@codexhost/cli-linux-arm64 0.23.0 → 0.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/app/codexhost-distribution.json +1 -1
- package/app/console-server.mjs +3968 -4082
- package/app/console-web.js +6822 -2065
- package/app/desktop-controller.mjs +13620 -2977
- package/app/host-runtime.mjs +12025 -12636
- package/app/plugins/antigravity/plugin.mjs +2382 -1452
- package/app/plugins/claude-code/plugin.mjs +2248 -1645
- package/app/plugins/codebuddy/plugin.mjs +1753 -1215
- package/app/plugins/codex-usage/plugin.mjs +1214 -915
- package/app/plugins/copilot/plugin.mjs +1239 -919
- package/app/plugins/cursor-cli/plugin.mjs +1549 -1099
- package/app/plugins/deepseek-harness/plugin.mjs +1955 -1484
- package/app/plugins/devin/plugin.mjs +1295 -978
- package/app/plugins/grok/plugin.mjs +1772 -1482
- package/app/plugins/hermes/plugin.mjs +1485 -1184
- package/app/plugins/kimi-code/plugin.mjs +1388 -1093
- package/app/plugins/kiro-cli/plugin.mjs +1349 -1036
- package/app/plugins/omp/plugin.mjs +2027 -1420
- package/app/plugins/opencode/plugin.mjs +2219 -1844
- package/app/plugins/pi/plugin.mjs +1956 -1606
- package/app/plugins/qoder/plugin.mjs +1536 -1229
- package/app/plugins/qoder-cn/plugin.mjs +1536 -1229
- package/app/plugins/qwen-code/plugin.mjs +1490 -1198
- package/app/plugins/workbuddy/plugin.mjs +1757 -1221
- package/app/plugins/zcode/plugin.mjs +1841 -1072
- package/app/renderer-extension.js +12894 -8392
- package/app/web/assets/index-CTCFIQbU.css +1 -0
- package/app/web/assets/index-DUOvhHbV.js +203 -0
- package/app/web/codexhost-settings.js +4811 -36168
- package/app/web/index.html +2 -2
- 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 +69 -69
- 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-approval/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 +75 -64
- package/app/web/plugins/deepseek-ai__dsh-client-ui-conversation/client.js +98 -95
- package/app/web/plugins/deepseek-ai__dsh-client-ui-input-trigger/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-layout/client.js +2 -2
- package/app/web/plugins/deepseek-ai__dsh-client-ui-model-selection/client.js +2 -2
- package/app/web/plugins/deepseek-ai__dsh-client-ui-settings-general/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-documentpreview/client.js +9 -9
- package/app/web/plugins/deepseek-ai__dsh-client-ui-sidebar-files/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-sidebar-right/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-theme/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-user-questions/client.js +3 -3
- package/app/web/plugins/deepseek-ai__dsh-client-ui-workspace/client.js +9 -9
- package/app/web/sw.js +8 -1
- package/app/web-modules/server.mjs +4752 -6790
- package/bin/codexhost +0 -0
- package/libexec/codexhost-shim +0 -0
- package/libexec/codexhost-updater +0 -0
- package/package.json +1 -1
- package/app/web/assets/index-DJW4bmyx.css +0 -1
- package/app/web/assets/index-Dyh1KzAB.js +0 -201
|
@@ -710,8 +710,8 @@ function cached(getter) {
|
|
|
710
710
|
}
|
|
711
711
|
};
|
|
712
712
|
}
|
|
713
|
-
function nullish(
|
|
714
|
-
return
|
|
713
|
+
function nullish(input2) {
|
|
714
|
+
return input2 === null || input2 === void 0;
|
|
715
715
|
}
|
|
716
716
|
function cleanRegex(source) {
|
|
717
717
|
const start = source.startsWith("^") ? 1 : 0;
|
|
@@ -798,8 +798,8 @@ function randomString(length = 10) {
|
|
|
798
798
|
function esc(str) {
|
|
799
799
|
return JSON.stringify(str);
|
|
800
800
|
}
|
|
801
|
-
function slugify(
|
|
802
|
-
return
|
|
801
|
+
function slugify(input2) {
|
|
802
|
+
return input2.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
|
|
803
803
|
}
|
|
804
804
|
var captureStackTrace = "captureStackTrace" in Error ? Error.captureStackTrace : (..._args) => {
|
|
805
805
|
};
|
|
@@ -1204,19 +1204,19 @@ function finalizeIssue(iss, ctx, config2) {
|
|
|
1204
1204
|
}
|
|
1205
1205
|
return rest;
|
|
1206
1206
|
}
|
|
1207
|
-
function getSizableOrigin(
|
|
1208
|
-
if (
|
|
1207
|
+
function getSizableOrigin(input2) {
|
|
1208
|
+
if (input2 instanceof Set)
|
|
1209
1209
|
return "set";
|
|
1210
|
-
if (
|
|
1210
|
+
if (input2 instanceof Map)
|
|
1211
1211
|
return "map";
|
|
1212
|
-
if (
|
|
1212
|
+
if (input2 instanceof File)
|
|
1213
1213
|
return "file";
|
|
1214
1214
|
return "unknown";
|
|
1215
1215
|
}
|
|
1216
|
-
function getLengthableOrigin(
|
|
1217
|
-
if (Array.isArray(
|
|
1216
|
+
function getLengthableOrigin(input2) {
|
|
1217
|
+
if (Array.isArray(input2))
|
|
1218
1218
|
return "array";
|
|
1219
|
-
if (typeof
|
|
1219
|
+
if (typeof input2 === "string")
|
|
1220
1220
|
return "string";
|
|
1221
1221
|
return "unknown";
|
|
1222
1222
|
}
|
|
@@ -1242,12 +1242,12 @@ function parsedType(data) {
|
|
|
1242
1242
|
return t;
|
|
1243
1243
|
}
|
|
1244
1244
|
function issue(...args) {
|
|
1245
|
-
const [iss,
|
|
1245
|
+
const [iss, input2, inst] = args;
|
|
1246
1246
|
if (typeof iss === "string") {
|
|
1247
1247
|
return {
|
|
1248
1248
|
message: iss,
|
|
1249
1249
|
code: "custom",
|
|
1250
|
-
input,
|
|
1250
|
+
input: input2,
|
|
1251
1251
|
inst
|
|
1252
1252
|
};
|
|
1253
1253
|
}
|
|
@@ -1258,8 +1258,8 @@ function cleanEnum(obj) {
|
|
|
1258
1258
|
return Number.isNaN(Number.parseInt(k, 10));
|
|
1259
1259
|
}).map((el) => el[1]);
|
|
1260
1260
|
}
|
|
1261
|
-
function base64ToUint8Array(
|
|
1262
|
-
const binaryString = atob(
|
|
1261
|
+
function base64ToUint8Array(base644) {
|
|
1262
|
+
const binaryString = atob(base644);
|
|
1263
1263
|
const bytes = new Uint8Array(binaryString.length);
|
|
1264
1264
|
for (let i = 0; i < binaryString.length; i++) {
|
|
1265
1265
|
bytes[i] = binaryString.charCodeAt(i);
|
|
@@ -1274,9 +1274,9 @@ function uint8ArrayToBase64(bytes) {
|
|
|
1274
1274
|
return btoa(binaryString);
|
|
1275
1275
|
}
|
|
1276
1276
|
function base64urlToUint8Array(base64url3) {
|
|
1277
|
-
const
|
|
1278
|
-
const padding = "=".repeat((4 -
|
|
1279
|
-
return base64ToUint8Array(
|
|
1277
|
+
const base644 = base64url3.replace(/-/g, "+").replace(/_/g, "/");
|
|
1278
|
+
const padding = "=".repeat((4 - base644.length % 4) % 4);
|
|
1279
|
+
return base64ToUint8Array(base644 + padding);
|
|
1280
1280
|
}
|
|
1281
1281
|
function uint8ArrayToBase64url(bytes) {
|
|
1282
1282
|
return uint8ArrayToBase64(bytes).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
|
|
@@ -1791,23 +1791,23 @@ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat"
|
|
|
1791
1791
|
bag.pattern = integer;
|
|
1792
1792
|
});
|
|
1793
1793
|
inst._zod.check = (payload) => {
|
|
1794
|
-
const
|
|
1794
|
+
const input2 = payload.value;
|
|
1795
1795
|
if (isInt) {
|
|
1796
|
-
if (!Number.isInteger(
|
|
1796
|
+
if (!Number.isInteger(input2)) {
|
|
1797
1797
|
payload.issues.push({
|
|
1798
1798
|
expected: origin,
|
|
1799
1799
|
format: def.format,
|
|
1800
1800
|
code: "invalid_type",
|
|
1801
1801
|
continue: false,
|
|
1802
|
-
input,
|
|
1802
|
+
input: input2,
|
|
1803
1803
|
inst
|
|
1804
1804
|
});
|
|
1805
1805
|
return;
|
|
1806
1806
|
}
|
|
1807
|
-
if (!Number.isSafeInteger(
|
|
1808
|
-
if (
|
|
1807
|
+
if (!Number.isSafeInteger(input2)) {
|
|
1808
|
+
if (input2 > 0) {
|
|
1809
1809
|
payload.issues.push({
|
|
1810
|
-
input,
|
|
1810
|
+
input: input2,
|
|
1811
1811
|
code: "too_big",
|
|
1812
1812
|
maximum: Number.MAX_SAFE_INTEGER,
|
|
1813
1813
|
note: "Integers must be within the safe integer range.",
|
|
@@ -1818,7 +1818,7 @@ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat"
|
|
|
1818
1818
|
});
|
|
1819
1819
|
} else {
|
|
1820
1820
|
payload.issues.push({
|
|
1821
|
-
input,
|
|
1821
|
+
input: input2,
|
|
1822
1822
|
code: "too_small",
|
|
1823
1823
|
minimum: Number.MIN_SAFE_INTEGER,
|
|
1824
1824
|
note: "Integers must be within the safe integer range.",
|
|
@@ -1831,10 +1831,10 @@ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat"
|
|
|
1831
1831
|
return;
|
|
1832
1832
|
}
|
|
1833
1833
|
}
|
|
1834
|
-
if (
|
|
1834
|
+
if (input2 < minimum) {
|
|
1835
1835
|
payload.issues.push({
|
|
1836
1836
|
origin: "number",
|
|
1837
|
-
input,
|
|
1837
|
+
input: input2,
|
|
1838
1838
|
code: "too_small",
|
|
1839
1839
|
minimum,
|
|
1840
1840
|
inclusive: true,
|
|
@@ -1842,10 +1842,10 @@ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat"
|
|
|
1842
1842
|
continue: !def.abort
|
|
1843
1843
|
});
|
|
1844
1844
|
}
|
|
1845
|
-
if (
|
|
1845
|
+
if (input2 > maximum) {
|
|
1846
1846
|
payload.issues.push({
|
|
1847
1847
|
origin: "number",
|
|
1848
|
-
input,
|
|
1848
|
+
input: input2,
|
|
1849
1849
|
code: "too_big",
|
|
1850
1850
|
maximum,
|
|
1851
1851
|
inclusive: true,
|
|
@@ -1865,11 +1865,11 @@ var $ZodCheckBigIntFormat = /* @__PURE__ */ $constructor("$ZodCheckBigIntFormat"
|
|
|
1865
1865
|
bag.maximum = maximum;
|
|
1866
1866
|
});
|
|
1867
1867
|
inst._zod.check = (payload) => {
|
|
1868
|
-
const
|
|
1869
|
-
if (
|
|
1868
|
+
const input2 = payload.value;
|
|
1869
|
+
if (input2 < minimum) {
|
|
1870
1870
|
payload.issues.push({
|
|
1871
1871
|
origin: "bigint",
|
|
1872
|
-
input,
|
|
1872
|
+
input: input2,
|
|
1873
1873
|
code: "too_small",
|
|
1874
1874
|
minimum,
|
|
1875
1875
|
inclusive: true,
|
|
@@ -1877,10 +1877,10 @@ var $ZodCheckBigIntFormat = /* @__PURE__ */ $constructor("$ZodCheckBigIntFormat"
|
|
|
1877
1877
|
continue: !def.abort
|
|
1878
1878
|
});
|
|
1879
1879
|
}
|
|
1880
|
-
if (
|
|
1880
|
+
if (input2 > maximum) {
|
|
1881
1881
|
payload.issues.push({
|
|
1882
1882
|
origin: "bigint",
|
|
1883
|
-
input,
|
|
1883
|
+
input: input2,
|
|
1884
1884
|
code: "too_big",
|
|
1885
1885
|
maximum,
|
|
1886
1886
|
inclusive: true,
|
|
@@ -1903,16 +1903,16 @@ var $ZodCheckMaxSize = /* @__PURE__ */ $constructor("$ZodCheckMaxSize", (inst, d
|
|
|
1903
1903
|
inst2._zod.bag.maximum = def.maximum;
|
|
1904
1904
|
});
|
|
1905
1905
|
inst._zod.check = (payload) => {
|
|
1906
|
-
const
|
|
1907
|
-
const size =
|
|
1906
|
+
const input2 = payload.value;
|
|
1907
|
+
const size = input2.size;
|
|
1908
1908
|
if (size <= def.maximum)
|
|
1909
1909
|
return;
|
|
1910
1910
|
payload.issues.push({
|
|
1911
|
-
origin: getSizableOrigin(
|
|
1911
|
+
origin: getSizableOrigin(input2),
|
|
1912
1912
|
code: "too_big",
|
|
1913
1913
|
maximum: def.maximum,
|
|
1914
1914
|
inclusive: true,
|
|
1915
|
-
input,
|
|
1915
|
+
input: input2,
|
|
1916
1916
|
inst,
|
|
1917
1917
|
continue: !def.abort
|
|
1918
1918
|
});
|
|
@@ -1931,16 +1931,16 @@ var $ZodCheckMinSize = /* @__PURE__ */ $constructor("$ZodCheckMinSize", (inst, d
|
|
|
1931
1931
|
inst2._zod.bag.minimum = def.minimum;
|
|
1932
1932
|
});
|
|
1933
1933
|
inst._zod.check = (payload) => {
|
|
1934
|
-
const
|
|
1935
|
-
const size =
|
|
1934
|
+
const input2 = payload.value;
|
|
1935
|
+
const size = input2.size;
|
|
1936
1936
|
if (size >= def.minimum)
|
|
1937
1937
|
return;
|
|
1938
1938
|
payload.issues.push({
|
|
1939
|
-
origin: getSizableOrigin(
|
|
1939
|
+
origin: getSizableOrigin(input2),
|
|
1940
1940
|
code: "too_small",
|
|
1941
1941
|
minimum: def.minimum,
|
|
1942
1942
|
inclusive: true,
|
|
1943
|
-
input,
|
|
1943
|
+
input: input2,
|
|
1944
1944
|
inst,
|
|
1945
1945
|
continue: !def.abort
|
|
1946
1946
|
});
|
|
@@ -1960,13 +1960,13 @@ var $ZodCheckSizeEquals = /* @__PURE__ */ $constructor("$ZodCheckSizeEquals", (i
|
|
|
1960
1960
|
bag.size = def.size;
|
|
1961
1961
|
});
|
|
1962
1962
|
inst._zod.check = (payload) => {
|
|
1963
|
-
const
|
|
1964
|
-
const size =
|
|
1963
|
+
const input2 = payload.value;
|
|
1964
|
+
const size = input2.size;
|
|
1965
1965
|
if (size === def.size)
|
|
1966
1966
|
return;
|
|
1967
1967
|
const tooBig = size > def.size;
|
|
1968
1968
|
payload.issues.push({
|
|
1969
|
-
origin: getSizableOrigin(
|
|
1969
|
+
origin: getSizableOrigin(input2),
|
|
1970
1970
|
...tooBig ? { code: "too_big", maximum: def.size } : { code: "too_small", minimum: def.size },
|
|
1971
1971
|
inclusive: true,
|
|
1972
1972
|
exact: true,
|
|
@@ -1989,17 +1989,17 @@ var $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (ins
|
|
|
1989
1989
|
inst2._zod.bag.maximum = def.maximum;
|
|
1990
1990
|
});
|
|
1991
1991
|
inst._zod.check = (payload) => {
|
|
1992
|
-
const
|
|
1993
|
-
const length =
|
|
1992
|
+
const input2 = payload.value;
|
|
1993
|
+
const length = input2.length;
|
|
1994
1994
|
if (length <= def.maximum)
|
|
1995
1995
|
return;
|
|
1996
|
-
const origin = getLengthableOrigin(
|
|
1996
|
+
const origin = getLengthableOrigin(input2);
|
|
1997
1997
|
payload.issues.push({
|
|
1998
1998
|
origin,
|
|
1999
1999
|
code: "too_big",
|
|
2000
2000
|
maximum: def.maximum,
|
|
2001
2001
|
inclusive: true,
|
|
2002
|
-
input,
|
|
2002
|
+
input: input2,
|
|
2003
2003
|
inst,
|
|
2004
2004
|
continue: !def.abort
|
|
2005
2005
|
});
|
|
@@ -2018,17 +2018,17 @@ var $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (ins
|
|
|
2018
2018
|
inst2._zod.bag.minimum = def.minimum;
|
|
2019
2019
|
});
|
|
2020
2020
|
inst._zod.check = (payload) => {
|
|
2021
|
-
const
|
|
2022
|
-
const length =
|
|
2021
|
+
const input2 = payload.value;
|
|
2022
|
+
const length = input2.length;
|
|
2023
2023
|
if (length >= def.minimum)
|
|
2024
2024
|
return;
|
|
2025
|
-
const origin = getLengthableOrigin(
|
|
2025
|
+
const origin = getLengthableOrigin(input2);
|
|
2026
2026
|
payload.issues.push({
|
|
2027
2027
|
origin,
|
|
2028
2028
|
code: "too_small",
|
|
2029
2029
|
minimum: def.minimum,
|
|
2030
2030
|
inclusive: true,
|
|
2031
|
-
input,
|
|
2031
|
+
input: input2,
|
|
2032
2032
|
inst,
|
|
2033
2033
|
continue: !def.abort
|
|
2034
2034
|
});
|
|
@@ -2048,11 +2048,11 @@ var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals"
|
|
|
2048
2048
|
bag.length = def.length;
|
|
2049
2049
|
});
|
|
2050
2050
|
inst._zod.check = (payload) => {
|
|
2051
|
-
const
|
|
2052
|
-
const length =
|
|
2051
|
+
const input2 = payload.value;
|
|
2052
|
+
const length = input2.length;
|
|
2053
2053
|
if (length === def.length)
|
|
2054
2054
|
return;
|
|
2055
|
-
const origin = getLengthableOrigin(
|
|
2055
|
+
const origin = getLengthableOrigin(input2);
|
|
2056
2056
|
const tooBig = length > def.length;
|
|
2057
2057
|
payload.issues.push({
|
|
2058
2058
|
origin,
|
|
@@ -2642,8 +2642,8 @@ var $ZodBase64 = /* @__PURE__ */ $constructor("$ZodBase64", (inst, def) => {
|
|
|
2642
2642
|
function isValidBase64URL(data) {
|
|
2643
2643
|
if (!base64url.test(data))
|
|
2644
2644
|
return false;
|
|
2645
|
-
const
|
|
2646
|
-
const padded =
|
|
2645
|
+
const base644 = data.replace(/[-_]/g, (c) => c === "-" ? "+" : "/");
|
|
2646
|
+
const padded = base644.padEnd(Math.ceil(base644.length / 4) * 4, "=");
|
|
2647
2647
|
return isValidBase64(padded);
|
|
2648
2648
|
}
|
|
2649
2649
|
var $ZodBase64URL = /* @__PURE__ */ $constructor("$ZodBase64URL", (inst, def) => {
|
|
@@ -2723,15 +2723,15 @@ var $ZodNumber = /* @__PURE__ */ $constructor("$ZodNumber", (inst, def) => {
|
|
|
2723
2723
|
payload.value = Number(payload.value);
|
|
2724
2724
|
} catch (_) {
|
|
2725
2725
|
}
|
|
2726
|
-
const
|
|
2727
|
-
if (typeof
|
|
2726
|
+
const input2 = payload.value;
|
|
2727
|
+
if (typeof input2 === "number" && !Number.isNaN(input2) && Number.isFinite(input2)) {
|
|
2728
2728
|
return payload;
|
|
2729
2729
|
}
|
|
2730
|
-
const received = typeof
|
|
2730
|
+
const received = typeof input2 === "number" ? Number.isNaN(input2) ? "NaN" : !Number.isFinite(input2) ? "Infinity" : void 0 : void 0;
|
|
2731
2731
|
payload.issues.push({
|
|
2732
2732
|
expected: "number",
|
|
2733
2733
|
code: "invalid_type",
|
|
2734
|
-
input,
|
|
2734
|
+
input: input2,
|
|
2735
2735
|
inst,
|
|
2736
2736
|
...received ? { received } : {}
|
|
2737
2737
|
});
|
|
@@ -2751,13 +2751,13 @@ var $ZodBoolean = /* @__PURE__ */ $constructor("$ZodBoolean", (inst, def) => {
|
|
|
2751
2751
|
payload.value = Boolean(payload.value);
|
|
2752
2752
|
} catch (_) {
|
|
2753
2753
|
}
|
|
2754
|
-
const
|
|
2755
|
-
if (typeof
|
|
2754
|
+
const input2 = payload.value;
|
|
2755
|
+
if (typeof input2 === "boolean")
|
|
2756
2756
|
return payload;
|
|
2757
2757
|
payload.issues.push({
|
|
2758
2758
|
expected: "boolean",
|
|
2759
2759
|
code: "invalid_type",
|
|
2760
|
-
input,
|
|
2760
|
+
input: input2,
|
|
2761
2761
|
inst
|
|
2762
2762
|
});
|
|
2763
2763
|
return payload;
|
|
@@ -2790,13 +2790,13 @@ var $ZodBigIntFormat = /* @__PURE__ */ $constructor("$ZodBigIntFormat", (inst, d
|
|
|
2790
2790
|
var $ZodSymbol = /* @__PURE__ */ $constructor("$ZodSymbol", (inst, def) => {
|
|
2791
2791
|
$ZodType.init(inst, def);
|
|
2792
2792
|
inst._zod.parse = (payload, _ctx) => {
|
|
2793
|
-
const
|
|
2794
|
-
if (typeof
|
|
2793
|
+
const input2 = payload.value;
|
|
2794
|
+
if (typeof input2 === "symbol")
|
|
2795
2795
|
return payload;
|
|
2796
2796
|
payload.issues.push({
|
|
2797
2797
|
expected: "symbol",
|
|
2798
2798
|
code: "invalid_type",
|
|
2799
|
-
input,
|
|
2799
|
+
input: input2,
|
|
2800
2800
|
inst
|
|
2801
2801
|
});
|
|
2802
2802
|
return payload;
|
|
@@ -2807,13 +2807,13 @@ var $ZodUndefined = /* @__PURE__ */ $constructor("$ZodUndefined", (inst, def) =>
|
|
|
2807
2807
|
inst._zod.pattern = _undefined;
|
|
2808
2808
|
inst._zod.values = /* @__PURE__ */ new Set([void 0]);
|
|
2809
2809
|
inst._zod.parse = (payload, _ctx) => {
|
|
2810
|
-
const
|
|
2811
|
-
if (typeof
|
|
2810
|
+
const input2 = payload.value;
|
|
2811
|
+
if (typeof input2 === "undefined")
|
|
2812
2812
|
return payload;
|
|
2813
2813
|
payload.issues.push({
|
|
2814
2814
|
expected: "undefined",
|
|
2815
2815
|
code: "invalid_type",
|
|
2816
|
-
input,
|
|
2816
|
+
input: input2,
|
|
2817
2817
|
inst
|
|
2818
2818
|
});
|
|
2819
2819
|
return payload;
|
|
@@ -2824,13 +2824,13 @@ var $ZodNull = /* @__PURE__ */ $constructor("$ZodNull", (inst, def) => {
|
|
|
2824
2824
|
inst._zod.pattern = _null;
|
|
2825
2825
|
inst._zod.values = /* @__PURE__ */ new Set([null]);
|
|
2826
2826
|
inst._zod.parse = (payload, _ctx) => {
|
|
2827
|
-
const
|
|
2828
|
-
if (
|
|
2827
|
+
const input2 = payload.value;
|
|
2828
|
+
if (input2 === null)
|
|
2829
2829
|
return payload;
|
|
2830
2830
|
payload.issues.push({
|
|
2831
2831
|
expected: "null",
|
|
2832
2832
|
code: "invalid_type",
|
|
2833
|
-
input,
|
|
2833
|
+
input: input2,
|
|
2834
2834
|
inst
|
|
2835
2835
|
});
|
|
2836
2836
|
return payload;
|
|
@@ -2859,13 +2859,13 @@ var $ZodNever = /* @__PURE__ */ $constructor("$ZodNever", (inst, def) => {
|
|
|
2859
2859
|
var $ZodVoid = /* @__PURE__ */ $constructor("$ZodVoid", (inst, def) => {
|
|
2860
2860
|
$ZodType.init(inst, def);
|
|
2861
2861
|
inst._zod.parse = (payload, _ctx) => {
|
|
2862
|
-
const
|
|
2863
|
-
if (typeof
|
|
2862
|
+
const input2 = payload.value;
|
|
2863
|
+
if (typeof input2 === "undefined")
|
|
2864
2864
|
return payload;
|
|
2865
2865
|
payload.issues.push({
|
|
2866
2866
|
expected: "void",
|
|
2867
2867
|
code: "invalid_type",
|
|
2868
|
-
input,
|
|
2868
|
+
input: input2,
|
|
2869
2869
|
inst
|
|
2870
2870
|
});
|
|
2871
2871
|
return payload;
|
|
@@ -2880,15 +2880,15 @@ var $ZodDate = /* @__PURE__ */ $constructor("$ZodDate", (inst, def) => {
|
|
|
2880
2880
|
} catch (_err) {
|
|
2881
2881
|
}
|
|
2882
2882
|
}
|
|
2883
|
-
const
|
|
2884
|
-
const isDate =
|
|
2885
|
-
const isValidDate = isDate && !Number.isNaN(
|
|
2883
|
+
const input2 = payload.value;
|
|
2884
|
+
const isDate = input2 instanceof Date;
|
|
2885
|
+
const isValidDate = isDate && !Number.isNaN(input2.getTime());
|
|
2886
2886
|
if (isValidDate)
|
|
2887
2887
|
return payload;
|
|
2888
2888
|
payload.issues.push({
|
|
2889
2889
|
expected: "date",
|
|
2890
2890
|
code: "invalid_type",
|
|
2891
|
-
input,
|
|
2891
|
+
input: input2,
|
|
2892
2892
|
...isDate ? { received: "Invalid Date" } : {},
|
|
2893
2893
|
inst
|
|
2894
2894
|
});
|
|
@@ -2904,20 +2904,20 @@ function handleArrayResult(result, final, index) {
|
|
|
2904
2904
|
var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
|
|
2905
2905
|
$ZodType.init(inst, def);
|
|
2906
2906
|
inst._zod.parse = (payload, ctx) => {
|
|
2907
|
-
const
|
|
2908
|
-
if (!Array.isArray(
|
|
2907
|
+
const input2 = payload.value;
|
|
2908
|
+
if (!Array.isArray(input2)) {
|
|
2909
2909
|
payload.issues.push({
|
|
2910
2910
|
expected: "array",
|
|
2911
2911
|
code: "invalid_type",
|
|
2912
|
-
input,
|
|
2912
|
+
input: input2,
|
|
2913
2913
|
inst
|
|
2914
2914
|
});
|
|
2915
2915
|
return payload;
|
|
2916
2916
|
}
|
|
2917
|
-
payload.value = Array(
|
|
2917
|
+
payload.value = Array(input2.length);
|
|
2918
2918
|
const proms = [];
|
|
2919
|
-
for (let i = 0; i <
|
|
2920
|
-
const item =
|
|
2919
|
+
for (let i = 0; i < input2.length; i++) {
|
|
2920
|
+
const item = input2[i];
|
|
2921
2921
|
const result = def.element._zod.run({
|
|
2922
2922
|
value: item,
|
|
2923
2923
|
issues: []
|
|
@@ -2934,8 +2934,8 @@ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
|
|
|
2934
2934
|
return payload;
|
|
2935
2935
|
};
|
|
2936
2936
|
});
|
|
2937
|
-
function handlePropertyResult(result, final, key2,
|
|
2938
|
-
const isPresent = key2 in
|
|
2937
|
+
function handlePropertyResult(result, final, key2, input2, isOptionalIn, isOptionalOut) {
|
|
2938
|
+
const isPresent = key2 in input2;
|
|
2939
2939
|
if (result.issues.length) {
|
|
2940
2940
|
if (isOptionalIn && isOptionalOut && !isPresent) {
|
|
2941
2941
|
return;
|
|
@@ -2977,14 +2977,14 @@ function normalizeDef(def) {
|
|
|
2977
2977
|
optionalKeys: new Set(okeys)
|
|
2978
2978
|
};
|
|
2979
2979
|
}
|
|
2980
|
-
function handleCatchall(proms,
|
|
2980
|
+
function handleCatchall(proms, input2, payload, ctx, def, inst) {
|
|
2981
2981
|
const unrecognized = [];
|
|
2982
2982
|
const keySet = def.keySet;
|
|
2983
2983
|
const _catchall = def.catchall._zod;
|
|
2984
2984
|
const t = _catchall.def.type;
|
|
2985
2985
|
const isOptionalIn = _catchall.optin === "optional";
|
|
2986
2986
|
const isOptionalOut = _catchall.optout === "optional";
|
|
2987
|
-
for (const key2 in
|
|
2987
|
+
for (const key2 in input2) {
|
|
2988
2988
|
if (key2 === "__proto__")
|
|
2989
2989
|
continue;
|
|
2990
2990
|
if (keySet.has(key2))
|
|
@@ -2993,18 +2993,18 @@ function handleCatchall(proms, input, payload, ctx, def, inst) {
|
|
|
2993
2993
|
unrecognized.push(key2);
|
|
2994
2994
|
continue;
|
|
2995
2995
|
}
|
|
2996
|
-
const r = _catchall.run({ value:
|
|
2996
|
+
const r = _catchall.run({ value: input2[key2], issues: [] }, ctx);
|
|
2997
2997
|
if (r instanceof Promise) {
|
|
2998
|
-
proms.push(r.then((r2) => handlePropertyResult(r2, payload, key2,
|
|
2998
|
+
proms.push(r.then((r2) => handlePropertyResult(r2, payload, key2, input2, isOptionalIn, isOptionalOut)));
|
|
2999
2999
|
} else {
|
|
3000
|
-
handlePropertyResult(r, payload, key2,
|
|
3000
|
+
handlePropertyResult(r, payload, key2, input2, isOptionalIn, isOptionalOut);
|
|
3001
3001
|
}
|
|
3002
3002
|
}
|
|
3003
3003
|
if (unrecognized.length) {
|
|
3004
3004
|
payload.issues.push({
|
|
3005
3005
|
code: "unrecognized_keys",
|
|
3006
3006
|
keys: unrecognized,
|
|
3007
|
-
input,
|
|
3007
|
+
input: input2,
|
|
3008
3008
|
inst
|
|
3009
3009
|
});
|
|
3010
3010
|
}
|
|
@@ -3048,12 +3048,12 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
3048
3048
|
let value;
|
|
3049
3049
|
inst._zod.parse = (payload, ctx) => {
|
|
3050
3050
|
value ?? (value = _normalized.value);
|
|
3051
|
-
const
|
|
3052
|
-
if (!isObject2(
|
|
3051
|
+
const input2 = payload.value;
|
|
3052
|
+
if (!isObject2(input2)) {
|
|
3053
3053
|
payload.issues.push({
|
|
3054
3054
|
expected: "object",
|
|
3055
3055
|
code: "invalid_type",
|
|
3056
|
-
input,
|
|
3056
|
+
input: input2,
|
|
3057
3057
|
inst
|
|
3058
3058
|
});
|
|
3059
3059
|
return payload;
|
|
@@ -3065,17 +3065,17 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
3065
3065
|
const el = shape[key2];
|
|
3066
3066
|
const isOptionalIn = el._zod.optin === "optional";
|
|
3067
3067
|
const isOptionalOut = el._zod.optout === "optional";
|
|
3068
|
-
const r = el._zod.run({ value:
|
|
3068
|
+
const r = el._zod.run({ value: input2[key2], issues: [] }, ctx);
|
|
3069
3069
|
if (r instanceof Promise) {
|
|
3070
|
-
proms.push(r.then((r2) => handlePropertyResult(r2, payload, key2,
|
|
3070
|
+
proms.push(r.then((r2) => handlePropertyResult(r2, payload, key2, input2, isOptionalIn, isOptionalOut)));
|
|
3071
3071
|
} else {
|
|
3072
|
-
handlePropertyResult(r, payload, key2,
|
|
3072
|
+
handlePropertyResult(r, payload, key2, input2, isOptionalIn, isOptionalOut);
|
|
3073
3073
|
}
|
|
3074
3074
|
}
|
|
3075
3075
|
if (!catchall) {
|
|
3076
3076
|
return proms.length ? Promise.all(proms).then(() => payload) : payload;
|
|
3077
3077
|
}
|
|
3078
|
-
return handleCatchall(proms,
|
|
3078
|
+
return handleCatchall(proms, input2, payload, ctx, _normalized.value, inst);
|
|
3079
3079
|
};
|
|
3080
3080
|
});
|
|
3081
3081
|
var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) => {
|
|
@@ -3097,42 +3097,42 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
3097
3097
|
}
|
|
3098
3098
|
doc.write(`const newResult = {};`);
|
|
3099
3099
|
for (const key2 of normalized.keys) {
|
|
3100
|
-
const
|
|
3100
|
+
const id2 = ids[key2];
|
|
3101
3101
|
const k = esc(key2);
|
|
3102
3102
|
const schema = shape[key2];
|
|
3103
3103
|
const isOptionalIn = schema?._zod?.optin === "optional";
|
|
3104
3104
|
const isOptionalOut = schema?._zod?.optout === "optional";
|
|
3105
|
-
doc.write(`const ${
|
|
3105
|
+
doc.write(`const ${id2} = ${parseStr(key2)};`);
|
|
3106
3106
|
if (isOptionalIn && isOptionalOut) {
|
|
3107
3107
|
doc.write(`
|
|
3108
|
-
if (${
|
|
3108
|
+
if (${id2}.issues.length) {
|
|
3109
3109
|
if (${k} in input) {
|
|
3110
|
-
payload.issues = payload.issues.concat(${
|
|
3110
|
+
payload.issues = payload.issues.concat(${id2}.issues.map(iss => ({
|
|
3111
3111
|
...iss,
|
|
3112
3112
|
path: iss.path ? [${k}, ...iss.path] : [${k}]
|
|
3113
3113
|
})));
|
|
3114
3114
|
}
|
|
3115
3115
|
}
|
|
3116
3116
|
|
|
3117
|
-
if (${
|
|
3117
|
+
if (${id2}.value === undefined) {
|
|
3118
3118
|
if (${k} in input) {
|
|
3119
3119
|
newResult[${k}] = undefined;
|
|
3120
3120
|
}
|
|
3121
3121
|
} else {
|
|
3122
|
-
newResult[${k}] = ${
|
|
3122
|
+
newResult[${k}] = ${id2}.value;
|
|
3123
3123
|
}
|
|
3124
3124
|
|
|
3125
3125
|
`);
|
|
3126
3126
|
} else if (!isOptionalIn) {
|
|
3127
3127
|
doc.write(`
|
|
3128
|
-
const ${
|
|
3129
|
-
if (${
|
|
3130
|
-
payload.issues = payload.issues.concat(${
|
|
3128
|
+
const ${id2}_present = ${k} in input;
|
|
3129
|
+
if (${id2}.issues.length) {
|
|
3130
|
+
payload.issues = payload.issues.concat(${id2}.issues.map(iss => ({
|
|
3131
3131
|
...iss,
|
|
3132
3132
|
path: iss.path ? [${k}, ...iss.path] : [${k}]
|
|
3133
3133
|
})));
|
|
3134
3134
|
}
|
|
3135
|
-
if (!${
|
|
3135
|
+
if (!${id2}_present && !${id2}.issues.length) {
|
|
3136
3136
|
payload.issues.push({
|
|
3137
3137
|
code: "invalid_type",
|
|
3138
3138
|
expected: "nonoptional",
|
|
@@ -3141,30 +3141,30 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
3141
3141
|
});
|
|
3142
3142
|
}
|
|
3143
3143
|
|
|
3144
|
-
if (${
|
|
3145
|
-
if (${
|
|
3144
|
+
if (${id2}_present) {
|
|
3145
|
+
if (${id2}.value === undefined) {
|
|
3146
3146
|
newResult[${k}] = undefined;
|
|
3147
3147
|
} else {
|
|
3148
|
-
newResult[${k}] = ${
|
|
3148
|
+
newResult[${k}] = ${id2}.value;
|
|
3149
3149
|
}
|
|
3150
3150
|
}
|
|
3151
3151
|
|
|
3152
3152
|
`);
|
|
3153
3153
|
} else {
|
|
3154
3154
|
doc.write(`
|
|
3155
|
-
if (${
|
|
3156
|
-
payload.issues = payload.issues.concat(${
|
|
3155
|
+
if (${id2}.issues.length) {
|
|
3156
|
+
payload.issues = payload.issues.concat(${id2}.issues.map(iss => ({
|
|
3157
3157
|
...iss,
|
|
3158
3158
|
path: iss.path ? [${k}, ...iss.path] : [${k}]
|
|
3159
3159
|
})));
|
|
3160
3160
|
}
|
|
3161
3161
|
|
|
3162
|
-
if (${
|
|
3162
|
+
if (${id2}.value === undefined) {
|
|
3163
3163
|
if (${k} in input) {
|
|
3164
3164
|
newResult[${k}] = undefined;
|
|
3165
3165
|
}
|
|
3166
3166
|
} else {
|
|
3167
|
-
newResult[${k}] = ${
|
|
3167
|
+
newResult[${k}] = ${id2}.value;
|
|
3168
3168
|
}
|
|
3169
3169
|
|
|
3170
3170
|
`);
|
|
@@ -3184,12 +3184,12 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
3184
3184
|
let value;
|
|
3185
3185
|
inst._zod.parse = (payload, ctx) => {
|
|
3186
3186
|
value ?? (value = _normalized.value);
|
|
3187
|
-
const
|
|
3188
|
-
if (!isObject2(
|
|
3187
|
+
const input2 = payload.value;
|
|
3188
|
+
if (!isObject2(input2)) {
|
|
3189
3189
|
payload.issues.push({
|
|
3190
3190
|
expected: "object",
|
|
3191
3191
|
code: "invalid_type",
|
|
3192
|
-
input,
|
|
3192
|
+
input: input2,
|
|
3193
3193
|
inst
|
|
3194
3194
|
});
|
|
3195
3195
|
return payload;
|
|
@@ -3200,7 +3200,7 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
3200
3200
|
payload = fastpass(payload, ctx);
|
|
3201
3201
|
if (!catchall)
|
|
3202
3202
|
return payload;
|
|
3203
|
-
return handleCatchall([],
|
|
3203
|
+
return handleCatchall([], input2, payload, ctx, value, inst);
|
|
3204
3204
|
}
|
|
3205
3205
|
return superParse(payload, ctx);
|
|
3206
3206
|
};
|
|
@@ -3360,17 +3360,17 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
|
|
|
3360
3360
|
return map2;
|
|
3361
3361
|
});
|
|
3362
3362
|
inst._zod.parse = (payload, ctx) => {
|
|
3363
|
-
const
|
|
3364
|
-
if (!isObject(
|
|
3363
|
+
const input2 = payload.value;
|
|
3364
|
+
if (!isObject(input2)) {
|
|
3365
3365
|
payload.issues.push({
|
|
3366
3366
|
code: "invalid_type",
|
|
3367
3367
|
expected: "object",
|
|
3368
|
-
input,
|
|
3368
|
+
input: input2,
|
|
3369
3369
|
inst
|
|
3370
3370
|
});
|
|
3371
3371
|
return payload;
|
|
3372
3372
|
}
|
|
3373
|
-
const opt = disc.value.get(
|
|
3373
|
+
const opt = disc.value.get(input2?.[def.discriminator]);
|
|
3374
3374
|
if (opt) {
|
|
3375
3375
|
return opt._zod.run(payload, ctx);
|
|
3376
3376
|
}
|
|
@@ -3383,7 +3383,7 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
|
|
|
3383
3383
|
note: "No matching discriminator",
|
|
3384
3384
|
discriminator: def.discriminator,
|
|
3385
3385
|
options: Array.from(disc.value.keys()),
|
|
3386
|
-
input,
|
|
3386
|
+
input: input2,
|
|
3387
3387
|
path: [def.discriminator],
|
|
3388
3388
|
inst
|
|
3389
3389
|
});
|
|
@@ -3393,9 +3393,9 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
|
|
|
3393
3393
|
var $ZodIntersection = /* @__PURE__ */ $constructor("$ZodIntersection", (inst, def) => {
|
|
3394
3394
|
$ZodType.init(inst, def);
|
|
3395
3395
|
inst._zod.parse = (payload, ctx) => {
|
|
3396
|
-
const
|
|
3397
|
-
const left = def.left._zod.run({ value:
|
|
3398
|
-
const right = def.right._zod.run({ value:
|
|
3396
|
+
const input2 = payload.value;
|
|
3397
|
+
const left = def.left._zod.run({ value: input2, issues: [] }, ctx);
|
|
3398
|
+
const right = def.right._zod.run({ value: input2, issues: [] }, ctx);
|
|
3399
3399
|
const async = left instanceof Promise || right instanceof Promise;
|
|
3400
3400
|
if (async) {
|
|
3401
3401
|
return Promise.all([left, right]).then(([left2, right2]) => {
|
|
@@ -3492,10 +3492,10 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
|
|
|
3492
3492
|
$ZodType.init(inst, def);
|
|
3493
3493
|
const items = def.items;
|
|
3494
3494
|
inst._zod.parse = (payload, ctx) => {
|
|
3495
|
-
const
|
|
3496
|
-
if (!Array.isArray(
|
|
3495
|
+
const input2 = payload.value;
|
|
3496
|
+
if (!Array.isArray(input2)) {
|
|
3497
3497
|
payload.issues.push({
|
|
3498
|
-
input,
|
|
3498
|
+
input: input2,
|
|
3499
3499
|
inst,
|
|
3500
3500
|
expected: "tuple",
|
|
3501
3501
|
code: "invalid_type"
|
|
@@ -3507,23 +3507,23 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
|
|
|
3507
3507
|
const optinStart = getTupleOptStart(items, "optin");
|
|
3508
3508
|
const optoutStart = getTupleOptStart(items, "optout");
|
|
3509
3509
|
if (!def.rest) {
|
|
3510
|
-
if (
|
|
3510
|
+
if (input2.length < optinStart) {
|
|
3511
3511
|
payload.issues.push({
|
|
3512
3512
|
code: "too_small",
|
|
3513
3513
|
minimum: optinStart,
|
|
3514
3514
|
inclusive: true,
|
|
3515
|
-
input,
|
|
3515
|
+
input: input2,
|
|
3516
3516
|
inst,
|
|
3517
3517
|
origin: "array"
|
|
3518
3518
|
});
|
|
3519
3519
|
return payload;
|
|
3520
3520
|
}
|
|
3521
|
-
if (
|
|
3521
|
+
if (input2.length > items.length) {
|
|
3522
3522
|
payload.issues.push({
|
|
3523
3523
|
code: "too_big",
|
|
3524
3524
|
maximum: items.length,
|
|
3525
3525
|
inclusive: true,
|
|
3526
|
-
input,
|
|
3526
|
+
input: input2,
|
|
3527
3527
|
inst,
|
|
3528
3528
|
origin: "array"
|
|
3529
3529
|
});
|
|
@@ -3531,7 +3531,7 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
|
|
|
3531
3531
|
}
|
|
3532
3532
|
const itemResults = new Array(items.length);
|
|
3533
3533
|
for (let i = 0; i < items.length; i++) {
|
|
3534
|
-
const r = items[i]._zod.run({ value:
|
|
3534
|
+
const r = items[i]._zod.run({ value: input2[i], issues: [] }, ctx);
|
|
3535
3535
|
if (r instanceof Promise) {
|
|
3536
3536
|
proms.push(r.then((rr) => {
|
|
3537
3537
|
itemResults[i] = rr;
|
|
@@ -3542,7 +3542,7 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
|
|
|
3542
3542
|
}
|
|
3543
3543
|
if (def.rest) {
|
|
3544
3544
|
let i = items.length - 1;
|
|
3545
|
-
const rest =
|
|
3545
|
+
const rest = input2.slice(items.length);
|
|
3546
3546
|
for (const el of rest) {
|
|
3547
3547
|
i++;
|
|
3548
3548
|
const result = def.rest._zod.run({ value: el, issues: [] }, ctx);
|
|
@@ -3554,9 +3554,9 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
|
|
|
3554
3554
|
}
|
|
3555
3555
|
}
|
|
3556
3556
|
if (proms.length) {
|
|
3557
|
-
return Promise.all(proms).then(() => handleTupleResults(itemResults, payload, items,
|
|
3557
|
+
return Promise.all(proms).then(() => handleTupleResults(itemResults, payload, items, input2, optoutStart));
|
|
3558
3558
|
}
|
|
3559
|
-
return handleTupleResults(itemResults, payload, items,
|
|
3559
|
+
return handleTupleResults(itemResults, payload, items, input2, optoutStart);
|
|
3560
3560
|
};
|
|
3561
3561
|
});
|
|
3562
3562
|
function getTupleOptStart(items, key2) {
|
|
@@ -3572,10 +3572,10 @@ function handleTupleResult(result, final, index) {
|
|
|
3572
3572
|
}
|
|
3573
3573
|
final.value[index] = result.value;
|
|
3574
3574
|
}
|
|
3575
|
-
function handleTupleResults(itemResults, final, items,
|
|
3575
|
+
function handleTupleResults(itemResults, final, items, input2, optoutStart) {
|
|
3576
3576
|
for (let i = 0; i < items.length; i++) {
|
|
3577
3577
|
const r = itemResults[i];
|
|
3578
|
-
const isPresent = i <
|
|
3578
|
+
const isPresent = i < input2.length;
|
|
3579
3579
|
if (r.issues.length) {
|
|
3580
3580
|
if (!isPresent && i >= optoutStart) {
|
|
3581
3581
|
final.value.length = i;
|
|
@@ -3585,7 +3585,7 @@ function handleTupleResults(itemResults, final, items, input, optoutStart) {
|
|
|
3585
3585
|
}
|
|
3586
3586
|
final.value[i] = r.value;
|
|
3587
3587
|
}
|
|
3588
|
-
for (let i = final.value.length - 1; i >=
|
|
3588
|
+
for (let i = final.value.length - 1; i >= input2.length; i--) {
|
|
3589
3589
|
if (items[i]._zod.optout === "optional" && final.value[i] === void 0) {
|
|
3590
3590
|
final.value.length = i;
|
|
3591
3591
|
} else {
|
|
@@ -3597,12 +3597,12 @@ function handleTupleResults(itemResults, final, items, input, optoutStart) {
|
|
|
3597
3597
|
var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
3598
3598
|
$ZodType.init(inst, def);
|
|
3599
3599
|
inst._zod.parse = (payload, ctx) => {
|
|
3600
|
-
const
|
|
3601
|
-
if (!isPlainObject(
|
|
3600
|
+
const input2 = payload.value;
|
|
3601
|
+
if (!isPlainObject(input2)) {
|
|
3602
3602
|
payload.issues.push({
|
|
3603
3603
|
expected: "record",
|
|
3604
3604
|
code: "invalid_type",
|
|
3605
|
-
input,
|
|
3605
|
+
input: input2,
|
|
3606
3606
|
inst
|
|
3607
3607
|
});
|
|
3608
3608
|
return payload;
|
|
@@ -3631,7 +3631,7 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
3631
3631
|
continue;
|
|
3632
3632
|
}
|
|
3633
3633
|
const outKey = keyResult.value;
|
|
3634
|
-
const result = def.valueType._zod.run({ value:
|
|
3634
|
+
const result = def.valueType._zod.run({ value: input2[key2], issues: [] }, ctx);
|
|
3635
3635
|
if (result instanceof Promise) {
|
|
3636
3636
|
proms.push(result.then((result2) => {
|
|
3637
3637
|
if (result2.issues.length) {
|
|
@@ -3648,7 +3648,7 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
3648
3648
|
}
|
|
3649
3649
|
}
|
|
3650
3650
|
let unrecognized;
|
|
3651
|
-
for (const key2 in
|
|
3651
|
+
for (const key2 in input2) {
|
|
3652
3652
|
if (!recordKeys.has(key2)) {
|
|
3653
3653
|
unrecognized = unrecognized ?? [];
|
|
3654
3654
|
unrecognized.push(key2);
|
|
@@ -3657,17 +3657,17 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
3657
3657
|
if (unrecognized && unrecognized.length > 0) {
|
|
3658
3658
|
payload.issues.push({
|
|
3659
3659
|
code: "unrecognized_keys",
|
|
3660
|
-
input,
|
|
3660
|
+
input: input2,
|
|
3661
3661
|
inst,
|
|
3662
3662
|
keys: unrecognized
|
|
3663
3663
|
});
|
|
3664
3664
|
}
|
|
3665
3665
|
} else {
|
|
3666
3666
|
payload.value = {};
|
|
3667
|
-
for (const key2 of Reflect.ownKeys(
|
|
3667
|
+
for (const key2 of Reflect.ownKeys(input2)) {
|
|
3668
3668
|
if (key2 === "__proto__")
|
|
3669
3669
|
continue;
|
|
3670
|
-
if (!Object.prototype.propertyIsEnumerable.call(
|
|
3670
|
+
if (!Object.prototype.propertyIsEnumerable.call(input2, key2))
|
|
3671
3671
|
continue;
|
|
3672
3672
|
let keyResult = def.keyType._zod.run({ value: key2, issues: [] }, ctx);
|
|
3673
3673
|
if (keyResult instanceof Promise) {
|
|
@@ -3685,7 +3685,7 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
3685
3685
|
}
|
|
3686
3686
|
if (keyResult.issues.length) {
|
|
3687
3687
|
if (def.mode === "loose") {
|
|
3688
|
-
payload.value[key2] =
|
|
3688
|
+
payload.value[key2] = input2[key2];
|
|
3689
3689
|
} else {
|
|
3690
3690
|
payload.issues.push({
|
|
3691
3691
|
code: "invalid_key",
|
|
@@ -3698,7 +3698,7 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
3698
3698
|
}
|
|
3699
3699
|
continue;
|
|
3700
3700
|
}
|
|
3701
|
-
const result = def.valueType._zod.run({ value:
|
|
3701
|
+
const result = def.valueType._zod.run({ value: input2[key2], issues: [] }, ctx);
|
|
3702
3702
|
if (result instanceof Promise) {
|
|
3703
3703
|
proms.push(result.then((result2) => {
|
|
3704
3704
|
if (result2.issues.length) {
|
|
@@ -3723,27 +3723,27 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
3723
3723
|
var $ZodMap = /* @__PURE__ */ $constructor("$ZodMap", (inst, def) => {
|
|
3724
3724
|
$ZodType.init(inst, def);
|
|
3725
3725
|
inst._zod.parse = (payload, ctx) => {
|
|
3726
|
-
const
|
|
3727
|
-
if (!(
|
|
3726
|
+
const input2 = payload.value;
|
|
3727
|
+
if (!(input2 instanceof Map)) {
|
|
3728
3728
|
payload.issues.push({
|
|
3729
3729
|
expected: "map",
|
|
3730
3730
|
code: "invalid_type",
|
|
3731
|
-
input,
|
|
3731
|
+
input: input2,
|
|
3732
3732
|
inst
|
|
3733
3733
|
});
|
|
3734
3734
|
return payload;
|
|
3735
3735
|
}
|
|
3736
3736
|
const proms = [];
|
|
3737
3737
|
payload.value = /* @__PURE__ */ new Map();
|
|
3738
|
-
for (const [key2, value] of
|
|
3738
|
+
for (const [key2, value] of input2) {
|
|
3739
3739
|
const keyResult = def.keyType._zod.run({ value: key2, issues: [] }, ctx);
|
|
3740
3740
|
const valueResult = def.valueType._zod.run({ value, issues: [] }, ctx);
|
|
3741
3741
|
if (keyResult instanceof Promise || valueResult instanceof Promise) {
|
|
3742
3742
|
proms.push(Promise.all([keyResult, valueResult]).then(([keyResult2, valueResult2]) => {
|
|
3743
|
-
handleMapResult(keyResult2, valueResult2, payload, key2,
|
|
3743
|
+
handleMapResult(keyResult2, valueResult2, payload, key2, input2, inst, ctx);
|
|
3744
3744
|
}));
|
|
3745
3745
|
} else {
|
|
3746
|
-
handleMapResult(keyResult, valueResult, payload, key2,
|
|
3746
|
+
handleMapResult(keyResult, valueResult, payload, key2, input2, inst, ctx);
|
|
3747
3747
|
}
|
|
3748
3748
|
}
|
|
3749
3749
|
if (proms.length)
|
|
@@ -3751,7 +3751,7 @@ var $ZodMap = /* @__PURE__ */ $constructor("$ZodMap", (inst, def) => {
|
|
|
3751
3751
|
return payload;
|
|
3752
3752
|
};
|
|
3753
3753
|
});
|
|
3754
|
-
function handleMapResult(keyResult, valueResult, final, key2,
|
|
3754
|
+
function handleMapResult(keyResult, valueResult, final, key2, input2, inst, ctx) {
|
|
3755
3755
|
if (keyResult.issues.length) {
|
|
3756
3756
|
if (propertyKeyTypes.has(typeof key2)) {
|
|
3757
3757
|
final.issues.push(...prefixIssues(key2, keyResult.issues));
|
|
@@ -3759,7 +3759,7 @@ function handleMapResult(keyResult, valueResult, final, key2, input, inst, ctx)
|
|
|
3759
3759
|
final.issues.push({
|
|
3760
3760
|
code: "invalid_key",
|
|
3761
3761
|
origin: "map",
|
|
3762
|
-
input,
|
|
3762
|
+
input: input2,
|
|
3763
3763
|
inst,
|
|
3764
3764
|
issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config()))
|
|
3765
3765
|
});
|
|
@@ -3772,7 +3772,7 @@ function handleMapResult(keyResult, valueResult, final, key2, input, inst, ctx)
|
|
|
3772
3772
|
final.issues.push({
|
|
3773
3773
|
origin: "map",
|
|
3774
3774
|
code: "invalid_element",
|
|
3775
|
-
input,
|
|
3775
|
+
input: input2,
|
|
3776
3776
|
inst,
|
|
3777
3777
|
key: key2,
|
|
3778
3778
|
issues: valueResult.issues.map((iss) => finalizeIssue(iss, ctx, config()))
|
|
@@ -3784,10 +3784,10 @@ function handleMapResult(keyResult, valueResult, final, key2, input, inst, ctx)
|
|
|
3784
3784
|
var $ZodSet = /* @__PURE__ */ $constructor("$ZodSet", (inst, def) => {
|
|
3785
3785
|
$ZodType.init(inst, def);
|
|
3786
3786
|
inst._zod.parse = (payload, ctx) => {
|
|
3787
|
-
const
|
|
3788
|
-
if (!(
|
|
3787
|
+
const input2 = payload.value;
|
|
3788
|
+
if (!(input2 instanceof Set)) {
|
|
3789
3789
|
payload.issues.push({
|
|
3790
|
-
input,
|
|
3790
|
+
input: input2,
|
|
3791
3791
|
inst,
|
|
3792
3792
|
expected: "set",
|
|
3793
3793
|
code: "invalid_type"
|
|
@@ -3796,7 +3796,7 @@ var $ZodSet = /* @__PURE__ */ $constructor("$ZodSet", (inst, def) => {
|
|
|
3796
3796
|
}
|
|
3797
3797
|
const proms = [];
|
|
3798
3798
|
payload.value = /* @__PURE__ */ new Set();
|
|
3799
|
-
for (const item of
|
|
3799
|
+
for (const item of input2) {
|
|
3800
3800
|
const result = def.valueType._zod.run({ value: item, issues: [] }, ctx);
|
|
3801
3801
|
if (result instanceof Promise) {
|
|
3802
3802
|
proms.push(result.then((result2) => handleSetResult(result2, payload)));
|
|
@@ -3821,14 +3821,14 @@ var $ZodEnum = /* @__PURE__ */ $constructor("$ZodEnum", (inst, def) => {
|
|
|
3821
3821
|
inst._zod.values = valuesSet;
|
|
3822
3822
|
inst._zod.pattern = new RegExp(`^(${values.filter((k) => propertyKeyTypes.has(typeof k)).map((o) => typeof o === "string" ? escapeRegex(o) : o.toString()).join("|")})$`);
|
|
3823
3823
|
inst._zod.parse = (payload, _ctx) => {
|
|
3824
|
-
const
|
|
3825
|
-
if (valuesSet.has(
|
|
3824
|
+
const input2 = payload.value;
|
|
3825
|
+
if (valuesSet.has(input2)) {
|
|
3826
3826
|
return payload;
|
|
3827
3827
|
}
|
|
3828
3828
|
payload.issues.push({
|
|
3829
3829
|
code: "invalid_value",
|
|
3830
3830
|
values,
|
|
3831
|
-
input,
|
|
3831
|
+
input: input2,
|
|
3832
3832
|
inst
|
|
3833
3833
|
});
|
|
3834
3834
|
return payload;
|
|
@@ -3843,14 +3843,14 @@ var $ZodLiteral = /* @__PURE__ */ $constructor("$ZodLiteral", (inst, def) => {
|
|
|
3843
3843
|
inst._zod.values = values;
|
|
3844
3844
|
inst._zod.pattern = new RegExp(`^(${def.values.map((o) => typeof o === "string" ? escapeRegex(o) : o ? escapeRegex(o.toString()) : String(o)).join("|")})$`);
|
|
3845
3845
|
inst._zod.parse = (payload, _ctx) => {
|
|
3846
|
-
const
|
|
3847
|
-
if (values.has(
|
|
3846
|
+
const input2 = payload.value;
|
|
3847
|
+
if (values.has(input2)) {
|
|
3848
3848
|
return payload;
|
|
3849
3849
|
}
|
|
3850
3850
|
payload.issues.push({
|
|
3851
3851
|
code: "invalid_value",
|
|
3852
3852
|
values: def.values,
|
|
3853
|
-
input,
|
|
3853
|
+
input: input2,
|
|
3854
3854
|
inst
|
|
3855
3855
|
});
|
|
3856
3856
|
return payload;
|
|
@@ -3859,13 +3859,13 @@ var $ZodLiteral = /* @__PURE__ */ $constructor("$ZodLiteral", (inst, def) => {
|
|
|
3859
3859
|
var $ZodFile = /* @__PURE__ */ $constructor("$ZodFile", (inst, def) => {
|
|
3860
3860
|
$ZodType.init(inst, def);
|
|
3861
3861
|
inst._zod.parse = (payload, _ctx) => {
|
|
3862
|
-
const
|
|
3863
|
-
if (
|
|
3862
|
+
const input2 = payload.value;
|
|
3863
|
+
if (input2 instanceof File)
|
|
3864
3864
|
return payload;
|
|
3865
3865
|
payload.issues.push({
|
|
3866
3866
|
expected: "file",
|
|
3867
3867
|
code: "invalid_type",
|
|
3868
|
-
input,
|
|
3868
|
+
input: input2,
|
|
3869
3869
|
inst
|
|
3870
3870
|
});
|
|
3871
3871
|
return payload;
|
|
@@ -3895,8 +3895,8 @@ var $ZodTransform = /* @__PURE__ */ $constructor("$ZodTransform", (inst, def) =>
|
|
|
3895
3895
|
return payload;
|
|
3896
3896
|
};
|
|
3897
3897
|
});
|
|
3898
|
-
function handleOptionalResult(result,
|
|
3899
|
-
if (
|
|
3898
|
+
function handleOptionalResult(result, input2) {
|
|
3899
|
+
if (input2 === void 0 && (result.issues.length || result.fallback)) {
|
|
3900
3900
|
return { issues: [], value: void 0 };
|
|
3901
3901
|
}
|
|
3902
3902
|
return result;
|
|
@@ -3914,11 +3914,11 @@ var $ZodOptional = /* @__PURE__ */ $constructor("$ZodOptional", (inst, def) => {
|
|
|
3914
3914
|
});
|
|
3915
3915
|
inst._zod.parse = (payload, ctx) => {
|
|
3916
3916
|
if (def.innerType._zod.optin === "optional") {
|
|
3917
|
-
const
|
|
3917
|
+
const input2 = payload.value;
|
|
3918
3918
|
const result = def.innerType._zod.run(payload, ctx);
|
|
3919
3919
|
if (result instanceof Promise)
|
|
3920
|
-
return result.then((r) => handleOptionalResult(r,
|
|
3921
|
-
return handleOptionalResult(result,
|
|
3920
|
+
return result.then((r) => handleOptionalResult(r, input2));
|
|
3921
|
+
return handleOptionalResult(result, input2);
|
|
3922
3922
|
}
|
|
3923
3923
|
if (payload.value === void 0) {
|
|
3924
3924
|
return payload;
|
|
@@ -4343,20 +4343,20 @@ var $ZodCustom = /* @__PURE__ */ $constructor("$ZodCustom", (inst, def) => {
|
|
|
4343
4343
|
return payload;
|
|
4344
4344
|
};
|
|
4345
4345
|
inst._zod.check = (payload) => {
|
|
4346
|
-
const
|
|
4347
|
-
const r = def.fn(
|
|
4346
|
+
const input2 = payload.value;
|
|
4347
|
+
const r = def.fn(input2);
|
|
4348
4348
|
if (r instanceof Promise) {
|
|
4349
|
-
return r.then((r2) => handleRefineResult(r2, payload,
|
|
4349
|
+
return r.then((r2) => handleRefineResult(r2, payload, input2, inst));
|
|
4350
4350
|
}
|
|
4351
|
-
handleRefineResult(r, payload,
|
|
4351
|
+
handleRefineResult(r, payload, input2, inst);
|
|
4352
4352
|
return;
|
|
4353
4353
|
};
|
|
4354
4354
|
});
|
|
4355
|
-
function handleRefineResult(result, payload,
|
|
4355
|
+
function handleRefineResult(result, payload, input2, inst) {
|
|
4356
4356
|
if (!result) {
|
|
4357
4357
|
const _iss = {
|
|
4358
4358
|
code: "custom",
|
|
4359
|
-
input,
|
|
4359
|
+
input: input2,
|
|
4360
4360
|
inst,
|
|
4361
4361
|
// incorporates params.error into issue reporting
|
|
4362
4362
|
path: [...inst._zod.def.path ?? []],
|
|
@@ -7643,8 +7643,8 @@ function ko_default() {
|
|
|
7643
7643
|
}
|
|
7644
7644
|
|
|
7645
7645
|
// ../../../node_modules/zod/v4/locales/lt.js
|
|
7646
|
-
var capitalizeFirstCharacter = (
|
|
7647
|
-
return
|
|
7646
|
+
var capitalizeFirstCharacter = (text3) => {
|
|
7647
|
+
return text3.charAt(0).toUpperCase() + text3.slice(1);
|
|
7648
7648
|
};
|
|
7649
7649
|
function getUnitTypeFromNumber(number4) {
|
|
7650
7650
|
const abs = Math.abs(number4);
|
|
@@ -11044,23 +11044,23 @@ function _overwrite(tx) {
|
|
|
11044
11044
|
}
|
|
11045
11045
|
// @__NO_SIDE_EFFECTS__
|
|
11046
11046
|
function _normalize(form) {
|
|
11047
|
-
return /* @__PURE__ */ _overwrite((
|
|
11047
|
+
return /* @__PURE__ */ _overwrite((input2) => input2.normalize(form));
|
|
11048
11048
|
}
|
|
11049
11049
|
// @__NO_SIDE_EFFECTS__
|
|
11050
11050
|
function _trim() {
|
|
11051
|
-
return /* @__PURE__ */ _overwrite((
|
|
11051
|
+
return /* @__PURE__ */ _overwrite((input2) => input2.trim());
|
|
11052
11052
|
}
|
|
11053
11053
|
// @__NO_SIDE_EFFECTS__
|
|
11054
11054
|
function _toLowerCase() {
|
|
11055
|
-
return /* @__PURE__ */ _overwrite((
|
|
11055
|
+
return /* @__PURE__ */ _overwrite((input2) => input2.toLowerCase());
|
|
11056
11056
|
}
|
|
11057
11057
|
// @__NO_SIDE_EFFECTS__
|
|
11058
11058
|
function _toUpperCase() {
|
|
11059
|
-
return /* @__PURE__ */ _overwrite((
|
|
11059
|
+
return /* @__PURE__ */ _overwrite((input2) => input2.toUpperCase());
|
|
11060
11060
|
}
|
|
11061
11061
|
// @__NO_SIDE_EFFECTS__
|
|
11062
11062
|
function _slugify() {
|
|
11063
|
-
return /* @__PURE__ */ _overwrite((
|
|
11063
|
+
return /* @__PURE__ */ _overwrite((input2) => slugify(input2));
|
|
11064
11064
|
}
|
|
11065
11065
|
// @__NO_SIDE_EFFECTS__
|
|
11066
11066
|
function _array(Class2, element, params) {
|
|
@@ -11365,8 +11365,8 @@ function _stringbool(Classes, _params) {
|
|
|
11365
11365
|
type: "pipe",
|
|
11366
11366
|
in: stringSchema,
|
|
11367
11367
|
out: booleanSchema,
|
|
11368
|
-
transform: ((
|
|
11369
|
-
let data =
|
|
11368
|
+
transform: ((input2, payload) => {
|
|
11369
|
+
let data = input2;
|
|
11370
11370
|
if (params.case !== "sensitive")
|
|
11371
11371
|
data = data.toLowerCase();
|
|
11372
11372
|
if (truthySet.has(data)) {
|
|
@@ -11385,8 +11385,8 @@ function _stringbool(Classes, _params) {
|
|
|
11385
11385
|
return {};
|
|
11386
11386
|
}
|
|
11387
11387
|
}),
|
|
11388
|
-
reverseTransform: ((
|
|
11389
|
-
if (
|
|
11388
|
+
reverseTransform: ((input2, _payload) => {
|
|
11389
|
+
if (input2 === true) {
|
|
11390
11390
|
return truthyArray[0] || "true";
|
|
11391
11391
|
} else {
|
|
11392
11392
|
return falsyArray[0] || "false";
|
|
@@ -11496,26 +11496,26 @@ function extractDefs(ctx, schema) {
|
|
|
11496
11496
|
throw new Error("Unprocessed schema. This is a bug in Zod.");
|
|
11497
11497
|
const idToSchema = /* @__PURE__ */ new Map();
|
|
11498
11498
|
for (const entry of ctx.seen.entries()) {
|
|
11499
|
-
const
|
|
11500
|
-
if (
|
|
11501
|
-
const existing = idToSchema.get(
|
|
11499
|
+
const id2 = ctx.metadataRegistry.get(entry[0])?.id;
|
|
11500
|
+
if (id2) {
|
|
11501
|
+
const existing = idToSchema.get(id2);
|
|
11502
11502
|
if (existing && existing !== entry[0]) {
|
|
11503
|
-
throw new Error(`Duplicate schema id "${
|
|
11503
|
+
throw new Error(`Duplicate schema id "${id2}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);
|
|
11504
11504
|
}
|
|
11505
|
-
idToSchema.set(
|
|
11505
|
+
idToSchema.set(id2, entry[0]);
|
|
11506
11506
|
}
|
|
11507
11507
|
}
|
|
11508
11508
|
const makeURI = (entry) => {
|
|
11509
11509
|
const defsSegment = ctx.target === "draft-2020-12" ? "$defs" : "definitions";
|
|
11510
11510
|
if (ctx.external) {
|
|
11511
11511
|
const externalId = ctx.external.registry.get(entry[0])?.id;
|
|
11512
|
-
const uriGenerator = ctx.external.uri ?? ((
|
|
11512
|
+
const uriGenerator = ctx.external.uri ?? ((id3) => id3);
|
|
11513
11513
|
if (externalId) {
|
|
11514
11514
|
return { ref: uriGenerator(externalId) };
|
|
11515
11515
|
}
|
|
11516
|
-
const
|
|
11517
|
-
entry[1].defId =
|
|
11518
|
-
return { defId:
|
|
11516
|
+
const id2 = entry[1].defId ?? entry[1].schema.id ?? `schema${ctx.counter++}`;
|
|
11517
|
+
entry[1].defId = id2;
|
|
11518
|
+
return { defId: id2, ref: `${uriGenerator("__shared")}#/${defsSegment}/${id2}` };
|
|
11519
11519
|
}
|
|
11520
11520
|
if (entry[1] === root) {
|
|
11521
11521
|
return { ref: "#" };
|
|
@@ -11563,8 +11563,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
11563
11563
|
continue;
|
|
11564
11564
|
}
|
|
11565
11565
|
}
|
|
11566
|
-
const
|
|
11567
|
-
if (
|
|
11566
|
+
const id2 = ctx.metadataRegistry.get(entry[0])?.id;
|
|
11567
|
+
if (id2) {
|
|
11568
11568
|
extractToDef(entry);
|
|
11569
11569
|
continue;
|
|
11570
11570
|
}
|
|
@@ -11660,10 +11660,10 @@ function finalize(ctx, schema) {
|
|
|
11660
11660
|
} else {
|
|
11661
11661
|
}
|
|
11662
11662
|
if (ctx.external?.uri) {
|
|
11663
|
-
const
|
|
11664
|
-
if (!
|
|
11663
|
+
const id2 = ctx.external.registry.get(schema)?.id;
|
|
11664
|
+
if (!id2)
|
|
11665
11665
|
throw new Error("Schema is missing an `id` property");
|
|
11666
|
-
result.$id = ctx.external.uri(
|
|
11666
|
+
result.$id = ctx.external.uri(id2);
|
|
11667
11667
|
}
|
|
11668
11668
|
Object.assign(result, root.def ?? root.schema);
|
|
11669
11669
|
const rootMetaId = ctx.metadataRegistry.get(schema)?.id;
|
|
@@ -11823,9 +11823,9 @@ var numberProcessor = (schema, ctx, _json, _params) => {
|
|
|
11823
11823
|
json2.type = "number";
|
|
11824
11824
|
const exMin = typeof exclusiveMinimum === "number" && exclusiveMinimum >= (minimum ?? Number.NEGATIVE_INFINITY);
|
|
11825
11825
|
const exMax = typeof exclusiveMaximum === "number" && exclusiveMaximum <= (maximum ?? Number.POSITIVE_INFINITY);
|
|
11826
|
-
const
|
|
11826
|
+
const legacy2 = ctx.target === "draft-04" || ctx.target === "openapi-3.0";
|
|
11827
11827
|
if (exMin) {
|
|
11828
|
-
if (
|
|
11828
|
+
if (legacy2) {
|
|
11829
11829
|
json2.minimum = exclusiveMinimum;
|
|
11830
11830
|
json2.exclusiveMinimum = true;
|
|
11831
11831
|
} else {
|
|
@@ -11835,7 +11835,7 @@ var numberProcessor = (schema, ctx, _json, _params) => {
|
|
|
11835
11835
|
json2.minimum = minimum;
|
|
11836
11836
|
}
|
|
11837
11837
|
if (exMax) {
|
|
11838
|
-
if (
|
|
11838
|
+
if (legacy2) {
|
|
11839
11839
|
json2.maximum = exclusiveMaximum;
|
|
11840
11840
|
json2.exclusiveMaximum = true;
|
|
11841
11841
|
} else {
|
|
@@ -12282,9 +12282,9 @@ var allProcessors = {
|
|
|
12282
12282
|
optional: optionalProcessor,
|
|
12283
12283
|
lazy: lazyProcessor
|
|
12284
12284
|
};
|
|
12285
|
-
function toJSONSchema(
|
|
12286
|
-
if ("_idmap" in
|
|
12287
|
-
const registry2 =
|
|
12285
|
+
function toJSONSchema(input2, params) {
|
|
12286
|
+
if ("_idmap" in input2) {
|
|
12287
|
+
const registry2 = input2;
|
|
12288
12288
|
const ctx2 = initializeContext({ ...params, processors: allProcessors });
|
|
12289
12289
|
const defs = {};
|
|
12290
12290
|
for (const entry of registry2._idmap.entries()) {
|
|
@@ -12312,9 +12312,9 @@ function toJSONSchema(input, params) {
|
|
|
12312
12312
|
return { schemas };
|
|
12313
12313
|
}
|
|
12314
12314
|
const ctx = initializeContext({ ...params, processors: allProcessors });
|
|
12315
|
-
process(
|
|
12316
|
-
extractDefs(ctx,
|
|
12317
|
-
return finalize(ctx,
|
|
12315
|
+
process(input2, ctx);
|
|
12316
|
+
extractDefs(ctx, input2);
|
|
12317
|
+
return finalize(ctx, input2);
|
|
12318
12318
|
}
|
|
12319
12319
|
|
|
12320
12320
|
// ../../../node_modules/zod/v4/core/json-schema-generator.js
|
|
@@ -12697,7 +12697,7 @@ var safeDecodeAsync2 = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
|
|
|
12697
12697
|
|
|
12698
12698
|
// ../../../node_modules/zod/v4/classic/schemas.js
|
|
12699
12699
|
var _installedGroups = /* @__PURE__ */ new WeakMap();
|
|
12700
|
-
function _installLazyMethods(inst, group,
|
|
12700
|
+
function _installLazyMethods(inst, group, methods2) {
|
|
12701
12701
|
const proto = Object.getPrototypeOf(inst);
|
|
12702
12702
|
let installed = _installedGroups.get(proto);
|
|
12703
12703
|
if (!installed) {
|
|
@@ -12707,8 +12707,8 @@ function _installLazyMethods(inst, group, methods) {
|
|
|
12707
12707
|
if (installed.has(group))
|
|
12708
12708
|
return;
|
|
12709
12709
|
installed.add(group);
|
|
12710
|
-
for (const key2 in
|
|
12711
|
-
const fn =
|
|
12710
|
+
for (const key2 in methods2) {
|
|
12711
|
+
const fn = methods2[key2];
|
|
12712
12712
|
Object.defineProperty(proto, key2, {
|
|
12713
12713
|
configurable: true,
|
|
12714
12714
|
enumerable: false,
|
|
@@ -14519,87 +14519,6 @@ function date4(params) {
|
|
|
14519
14519
|
// ../../../node_modules/zod/v4/classic/external.js
|
|
14520
14520
|
config(en_default());
|
|
14521
14521
|
|
|
14522
|
-
// ../../shared-contracts/dist/ids.js
|
|
14523
|
-
var opaqueIdSchema = external_exports.string().refine((value) => value.trim().length > 0, {
|
|
14524
|
-
message: "Identifier must not be empty or whitespace"
|
|
14525
|
-
});
|
|
14526
|
-
var harnessIdSchema = opaqueIdSchema.brand();
|
|
14527
|
-
var hostThreadIdSchema = opaqueIdSchema.brand();
|
|
14528
|
-
var hostTurnIdSchema = opaqueIdSchema.brand();
|
|
14529
|
-
var hostItemIdSchema = opaqueIdSchema.brand();
|
|
14530
|
-
var hostInteractionIdSchema = opaqueIdSchema.brand();
|
|
14531
|
-
|
|
14532
|
-
// ../../shared-contracts/dist/harness-plugins.js
|
|
14533
|
-
var HARNESS_PLUGIN_MANIFEST_MAX_BYTES = 32 * 1024;
|
|
14534
|
-
var HARNESS_PLUGIN_ICON_MAX_BYTES = 128 * 1024;
|
|
14535
|
-
var HARNESS_PLUGIN_LIMIT = 128;
|
|
14536
|
-
var installedPluginIdSchema = external_exports.string().min(1).max(128).regex(/^[a-z][a-z0-9]*(?:[._-][a-z0-9]+)*$/u);
|
|
14537
|
-
var installedHarnessPluginIdSchema = installedPluginIdSchema.pipe(harnessIdSchema);
|
|
14538
|
-
var harnessPluginIdSchema = installedHarnessPluginIdSchema.refine((id) => id !== "codex", "The official Codex identity is reserved");
|
|
14539
|
-
var pluginRelativeResourceSchema = external_exports.string().min(1).max(512).refine((value) => !/[\\\u0000:#?]/u.test(value) && !value.startsWith("/") && !value.split("/").some((part) => part === ".." || part === ""), "Plugin resources must be relative paths inside the plugin");
|
|
14540
|
-
var documentationUrlSchema = external_exports.url().refine((value) => /^https:\/\/[^/?#@]+(?:[/?#]|$)/iu.test(value), "Plugin documentation links must be credential-free HTTPS URLs");
|
|
14541
|
-
var localizedTextSchema = external_exports.object({ en: external_exports.string().max(4096), "zh-CN": external_exports.string().max(4096).optional() }).strict();
|
|
14542
|
-
var harnessInstallationGuideSchema = external_exports.object({
|
|
14543
|
-
commands: external_exports.array(external_exports.object({ terminal: external_exports.string().max(256), command: external_exports.string().max(4096) }).strict()).max(8),
|
|
14544
|
-
before: localizedTextSchema.optional(),
|
|
14545
|
-
after: localizedTextSchema.optional(),
|
|
14546
|
-
downloads: external_exports.array(external_exports.object({ label: external_exports.string().max(128), url: documentationUrlSchema }).strict()).max(8).optional()
|
|
14547
|
-
}).strict();
|
|
14548
|
-
var pluginPresentationShape = {
|
|
14549
|
-
id: installedHarnessPluginIdSchema,
|
|
14550
|
-
name: external_exports.string().trim().min(1).max(128),
|
|
14551
|
-
version: external_exports.string().min(1).max(128),
|
|
14552
|
-
/** Capability-only plugin; omitted for existing session-capable plugins. */
|
|
14553
|
-
kind: external_exports.literal("usage").optional(),
|
|
14554
|
-
/** Original image styling or bounded vector paths; never arbitrary CSS/SVG markup. */
|
|
14555
|
-
iconStyle: external_exports.object({
|
|
14556
|
-
vector: external_exports.object({
|
|
14557
|
-
viewBox: external_exports.string().max(128).regex(/^-?\d+(?:\.\d+)?(?: +-?\d+(?:\.\d+)?){3}$/u),
|
|
14558
|
-
color: external_exports.string().regex(/^(?:currentColor|#[a-f0-9]{6})$/iu),
|
|
14559
|
-
paths: external_exports.array(external_exports.object({
|
|
14560
|
-
d: external_exports.string().min(1).max(32768).regex(/^[MmLlHhVvCcSsQqTtAaZz\d.,+eE\s-]+$/u),
|
|
14561
|
-
fillRule: external_exports.enum(["evenodd", "nonzero"]).optional(),
|
|
14562
|
-
fill: external_exports.string().regex(/^(?:currentColor|#[a-f0-9]{6})$/iu).optional()
|
|
14563
|
-
}).strict()).min(1).max(32)
|
|
14564
|
-
}).strict().optional(),
|
|
14565
|
-
background: external_exports.string().regex(/^#[a-f0-9]{6}$/iu).optional(),
|
|
14566
|
-
borderRadius: external_exports.number().min(0).max(50).optional(),
|
|
14567
|
-
paddingRatio: external_exports.number().min(0).max(0.25).optional()
|
|
14568
|
-
}).strict().optional(),
|
|
14569
|
-
installation: harnessInstallationGuideSchema.optional(),
|
|
14570
|
-
notice: localizedTextSchema.optional(),
|
|
14571
|
-
/** The factory accepts a persisted local entrypoint through its construction context. */
|
|
14572
|
-
launchCommand: external_exports.literal(true).optional(),
|
|
14573
|
-
links: external_exports.object({
|
|
14574
|
-
website: documentationUrlSchema.optional(),
|
|
14575
|
-
documentation: documentationUrlSchema.optional(),
|
|
14576
|
-
installation: documentationUrlSchema.optional()
|
|
14577
|
-
}).strict().optional()
|
|
14578
|
-
};
|
|
14579
|
-
var harnessPluginManifestSchema = external_exports.object({
|
|
14580
|
-
manifestVersion: external_exports.literal(1),
|
|
14581
|
-
...pluginPresentationShape,
|
|
14582
|
-
adapterApiVersion: external_exports.number().int().positive(),
|
|
14583
|
-
entry: pluginRelativeResourceSchema,
|
|
14584
|
-
icon: pluginRelativeResourceSchema.optional()
|
|
14585
|
-
}).strict();
|
|
14586
|
-
var harnessPluginIconSchema = external_exports.string().max(Math.ceil(HARNESS_PLUGIN_ICON_MAX_BYTES / 3) * 4 + 64).regex(/^data:image\/(?:png|jpeg|webp|svg\+xml);base64,[A-Za-z0-9+/]+={0,2}$/u);
|
|
14587
|
-
var harnessPluginDescriptorSchema = external_exports.object({
|
|
14588
|
-
...pluginPresentationShape,
|
|
14589
|
-
icon: harnessPluginIconSchema.optional()
|
|
14590
|
-
}).strict();
|
|
14591
|
-
var harnessPluginListParamsSchema = external_exports.object({}).strict();
|
|
14592
|
-
var harnessPluginListResultSchema = external_exports.object({
|
|
14593
|
-
plugins: external_exports.array(harnessPluginDescriptorSchema.extend({ id: harnessPluginIdSchema })).max(HARNESS_PLUGIN_LIMIT)
|
|
14594
|
-
}).strict();
|
|
14595
|
-
var harnessPluginConfigurationSchema = external_exports.object({
|
|
14596
|
-
version: external_exports.literal(1),
|
|
14597
|
-
enabled: external_exports.array(installedHarnessPluginIdSchema).max(HARNESS_PLUGIN_LIMIT)
|
|
14598
|
-
}).strict().refine((value) => new Set(value.enabled).size === value.enabled.length, {
|
|
14599
|
-
message: "Enabled plugin IDs must be unique",
|
|
14600
|
-
path: ["enabled"]
|
|
14601
|
-
});
|
|
14602
|
-
|
|
14603
14522
|
// ../../shared-contracts/dist/json-value.js
|
|
14604
14523
|
function rejectExplicitUndefined(keys) {
|
|
14605
14524
|
return (value, context) => {
|
|
@@ -14659,403 +14578,73 @@ var jsonValueSchema = nonCircularSchema.pipe(recursiveJsonValueSchema);
|
|
|
14659
14578
|
var jsonArraySchema = nonCircularSchema.pipe(external_exports.array(recursiveJsonValueSchema));
|
|
14660
14579
|
var jsonObjectSchema = nonCircularSchema.pipe(external_exports.record(external_exports.string(), recursiveJsonValueSchema));
|
|
14661
14580
|
|
|
14662
|
-
// ../../shared-contracts/dist/
|
|
14663
|
-
var
|
|
14664
|
-
|
|
14665
|
-
|
|
14666
|
-
|
|
14667
|
-
|
|
14668
|
-
|
|
14669
|
-
|
|
14670
|
-
|
|
14671
|
-
|
|
14672
|
-
|
|
14673
|
-
|
|
14674
|
-
var
|
|
14675
|
-
var
|
|
14676
|
-
var
|
|
14677
|
-
|
|
14678
|
-
|
|
14679
|
-
|
|
14680
|
-
|
|
14681
|
-
|
|
14682
|
-
|
|
14683
|
-
var
|
|
14684
|
-
"
|
|
14685
|
-
|
|
14686
|
-
|
|
14687
|
-
|
|
14688
|
-
|
|
14689
|
-
|
|
14690
|
-
|
|
14691
|
-
|
|
14692
|
-
|
|
14693
|
-
|
|
14694
|
-
|
|
14695
|
-
|
|
14696
|
-
|
|
14697
|
-
|
|
14698
|
-
|
|
14699
|
-
|
|
14700
|
-
|
|
14701
|
-
|
|
14702
|
-
|
|
14581
|
+
// ../../shared-contracts/dist/errors.js
|
|
14582
|
+
var codexhostErrorSchema = external_exports.strictObject({
|
|
14583
|
+
code: external_exports.string().min(1),
|
|
14584
|
+
message: external_exports.string().min(1),
|
|
14585
|
+
retryable: external_exports.boolean(),
|
|
14586
|
+
diagnostic: external_exports.string().min(1).optional(),
|
|
14587
|
+
stage: external_exports.string().min(1).optional(),
|
|
14588
|
+
durationMs: external_exports.number().int().nonnegative().optional(),
|
|
14589
|
+
stderrTail: external_exports.string().min(1).optional()
|
|
14590
|
+
}).superRefine(rejectExplicitUndefined(["diagnostic", "stage", "durationMs", "stderrTail"]));
|
|
14591
|
+
|
|
14592
|
+
// ../../shared-contracts/dist/harness-presentation.js
|
|
14593
|
+
var localeSchema = external_exports.string().max(64).regex(/^[a-z]{2,3}(?:-[A-Za-z0-9]{2,8})*$/u);
|
|
14594
|
+
var displayText = (maximum) => external_exports.string().min(1).max(maximum).refine((text3) => text3.trim().length > 0);
|
|
14595
|
+
var harnessLocalizationsSchema = external_exports.record(localeSchema, external_exports.object({
|
|
14596
|
+
label: displayText(256).optional(),
|
|
14597
|
+
description: displayText(1024).optional()
|
|
14598
|
+
}).strict()).refine((entries) => Object.keys(entries).length <= 16, "Too many locales");
|
|
14599
|
+
var harnessLocalizedTextSchema = external_exports.record(localeSchema, displayText(4096)).refine((entries) => typeof entries.en === "string", "English fallback is required").refine((entries) => Object.keys(entries).length <= 16, "Too many locales");
|
|
14600
|
+
|
|
14601
|
+
// ../../shared-contracts/dist/ids.js
|
|
14602
|
+
var opaqueIdSchema = external_exports.string().refine((value) => value.trim().length > 0, {
|
|
14603
|
+
message: "Identifier must not be empty or whitespace"
|
|
14604
|
+
});
|
|
14605
|
+
var harnessIdSchema = opaqueIdSchema.brand();
|
|
14606
|
+
var hostThreadIdSchema = opaqueIdSchema.brand();
|
|
14607
|
+
var hostTurnIdSchema = opaqueIdSchema.brand();
|
|
14608
|
+
var hostItemIdSchema = opaqueIdSchema.brand();
|
|
14609
|
+
var hostInteractionIdSchema = opaqueIdSchema.brand();
|
|
14610
|
+
|
|
14611
|
+
// ../../shared-contracts/dist/harness-permission-modes.js
|
|
14612
|
+
var HARNESS_PERMISSION_MODE_ID_MAX_LENGTH = 128;
|
|
14613
|
+
var HARNESS_PERMISSION_MODE_LABEL_MAX_LENGTH = 256;
|
|
14614
|
+
var HARNESS_PERMISSION_MODE_DESCRIPTION_MAX_LENGTH = 1024;
|
|
14615
|
+
var HARNESS_PERMISSION_MODE_CATALOG_MAX_LENGTH = 32;
|
|
14616
|
+
var nonBlankTextSchema = external_exports.string().refine((value) => value.trim().length > 0, {
|
|
14617
|
+
message: "Value must not be empty or whitespace"
|
|
14618
|
+
});
|
|
14619
|
+
var harnessPermissionModeIdSchema = nonBlankTextSchema.max(HARNESS_PERMISSION_MODE_ID_MAX_LENGTH).regex(/^[A-Za-z0-9._~:-]+$/u, "Permission Mode ID must use transport-safe characters").brand();
|
|
14620
|
+
var harnessPermissionModeSchema = external_exports.object({
|
|
14621
|
+
id: harnessPermissionModeIdSchema,
|
|
14622
|
+
label: nonBlankTextSchema.max(HARNESS_PERMISSION_MODE_LABEL_MAX_LENGTH),
|
|
14623
|
+
description: nonBlankTextSchema.max(HARNESS_PERMISSION_MODE_DESCRIPTION_MAX_LENGTH).optional(),
|
|
14624
|
+
dangerous: external_exports.boolean().optional(),
|
|
14625
|
+
localizations: harnessLocalizationsSchema.optional()
|
|
14626
|
+
}).strict();
|
|
14627
|
+
var harnessPermissionModeCatalogSchema = external_exports.object({
|
|
14628
|
+
modes: external_exports.array(harnessPermissionModeSchema).min(1).max(HARNESS_PERMISSION_MODE_CATALOG_MAX_LENGTH),
|
|
14629
|
+
defaultModeId: harnessPermissionModeIdSchema
|
|
14630
|
+
}).strict().superRefine((catalog, context) => {
|
|
14631
|
+
const ids = /* @__PURE__ */ new Set();
|
|
14632
|
+
for (const [index, mode] of catalog.modes.entries()) {
|
|
14633
|
+
if (ids.has(mode.id)) {
|
|
14634
|
+
context.addIssue({
|
|
14635
|
+
code: "custom",
|
|
14636
|
+
message: "Permission Mode IDs must be unique",
|
|
14637
|
+
path: ["modes", index, "id"]
|
|
14638
|
+
});
|
|
14639
|
+
}
|
|
14640
|
+
ids.add(mode.id);
|
|
14703
14641
|
}
|
|
14704
|
-
|
|
14705
|
-
|
|
14706
|
-
|
|
14707
|
-
|
|
14708
|
-
|
|
14709
|
-
|
|
14710
|
-
return "image/svg+xml";
|
|
14711
|
-
case "woff2":
|
|
14712
|
-
return "font/woff2";
|
|
14713
|
-
case "json":
|
|
14714
|
-
return "application/json";
|
|
14715
|
-
case "css":
|
|
14716
|
-
return "text/css";
|
|
14717
|
-
default:
|
|
14718
|
-
return desktopExtensionScreenshotMimeType(resource);
|
|
14719
|
-
}
|
|
14720
|
-
}
|
|
14721
|
-
var hasPortableSegments = (resource) => resource.split("/").every((segment) => !/[. ]$/u.test(segment));
|
|
14722
|
-
var desktopExtensionAssetPathSchema = pluginRelativeResourceSchema.refine((resource) => hasPortableSegments(resource) && desktopExtensionAssetMimeType(resource) !== void 0, "Expected a relative Desktop extension asset path with a supported suffix");
|
|
14723
|
-
var imagePathSchema = pluginRelativeResourceSchema.refine((resource) => desktopExtensionScreenshotMimeType(resource) !== void 0 && hasPortableSegments(resource), "Images must be relative .png, .jpg, .jpeg, or .webp paths with no segments ending in a dot or space");
|
|
14724
|
-
var desktopExtensionHttpUrlSchema = external_exports.string().trim().max(2048).regex(/^https?:\/\/[^/?#\\\s]+/iu, "Expected an HTTP(S) URL").pipe(external_exports.url({ protocol: /^https?$/u })).refine((value) => {
|
|
14725
|
-
const { username, password } = new URL(value);
|
|
14726
|
-
return !username && !password && !/[\\\s]/u.test(value);
|
|
14727
|
-
}, "URL must not contain credentials, backslashes, or whitespace");
|
|
14728
|
-
function localizedText(text2) {
|
|
14729
|
-
return external_exports.strictObject({ en: text2, "zh-CN": text2 });
|
|
14730
|
-
}
|
|
14731
|
-
var desktopExtensionLocalizedTextSchema = localizedText(external_exports.string().trim().min(1));
|
|
14732
|
-
var categoriesSchema = external_exports.array(desktopExtensionCategorySchema).max(desktopExtensionCategorySchema.options.length).refine((categories) => new Set(categories).size === categories.length, "Duplicate categories");
|
|
14733
|
-
var slotsSchema = external_exports.array(desktopExtensionSlotSchema).max(desktopExtensionSlotSchema.options.length).refine((slots) => new Set(slots).size === slots.length, "Duplicate slots");
|
|
14734
|
-
var settingField = {
|
|
14735
|
-
key: external_exports.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/u),
|
|
14736
|
-
label: desktopExtensionLocalizedTextSchema,
|
|
14737
|
-
description: desktopExtensionLocalizedTextSchema.optional()
|
|
14738
|
-
};
|
|
14739
|
-
var numericSetting = {
|
|
14740
|
-
...settingField,
|
|
14741
|
-
step: external_exports.number().positive().optional(),
|
|
14742
|
-
default: external_exports.number().optional()
|
|
14743
|
-
};
|
|
14744
|
-
var settingOption = external_exports.strictObject({
|
|
14745
|
-
value: external_exports.string(),
|
|
14746
|
-
label: desktopExtensionLocalizedTextSchema
|
|
14747
|
-
});
|
|
14748
|
-
var desktopExtensionSettingFieldSchema = external_exports.discriminatedUnion("type", [
|
|
14749
|
-
external_exports.strictObject({
|
|
14750
|
-
...settingField,
|
|
14751
|
-
type: external_exports.literal("boolean"),
|
|
14752
|
-
default: external_exports.boolean().optional()
|
|
14753
|
-
}),
|
|
14754
|
-
external_exports.strictObject({
|
|
14755
|
-
...settingField,
|
|
14756
|
-
type: external_exports.literal("string"),
|
|
14757
|
-
placeholder: desktopExtensionLocalizedTextSchema.optional(),
|
|
14758
|
-
default: external_exports.string().optional()
|
|
14759
|
-
}),
|
|
14760
|
-
external_exports.strictObject({
|
|
14761
|
-
...numericSetting,
|
|
14762
|
-
type: external_exports.literal("number"),
|
|
14763
|
-
min: external_exports.number().optional(),
|
|
14764
|
-
max: external_exports.number().optional()
|
|
14765
|
-
}),
|
|
14766
|
-
external_exports.strictObject({
|
|
14767
|
-
...numericSetting,
|
|
14768
|
-
type: external_exports.literal("range"),
|
|
14769
|
-
min: external_exports.number(),
|
|
14770
|
-
max: external_exports.number()
|
|
14771
|
-
}),
|
|
14772
|
-
external_exports.strictObject({
|
|
14773
|
-
...settingField,
|
|
14774
|
-
type: external_exports.literal("select"),
|
|
14775
|
-
options: external_exports.array(settingOption).min(1),
|
|
14776
|
-
default: external_exports.string().optional()
|
|
14777
|
-
})
|
|
14778
|
-
]).superRefine((field2, ctx) => {
|
|
14779
|
-
const issue2 = (path2, message) => ctx.addIssue({ code: "custom", path: [path2], message });
|
|
14780
|
-
if (field2.type === "number" || field2.type === "range") {
|
|
14781
|
-
const { min = -Infinity, max = Infinity, default: value } = field2;
|
|
14782
|
-
if (min > max)
|
|
14783
|
-
issue2("max", "Must be at least min");
|
|
14784
|
-
if (value !== void 0 && (value < min || value > max))
|
|
14785
|
-
issue2("default", "Must be within min and max");
|
|
14786
|
-
} else if (field2.type === "select") {
|
|
14787
|
-
const values = new Set(field2.options.map(({ value }) => value));
|
|
14788
|
-
if (values.size !== field2.options.length)
|
|
14789
|
-
issue2("options", "Duplicate option values");
|
|
14790
|
-
if (field2.default !== void 0 && !values.has(field2.default))
|
|
14791
|
-
issue2("default", "Must match an option value");
|
|
14792
|
-
}
|
|
14793
|
-
});
|
|
14794
|
-
var manifestHeader = external_exports.object({
|
|
14795
|
-
manifestVersion: external_exports.int().positive(),
|
|
14796
|
-
id: desktopExtensionIdSchema,
|
|
14797
|
-
name: external_exports.union([extensionName, localizedText(extensionName)]),
|
|
14798
|
-
version: external_exports.string().min(1).max(128),
|
|
14799
|
-
desktopApi: external_exports.int().positive()
|
|
14800
|
-
}).passthrough();
|
|
14801
|
-
var desktopExtensionManifestSchema = manifestHeader.extend({
|
|
14802
|
-
manifestVersion: external_exports.literal(1),
|
|
14803
|
-
desktopApi: external_exports.literal(DESKTOP_EXTENSION_API_VERSION),
|
|
14804
|
-
description: external_exports.strictObject({ en: external_exports.string().max(4096), "zh-CN": external_exports.string().max(4096).optional() }).optional(),
|
|
14805
|
-
author: external_exports.string().trim().min(1).max(128).optional(),
|
|
14806
|
-
repository: desktopExtensionHttpUrlSchema.optional(),
|
|
14807
|
-
details: external_exports.strictObject({ en: external_exports.string().max(16384), "zh-CN": external_exports.string().max(16384).optional() }).optional(),
|
|
14808
|
-
icon: imagePathSchema.optional(),
|
|
14809
|
-
screenshots: external_exports.array(imagePathSchema).max(DESKTOP_EXTENSION_SCREENSHOT_LIMIT).refine((screenshots) => new Set(screenshots).size === screenshots.length, "Duplicate screenshots").optional(),
|
|
14810
|
-
desktop: external_exports.strictObject({
|
|
14811
|
-
script: pluginRelativeResourceSchema,
|
|
14812
|
-
style: pluginRelativeResourceSchema.optional()
|
|
14813
|
-
}).optional(),
|
|
14814
|
-
backend: external_exports.strictObject({ script: pluginRelativeResourceSchema.refine(hasPortableSegments) }).optional(),
|
|
14815
|
-
slots: slotsSchema.default(() => []),
|
|
14816
|
-
settingsSchema: external_exports.array(desktopExtensionSettingFieldSchema).max(32).refine((fields2) => new Set(fields2.map(({ key: key2 }) => key2)).size === fields2.length, "Duplicate setting keys").optional(),
|
|
14817
|
-
categories: categoriesSchema.optional()
|
|
14818
|
-
}).strict().refine((manifest) => manifest.desktop !== void 0 || manifest.backend !== void 0, "Expected at least one desktop or backend entry");
|
|
14819
|
-
var desktopExtensionConfigurationSchema = external_exports.strictObject({
|
|
14820
|
-
version: external_exports.literal(1),
|
|
14821
|
-
revision: external_exports.int().nonnegative(),
|
|
14822
|
-
enabled: external_exports.array(desktopExtensionIdSchema).max(DESKTOP_EXTENSION_LIMIT).refine((ids) => new Set(ids).size === ids.length, "Duplicate extension IDs"),
|
|
14823
|
-
reloadToken: external_exports.uuid().optional()
|
|
14824
|
-
});
|
|
14825
|
-
var desktopExtensionHashSchema = external_exports.string().regex(/^[a-f0-9]{64}$/u);
|
|
14826
|
-
var desktopExtensionStatusSchema = external_exports.strictObject({
|
|
14827
|
-
state: external_exports.enum([
|
|
14828
|
-
"running",
|
|
14829
|
-
"disabled",
|
|
14830
|
-
"invalid",
|
|
14831
|
-
"incompatible",
|
|
14832
|
-
"conflict",
|
|
14833
|
-
"failed",
|
|
14834
|
-
"waiting"
|
|
14835
|
-
]),
|
|
14836
|
-
hash: desktopExtensionHashSchema.optional(),
|
|
14837
|
-
error: external_exports.string().optional(),
|
|
14838
|
-
conflictWith: desktopExtensionIdSchema.optional()
|
|
14839
|
-
});
|
|
14840
|
-
var desktopExtensionsDiagnosticSchema = external_exports.strictObject({
|
|
14841
|
-
controllerPid: external_exports.int().positive(),
|
|
14842
|
-
targetId: external_exports.string().nullable(),
|
|
14843
|
-
updatedAt: external_exports.iso.datetime(),
|
|
14844
|
-
handledReloadToken: external_exports.uuid().optional(),
|
|
14845
|
-
extensions: external_exports.record(external_exports.string(), desktopExtensionStatusSchema)
|
|
14846
|
-
});
|
|
14847
|
-
var desktopExtensionTrustTierSchema = external_exports.enum(["official", "community"]);
|
|
14848
|
-
function isGitHubDesktopExtensionZipballUrl(url2) {
|
|
14849
|
-
return url2.origin === "https://api.github.com" && /^\/repos\/[\w-]+\/[\w.-]+\/zipball(?:\/[^/]+)?\/?$/u.test(url2.pathname);
|
|
14850
|
-
}
|
|
14851
|
-
var desktopExtensionZipUrlSchema = desktopExtensionHttpUrlSchema.refine((input) => {
|
|
14852
|
-
const url2 = new URL(input);
|
|
14853
|
-
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);
|
|
14854
|
-
}, "Expected a .zip download URL or a GitHub zipball URL");
|
|
14855
|
-
var desktopExtensionCatalogEntrySchema = external_exports.strictObject({
|
|
14856
|
-
id: desktopExtensionIdSchema,
|
|
14857
|
-
version: external_exports.string().trim().min(1).max(128),
|
|
14858
|
-
name: desktopExtensionLocalizedTextSchema.extend({ en: extensionName, "zh-CN": extensionName }),
|
|
14859
|
-
description: localizedText(external_exports.string().trim().min(1).max(4096)),
|
|
14860
|
-
details: localizedText(external_exports.string().trim().min(1).max(16384)).optional(),
|
|
14861
|
-
author: external_exports.string().trim().min(1).max(128),
|
|
14862
|
-
repository: desktopExtensionHttpUrlSchema,
|
|
14863
|
-
stars: external_exports.number().int().min(0).optional(),
|
|
14864
|
-
downloads: external_exports.number().int().min(0).optional(),
|
|
14865
|
-
categories: categoriesSchema.optional(),
|
|
14866
|
-
trustTier: desktopExtensionTrustTierSchema.default("community"),
|
|
14867
|
-
icon: desktopExtensionHttpUrlSchema.optional(),
|
|
14868
|
-
screenshots: external_exports.array(desktopExtensionHttpUrlSchema).max(DESKTOP_EXTENSION_SCREENSHOT_LIMIT).optional(),
|
|
14869
|
-
downloadUrl: desktopExtensionZipUrlSchema,
|
|
14870
|
-
sha256: desktopExtensionHashSchema,
|
|
14871
|
-
slots: slotsSchema.optional(),
|
|
14872
|
-
publishedAt: external_exports.string().optional(),
|
|
14873
|
-
updatedAt: external_exports.string().optional(),
|
|
14874
|
-
minCodexHostVersion: external_exports.string().optional()
|
|
14875
|
-
});
|
|
14876
|
-
var desktopExtensionCatalogSchema = external_exports.strictObject({
|
|
14877
|
-
schemaVersion: external_exports.literal(1),
|
|
14878
|
-
generatedAt: external_exports.string(),
|
|
14879
|
-
extensions: external_exports.array(desktopExtensionCatalogEntrySchema).refine((entries) => new Set(entries.map(({ id }) => id)).size === entries.length, "Duplicate extension IDs")
|
|
14880
|
-
});
|
|
14881
|
-
var DESKTOP_EXTENSIONS_ASSET_METHOD = "codexhost/desktop/extensions/asset";
|
|
14882
|
-
var DESKTOP_EXTENSIONS_SETTINGS_GET_METHOD = "codexhost/desktop/extensions/settings/get";
|
|
14883
|
-
var DESKTOP_EXTENSIONS_SETTINGS_SET_METHOD = "codexhost/desktop/extensions/settings/set";
|
|
14884
|
-
var DESKTOP_EXTENSIONS_BACKEND_INVOKE_METHOD = "codexhost/desktop/extensions/backend/invoke";
|
|
14885
|
-
var extensionIdParams = { id: desktopExtensionIdSchema };
|
|
14886
|
-
var desktopExtensionsAssetParamsSchema = external_exports.strictObject({
|
|
14887
|
-
...extensionIdParams,
|
|
14888
|
-
path: desktopExtensionAssetPathSchema
|
|
14889
|
-
});
|
|
14890
|
-
var desktopExtensionsAssetResultSchema = external_exports.strictObject({
|
|
14891
|
-
mimeType: external_exports.string(),
|
|
14892
|
-
dataUrl: external_exports.string()
|
|
14893
|
-
});
|
|
14894
|
-
var desktopExtensionsSettingsGetParamsSchema = external_exports.strictObject(extensionIdParams);
|
|
14895
|
-
var desktopExtensionsSettingsSetParamsSchema = external_exports.strictObject({
|
|
14896
|
-
...extensionIdParams,
|
|
14897
|
-
values: jsonObjectSchema
|
|
14898
|
-
});
|
|
14899
|
-
var desktopExtensionsSettingsResultSchema = external_exports.strictObject({ values: jsonObjectSchema });
|
|
14900
|
-
var desktopExtensionBackendMethodSchema = external_exports.string().trim().min(1).max(128);
|
|
14901
|
-
var desktopExtensionsBackendInvokeParamsSchema = external_exports.strictObject({
|
|
14902
|
-
...extensionIdParams,
|
|
14903
|
-
method: desktopExtensionBackendMethodSchema,
|
|
14904
|
-
params: jsonValueSchema.optional()
|
|
14905
|
-
});
|
|
14906
|
-
var desktopExtensionsBackendInvokeResultSchema = external_exports.strictObject({
|
|
14907
|
-
result: jsonValueSchema
|
|
14908
|
-
});
|
|
14909
|
-
|
|
14910
|
-
// ../../shared-contracts/dist/desktop-extension-management.js
|
|
14911
|
-
var DESKTOP_EXTENSIONS_LIST_METHOD = "codexhost/desktop/extensions/list";
|
|
14912
|
-
var DESKTOP_EXTENSIONS_ENABLE_METHOD = "codexhost/desktop/extensions/enable";
|
|
14913
|
-
var DESKTOP_EXTENSIONS_DISABLE_METHOD = "codexhost/desktop/extensions/disable";
|
|
14914
|
-
var DESKTOP_EXTENSIONS_CATALOG_METHOD = "codexhost/desktop/extensions/catalog";
|
|
14915
|
-
var DESKTOP_EXTENSIONS_INSTALL_METHOD = "codexhost/desktop/extensions/install";
|
|
14916
|
-
var DESKTOP_EXTENSIONS_UNINSTALL_METHOD = "codexhost/desktop/extensions/uninstall";
|
|
14917
|
-
var DESKTOP_EXTENSIONS_RECOVER_METHOD = "codexhost/desktop/extensions/disable-all-and-reload";
|
|
14918
|
-
var DESKTOP_EXTENSION_MANAGEMENT_METHODS = [
|
|
14919
|
-
DESKTOP_EXTENSIONS_LIST_METHOD,
|
|
14920
|
-
DESKTOP_EXTENSIONS_ENABLE_METHOD,
|
|
14921
|
-
DESKTOP_EXTENSIONS_DISABLE_METHOD,
|
|
14922
|
-
DESKTOP_EXTENSIONS_RECOVER_METHOD,
|
|
14923
|
-
DESKTOP_EXTENSIONS_CATALOG_METHOD,
|
|
14924
|
-
DESKTOP_EXTENSIONS_INSTALL_METHOD,
|
|
14925
|
-
DESKTOP_EXTENSIONS_UNINSTALL_METHOD,
|
|
14926
|
-
DESKTOP_EXTENSIONS_ASSET_METHOD,
|
|
14927
|
-
DESKTOP_EXTENSIONS_SETTINGS_GET_METHOD,
|
|
14928
|
-
DESKTOP_EXTENSIONS_SETTINGS_SET_METHOD,
|
|
14929
|
-
DESKTOP_EXTENSIONS_BACKEND_INVOKE_METHOD
|
|
14930
|
-
];
|
|
14931
|
-
var revisionSchema = external_exports.int().nonnegative();
|
|
14932
|
-
var desktopExtensionsListParamsSchema = external_exports.strictObject({});
|
|
14933
|
-
var desktopExtensionSelectionParamsSchema = external_exports.strictObject({
|
|
14934
|
-
id: desktopExtensionIdSchema,
|
|
14935
|
-
expectedRevision: revisionSchema
|
|
14936
|
-
});
|
|
14937
|
-
var desktopExtensionsRecoveryParamsSchema = external_exports.strictObject({
|
|
14938
|
-
expectedRevision: revisionSchema.optional()
|
|
14939
|
-
});
|
|
14940
|
-
var rasterDataUrlSchema = (maxBytes) => external_exports.string().max("data:image/jpeg;base64,".length + 4 * Math.ceil(maxBytes / 3)).regex(/^data:image\/(?:png|jpeg|webp);base64,[A-Za-z0-9+/]+={0,2}$/u);
|
|
14941
|
-
var desktopExtensionListItemSchema = external_exports.strictObject({
|
|
14942
|
-
// An invalid discovery can have a directory name that isn't a valid extension ID.
|
|
14943
|
-
id: external_exports.string().min(1),
|
|
14944
|
-
manifest: desktopExtensionManifestSchema.optional(),
|
|
14945
|
-
iconDataUrl: rasterDataUrlSchema(DESKTOP_EXTENSION_ICON_MAX_BYTES).optional(),
|
|
14946
|
-
screenshotDataUrls: external_exports.array(rasterDataUrlSchema(DESKTOP_EXTENSION_SCREENSHOT_MAX_BYTES)).max(DESKTOP_EXTENSION_SCREENSHOT_LIMIT).optional(),
|
|
14947
|
-
enabled: external_exports.boolean(),
|
|
14948
|
-
status: desktopExtensionStatusSchema
|
|
14949
|
-
});
|
|
14950
|
-
var desktopExtensionsListResultSchema = external_exports.strictObject({
|
|
14951
|
-
configuration: desktopExtensionConfigurationSchema,
|
|
14952
|
-
desktopConnected: external_exports.boolean(),
|
|
14953
|
-
diagnostics: external_exports.array(external_exports.string()),
|
|
14954
|
-
extensions: external_exports.array(desktopExtensionListItemSchema)
|
|
14955
|
-
});
|
|
14956
|
-
var desktopExtensionsCatalogParamsSchema = external_exports.strictObject({
|
|
14957
|
-
forceRefresh: external_exports.boolean().optional()
|
|
14958
|
-
});
|
|
14959
|
-
var desktopExtensionsCatalogResultSchema = external_exports.strictObject({
|
|
14960
|
-
catalogUrl: external_exports.string(),
|
|
14961
|
-
source: external_exports.enum(["remote", "fallback"]),
|
|
14962
|
-
fetchedAt: external_exports.string(),
|
|
14963
|
-
cached: external_exports.boolean(),
|
|
14964
|
-
extensions: desktopExtensionCatalogSchema.shape.extensions,
|
|
14965
|
-
error: external_exports.string().optional()
|
|
14966
|
-
});
|
|
14967
|
-
var desktopExtensionsInstallParamsSchema = external_exports.strictObject({
|
|
14968
|
-
source: external_exports.discriminatedUnion("type", [
|
|
14969
|
-
external_exports.strictObject({ type: external_exports.literal("catalog"), id: desktopExtensionIdSchema }),
|
|
14970
|
-
external_exports.strictObject({
|
|
14971
|
-
type: external_exports.literal("url"),
|
|
14972
|
-
url: desktopExtensionHttpUrlSchema,
|
|
14973
|
-
expectedSha256: desktopExtensionHashSchema.optional()
|
|
14974
|
-
}),
|
|
14975
|
-
external_exports.strictObject({
|
|
14976
|
-
type: external_exports.literal("zip-base64"),
|
|
14977
|
-
fileName: external_exports.string().trim().min(1).max(255),
|
|
14978
|
-
contentBase64: external_exports.string().min(4).max(DESKTOP_EXTENSION_ZIP_MAX_BASE64_LENGTH).refine((value) => value.length % 4 === 0 && /^[A-Za-z0-9+/]+={0,2}$/u.test(value), "Expected standard padded base64")
|
|
14979
|
-
})
|
|
14980
|
-
])
|
|
14981
|
-
});
|
|
14982
|
-
var desktopExtensionsInstallResultSchema = external_exports.strictObject({
|
|
14983
|
-
extensionId: desktopExtensionIdSchema,
|
|
14984
|
-
version: external_exports.string().min(1),
|
|
14985
|
-
replaced: external_exports.boolean(),
|
|
14986
|
-
installedPath: external_exports.string(),
|
|
14987
|
-
list: desktopExtensionsListResultSchema
|
|
14988
|
-
});
|
|
14989
|
-
var desktopExtensionsUninstallParamsSchema = external_exports.strictObject({
|
|
14990
|
-
id: desktopExtensionIdSchema
|
|
14991
|
-
});
|
|
14992
|
-
var desktopExtensionsUninstallResultSchema = external_exports.strictObject({
|
|
14993
|
-
removedId: desktopExtensionIdSchema,
|
|
14994
|
-
list: desktopExtensionsListResultSchema
|
|
14995
|
-
});
|
|
14996
|
-
var desktopExtensionMutationResultSchema = external_exports.discriminatedUnion("state", [
|
|
14997
|
-
external_exports.strictObject({ state: external_exports.literal("saved"), configuration: desktopExtensionConfigurationSchema }),
|
|
14998
|
-
external_exports.strictObject({ state: external_exports.literal("slot-conflict"), conflictWith: desktopExtensionIdSchema }),
|
|
14999
|
-
external_exports.strictObject({ state: external_exports.literal("revision-conflict"), revision: revisionSchema })
|
|
15000
|
-
]);
|
|
15001
|
-
|
|
15002
|
-
// ../../shared-contracts/dist/errors.js
|
|
15003
|
-
var codexhostErrorSchema = external_exports.strictObject({
|
|
15004
|
-
code: external_exports.string().min(1),
|
|
15005
|
-
message: external_exports.string().min(1),
|
|
15006
|
-
retryable: external_exports.boolean(),
|
|
15007
|
-
diagnostic: external_exports.string().min(1).optional(),
|
|
15008
|
-
stage: external_exports.string().min(1).optional(),
|
|
15009
|
-
durationMs: external_exports.number().int().nonnegative().optional(),
|
|
15010
|
-
stderrTail: external_exports.string().min(1).optional()
|
|
15011
|
-
}).superRefine(rejectExplicitUndefined(["diagnostic", "stage", "durationMs", "stderrTail"]));
|
|
15012
|
-
|
|
15013
|
-
// ../../shared-contracts/dist/harness-presentation.js
|
|
15014
|
-
var localeSchema = external_exports.string().max(64).regex(/^[a-z]{2,3}(?:-[A-Za-z0-9]{2,8})*$/u);
|
|
15015
|
-
var displayText = (maximum) => external_exports.string().min(1).max(maximum).refine((text2) => text2.trim().length > 0);
|
|
15016
|
-
var harnessLocalizationsSchema = external_exports.record(localeSchema, external_exports.object({
|
|
15017
|
-
label: displayText(256).optional(),
|
|
15018
|
-
description: displayText(1024).optional()
|
|
15019
|
-
}).strict()).refine((entries) => Object.keys(entries).length <= 16, "Too many locales");
|
|
15020
|
-
var harnessLocalizedTextSchema = external_exports.record(localeSchema, displayText(4096)).refine((entries) => typeof entries.en === "string", "English fallback is required").refine((entries) => Object.keys(entries).length <= 16, "Too many locales");
|
|
15021
|
-
|
|
15022
|
-
// ../../shared-contracts/dist/harness-permission-modes.js
|
|
15023
|
-
var HARNESS_PERMISSION_MODE_ID_MAX_LENGTH = 128;
|
|
15024
|
-
var HARNESS_PERMISSION_MODE_LABEL_MAX_LENGTH = 256;
|
|
15025
|
-
var HARNESS_PERMISSION_MODE_DESCRIPTION_MAX_LENGTH = 1024;
|
|
15026
|
-
var HARNESS_PERMISSION_MODE_CATALOG_MAX_LENGTH = 32;
|
|
15027
|
-
var nonBlankTextSchema = external_exports.string().refine((value) => value.trim().length > 0, {
|
|
15028
|
-
message: "Value must not be empty or whitespace"
|
|
15029
|
-
});
|
|
15030
|
-
var harnessPermissionModeIdSchema = nonBlankTextSchema.max(HARNESS_PERMISSION_MODE_ID_MAX_LENGTH).regex(/^[A-Za-z0-9._~:-]+$/u, "Permission Mode ID must use transport-safe characters").brand();
|
|
15031
|
-
var harnessPermissionModeSchema = external_exports.object({
|
|
15032
|
-
id: harnessPermissionModeIdSchema,
|
|
15033
|
-
label: nonBlankTextSchema.max(HARNESS_PERMISSION_MODE_LABEL_MAX_LENGTH),
|
|
15034
|
-
description: nonBlankTextSchema.max(HARNESS_PERMISSION_MODE_DESCRIPTION_MAX_LENGTH).optional(),
|
|
15035
|
-
dangerous: external_exports.boolean().optional(),
|
|
15036
|
-
localizations: harnessLocalizationsSchema.optional()
|
|
15037
|
-
}).strict();
|
|
15038
|
-
var harnessPermissionModeCatalogSchema = external_exports.object({
|
|
15039
|
-
modes: external_exports.array(harnessPermissionModeSchema).min(1).max(HARNESS_PERMISSION_MODE_CATALOG_MAX_LENGTH),
|
|
15040
|
-
defaultModeId: harnessPermissionModeIdSchema
|
|
15041
|
-
}).strict().superRefine((catalog, context) => {
|
|
15042
|
-
const ids = /* @__PURE__ */ new Set();
|
|
15043
|
-
for (const [index, mode] of catalog.modes.entries()) {
|
|
15044
|
-
if (ids.has(mode.id)) {
|
|
15045
|
-
context.addIssue({
|
|
15046
|
-
code: "custom",
|
|
15047
|
-
message: "Permission Mode IDs must be unique",
|
|
15048
|
-
path: ["modes", index, "id"]
|
|
15049
|
-
});
|
|
15050
|
-
}
|
|
15051
|
-
ids.add(mode.id);
|
|
15052
|
-
}
|
|
15053
|
-
if (!ids.has(catalog.defaultModeId)) {
|
|
15054
|
-
context.addIssue({
|
|
15055
|
-
code: "custom",
|
|
15056
|
-
message: "Default Permission Mode must exist in the catalog",
|
|
15057
|
-
path: ["defaultModeId"]
|
|
15058
|
-
});
|
|
14642
|
+
if (!ids.has(catalog.defaultModeId)) {
|
|
14643
|
+
context.addIssue({
|
|
14644
|
+
code: "custom",
|
|
14645
|
+
message: "Default Permission Mode must exist in the catalog",
|
|
14646
|
+
path: ["defaultModeId"]
|
|
14647
|
+
});
|
|
15059
14648
|
}
|
|
15060
14649
|
});
|
|
15061
14650
|
var threadPermissionModeSelectParamsSchema = external_exports.object({
|
|
@@ -15063,6 +14652,9 @@ var threadPermissionModeSelectParamsSchema = external_exports.object({
|
|
|
15063
14652
|
permissionModeId: harnessPermissionModeIdSchema
|
|
15064
14653
|
}).strict();
|
|
15065
14654
|
|
|
14655
|
+
// ../../shared-contracts/dist/harness-route-limit.js
|
|
14656
|
+
var HARNESS_TRANSPORT_MODEL_ID_MAX_LENGTH = 8192;
|
|
14657
|
+
|
|
15066
14658
|
// ../../shared-contracts/dist/thread-usage.js
|
|
15067
14659
|
var nonNegativeSafeIntegerSchema = external_exports.number().int().safe().nonnegative();
|
|
15068
14660
|
var finiteNonNegativeNumberSchema = external_exports.number().finite().nonnegative();
|
|
@@ -15088,14 +14680,14 @@ var usageMeasurementsSchema = external_exports.object({
|
|
|
15088
14680
|
outputTokensPerSecond: usageMeasurementSchema.refine((value) => value.version === 4).optional().catch(void 0),
|
|
15089
14681
|
timeToFirstOutputMs: usageMeasurementSchema.extend({ value: nonNegativeSafeIntegerSchema }).optional()
|
|
15090
14682
|
}).strict();
|
|
15091
|
-
var indicatorTextSchema = (maximum) => harnessLocalizedTextSchema.refine((entries) => Object.values(entries).every((
|
|
14683
|
+
var indicatorTextSchema = (maximum) => harnessLocalizedTextSchema.refine((entries) => Object.values(entries).every((text3) => text3.length <= maximum));
|
|
15092
14684
|
var composerIndicatorsSchema = external_exports.array(external_exports.object({
|
|
15093
14685
|
kind: external_exports.literal("countdown"),
|
|
15094
14686
|
id: external_exports.string().min(1).max(64),
|
|
15095
14687
|
expiresAtUnix: nonNegativeSafeIntegerSchema,
|
|
15096
14688
|
label: indicatorTextSchema(256).optional(),
|
|
15097
14689
|
tooltip: indicatorTextSchema(1024).optional()
|
|
15098
|
-
}).strict()).max(2).refine((entries) => new Set(entries.map(({ id }) =>
|
|
14690
|
+
}).strict()).max(2).refine((entries) => new Set(entries.map(({ id: id2 }) => id2)).size === entries.length, {
|
|
15099
14691
|
message: "Composer indicator IDs must be unique"
|
|
15100
14692
|
});
|
|
15101
14693
|
var threadUsageSnapshotSchema = external_exports.object({
|
|
@@ -15121,6 +14713,7 @@ var threadUsageSnapshotSchema = external_exports.object({
|
|
|
15121
14713
|
planSevenDayResetsAtUnix: nonNegativeSafeIntegerSchema.optional(),
|
|
15122
14714
|
sessionCacheHitRatePercent: cacheHitRatePercentSchema.optional(),
|
|
15123
14715
|
timeToFirstOutputMs: nonNegativeSafeIntegerSchema.optional(),
|
|
14716
|
+
latestRequestTimeToFirstOutputMs: nonNegativeSafeIntegerSchema.optional(),
|
|
15124
14717
|
costSource: external_exports.enum(["publicPrice", "native"]).optional(),
|
|
15125
14718
|
unpricedModels: external_exports.array(external_exports.string().min(1)).min(1).optional()
|
|
15126
14719
|
}).strict().superRefine((usage2, context) => {
|
|
@@ -15248,10 +14841,15 @@ var THREAD_OWNERSHIP_LIST_MAX_LENGTH = 100;
|
|
|
15248
14841
|
var nonBlankTextSchema2 = external_exports.string().refine((value) => value.trim().length > 0, {
|
|
15249
14842
|
message: "Value must not be empty or whitespace"
|
|
15250
14843
|
});
|
|
15251
|
-
var harnessModelRefIdSchema =
|
|
14844
|
+
var harnessModelRefIdSchema = external_exports.string().min(1).max(HARNESS_MODEL_REF_MAX_LENGTH).refine((id2) => !new RegExp("\\p{Cc}", "u").test(id2), "Model Ref must not contain control characters").brand();
|
|
14845
|
+
var harnessModelServiceTierSchema = external_exports.enum(["priority", "ultrafast"]);
|
|
15252
14846
|
var harnessModelRefSchema = external_exports.object({
|
|
15253
|
-
id: harnessModelRefIdSchema
|
|
14847
|
+
id: harnessModelRefIdSchema,
|
|
14848
|
+
serviceTier: harnessModelServiceTierSchema.optional()
|
|
15254
14849
|
}).strict();
|
|
14850
|
+
function sameHarnessModelRef(left, right) {
|
|
14851
|
+
return left?.id === right?.id && left?.serviceTier === right?.serviceTier;
|
|
14852
|
+
}
|
|
15255
14853
|
var harnessThinkingOptionIdSchema = nonBlankTextSchema2.max(HARNESS_THINKING_OPTION_ID_MAX_LENGTH).regex(/^[A-Za-z0-9._~-]+$/u, "Thinking option ID must use transport-safe characters").brand();
|
|
15256
14854
|
var harnessResolvedModelLabelSchema = nonBlankTextSchema2.max(HARNESS_MODEL_LABEL_MAX_LENGTH);
|
|
15257
14855
|
var harnessThinkingOptionSchema = external_exports.object({
|
|
@@ -15265,7 +14863,15 @@ var harnessModelSchema = external_exports.object({
|
|
|
15265
14863
|
/** Optional opaque selection for this same Model with priority processing enabled. */
|
|
15266
14864
|
fastModel: harnessModelRefSchema.optional(),
|
|
15267
14865
|
supportedThinkingOptionIds: external_exports.array(harnessThinkingOptionIdSchema).optional()
|
|
15268
|
-
}).strict()
|
|
14866
|
+
}).strict().refine((model2) => model2.fastModel?.serviceTier === void 0 || model2.fastModel.id === model2.ref.id, {
|
|
14867
|
+
path: ["fastModel", "id"],
|
|
14868
|
+
message: "A tiered Fast Model must share the base Model ID"
|
|
14869
|
+
});
|
|
14870
|
+
function catalogModelForRef(catalog, ref) {
|
|
14871
|
+
if (!ref)
|
|
14872
|
+
return void 0;
|
|
14873
|
+
return catalog?.models.find((model2) => sameHarnessModelRef(model2.ref, ref) || sameHarnessModelRef(model2.fastModel, ref));
|
|
14874
|
+
}
|
|
15269
14875
|
var harnessThinkingOptionsSchema = external_exports.array(harnessThinkingOptionSchema).superRefine((options, context) => {
|
|
15270
14876
|
const ids = /* @__PURE__ */ new Set();
|
|
15271
14877
|
for (const [index, option] of options.entries()) {
|
|
@@ -15285,26 +14891,26 @@ var harnessModelCatalogSchema = external_exports.object({
|
|
|
15285
14891
|
thinkingOptions: harnessThinkingOptionsSchema,
|
|
15286
14892
|
defaultThinkingOptionId: harnessThinkingOptionIdSchema.optional()
|
|
15287
14893
|
}).strict().superRefine((catalog, context) => {
|
|
15288
|
-
const refs =
|
|
15289
|
-
const thinkingIds = new Set(catalog.thinkingOptions.map(({ id }) =>
|
|
14894
|
+
const refs = [];
|
|
14895
|
+
const thinkingIds = new Set(catalog.thinkingOptions.map(({ id: id2 }) => id2));
|
|
15290
14896
|
for (const [index, model2] of catalog.models.entries()) {
|
|
15291
|
-
if (refs.
|
|
14897
|
+
if (refs.some((ref) => sameHarnessModelRef(ref, model2.ref))) {
|
|
15292
14898
|
context.addIssue({
|
|
15293
14899
|
code: "custom",
|
|
15294
14900
|
message: "Model Catalog refs must be unique",
|
|
15295
14901
|
path: ["models", index, "ref", "id"]
|
|
15296
14902
|
});
|
|
15297
14903
|
}
|
|
15298
|
-
refs.
|
|
14904
|
+
refs.push(model2.ref);
|
|
15299
14905
|
if (model2.fastModel) {
|
|
15300
|
-
if (refs.
|
|
14906
|
+
if (refs.some((ref) => sameHarnessModelRef(ref, model2.fastModel))) {
|
|
15301
14907
|
context.addIssue({
|
|
15302
14908
|
code: "custom",
|
|
15303
14909
|
message: "Fast Model refs must be distinct and unique",
|
|
15304
14910
|
path: ["models", index, "fastModel"]
|
|
15305
14911
|
});
|
|
15306
14912
|
}
|
|
15307
|
-
refs.
|
|
14913
|
+
refs.push(model2.fastModel);
|
|
15308
14914
|
}
|
|
15309
14915
|
const supportedThinkingIds = /* @__PURE__ */ new Set();
|
|
15310
14916
|
for (const [optionIndex, optionId] of (model2.supportedThinkingOptionIds ?? []).entries()) {
|
|
@@ -15325,7 +14931,7 @@ var harnessModelCatalogSchema = external_exports.object({
|
|
|
15325
14931
|
}
|
|
15326
14932
|
}
|
|
15327
14933
|
}
|
|
15328
|
-
if (catalog.defaultModel && !
|
|
14934
|
+
if (catalog.defaultModel && !catalogModelForRef(catalog, catalog.defaultModel)) {
|
|
15329
14935
|
context.addIssue({
|
|
15330
14936
|
code: "custom",
|
|
15331
14937
|
message: "Default Model must exist in the Model Catalog",
|
|
@@ -15365,7 +14971,12 @@ var harnessSessionCapabilitiesSchema = external_exports.object({
|
|
|
15365
14971
|
observe: external_exports.boolean()
|
|
15366
14972
|
}).strict().optional(),
|
|
15367
14973
|
/** True only when `turn.steer` delivers input into the active Turn through a native primitive. */
|
|
15368
|
-
steer: external_exports.boolean().optional()
|
|
14974
|
+
steer: external_exports.boolean().optional(),
|
|
14975
|
+
/**
|
|
14976
|
+
* True when the native plan (task list) outlives the Turn that changed it, so a reopened
|
|
14977
|
+
* Thread gets its latest plan again. Otherwise a plan stays with the Turn that made it.
|
|
14978
|
+
*/
|
|
14979
|
+
persistentPlan: external_exports.boolean().optional()
|
|
15369
14980
|
}).strict();
|
|
15370
14981
|
var harnessConfigurationStateSchema = external_exports.object({
|
|
15371
14982
|
effectiveModel: harnessModelRefSchema.optional(),
|
|
@@ -15374,7 +14985,7 @@ var harnessConfigurationStateSchema = external_exports.object({
|
|
|
15374
14985
|
availableThinkingOptions: harnessThinkingOptionsSchema.optional(),
|
|
15375
14986
|
effectivePermissionModeId: harnessPermissionModeIdSchema.optional()
|
|
15376
14987
|
}).strict().superRefine((state, context) => {
|
|
15377
|
-
if (state.effectiveThinkingOptionId && state.availableThinkingOptions && !state.availableThinkingOptions.some(({ id }) =>
|
|
14988
|
+
if (state.effectiveThinkingOptionId && state.availableThinkingOptions && !state.availableThinkingOptions.some(({ id: id2 }) => id2 === state.effectiveThinkingOptionId)) {
|
|
15378
14989
|
context.addIssue({
|
|
15379
14990
|
code: "custom",
|
|
15380
14991
|
message: "Effective Thinking option must be currently available",
|
|
@@ -15382,150 +14993,698 @@ var harnessConfigurationStateSchema = external_exports.object({
|
|
|
15382
14993
|
});
|
|
15383
14994
|
}
|
|
15384
14995
|
});
|
|
15385
|
-
var harnessWebUiCapabilitySchema = external_exports.object({
|
|
15386
|
-
open: external_exports.literal(true)
|
|
15387
|
-
}).strict();
|
|
15388
|
-
var readyHarnessInspectionSchema = external_exports.object({
|
|
15389
|
-
status: external_exports.literal("ready"),
|
|
15390
|
-
catalog: harnessModelCatalogSchema,
|
|
15391
|
-
permissionModes: harnessPermissionModeCatalogSchema.optional(),
|
|
15392
|
-
capabilities: harnessSessionCapabilitiesSchema,
|
|
15393
|
-
webUi: harnessWebUiCapabilitySchema.optional()
|
|
15394
|
-
}).strict().superRefine((inspection, context) => {
|
|
15395
|
-
const selectable = inspection.capabilities.configuration.selectPermissionMode;
|
|
15396
|
-
if (selectable !== Boolean(inspection.permissionModes)) {
|
|
15397
|
-
context.addIssue({
|
|
15398
|
-
code: "custom",
|
|
15399
|
-
message: "Permission Mode catalog and capability must agree",
|
|
15400
|
-
path: selectable ? ["permissionModes"] : ["capabilities", "configuration", "selectPermissionMode"]
|
|
15401
|
-
});
|
|
15402
|
-
}
|
|
14996
|
+
var harnessWebUiCapabilitySchema = external_exports.object({
|
|
14997
|
+
open: external_exports.literal(true)
|
|
14998
|
+
}).strict();
|
|
14999
|
+
var readyHarnessInspectionSchema = external_exports.object({
|
|
15000
|
+
status: external_exports.literal("ready"),
|
|
15001
|
+
catalog: harnessModelCatalogSchema,
|
|
15002
|
+
permissionModes: harnessPermissionModeCatalogSchema.optional(),
|
|
15003
|
+
capabilities: harnessSessionCapabilitiesSchema,
|
|
15004
|
+
webUi: harnessWebUiCapabilitySchema.optional()
|
|
15005
|
+
}).strict().superRefine((inspection, context) => {
|
|
15006
|
+
const selectable = inspection.capabilities.configuration.selectPermissionMode;
|
|
15007
|
+
if (selectable !== Boolean(inspection.permissionModes)) {
|
|
15008
|
+
context.addIssue({
|
|
15009
|
+
code: "custom",
|
|
15010
|
+
message: "Permission Mode catalog and capability must agree",
|
|
15011
|
+
path: selectable ? ["permissionModes"] : ["capabilities", "configuration", "selectPermissionMode"]
|
|
15012
|
+
});
|
|
15013
|
+
}
|
|
15014
|
+
});
|
|
15015
|
+
var failedHarnessInspectionSchema = external_exports.object({
|
|
15016
|
+
status: external_exports.enum(["notInstalled", "unavailable", "error"]),
|
|
15017
|
+
error: codexhostErrorSchema
|
|
15018
|
+
}).strict();
|
|
15019
|
+
var harnessInspectionSchema = external_exports.union([
|
|
15020
|
+
readyHarnessInspectionSchema,
|
|
15021
|
+
failedHarnessInspectionSchema
|
|
15022
|
+
]);
|
|
15023
|
+
var harnessInspectParamsSchema = external_exports.object({
|
|
15024
|
+
harnessId: harnessIdSchema,
|
|
15025
|
+
cwd: nonBlankTextSchema2.max(16384).optional(),
|
|
15026
|
+
refresh: external_exports.boolean().optional(),
|
|
15027
|
+
/** `availability` asks only whether the Harness can run; see `InspectHarnessInput.purpose`. */
|
|
15028
|
+
purpose: external_exports.literal("availability").optional(),
|
|
15029
|
+
credentialAccess: external_exports.enum(["allow", "retry"]).optional()
|
|
15030
|
+
}).strict();
|
|
15031
|
+
var harnessWebUiOpenParamsSchema = external_exports.object({
|
|
15032
|
+
harnessId: harnessIdSchema
|
|
15033
|
+
}).strict();
|
|
15034
|
+
var harnessWebUiOpenResultSchema = external_exports.object({}).strict();
|
|
15035
|
+
var threadModelSelectParamsSchema = external_exports.object({
|
|
15036
|
+
threadId: hostThreadIdSchema,
|
|
15037
|
+
model: harnessModelRefSchema
|
|
15038
|
+
}).strict();
|
|
15039
|
+
var threadThinkingSelectParamsSchema = external_exports.object({
|
|
15040
|
+
threadId: hostThreadIdSchema,
|
|
15041
|
+
thinkingOptionId: harnessThinkingOptionIdSchema
|
|
15042
|
+
}).strict();
|
|
15043
|
+
var threadInspectionParamsSchema = external_exports.object({
|
|
15044
|
+
threadId: hostThreadIdSchema,
|
|
15045
|
+
includeReferenceCapability: external_exports.boolean().optional()
|
|
15046
|
+
}).strict();
|
|
15047
|
+
var codexThreadInspectionSchema = external_exports.object({
|
|
15048
|
+
owner: external_exports.literal("codex"),
|
|
15049
|
+
locked: external_exports.boolean(),
|
|
15050
|
+
effectiveModel: harnessModelRefSchema.optional(),
|
|
15051
|
+
resolvedModelLabel: harnessResolvedModelLabelSchema.optional(),
|
|
15052
|
+
effectiveThinkingOptionId: harnessThinkingOptionIdSchema.optional(),
|
|
15053
|
+
effectivePermissionModeId: harnessPermissionModeIdSchema.optional(),
|
|
15054
|
+
history: harnessHistoryCapabilitiesSchema.optional(),
|
|
15055
|
+
supportsThreadReferences: external_exports.literal(true).optional()
|
|
15056
|
+
}).strict();
|
|
15057
|
+
var externalThreadInspectionSchema = external_exports.object({
|
|
15058
|
+
owner: external_exports.literal("external"),
|
|
15059
|
+
harnessId: nonBlankTextSchema2.max(256),
|
|
15060
|
+
transportModelId: nonBlankTextSchema2.max(HARNESS_TRANSPORT_MODEL_ID_MAX_LENGTH),
|
|
15061
|
+
effectiveModel: harnessModelRefSchema.optional(),
|
|
15062
|
+
resolvedModelLabel: harnessResolvedModelLabelSchema.optional(),
|
|
15063
|
+
effectiveThinkingOptionId: harnessThinkingOptionIdSchema.optional(),
|
|
15064
|
+
availableThinkingOptions: harnessThinkingOptionsSchema.optional(),
|
|
15065
|
+
effectivePermissionModeId: harnessPermissionModeIdSchema.optional(),
|
|
15066
|
+
/** Live Session catalog when it, not the Adapter inspection, contains `effectiveModel`. */
|
|
15067
|
+
catalog: harnessModelCatalogSchema.optional(),
|
|
15068
|
+
history: harnessHistoryCapabilitiesSchema,
|
|
15069
|
+
usage: threadUsageSnapshotSchema.optional(),
|
|
15070
|
+
locked: external_exports.literal(true)
|
|
15071
|
+
}).strict();
|
|
15072
|
+
var threadInspectionSchema = external_exports.discriminatedUnion("owner", [
|
|
15073
|
+
codexThreadInspectionSchema,
|
|
15074
|
+
externalThreadInspectionSchema
|
|
15075
|
+
]);
|
|
15076
|
+
var threadOwnershipListParamsSchema = external_exports.object({
|
|
15077
|
+
threadIds: external_exports.array(hostThreadIdSchema).min(1).max(THREAD_OWNERSHIP_LIST_MAX_LENGTH)
|
|
15078
|
+
}).strict().superRefine(({ threadIds }, context) => {
|
|
15079
|
+
const seen = /* @__PURE__ */ new Set();
|
|
15080
|
+
for (const [index, threadId] of threadIds.entries()) {
|
|
15081
|
+
if (seen.has(threadId)) {
|
|
15082
|
+
context.addIssue({
|
|
15083
|
+
code: "custom",
|
|
15084
|
+
message: "Thread ownership-list IDs must be unique",
|
|
15085
|
+
path: ["threadIds", index]
|
|
15086
|
+
});
|
|
15087
|
+
}
|
|
15088
|
+
seen.add(threadId);
|
|
15089
|
+
}
|
|
15090
|
+
});
|
|
15091
|
+
var codexThreadOwnershipSchema = external_exports.object({
|
|
15092
|
+
threadId: hostThreadIdSchema,
|
|
15093
|
+
owner: external_exports.literal("codex")
|
|
15094
|
+
}).strict();
|
|
15095
|
+
var externalThreadOwnershipSchema = external_exports.object({
|
|
15096
|
+
threadId: hostThreadIdSchema,
|
|
15097
|
+
owner: external_exports.literal("external"),
|
|
15098
|
+
harnessId: external_exports.string().max(256).pipe(harnessIdSchema)
|
|
15099
|
+
}).strict();
|
|
15100
|
+
var threadOwnershipSchema = external_exports.discriminatedUnion("owner", [
|
|
15101
|
+
codexThreadOwnershipSchema,
|
|
15102
|
+
externalThreadOwnershipSchema
|
|
15103
|
+
]);
|
|
15104
|
+
var threadOwnershipListResultSchema = external_exports.object({
|
|
15105
|
+
threads: external_exports.array(threadOwnershipSchema).min(1).max(THREAD_OWNERSHIP_LIST_MAX_LENGTH)
|
|
15106
|
+
}).strict().superRefine(({ threads }, context) => {
|
|
15107
|
+
const seen = /* @__PURE__ */ new Set();
|
|
15108
|
+
for (const [index, thread2] of threads.entries()) {
|
|
15109
|
+
if (seen.has(thread2.threadId)) {
|
|
15110
|
+
context.addIssue({
|
|
15111
|
+
code: "custom",
|
|
15112
|
+
message: "Thread ownership-list results must be unique",
|
|
15113
|
+
path: ["threads", index, "threadId"]
|
|
15114
|
+
});
|
|
15115
|
+
}
|
|
15116
|
+
seen.add(thread2.threadId);
|
|
15117
|
+
}
|
|
15118
|
+
});
|
|
15119
|
+
var threadSteeringInspectParamsSchema = external_exports.object({
|
|
15120
|
+
threadId: hostThreadIdSchema,
|
|
15121
|
+
/** The text about to be steered; a Harness command always stops and restarts. */
|
|
15122
|
+
text: external_exports.string().optional()
|
|
15123
|
+
}).strict();
|
|
15124
|
+
var threadSteeringContextSchema = external_exports.object({
|
|
15125
|
+
kind: external_exports.literal("application"),
|
|
15126
|
+
value: external_exports.string().transform((text3, context) => {
|
|
15127
|
+
try {
|
|
15128
|
+
return JSON.parse(text3);
|
|
15129
|
+
} catch {
|
|
15130
|
+
context.addIssue({ code: "custom", message: "Invalid steering context JSON" });
|
|
15131
|
+
return external_exports.NEVER;
|
|
15132
|
+
}
|
|
15133
|
+
}).pipe(external_exports.object({
|
|
15134
|
+
expectedTurnId: hostTurnIdSchema,
|
|
15135
|
+
clientUserMessageId: external_exports.string().min(1),
|
|
15136
|
+
delivery: external_exports.enum(["newTurn", "activeTurn"])
|
|
15137
|
+
}).strict())
|
|
15138
|
+
}).strict().transform((context) => context.value);
|
|
15139
|
+
var threadSteerDeliverySchema = external_exports.enum(["activeTurn", "newTurn"]);
|
|
15140
|
+
var threadSteeringInspectResultSchema = external_exports.object({
|
|
15141
|
+
delivery: external_exports.enum(["official", "activeTurn", "newTurn"])
|
|
15142
|
+
}).strict();
|
|
15143
|
+
|
|
15144
|
+
// ../../shared-contracts/dist/harness-plugins.js
|
|
15145
|
+
var HARNESS_PLUGIN_MANIFEST_MAX_BYTES = 32 * 1024;
|
|
15146
|
+
var HARNESS_PLUGIN_ICON_MAX_BYTES = 128 * 1024;
|
|
15147
|
+
var HARNESS_PLUGIN_LIMIT = 128;
|
|
15148
|
+
var installedPluginIdSchema = external_exports.string().min(1).max(128).regex(/^[a-z][a-z0-9]*(?:[._-][a-z0-9]+)*$/u);
|
|
15149
|
+
var installedHarnessPluginIdSchema = installedPluginIdSchema.pipe(harnessIdSchema);
|
|
15150
|
+
var harnessPluginIdSchema = installedHarnessPluginIdSchema.refine((id2) => id2 !== "codex", "The official Codex identity is reserved");
|
|
15151
|
+
var pluginRelativeResourceSchema = external_exports.string().min(1).max(512).refine((value) => !/[\\\u0000:#?]/u.test(value) && !value.startsWith("/") && !value.split("/").some((part) => part === ".." || part === ""), "Plugin resources must be relative paths inside the plugin");
|
|
15152
|
+
var documentationUrlSchema = external_exports.url().refine((value) => /^https:\/\/[^/?#@]+(?:[/?#]|$)/iu.test(value), "Plugin documentation links must be credential-free HTTPS URLs");
|
|
15153
|
+
var localizedTextSchema = external_exports.object({ en: external_exports.string().max(4096), "zh-CN": external_exports.string().max(4096).optional() }).strict();
|
|
15154
|
+
var harnessInstallationGuideSchema = external_exports.object({
|
|
15155
|
+
commands: external_exports.array(external_exports.object({ terminal: external_exports.string().max(256), command: external_exports.string().max(4096) }).strict()).max(8),
|
|
15156
|
+
before: localizedTextSchema.optional(),
|
|
15157
|
+
after: localizedTextSchema.optional(),
|
|
15158
|
+
downloads: external_exports.array(external_exports.object({ label: external_exports.string().max(128), url: documentationUrlSchema }).strict()).max(8).optional()
|
|
15159
|
+
}).strict();
|
|
15160
|
+
var pluginPresentationShape = {
|
|
15161
|
+
id: installedHarnessPluginIdSchema,
|
|
15162
|
+
name: external_exports.string().trim().min(1).max(128),
|
|
15163
|
+
version: external_exports.string().min(1).max(128),
|
|
15164
|
+
/** Capability-only plugin; omitted for existing session-capable plugins. */
|
|
15165
|
+
kind: external_exports.literal("usage").optional(),
|
|
15166
|
+
/** Original image styling or bounded vector paths; never arbitrary CSS/SVG markup. */
|
|
15167
|
+
iconStyle: external_exports.object({
|
|
15168
|
+
vector: external_exports.object({
|
|
15169
|
+
viewBox: external_exports.string().max(128).regex(/^-?\d+(?:\.\d+)?(?: +-?\d+(?:\.\d+)?){3}$/u),
|
|
15170
|
+
color: external_exports.string().regex(/^(?:currentColor|#[a-f0-9]{6})$/iu),
|
|
15171
|
+
paths: external_exports.array(external_exports.object({
|
|
15172
|
+
d: external_exports.string().min(1).max(32768).regex(/^[MmLlHhVvCcSsQqTtAaZz\d.,+eE\s-]+$/u),
|
|
15173
|
+
fillRule: external_exports.enum(["evenodd", "nonzero"]).optional(),
|
|
15174
|
+
fill: external_exports.string().regex(/^(?:currentColor|#[a-f0-9]{6})$/iu).optional()
|
|
15175
|
+
}).strict()).min(1).max(32)
|
|
15176
|
+
}).strict().optional(),
|
|
15177
|
+
background: external_exports.string().regex(/^#[a-f0-9]{6}$/iu).optional(),
|
|
15178
|
+
borderRadius: external_exports.number().min(0).max(50).optional(),
|
|
15179
|
+
paddingRatio: external_exports.number().min(0).max(0.25).optional()
|
|
15180
|
+
}).strict().optional(),
|
|
15181
|
+
installation: harnessInstallationGuideSchema.optional(),
|
|
15182
|
+
notice: localizedTextSchema.optional(),
|
|
15183
|
+
/** The factory accepts a persisted local entrypoint through its construction context. */
|
|
15184
|
+
launchCommand: external_exports.literal(true).optional(),
|
|
15185
|
+
links: external_exports.object({
|
|
15186
|
+
website: documentationUrlSchema.optional(),
|
|
15187
|
+
documentation: documentationUrlSchema.optional(),
|
|
15188
|
+
installation: documentationUrlSchema.optional()
|
|
15189
|
+
}).strict().optional()
|
|
15190
|
+
};
|
|
15191
|
+
var harnessPluginManifestSchema = external_exports.object({
|
|
15192
|
+
manifestVersion: external_exports.literal(1),
|
|
15193
|
+
...pluginPresentationShape,
|
|
15194
|
+
adapterApiVersion: external_exports.number().int().positive(),
|
|
15195
|
+
entry: pluginRelativeResourceSchema,
|
|
15196
|
+
icon: pluginRelativeResourceSchema.optional()
|
|
15197
|
+
}).strict();
|
|
15198
|
+
var harnessPluginIconSchema = external_exports.string().max(Math.ceil(HARNESS_PLUGIN_ICON_MAX_BYTES / 3) * 4 + 64).regex(/^data:image\/(?:png|jpeg|webp|svg\+xml);base64,[A-Za-z0-9+/]+={0,2}$/u);
|
|
15199
|
+
var harnessPluginDescriptorSchema = external_exports.object({
|
|
15200
|
+
...pluginPresentationShape,
|
|
15201
|
+
icon: harnessPluginIconSchema.optional()
|
|
15202
|
+
}).strict();
|
|
15203
|
+
var harnessPluginListParamsSchema = external_exports.object({}).strict();
|
|
15204
|
+
var harnessPluginListResultSchema = external_exports.object({
|
|
15205
|
+
plugins: external_exports.array(harnessPluginDescriptorSchema.extend({ id: harnessPluginIdSchema })).max(HARNESS_PLUGIN_LIMIT)
|
|
15206
|
+
}).strict();
|
|
15207
|
+
var harnessPluginConfigurationSchema = external_exports.object({
|
|
15208
|
+
version: external_exports.literal(1),
|
|
15209
|
+
enabled: external_exports.array(installedHarnessPluginIdSchema).max(HARNESS_PLUGIN_LIMIT)
|
|
15210
|
+
}).strict().refine((value) => new Set(value.enabled).size === value.enabled.length, {
|
|
15211
|
+
message: "Enabled plugin IDs must be unique",
|
|
15212
|
+
path: ["enabled"]
|
|
15213
|
+
});
|
|
15214
|
+
|
|
15215
|
+
// ../../shared-contracts/dist/desktop-extensions.js
|
|
15216
|
+
var DESKTOP_EXTENSION_API_VERSION = 1;
|
|
15217
|
+
var DESKTOP_EXTENSION_LIMIT = 64;
|
|
15218
|
+
var DESKTOP_EXTENSION_ZIP_MAX_BYTES = 64 * 1024 * 1024;
|
|
15219
|
+
var DESKTOP_EXTENSION_MANIFEST_MAX_BYTES = 128 * 1024;
|
|
15220
|
+
var DESKTOP_EXTENSION_SCRIPT_MAX_BYTES = 2 * 1024 * 1024;
|
|
15221
|
+
var DESKTOP_EXTENSION_STYLE_MAX_BYTES = 256 * 1024;
|
|
15222
|
+
var DESKTOP_EXTENSION_ICON_MAX_BYTES = 128 * 1024;
|
|
15223
|
+
var DESKTOP_EXTENSION_SCREENSHOT_LIMIT = 4;
|
|
15224
|
+
var DESKTOP_EXTENSION_SCREENSHOT_MAX_BYTES = 512 * 1024;
|
|
15225
|
+
var DESKTOP_EXTENSION_LIST_SCREENSHOTS_MAX_BYTES = 8 * 1024 * 1024;
|
|
15226
|
+
var DESKTOP_EXTENSION_SNAPSHOT_MAX_BYTES = 8 * 1024 * 1024;
|
|
15227
|
+
var DESKTOP_EXTENSION_ASSET_MAX_BYTES = 16 * 1024 * 1024;
|
|
15228
|
+
var DESKTOP_EXTENSION_SETTINGS_MAX_BYTES = 1024 * 1024;
|
|
15229
|
+
var desktopExtensionIdSchema = installedPluginIdSchema;
|
|
15230
|
+
var desktopExtensionSlotSchema = external_exports.enum([
|
|
15231
|
+
"sidebar.thread-layout",
|
|
15232
|
+
"sidebar.thread-badge",
|
|
15233
|
+
"appearance.theme"
|
|
15234
|
+
]);
|
|
15235
|
+
var desktopExtensionCategorySchema = external_exports.enum([
|
|
15236
|
+
"appearance",
|
|
15237
|
+
"interface",
|
|
15238
|
+
"workflow",
|
|
15239
|
+
"analytics",
|
|
15240
|
+
"integrations",
|
|
15241
|
+
"tools"
|
|
15242
|
+
]);
|
|
15243
|
+
var extensionName = external_exports.string().trim().min(1).max(128);
|
|
15244
|
+
function desktopExtensionScreenshotMimeType(resource) {
|
|
15245
|
+
switch (resource.match(/\.([^./]+)$/u)?.[1]?.toLowerCase()) {
|
|
15246
|
+
case "png":
|
|
15247
|
+
return "image/png";
|
|
15248
|
+
case "jpg":
|
|
15249
|
+
case "jpeg":
|
|
15250
|
+
return "image/jpeg";
|
|
15251
|
+
case "webp":
|
|
15252
|
+
return "image/webp";
|
|
15253
|
+
default:
|
|
15254
|
+
return void 0;
|
|
15255
|
+
}
|
|
15256
|
+
}
|
|
15257
|
+
var hasPortableSegments = (resource) => resource.split("/").every((segment) => !/[. ]$/u.test(segment));
|
|
15258
|
+
var imagePathSchema = pluginRelativeResourceSchema.refine((resource) => desktopExtensionScreenshotMimeType(resource) !== void 0 && hasPortableSegments(resource), "Images must be relative .png, .jpg, .jpeg, or .webp paths with no segments ending in a dot or space");
|
|
15259
|
+
var desktopExtensionHttpUrlSchema = external_exports.string().trim().max(2048).regex(/^https?:\/\/[^/?#\\\s]+/iu, "Expected an HTTP(S) URL").pipe(external_exports.url({ protocol: /^https?$/u })).refine((value) => {
|
|
15260
|
+
const { username, password } = new URL(value);
|
|
15261
|
+
return !username && !password && !/[\\\s]/u.test(value);
|
|
15262
|
+
}, "URL must not contain credentials, backslashes, or whitespace");
|
|
15263
|
+
function localizedText(text3) {
|
|
15264
|
+
return external_exports.strictObject({ en: text3, "zh-CN": text3 });
|
|
15265
|
+
}
|
|
15266
|
+
var desktopExtensionLocalizedTextSchema = localizedText(external_exports.string().trim().min(1));
|
|
15267
|
+
var categoriesSchema = external_exports.array(desktopExtensionCategorySchema).max(desktopExtensionCategorySchema.options.length).refine((categories) => new Set(categories).size === categories.length, "Duplicate categories");
|
|
15268
|
+
var slotsSchema = external_exports.array(desktopExtensionSlotSchema).max(desktopExtensionSlotSchema.options.length).refine((slots) => new Set(slots).size === slots.length, "Duplicate slots");
|
|
15269
|
+
var settingField = {
|
|
15270
|
+
key: external_exports.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/u),
|
|
15271
|
+
label: desktopExtensionLocalizedTextSchema,
|
|
15272
|
+
description: desktopExtensionLocalizedTextSchema.optional()
|
|
15273
|
+
};
|
|
15274
|
+
var numericSetting = {
|
|
15275
|
+
...settingField,
|
|
15276
|
+
step: external_exports.number().positive().optional(),
|
|
15277
|
+
default: external_exports.number().optional()
|
|
15278
|
+
};
|
|
15279
|
+
var settingOption = external_exports.strictObject({
|
|
15280
|
+
value: external_exports.string(),
|
|
15281
|
+
label: desktopExtensionLocalizedTextSchema
|
|
15282
|
+
});
|
|
15283
|
+
var desktopExtensionSettingFieldSchema = external_exports.discriminatedUnion("type", [
|
|
15284
|
+
external_exports.strictObject({
|
|
15285
|
+
...settingField,
|
|
15286
|
+
type: external_exports.literal("boolean"),
|
|
15287
|
+
default: external_exports.boolean().optional()
|
|
15288
|
+
}),
|
|
15289
|
+
external_exports.strictObject({
|
|
15290
|
+
...settingField,
|
|
15291
|
+
type: external_exports.literal("string"),
|
|
15292
|
+
placeholder: desktopExtensionLocalizedTextSchema.optional(),
|
|
15293
|
+
default: external_exports.string().optional()
|
|
15294
|
+
}),
|
|
15295
|
+
external_exports.strictObject({
|
|
15296
|
+
...numericSetting,
|
|
15297
|
+
type: external_exports.literal("number"),
|
|
15298
|
+
min: external_exports.number().optional(),
|
|
15299
|
+
max: external_exports.number().optional()
|
|
15300
|
+
}),
|
|
15301
|
+
external_exports.strictObject({
|
|
15302
|
+
...numericSetting,
|
|
15303
|
+
type: external_exports.literal("range"),
|
|
15304
|
+
min: external_exports.number(),
|
|
15305
|
+
max: external_exports.number()
|
|
15306
|
+
}),
|
|
15307
|
+
external_exports.strictObject({
|
|
15308
|
+
...settingField,
|
|
15309
|
+
type: external_exports.literal("select"),
|
|
15310
|
+
options: external_exports.array(settingOption).min(1),
|
|
15311
|
+
default: external_exports.string().optional()
|
|
15312
|
+
})
|
|
15313
|
+
]).superRefine((field2, ctx) => {
|
|
15314
|
+
const issue2 = (path2, message) => ctx.addIssue({ code: "custom", path: [path2], message });
|
|
15315
|
+
if (field2.type === "number" || field2.type === "range") {
|
|
15316
|
+
const { min = -Infinity, max = Infinity, default: value } = field2;
|
|
15317
|
+
if (min > max)
|
|
15318
|
+
issue2("max", "Must be at least min");
|
|
15319
|
+
if (value !== void 0 && (value < min || value > max))
|
|
15320
|
+
issue2("default", "Must be within min and max");
|
|
15321
|
+
} else if (field2.type === "select") {
|
|
15322
|
+
const values = new Set(field2.options.map(({ value }) => value));
|
|
15323
|
+
if (values.size !== field2.options.length)
|
|
15324
|
+
issue2("options", "Duplicate option values");
|
|
15325
|
+
if (field2.default !== void 0 && !values.has(field2.default))
|
|
15326
|
+
issue2("default", "Must match an option value");
|
|
15327
|
+
}
|
|
15328
|
+
});
|
|
15329
|
+
var manifestHeader = external_exports.object({
|
|
15330
|
+
manifestVersion: external_exports.int().positive(),
|
|
15331
|
+
id: desktopExtensionIdSchema,
|
|
15332
|
+
name: external_exports.union([extensionName, localizedText(extensionName)]),
|
|
15333
|
+
version: external_exports.string().min(1).max(128),
|
|
15334
|
+
desktopApi: external_exports.int().positive()
|
|
15335
|
+
}).passthrough();
|
|
15336
|
+
var desktopExtensionManifestSchema = manifestHeader.extend({
|
|
15337
|
+
manifestVersion: external_exports.literal(1),
|
|
15338
|
+
desktopApi: external_exports.literal(DESKTOP_EXTENSION_API_VERSION),
|
|
15339
|
+
description: external_exports.strictObject({ en: external_exports.string().max(4096), "zh-CN": external_exports.string().max(4096).optional() }).optional(),
|
|
15340
|
+
author: external_exports.string().trim().min(1).max(128).optional(),
|
|
15341
|
+
repository: desktopExtensionHttpUrlSchema.optional(),
|
|
15342
|
+
details: external_exports.strictObject({ en: external_exports.string().max(16384), "zh-CN": external_exports.string().max(16384).optional() }).optional(),
|
|
15343
|
+
icon: imagePathSchema.optional(),
|
|
15344
|
+
screenshots: external_exports.array(imagePathSchema).max(DESKTOP_EXTENSION_SCREENSHOT_LIMIT).refine((screenshots) => new Set(screenshots).size === screenshots.length, "Duplicate screenshots").optional(),
|
|
15345
|
+
desktop: external_exports.strictObject({
|
|
15346
|
+
script: pluginRelativeResourceSchema,
|
|
15347
|
+
style: pluginRelativeResourceSchema.optional()
|
|
15348
|
+
}).optional(),
|
|
15349
|
+
backend: external_exports.strictObject({ script: pluginRelativeResourceSchema.refine(hasPortableSegments) }).optional(),
|
|
15350
|
+
slots: slotsSchema.default(() => []),
|
|
15351
|
+
settingsSchema: external_exports.array(desktopExtensionSettingFieldSchema).max(32).refine((fields2) => new Set(fields2.map(({ key: key2 }) => key2)).size === fields2.length, "Duplicate setting keys").optional(),
|
|
15352
|
+
categories: categoriesSchema.optional()
|
|
15353
|
+
}).strict().refine((manifest) => manifest.desktop !== void 0 || manifest.backend !== void 0, "Expected at least one desktop or backend entry");
|
|
15354
|
+
var desktopExtensionHashSchema = external_exports.string().regex(/^[a-f0-9]{64}$/u);
|
|
15355
|
+
var desktopExtensionStatusSchema = external_exports.strictObject({
|
|
15356
|
+
state: external_exports.enum([
|
|
15357
|
+
"running",
|
|
15358
|
+
"disabled",
|
|
15359
|
+
"invalid",
|
|
15360
|
+
"incompatible",
|
|
15361
|
+
"conflict",
|
|
15362
|
+
"failed",
|
|
15363
|
+
"waiting"
|
|
15364
|
+
]),
|
|
15365
|
+
hash: desktopExtensionHashSchema.optional(),
|
|
15366
|
+
error: external_exports.string().optional(),
|
|
15367
|
+
conflictWith: desktopExtensionIdSchema.optional()
|
|
15368
|
+
});
|
|
15369
|
+
var desktopExtensionsDiagnosticSchema = external_exports.strictObject({
|
|
15370
|
+
controllerPid: external_exports.int().positive(),
|
|
15371
|
+
targetId: external_exports.string().nullable(),
|
|
15372
|
+
updatedAt: external_exports.iso.datetime(),
|
|
15373
|
+
handledReloadToken: external_exports.uuid().optional(),
|
|
15374
|
+
extensions: external_exports.record(external_exports.string(), desktopExtensionStatusSchema),
|
|
15375
|
+
surfaces: external_exports.record(external_exports.string(), desktopExtensionStatusSchema).optional()
|
|
15403
15376
|
});
|
|
15404
|
-
var
|
|
15405
|
-
|
|
15406
|
-
|
|
15407
|
-
}
|
|
15408
|
-
var
|
|
15409
|
-
|
|
15410
|
-
|
|
15377
|
+
var desktopExtensionTrustTierSchema = external_exports.enum(["official", "community"]);
|
|
15378
|
+
function isGitHubDesktopExtensionZipballUrl(url2) {
|
|
15379
|
+
return url2.origin === "https://api.github.com" && /^\/repos\/[\w-]+\/[\w.-]+\/zipball(?:\/[^/]+)?\/?$/u.test(url2.pathname);
|
|
15380
|
+
}
|
|
15381
|
+
var desktopExtensionZipUrlSchema = desktopExtensionHttpUrlSchema.refine((input2) => {
|
|
15382
|
+
const url2 = new URL(input2);
|
|
15383
|
+
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);
|
|
15384
|
+
}, "Expected a .zip download URL or a GitHub zipball URL");
|
|
15385
|
+
var desktopExtensionCatalogEntrySchema = external_exports.strictObject({
|
|
15386
|
+
id: desktopExtensionIdSchema,
|
|
15387
|
+
version: external_exports.string().trim().min(1).max(128),
|
|
15388
|
+
name: desktopExtensionLocalizedTextSchema.extend({ en: extensionName, "zh-CN": extensionName }),
|
|
15389
|
+
description: localizedText(external_exports.string().trim().min(1).max(4096)),
|
|
15390
|
+
details: localizedText(external_exports.string().trim().min(1).max(16384)).optional(),
|
|
15391
|
+
author: external_exports.string().trim().min(1).max(128),
|
|
15392
|
+
repository: desktopExtensionHttpUrlSchema,
|
|
15393
|
+
stars: external_exports.number().int().min(0).optional(),
|
|
15394
|
+
downloads: external_exports.number().int().min(0).optional(),
|
|
15395
|
+
categories: categoriesSchema.optional(),
|
|
15396
|
+
trustTier: desktopExtensionTrustTierSchema.default("community"),
|
|
15397
|
+
icon: desktopExtensionHttpUrlSchema.optional(),
|
|
15398
|
+
screenshots: external_exports.array(desktopExtensionHttpUrlSchema).max(DESKTOP_EXTENSION_SCREENSHOT_LIMIT).optional(),
|
|
15399
|
+
downloadUrl: desktopExtensionZipUrlSchema,
|
|
15400
|
+
sha256: desktopExtensionHashSchema,
|
|
15401
|
+
slots: slotsSchema.optional(),
|
|
15402
|
+
publishedAt: external_exports.string().optional(),
|
|
15403
|
+
updatedAt: external_exports.string().optional(),
|
|
15404
|
+
minCodexHostVersion: external_exports.string().optional()
|
|
15405
|
+
});
|
|
15406
|
+
var desktopExtensionCatalogSchema = external_exports.strictObject({
|
|
15407
|
+
schemaVersion: external_exports.literal(1),
|
|
15408
|
+
generatedAt: external_exports.string(),
|
|
15409
|
+
extensions: external_exports.array(desktopExtensionCatalogEntrySchema).refine((entries) => new Set(entries.map(({ id: id2 }) => id2)).size === entries.length, "Duplicate extension IDs")
|
|
15410
|
+
});
|
|
15411
|
+
var desktopExtensionBackendMethodSchema = external_exports.string().trim().min(1).max(128);
|
|
15412
|
+
|
|
15413
|
+
// ../../shared-contracts/dist/host-extensions.js
|
|
15414
|
+
var reservedName = /^(?:con|prn|aux|nul|com[1-9¹²³]|lpt[1-9¹²³]) *(?:\.|$)/iu;
|
|
15415
|
+
var HOST_EXTENSION_PAGE_API_VERSION = 1;
|
|
15416
|
+
var hostExtensionIdSchema = desktopExtensionIdSchema.refine((id2) => !reservedName.test(id2), "Reserved extension ID");
|
|
15417
|
+
var hostExtensionTargetSchema = external_exports.enum(["desktop", "web"]);
|
|
15418
|
+
var hostExtensionDigestSchema = desktopExtensionHashSchema;
|
|
15419
|
+
var hostExtensionActivationIdSchema = external_exports.uuid();
|
|
15420
|
+
var hostExtensionResourcePathSchema = pluginRelativeResourceSchema.refine((resource) => !/[\x00-\x1f\x7f<>"|*]/u.test(resource) && resource.split("/").every((part) => !/[. ]$/u.test(part) && !reservedName.test(part)), "Expected a portable relative resource path").refine((path2) => path2.split("/").length <= 32, "Extension resources may be at most 32 segments deep");
|
|
15421
|
+
var legacy = desktopExtensionManifestSchema.shape;
|
|
15422
|
+
var localized = (max, min = 0) => external_exports.strictObject({
|
|
15423
|
+
en: external_exports.string().trim().min(min).max(max),
|
|
15424
|
+
"zh-CN": external_exports.string().trim().min(min).max(max)
|
|
15425
|
+
});
|
|
15426
|
+
var resourceWithSuffix = (suffix) => hostExtensionResourcePathSchema.refine((path2) => path2.endsWith(suffix), `Expected a ${suffix} file`);
|
|
15427
|
+
var moduleEntry = resourceWithSuffix(".mjs");
|
|
15428
|
+
var style = resourceWithSuffix(".css").optional();
|
|
15429
|
+
var hostExtensionCanonicalPath = (path2) => path2.normalize("NFC").toLowerCase();
|
|
15430
|
+
var hostExtensionManifestV2Schema = external_exports.strictObject({
|
|
15431
|
+
manifestVersion: external_exports.literal(2),
|
|
15432
|
+
id: hostExtensionIdSchema,
|
|
15433
|
+
name: localized(128, 1),
|
|
15434
|
+
version: external_exports.string().trim().min(1).max(128),
|
|
15435
|
+
description: localized(4096),
|
|
15436
|
+
details: localized(16384).optional(),
|
|
15437
|
+
author: legacy.author,
|
|
15438
|
+
repository: legacy.repository,
|
|
15439
|
+
icon: legacy.icon.refine((path2) => path2 === void 0 || hostExtensionResourcePathSchema.safeParse(path2).success),
|
|
15440
|
+
screenshots: legacy.screenshots.refine((paths) => paths === void 0 || paths.every((path2) => hostExtensionResourcePathSchema.safeParse(path2).success)),
|
|
15441
|
+
categories: legacy.categories,
|
|
15442
|
+
settingsSchema: legacy.settingsSchema,
|
|
15443
|
+
slots: legacy.slots.removeDefault().optional(),
|
|
15444
|
+
page: external_exports.strictObject({
|
|
15445
|
+
apiVersion: external_exports.literal(HOST_EXTENSION_PAGE_API_VERSION),
|
|
15446
|
+
entry: moduleEntry,
|
|
15447
|
+
style,
|
|
15448
|
+
title: localized(128, 1).optional()
|
|
15449
|
+
}).optional(),
|
|
15450
|
+
widget: external_exports.strictObject({
|
|
15451
|
+
apiVersion: external_exports.literal(HOST_EXTENSION_PAGE_API_VERSION),
|
|
15452
|
+
entry: moduleEntry,
|
|
15453
|
+
style
|
|
15454
|
+
}).optional(),
|
|
15455
|
+
desktop: external_exports.strictObject({ apiVersion: external_exports.literal(1), script: resourceWithSuffix(".js"), style }).optional(),
|
|
15456
|
+
web: external_exports.strictObject({ apiVersion: external_exports.literal(1), entry: moduleEntry.optional(), style }).refine(({ entry, style: style2 }) => entry !== void 0 || style2 !== void 0, "Expected a Web entry or style").optional(),
|
|
15457
|
+
backend: external_exports.strictObject({ apiVersion: external_exports.literal(1), entry: moduleEntry }).optional()
|
|
15458
|
+
}).refine(({ page, widget, desktop, web, backend }) => Boolean(page || widget || desktop || web || backend), "Expected at least one page, widget, desktop, web, or backend entry").refine(({ page, widget, web, backend }) => !backend || [page?.entry, widget?.entry, web?.entry].every((entry) => entry === void 0 || hostExtensionCanonicalPath(entry) !== hostExtensionCanonicalPath(backend.entry)), { path: ["backend", "entry"], message: "A backend entry cannot also be a frontend entry" });
|
|
15459
|
+
function targetsForCapabilities({ hasPage, hasWidget, hasDesktop, hasWeb, hasBackend }) {
|
|
15460
|
+
if (hasPage || hasWidget || hasBackend && !hasDesktop && !hasWeb)
|
|
15461
|
+
return ["desktop", "web"];
|
|
15462
|
+
const targets = [];
|
|
15463
|
+
if (hasDesktop)
|
|
15464
|
+
targets.push("desktop");
|
|
15465
|
+
if (hasWeb)
|
|
15466
|
+
targets.push("web");
|
|
15467
|
+
return targets;
|
|
15468
|
+
}
|
|
15469
|
+
var hostExtensionBackendMethodSchema = desktopExtensionBackendMethodSchema;
|
|
15470
|
+
|
|
15471
|
+
// ../../shared-contracts/dist/host-extension-management.js
|
|
15472
|
+
var HOST_EXTENSION_ZIP_MAX_BYTES = DESKTOP_EXTENSION_ZIP_MAX_BYTES;
|
|
15473
|
+
var hostExtensionRevisionSchema = external_exports.int().nonnegative();
|
|
15474
|
+
var hostExtensionConfigurationSchema = external_exports.strictObject({
|
|
15475
|
+
revision: hostExtensionRevisionSchema,
|
|
15476
|
+
enabled: external_exports.array(hostExtensionIdSchema).max(DESKTOP_EXTENSION_LIMIT).refine((ids) => new Set(ids).size === ids.length, "Duplicate extension IDs")
|
|
15477
|
+
});
|
|
15478
|
+
var { downloadUrl, ...catalogMetadata } = desktopExtensionCatalogEntrySchema.shape;
|
|
15479
|
+
var hostExtensionCatalogEntrySchema = external_exports.object({
|
|
15480
|
+
...catalogMetadata,
|
|
15481
|
+
id: hostExtensionIdSchema,
|
|
15482
|
+
format: external_exports.literal("codexhost"),
|
|
15483
|
+
targets: external_exports.array(hostExtensionTargetSchema).min(1).max(2).refine((targets) => new Set(targets).size === targets.length, "Duplicate targets"),
|
|
15484
|
+
apis: external_exports.strictObject({
|
|
15485
|
+
page: external_exports.int().positive().optional(),
|
|
15486
|
+
widget: external_exports.int().positive().optional(),
|
|
15487
|
+
desktop: external_exports.int().positive().optional(),
|
|
15488
|
+
web: external_exports.int().positive().optional(),
|
|
15489
|
+
backend: external_exports.int().positive().optional()
|
|
15490
|
+
}),
|
|
15491
|
+
downloadUrl: downloadUrl.refine((url2) => url2.startsWith("https://"), "Expected HTTPS")
|
|
15492
|
+
}).refine(({ targets, apis }) => {
|
|
15493
|
+
const derived = targetsForCapabilities({
|
|
15494
|
+
hasPage: Boolean(apis.page),
|
|
15495
|
+
hasWidget: Boolean(apis.widget),
|
|
15496
|
+
hasDesktop: Boolean(apis.desktop),
|
|
15497
|
+
hasWeb: Boolean(apis.web),
|
|
15498
|
+
hasBackend: Boolean(apis.backend)
|
|
15499
|
+
});
|
|
15500
|
+
return targets.length === derived.length && derived.every((target2) => targets.includes(target2));
|
|
15501
|
+
}, "Catalog targets must match the declared APIs");
|
|
15502
|
+
var hostExtensionCatalogSchema = external_exports.object({
|
|
15503
|
+
schemaVersion: external_exports.literal(2),
|
|
15504
|
+
generatedAt: external_exports.string().min(1),
|
|
15505
|
+
extensions: external_exports.array(hostExtensionCatalogEntrySchema).max(1e4).refine((entries) => new Set(entries.map(({ id: id2 }) => id2)).size === entries.length, "Duplicate extension IDs")
|
|
15506
|
+
});
|
|
15507
|
+
var hostExtensionsCatalogResultSchema = hostExtensionCatalogSchema.extend({
|
|
15508
|
+
catalogUrl: desktopExtensionHttpUrlSchema,
|
|
15509
|
+
fetchedAt: external_exports.iso.datetime(),
|
|
15510
|
+
cached: external_exports.boolean()
|
|
15511
|
+
});
|
|
15512
|
+
var id = { id: hostExtensionIdSchema };
|
|
15513
|
+
var active = {
|
|
15514
|
+
...id,
|
|
15515
|
+
activationId: hostExtensionActivationIdSchema,
|
|
15516
|
+
digest: hostExtensionDigestSchema
|
|
15517
|
+
};
|
|
15518
|
+
var optionalActivation = { ...id, activationId: active.activationId.optional() };
|
|
15519
|
+
var filePath = external_exports.string().min(1).max(4096).refine((path2) => /^(?:\/|[a-z]:[/\\])/iu.test(path2) && !path2.includes("\0") && !path2.split(/[/\\]/u).some((part) => part === "." || part === ".."), "Expected an absolute local path without dot segments");
|
|
15520
|
+
var gitRef = external_exports.string().min(1).max(256).refine((ref) => ref.split("/").every((part) => part && /^[a-z0-9_.-]+$/iu.test(part) && part !== "." && part !== ".."), "Invalid GitHub ref");
|
|
15521
|
+
function base643(maxBytes) {
|
|
15522
|
+
return external_exports.string().max(4 * Math.ceil(maxBytes / 3)).refine((value) => {
|
|
15523
|
+
const padding = value.endsWith("==") ? 2 : value.endsWith("=") ? 1 : 0;
|
|
15524
|
+
return value.length % 4 === 0 && value.length * 3 / 4 - padding <= maxBytes && /^[A-Za-z0-9+/]*={0,2}$/u.test(value);
|
|
15525
|
+
}, "Expected bounded standard padded base64");
|
|
15526
|
+
}
|
|
15527
|
+
var hostExtensionGitHubSourceSchema = external_exports.strictObject({
|
|
15528
|
+
type: external_exports.literal("github"),
|
|
15529
|
+
repository: external_exports.string().max(150).regex(/^[a-z0-9-]+\/[a-z0-9_-][a-z0-9_.-]*$/iu),
|
|
15530
|
+
ref: gitRef.optional(),
|
|
15531
|
+
tag: gitRef.optional(),
|
|
15532
|
+
asset: external_exports.string().max(255).regex(/^[a-z0-9_.-]+\.zip$/iu).optional(),
|
|
15533
|
+
subpath: hostExtensionResourcePathSchema.optional()
|
|
15534
|
+
}).refine(({ ref, tag, asset }) => !ref || !tag && !asset, "Use either a zipball ref or a release tag/asset");
|
|
15535
|
+
var hostExtensionInstallSourceSchema = external_exports.union([
|
|
15536
|
+
external_exports.strictObject({ type: external_exports.literal("catalog"), ...id }),
|
|
15537
|
+
hostExtensionGitHubSourceSchema,
|
|
15538
|
+
external_exports.strictObject({ type: external_exports.literal("zip"), base64: base643(HOST_EXTENSION_ZIP_MAX_BYTES).min(4) }),
|
|
15539
|
+
external_exports.strictObject({ type: external_exports.literal("zip"), localZipPath: filePath }),
|
|
15540
|
+
external_exports.strictObject({ type: external_exports.literal("localDir"), localDir: filePath })
|
|
15411
15541
|
]);
|
|
15412
|
-
var
|
|
15413
|
-
|
|
15414
|
-
|
|
15415
|
-
|
|
15416
|
-
|
|
15417
|
-
purpose: external_exports.literal("availability").optional()
|
|
15418
|
-
}).strict();
|
|
15419
|
-
var harnessWebUiOpenParamsSchema = external_exports.object({
|
|
15420
|
-
harnessId: harnessIdSchema
|
|
15421
|
-
}).strict();
|
|
15422
|
-
var harnessWebUiOpenResultSchema = external_exports.object({}).strict();
|
|
15423
|
-
var threadModelSelectParamsSchema = external_exports.object({
|
|
15424
|
-
threadId: hostThreadIdSchema,
|
|
15425
|
-
model: harnessModelRefSchema
|
|
15426
|
-
}).strict();
|
|
15427
|
-
var threadThinkingSelectParamsSchema = external_exports.object({
|
|
15428
|
-
threadId: hostThreadIdSchema,
|
|
15429
|
-
thinkingOptionId: harnessThinkingOptionIdSchema
|
|
15430
|
-
}).strict();
|
|
15431
|
-
var threadInspectionParamsSchema = external_exports.object({
|
|
15432
|
-
threadId: hostThreadIdSchema,
|
|
15433
|
-
includeReferenceCapability: external_exports.boolean().optional()
|
|
15434
|
-
}).strict();
|
|
15435
|
-
var codexThreadInspectionSchema = external_exports.object({
|
|
15436
|
-
owner: external_exports.literal("codex"),
|
|
15437
|
-
locked: external_exports.boolean(),
|
|
15438
|
-
effectiveModel: harnessModelRefSchema.optional(),
|
|
15439
|
-
resolvedModelLabel: harnessResolvedModelLabelSchema.optional(),
|
|
15440
|
-
effectiveThinkingOptionId: harnessThinkingOptionIdSchema.optional(),
|
|
15441
|
-
effectivePermissionModeId: harnessPermissionModeIdSchema.optional(),
|
|
15442
|
-
history: harnessHistoryCapabilitiesSchema.optional(),
|
|
15443
|
-
supportsThreadReferences: external_exports.literal(true).optional()
|
|
15444
|
-
}).strict();
|
|
15445
|
-
var externalThreadInspectionSchema = external_exports.object({
|
|
15446
|
-
owner: external_exports.literal("external"),
|
|
15447
|
-
harnessId: nonBlankTextSchema2.max(256),
|
|
15448
|
-
transportModelId: nonBlankTextSchema2.max(1024),
|
|
15449
|
-
effectiveModel: harnessModelRefSchema.optional(),
|
|
15450
|
-
resolvedModelLabel: harnessResolvedModelLabelSchema.optional(),
|
|
15451
|
-
effectiveThinkingOptionId: harnessThinkingOptionIdSchema.optional(),
|
|
15452
|
-
availableThinkingOptions: harnessThinkingOptionsSchema.optional(),
|
|
15453
|
-
effectivePermissionModeId: harnessPermissionModeIdSchema.optional(),
|
|
15454
|
-
history: harnessHistoryCapabilitiesSchema,
|
|
15455
|
-
usage: threadUsageSnapshotSchema.optional(),
|
|
15456
|
-
locked: external_exports.literal(true)
|
|
15457
|
-
}).strict();
|
|
15458
|
-
var threadInspectionSchema = external_exports.discriminatedUnion("owner", [
|
|
15459
|
-
codexThreadInspectionSchema,
|
|
15460
|
-
externalThreadInspectionSchema
|
|
15542
|
+
var hostExtensionProvenanceSchema = external_exports.discriminatedUnion("type", [
|
|
15543
|
+
external_exports.strictObject({ type: external_exports.literal("catalog"), ...id }),
|
|
15544
|
+
hostExtensionGitHubSourceSchema,
|
|
15545
|
+
external_exports.strictObject({ type: external_exports.literal("zip") }),
|
|
15546
|
+
external_exports.strictObject({ type: external_exports.literal("localDir") })
|
|
15461
15547
|
]);
|
|
15462
|
-
var
|
|
15463
|
-
|
|
15464
|
-
|
|
15465
|
-
|
|
15466
|
-
|
|
15467
|
-
if (seen.has(threadId)) {
|
|
15468
|
-
context.addIssue({
|
|
15469
|
-
code: "custom",
|
|
15470
|
-
message: "Thread ownership-list IDs must be unique",
|
|
15471
|
-
path: ["threadIds", index]
|
|
15472
|
-
});
|
|
15473
|
-
}
|
|
15474
|
-
seen.add(threadId);
|
|
15475
|
-
}
|
|
15548
|
+
var hostExtensionInstallationSchema = external_exports.strictObject({
|
|
15549
|
+
...active,
|
|
15550
|
+
manifest: hostExtensionManifestV2Schema,
|
|
15551
|
+
installedAt: external_exports.iso.datetime(),
|
|
15552
|
+
source: hostExtensionProvenanceSchema.optional()
|
|
15476
15553
|
});
|
|
15477
|
-
var
|
|
15478
|
-
|
|
15479
|
-
|
|
15480
|
-
|
|
15481
|
-
|
|
15482
|
-
|
|
15483
|
-
|
|
15484
|
-
|
|
15485
|
-
|
|
15486
|
-
|
|
15487
|
-
|
|
15488
|
-
|
|
15554
|
+
var rasterDataUrlSchema = (maxBytes) => external_exports.string().max("data:image/jpeg;base64,".length + 4 * Math.ceil(maxBytes / 3)).regex(/^data:image\/(?:png|jpeg|webp);base64,[A-Za-z0-9+/]+={0,2}$/u);
|
|
15555
|
+
var desktopConflict = { desktopConflictWith: hostExtensionIdSchema.optional() };
|
|
15556
|
+
var backendState = external_exports.enum(["none", "inactive", "starting", "running", "failed"]);
|
|
15557
|
+
var hostExtensionListItemSchema = external_exports.discriminatedUnion("state", [
|
|
15558
|
+
hostExtensionInstallationSchema.extend({
|
|
15559
|
+
state: external_exports.literal("valid"),
|
|
15560
|
+
enabled: external_exports.boolean(),
|
|
15561
|
+
...desktopConflict,
|
|
15562
|
+
iconDataUrl: rasterDataUrlSchema(DESKTOP_EXTENSION_ICON_MAX_BYTES).optional(),
|
|
15563
|
+
screenshotDataUrls: external_exports.array(rasterDataUrlSchema(DESKTOP_EXTENSION_SCREENSHOT_MAX_BYTES)).max(DESKTOP_EXTENSION_SCREENSHOT_LIMIT).optional(),
|
|
15564
|
+
backendState: backendState.optional(),
|
|
15565
|
+
backendError: external_exports.string().optional()
|
|
15566
|
+
}),
|
|
15567
|
+
external_exports.strictObject({
|
|
15568
|
+
state: external_exports.enum(["invalid", "incompatible"]),
|
|
15569
|
+
id: external_exports.string().min(1),
|
|
15570
|
+
enabled: external_exports.boolean(),
|
|
15571
|
+
error: external_exports.string()
|
|
15572
|
+
})
|
|
15489
15573
|
]);
|
|
15490
|
-
var
|
|
15491
|
-
|
|
15492
|
-
|
|
15493
|
-
|
|
15494
|
-
|
|
15495
|
-
|
|
15496
|
-
|
|
15497
|
-
|
|
15498
|
-
|
|
15499
|
-
|
|
15500
|
-
|
|
15501
|
-
|
|
15502
|
-
|
|
15503
|
-
|
|
15574
|
+
var hostExtensionsListResultSchema = external_exports.strictObject({
|
|
15575
|
+
revision: hostExtensionRevisionSchema,
|
|
15576
|
+
configuration: hostExtensionConfigurationSchema,
|
|
15577
|
+
diagnostics: external_exports.array(external_exports.string()),
|
|
15578
|
+
extensions: external_exports.array(hostExtensionListItemSchema)
|
|
15579
|
+
});
|
|
15580
|
+
var hostExtensionRuntimeEntrySchema = hostExtensionInstallationSchema.extend({
|
|
15581
|
+
...desktopConflict,
|
|
15582
|
+
settingsRevision: hostExtensionRevisionSchema
|
|
15583
|
+
});
|
|
15584
|
+
var hostExtensionsSnapshotResultSchema = external_exports.strictObject({
|
|
15585
|
+
/** The Host publishes this revision in extensions-changed, independent of enabled.json's revision. */
|
|
15586
|
+
revision: hostExtensionRevisionSchema,
|
|
15587
|
+
// Enabled, valid activations only. A Desktop conflict does not hide other capabilities.
|
|
15588
|
+
extensions: external_exports.array(hostExtensionRuntimeEntrySchema).max(DESKTOP_EXTENSION_LIMIT)
|
|
15589
|
+
});
|
|
15590
|
+
var HOST_EXTENSIONS_RPC = {
|
|
15591
|
+
list: "codexhost/extensions/list",
|
|
15592
|
+
snapshot: "codexhost/extensions/snapshot",
|
|
15593
|
+
catalog: "codexhost/extensions/catalog",
|
|
15594
|
+
install: "codexhost/extensions/install",
|
|
15595
|
+
update: "codexhost/extensions/update",
|
|
15596
|
+
enable: "codexhost/extensions/enable",
|
|
15597
|
+
disable: "codexhost/extensions/disable",
|
|
15598
|
+
uninstall: "codexhost/extensions/uninstall",
|
|
15599
|
+
recover: "codexhost/extensions/recover",
|
|
15600
|
+
asset: "codexhost/extensions/asset",
|
|
15601
|
+
settingsGet: "codexhost/extensions/settings/get",
|
|
15602
|
+
settingsSet: "codexhost/extensions/settings/set",
|
|
15603
|
+
backendInvoke: "codexhost/extensions/backend/invoke"
|
|
15604
|
+
};
|
|
15605
|
+
var HOST_EXTENSION_MANAGEMENT_METHODS = Object.freeze(Object.values(HOST_EXTENSIONS_RPC));
|
|
15606
|
+
var methods = new Set(HOST_EXTENSION_MANAGEMENT_METHODS);
|
|
15607
|
+
var noParams = external_exports.strictObject({});
|
|
15608
|
+
var expectedRevision = { expectedRevision: hostExtensionRevisionSchema };
|
|
15609
|
+
var selection = external_exports.strictObject({ ...id, ...expectedRevision });
|
|
15610
|
+
var installationResult = hostExtensionInstallationSchema.extend({ replaced: external_exports.boolean() });
|
|
15611
|
+
var mutationResult = external_exports.discriminatedUnion("state", [
|
|
15612
|
+
external_exports.strictObject({ state: external_exports.literal("saved"), configuration: hostExtensionConfigurationSchema }),
|
|
15613
|
+
external_exports.strictObject({ state: external_exports.literal("revision-conflict"), revision: hostExtensionRevisionSchema })
|
|
15614
|
+
]);
|
|
15615
|
+
var hostExtensionsAssetParamsSchema = external_exports.strictObject({
|
|
15616
|
+
...optionalActivation,
|
|
15617
|
+
digest: active.digest.optional(),
|
|
15618
|
+
path: hostExtensionResourcePathSchema
|
|
15619
|
+
});
|
|
15620
|
+
var hostExtensionsAssetResultSchema = external_exports.strictObject({
|
|
15621
|
+
mimeType: external_exports.string().min(1),
|
|
15622
|
+
base64: base643(DESKTOP_EXTENSION_ASSET_MAX_BYTES),
|
|
15623
|
+
digest: active.digest
|
|
15624
|
+
});
|
|
15625
|
+
var hostExtensionSettingsSchema = external_exports.strictObject({
|
|
15626
|
+
settingsRevision: hostExtensionRevisionSchema,
|
|
15627
|
+
values: jsonObjectSchema
|
|
15504
15628
|
});
|
|
15505
|
-
var
|
|
15506
|
-
|
|
15507
|
-
|
|
15508
|
-
|
|
15509
|
-
|
|
15510
|
-
|
|
15511
|
-
|
|
15512
|
-
|
|
15513
|
-
|
|
15514
|
-
|
|
15515
|
-
|
|
15516
|
-
|
|
15517
|
-
|
|
15518
|
-
|
|
15519
|
-
|
|
15520
|
-
|
|
15521
|
-
|
|
15522
|
-
|
|
15523
|
-
|
|
15524
|
-
}
|
|
15525
|
-
|
|
15526
|
-
|
|
15527
|
-
|
|
15528
|
-
|
|
15629
|
+
var hostExtensionsRpcSchemas = {
|
|
15630
|
+
[HOST_EXTENSIONS_RPC.list]: { params: noParams, result: hostExtensionsListResultSchema },
|
|
15631
|
+
[HOST_EXTENSIONS_RPC.snapshot]: { params: noParams, result: hostExtensionsSnapshotResultSchema },
|
|
15632
|
+
[HOST_EXTENSIONS_RPC.catalog]: {
|
|
15633
|
+
params: external_exports.strictObject({ forceRefresh: external_exports.boolean().optional() }),
|
|
15634
|
+
result: hostExtensionsCatalogResultSchema
|
|
15635
|
+
},
|
|
15636
|
+
[HOST_EXTENSIONS_RPC.install]: {
|
|
15637
|
+
params: external_exports.strictObject({ source: hostExtensionInstallSourceSchema }),
|
|
15638
|
+
result: installationResult
|
|
15639
|
+
},
|
|
15640
|
+
[HOST_EXTENSIONS_RPC.update]: {
|
|
15641
|
+
params: external_exports.strictObject({
|
|
15642
|
+
...id,
|
|
15643
|
+
expectedDigest: active.digest,
|
|
15644
|
+
expectedActivationId: active.activationId.optional(),
|
|
15645
|
+
source: hostExtensionInstallSourceSchema.optional()
|
|
15646
|
+
}),
|
|
15647
|
+
result: installationResult
|
|
15648
|
+
},
|
|
15649
|
+
[HOST_EXTENSIONS_RPC.enable]: { params: selection, result: mutationResult },
|
|
15650
|
+
[HOST_EXTENSIONS_RPC.disable]: { params: selection, result: mutationResult },
|
|
15651
|
+
[HOST_EXTENSIONS_RPC.uninstall]: {
|
|
15652
|
+
params: external_exports.strictObject({
|
|
15653
|
+
...id,
|
|
15654
|
+
removeData: external_exports.boolean().optional(),
|
|
15655
|
+
expectedDigest: active.digest.optional()
|
|
15656
|
+
}),
|
|
15657
|
+
result: external_exports.strictObject({ ...id, removed: external_exports.boolean() })
|
|
15658
|
+
},
|
|
15659
|
+
[HOST_EXTENSIONS_RPC.recover]: {
|
|
15660
|
+
params: external_exports.strictObject({ expectedRevision: expectedRevision.expectedRevision.optional() }),
|
|
15661
|
+
result: mutationResult
|
|
15662
|
+
},
|
|
15663
|
+
[HOST_EXTENSIONS_RPC.asset]: {
|
|
15664
|
+
params: hostExtensionsAssetParamsSchema,
|
|
15665
|
+
result: hostExtensionsAssetResultSchema
|
|
15666
|
+
},
|
|
15667
|
+
[HOST_EXTENSIONS_RPC.settingsGet]: {
|
|
15668
|
+
params: external_exports.strictObject(optionalActivation),
|
|
15669
|
+
result: hostExtensionSettingsSchema
|
|
15670
|
+
},
|
|
15671
|
+
[HOST_EXTENSIONS_RPC.settingsSet]: {
|
|
15672
|
+
params: external_exports.strictObject({
|
|
15673
|
+
...optionalActivation,
|
|
15674
|
+
expectedSettingsRevision: hostExtensionRevisionSchema,
|
|
15675
|
+
values: jsonObjectSchema
|
|
15676
|
+
}),
|
|
15677
|
+
result: hostExtensionSettingsSchema
|
|
15678
|
+
},
|
|
15679
|
+
[HOST_EXTENSIONS_RPC.backendInvoke]: {
|
|
15680
|
+
params: external_exports.strictObject({
|
|
15681
|
+
...optionalActivation,
|
|
15682
|
+
method: hostExtensionBackendMethodSchema,
|
|
15683
|
+
params: jsonValueSchema.optional()
|
|
15684
|
+
}),
|
|
15685
|
+
result: external_exports.strictObject({ result: jsonValueSchema })
|
|
15686
|
+
}
|
|
15687
|
+
};
|
|
15529
15688
|
|
|
15530
15689
|
// ../../shared-contracts/dist/thread-archive-confirm.js
|
|
15531
15690
|
var THREAD_ARCHIVE_CONFIRM_METHOD = "codexhost/thread/archive/confirm";
|
|
@@ -15571,6 +15730,8 @@ var CLIENT_CHANNEL_METHODS = [
|
|
|
15571
15730
|
"codexhost/workspace/read",
|
|
15572
15731
|
"codexhost/thread/tree/read",
|
|
15573
15732
|
"codexhost/thread/pins/list",
|
|
15733
|
+
"codexhost/thread/sections/list",
|
|
15734
|
+
"codexhost/thread/sections/move",
|
|
15574
15735
|
"codexhost/thread/pins/set",
|
|
15575
15736
|
"codexhost/harness/plugins/list",
|
|
15576
15737
|
"codexhost/harness/inspect",
|
|
@@ -15588,7 +15749,7 @@ var CLIENT_CHANNEL_METHODS = [
|
|
|
15588
15749
|
"codexhost/harness/session-import/list",
|
|
15589
15750
|
"codexhost/harness/session-import/import",
|
|
15590
15751
|
// Host settings shared across Desktop and Web.
|
|
15591
|
-
...
|
|
15752
|
+
...HOST_EXTENSION_MANAGEMENT_METHODS,
|
|
15592
15753
|
"codexhost/harness/installation",
|
|
15593
15754
|
"codexhost/harness/installation/start",
|
|
15594
15755
|
"codexhost/harness/installation/status",
|
|
@@ -15609,8 +15770,21 @@ var CLIENT_CHANNEL_METHODS = [
|
|
|
15609
15770
|
"codexhost/update/check",
|
|
15610
15771
|
"codexhost/update/start",
|
|
15611
15772
|
"codexhost/update/status",
|
|
15773
|
+
"codexhost/announcement/get",
|
|
15774
|
+
"codexhost/announcement/acknowledge",
|
|
15612
15775
|
"codexhost/sessions/loaded/list"
|
|
15613
15776
|
];
|
|
15777
|
+
var clientThreadSectionsSchema = external_exports.object({
|
|
15778
|
+
sections: external_exports.array(external_exports.object({
|
|
15779
|
+
id: external_exports.string().min(1),
|
|
15780
|
+
name: external_exports.string().min(1),
|
|
15781
|
+
threads: external_exports.array(jsonObjectSchema)
|
|
15782
|
+
}).strict())
|
|
15783
|
+
}).strict();
|
|
15784
|
+
var clientThreadSectionMoveSchema = external_exports.object({
|
|
15785
|
+
threadId: external_exports.string().min(1).max(1024),
|
|
15786
|
+
sectionId: external_exports.string().min(1).max(1024).nullable()
|
|
15787
|
+
}).strict();
|
|
15614
15788
|
var clientThreadPinsSchema = external_exports.object({ threadIds: external_exports.array(external_exports.string().min(1)) }).strict();
|
|
15615
15789
|
var clientThreadPinParamsSchema = external_exports.object({ threadId: external_exports.string().min(1).max(1024), pinned: external_exports.boolean() }).strict();
|
|
15616
15790
|
var clientThreadTreeReadParamsSchema = external_exports.object({}).strict();
|
|
@@ -15649,6 +15823,11 @@ var clientChannelEventSchema = external_exports.discriminatedUnion("type", [
|
|
|
15649
15823
|
cursor: clientChannelCursorSchema,
|
|
15650
15824
|
revision: external_exports.number().int().nonnegative()
|
|
15651
15825
|
}),
|
|
15826
|
+
external_exports.object({
|
|
15827
|
+
type: external_exports.literal("extensions-changed"),
|
|
15828
|
+
cursor: clientChannelCursorSchema,
|
|
15829
|
+
revision: hostExtensionRevisionSchema
|
|
15830
|
+
}),
|
|
15652
15831
|
external_exports.object({
|
|
15653
15832
|
type: external_exports.literal("hello"),
|
|
15654
15833
|
version: external_exports.literal(1),
|
|
@@ -16085,7 +16264,7 @@ var DEFAULT_IDLE_RELEASE_SETTINGS = Object.freeze({
|
|
|
16085
16264
|
|
|
16086
16265
|
// ../../shared-contracts/dist/harness-preferences.js
|
|
16087
16266
|
var harnessPreferenceScopeSchema = external_exports.string().regex(/^external$/u);
|
|
16088
|
-
var preferenceHarnessKey = harnessIdSchema.transform((
|
|
16267
|
+
var preferenceHarnessKey = harnessIdSchema.transform((id2) => String(id2));
|
|
16089
16268
|
var harnessDefaultConfigurationSchema = external_exports.strictObject({
|
|
16090
16269
|
model: harnessModelRefSchema.optional(),
|
|
16091
16270
|
thinkingOptionId: harnessThinkingOptionIdSchema.optional(),
|
|
@@ -16095,11 +16274,19 @@ var newThreadDefaultsSchema = external_exports.strictObject({
|
|
|
16095
16274
|
lastHarness: harnessIdSchema.optional(),
|
|
16096
16275
|
byHarness: external_exports.record(preferenceHarnessKey, harnessDefaultConfigurationSchema)
|
|
16097
16276
|
});
|
|
16277
|
+
var harnessDelegationDefaultSchema = external_exports.strictObject({
|
|
16278
|
+
model: harnessModelRefSchema.optional(),
|
|
16279
|
+
thinkingOptionId: harnessThinkingOptionIdSchema.optional()
|
|
16280
|
+
}).refine((value) => Boolean(value.model || value.thinkingOptionId), "A delegation default must contain a Model or Thinking option");
|
|
16281
|
+
var delegationDefaultsSchema = external_exports.strictObject({
|
|
16282
|
+
byHarness: external_exports.record(preferenceHarnessKey, harnessDelegationDefaultSchema)
|
|
16283
|
+
});
|
|
16098
16284
|
var modelId = external_exports.string().min(1).max(1024);
|
|
16099
16285
|
var harnessPreferenceValuesSchema = external_exports.strictObject({
|
|
16100
16286
|
idleRelease: idleReleaseSettingsSchema.optional(),
|
|
16101
16287
|
favorites: external_exports.record(preferenceHarnessKey, external_exports.array(modelId).max(2048)).default({}),
|
|
16102
|
-
newThread: newThreadDefaultsSchema.optional()
|
|
16288
|
+
newThread: newThreadDefaultsSchema.optional(),
|
|
16289
|
+
delegation: delegationDefaultsSchema.optional()
|
|
16103
16290
|
});
|
|
16104
16291
|
var harnessPreferenceSnapshotSchema = external_exports.strictObject({
|
|
16105
16292
|
scope: harnessPreferenceScopeSchema,
|
|
@@ -16127,6 +16314,11 @@ var harnessPreferenceOperationSchema = external_exports.discriminatedUnion("kind
|
|
|
16127
16314
|
lastHarness: harnessIdSchema.optional(),
|
|
16128
16315
|
harnessId: harnessIdSchema.optional(),
|
|
16129
16316
|
configuration: harnessDefaultConfigurationSchema.optional()
|
|
16317
|
+
}),
|
|
16318
|
+
external_exports.strictObject({
|
|
16319
|
+
kind: external_exports.literal("delegation"),
|
|
16320
|
+
harnessId: harnessIdSchema,
|
|
16321
|
+
configuration: harnessDelegationDefaultSchema.nullable()
|
|
16130
16322
|
})
|
|
16131
16323
|
]);
|
|
16132
16324
|
var harnessPreferencePatchSchema = external_exports.strictObject({
|
|
@@ -16134,8 +16326,8 @@ var harnessPreferencePatchSchema = external_exports.strictObject({
|
|
|
16134
16326
|
operations: external_exports.array(harnessPreferenceOperationSchema).min(1).max(256),
|
|
16135
16327
|
initializeOnly: external_exports.boolean().optional(),
|
|
16136
16328
|
expectedRevision: external_exports.number().int().nonnegative().optional()
|
|
16137
|
-
}).superRefine((
|
|
16138
|
-
for (const operation of
|
|
16329
|
+
}).superRefine((input2, ctx) => {
|
|
16330
|
+
for (const operation of input2.operations) {
|
|
16139
16331
|
if (operation.kind === "newThread" && (!operation.lastHarness && !operation.configuration || Boolean(operation.harnessId) !== Boolean(operation.configuration)))
|
|
16140
16332
|
ctx.addIssue({
|
|
16141
16333
|
code: "custom",
|
|
@@ -16537,13 +16729,18 @@ var harnessLaunchSettingsSchema = external_exports.object({
|
|
|
16537
16729
|
// ../../shared-contracts/dist/harness-installation.js
|
|
16538
16730
|
var harnessInstallationParamsSchema = external_exports.object({
|
|
16539
16731
|
harnessId: harnessIdSchema,
|
|
16540
|
-
action: external_exports.enum(["check", "update", "install"])
|
|
16541
|
-
|
|
16732
|
+
action: external_exports.enum(["check", "update", "install"]),
|
|
16733
|
+
confirmedVersion: external_exports.string().min(1).max(128).optional()
|
|
16734
|
+
}).strict().refine(({ action, confirmedVersion }) => action === "update" || confirmedVersion === void 0);
|
|
16542
16735
|
var harnessInstallationStateSchema = external_exports.object({
|
|
16543
16736
|
currentVersion: external_exports.string().min(1).max(128),
|
|
16544
16737
|
latestVersion: external_exports.string().min(1).max(128),
|
|
16545
16738
|
updateAvailable: external_exports.boolean(),
|
|
16546
16739
|
canUpdate: external_exports.boolean(),
|
|
16740
|
+
/** Present when the Adapter has a verified list and the available target is outside it. */
|
|
16741
|
+
latestVerifiedVersion: external_exports.string().min(1).max(128).optional(),
|
|
16742
|
+
/** Update preflight stopped before running the installer; latestVersion needs confirmation. */
|
|
16743
|
+
confirmationRequired: external_exports.literal(true).optional(),
|
|
16547
16744
|
/** Defaults to CLI; some Harnesses ship only inside a desktop application. */
|
|
16548
16745
|
versionKind: external_exports.enum(["cli", "application"]).optional(),
|
|
16549
16746
|
/** Official download opened by the user; does not imply an automatic installation. */
|
|
@@ -16868,6 +17065,38 @@ var updateStatusResultSchema = external_exports.strictObject({
|
|
|
16868
17065
|
status: updateStatusSchema.nullable()
|
|
16869
17066
|
});
|
|
16870
17067
|
|
|
17068
|
+
// ../../shared-contracts/dist/release-announcement.js
|
|
17069
|
+
var RELEASE_ANNOUNCEMENT_MAX_THEMES = 12;
|
|
17070
|
+
var releaseAnnouncementThemeSchema = external_exports.strictObject({
|
|
17071
|
+
icon: external_exports.string().min(1).max(16).optional(),
|
|
17072
|
+
title: external_exports.string().min(1).max(120),
|
|
17073
|
+
body: external_exports.string().min(1).max(1200),
|
|
17074
|
+
contributors: external_exports.array(external_exports.string().min(1).max(39)).max(30)
|
|
17075
|
+
});
|
|
17076
|
+
var releaseAnnouncementContentSchema = external_exports.strictObject({
|
|
17077
|
+
summary: external_exports.string().min(1).max(600).optional(),
|
|
17078
|
+
themes: external_exports.array(releaseAnnouncementThemeSchema).min(1).max(RELEASE_ANNOUNCEMENT_MAX_THEMES)
|
|
17079
|
+
});
|
|
17080
|
+
var releaseAnnouncementSchema = external_exports.strictObject({
|
|
17081
|
+
version: updateSemanticVersionSchema,
|
|
17082
|
+
publishedAt: external_exports.iso.datetime(),
|
|
17083
|
+
url: external_exports.string().max(300).regex(/^https:\/\/github\.com\/BytePioneer-AI\/codex-host\/releases\/tag\/v[0-9A-Za-z.+-]+$/u),
|
|
17084
|
+
zh: releaseAnnouncementContentSchema.nullable(),
|
|
17085
|
+
en: releaseAnnouncementContentSchema.nullable()
|
|
17086
|
+
}).refine((value) => value.zh !== null || value.en !== null, {
|
|
17087
|
+
message: "an announcement needs at least one language"
|
|
17088
|
+
});
|
|
17089
|
+
var releaseAnnouncementGetParamsSchema = external_exports.strictObject({
|
|
17090
|
+
manual: external_exports.boolean().optional()
|
|
17091
|
+
});
|
|
17092
|
+
var releaseAnnouncementGetResultSchema = external_exports.strictObject({
|
|
17093
|
+
announcement: releaseAnnouncementSchema.nullable(),
|
|
17094
|
+
unread: external_exports.boolean()
|
|
17095
|
+
});
|
|
17096
|
+
var releaseAnnouncementAcknowledgeParamsSchema = external_exports.strictObject({
|
|
17097
|
+
version: updateSemanticVersionSchema
|
|
17098
|
+
});
|
|
17099
|
+
|
|
16871
17100
|
// ../../shared-contracts/dist/thread-watch-notice.js
|
|
16872
17101
|
var THREAD_WATCH_NOTICE_OUTCOMES = [
|
|
16873
17102
|
"completed",
|
|
@@ -16915,17 +17144,67 @@ var remoteSshSetupResultSchema = external_exports.object({ state: external_expor
|
|
|
16915
17144
|
|
|
16916
17145
|
// ../../shared-contracts/dist/remote-sessions.js
|
|
16917
17146
|
var REMOTE_CONTROLLER_REQUEST_MAX_BYTES = 16 * 1024;
|
|
16918
|
-
var
|
|
17147
|
+
var REMOTE_IDENTITY_MAX_LENGTH = 1024;
|
|
17148
|
+
var identity = external_exports.string().min(1).max(REMOTE_IDENTITY_MAX_LENGTH);
|
|
16919
17149
|
var target = { hostId: identity.regex(/^remote-(?:ssh(?:-|:)|control:)/u) };
|
|
16920
17150
|
var thread = { ...target, threadId: identity };
|
|
17151
|
+
var text = external_exports.string().min(1).max(8e3);
|
|
17152
|
+
var input = { text, requestId: identity };
|
|
17153
|
+
var remoteDeliveryReplySchema = external_exports.discriminatedUnion("accepted", [
|
|
17154
|
+
external_exports.object({ accepted: external_exports.literal(true), startQueuedItemId: identity.optional() }),
|
|
17155
|
+
external_exports.object({
|
|
17156
|
+
accepted: external_exports.literal(false),
|
|
17157
|
+
code: external_exports.enum([
|
|
17158
|
+
"remote/queue-unavailable",
|
|
17159
|
+
"remote/steer-unavailable",
|
|
17160
|
+
"remote/turn-changed",
|
|
17161
|
+
"remote/send-rejected",
|
|
17162
|
+
"session/queue-item-not-found",
|
|
17163
|
+
"session/queue-item-starting"
|
|
17164
|
+
]),
|
|
17165
|
+
message: external_exports.string()
|
|
17166
|
+
})
|
|
17167
|
+
]);
|
|
17168
|
+
var remoteQueueSnapshotSchema = external_exports.discriminatedUnion("available", [
|
|
17169
|
+
external_exports.object({ available: external_exports.literal(false) }),
|
|
17170
|
+
external_exports.object({
|
|
17171
|
+
available: external_exports.literal(true),
|
|
17172
|
+
items: external_exports.array(external_exports.object({ id: identity, clientUserMessageId: identity, preview: external_exports.string().max(801) })).max(100)
|
|
17173
|
+
})
|
|
17174
|
+
]);
|
|
16921
17175
|
var remoteSessionOperationSchema = external_exports.discriminatedUnion("kind", [
|
|
16922
17176
|
external_exports.strictObject({ kind: external_exports.literal("hosts") }),
|
|
17177
|
+
external_exports.strictObject({
|
|
17178
|
+
kind: external_exports.literal("create"),
|
|
17179
|
+
...target,
|
|
17180
|
+
cwd: external_exports.string().min(1).max(8192),
|
|
17181
|
+
epoch: identity
|
|
17182
|
+
}),
|
|
17183
|
+
external_exports.strictObject({ kind: external_exports.literal("projectHarnesses"), ...target, epoch: identity }),
|
|
17184
|
+
external_exports.strictObject({
|
|
17185
|
+
kind: external_exports.literal("inspectHarness"),
|
|
17186
|
+
...target,
|
|
17187
|
+
epoch: identity,
|
|
17188
|
+
cwd: external_exports.string().min(1).max(8192),
|
|
17189
|
+
harnessId: identity
|
|
17190
|
+
}),
|
|
17191
|
+
external_exports.strictObject({
|
|
17192
|
+
kind: external_exports.literal("startSelected"),
|
|
17193
|
+
...target,
|
|
17194
|
+
epoch: identity,
|
|
17195
|
+
cwd: external_exports.string().min(1).max(8192),
|
|
17196
|
+
harnessId: identity,
|
|
17197
|
+
model: external_exports.string().min(1).max(4096),
|
|
17198
|
+
serviceTier: external_exports.enum(["priority", "ultrafast"]).optional(),
|
|
17199
|
+
reasoningEffort: identity.optional()
|
|
17200
|
+
}),
|
|
16923
17201
|
external_exports.strictObject({ kind: external_exports.literal("status"), ...thread }),
|
|
16924
17202
|
external_exports.strictObject({
|
|
16925
17203
|
kind: external_exports.literal("list"),
|
|
16926
17204
|
...target,
|
|
16927
17205
|
cursor: external_exports.string().nullable(),
|
|
16928
|
-
archived: external_exports.boolean()
|
|
17206
|
+
archived: external_exports.boolean(),
|
|
17207
|
+
includeLoaded: external_exports.literal(true).optional()
|
|
16929
17208
|
}),
|
|
16930
17209
|
external_exports.strictObject({
|
|
16931
17210
|
kind: external_exports.literal("read"),
|
|
@@ -16945,16 +17224,35 @@ var remoteSessionOperationSchema = external_exports.discriminatedUnion("kind", [
|
|
|
16945
17224
|
...thread,
|
|
16946
17225
|
epoch: identity,
|
|
16947
17226
|
modelId: identity.optional(),
|
|
17227
|
+
serviceTier: harnessModelServiceTierSchema.optional(),
|
|
16948
17228
|
thinkingOptionId: identity.optional(),
|
|
16949
17229
|
permissionModeId: identity.optional()
|
|
16950
|
-
}).refine((value) => [value.modelId, value.thinkingOptionId, value.permissionModeId].filter((v) => v !== void 0).length === 1, "Select exactly one remote setting"),
|
|
17230
|
+
}).refine((value) => [value.modelId, value.thinkingOptionId, value.permissionModeId].filter((v) => v !== void 0).length === 1, "Select exactly one remote setting").refine((value) => value.serviceTier === void 0 || value.modelId !== void 0, {
|
|
17231
|
+
message: "A service tier requires a Model ID"
|
|
17232
|
+
}),
|
|
16951
17233
|
external_exports.strictObject({
|
|
16952
17234
|
kind: external_exports.literal("prompt"),
|
|
16953
17235
|
...thread,
|
|
16954
17236
|
epoch: identity,
|
|
16955
|
-
text
|
|
17237
|
+
text,
|
|
16956
17238
|
requestId: identity.optional()
|
|
16957
17239
|
}),
|
|
17240
|
+
external_exports.strictObject({ kind: external_exports.literal("queue"), ...thread, epoch: identity }),
|
|
17241
|
+
external_exports.strictObject({
|
|
17242
|
+
kind: external_exports.literal("delivery"),
|
|
17243
|
+
...thread,
|
|
17244
|
+
epoch: identity,
|
|
17245
|
+
action: external_exports.discriminatedUnion("kind", [
|
|
17246
|
+
external_exports.strictObject({ kind: external_exports.literal("enqueue"), ...input }),
|
|
17247
|
+
external_exports.strictObject({ kind: external_exports.literal("steer"), ...input, turnId: identity }),
|
|
17248
|
+
external_exports.strictObject({ kind: external_exports.literal("remove"), itemId: identity }),
|
|
17249
|
+
external_exports.strictObject({
|
|
17250
|
+
kind: external_exports.literal("start"),
|
|
17251
|
+
itemId: identity,
|
|
17252
|
+
onlyIfHead: external_exports.literal(true).optional()
|
|
17253
|
+
})
|
|
17254
|
+
])
|
|
17255
|
+
}),
|
|
16958
17256
|
external_exports.strictObject({ kind: external_exports.literal("interrupt"), ...thread, epoch: identity, turnId: identity }),
|
|
16959
17257
|
external_exports.strictObject({
|
|
16960
17258
|
kind: external_exports.literal("rename"),
|
|
@@ -16997,7 +17295,7 @@ var remoteConnectionsRequestSchema = external_exports.discriminatedUnion("action
|
|
|
16997
17295
|
external_exports.strictObject({ action: external_exports.literal("catalog") }),
|
|
16998
17296
|
external_exports.strictObject({
|
|
16999
17297
|
action: external_exports.literal("read-thread"),
|
|
17000
|
-
hostId: hostId.refine((
|
|
17298
|
+
hostId: hostId.refine((id2) => id2 !== "local"),
|
|
17001
17299
|
input: delegationReadParamsSchema
|
|
17002
17300
|
}),
|
|
17003
17301
|
external_exports.strictObject({
|
|
@@ -17011,7 +17309,7 @@ var remoteConnectionsRequestSchema = external_exports.discriminatedUnion("action
|
|
|
17011
17309
|
external_exports.strictObject({ action: external_exports.literal("runtime"), hostId }),
|
|
17012
17310
|
external_exports.strictObject({
|
|
17013
17311
|
action: external_exports.literal("update"),
|
|
17014
|
-
hostId: hostId.refine((
|
|
17312
|
+
hostId: hostId.refine((id2) => id2 !== "local"),
|
|
17015
17313
|
version: remoteUpdateParamsSchema.shape.version
|
|
17016
17314
|
})
|
|
17017
17315
|
]);
|
|
@@ -17322,9 +17620,9 @@ var CodexCounters = class {
|
|
|
17322
17620
|
}
|
|
17323
17621
|
}
|
|
17324
17622
|
#align(at, total, last) {
|
|
17325
|
-
const
|
|
17623
|
+
const active2 = this.#snapshotThread;
|
|
17326
17624
|
this.#snapshotThread = "";
|
|
17327
|
-
if (!
|
|
17625
|
+
if (!active2 || !this.#snapshotTotal || this.#high || at !== this.#snapshotAt || !last || last.known !== 31 || !isZero(last) || total.known !== 31 || this.#snapshotTotal.known !== 31 || !covers(this.#snapshotTotal, total) || this.entries.some((v) => !v.compaction || v.at !== at))
|
|
17328
17626
|
return;
|
|
17329
17627
|
let offset = minus(this.#snapshotTotal, total);
|
|
17330
17628
|
for (const c of this.#compactions.values()) {
|
|
@@ -17644,7 +17942,7 @@ async function* rolloutBytes(file2, signal) {
|
|
|
17644
17942
|
}
|
|
17645
17943
|
return;
|
|
17646
17944
|
}
|
|
17647
|
-
const
|
|
17945
|
+
const input2 = stream[Symbol.asyncIterator]();
|
|
17648
17946
|
let pending = Buffer.alloc(0);
|
|
17649
17947
|
async function readExact(size, allowEof = false) {
|
|
17650
17948
|
const parts = [];
|
|
@@ -17652,7 +17950,7 @@ async function* rolloutBytes(file2, signal) {
|
|
|
17652
17950
|
while (length < size) {
|
|
17653
17951
|
signal.throwIfAborted();
|
|
17654
17952
|
if (!pending.length) {
|
|
17655
|
-
const next = await
|
|
17953
|
+
const next = await input2.next();
|
|
17656
17954
|
if (next.done) {
|
|
17657
17955
|
if (allowEof && !length)
|
|
17658
17956
|
return Buffer.alloc(0);
|
|
@@ -17791,7 +18089,7 @@ async function copyRelation(a, b, signal) {
|
|
|
17791
18089
|
|
|
17792
18090
|
// dist/usage-statistics.js
|
|
17793
18091
|
var ROLLOUT = /^rollout-.*?([0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12})(?:[_-][0-9a-f-]+)?\.jsonl(?:\.zst)?$/iu;
|
|
17794
|
-
var
|
|
18092
|
+
var text2 = (value) => typeof value === "string" ? value : "";
|
|
17795
18093
|
var ROW_KINDS = /* @__PURE__ */ new Set([
|
|
17796
18094
|
"session_meta",
|
|
17797
18095
|
"turn_context",
|
|
@@ -17825,11 +18123,11 @@ function fingerprint(files, extra = "") {
|
|
|
17825
18123
|
function typedPrompt(value) {
|
|
17826
18124
|
if (typeof value !== "string")
|
|
17827
18125
|
return void 0;
|
|
17828
|
-
const
|
|
17829
|
-
if (!
|
|
18126
|
+
const text3 = value.trim();
|
|
18127
|
+
if (!text3 || text3.startsWith("<") || text3.startsWith("# AGENTS.md") || text3.startsWith("<!--")) {
|
|
17830
18128
|
return void 0;
|
|
17831
18129
|
}
|
|
17832
|
-
return usageSessionTitle(
|
|
18130
|
+
return usageSessionTitle(text3);
|
|
17833
18131
|
}
|
|
17834
18132
|
function userItemPrompt(payload) {
|
|
17835
18133
|
if (!payload || payload.type !== "message" || payload.role !== "user")
|
|
@@ -17852,10 +18150,10 @@ async function readThreadNames(home, signal) {
|
|
|
17852
18150
|
const names = /* @__PURE__ */ new Map();
|
|
17853
18151
|
try {
|
|
17854
18152
|
for await (const line of jsonlRecords(path.join(home, "session_index.jsonl"), '"thread_name"', signal)) {
|
|
17855
|
-
const
|
|
18153
|
+
const id2 = text2(line.id);
|
|
17856
18154
|
const name = usageSessionTitle(line.thread_name);
|
|
17857
|
-
if (
|
|
17858
|
-
names.set(
|
|
18155
|
+
if (id2 && name)
|
|
18156
|
+
names.set(id2, name);
|
|
17859
18157
|
}
|
|
17860
18158
|
} catch (error51) {
|
|
17861
18159
|
if (error51.code !== "ENOENT")
|
|
@@ -17907,7 +18205,7 @@ async function readCodexRollouts(files, thread2, signal, options = {}) {
|
|
|
17907
18205
|
switch (row.type) {
|
|
17908
18206
|
case "session_meta": {
|
|
17909
18207
|
if (!firstMeta) {
|
|
17910
|
-
if (
|
|
18208
|
+
if (text2(p.id) !== thread2)
|
|
17911
18209
|
throw new Error("Codex rollout identity does not match its source");
|
|
17912
18210
|
if (p.forked_from_id || p.parent_thread_id || p.subagent_history_start_ordinal || object2(p.history_base)) {
|
|
17913
18211
|
forkAt = nativeTimeMs(p.timestamp) ?? at;
|
|
@@ -17916,22 +18214,22 @@ async function readCodexRollouts(files, thread2, signal, options = {}) {
|
|
|
17916
18214
|
else
|
|
17917
18215
|
options.onIncomplete?.();
|
|
17918
18216
|
}
|
|
17919
|
-
cwd =
|
|
18217
|
+
cwd = text2(p.cwd);
|
|
17920
18218
|
firstMeta = true;
|
|
17921
18219
|
}
|
|
17922
|
-
counters.context(
|
|
17923
|
-
counters.snapshot(at,
|
|
18220
|
+
counters.context(text2(p.session_id) || text2(p.id), "", "");
|
|
18221
|
+
counters.snapshot(at, text2(p.id), p);
|
|
17924
18222
|
break;
|
|
17925
18223
|
}
|
|
17926
18224
|
case "turn_context":
|
|
17927
|
-
if (
|
|
17928
|
-
options.onTurnId?.(
|
|
18225
|
+
if (text2(p.turn_id))
|
|
18226
|
+
options.onTurnId?.(text2(p.turn_id));
|
|
17929
18227
|
ownFrom ??= counters.entries.length;
|
|
17930
|
-
model2 =
|
|
17931
|
-
counters.context("",
|
|
18228
|
+
model2 = text2(p.model) || model2;
|
|
18229
|
+
counters.context("", text2(p.turn_id), model2);
|
|
17932
18230
|
break;
|
|
17933
18231
|
case "token_usage_record":
|
|
17934
|
-
if (!usage(p.usage) || !
|
|
18232
|
+
if (!usage(p.usage) || !text2(p.response_id))
|
|
17935
18233
|
options.onIncomplete?.();
|
|
17936
18234
|
counters.record(at, model2, p);
|
|
17937
18235
|
break;
|
|
@@ -17952,23 +18250,23 @@ async function readCodexRollouts(files, thread2, signal, options = {}) {
|
|
|
17952
18250
|
break;
|
|
17953
18251
|
case "event_msg":
|
|
17954
18252
|
if (p.type === "task_started") {
|
|
17955
|
-
if (
|
|
17956
|
-
options.onTurnId?.(
|
|
17957
|
-
counters.context("",
|
|
18253
|
+
if (text2(p.turn_id))
|
|
18254
|
+
options.onTurnId?.(text2(p.turn_id));
|
|
18255
|
+
counters.context("", text2(p.turn_id), "");
|
|
17958
18256
|
counters.boundary();
|
|
17959
18257
|
}
|
|
17960
|
-
if (p.type === "task_complete" &&
|
|
17961
|
-
options.onTurnId?.(
|
|
18258
|
+
if (p.type === "task_complete" && text2(p.turn_id)) {
|
|
18259
|
+
options.onTurnId?.(text2(p.turn_id));
|
|
17962
18260
|
const latency = p.time_to_first_token_ms;
|
|
17963
18261
|
if (typeof latency === "number" && Number.isSafeInteger(latency) && latency >= 0)
|
|
17964
|
-
options.onTurnTiming?.(
|
|
18262
|
+
options.onTurnTiming?.(text2(p.turn_id), latency, at);
|
|
17965
18263
|
}
|
|
17966
18264
|
if (p.type === "user_message") {
|
|
17967
18265
|
counters.boundary();
|
|
17968
18266
|
firstPrompt ??= typedPrompt(p.message);
|
|
17969
18267
|
}
|
|
17970
18268
|
if (p.type === "thread_settings_applied") {
|
|
17971
|
-
model2 =
|
|
18269
|
+
model2 = text2(object2(p.thread_settings)?.model) || model2;
|
|
17972
18270
|
counters.context("", "", model2);
|
|
17973
18271
|
}
|
|
17974
18272
|
if (p.type === "token_count") {
|
|
@@ -17992,13 +18290,13 @@ async function readCodexRollouts(files, thread2, signal, options = {}) {
|
|
|
17992
18290
|
return [];
|
|
17993
18291
|
if (v.thread && v.thread !== thread2 || !v.thread && forkAt && v.at < forkAt)
|
|
17994
18292
|
return [];
|
|
17995
|
-
const [
|
|
17996
|
-
const
|
|
18293
|
+
const [input2, output, cached2, written, reasoning] = v.usage.values;
|
|
18294
|
+
const id2 = v.response ? `${v.session}:${v.response}` : `legacy:${createHash("sha256").update(JSON.stringify([v.session, v.turn, v.epoch, v.at, v.total?.values, v.usage.values])).digest("hex")}`;
|
|
17997
18295
|
const entry = parseHarnessUsageEntry({
|
|
17998
|
-
id,
|
|
18296
|
+
id: id2,
|
|
17999
18297
|
occurredAtMs: v.at,
|
|
18000
18298
|
...v.model ? { model: v.model } : {},
|
|
18001
|
-
inputTokens:
|
|
18299
|
+
inputTokens: input2,
|
|
18002
18300
|
outputTokens: output,
|
|
18003
18301
|
...v.usage.known & 4 ? { cachedInputTokens: cached2 } : {},
|
|
18004
18302
|
...v.usage.known & 8 ? { cacheWriteInputTokens: written } : {},
|
|
@@ -18052,15 +18350,15 @@ function createCodexUsageStatistics(environment, options = {}) {
|
|
|
18052
18350
|
groups.clear();
|
|
18053
18351
|
for (const [thread2, files] of found) {
|
|
18054
18352
|
files.sort((a, b) => path.basename(a.file).localeCompare(path.basename(b.file)) || a.file.localeCompare(b.file));
|
|
18055
|
-
const
|
|
18056
|
-
groups.set(
|
|
18057
|
-
result.push({ id, fingerprint: fingerprint(files, indexStamp) });
|
|
18353
|
+
const id2 = path.join(home, `usage-thread-${thread2}`);
|
|
18354
|
+
groups.set(id2, { thread: thread2, files });
|
|
18355
|
+
result.push({ id: id2, fingerprint: fingerprint(files, indexStamp) });
|
|
18058
18356
|
}
|
|
18059
18357
|
return result;
|
|
18060
18358
|
},
|
|
18061
|
-
async readSource(
|
|
18359
|
+
async readSource(id2, signal) {
|
|
18062
18360
|
signal.throwIfAborted();
|
|
18063
|
-
const group = groups.get(
|
|
18361
|
+
const group = groups.get(id2);
|
|
18064
18362
|
if (!group)
|
|
18065
18363
|
throw new Error("Unknown Codex usage source; list sources before reading");
|
|
18066
18364
|
const kept = [];
|
|
@@ -18119,7 +18417,8 @@ var tokenFields = [
|
|
|
18119
18417
|
var safeIntegerFields = [
|
|
18120
18418
|
"planFiveHourResetsAtUnix",
|
|
18121
18419
|
"planSevenDayResetsAtUnix",
|
|
18122
|
-
"timeToFirstOutputMs"
|
|
18420
|
+
"timeToFirstOutputMs",
|
|
18421
|
+
"latestRequestTimeToFirstOutputMs"
|
|
18123
18422
|
];
|
|
18124
18423
|
var percentFields = [
|
|
18125
18424
|
"cacheHitRatePercent",
|
|
@@ -18333,10 +18632,10 @@ function tokenSnapshot(value) {
|
|
|
18333
18632
|
result.contextUsedTokens = used;
|
|
18334
18633
|
result.contextWindowTokens = window;
|
|
18335
18634
|
}
|
|
18336
|
-
const
|
|
18635
|
+
const input2 = integer2(last?.inputTokens);
|
|
18337
18636
|
const cached2 = integer2(last?.cachedInputTokens);
|
|
18338
|
-
if (
|
|
18339
|
-
result.cacheHitRatePercent = cached2 /
|
|
18637
|
+
if (input2 && cached2 !== void 0 && cached2 <= input2)
|
|
18638
|
+
result.cacheHitRatePercent = cached2 / input2 * 100;
|
|
18340
18639
|
if (result.inputTokens && result.cachedInputTokens !== void 0) {
|
|
18341
18640
|
result.sessionCacheUsage = {
|
|
18342
18641
|
inputTokens: result.inputTokens,
|
|
@@ -18430,8 +18729,8 @@ function createCodexSessionHistoryReader(environment) {
|
|
|
18430
18729
|
onTokenCount: (info) => {
|
|
18431
18730
|
snapshot = rolloutTokenSnapshot(info) ?? snapshot;
|
|
18432
18731
|
},
|
|
18433
|
-
onTurnId: (
|
|
18434
|
-
turns.add(
|
|
18732
|
+
onTurnId: (id2) => {
|
|
18733
|
+
turns.add(id2);
|
|
18435
18734
|
},
|
|
18436
18735
|
onTurnTiming: (turnId, timeToFirstOutputMs, at) => {
|
|
18437
18736
|
if (!lastTurnTiming || at >= lastTurnTiming.at)
|
|
@@ -18555,12 +18854,12 @@ var CodexResponseTiming = class {
|
|
|
18555
18854
|
if (frame?.method === "error")
|
|
18556
18855
|
return unavailable();
|
|
18557
18856
|
if (frame?.method === "rawResponse/completed") {
|
|
18558
|
-
const
|
|
18559
|
-
if (typeof
|
|
18857
|
+
const id2 = params.responseId;
|
|
18858
|
+
if (typeof id2 !== "string" || !id2)
|
|
18560
18859
|
return unavailable();
|
|
18561
|
-
if (state.seen.has(
|
|
18860
|
+
if (state.seen.has(id2))
|
|
18562
18861
|
return null;
|
|
18563
|
-
state.seen.add(
|
|
18862
|
+
state.seen.add(id2);
|
|
18564
18863
|
const usage2 = object2(params.usage);
|
|
18565
18864
|
const startedAtMs = state.firstOutputAtMs;
|
|
18566
18865
|
state.firstOutputAtMs = void 0;
|
|
@@ -18571,7 +18870,7 @@ var CodexResponseTiming = class {
|
|
|
18571
18870
|
return {
|
|
18572
18871
|
sessionId,
|
|
18573
18872
|
requestTiming: {
|
|
18574
|
-
requestId:
|
|
18873
|
+
requestId: id2,
|
|
18575
18874
|
turnId: state.id,
|
|
18576
18875
|
outputTokens: usage2.outputTokens,
|
|
18577
18876
|
startedAtMs,
|
|
@@ -18711,7 +19010,7 @@ function createUsageStatisticsAdapter(context) {
|
|
|
18711
19010
|
sessionUsage: createCodexSessionUsage(context.environment, abort.signal),
|
|
18712
19011
|
usageStatistics: {
|
|
18713
19012
|
listSources: (signal) => reader.listSources(AbortSignal.any([signal, abort.signal])),
|
|
18714
|
-
readSource: (
|
|
19013
|
+
readSource: (id2, signal) => reader.readSource(id2, AbortSignal.any([signal, abort.signal]))
|
|
18715
19014
|
},
|
|
18716
19015
|
close: async () => {
|
|
18717
19016
|
abort.abort();
|