@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
|
@@ -714,8 +714,8 @@ function cached(getter) {
|
|
|
714
714
|
}
|
|
715
715
|
};
|
|
716
716
|
}
|
|
717
|
-
function nullish(
|
|
718
|
-
return
|
|
717
|
+
function nullish(input2) {
|
|
718
|
+
return input2 === null || input2 === void 0;
|
|
719
719
|
}
|
|
720
720
|
function cleanRegex(source) {
|
|
721
721
|
const start = source.startsWith("^") ? 1 : 0;
|
|
@@ -802,8 +802,8 @@ function randomString(length = 10) {
|
|
|
802
802
|
function esc(str) {
|
|
803
803
|
return JSON.stringify(str);
|
|
804
804
|
}
|
|
805
|
-
function slugify(
|
|
806
|
-
return
|
|
805
|
+
function slugify(input2) {
|
|
806
|
+
return input2.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
|
|
807
807
|
}
|
|
808
808
|
var captureStackTrace = "captureStackTrace" in Error ? Error.captureStackTrace : (..._args) => {
|
|
809
809
|
};
|
|
@@ -1208,19 +1208,19 @@ function finalizeIssue(iss, ctx, config2) {
|
|
|
1208
1208
|
}
|
|
1209
1209
|
return rest;
|
|
1210
1210
|
}
|
|
1211
|
-
function getSizableOrigin(
|
|
1212
|
-
if (
|
|
1211
|
+
function getSizableOrigin(input2) {
|
|
1212
|
+
if (input2 instanceof Set)
|
|
1213
1213
|
return "set";
|
|
1214
|
-
if (
|
|
1214
|
+
if (input2 instanceof Map)
|
|
1215
1215
|
return "map";
|
|
1216
|
-
if (
|
|
1216
|
+
if (input2 instanceof File)
|
|
1217
1217
|
return "file";
|
|
1218
1218
|
return "unknown";
|
|
1219
1219
|
}
|
|
1220
|
-
function getLengthableOrigin(
|
|
1221
|
-
if (Array.isArray(
|
|
1220
|
+
function getLengthableOrigin(input2) {
|
|
1221
|
+
if (Array.isArray(input2))
|
|
1222
1222
|
return "array";
|
|
1223
|
-
if (typeof
|
|
1223
|
+
if (typeof input2 === "string")
|
|
1224
1224
|
return "string";
|
|
1225
1225
|
return "unknown";
|
|
1226
1226
|
}
|
|
@@ -1246,12 +1246,12 @@ function parsedType(data) {
|
|
|
1246
1246
|
return t;
|
|
1247
1247
|
}
|
|
1248
1248
|
function issue(...args) {
|
|
1249
|
-
const [iss,
|
|
1249
|
+
const [iss, input2, inst] = args;
|
|
1250
1250
|
if (typeof iss === "string") {
|
|
1251
1251
|
return {
|
|
1252
1252
|
message: iss,
|
|
1253
1253
|
code: "custom",
|
|
1254
|
-
input,
|
|
1254
|
+
input: input2,
|
|
1255
1255
|
inst
|
|
1256
1256
|
};
|
|
1257
1257
|
}
|
|
@@ -1262,8 +1262,8 @@ function cleanEnum(obj) {
|
|
|
1262
1262
|
return Number.isNaN(Number.parseInt(k, 10));
|
|
1263
1263
|
}).map((el) => el[1]);
|
|
1264
1264
|
}
|
|
1265
|
-
function base64ToUint8Array(
|
|
1266
|
-
const binaryString = atob(
|
|
1265
|
+
function base64ToUint8Array(base644) {
|
|
1266
|
+
const binaryString = atob(base644);
|
|
1267
1267
|
const bytes = new Uint8Array(binaryString.length);
|
|
1268
1268
|
for (let i = 0; i < binaryString.length; i++) {
|
|
1269
1269
|
bytes[i] = binaryString.charCodeAt(i);
|
|
@@ -1278,9 +1278,9 @@ function uint8ArrayToBase64(bytes) {
|
|
|
1278
1278
|
return btoa(binaryString);
|
|
1279
1279
|
}
|
|
1280
1280
|
function base64urlToUint8Array(base64url3) {
|
|
1281
|
-
const
|
|
1282
|
-
const padding = "=".repeat((4 -
|
|
1283
|
-
return base64ToUint8Array(
|
|
1281
|
+
const base644 = base64url3.replace(/-/g, "+").replace(/_/g, "/");
|
|
1282
|
+
const padding = "=".repeat((4 - base644.length % 4) % 4);
|
|
1283
|
+
return base64ToUint8Array(base644 + padding);
|
|
1284
1284
|
}
|
|
1285
1285
|
function uint8ArrayToBase64url(bytes) {
|
|
1286
1286
|
return uint8ArrayToBase64(bytes).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
|
|
@@ -1795,23 +1795,23 @@ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat"
|
|
|
1795
1795
|
bag.pattern = integer;
|
|
1796
1796
|
});
|
|
1797
1797
|
inst._zod.check = (payload) => {
|
|
1798
|
-
const
|
|
1798
|
+
const input2 = payload.value;
|
|
1799
1799
|
if (isInt) {
|
|
1800
|
-
if (!Number.isInteger(
|
|
1800
|
+
if (!Number.isInteger(input2)) {
|
|
1801
1801
|
payload.issues.push({
|
|
1802
1802
|
expected: origin,
|
|
1803
1803
|
format: def.format,
|
|
1804
1804
|
code: "invalid_type",
|
|
1805
1805
|
continue: false,
|
|
1806
|
-
input,
|
|
1806
|
+
input: input2,
|
|
1807
1807
|
inst
|
|
1808
1808
|
});
|
|
1809
1809
|
return;
|
|
1810
1810
|
}
|
|
1811
|
-
if (!Number.isSafeInteger(
|
|
1812
|
-
if (
|
|
1811
|
+
if (!Number.isSafeInteger(input2)) {
|
|
1812
|
+
if (input2 > 0) {
|
|
1813
1813
|
payload.issues.push({
|
|
1814
|
-
input,
|
|
1814
|
+
input: input2,
|
|
1815
1815
|
code: "too_big",
|
|
1816
1816
|
maximum: Number.MAX_SAFE_INTEGER,
|
|
1817
1817
|
note: "Integers must be within the safe integer range.",
|
|
@@ -1822,7 +1822,7 @@ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat"
|
|
|
1822
1822
|
});
|
|
1823
1823
|
} else {
|
|
1824
1824
|
payload.issues.push({
|
|
1825
|
-
input,
|
|
1825
|
+
input: input2,
|
|
1826
1826
|
code: "too_small",
|
|
1827
1827
|
minimum: Number.MIN_SAFE_INTEGER,
|
|
1828
1828
|
note: "Integers must be within the safe integer range.",
|
|
@@ -1835,10 +1835,10 @@ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat"
|
|
|
1835
1835
|
return;
|
|
1836
1836
|
}
|
|
1837
1837
|
}
|
|
1838
|
-
if (
|
|
1838
|
+
if (input2 < minimum) {
|
|
1839
1839
|
payload.issues.push({
|
|
1840
1840
|
origin: "number",
|
|
1841
|
-
input,
|
|
1841
|
+
input: input2,
|
|
1842
1842
|
code: "too_small",
|
|
1843
1843
|
minimum,
|
|
1844
1844
|
inclusive: true,
|
|
@@ -1846,10 +1846,10 @@ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat"
|
|
|
1846
1846
|
continue: !def.abort
|
|
1847
1847
|
});
|
|
1848
1848
|
}
|
|
1849
|
-
if (
|
|
1849
|
+
if (input2 > maximum) {
|
|
1850
1850
|
payload.issues.push({
|
|
1851
1851
|
origin: "number",
|
|
1852
|
-
input,
|
|
1852
|
+
input: input2,
|
|
1853
1853
|
code: "too_big",
|
|
1854
1854
|
maximum,
|
|
1855
1855
|
inclusive: true,
|
|
@@ -1869,11 +1869,11 @@ var $ZodCheckBigIntFormat = /* @__PURE__ */ $constructor("$ZodCheckBigIntFormat"
|
|
|
1869
1869
|
bag.maximum = maximum;
|
|
1870
1870
|
});
|
|
1871
1871
|
inst._zod.check = (payload) => {
|
|
1872
|
-
const
|
|
1873
|
-
if (
|
|
1872
|
+
const input2 = payload.value;
|
|
1873
|
+
if (input2 < minimum) {
|
|
1874
1874
|
payload.issues.push({
|
|
1875
1875
|
origin: "bigint",
|
|
1876
|
-
input,
|
|
1876
|
+
input: input2,
|
|
1877
1877
|
code: "too_small",
|
|
1878
1878
|
minimum,
|
|
1879
1879
|
inclusive: true,
|
|
@@ -1881,10 +1881,10 @@ var $ZodCheckBigIntFormat = /* @__PURE__ */ $constructor("$ZodCheckBigIntFormat"
|
|
|
1881
1881
|
continue: !def.abort
|
|
1882
1882
|
});
|
|
1883
1883
|
}
|
|
1884
|
-
if (
|
|
1884
|
+
if (input2 > maximum) {
|
|
1885
1885
|
payload.issues.push({
|
|
1886
1886
|
origin: "bigint",
|
|
1887
|
-
input,
|
|
1887
|
+
input: input2,
|
|
1888
1888
|
code: "too_big",
|
|
1889
1889
|
maximum,
|
|
1890
1890
|
inclusive: true,
|
|
@@ -1907,16 +1907,16 @@ var $ZodCheckMaxSize = /* @__PURE__ */ $constructor("$ZodCheckMaxSize", (inst, d
|
|
|
1907
1907
|
inst2._zod.bag.maximum = def.maximum;
|
|
1908
1908
|
});
|
|
1909
1909
|
inst._zod.check = (payload) => {
|
|
1910
|
-
const
|
|
1911
|
-
const size =
|
|
1910
|
+
const input2 = payload.value;
|
|
1911
|
+
const size = input2.size;
|
|
1912
1912
|
if (size <= def.maximum)
|
|
1913
1913
|
return;
|
|
1914
1914
|
payload.issues.push({
|
|
1915
|
-
origin: getSizableOrigin(
|
|
1915
|
+
origin: getSizableOrigin(input2),
|
|
1916
1916
|
code: "too_big",
|
|
1917
1917
|
maximum: def.maximum,
|
|
1918
1918
|
inclusive: true,
|
|
1919
|
-
input,
|
|
1919
|
+
input: input2,
|
|
1920
1920
|
inst,
|
|
1921
1921
|
continue: !def.abort
|
|
1922
1922
|
});
|
|
@@ -1935,16 +1935,16 @@ var $ZodCheckMinSize = /* @__PURE__ */ $constructor("$ZodCheckMinSize", (inst, d
|
|
|
1935
1935
|
inst2._zod.bag.minimum = def.minimum;
|
|
1936
1936
|
});
|
|
1937
1937
|
inst._zod.check = (payload) => {
|
|
1938
|
-
const
|
|
1939
|
-
const size =
|
|
1938
|
+
const input2 = payload.value;
|
|
1939
|
+
const size = input2.size;
|
|
1940
1940
|
if (size >= def.minimum)
|
|
1941
1941
|
return;
|
|
1942
1942
|
payload.issues.push({
|
|
1943
|
-
origin: getSizableOrigin(
|
|
1943
|
+
origin: getSizableOrigin(input2),
|
|
1944
1944
|
code: "too_small",
|
|
1945
1945
|
minimum: def.minimum,
|
|
1946
1946
|
inclusive: true,
|
|
1947
|
-
input,
|
|
1947
|
+
input: input2,
|
|
1948
1948
|
inst,
|
|
1949
1949
|
continue: !def.abort
|
|
1950
1950
|
});
|
|
@@ -1964,13 +1964,13 @@ var $ZodCheckSizeEquals = /* @__PURE__ */ $constructor("$ZodCheckSizeEquals", (i
|
|
|
1964
1964
|
bag.size = def.size;
|
|
1965
1965
|
});
|
|
1966
1966
|
inst._zod.check = (payload) => {
|
|
1967
|
-
const
|
|
1968
|
-
const size =
|
|
1967
|
+
const input2 = payload.value;
|
|
1968
|
+
const size = input2.size;
|
|
1969
1969
|
if (size === def.size)
|
|
1970
1970
|
return;
|
|
1971
1971
|
const tooBig = size > def.size;
|
|
1972
1972
|
payload.issues.push({
|
|
1973
|
-
origin: getSizableOrigin(
|
|
1973
|
+
origin: getSizableOrigin(input2),
|
|
1974
1974
|
...tooBig ? { code: "too_big", maximum: def.size } : { code: "too_small", minimum: def.size },
|
|
1975
1975
|
inclusive: true,
|
|
1976
1976
|
exact: true,
|
|
@@ -1993,17 +1993,17 @@ var $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (ins
|
|
|
1993
1993
|
inst2._zod.bag.maximum = def.maximum;
|
|
1994
1994
|
});
|
|
1995
1995
|
inst._zod.check = (payload) => {
|
|
1996
|
-
const
|
|
1997
|
-
const length =
|
|
1996
|
+
const input2 = payload.value;
|
|
1997
|
+
const length = input2.length;
|
|
1998
1998
|
if (length <= def.maximum)
|
|
1999
1999
|
return;
|
|
2000
|
-
const origin = getLengthableOrigin(
|
|
2000
|
+
const origin = getLengthableOrigin(input2);
|
|
2001
2001
|
payload.issues.push({
|
|
2002
2002
|
origin,
|
|
2003
2003
|
code: "too_big",
|
|
2004
2004
|
maximum: def.maximum,
|
|
2005
2005
|
inclusive: true,
|
|
2006
|
-
input,
|
|
2006
|
+
input: input2,
|
|
2007
2007
|
inst,
|
|
2008
2008
|
continue: !def.abort
|
|
2009
2009
|
});
|
|
@@ -2022,17 +2022,17 @@ var $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (ins
|
|
|
2022
2022
|
inst2._zod.bag.minimum = def.minimum;
|
|
2023
2023
|
});
|
|
2024
2024
|
inst._zod.check = (payload) => {
|
|
2025
|
-
const
|
|
2026
|
-
const length =
|
|
2025
|
+
const input2 = payload.value;
|
|
2026
|
+
const length = input2.length;
|
|
2027
2027
|
if (length >= def.minimum)
|
|
2028
2028
|
return;
|
|
2029
|
-
const origin = getLengthableOrigin(
|
|
2029
|
+
const origin = getLengthableOrigin(input2);
|
|
2030
2030
|
payload.issues.push({
|
|
2031
2031
|
origin,
|
|
2032
2032
|
code: "too_small",
|
|
2033
2033
|
minimum: def.minimum,
|
|
2034
2034
|
inclusive: true,
|
|
2035
|
-
input,
|
|
2035
|
+
input: input2,
|
|
2036
2036
|
inst,
|
|
2037
2037
|
continue: !def.abort
|
|
2038
2038
|
});
|
|
@@ -2052,11 +2052,11 @@ var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals"
|
|
|
2052
2052
|
bag.length = def.length;
|
|
2053
2053
|
});
|
|
2054
2054
|
inst._zod.check = (payload) => {
|
|
2055
|
-
const
|
|
2056
|
-
const length =
|
|
2055
|
+
const input2 = payload.value;
|
|
2056
|
+
const length = input2.length;
|
|
2057
2057
|
if (length === def.length)
|
|
2058
2058
|
return;
|
|
2059
|
-
const origin = getLengthableOrigin(
|
|
2059
|
+
const origin = getLengthableOrigin(input2);
|
|
2060
2060
|
const tooBig = length > def.length;
|
|
2061
2061
|
payload.issues.push({
|
|
2062
2062
|
origin,
|
|
@@ -2646,8 +2646,8 @@ var $ZodBase64 = /* @__PURE__ */ $constructor("$ZodBase64", (inst, def) => {
|
|
|
2646
2646
|
function isValidBase64URL(data) {
|
|
2647
2647
|
if (!base64url.test(data))
|
|
2648
2648
|
return false;
|
|
2649
|
-
const
|
|
2650
|
-
const padded =
|
|
2649
|
+
const base644 = data.replace(/[-_]/g, (c) => c === "-" ? "+" : "/");
|
|
2650
|
+
const padded = base644.padEnd(Math.ceil(base644.length / 4) * 4, "=");
|
|
2651
2651
|
return isValidBase64(padded);
|
|
2652
2652
|
}
|
|
2653
2653
|
var $ZodBase64URL = /* @__PURE__ */ $constructor("$ZodBase64URL", (inst, def) => {
|
|
@@ -2727,15 +2727,15 @@ var $ZodNumber = /* @__PURE__ */ $constructor("$ZodNumber", (inst, def) => {
|
|
|
2727
2727
|
payload.value = Number(payload.value);
|
|
2728
2728
|
} catch (_) {
|
|
2729
2729
|
}
|
|
2730
|
-
const
|
|
2731
|
-
if (typeof
|
|
2730
|
+
const input2 = payload.value;
|
|
2731
|
+
if (typeof input2 === "number" && !Number.isNaN(input2) && Number.isFinite(input2)) {
|
|
2732
2732
|
return payload;
|
|
2733
2733
|
}
|
|
2734
|
-
const received = typeof
|
|
2734
|
+
const received = typeof input2 === "number" ? Number.isNaN(input2) ? "NaN" : !Number.isFinite(input2) ? "Infinity" : void 0 : void 0;
|
|
2735
2735
|
payload.issues.push({
|
|
2736
2736
|
expected: "number",
|
|
2737
2737
|
code: "invalid_type",
|
|
2738
|
-
input,
|
|
2738
|
+
input: input2,
|
|
2739
2739
|
inst,
|
|
2740
2740
|
...received ? { received } : {}
|
|
2741
2741
|
});
|
|
@@ -2755,13 +2755,13 @@ var $ZodBoolean = /* @__PURE__ */ $constructor("$ZodBoolean", (inst, def) => {
|
|
|
2755
2755
|
payload.value = Boolean(payload.value);
|
|
2756
2756
|
} catch (_) {
|
|
2757
2757
|
}
|
|
2758
|
-
const
|
|
2759
|
-
if (typeof
|
|
2758
|
+
const input2 = payload.value;
|
|
2759
|
+
if (typeof input2 === "boolean")
|
|
2760
2760
|
return payload;
|
|
2761
2761
|
payload.issues.push({
|
|
2762
2762
|
expected: "boolean",
|
|
2763
2763
|
code: "invalid_type",
|
|
2764
|
-
input,
|
|
2764
|
+
input: input2,
|
|
2765
2765
|
inst
|
|
2766
2766
|
});
|
|
2767
2767
|
return payload;
|
|
@@ -2794,13 +2794,13 @@ var $ZodBigIntFormat = /* @__PURE__ */ $constructor("$ZodBigIntFormat", (inst, d
|
|
|
2794
2794
|
var $ZodSymbol = /* @__PURE__ */ $constructor("$ZodSymbol", (inst, def) => {
|
|
2795
2795
|
$ZodType.init(inst, def);
|
|
2796
2796
|
inst._zod.parse = (payload, _ctx) => {
|
|
2797
|
-
const
|
|
2798
|
-
if (typeof
|
|
2797
|
+
const input2 = payload.value;
|
|
2798
|
+
if (typeof input2 === "symbol")
|
|
2799
2799
|
return payload;
|
|
2800
2800
|
payload.issues.push({
|
|
2801
2801
|
expected: "symbol",
|
|
2802
2802
|
code: "invalid_type",
|
|
2803
|
-
input,
|
|
2803
|
+
input: input2,
|
|
2804
2804
|
inst
|
|
2805
2805
|
});
|
|
2806
2806
|
return payload;
|
|
@@ -2811,13 +2811,13 @@ var $ZodUndefined = /* @__PURE__ */ $constructor("$ZodUndefined", (inst, def) =>
|
|
|
2811
2811
|
inst._zod.pattern = _undefined;
|
|
2812
2812
|
inst._zod.values = /* @__PURE__ */ new Set([void 0]);
|
|
2813
2813
|
inst._zod.parse = (payload, _ctx) => {
|
|
2814
|
-
const
|
|
2815
|
-
if (typeof
|
|
2814
|
+
const input2 = payload.value;
|
|
2815
|
+
if (typeof input2 === "undefined")
|
|
2816
2816
|
return payload;
|
|
2817
2817
|
payload.issues.push({
|
|
2818
2818
|
expected: "undefined",
|
|
2819
2819
|
code: "invalid_type",
|
|
2820
|
-
input,
|
|
2820
|
+
input: input2,
|
|
2821
2821
|
inst
|
|
2822
2822
|
});
|
|
2823
2823
|
return payload;
|
|
@@ -2828,13 +2828,13 @@ var $ZodNull = /* @__PURE__ */ $constructor("$ZodNull", (inst, def) => {
|
|
|
2828
2828
|
inst._zod.pattern = _null;
|
|
2829
2829
|
inst._zod.values = /* @__PURE__ */ new Set([null]);
|
|
2830
2830
|
inst._zod.parse = (payload, _ctx) => {
|
|
2831
|
-
const
|
|
2832
|
-
if (
|
|
2831
|
+
const input2 = payload.value;
|
|
2832
|
+
if (input2 === null)
|
|
2833
2833
|
return payload;
|
|
2834
2834
|
payload.issues.push({
|
|
2835
2835
|
expected: "null",
|
|
2836
2836
|
code: "invalid_type",
|
|
2837
|
-
input,
|
|
2837
|
+
input: input2,
|
|
2838
2838
|
inst
|
|
2839
2839
|
});
|
|
2840
2840
|
return payload;
|
|
@@ -2863,13 +2863,13 @@ var $ZodNever = /* @__PURE__ */ $constructor("$ZodNever", (inst, def) => {
|
|
|
2863
2863
|
var $ZodVoid = /* @__PURE__ */ $constructor("$ZodVoid", (inst, def) => {
|
|
2864
2864
|
$ZodType.init(inst, def);
|
|
2865
2865
|
inst._zod.parse = (payload, _ctx) => {
|
|
2866
|
-
const
|
|
2867
|
-
if (typeof
|
|
2866
|
+
const input2 = payload.value;
|
|
2867
|
+
if (typeof input2 === "undefined")
|
|
2868
2868
|
return payload;
|
|
2869
2869
|
payload.issues.push({
|
|
2870
2870
|
expected: "void",
|
|
2871
2871
|
code: "invalid_type",
|
|
2872
|
-
input,
|
|
2872
|
+
input: input2,
|
|
2873
2873
|
inst
|
|
2874
2874
|
});
|
|
2875
2875
|
return payload;
|
|
@@ -2884,15 +2884,15 @@ var $ZodDate = /* @__PURE__ */ $constructor("$ZodDate", (inst, def) => {
|
|
|
2884
2884
|
} catch (_err) {
|
|
2885
2885
|
}
|
|
2886
2886
|
}
|
|
2887
|
-
const
|
|
2888
|
-
const isDate =
|
|
2889
|
-
const isValidDate = isDate && !Number.isNaN(
|
|
2887
|
+
const input2 = payload.value;
|
|
2888
|
+
const isDate = input2 instanceof Date;
|
|
2889
|
+
const isValidDate = isDate && !Number.isNaN(input2.getTime());
|
|
2890
2890
|
if (isValidDate)
|
|
2891
2891
|
return payload;
|
|
2892
2892
|
payload.issues.push({
|
|
2893
2893
|
expected: "date",
|
|
2894
2894
|
code: "invalid_type",
|
|
2895
|
-
input,
|
|
2895
|
+
input: input2,
|
|
2896
2896
|
...isDate ? { received: "Invalid Date" } : {},
|
|
2897
2897
|
inst
|
|
2898
2898
|
});
|
|
@@ -2908,20 +2908,20 @@ function handleArrayResult(result, final, index) {
|
|
|
2908
2908
|
var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
|
|
2909
2909
|
$ZodType.init(inst, def);
|
|
2910
2910
|
inst._zod.parse = (payload, ctx) => {
|
|
2911
|
-
const
|
|
2912
|
-
if (!Array.isArray(
|
|
2911
|
+
const input2 = payload.value;
|
|
2912
|
+
if (!Array.isArray(input2)) {
|
|
2913
2913
|
payload.issues.push({
|
|
2914
2914
|
expected: "array",
|
|
2915
2915
|
code: "invalid_type",
|
|
2916
|
-
input,
|
|
2916
|
+
input: input2,
|
|
2917
2917
|
inst
|
|
2918
2918
|
});
|
|
2919
2919
|
return payload;
|
|
2920
2920
|
}
|
|
2921
|
-
payload.value = Array(
|
|
2921
|
+
payload.value = Array(input2.length);
|
|
2922
2922
|
const proms = [];
|
|
2923
|
-
for (let i = 0; i <
|
|
2924
|
-
const item =
|
|
2923
|
+
for (let i = 0; i < input2.length; i++) {
|
|
2924
|
+
const item = input2[i];
|
|
2925
2925
|
const result = def.element._zod.run({
|
|
2926
2926
|
value: item,
|
|
2927
2927
|
issues: []
|
|
@@ -2938,8 +2938,8 @@ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
|
|
|
2938
2938
|
return payload;
|
|
2939
2939
|
};
|
|
2940
2940
|
});
|
|
2941
|
-
function handlePropertyResult(result, final, key,
|
|
2942
|
-
const isPresent = key in
|
|
2941
|
+
function handlePropertyResult(result, final, key, input2, isOptionalIn, isOptionalOut) {
|
|
2942
|
+
const isPresent = key in input2;
|
|
2943
2943
|
if (result.issues.length) {
|
|
2944
2944
|
if (isOptionalIn && isOptionalOut && !isPresent) {
|
|
2945
2945
|
return;
|
|
@@ -2981,14 +2981,14 @@ function normalizeDef(def) {
|
|
|
2981
2981
|
optionalKeys: new Set(okeys)
|
|
2982
2982
|
};
|
|
2983
2983
|
}
|
|
2984
|
-
function handleCatchall(proms,
|
|
2984
|
+
function handleCatchall(proms, input2, payload, ctx, def, inst) {
|
|
2985
2985
|
const unrecognized = [];
|
|
2986
2986
|
const keySet = def.keySet;
|
|
2987
2987
|
const _catchall = def.catchall._zod;
|
|
2988
2988
|
const t = _catchall.def.type;
|
|
2989
2989
|
const isOptionalIn = _catchall.optin === "optional";
|
|
2990
2990
|
const isOptionalOut = _catchall.optout === "optional";
|
|
2991
|
-
for (const key in
|
|
2991
|
+
for (const key in input2) {
|
|
2992
2992
|
if (key === "__proto__")
|
|
2993
2993
|
continue;
|
|
2994
2994
|
if (keySet.has(key))
|
|
@@ -2997,18 +2997,18 @@ function handleCatchall(proms, input, payload, ctx, def, inst) {
|
|
|
2997
2997
|
unrecognized.push(key);
|
|
2998
2998
|
continue;
|
|
2999
2999
|
}
|
|
3000
|
-
const r = _catchall.run({ value:
|
|
3000
|
+
const r = _catchall.run({ value: input2[key], issues: [] }, ctx);
|
|
3001
3001
|
if (r instanceof Promise) {
|
|
3002
|
-
proms.push(r.then((r2) => handlePropertyResult(r2, payload, key,
|
|
3002
|
+
proms.push(r.then((r2) => handlePropertyResult(r2, payload, key, input2, isOptionalIn, isOptionalOut)));
|
|
3003
3003
|
} else {
|
|
3004
|
-
handlePropertyResult(r, payload, key,
|
|
3004
|
+
handlePropertyResult(r, payload, key, input2, isOptionalIn, isOptionalOut);
|
|
3005
3005
|
}
|
|
3006
3006
|
}
|
|
3007
3007
|
if (unrecognized.length) {
|
|
3008
3008
|
payload.issues.push({
|
|
3009
3009
|
code: "unrecognized_keys",
|
|
3010
3010
|
keys: unrecognized,
|
|
3011
|
-
input,
|
|
3011
|
+
input: input2,
|
|
3012
3012
|
inst
|
|
3013
3013
|
});
|
|
3014
3014
|
}
|
|
@@ -3052,12 +3052,12 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
3052
3052
|
let value;
|
|
3053
3053
|
inst._zod.parse = (payload, ctx) => {
|
|
3054
3054
|
value ?? (value = _normalized.value);
|
|
3055
|
-
const
|
|
3056
|
-
if (!isObject2(
|
|
3055
|
+
const input2 = payload.value;
|
|
3056
|
+
if (!isObject2(input2)) {
|
|
3057
3057
|
payload.issues.push({
|
|
3058
3058
|
expected: "object",
|
|
3059
3059
|
code: "invalid_type",
|
|
3060
|
-
input,
|
|
3060
|
+
input: input2,
|
|
3061
3061
|
inst
|
|
3062
3062
|
});
|
|
3063
3063
|
return payload;
|
|
@@ -3069,17 +3069,17 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
3069
3069
|
const el = shape[key];
|
|
3070
3070
|
const isOptionalIn = el._zod.optin === "optional";
|
|
3071
3071
|
const isOptionalOut = el._zod.optout === "optional";
|
|
3072
|
-
const r = el._zod.run({ value:
|
|
3072
|
+
const r = el._zod.run({ value: input2[key], issues: [] }, ctx);
|
|
3073
3073
|
if (r instanceof Promise) {
|
|
3074
|
-
proms.push(r.then((r2) => handlePropertyResult(r2, payload, key,
|
|
3074
|
+
proms.push(r.then((r2) => handlePropertyResult(r2, payload, key, input2, isOptionalIn, isOptionalOut)));
|
|
3075
3075
|
} else {
|
|
3076
|
-
handlePropertyResult(r, payload, key,
|
|
3076
|
+
handlePropertyResult(r, payload, key, input2, isOptionalIn, isOptionalOut);
|
|
3077
3077
|
}
|
|
3078
3078
|
}
|
|
3079
3079
|
if (!catchall) {
|
|
3080
3080
|
return proms.length ? Promise.all(proms).then(() => payload) : payload;
|
|
3081
3081
|
}
|
|
3082
|
-
return handleCatchall(proms,
|
|
3082
|
+
return handleCatchall(proms, input2, payload, ctx, _normalized.value, inst);
|
|
3083
3083
|
};
|
|
3084
3084
|
});
|
|
3085
3085
|
var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) => {
|
|
@@ -3101,42 +3101,42 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
3101
3101
|
}
|
|
3102
3102
|
doc.write(`const newResult = {};`);
|
|
3103
3103
|
for (const key of normalized.keys) {
|
|
3104
|
-
const
|
|
3104
|
+
const id2 = ids[key];
|
|
3105
3105
|
const k = esc(key);
|
|
3106
3106
|
const schema = shape[key];
|
|
3107
3107
|
const isOptionalIn = schema?._zod?.optin === "optional";
|
|
3108
3108
|
const isOptionalOut = schema?._zod?.optout === "optional";
|
|
3109
|
-
doc.write(`const ${
|
|
3109
|
+
doc.write(`const ${id2} = ${parseStr(key)};`);
|
|
3110
3110
|
if (isOptionalIn && isOptionalOut) {
|
|
3111
3111
|
doc.write(`
|
|
3112
|
-
if (${
|
|
3112
|
+
if (${id2}.issues.length) {
|
|
3113
3113
|
if (${k} in input) {
|
|
3114
|
-
payload.issues = payload.issues.concat(${
|
|
3114
|
+
payload.issues = payload.issues.concat(${id2}.issues.map(iss => ({
|
|
3115
3115
|
...iss,
|
|
3116
3116
|
path: iss.path ? [${k}, ...iss.path] : [${k}]
|
|
3117
3117
|
})));
|
|
3118
3118
|
}
|
|
3119
3119
|
}
|
|
3120
3120
|
|
|
3121
|
-
if (${
|
|
3121
|
+
if (${id2}.value === undefined) {
|
|
3122
3122
|
if (${k} in input) {
|
|
3123
3123
|
newResult[${k}] = undefined;
|
|
3124
3124
|
}
|
|
3125
3125
|
} else {
|
|
3126
|
-
newResult[${k}] = ${
|
|
3126
|
+
newResult[${k}] = ${id2}.value;
|
|
3127
3127
|
}
|
|
3128
3128
|
|
|
3129
3129
|
`);
|
|
3130
3130
|
} else if (!isOptionalIn) {
|
|
3131
3131
|
doc.write(`
|
|
3132
|
-
const ${
|
|
3133
|
-
if (${
|
|
3134
|
-
payload.issues = payload.issues.concat(${
|
|
3132
|
+
const ${id2}_present = ${k} in input;
|
|
3133
|
+
if (${id2}.issues.length) {
|
|
3134
|
+
payload.issues = payload.issues.concat(${id2}.issues.map(iss => ({
|
|
3135
3135
|
...iss,
|
|
3136
3136
|
path: iss.path ? [${k}, ...iss.path] : [${k}]
|
|
3137
3137
|
})));
|
|
3138
3138
|
}
|
|
3139
|
-
if (!${
|
|
3139
|
+
if (!${id2}_present && !${id2}.issues.length) {
|
|
3140
3140
|
payload.issues.push({
|
|
3141
3141
|
code: "invalid_type",
|
|
3142
3142
|
expected: "nonoptional",
|
|
@@ -3145,30 +3145,30 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
3145
3145
|
});
|
|
3146
3146
|
}
|
|
3147
3147
|
|
|
3148
|
-
if (${
|
|
3149
|
-
if (${
|
|
3148
|
+
if (${id2}_present) {
|
|
3149
|
+
if (${id2}.value === undefined) {
|
|
3150
3150
|
newResult[${k}] = undefined;
|
|
3151
3151
|
} else {
|
|
3152
|
-
newResult[${k}] = ${
|
|
3152
|
+
newResult[${k}] = ${id2}.value;
|
|
3153
3153
|
}
|
|
3154
3154
|
}
|
|
3155
3155
|
|
|
3156
3156
|
`);
|
|
3157
3157
|
} else {
|
|
3158
3158
|
doc.write(`
|
|
3159
|
-
if (${
|
|
3160
|
-
payload.issues = payload.issues.concat(${
|
|
3159
|
+
if (${id2}.issues.length) {
|
|
3160
|
+
payload.issues = payload.issues.concat(${id2}.issues.map(iss => ({
|
|
3161
3161
|
...iss,
|
|
3162
3162
|
path: iss.path ? [${k}, ...iss.path] : [${k}]
|
|
3163
3163
|
})));
|
|
3164
3164
|
}
|
|
3165
3165
|
|
|
3166
|
-
if (${
|
|
3166
|
+
if (${id2}.value === undefined) {
|
|
3167
3167
|
if (${k} in input) {
|
|
3168
3168
|
newResult[${k}] = undefined;
|
|
3169
3169
|
}
|
|
3170
3170
|
} else {
|
|
3171
|
-
newResult[${k}] = ${
|
|
3171
|
+
newResult[${k}] = ${id2}.value;
|
|
3172
3172
|
}
|
|
3173
3173
|
|
|
3174
3174
|
`);
|
|
@@ -3188,12 +3188,12 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
3188
3188
|
let value;
|
|
3189
3189
|
inst._zod.parse = (payload, ctx) => {
|
|
3190
3190
|
value ?? (value = _normalized.value);
|
|
3191
|
-
const
|
|
3192
|
-
if (!isObject2(
|
|
3191
|
+
const input2 = payload.value;
|
|
3192
|
+
if (!isObject2(input2)) {
|
|
3193
3193
|
payload.issues.push({
|
|
3194
3194
|
expected: "object",
|
|
3195
3195
|
code: "invalid_type",
|
|
3196
|
-
input,
|
|
3196
|
+
input: input2,
|
|
3197
3197
|
inst
|
|
3198
3198
|
});
|
|
3199
3199
|
return payload;
|
|
@@ -3204,7 +3204,7 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
3204
3204
|
payload = fastpass(payload, ctx);
|
|
3205
3205
|
if (!catchall)
|
|
3206
3206
|
return payload;
|
|
3207
|
-
return handleCatchall([],
|
|
3207
|
+
return handleCatchall([], input2, payload, ctx, value, inst);
|
|
3208
3208
|
}
|
|
3209
3209
|
return superParse(payload, ctx);
|
|
3210
3210
|
};
|
|
@@ -3364,17 +3364,17 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
|
|
|
3364
3364
|
return map2;
|
|
3365
3365
|
});
|
|
3366
3366
|
inst._zod.parse = (payload, ctx) => {
|
|
3367
|
-
const
|
|
3368
|
-
if (!isObject(
|
|
3367
|
+
const input2 = payload.value;
|
|
3368
|
+
if (!isObject(input2)) {
|
|
3369
3369
|
payload.issues.push({
|
|
3370
3370
|
code: "invalid_type",
|
|
3371
3371
|
expected: "object",
|
|
3372
|
-
input,
|
|
3372
|
+
input: input2,
|
|
3373
3373
|
inst
|
|
3374
3374
|
});
|
|
3375
3375
|
return payload;
|
|
3376
3376
|
}
|
|
3377
|
-
const opt = disc.value.get(
|
|
3377
|
+
const opt = disc.value.get(input2?.[def.discriminator]);
|
|
3378
3378
|
if (opt) {
|
|
3379
3379
|
return opt._zod.run(payload, ctx);
|
|
3380
3380
|
}
|
|
@@ -3387,7 +3387,7 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
|
|
|
3387
3387
|
note: "No matching discriminator",
|
|
3388
3388
|
discriminator: def.discriminator,
|
|
3389
3389
|
options: Array.from(disc.value.keys()),
|
|
3390
|
-
input,
|
|
3390
|
+
input: input2,
|
|
3391
3391
|
path: [def.discriminator],
|
|
3392
3392
|
inst
|
|
3393
3393
|
});
|
|
@@ -3397,9 +3397,9 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
|
|
|
3397
3397
|
var $ZodIntersection = /* @__PURE__ */ $constructor("$ZodIntersection", (inst, def) => {
|
|
3398
3398
|
$ZodType.init(inst, def);
|
|
3399
3399
|
inst._zod.parse = (payload, ctx) => {
|
|
3400
|
-
const
|
|
3401
|
-
const left = def.left._zod.run({ value:
|
|
3402
|
-
const right = def.right._zod.run({ value:
|
|
3400
|
+
const input2 = payload.value;
|
|
3401
|
+
const left = def.left._zod.run({ value: input2, issues: [] }, ctx);
|
|
3402
|
+
const right = def.right._zod.run({ value: input2, issues: [] }, ctx);
|
|
3403
3403
|
const async = left instanceof Promise || right instanceof Promise;
|
|
3404
3404
|
if (async) {
|
|
3405
3405
|
return Promise.all([left, right]).then(([left2, right2]) => {
|
|
@@ -3496,10 +3496,10 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
|
|
|
3496
3496
|
$ZodType.init(inst, def);
|
|
3497
3497
|
const items = def.items;
|
|
3498
3498
|
inst._zod.parse = (payload, ctx) => {
|
|
3499
|
-
const
|
|
3500
|
-
if (!Array.isArray(
|
|
3499
|
+
const input2 = payload.value;
|
|
3500
|
+
if (!Array.isArray(input2)) {
|
|
3501
3501
|
payload.issues.push({
|
|
3502
|
-
input,
|
|
3502
|
+
input: input2,
|
|
3503
3503
|
inst,
|
|
3504
3504
|
expected: "tuple",
|
|
3505
3505
|
code: "invalid_type"
|
|
@@ -3511,23 +3511,23 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
|
|
|
3511
3511
|
const optinStart = getTupleOptStart(items, "optin");
|
|
3512
3512
|
const optoutStart = getTupleOptStart(items, "optout");
|
|
3513
3513
|
if (!def.rest) {
|
|
3514
|
-
if (
|
|
3514
|
+
if (input2.length < optinStart) {
|
|
3515
3515
|
payload.issues.push({
|
|
3516
3516
|
code: "too_small",
|
|
3517
3517
|
minimum: optinStart,
|
|
3518
3518
|
inclusive: true,
|
|
3519
|
-
input,
|
|
3519
|
+
input: input2,
|
|
3520
3520
|
inst,
|
|
3521
3521
|
origin: "array"
|
|
3522
3522
|
});
|
|
3523
3523
|
return payload;
|
|
3524
3524
|
}
|
|
3525
|
-
if (
|
|
3525
|
+
if (input2.length > items.length) {
|
|
3526
3526
|
payload.issues.push({
|
|
3527
3527
|
code: "too_big",
|
|
3528
3528
|
maximum: items.length,
|
|
3529
3529
|
inclusive: true,
|
|
3530
|
-
input,
|
|
3530
|
+
input: input2,
|
|
3531
3531
|
inst,
|
|
3532
3532
|
origin: "array"
|
|
3533
3533
|
});
|
|
@@ -3535,7 +3535,7 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
|
|
|
3535
3535
|
}
|
|
3536
3536
|
const itemResults = new Array(items.length);
|
|
3537
3537
|
for (let i = 0; i < items.length; i++) {
|
|
3538
|
-
const r = items[i]._zod.run({ value:
|
|
3538
|
+
const r = items[i]._zod.run({ value: input2[i], issues: [] }, ctx);
|
|
3539
3539
|
if (r instanceof Promise) {
|
|
3540
3540
|
proms.push(r.then((rr) => {
|
|
3541
3541
|
itemResults[i] = rr;
|
|
@@ -3546,7 +3546,7 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
|
|
|
3546
3546
|
}
|
|
3547
3547
|
if (def.rest) {
|
|
3548
3548
|
let i = items.length - 1;
|
|
3549
|
-
const rest =
|
|
3549
|
+
const rest = input2.slice(items.length);
|
|
3550
3550
|
for (const el of rest) {
|
|
3551
3551
|
i++;
|
|
3552
3552
|
const result = def.rest._zod.run({ value: el, issues: [] }, ctx);
|
|
@@ -3558,9 +3558,9 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
|
|
|
3558
3558
|
}
|
|
3559
3559
|
}
|
|
3560
3560
|
if (proms.length) {
|
|
3561
|
-
return Promise.all(proms).then(() => handleTupleResults(itemResults, payload, items,
|
|
3561
|
+
return Promise.all(proms).then(() => handleTupleResults(itemResults, payload, items, input2, optoutStart));
|
|
3562
3562
|
}
|
|
3563
|
-
return handleTupleResults(itemResults, payload, items,
|
|
3563
|
+
return handleTupleResults(itemResults, payload, items, input2, optoutStart);
|
|
3564
3564
|
};
|
|
3565
3565
|
});
|
|
3566
3566
|
function getTupleOptStart(items, key) {
|
|
@@ -3576,10 +3576,10 @@ function handleTupleResult(result, final, index) {
|
|
|
3576
3576
|
}
|
|
3577
3577
|
final.value[index] = result.value;
|
|
3578
3578
|
}
|
|
3579
|
-
function handleTupleResults(itemResults, final, items,
|
|
3579
|
+
function handleTupleResults(itemResults, final, items, input2, optoutStart) {
|
|
3580
3580
|
for (let i = 0; i < items.length; i++) {
|
|
3581
3581
|
const r = itemResults[i];
|
|
3582
|
-
const isPresent = i <
|
|
3582
|
+
const isPresent = i < input2.length;
|
|
3583
3583
|
if (r.issues.length) {
|
|
3584
3584
|
if (!isPresent && i >= optoutStart) {
|
|
3585
3585
|
final.value.length = i;
|
|
@@ -3589,7 +3589,7 @@ function handleTupleResults(itemResults, final, items, input, optoutStart) {
|
|
|
3589
3589
|
}
|
|
3590
3590
|
final.value[i] = r.value;
|
|
3591
3591
|
}
|
|
3592
|
-
for (let i = final.value.length - 1; i >=
|
|
3592
|
+
for (let i = final.value.length - 1; i >= input2.length; i--) {
|
|
3593
3593
|
if (items[i]._zod.optout === "optional" && final.value[i] === void 0) {
|
|
3594
3594
|
final.value.length = i;
|
|
3595
3595
|
} else {
|
|
@@ -3601,12 +3601,12 @@ function handleTupleResults(itemResults, final, items, input, optoutStart) {
|
|
|
3601
3601
|
var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
3602
3602
|
$ZodType.init(inst, def);
|
|
3603
3603
|
inst._zod.parse = (payload, ctx) => {
|
|
3604
|
-
const
|
|
3605
|
-
if (!isPlainObject(
|
|
3604
|
+
const input2 = payload.value;
|
|
3605
|
+
if (!isPlainObject(input2)) {
|
|
3606
3606
|
payload.issues.push({
|
|
3607
3607
|
expected: "record",
|
|
3608
3608
|
code: "invalid_type",
|
|
3609
|
-
input,
|
|
3609
|
+
input: input2,
|
|
3610
3610
|
inst
|
|
3611
3611
|
});
|
|
3612
3612
|
return payload;
|
|
@@ -3635,7 +3635,7 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
3635
3635
|
continue;
|
|
3636
3636
|
}
|
|
3637
3637
|
const outKey = keyResult.value;
|
|
3638
|
-
const result = def.valueType._zod.run({ value:
|
|
3638
|
+
const result = def.valueType._zod.run({ value: input2[key], issues: [] }, ctx);
|
|
3639
3639
|
if (result instanceof Promise) {
|
|
3640
3640
|
proms.push(result.then((result2) => {
|
|
3641
3641
|
if (result2.issues.length) {
|
|
@@ -3652,7 +3652,7 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
3652
3652
|
}
|
|
3653
3653
|
}
|
|
3654
3654
|
let unrecognized;
|
|
3655
|
-
for (const key in
|
|
3655
|
+
for (const key in input2) {
|
|
3656
3656
|
if (!recordKeys.has(key)) {
|
|
3657
3657
|
unrecognized = unrecognized ?? [];
|
|
3658
3658
|
unrecognized.push(key);
|
|
@@ -3661,17 +3661,17 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
3661
3661
|
if (unrecognized && unrecognized.length > 0) {
|
|
3662
3662
|
payload.issues.push({
|
|
3663
3663
|
code: "unrecognized_keys",
|
|
3664
|
-
input,
|
|
3664
|
+
input: input2,
|
|
3665
3665
|
inst,
|
|
3666
3666
|
keys: unrecognized
|
|
3667
3667
|
});
|
|
3668
3668
|
}
|
|
3669
3669
|
} else {
|
|
3670
3670
|
payload.value = {};
|
|
3671
|
-
for (const key of Reflect.ownKeys(
|
|
3671
|
+
for (const key of Reflect.ownKeys(input2)) {
|
|
3672
3672
|
if (key === "__proto__")
|
|
3673
3673
|
continue;
|
|
3674
|
-
if (!Object.prototype.propertyIsEnumerable.call(
|
|
3674
|
+
if (!Object.prototype.propertyIsEnumerable.call(input2, key))
|
|
3675
3675
|
continue;
|
|
3676
3676
|
let keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
|
|
3677
3677
|
if (keyResult instanceof Promise) {
|
|
@@ -3689,7 +3689,7 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
3689
3689
|
}
|
|
3690
3690
|
if (keyResult.issues.length) {
|
|
3691
3691
|
if (def.mode === "loose") {
|
|
3692
|
-
payload.value[key] =
|
|
3692
|
+
payload.value[key] = input2[key];
|
|
3693
3693
|
} else {
|
|
3694
3694
|
payload.issues.push({
|
|
3695
3695
|
code: "invalid_key",
|
|
@@ -3702,7 +3702,7 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
3702
3702
|
}
|
|
3703
3703
|
continue;
|
|
3704
3704
|
}
|
|
3705
|
-
const result = def.valueType._zod.run({ value:
|
|
3705
|
+
const result = def.valueType._zod.run({ value: input2[key], issues: [] }, ctx);
|
|
3706
3706
|
if (result instanceof Promise) {
|
|
3707
3707
|
proms.push(result.then((result2) => {
|
|
3708
3708
|
if (result2.issues.length) {
|
|
@@ -3727,27 +3727,27 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
3727
3727
|
var $ZodMap = /* @__PURE__ */ $constructor("$ZodMap", (inst, def) => {
|
|
3728
3728
|
$ZodType.init(inst, def);
|
|
3729
3729
|
inst._zod.parse = (payload, ctx) => {
|
|
3730
|
-
const
|
|
3731
|
-
if (!(
|
|
3730
|
+
const input2 = payload.value;
|
|
3731
|
+
if (!(input2 instanceof Map)) {
|
|
3732
3732
|
payload.issues.push({
|
|
3733
3733
|
expected: "map",
|
|
3734
3734
|
code: "invalid_type",
|
|
3735
|
-
input,
|
|
3735
|
+
input: input2,
|
|
3736
3736
|
inst
|
|
3737
3737
|
});
|
|
3738
3738
|
return payload;
|
|
3739
3739
|
}
|
|
3740
3740
|
const proms = [];
|
|
3741
3741
|
payload.value = /* @__PURE__ */ new Map();
|
|
3742
|
-
for (const [key, value] of
|
|
3742
|
+
for (const [key, value] of input2) {
|
|
3743
3743
|
const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
|
|
3744
3744
|
const valueResult = def.valueType._zod.run({ value, issues: [] }, ctx);
|
|
3745
3745
|
if (keyResult instanceof Promise || valueResult instanceof Promise) {
|
|
3746
3746
|
proms.push(Promise.all([keyResult, valueResult]).then(([keyResult2, valueResult2]) => {
|
|
3747
|
-
handleMapResult(keyResult2, valueResult2, payload, key,
|
|
3747
|
+
handleMapResult(keyResult2, valueResult2, payload, key, input2, inst, ctx);
|
|
3748
3748
|
}));
|
|
3749
3749
|
} else {
|
|
3750
|
-
handleMapResult(keyResult, valueResult, payload, key,
|
|
3750
|
+
handleMapResult(keyResult, valueResult, payload, key, input2, inst, ctx);
|
|
3751
3751
|
}
|
|
3752
3752
|
}
|
|
3753
3753
|
if (proms.length)
|
|
@@ -3755,7 +3755,7 @@ var $ZodMap = /* @__PURE__ */ $constructor("$ZodMap", (inst, def) => {
|
|
|
3755
3755
|
return payload;
|
|
3756
3756
|
};
|
|
3757
3757
|
});
|
|
3758
|
-
function handleMapResult(keyResult, valueResult, final, key,
|
|
3758
|
+
function handleMapResult(keyResult, valueResult, final, key, input2, inst, ctx) {
|
|
3759
3759
|
if (keyResult.issues.length) {
|
|
3760
3760
|
if (propertyKeyTypes.has(typeof key)) {
|
|
3761
3761
|
final.issues.push(...prefixIssues(key, keyResult.issues));
|
|
@@ -3763,7 +3763,7 @@ function handleMapResult(keyResult, valueResult, final, key, input, inst, ctx) {
|
|
|
3763
3763
|
final.issues.push({
|
|
3764
3764
|
code: "invalid_key",
|
|
3765
3765
|
origin: "map",
|
|
3766
|
-
input,
|
|
3766
|
+
input: input2,
|
|
3767
3767
|
inst,
|
|
3768
3768
|
issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config()))
|
|
3769
3769
|
});
|
|
@@ -3776,7 +3776,7 @@ function handleMapResult(keyResult, valueResult, final, key, input, inst, ctx) {
|
|
|
3776
3776
|
final.issues.push({
|
|
3777
3777
|
origin: "map",
|
|
3778
3778
|
code: "invalid_element",
|
|
3779
|
-
input,
|
|
3779
|
+
input: input2,
|
|
3780
3780
|
inst,
|
|
3781
3781
|
key,
|
|
3782
3782
|
issues: valueResult.issues.map((iss) => finalizeIssue(iss, ctx, config()))
|
|
@@ -3788,10 +3788,10 @@ function handleMapResult(keyResult, valueResult, final, key, input, inst, ctx) {
|
|
|
3788
3788
|
var $ZodSet = /* @__PURE__ */ $constructor("$ZodSet", (inst, def) => {
|
|
3789
3789
|
$ZodType.init(inst, def);
|
|
3790
3790
|
inst._zod.parse = (payload, ctx) => {
|
|
3791
|
-
const
|
|
3792
|
-
if (!(
|
|
3791
|
+
const input2 = payload.value;
|
|
3792
|
+
if (!(input2 instanceof Set)) {
|
|
3793
3793
|
payload.issues.push({
|
|
3794
|
-
input,
|
|
3794
|
+
input: input2,
|
|
3795
3795
|
inst,
|
|
3796
3796
|
expected: "set",
|
|
3797
3797
|
code: "invalid_type"
|
|
@@ -3800,7 +3800,7 @@ var $ZodSet = /* @__PURE__ */ $constructor("$ZodSet", (inst, def) => {
|
|
|
3800
3800
|
}
|
|
3801
3801
|
const proms = [];
|
|
3802
3802
|
payload.value = /* @__PURE__ */ new Set();
|
|
3803
|
-
for (const item of
|
|
3803
|
+
for (const item of input2) {
|
|
3804
3804
|
const result = def.valueType._zod.run({ value: item, issues: [] }, ctx);
|
|
3805
3805
|
if (result instanceof Promise) {
|
|
3806
3806
|
proms.push(result.then((result2) => handleSetResult(result2, payload)));
|
|
@@ -3825,14 +3825,14 @@ var $ZodEnum = /* @__PURE__ */ $constructor("$ZodEnum", (inst, def) => {
|
|
|
3825
3825
|
inst._zod.values = valuesSet;
|
|
3826
3826
|
inst._zod.pattern = new RegExp(`^(${values.filter((k) => propertyKeyTypes.has(typeof k)).map((o) => typeof o === "string" ? escapeRegex(o) : o.toString()).join("|")})$`);
|
|
3827
3827
|
inst._zod.parse = (payload, _ctx) => {
|
|
3828
|
-
const
|
|
3829
|
-
if (valuesSet.has(
|
|
3828
|
+
const input2 = payload.value;
|
|
3829
|
+
if (valuesSet.has(input2)) {
|
|
3830
3830
|
return payload;
|
|
3831
3831
|
}
|
|
3832
3832
|
payload.issues.push({
|
|
3833
3833
|
code: "invalid_value",
|
|
3834
3834
|
values,
|
|
3835
|
-
input,
|
|
3835
|
+
input: input2,
|
|
3836
3836
|
inst
|
|
3837
3837
|
});
|
|
3838
3838
|
return payload;
|
|
@@ -3847,14 +3847,14 @@ var $ZodLiteral = /* @__PURE__ */ $constructor("$ZodLiteral", (inst, def) => {
|
|
|
3847
3847
|
inst._zod.values = values;
|
|
3848
3848
|
inst._zod.pattern = new RegExp(`^(${def.values.map((o) => typeof o === "string" ? escapeRegex(o) : o ? escapeRegex(o.toString()) : String(o)).join("|")})$`);
|
|
3849
3849
|
inst._zod.parse = (payload, _ctx) => {
|
|
3850
|
-
const
|
|
3851
|
-
if (values.has(
|
|
3850
|
+
const input2 = payload.value;
|
|
3851
|
+
if (values.has(input2)) {
|
|
3852
3852
|
return payload;
|
|
3853
3853
|
}
|
|
3854
3854
|
payload.issues.push({
|
|
3855
3855
|
code: "invalid_value",
|
|
3856
3856
|
values: def.values,
|
|
3857
|
-
input,
|
|
3857
|
+
input: input2,
|
|
3858
3858
|
inst
|
|
3859
3859
|
});
|
|
3860
3860
|
return payload;
|
|
@@ -3863,13 +3863,13 @@ var $ZodLiteral = /* @__PURE__ */ $constructor("$ZodLiteral", (inst, def) => {
|
|
|
3863
3863
|
var $ZodFile = /* @__PURE__ */ $constructor("$ZodFile", (inst, def) => {
|
|
3864
3864
|
$ZodType.init(inst, def);
|
|
3865
3865
|
inst._zod.parse = (payload, _ctx) => {
|
|
3866
|
-
const
|
|
3867
|
-
if (
|
|
3866
|
+
const input2 = payload.value;
|
|
3867
|
+
if (input2 instanceof File)
|
|
3868
3868
|
return payload;
|
|
3869
3869
|
payload.issues.push({
|
|
3870
3870
|
expected: "file",
|
|
3871
3871
|
code: "invalid_type",
|
|
3872
|
-
input,
|
|
3872
|
+
input: input2,
|
|
3873
3873
|
inst
|
|
3874
3874
|
});
|
|
3875
3875
|
return payload;
|
|
@@ -3899,8 +3899,8 @@ var $ZodTransform = /* @__PURE__ */ $constructor("$ZodTransform", (inst, def) =>
|
|
|
3899
3899
|
return payload;
|
|
3900
3900
|
};
|
|
3901
3901
|
});
|
|
3902
|
-
function handleOptionalResult(result,
|
|
3903
|
-
if (
|
|
3902
|
+
function handleOptionalResult(result, input2) {
|
|
3903
|
+
if (input2 === void 0 && (result.issues.length || result.fallback)) {
|
|
3904
3904
|
return { issues: [], value: void 0 };
|
|
3905
3905
|
}
|
|
3906
3906
|
return result;
|
|
@@ -3918,11 +3918,11 @@ var $ZodOptional = /* @__PURE__ */ $constructor("$ZodOptional", (inst, def) => {
|
|
|
3918
3918
|
});
|
|
3919
3919
|
inst._zod.parse = (payload, ctx) => {
|
|
3920
3920
|
if (def.innerType._zod.optin === "optional") {
|
|
3921
|
-
const
|
|
3921
|
+
const input2 = payload.value;
|
|
3922
3922
|
const result = def.innerType._zod.run(payload, ctx);
|
|
3923
3923
|
if (result instanceof Promise)
|
|
3924
|
-
return result.then((r) => handleOptionalResult(r,
|
|
3925
|
-
return handleOptionalResult(result,
|
|
3924
|
+
return result.then((r) => handleOptionalResult(r, input2));
|
|
3925
|
+
return handleOptionalResult(result, input2);
|
|
3926
3926
|
}
|
|
3927
3927
|
if (payload.value === void 0) {
|
|
3928
3928
|
return payload;
|
|
@@ -4347,20 +4347,20 @@ var $ZodCustom = /* @__PURE__ */ $constructor("$ZodCustom", (inst, def) => {
|
|
|
4347
4347
|
return payload;
|
|
4348
4348
|
};
|
|
4349
4349
|
inst._zod.check = (payload) => {
|
|
4350
|
-
const
|
|
4351
|
-
const r = def.fn(
|
|
4350
|
+
const input2 = payload.value;
|
|
4351
|
+
const r = def.fn(input2);
|
|
4352
4352
|
if (r instanceof Promise) {
|
|
4353
|
-
return r.then((r2) => handleRefineResult(r2, payload,
|
|
4353
|
+
return r.then((r2) => handleRefineResult(r2, payload, input2, inst));
|
|
4354
4354
|
}
|
|
4355
|
-
handleRefineResult(r, payload,
|
|
4355
|
+
handleRefineResult(r, payload, input2, inst);
|
|
4356
4356
|
return;
|
|
4357
4357
|
};
|
|
4358
4358
|
});
|
|
4359
|
-
function handleRefineResult(result, payload,
|
|
4359
|
+
function handleRefineResult(result, payload, input2, inst) {
|
|
4360
4360
|
if (!result) {
|
|
4361
4361
|
const _iss = {
|
|
4362
4362
|
code: "custom",
|
|
4363
|
-
input,
|
|
4363
|
+
input: input2,
|
|
4364
4364
|
inst,
|
|
4365
4365
|
// incorporates params.error into issue reporting
|
|
4366
4366
|
path: [...inst._zod.def.path ?? []],
|
|
@@ -7647,8 +7647,8 @@ function ko_default() {
|
|
|
7647
7647
|
}
|
|
7648
7648
|
|
|
7649
7649
|
// ../../../node_modules/zod/v4/locales/lt.js
|
|
7650
|
-
var capitalizeFirstCharacter = (
|
|
7651
|
-
return
|
|
7650
|
+
var capitalizeFirstCharacter = (text2) => {
|
|
7651
|
+
return text2.charAt(0).toUpperCase() + text2.slice(1);
|
|
7652
7652
|
};
|
|
7653
7653
|
function getUnitTypeFromNumber(number4) {
|
|
7654
7654
|
const abs = Math.abs(number4);
|
|
@@ -11048,23 +11048,23 @@ function _overwrite(tx) {
|
|
|
11048
11048
|
}
|
|
11049
11049
|
// @__NO_SIDE_EFFECTS__
|
|
11050
11050
|
function _normalize(form) {
|
|
11051
|
-
return /* @__PURE__ */ _overwrite((
|
|
11051
|
+
return /* @__PURE__ */ _overwrite((input2) => input2.normalize(form));
|
|
11052
11052
|
}
|
|
11053
11053
|
// @__NO_SIDE_EFFECTS__
|
|
11054
11054
|
function _trim() {
|
|
11055
|
-
return /* @__PURE__ */ _overwrite((
|
|
11055
|
+
return /* @__PURE__ */ _overwrite((input2) => input2.trim());
|
|
11056
11056
|
}
|
|
11057
11057
|
// @__NO_SIDE_EFFECTS__
|
|
11058
11058
|
function _toLowerCase() {
|
|
11059
|
-
return /* @__PURE__ */ _overwrite((
|
|
11059
|
+
return /* @__PURE__ */ _overwrite((input2) => input2.toLowerCase());
|
|
11060
11060
|
}
|
|
11061
11061
|
// @__NO_SIDE_EFFECTS__
|
|
11062
11062
|
function _toUpperCase() {
|
|
11063
|
-
return /* @__PURE__ */ _overwrite((
|
|
11063
|
+
return /* @__PURE__ */ _overwrite((input2) => input2.toUpperCase());
|
|
11064
11064
|
}
|
|
11065
11065
|
// @__NO_SIDE_EFFECTS__
|
|
11066
11066
|
function _slugify() {
|
|
11067
|
-
return /* @__PURE__ */ _overwrite((
|
|
11067
|
+
return /* @__PURE__ */ _overwrite((input2) => slugify(input2));
|
|
11068
11068
|
}
|
|
11069
11069
|
// @__NO_SIDE_EFFECTS__
|
|
11070
11070
|
function _array(Class2, element, params) {
|
|
@@ -11369,8 +11369,8 @@ function _stringbool(Classes, _params) {
|
|
|
11369
11369
|
type: "pipe",
|
|
11370
11370
|
in: stringSchema,
|
|
11371
11371
|
out: booleanSchema,
|
|
11372
|
-
transform: ((
|
|
11373
|
-
let data =
|
|
11372
|
+
transform: ((input2, payload) => {
|
|
11373
|
+
let data = input2;
|
|
11374
11374
|
if (params.case !== "sensitive")
|
|
11375
11375
|
data = data.toLowerCase();
|
|
11376
11376
|
if (truthySet.has(data)) {
|
|
@@ -11389,8 +11389,8 @@ function _stringbool(Classes, _params) {
|
|
|
11389
11389
|
return {};
|
|
11390
11390
|
}
|
|
11391
11391
|
}),
|
|
11392
|
-
reverseTransform: ((
|
|
11393
|
-
if (
|
|
11392
|
+
reverseTransform: ((input2, _payload) => {
|
|
11393
|
+
if (input2 === true) {
|
|
11394
11394
|
return truthyArray[0] || "true";
|
|
11395
11395
|
} else {
|
|
11396
11396
|
return falsyArray[0] || "false";
|
|
@@ -11500,26 +11500,26 @@ function extractDefs(ctx, schema) {
|
|
|
11500
11500
|
throw new Error("Unprocessed schema. This is a bug in Zod.");
|
|
11501
11501
|
const idToSchema = /* @__PURE__ */ new Map();
|
|
11502
11502
|
for (const entry of ctx.seen.entries()) {
|
|
11503
|
-
const
|
|
11504
|
-
if (
|
|
11505
|
-
const existing = idToSchema.get(
|
|
11503
|
+
const id2 = ctx.metadataRegistry.get(entry[0])?.id;
|
|
11504
|
+
if (id2) {
|
|
11505
|
+
const existing = idToSchema.get(id2);
|
|
11506
11506
|
if (existing && existing !== entry[0]) {
|
|
11507
|
-
throw new Error(`Duplicate schema id "${
|
|
11507
|
+
throw new Error(`Duplicate schema id "${id2}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);
|
|
11508
11508
|
}
|
|
11509
|
-
idToSchema.set(
|
|
11509
|
+
idToSchema.set(id2, entry[0]);
|
|
11510
11510
|
}
|
|
11511
11511
|
}
|
|
11512
11512
|
const makeURI = (entry) => {
|
|
11513
11513
|
const defsSegment = ctx.target === "draft-2020-12" ? "$defs" : "definitions";
|
|
11514
11514
|
if (ctx.external) {
|
|
11515
11515
|
const externalId = ctx.external.registry.get(entry[0])?.id;
|
|
11516
|
-
const uriGenerator = ctx.external.uri ?? ((
|
|
11516
|
+
const uriGenerator = ctx.external.uri ?? ((id3) => id3);
|
|
11517
11517
|
if (externalId) {
|
|
11518
11518
|
return { ref: uriGenerator(externalId) };
|
|
11519
11519
|
}
|
|
11520
|
-
const
|
|
11521
|
-
entry[1].defId =
|
|
11522
|
-
return { defId:
|
|
11520
|
+
const id2 = entry[1].defId ?? entry[1].schema.id ?? `schema${ctx.counter++}`;
|
|
11521
|
+
entry[1].defId = id2;
|
|
11522
|
+
return { defId: id2, ref: `${uriGenerator("__shared")}#/${defsSegment}/${id2}` };
|
|
11523
11523
|
}
|
|
11524
11524
|
if (entry[1] === root) {
|
|
11525
11525
|
return { ref: "#" };
|
|
@@ -11567,8 +11567,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
11567
11567
|
continue;
|
|
11568
11568
|
}
|
|
11569
11569
|
}
|
|
11570
|
-
const
|
|
11571
|
-
if (
|
|
11570
|
+
const id2 = ctx.metadataRegistry.get(entry[0])?.id;
|
|
11571
|
+
if (id2) {
|
|
11572
11572
|
extractToDef(entry);
|
|
11573
11573
|
continue;
|
|
11574
11574
|
}
|
|
@@ -11664,10 +11664,10 @@ function finalize(ctx, schema) {
|
|
|
11664
11664
|
} else {
|
|
11665
11665
|
}
|
|
11666
11666
|
if (ctx.external?.uri) {
|
|
11667
|
-
const
|
|
11668
|
-
if (!
|
|
11667
|
+
const id2 = ctx.external.registry.get(schema)?.id;
|
|
11668
|
+
if (!id2)
|
|
11669
11669
|
throw new Error("Schema is missing an `id` property");
|
|
11670
|
-
result.$id = ctx.external.uri(
|
|
11670
|
+
result.$id = ctx.external.uri(id2);
|
|
11671
11671
|
}
|
|
11672
11672
|
Object.assign(result, root.def ?? root.schema);
|
|
11673
11673
|
const rootMetaId = ctx.metadataRegistry.get(schema)?.id;
|
|
@@ -11827,9 +11827,9 @@ var numberProcessor = (schema, ctx, _json, _params) => {
|
|
|
11827
11827
|
json2.type = "number";
|
|
11828
11828
|
const exMin = typeof exclusiveMinimum === "number" && exclusiveMinimum >= (minimum ?? Number.NEGATIVE_INFINITY);
|
|
11829
11829
|
const exMax = typeof exclusiveMaximum === "number" && exclusiveMaximum <= (maximum ?? Number.POSITIVE_INFINITY);
|
|
11830
|
-
const
|
|
11830
|
+
const legacy2 = ctx.target === "draft-04" || ctx.target === "openapi-3.0";
|
|
11831
11831
|
if (exMin) {
|
|
11832
|
-
if (
|
|
11832
|
+
if (legacy2) {
|
|
11833
11833
|
json2.minimum = exclusiveMinimum;
|
|
11834
11834
|
json2.exclusiveMinimum = true;
|
|
11835
11835
|
} else {
|
|
@@ -11839,7 +11839,7 @@ var numberProcessor = (schema, ctx, _json, _params) => {
|
|
|
11839
11839
|
json2.minimum = minimum;
|
|
11840
11840
|
}
|
|
11841
11841
|
if (exMax) {
|
|
11842
|
-
if (
|
|
11842
|
+
if (legacy2) {
|
|
11843
11843
|
json2.maximum = exclusiveMaximum;
|
|
11844
11844
|
json2.exclusiveMaximum = true;
|
|
11845
11845
|
} else {
|
|
@@ -12286,9 +12286,9 @@ var allProcessors = {
|
|
|
12286
12286
|
optional: optionalProcessor,
|
|
12287
12287
|
lazy: lazyProcessor
|
|
12288
12288
|
};
|
|
12289
|
-
function toJSONSchema(
|
|
12290
|
-
if ("_idmap" in
|
|
12291
|
-
const registry2 =
|
|
12289
|
+
function toJSONSchema(input2, params) {
|
|
12290
|
+
if ("_idmap" in input2) {
|
|
12291
|
+
const registry2 = input2;
|
|
12292
12292
|
const ctx2 = initializeContext({ ...params, processors: allProcessors });
|
|
12293
12293
|
const defs = {};
|
|
12294
12294
|
for (const entry of registry2._idmap.entries()) {
|
|
@@ -12316,9 +12316,9 @@ function toJSONSchema(input, params) {
|
|
|
12316
12316
|
return { schemas };
|
|
12317
12317
|
}
|
|
12318
12318
|
const ctx = initializeContext({ ...params, processors: allProcessors });
|
|
12319
|
-
process2(
|
|
12320
|
-
extractDefs(ctx,
|
|
12321
|
-
return finalize(ctx,
|
|
12319
|
+
process2(input2, ctx);
|
|
12320
|
+
extractDefs(ctx, input2);
|
|
12321
|
+
return finalize(ctx, input2);
|
|
12322
12322
|
}
|
|
12323
12323
|
|
|
12324
12324
|
// ../../../node_modules/zod/v4/core/json-schema-generator.js
|
|
@@ -12701,7 +12701,7 @@ var safeDecodeAsync2 = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
|
|
|
12701
12701
|
|
|
12702
12702
|
// ../../../node_modules/zod/v4/classic/schemas.js
|
|
12703
12703
|
var _installedGroups = /* @__PURE__ */ new WeakMap();
|
|
12704
|
-
function _installLazyMethods(inst, group,
|
|
12704
|
+
function _installLazyMethods(inst, group, methods3) {
|
|
12705
12705
|
const proto = Object.getPrototypeOf(inst);
|
|
12706
12706
|
let installed = _installedGroups.get(proto);
|
|
12707
12707
|
if (!installed) {
|
|
@@ -12711,8 +12711,8 @@ function _installLazyMethods(inst, group, methods2) {
|
|
|
12711
12711
|
if (installed.has(group))
|
|
12712
12712
|
return;
|
|
12713
12713
|
installed.add(group);
|
|
12714
|
-
for (const key in
|
|
12715
|
-
const fn =
|
|
12714
|
+
for (const key in methods3) {
|
|
12715
|
+
const fn = methods3[key];
|
|
12716
12716
|
Object.defineProperty(proto, key, {
|
|
12717
12717
|
configurable: true,
|
|
12718
12718
|
enumerable: false,
|
|
@@ -14523,87 +14523,6 @@ function date4(params) {
|
|
|
14523
14523
|
// ../../../node_modules/zod/v4/classic/external.js
|
|
14524
14524
|
config(en_default());
|
|
14525
14525
|
|
|
14526
|
-
// ../../shared-contracts/dist/ids.js
|
|
14527
|
-
var opaqueIdSchema = external_exports.string().refine((value) => value.trim().length > 0, {
|
|
14528
|
-
message: "Identifier must not be empty or whitespace"
|
|
14529
|
-
});
|
|
14530
|
-
var harnessIdSchema = opaqueIdSchema.brand();
|
|
14531
|
-
var hostThreadIdSchema = opaqueIdSchema.brand();
|
|
14532
|
-
var hostTurnIdSchema = opaqueIdSchema.brand();
|
|
14533
|
-
var hostItemIdSchema = opaqueIdSchema.brand();
|
|
14534
|
-
var hostInteractionIdSchema = opaqueIdSchema.brand();
|
|
14535
|
-
|
|
14536
|
-
// ../../shared-contracts/dist/harness-plugins.js
|
|
14537
|
-
var HARNESS_PLUGIN_MANIFEST_MAX_BYTES = 32 * 1024;
|
|
14538
|
-
var HARNESS_PLUGIN_ICON_MAX_BYTES = 128 * 1024;
|
|
14539
|
-
var HARNESS_PLUGIN_LIMIT = 128;
|
|
14540
|
-
var installedPluginIdSchema = external_exports.string().min(1).max(128).regex(/^[a-z][a-z0-9]*(?:[._-][a-z0-9]+)*$/u);
|
|
14541
|
-
var installedHarnessPluginIdSchema = installedPluginIdSchema.pipe(harnessIdSchema);
|
|
14542
|
-
var harnessPluginIdSchema = installedHarnessPluginIdSchema.refine((id) => id !== "codex", "The official Codex identity is reserved");
|
|
14543
|
-
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");
|
|
14544
|
-
var documentationUrlSchema = external_exports.url().refine((value) => /^https:\/\/[^/?#@]+(?:[/?#]|$)/iu.test(value), "Plugin documentation links must be credential-free HTTPS URLs");
|
|
14545
|
-
var localizedTextSchema = external_exports.object({ en: external_exports.string().max(4096), "zh-CN": external_exports.string().max(4096).optional() }).strict();
|
|
14546
|
-
var harnessInstallationGuideSchema = external_exports.object({
|
|
14547
|
-
commands: external_exports.array(external_exports.object({ terminal: external_exports.string().max(256), command: external_exports.string().max(4096) }).strict()).max(8),
|
|
14548
|
-
before: localizedTextSchema.optional(),
|
|
14549
|
-
after: localizedTextSchema.optional(),
|
|
14550
|
-
downloads: external_exports.array(external_exports.object({ label: external_exports.string().max(128), url: documentationUrlSchema }).strict()).max(8).optional()
|
|
14551
|
-
}).strict();
|
|
14552
|
-
var pluginPresentationShape = {
|
|
14553
|
-
id: installedHarnessPluginIdSchema,
|
|
14554
|
-
name: external_exports.string().trim().min(1).max(128),
|
|
14555
|
-
version: external_exports.string().min(1).max(128),
|
|
14556
|
-
/** Capability-only plugin; omitted for existing session-capable plugins. */
|
|
14557
|
-
kind: external_exports.literal("usage").optional(),
|
|
14558
|
-
/** Original image styling or bounded vector paths; never arbitrary CSS/SVG markup. */
|
|
14559
|
-
iconStyle: external_exports.object({
|
|
14560
|
-
vector: external_exports.object({
|
|
14561
|
-
viewBox: external_exports.string().max(128).regex(/^-?\d+(?:\.\d+)?(?: +-?\d+(?:\.\d+)?){3}$/u),
|
|
14562
|
-
color: external_exports.string().regex(/^(?:currentColor|#[a-f0-9]{6})$/iu),
|
|
14563
|
-
paths: external_exports.array(external_exports.object({
|
|
14564
|
-
d: external_exports.string().min(1).max(32768).regex(/^[MmLlHhVvCcSsQqTtAaZz\d.,+eE\s-]+$/u),
|
|
14565
|
-
fillRule: external_exports.enum(["evenodd", "nonzero"]).optional(),
|
|
14566
|
-
fill: external_exports.string().regex(/^(?:currentColor|#[a-f0-9]{6})$/iu).optional()
|
|
14567
|
-
}).strict()).min(1).max(32)
|
|
14568
|
-
}).strict().optional(),
|
|
14569
|
-
background: external_exports.string().regex(/^#[a-f0-9]{6}$/iu).optional(),
|
|
14570
|
-
borderRadius: external_exports.number().min(0).max(50).optional(),
|
|
14571
|
-
paddingRatio: external_exports.number().min(0).max(0.25).optional()
|
|
14572
|
-
}).strict().optional(),
|
|
14573
|
-
installation: harnessInstallationGuideSchema.optional(),
|
|
14574
|
-
notice: localizedTextSchema.optional(),
|
|
14575
|
-
/** The factory accepts a persisted local entrypoint through its construction context. */
|
|
14576
|
-
launchCommand: external_exports.literal(true).optional(),
|
|
14577
|
-
links: external_exports.object({
|
|
14578
|
-
website: documentationUrlSchema.optional(),
|
|
14579
|
-
documentation: documentationUrlSchema.optional(),
|
|
14580
|
-
installation: documentationUrlSchema.optional()
|
|
14581
|
-
}).strict().optional()
|
|
14582
|
-
};
|
|
14583
|
-
var harnessPluginManifestSchema = external_exports.object({
|
|
14584
|
-
manifestVersion: external_exports.literal(1),
|
|
14585
|
-
...pluginPresentationShape,
|
|
14586
|
-
adapterApiVersion: external_exports.number().int().positive(),
|
|
14587
|
-
entry: pluginRelativeResourceSchema,
|
|
14588
|
-
icon: pluginRelativeResourceSchema.optional()
|
|
14589
|
-
}).strict();
|
|
14590
|
-
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);
|
|
14591
|
-
var harnessPluginDescriptorSchema = external_exports.object({
|
|
14592
|
-
...pluginPresentationShape,
|
|
14593
|
-
icon: harnessPluginIconSchema.optional()
|
|
14594
|
-
}).strict();
|
|
14595
|
-
var harnessPluginListParamsSchema = external_exports.object({}).strict();
|
|
14596
|
-
var harnessPluginListResultSchema = external_exports.object({
|
|
14597
|
-
plugins: external_exports.array(harnessPluginDescriptorSchema.extend({ id: harnessPluginIdSchema })).max(HARNESS_PLUGIN_LIMIT)
|
|
14598
|
-
}).strict();
|
|
14599
|
-
var harnessPluginConfigurationSchema = external_exports.object({
|
|
14600
|
-
version: external_exports.literal(1),
|
|
14601
|
-
enabled: external_exports.array(installedHarnessPluginIdSchema).max(HARNESS_PLUGIN_LIMIT)
|
|
14602
|
-
}).strict().refine((value) => new Set(value.enabled).size === value.enabled.length, {
|
|
14603
|
-
message: "Enabled plugin IDs must be unique",
|
|
14604
|
-
path: ["enabled"]
|
|
14605
|
-
});
|
|
14606
|
-
|
|
14607
14526
|
// ../../shared-contracts/dist/json-value.js
|
|
14608
14527
|
function rejectExplicitUndefined(keys) {
|
|
14609
14528
|
return (value, context) => {
|
|
@@ -14663,403 +14582,73 @@ var jsonValueSchema = nonCircularSchema.pipe(recursiveJsonValueSchema);
|
|
|
14663
14582
|
var jsonArraySchema = nonCircularSchema.pipe(external_exports.array(recursiveJsonValueSchema));
|
|
14664
14583
|
var jsonObjectSchema = nonCircularSchema.pipe(external_exports.record(external_exports.string(), recursiveJsonValueSchema));
|
|
14665
14584
|
|
|
14666
|
-
// ../../shared-contracts/dist/
|
|
14667
|
-
var
|
|
14668
|
-
|
|
14669
|
-
|
|
14670
|
-
|
|
14671
|
-
|
|
14672
|
-
|
|
14673
|
-
|
|
14674
|
-
|
|
14675
|
-
|
|
14676
|
-
|
|
14677
|
-
|
|
14678
|
-
var
|
|
14679
|
-
var
|
|
14680
|
-
var
|
|
14681
|
-
|
|
14682
|
-
|
|
14683
|
-
|
|
14684
|
-
|
|
14685
|
-
|
|
14686
|
-
|
|
14687
|
-
var
|
|
14688
|
-
"
|
|
14689
|
-
|
|
14690
|
-
|
|
14691
|
-
|
|
14692
|
-
|
|
14693
|
-
|
|
14694
|
-
|
|
14695
|
-
|
|
14696
|
-
|
|
14697
|
-
|
|
14698
|
-
|
|
14699
|
-
|
|
14700
|
-
|
|
14701
|
-
|
|
14702
|
-
|
|
14703
|
-
|
|
14704
|
-
|
|
14705
|
-
|
|
14706
|
-
|
|
14585
|
+
// ../../shared-contracts/dist/errors.js
|
|
14586
|
+
var codexhostErrorSchema = external_exports.strictObject({
|
|
14587
|
+
code: external_exports.string().min(1),
|
|
14588
|
+
message: external_exports.string().min(1),
|
|
14589
|
+
retryable: external_exports.boolean(),
|
|
14590
|
+
diagnostic: external_exports.string().min(1).optional(),
|
|
14591
|
+
stage: external_exports.string().min(1).optional(),
|
|
14592
|
+
durationMs: external_exports.number().int().nonnegative().optional(),
|
|
14593
|
+
stderrTail: external_exports.string().min(1).optional()
|
|
14594
|
+
}).superRefine(rejectExplicitUndefined(["diagnostic", "stage", "durationMs", "stderrTail"]));
|
|
14595
|
+
|
|
14596
|
+
// ../../shared-contracts/dist/harness-presentation.js
|
|
14597
|
+
var localeSchema = external_exports.string().max(64).regex(/^[a-z]{2,3}(?:-[A-Za-z0-9]{2,8})*$/u);
|
|
14598
|
+
var displayText = (maximum) => external_exports.string().min(1).max(maximum).refine((text2) => text2.trim().length > 0);
|
|
14599
|
+
var harnessLocalizationsSchema = external_exports.record(localeSchema, external_exports.object({
|
|
14600
|
+
label: displayText(256).optional(),
|
|
14601
|
+
description: displayText(1024).optional()
|
|
14602
|
+
}).strict()).refine((entries) => Object.keys(entries).length <= 16, "Too many locales");
|
|
14603
|
+
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");
|
|
14604
|
+
|
|
14605
|
+
// ../../shared-contracts/dist/ids.js
|
|
14606
|
+
var opaqueIdSchema = external_exports.string().refine((value) => value.trim().length > 0, {
|
|
14607
|
+
message: "Identifier must not be empty or whitespace"
|
|
14608
|
+
});
|
|
14609
|
+
var harnessIdSchema = opaqueIdSchema.brand();
|
|
14610
|
+
var hostThreadIdSchema = opaqueIdSchema.brand();
|
|
14611
|
+
var hostTurnIdSchema = opaqueIdSchema.brand();
|
|
14612
|
+
var hostItemIdSchema = opaqueIdSchema.brand();
|
|
14613
|
+
var hostInteractionIdSchema = opaqueIdSchema.brand();
|
|
14614
|
+
|
|
14615
|
+
// ../../shared-contracts/dist/harness-permission-modes.js
|
|
14616
|
+
var HARNESS_PERMISSION_MODE_ID_MAX_LENGTH = 128;
|
|
14617
|
+
var HARNESS_PERMISSION_MODE_LABEL_MAX_LENGTH = 256;
|
|
14618
|
+
var HARNESS_PERMISSION_MODE_DESCRIPTION_MAX_LENGTH = 1024;
|
|
14619
|
+
var HARNESS_PERMISSION_MODE_CATALOG_MAX_LENGTH = 32;
|
|
14620
|
+
var nonBlankTextSchema = external_exports.string().refine((value) => value.trim().length > 0, {
|
|
14621
|
+
message: "Value must not be empty or whitespace"
|
|
14622
|
+
});
|
|
14623
|
+
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();
|
|
14624
|
+
var harnessPermissionModeSchema = external_exports.object({
|
|
14625
|
+
id: harnessPermissionModeIdSchema,
|
|
14626
|
+
label: nonBlankTextSchema.max(HARNESS_PERMISSION_MODE_LABEL_MAX_LENGTH),
|
|
14627
|
+
description: nonBlankTextSchema.max(HARNESS_PERMISSION_MODE_DESCRIPTION_MAX_LENGTH).optional(),
|
|
14628
|
+
dangerous: external_exports.boolean().optional(),
|
|
14629
|
+
localizations: harnessLocalizationsSchema.optional()
|
|
14630
|
+
}).strict();
|
|
14631
|
+
var harnessPermissionModeCatalogSchema = external_exports.object({
|
|
14632
|
+
modes: external_exports.array(harnessPermissionModeSchema).min(1).max(HARNESS_PERMISSION_MODE_CATALOG_MAX_LENGTH),
|
|
14633
|
+
defaultModeId: harnessPermissionModeIdSchema
|
|
14634
|
+
}).strict().superRefine((catalog, context) => {
|
|
14635
|
+
const ids = /* @__PURE__ */ new Set();
|
|
14636
|
+
for (const [index, mode] of catalog.modes.entries()) {
|
|
14637
|
+
if (ids.has(mode.id)) {
|
|
14638
|
+
context.addIssue({
|
|
14639
|
+
code: "custom",
|
|
14640
|
+
message: "Permission Mode IDs must be unique",
|
|
14641
|
+
path: ["modes", index, "id"]
|
|
14642
|
+
});
|
|
14643
|
+
}
|
|
14644
|
+
ids.add(mode.id);
|
|
14707
14645
|
}
|
|
14708
|
-
|
|
14709
|
-
|
|
14710
|
-
|
|
14711
|
-
|
|
14712
|
-
|
|
14713
|
-
|
|
14714
|
-
return "image/svg+xml";
|
|
14715
|
-
case "woff2":
|
|
14716
|
-
return "font/woff2";
|
|
14717
|
-
case "json":
|
|
14718
|
-
return "application/json";
|
|
14719
|
-
case "css":
|
|
14720
|
-
return "text/css";
|
|
14721
|
-
default:
|
|
14722
|
-
return desktopExtensionScreenshotMimeType(resource);
|
|
14723
|
-
}
|
|
14724
|
-
}
|
|
14725
|
-
var hasPortableSegments = (resource) => resource.split("/").every((segment) => !/[. ]$/u.test(segment));
|
|
14726
|
-
var desktopExtensionAssetPathSchema = pluginRelativeResourceSchema.refine((resource) => hasPortableSegments(resource) && desktopExtensionAssetMimeType(resource) !== void 0, "Expected a relative Desktop extension asset path with a supported suffix");
|
|
14727
|
-
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");
|
|
14728
|
-
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) => {
|
|
14729
|
-
const { username, password } = new URL(value);
|
|
14730
|
-
return !username && !password && !/[\\\s]/u.test(value);
|
|
14731
|
-
}, "URL must not contain credentials, backslashes, or whitespace");
|
|
14732
|
-
function localizedText(text) {
|
|
14733
|
-
return external_exports.strictObject({ en: text, "zh-CN": text });
|
|
14734
|
-
}
|
|
14735
|
-
var desktopExtensionLocalizedTextSchema = localizedText(external_exports.string().trim().min(1));
|
|
14736
|
-
var categoriesSchema = external_exports.array(desktopExtensionCategorySchema).max(desktopExtensionCategorySchema.options.length).refine((categories) => new Set(categories).size === categories.length, "Duplicate categories");
|
|
14737
|
-
var slotsSchema = external_exports.array(desktopExtensionSlotSchema).max(desktopExtensionSlotSchema.options.length).refine((slots) => new Set(slots).size === slots.length, "Duplicate slots");
|
|
14738
|
-
var settingField = {
|
|
14739
|
-
key: external_exports.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/u),
|
|
14740
|
-
label: desktopExtensionLocalizedTextSchema,
|
|
14741
|
-
description: desktopExtensionLocalizedTextSchema.optional()
|
|
14742
|
-
};
|
|
14743
|
-
var numericSetting = {
|
|
14744
|
-
...settingField,
|
|
14745
|
-
step: external_exports.number().positive().optional(),
|
|
14746
|
-
default: external_exports.number().optional()
|
|
14747
|
-
};
|
|
14748
|
-
var settingOption = external_exports.strictObject({
|
|
14749
|
-
value: external_exports.string(),
|
|
14750
|
-
label: desktopExtensionLocalizedTextSchema
|
|
14751
|
-
});
|
|
14752
|
-
var desktopExtensionSettingFieldSchema = external_exports.discriminatedUnion("type", [
|
|
14753
|
-
external_exports.strictObject({
|
|
14754
|
-
...settingField,
|
|
14755
|
-
type: external_exports.literal("boolean"),
|
|
14756
|
-
default: external_exports.boolean().optional()
|
|
14757
|
-
}),
|
|
14758
|
-
external_exports.strictObject({
|
|
14759
|
-
...settingField,
|
|
14760
|
-
type: external_exports.literal("string"),
|
|
14761
|
-
placeholder: desktopExtensionLocalizedTextSchema.optional(),
|
|
14762
|
-
default: external_exports.string().optional()
|
|
14763
|
-
}),
|
|
14764
|
-
external_exports.strictObject({
|
|
14765
|
-
...numericSetting,
|
|
14766
|
-
type: external_exports.literal("number"),
|
|
14767
|
-
min: external_exports.number().optional(),
|
|
14768
|
-
max: external_exports.number().optional()
|
|
14769
|
-
}),
|
|
14770
|
-
external_exports.strictObject({
|
|
14771
|
-
...numericSetting,
|
|
14772
|
-
type: external_exports.literal("range"),
|
|
14773
|
-
min: external_exports.number(),
|
|
14774
|
-
max: external_exports.number()
|
|
14775
|
-
}),
|
|
14776
|
-
external_exports.strictObject({
|
|
14777
|
-
...settingField,
|
|
14778
|
-
type: external_exports.literal("select"),
|
|
14779
|
-
options: external_exports.array(settingOption).min(1),
|
|
14780
|
-
default: external_exports.string().optional()
|
|
14781
|
-
})
|
|
14782
|
-
]).superRefine((field2, ctx) => {
|
|
14783
|
-
const issue2 = (path6, message) => ctx.addIssue({ code: "custom", path: [path6], message });
|
|
14784
|
-
if (field2.type === "number" || field2.type === "range") {
|
|
14785
|
-
const { min = -Infinity, max = Infinity, default: value } = field2;
|
|
14786
|
-
if (min > max)
|
|
14787
|
-
issue2("max", "Must be at least min");
|
|
14788
|
-
if (value !== void 0 && (value < min || value > max))
|
|
14789
|
-
issue2("default", "Must be within min and max");
|
|
14790
|
-
} else if (field2.type === "select") {
|
|
14791
|
-
const values = new Set(field2.options.map(({ value }) => value));
|
|
14792
|
-
if (values.size !== field2.options.length)
|
|
14793
|
-
issue2("options", "Duplicate option values");
|
|
14794
|
-
if (field2.default !== void 0 && !values.has(field2.default))
|
|
14795
|
-
issue2("default", "Must match an option value");
|
|
14796
|
-
}
|
|
14797
|
-
});
|
|
14798
|
-
var manifestHeader = external_exports.object({
|
|
14799
|
-
manifestVersion: external_exports.int().positive(),
|
|
14800
|
-
id: desktopExtensionIdSchema,
|
|
14801
|
-
name: external_exports.union([extensionName, localizedText(extensionName)]),
|
|
14802
|
-
version: external_exports.string().min(1).max(128),
|
|
14803
|
-
desktopApi: external_exports.int().positive()
|
|
14804
|
-
}).passthrough();
|
|
14805
|
-
var desktopExtensionManifestSchema = manifestHeader.extend({
|
|
14806
|
-
manifestVersion: external_exports.literal(1),
|
|
14807
|
-
desktopApi: external_exports.literal(DESKTOP_EXTENSION_API_VERSION),
|
|
14808
|
-
description: external_exports.strictObject({ en: external_exports.string().max(4096), "zh-CN": external_exports.string().max(4096).optional() }).optional(),
|
|
14809
|
-
author: external_exports.string().trim().min(1).max(128).optional(),
|
|
14810
|
-
repository: desktopExtensionHttpUrlSchema.optional(),
|
|
14811
|
-
details: external_exports.strictObject({ en: external_exports.string().max(16384), "zh-CN": external_exports.string().max(16384).optional() }).optional(),
|
|
14812
|
-
icon: imagePathSchema.optional(),
|
|
14813
|
-
screenshots: external_exports.array(imagePathSchema).max(DESKTOP_EXTENSION_SCREENSHOT_LIMIT).refine((screenshots) => new Set(screenshots).size === screenshots.length, "Duplicate screenshots").optional(),
|
|
14814
|
-
desktop: external_exports.strictObject({
|
|
14815
|
-
script: pluginRelativeResourceSchema,
|
|
14816
|
-
style: pluginRelativeResourceSchema.optional()
|
|
14817
|
-
}).optional(),
|
|
14818
|
-
backend: external_exports.strictObject({ script: pluginRelativeResourceSchema.refine(hasPortableSegments) }).optional(),
|
|
14819
|
-
slots: slotsSchema.default(() => []),
|
|
14820
|
-
settingsSchema: external_exports.array(desktopExtensionSettingFieldSchema).max(32).refine((fields) => new Set(fields.map(({ key }) => key)).size === fields.length, "Duplicate setting keys").optional(),
|
|
14821
|
-
categories: categoriesSchema.optional()
|
|
14822
|
-
}).strict().refine((manifest) => manifest.desktop !== void 0 || manifest.backend !== void 0, "Expected at least one desktop or backend entry");
|
|
14823
|
-
var desktopExtensionConfigurationSchema = external_exports.strictObject({
|
|
14824
|
-
version: external_exports.literal(1),
|
|
14825
|
-
revision: external_exports.int().nonnegative(),
|
|
14826
|
-
enabled: external_exports.array(desktopExtensionIdSchema).max(DESKTOP_EXTENSION_LIMIT).refine((ids) => new Set(ids).size === ids.length, "Duplicate extension IDs"),
|
|
14827
|
-
reloadToken: external_exports.uuid().optional()
|
|
14828
|
-
});
|
|
14829
|
-
var desktopExtensionHashSchema = external_exports.string().regex(/^[a-f0-9]{64}$/u);
|
|
14830
|
-
var desktopExtensionStatusSchema = external_exports.strictObject({
|
|
14831
|
-
state: external_exports.enum([
|
|
14832
|
-
"running",
|
|
14833
|
-
"disabled",
|
|
14834
|
-
"invalid",
|
|
14835
|
-
"incompatible",
|
|
14836
|
-
"conflict",
|
|
14837
|
-
"failed",
|
|
14838
|
-
"waiting"
|
|
14839
|
-
]),
|
|
14840
|
-
hash: desktopExtensionHashSchema.optional(),
|
|
14841
|
-
error: external_exports.string().optional(),
|
|
14842
|
-
conflictWith: desktopExtensionIdSchema.optional()
|
|
14843
|
-
});
|
|
14844
|
-
var desktopExtensionsDiagnosticSchema = external_exports.strictObject({
|
|
14845
|
-
controllerPid: external_exports.int().positive(),
|
|
14846
|
-
targetId: external_exports.string().nullable(),
|
|
14847
|
-
updatedAt: external_exports.iso.datetime(),
|
|
14848
|
-
handledReloadToken: external_exports.uuid().optional(),
|
|
14849
|
-
extensions: external_exports.record(external_exports.string(), desktopExtensionStatusSchema)
|
|
14850
|
-
});
|
|
14851
|
-
var desktopExtensionTrustTierSchema = external_exports.enum(["official", "community"]);
|
|
14852
|
-
function isGitHubDesktopExtensionZipballUrl(url2) {
|
|
14853
|
-
return url2.origin === "https://api.github.com" && /^\/repos\/[\w-]+\/[\w.-]+\/zipball(?:\/[^/]+)?\/?$/u.test(url2.pathname);
|
|
14854
|
-
}
|
|
14855
|
-
var desktopExtensionZipUrlSchema = desktopExtensionHttpUrlSchema.refine((input) => {
|
|
14856
|
-
const url2 = new URL(input);
|
|
14857
|
-
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);
|
|
14858
|
-
}, "Expected a .zip download URL or a GitHub zipball URL");
|
|
14859
|
-
var desktopExtensionCatalogEntrySchema = external_exports.strictObject({
|
|
14860
|
-
id: desktopExtensionIdSchema,
|
|
14861
|
-
version: external_exports.string().trim().min(1).max(128),
|
|
14862
|
-
name: desktopExtensionLocalizedTextSchema.extend({ en: extensionName, "zh-CN": extensionName }),
|
|
14863
|
-
description: localizedText(external_exports.string().trim().min(1).max(4096)),
|
|
14864
|
-
details: localizedText(external_exports.string().trim().min(1).max(16384)).optional(),
|
|
14865
|
-
author: external_exports.string().trim().min(1).max(128),
|
|
14866
|
-
repository: desktopExtensionHttpUrlSchema,
|
|
14867
|
-
stars: external_exports.number().int().min(0).optional(),
|
|
14868
|
-
downloads: external_exports.number().int().min(0).optional(),
|
|
14869
|
-
categories: categoriesSchema.optional(),
|
|
14870
|
-
trustTier: desktopExtensionTrustTierSchema.default("community"),
|
|
14871
|
-
icon: desktopExtensionHttpUrlSchema.optional(),
|
|
14872
|
-
screenshots: external_exports.array(desktopExtensionHttpUrlSchema).max(DESKTOP_EXTENSION_SCREENSHOT_LIMIT).optional(),
|
|
14873
|
-
downloadUrl: desktopExtensionZipUrlSchema,
|
|
14874
|
-
sha256: desktopExtensionHashSchema,
|
|
14875
|
-
slots: slotsSchema.optional(),
|
|
14876
|
-
publishedAt: external_exports.string().optional(),
|
|
14877
|
-
updatedAt: external_exports.string().optional(),
|
|
14878
|
-
minCodexHostVersion: external_exports.string().optional()
|
|
14879
|
-
});
|
|
14880
|
-
var desktopExtensionCatalogSchema = external_exports.strictObject({
|
|
14881
|
-
schemaVersion: external_exports.literal(1),
|
|
14882
|
-
generatedAt: external_exports.string(),
|
|
14883
|
-
extensions: external_exports.array(desktopExtensionCatalogEntrySchema).refine((entries) => new Set(entries.map(({ id }) => id)).size === entries.length, "Duplicate extension IDs")
|
|
14884
|
-
});
|
|
14885
|
-
var DESKTOP_EXTENSIONS_ASSET_METHOD = "codexhost/desktop/extensions/asset";
|
|
14886
|
-
var DESKTOP_EXTENSIONS_SETTINGS_GET_METHOD = "codexhost/desktop/extensions/settings/get";
|
|
14887
|
-
var DESKTOP_EXTENSIONS_SETTINGS_SET_METHOD = "codexhost/desktop/extensions/settings/set";
|
|
14888
|
-
var DESKTOP_EXTENSIONS_BACKEND_INVOKE_METHOD = "codexhost/desktop/extensions/backend/invoke";
|
|
14889
|
-
var extensionIdParams = { id: desktopExtensionIdSchema };
|
|
14890
|
-
var desktopExtensionsAssetParamsSchema = external_exports.strictObject({
|
|
14891
|
-
...extensionIdParams,
|
|
14892
|
-
path: desktopExtensionAssetPathSchema
|
|
14893
|
-
});
|
|
14894
|
-
var desktopExtensionsAssetResultSchema = external_exports.strictObject({
|
|
14895
|
-
mimeType: external_exports.string(),
|
|
14896
|
-
dataUrl: external_exports.string()
|
|
14897
|
-
});
|
|
14898
|
-
var desktopExtensionsSettingsGetParamsSchema = external_exports.strictObject(extensionIdParams);
|
|
14899
|
-
var desktopExtensionsSettingsSetParamsSchema = external_exports.strictObject({
|
|
14900
|
-
...extensionIdParams,
|
|
14901
|
-
values: jsonObjectSchema
|
|
14902
|
-
});
|
|
14903
|
-
var desktopExtensionsSettingsResultSchema = external_exports.strictObject({ values: jsonObjectSchema });
|
|
14904
|
-
var desktopExtensionBackendMethodSchema = external_exports.string().trim().min(1).max(128);
|
|
14905
|
-
var desktopExtensionsBackendInvokeParamsSchema = external_exports.strictObject({
|
|
14906
|
-
...extensionIdParams,
|
|
14907
|
-
method: desktopExtensionBackendMethodSchema,
|
|
14908
|
-
params: jsonValueSchema.optional()
|
|
14909
|
-
});
|
|
14910
|
-
var desktopExtensionsBackendInvokeResultSchema = external_exports.strictObject({
|
|
14911
|
-
result: jsonValueSchema
|
|
14912
|
-
});
|
|
14913
|
-
|
|
14914
|
-
// ../../shared-contracts/dist/desktop-extension-management.js
|
|
14915
|
-
var DESKTOP_EXTENSIONS_LIST_METHOD = "codexhost/desktop/extensions/list";
|
|
14916
|
-
var DESKTOP_EXTENSIONS_ENABLE_METHOD = "codexhost/desktop/extensions/enable";
|
|
14917
|
-
var DESKTOP_EXTENSIONS_DISABLE_METHOD = "codexhost/desktop/extensions/disable";
|
|
14918
|
-
var DESKTOP_EXTENSIONS_CATALOG_METHOD = "codexhost/desktop/extensions/catalog";
|
|
14919
|
-
var DESKTOP_EXTENSIONS_INSTALL_METHOD = "codexhost/desktop/extensions/install";
|
|
14920
|
-
var DESKTOP_EXTENSIONS_UNINSTALL_METHOD = "codexhost/desktop/extensions/uninstall";
|
|
14921
|
-
var DESKTOP_EXTENSIONS_RECOVER_METHOD = "codexhost/desktop/extensions/disable-all-and-reload";
|
|
14922
|
-
var DESKTOP_EXTENSION_MANAGEMENT_METHODS = [
|
|
14923
|
-
DESKTOP_EXTENSIONS_LIST_METHOD,
|
|
14924
|
-
DESKTOP_EXTENSIONS_ENABLE_METHOD,
|
|
14925
|
-
DESKTOP_EXTENSIONS_DISABLE_METHOD,
|
|
14926
|
-
DESKTOP_EXTENSIONS_RECOVER_METHOD,
|
|
14927
|
-
DESKTOP_EXTENSIONS_CATALOG_METHOD,
|
|
14928
|
-
DESKTOP_EXTENSIONS_INSTALL_METHOD,
|
|
14929
|
-
DESKTOP_EXTENSIONS_UNINSTALL_METHOD,
|
|
14930
|
-
DESKTOP_EXTENSIONS_ASSET_METHOD,
|
|
14931
|
-
DESKTOP_EXTENSIONS_SETTINGS_GET_METHOD,
|
|
14932
|
-
DESKTOP_EXTENSIONS_SETTINGS_SET_METHOD,
|
|
14933
|
-
DESKTOP_EXTENSIONS_BACKEND_INVOKE_METHOD
|
|
14934
|
-
];
|
|
14935
|
-
var revisionSchema = external_exports.int().nonnegative();
|
|
14936
|
-
var desktopExtensionsListParamsSchema = external_exports.strictObject({});
|
|
14937
|
-
var desktopExtensionSelectionParamsSchema = external_exports.strictObject({
|
|
14938
|
-
id: desktopExtensionIdSchema,
|
|
14939
|
-
expectedRevision: revisionSchema
|
|
14940
|
-
});
|
|
14941
|
-
var desktopExtensionsRecoveryParamsSchema = external_exports.strictObject({
|
|
14942
|
-
expectedRevision: revisionSchema.optional()
|
|
14943
|
-
});
|
|
14944
|
-
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);
|
|
14945
|
-
var desktopExtensionListItemSchema = external_exports.strictObject({
|
|
14946
|
-
// An invalid discovery can have a directory name that isn't a valid extension ID.
|
|
14947
|
-
id: external_exports.string().min(1),
|
|
14948
|
-
manifest: desktopExtensionManifestSchema.optional(),
|
|
14949
|
-
iconDataUrl: rasterDataUrlSchema(DESKTOP_EXTENSION_ICON_MAX_BYTES).optional(),
|
|
14950
|
-
screenshotDataUrls: external_exports.array(rasterDataUrlSchema(DESKTOP_EXTENSION_SCREENSHOT_MAX_BYTES)).max(DESKTOP_EXTENSION_SCREENSHOT_LIMIT).optional(),
|
|
14951
|
-
enabled: external_exports.boolean(),
|
|
14952
|
-
status: desktopExtensionStatusSchema
|
|
14953
|
-
});
|
|
14954
|
-
var desktopExtensionsListResultSchema = external_exports.strictObject({
|
|
14955
|
-
configuration: desktopExtensionConfigurationSchema,
|
|
14956
|
-
desktopConnected: external_exports.boolean(),
|
|
14957
|
-
diagnostics: external_exports.array(external_exports.string()),
|
|
14958
|
-
extensions: external_exports.array(desktopExtensionListItemSchema)
|
|
14959
|
-
});
|
|
14960
|
-
var desktopExtensionsCatalogParamsSchema = external_exports.strictObject({
|
|
14961
|
-
forceRefresh: external_exports.boolean().optional()
|
|
14962
|
-
});
|
|
14963
|
-
var desktopExtensionsCatalogResultSchema = external_exports.strictObject({
|
|
14964
|
-
catalogUrl: external_exports.string(),
|
|
14965
|
-
source: external_exports.enum(["remote", "fallback"]),
|
|
14966
|
-
fetchedAt: external_exports.string(),
|
|
14967
|
-
cached: external_exports.boolean(),
|
|
14968
|
-
extensions: desktopExtensionCatalogSchema.shape.extensions,
|
|
14969
|
-
error: external_exports.string().optional()
|
|
14970
|
-
});
|
|
14971
|
-
var desktopExtensionsInstallParamsSchema = external_exports.strictObject({
|
|
14972
|
-
source: external_exports.discriminatedUnion("type", [
|
|
14973
|
-
external_exports.strictObject({ type: external_exports.literal("catalog"), id: desktopExtensionIdSchema }),
|
|
14974
|
-
external_exports.strictObject({
|
|
14975
|
-
type: external_exports.literal("url"),
|
|
14976
|
-
url: desktopExtensionHttpUrlSchema,
|
|
14977
|
-
expectedSha256: desktopExtensionHashSchema.optional()
|
|
14978
|
-
}),
|
|
14979
|
-
external_exports.strictObject({
|
|
14980
|
-
type: external_exports.literal("zip-base64"),
|
|
14981
|
-
fileName: external_exports.string().trim().min(1).max(255),
|
|
14982
|
-
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")
|
|
14983
|
-
})
|
|
14984
|
-
])
|
|
14985
|
-
});
|
|
14986
|
-
var desktopExtensionsInstallResultSchema = external_exports.strictObject({
|
|
14987
|
-
extensionId: desktopExtensionIdSchema,
|
|
14988
|
-
version: external_exports.string().min(1),
|
|
14989
|
-
replaced: external_exports.boolean(),
|
|
14990
|
-
installedPath: external_exports.string(),
|
|
14991
|
-
list: desktopExtensionsListResultSchema
|
|
14992
|
-
});
|
|
14993
|
-
var desktopExtensionsUninstallParamsSchema = external_exports.strictObject({
|
|
14994
|
-
id: desktopExtensionIdSchema
|
|
14995
|
-
});
|
|
14996
|
-
var desktopExtensionsUninstallResultSchema = external_exports.strictObject({
|
|
14997
|
-
removedId: desktopExtensionIdSchema,
|
|
14998
|
-
list: desktopExtensionsListResultSchema
|
|
14999
|
-
});
|
|
15000
|
-
var desktopExtensionMutationResultSchema = external_exports.discriminatedUnion("state", [
|
|
15001
|
-
external_exports.strictObject({ state: external_exports.literal("saved"), configuration: desktopExtensionConfigurationSchema }),
|
|
15002
|
-
external_exports.strictObject({ state: external_exports.literal("slot-conflict"), conflictWith: desktopExtensionIdSchema }),
|
|
15003
|
-
external_exports.strictObject({ state: external_exports.literal("revision-conflict"), revision: revisionSchema })
|
|
15004
|
-
]);
|
|
15005
|
-
|
|
15006
|
-
// ../../shared-contracts/dist/errors.js
|
|
15007
|
-
var codexhostErrorSchema = external_exports.strictObject({
|
|
15008
|
-
code: external_exports.string().min(1),
|
|
15009
|
-
message: external_exports.string().min(1),
|
|
15010
|
-
retryable: external_exports.boolean(),
|
|
15011
|
-
diagnostic: external_exports.string().min(1).optional(),
|
|
15012
|
-
stage: external_exports.string().min(1).optional(),
|
|
15013
|
-
durationMs: external_exports.number().int().nonnegative().optional(),
|
|
15014
|
-
stderrTail: external_exports.string().min(1).optional()
|
|
15015
|
-
}).superRefine(rejectExplicitUndefined(["diagnostic", "stage", "durationMs", "stderrTail"]));
|
|
15016
|
-
|
|
15017
|
-
// ../../shared-contracts/dist/harness-presentation.js
|
|
15018
|
-
var localeSchema = external_exports.string().max(64).regex(/^[a-z]{2,3}(?:-[A-Za-z0-9]{2,8})*$/u);
|
|
15019
|
-
var displayText = (maximum) => external_exports.string().min(1).max(maximum).refine((text) => text.trim().length > 0);
|
|
15020
|
-
var harnessLocalizationsSchema = external_exports.record(localeSchema, external_exports.object({
|
|
15021
|
-
label: displayText(256).optional(),
|
|
15022
|
-
description: displayText(1024).optional()
|
|
15023
|
-
}).strict()).refine((entries) => Object.keys(entries).length <= 16, "Too many locales");
|
|
15024
|
-
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");
|
|
15025
|
-
|
|
15026
|
-
// ../../shared-contracts/dist/harness-permission-modes.js
|
|
15027
|
-
var HARNESS_PERMISSION_MODE_ID_MAX_LENGTH = 128;
|
|
15028
|
-
var HARNESS_PERMISSION_MODE_LABEL_MAX_LENGTH = 256;
|
|
15029
|
-
var HARNESS_PERMISSION_MODE_DESCRIPTION_MAX_LENGTH = 1024;
|
|
15030
|
-
var HARNESS_PERMISSION_MODE_CATALOG_MAX_LENGTH = 32;
|
|
15031
|
-
var nonBlankTextSchema = external_exports.string().refine((value) => value.trim().length > 0, {
|
|
15032
|
-
message: "Value must not be empty or whitespace"
|
|
15033
|
-
});
|
|
15034
|
-
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();
|
|
15035
|
-
var harnessPermissionModeSchema = external_exports.object({
|
|
15036
|
-
id: harnessPermissionModeIdSchema,
|
|
15037
|
-
label: nonBlankTextSchema.max(HARNESS_PERMISSION_MODE_LABEL_MAX_LENGTH),
|
|
15038
|
-
description: nonBlankTextSchema.max(HARNESS_PERMISSION_MODE_DESCRIPTION_MAX_LENGTH).optional(),
|
|
15039
|
-
dangerous: external_exports.boolean().optional(),
|
|
15040
|
-
localizations: harnessLocalizationsSchema.optional()
|
|
15041
|
-
}).strict();
|
|
15042
|
-
var harnessPermissionModeCatalogSchema = external_exports.object({
|
|
15043
|
-
modes: external_exports.array(harnessPermissionModeSchema).min(1).max(HARNESS_PERMISSION_MODE_CATALOG_MAX_LENGTH),
|
|
15044
|
-
defaultModeId: harnessPermissionModeIdSchema
|
|
15045
|
-
}).strict().superRefine((catalog, context) => {
|
|
15046
|
-
const ids = /* @__PURE__ */ new Set();
|
|
15047
|
-
for (const [index, mode] of catalog.modes.entries()) {
|
|
15048
|
-
if (ids.has(mode.id)) {
|
|
15049
|
-
context.addIssue({
|
|
15050
|
-
code: "custom",
|
|
15051
|
-
message: "Permission Mode IDs must be unique",
|
|
15052
|
-
path: ["modes", index, "id"]
|
|
15053
|
-
});
|
|
15054
|
-
}
|
|
15055
|
-
ids.add(mode.id);
|
|
15056
|
-
}
|
|
15057
|
-
if (!ids.has(catalog.defaultModeId)) {
|
|
15058
|
-
context.addIssue({
|
|
15059
|
-
code: "custom",
|
|
15060
|
-
message: "Default Permission Mode must exist in the catalog",
|
|
15061
|
-
path: ["defaultModeId"]
|
|
15062
|
-
});
|
|
14646
|
+
if (!ids.has(catalog.defaultModeId)) {
|
|
14647
|
+
context.addIssue({
|
|
14648
|
+
code: "custom",
|
|
14649
|
+
message: "Default Permission Mode must exist in the catalog",
|
|
14650
|
+
path: ["defaultModeId"]
|
|
14651
|
+
});
|
|
15063
14652
|
}
|
|
15064
14653
|
});
|
|
15065
14654
|
var threadPermissionModeSelectParamsSchema = external_exports.object({
|
|
@@ -15067,6 +14656,9 @@ var threadPermissionModeSelectParamsSchema = external_exports.object({
|
|
|
15067
14656
|
permissionModeId: harnessPermissionModeIdSchema
|
|
15068
14657
|
}).strict();
|
|
15069
14658
|
|
|
14659
|
+
// ../../shared-contracts/dist/harness-route-limit.js
|
|
14660
|
+
var HARNESS_TRANSPORT_MODEL_ID_MAX_LENGTH = 8192;
|
|
14661
|
+
|
|
15070
14662
|
// ../../shared-contracts/dist/thread-usage.js
|
|
15071
14663
|
var nonNegativeSafeIntegerSchema = external_exports.number().int().safe().nonnegative();
|
|
15072
14664
|
var finiteNonNegativeNumberSchema = external_exports.number().finite().nonnegative();
|
|
@@ -15092,14 +14684,14 @@ var usageMeasurementsSchema = external_exports.object({
|
|
|
15092
14684
|
outputTokensPerSecond: usageMeasurementSchema.refine((value) => value.version === 4).optional().catch(void 0),
|
|
15093
14685
|
timeToFirstOutputMs: usageMeasurementSchema.extend({ value: nonNegativeSafeIntegerSchema }).optional()
|
|
15094
14686
|
}).strict();
|
|
15095
|
-
var indicatorTextSchema = (maximum) => harnessLocalizedTextSchema.refine((entries) => Object.values(entries).every((
|
|
14687
|
+
var indicatorTextSchema = (maximum) => harnessLocalizedTextSchema.refine((entries) => Object.values(entries).every((text2) => text2.length <= maximum));
|
|
15096
14688
|
var composerIndicatorsSchema = external_exports.array(external_exports.object({
|
|
15097
14689
|
kind: external_exports.literal("countdown"),
|
|
15098
14690
|
id: external_exports.string().min(1).max(64),
|
|
15099
14691
|
expiresAtUnix: nonNegativeSafeIntegerSchema,
|
|
15100
14692
|
label: indicatorTextSchema(256).optional(),
|
|
15101
14693
|
tooltip: indicatorTextSchema(1024).optional()
|
|
15102
|
-
}).strict()).max(2).refine((entries) => new Set(entries.map(({ id }) =>
|
|
14694
|
+
}).strict()).max(2).refine((entries) => new Set(entries.map(({ id: id2 }) => id2)).size === entries.length, {
|
|
15103
14695
|
message: "Composer indicator IDs must be unique"
|
|
15104
14696
|
});
|
|
15105
14697
|
var threadUsageSnapshotSchema = external_exports.object({
|
|
@@ -15125,6 +14717,7 @@ var threadUsageSnapshotSchema = external_exports.object({
|
|
|
15125
14717
|
planSevenDayResetsAtUnix: nonNegativeSafeIntegerSchema.optional(),
|
|
15126
14718
|
sessionCacheHitRatePercent: cacheHitRatePercentSchema.optional(),
|
|
15127
14719
|
timeToFirstOutputMs: nonNegativeSafeIntegerSchema.optional(),
|
|
14720
|
+
latestRequestTimeToFirstOutputMs: nonNegativeSafeIntegerSchema.optional(),
|
|
15128
14721
|
costSource: external_exports.enum(["publicPrice", "native"]).optional(),
|
|
15129
14722
|
unpricedModels: external_exports.array(external_exports.string().min(1)).min(1).optional()
|
|
15130
14723
|
}).strict().superRefine((usage, context) => {
|
|
@@ -15252,10 +14845,15 @@ var THREAD_OWNERSHIP_LIST_MAX_LENGTH = 100;
|
|
|
15252
14845
|
var nonBlankTextSchema2 = external_exports.string().refine((value) => value.trim().length > 0, {
|
|
15253
14846
|
message: "Value must not be empty or whitespace"
|
|
15254
14847
|
});
|
|
15255
|
-
var harnessModelRefIdSchema =
|
|
14848
|
+
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();
|
|
14849
|
+
var harnessModelServiceTierSchema = external_exports.enum(["priority", "ultrafast"]);
|
|
15256
14850
|
var harnessModelRefSchema = external_exports.object({
|
|
15257
|
-
id: harnessModelRefIdSchema
|
|
14851
|
+
id: harnessModelRefIdSchema,
|
|
14852
|
+
serviceTier: harnessModelServiceTierSchema.optional()
|
|
15258
14853
|
}).strict();
|
|
14854
|
+
function sameHarnessModelRef(left, right) {
|
|
14855
|
+
return left?.id === right?.id && left?.serviceTier === right?.serviceTier;
|
|
14856
|
+
}
|
|
15259
14857
|
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();
|
|
15260
14858
|
var harnessResolvedModelLabelSchema = nonBlankTextSchema2.max(HARNESS_MODEL_LABEL_MAX_LENGTH);
|
|
15261
14859
|
var harnessThinkingOptionSchema = external_exports.object({
|
|
@@ -15269,7 +14867,15 @@ var harnessModelSchema = external_exports.object({
|
|
|
15269
14867
|
/** Optional opaque selection for this same Model with priority processing enabled. */
|
|
15270
14868
|
fastModel: harnessModelRefSchema.optional(),
|
|
15271
14869
|
supportedThinkingOptionIds: external_exports.array(harnessThinkingOptionIdSchema).optional()
|
|
15272
|
-
}).strict()
|
|
14870
|
+
}).strict().refine((model2) => model2.fastModel?.serviceTier === void 0 || model2.fastModel.id === model2.ref.id, {
|
|
14871
|
+
path: ["fastModel", "id"],
|
|
14872
|
+
message: "A tiered Fast Model must share the base Model ID"
|
|
14873
|
+
});
|
|
14874
|
+
function catalogModelForRef(catalog, ref) {
|
|
14875
|
+
if (!ref)
|
|
14876
|
+
return void 0;
|
|
14877
|
+
return catalog?.models.find((model2) => sameHarnessModelRef(model2.ref, ref) || sameHarnessModelRef(model2.fastModel, ref));
|
|
14878
|
+
}
|
|
15273
14879
|
var harnessThinkingOptionsSchema = external_exports.array(harnessThinkingOptionSchema).superRefine((options, context) => {
|
|
15274
14880
|
const ids = /* @__PURE__ */ new Set();
|
|
15275
14881
|
for (const [index, option] of options.entries()) {
|
|
@@ -15289,26 +14895,26 @@ var harnessModelCatalogSchema = external_exports.object({
|
|
|
15289
14895
|
thinkingOptions: harnessThinkingOptionsSchema,
|
|
15290
14896
|
defaultThinkingOptionId: harnessThinkingOptionIdSchema.optional()
|
|
15291
14897
|
}).strict().superRefine((catalog, context) => {
|
|
15292
|
-
const refs =
|
|
15293
|
-
const thinkingIds = new Set(catalog.thinkingOptions.map(({ id }) =>
|
|
14898
|
+
const refs = [];
|
|
14899
|
+
const thinkingIds = new Set(catalog.thinkingOptions.map(({ id: id2 }) => id2));
|
|
15294
14900
|
for (const [index, model2] of catalog.models.entries()) {
|
|
15295
|
-
if (refs.
|
|
14901
|
+
if (refs.some((ref) => sameHarnessModelRef(ref, model2.ref))) {
|
|
15296
14902
|
context.addIssue({
|
|
15297
14903
|
code: "custom",
|
|
15298
14904
|
message: "Model Catalog refs must be unique",
|
|
15299
14905
|
path: ["models", index, "ref", "id"]
|
|
15300
14906
|
});
|
|
15301
14907
|
}
|
|
15302
|
-
refs.
|
|
14908
|
+
refs.push(model2.ref);
|
|
15303
14909
|
if (model2.fastModel) {
|
|
15304
|
-
if (refs.
|
|
14910
|
+
if (refs.some((ref) => sameHarnessModelRef(ref, model2.fastModel))) {
|
|
15305
14911
|
context.addIssue({
|
|
15306
14912
|
code: "custom",
|
|
15307
14913
|
message: "Fast Model refs must be distinct and unique",
|
|
15308
14914
|
path: ["models", index, "fastModel"]
|
|
15309
14915
|
});
|
|
15310
14916
|
}
|
|
15311
|
-
refs.
|
|
14917
|
+
refs.push(model2.fastModel);
|
|
15312
14918
|
}
|
|
15313
14919
|
const supportedThinkingIds = /* @__PURE__ */ new Set();
|
|
15314
14920
|
for (const [optionIndex, optionId] of (model2.supportedThinkingOptionIds ?? []).entries()) {
|
|
@@ -15329,7 +14935,7 @@ var harnessModelCatalogSchema = external_exports.object({
|
|
|
15329
14935
|
}
|
|
15330
14936
|
}
|
|
15331
14937
|
}
|
|
15332
|
-
if (catalog.defaultModel && !
|
|
14938
|
+
if (catalog.defaultModel && !catalogModelForRef(catalog, catalog.defaultModel)) {
|
|
15333
14939
|
context.addIssue({
|
|
15334
14940
|
code: "custom",
|
|
15335
14941
|
message: "Default Model must exist in the Model Catalog",
|
|
@@ -15369,7 +14975,12 @@ var harnessSessionCapabilitiesSchema = external_exports.object({
|
|
|
15369
14975
|
observe: external_exports.boolean()
|
|
15370
14976
|
}).strict().optional(),
|
|
15371
14977
|
/** True only when `turn.steer` delivers input into the active Turn through a native primitive. */
|
|
15372
|
-
steer: external_exports.boolean().optional()
|
|
14978
|
+
steer: external_exports.boolean().optional(),
|
|
14979
|
+
/**
|
|
14980
|
+
* True when the native plan (task list) outlives the Turn that changed it, so a reopened
|
|
14981
|
+
* Thread gets its latest plan again. Otherwise a plan stays with the Turn that made it.
|
|
14982
|
+
*/
|
|
14983
|
+
persistentPlan: external_exports.boolean().optional()
|
|
15373
14984
|
}).strict();
|
|
15374
14985
|
var harnessConfigurationStateSchema = external_exports.object({
|
|
15375
14986
|
effectiveModel: harnessModelRefSchema.optional(),
|
|
@@ -15378,7 +14989,7 @@ var harnessConfigurationStateSchema = external_exports.object({
|
|
|
15378
14989
|
availableThinkingOptions: harnessThinkingOptionsSchema.optional(),
|
|
15379
14990
|
effectivePermissionModeId: harnessPermissionModeIdSchema.optional()
|
|
15380
14991
|
}).strict().superRefine((state, context) => {
|
|
15381
|
-
if (state.effectiveThinkingOptionId && state.availableThinkingOptions && !state.availableThinkingOptions.some(({ id }) =>
|
|
14992
|
+
if (state.effectiveThinkingOptionId && state.availableThinkingOptions && !state.availableThinkingOptions.some(({ id: id2 }) => id2 === state.effectiveThinkingOptionId)) {
|
|
15382
14993
|
context.addIssue({
|
|
15383
14994
|
code: "custom",
|
|
15384
14995
|
message: "Effective Thinking option must be currently available",
|
|
@@ -15386,150 +14997,698 @@ var harnessConfigurationStateSchema = external_exports.object({
|
|
|
15386
14997
|
});
|
|
15387
14998
|
}
|
|
15388
14999
|
});
|
|
15389
|
-
var harnessWebUiCapabilitySchema = external_exports.object({
|
|
15390
|
-
open: external_exports.literal(true)
|
|
15391
|
-
}).strict();
|
|
15392
|
-
var readyHarnessInspectionSchema = external_exports.object({
|
|
15393
|
-
status: external_exports.literal("ready"),
|
|
15394
|
-
catalog: harnessModelCatalogSchema,
|
|
15395
|
-
permissionModes: harnessPermissionModeCatalogSchema.optional(),
|
|
15396
|
-
capabilities: harnessSessionCapabilitiesSchema,
|
|
15397
|
-
webUi: harnessWebUiCapabilitySchema.optional()
|
|
15398
|
-
}).strict().superRefine((inspection, context) => {
|
|
15399
|
-
const selectable = inspection.capabilities.configuration.selectPermissionMode;
|
|
15400
|
-
if (selectable !== Boolean(inspection.permissionModes)) {
|
|
15401
|
-
context.addIssue({
|
|
15402
|
-
code: "custom",
|
|
15403
|
-
message: "Permission Mode catalog and capability must agree",
|
|
15404
|
-
path: selectable ? ["permissionModes"] : ["capabilities", "configuration", "selectPermissionMode"]
|
|
15405
|
-
});
|
|
15406
|
-
}
|
|
15000
|
+
var harnessWebUiCapabilitySchema = external_exports.object({
|
|
15001
|
+
open: external_exports.literal(true)
|
|
15002
|
+
}).strict();
|
|
15003
|
+
var readyHarnessInspectionSchema = external_exports.object({
|
|
15004
|
+
status: external_exports.literal("ready"),
|
|
15005
|
+
catalog: harnessModelCatalogSchema,
|
|
15006
|
+
permissionModes: harnessPermissionModeCatalogSchema.optional(),
|
|
15007
|
+
capabilities: harnessSessionCapabilitiesSchema,
|
|
15008
|
+
webUi: harnessWebUiCapabilitySchema.optional()
|
|
15009
|
+
}).strict().superRefine((inspection, context) => {
|
|
15010
|
+
const selectable = inspection.capabilities.configuration.selectPermissionMode;
|
|
15011
|
+
if (selectable !== Boolean(inspection.permissionModes)) {
|
|
15012
|
+
context.addIssue({
|
|
15013
|
+
code: "custom",
|
|
15014
|
+
message: "Permission Mode catalog and capability must agree",
|
|
15015
|
+
path: selectable ? ["permissionModes"] : ["capabilities", "configuration", "selectPermissionMode"]
|
|
15016
|
+
});
|
|
15017
|
+
}
|
|
15018
|
+
});
|
|
15019
|
+
var failedHarnessInspectionSchema = external_exports.object({
|
|
15020
|
+
status: external_exports.enum(["notInstalled", "unavailable", "error"]),
|
|
15021
|
+
error: codexhostErrorSchema
|
|
15022
|
+
}).strict();
|
|
15023
|
+
var harnessInspectionSchema = external_exports.union([
|
|
15024
|
+
readyHarnessInspectionSchema,
|
|
15025
|
+
failedHarnessInspectionSchema
|
|
15026
|
+
]);
|
|
15027
|
+
var harnessInspectParamsSchema = external_exports.object({
|
|
15028
|
+
harnessId: harnessIdSchema,
|
|
15029
|
+
cwd: nonBlankTextSchema2.max(16384).optional(),
|
|
15030
|
+
refresh: external_exports.boolean().optional(),
|
|
15031
|
+
/** `availability` asks only whether the Harness can run; see `InspectHarnessInput.purpose`. */
|
|
15032
|
+
purpose: external_exports.literal("availability").optional(),
|
|
15033
|
+
credentialAccess: external_exports.enum(["allow", "retry"]).optional()
|
|
15034
|
+
}).strict();
|
|
15035
|
+
var harnessWebUiOpenParamsSchema = external_exports.object({
|
|
15036
|
+
harnessId: harnessIdSchema
|
|
15037
|
+
}).strict();
|
|
15038
|
+
var harnessWebUiOpenResultSchema = external_exports.object({}).strict();
|
|
15039
|
+
var threadModelSelectParamsSchema = external_exports.object({
|
|
15040
|
+
threadId: hostThreadIdSchema,
|
|
15041
|
+
model: harnessModelRefSchema
|
|
15042
|
+
}).strict();
|
|
15043
|
+
var threadThinkingSelectParamsSchema = external_exports.object({
|
|
15044
|
+
threadId: hostThreadIdSchema,
|
|
15045
|
+
thinkingOptionId: harnessThinkingOptionIdSchema
|
|
15046
|
+
}).strict();
|
|
15047
|
+
var threadInspectionParamsSchema = external_exports.object({
|
|
15048
|
+
threadId: hostThreadIdSchema,
|
|
15049
|
+
includeReferenceCapability: external_exports.boolean().optional()
|
|
15050
|
+
}).strict();
|
|
15051
|
+
var codexThreadInspectionSchema = external_exports.object({
|
|
15052
|
+
owner: external_exports.literal("codex"),
|
|
15053
|
+
locked: external_exports.boolean(),
|
|
15054
|
+
effectiveModel: harnessModelRefSchema.optional(),
|
|
15055
|
+
resolvedModelLabel: harnessResolvedModelLabelSchema.optional(),
|
|
15056
|
+
effectiveThinkingOptionId: harnessThinkingOptionIdSchema.optional(),
|
|
15057
|
+
effectivePermissionModeId: harnessPermissionModeIdSchema.optional(),
|
|
15058
|
+
history: harnessHistoryCapabilitiesSchema.optional(),
|
|
15059
|
+
supportsThreadReferences: external_exports.literal(true).optional()
|
|
15060
|
+
}).strict();
|
|
15061
|
+
var externalThreadInspectionSchema = external_exports.object({
|
|
15062
|
+
owner: external_exports.literal("external"),
|
|
15063
|
+
harnessId: nonBlankTextSchema2.max(256),
|
|
15064
|
+
transportModelId: nonBlankTextSchema2.max(HARNESS_TRANSPORT_MODEL_ID_MAX_LENGTH),
|
|
15065
|
+
effectiveModel: harnessModelRefSchema.optional(),
|
|
15066
|
+
resolvedModelLabel: harnessResolvedModelLabelSchema.optional(),
|
|
15067
|
+
effectiveThinkingOptionId: harnessThinkingOptionIdSchema.optional(),
|
|
15068
|
+
availableThinkingOptions: harnessThinkingOptionsSchema.optional(),
|
|
15069
|
+
effectivePermissionModeId: harnessPermissionModeIdSchema.optional(),
|
|
15070
|
+
/** Live Session catalog when it, not the Adapter inspection, contains `effectiveModel`. */
|
|
15071
|
+
catalog: harnessModelCatalogSchema.optional(),
|
|
15072
|
+
history: harnessHistoryCapabilitiesSchema,
|
|
15073
|
+
usage: threadUsageSnapshotSchema.optional(),
|
|
15074
|
+
locked: external_exports.literal(true)
|
|
15075
|
+
}).strict();
|
|
15076
|
+
var threadInspectionSchema = external_exports.discriminatedUnion("owner", [
|
|
15077
|
+
codexThreadInspectionSchema,
|
|
15078
|
+
externalThreadInspectionSchema
|
|
15079
|
+
]);
|
|
15080
|
+
var threadOwnershipListParamsSchema = external_exports.object({
|
|
15081
|
+
threadIds: external_exports.array(hostThreadIdSchema).min(1).max(THREAD_OWNERSHIP_LIST_MAX_LENGTH)
|
|
15082
|
+
}).strict().superRefine(({ threadIds }, context) => {
|
|
15083
|
+
const seen = /* @__PURE__ */ new Set();
|
|
15084
|
+
for (const [index, threadId] of threadIds.entries()) {
|
|
15085
|
+
if (seen.has(threadId)) {
|
|
15086
|
+
context.addIssue({
|
|
15087
|
+
code: "custom",
|
|
15088
|
+
message: "Thread ownership-list IDs must be unique",
|
|
15089
|
+
path: ["threadIds", index]
|
|
15090
|
+
});
|
|
15091
|
+
}
|
|
15092
|
+
seen.add(threadId);
|
|
15093
|
+
}
|
|
15094
|
+
});
|
|
15095
|
+
var codexThreadOwnershipSchema = external_exports.object({
|
|
15096
|
+
threadId: hostThreadIdSchema,
|
|
15097
|
+
owner: external_exports.literal("codex")
|
|
15098
|
+
}).strict();
|
|
15099
|
+
var externalThreadOwnershipSchema = external_exports.object({
|
|
15100
|
+
threadId: hostThreadIdSchema,
|
|
15101
|
+
owner: external_exports.literal("external"),
|
|
15102
|
+
harnessId: external_exports.string().max(256).pipe(harnessIdSchema)
|
|
15103
|
+
}).strict();
|
|
15104
|
+
var threadOwnershipSchema = external_exports.discriminatedUnion("owner", [
|
|
15105
|
+
codexThreadOwnershipSchema,
|
|
15106
|
+
externalThreadOwnershipSchema
|
|
15107
|
+
]);
|
|
15108
|
+
var threadOwnershipListResultSchema = external_exports.object({
|
|
15109
|
+
threads: external_exports.array(threadOwnershipSchema).min(1).max(THREAD_OWNERSHIP_LIST_MAX_LENGTH)
|
|
15110
|
+
}).strict().superRefine(({ threads }, context) => {
|
|
15111
|
+
const seen = /* @__PURE__ */ new Set();
|
|
15112
|
+
for (const [index, thread2] of threads.entries()) {
|
|
15113
|
+
if (seen.has(thread2.threadId)) {
|
|
15114
|
+
context.addIssue({
|
|
15115
|
+
code: "custom",
|
|
15116
|
+
message: "Thread ownership-list results must be unique",
|
|
15117
|
+
path: ["threads", index, "threadId"]
|
|
15118
|
+
});
|
|
15119
|
+
}
|
|
15120
|
+
seen.add(thread2.threadId);
|
|
15121
|
+
}
|
|
15122
|
+
});
|
|
15123
|
+
var threadSteeringInspectParamsSchema = external_exports.object({
|
|
15124
|
+
threadId: hostThreadIdSchema,
|
|
15125
|
+
/** The text about to be steered; a Harness command always stops and restarts. */
|
|
15126
|
+
text: external_exports.string().optional()
|
|
15127
|
+
}).strict();
|
|
15128
|
+
var threadSteeringContextSchema = external_exports.object({
|
|
15129
|
+
kind: external_exports.literal("application"),
|
|
15130
|
+
value: external_exports.string().transform((text2, context) => {
|
|
15131
|
+
try {
|
|
15132
|
+
return JSON.parse(text2);
|
|
15133
|
+
} catch {
|
|
15134
|
+
context.addIssue({ code: "custom", message: "Invalid steering context JSON" });
|
|
15135
|
+
return external_exports.NEVER;
|
|
15136
|
+
}
|
|
15137
|
+
}).pipe(external_exports.object({
|
|
15138
|
+
expectedTurnId: hostTurnIdSchema,
|
|
15139
|
+
clientUserMessageId: external_exports.string().min(1),
|
|
15140
|
+
delivery: external_exports.enum(["newTurn", "activeTurn"])
|
|
15141
|
+
}).strict())
|
|
15142
|
+
}).strict().transform((context) => context.value);
|
|
15143
|
+
var threadSteerDeliverySchema = external_exports.enum(["activeTurn", "newTurn"]);
|
|
15144
|
+
var threadSteeringInspectResultSchema = external_exports.object({
|
|
15145
|
+
delivery: external_exports.enum(["official", "activeTurn", "newTurn"])
|
|
15146
|
+
}).strict();
|
|
15147
|
+
|
|
15148
|
+
// ../../shared-contracts/dist/harness-plugins.js
|
|
15149
|
+
var HARNESS_PLUGIN_MANIFEST_MAX_BYTES = 32 * 1024;
|
|
15150
|
+
var HARNESS_PLUGIN_ICON_MAX_BYTES = 128 * 1024;
|
|
15151
|
+
var HARNESS_PLUGIN_LIMIT = 128;
|
|
15152
|
+
var installedPluginIdSchema = external_exports.string().min(1).max(128).regex(/^[a-z][a-z0-9]*(?:[._-][a-z0-9]+)*$/u);
|
|
15153
|
+
var installedHarnessPluginIdSchema = installedPluginIdSchema.pipe(harnessIdSchema);
|
|
15154
|
+
var harnessPluginIdSchema = installedHarnessPluginIdSchema.refine((id2) => id2 !== "codex", "The official Codex identity is reserved");
|
|
15155
|
+
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");
|
|
15156
|
+
var documentationUrlSchema = external_exports.url().refine((value) => /^https:\/\/[^/?#@]+(?:[/?#]|$)/iu.test(value), "Plugin documentation links must be credential-free HTTPS URLs");
|
|
15157
|
+
var localizedTextSchema = external_exports.object({ en: external_exports.string().max(4096), "zh-CN": external_exports.string().max(4096).optional() }).strict();
|
|
15158
|
+
var harnessInstallationGuideSchema = external_exports.object({
|
|
15159
|
+
commands: external_exports.array(external_exports.object({ terminal: external_exports.string().max(256), command: external_exports.string().max(4096) }).strict()).max(8),
|
|
15160
|
+
before: localizedTextSchema.optional(),
|
|
15161
|
+
after: localizedTextSchema.optional(),
|
|
15162
|
+
downloads: external_exports.array(external_exports.object({ label: external_exports.string().max(128), url: documentationUrlSchema }).strict()).max(8).optional()
|
|
15163
|
+
}).strict();
|
|
15164
|
+
var pluginPresentationShape = {
|
|
15165
|
+
id: installedHarnessPluginIdSchema,
|
|
15166
|
+
name: external_exports.string().trim().min(1).max(128),
|
|
15167
|
+
version: external_exports.string().min(1).max(128),
|
|
15168
|
+
/** Capability-only plugin; omitted for existing session-capable plugins. */
|
|
15169
|
+
kind: external_exports.literal("usage").optional(),
|
|
15170
|
+
/** Original image styling or bounded vector paths; never arbitrary CSS/SVG markup. */
|
|
15171
|
+
iconStyle: external_exports.object({
|
|
15172
|
+
vector: external_exports.object({
|
|
15173
|
+
viewBox: external_exports.string().max(128).regex(/^-?\d+(?:\.\d+)?(?: +-?\d+(?:\.\d+)?){3}$/u),
|
|
15174
|
+
color: external_exports.string().regex(/^(?:currentColor|#[a-f0-9]{6})$/iu),
|
|
15175
|
+
paths: external_exports.array(external_exports.object({
|
|
15176
|
+
d: external_exports.string().min(1).max(32768).regex(/^[MmLlHhVvCcSsQqTtAaZz\d.,+eE\s-]+$/u),
|
|
15177
|
+
fillRule: external_exports.enum(["evenodd", "nonzero"]).optional(),
|
|
15178
|
+
fill: external_exports.string().regex(/^(?:currentColor|#[a-f0-9]{6})$/iu).optional()
|
|
15179
|
+
}).strict()).min(1).max(32)
|
|
15180
|
+
}).strict().optional(),
|
|
15181
|
+
background: external_exports.string().regex(/^#[a-f0-9]{6}$/iu).optional(),
|
|
15182
|
+
borderRadius: external_exports.number().min(0).max(50).optional(),
|
|
15183
|
+
paddingRatio: external_exports.number().min(0).max(0.25).optional()
|
|
15184
|
+
}).strict().optional(),
|
|
15185
|
+
installation: harnessInstallationGuideSchema.optional(),
|
|
15186
|
+
notice: localizedTextSchema.optional(),
|
|
15187
|
+
/** The factory accepts a persisted local entrypoint through its construction context. */
|
|
15188
|
+
launchCommand: external_exports.literal(true).optional(),
|
|
15189
|
+
links: external_exports.object({
|
|
15190
|
+
website: documentationUrlSchema.optional(),
|
|
15191
|
+
documentation: documentationUrlSchema.optional(),
|
|
15192
|
+
installation: documentationUrlSchema.optional()
|
|
15193
|
+
}).strict().optional()
|
|
15194
|
+
};
|
|
15195
|
+
var harnessPluginManifestSchema = external_exports.object({
|
|
15196
|
+
manifestVersion: external_exports.literal(1),
|
|
15197
|
+
...pluginPresentationShape,
|
|
15198
|
+
adapterApiVersion: external_exports.number().int().positive(),
|
|
15199
|
+
entry: pluginRelativeResourceSchema,
|
|
15200
|
+
icon: pluginRelativeResourceSchema.optional()
|
|
15201
|
+
}).strict();
|
|
15202
|
+
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);
|
|
15203
|
+
var harnessPluginDescriptorSchema = external_exports.object({
|
|
15204
|
+
...pluginPresentationShape,
|
|
15205
|
+
icon: harnessPluginIconSchema.optional()
|
|
15206
|
+
}).strict();
|
|
15207
|
+
var harnessPluginListParamsSchema = external_exports.object({}).strict();
|
|
15208
|
+
var harnessPluginListResultSchema = external_exports.object({
|
|
15209
|
+
plugins: external_exports.array(harnessPluginDescriptorSchema.extend({ id: harnessPluginIdSchema })).max(HARNESS_PLUGIN_LIMIT)
|
|
15210
|
+
}).strict();
|
|
15211
|
+
var harnessPluginConfigurationSchema = external_exports.object({
|
|
15212
|
+
version: external_exports.literal(1),
|
|
15213
|
+
enabled: external_exports.array(installedHarnessPluginIdSchema).max(HARNESS_PLUGIN_LIMIT)
|
|
15214
|
+
}).strict().refine((value) => new Set(value.enabled).size === value.enabled.length, {
|
|
15215
|
+
message: "Enabled plugin IDs must be unique",
|
|
15216
|
+
path: ["enabled"]
|
|
15217
|
+
});
|
|
15218
|
+
|
|
15219
|
+
// ../../shared-contracts/dist/desktop-extensions.js
|
|
15220
|
+
var DESKTOP_EXTENSION_API_VERSION = 1;
|
|
15221
|
+
var DESKTOP_EXTENSION_LIMIT = 64;
|
|
15222
|
+
var DESKTOP_EXTENSION_ZIP_MAX_BYTES = 64 * 1024 * 1024;
|
|
15223
|
+
var DESKTOP_EXTENSION_MANIFEST_MAX_BYTES = 128 * 1024;
|
|
15224
|
+
var DESKTOP_EXTENSION_SCRIPT_MAX_BYTES = 2 * 1024 * 1024;
|
|
15225
|
+
var DESKTOP_EXTENSION_STYLE_MAX_BYTES = 256 * 1024;
|
|
15226
|
+
var DESKTOP_EXTENSION_ICON_MAX_BYTES = 128 * 1024;
|
|
15227
|
+
var DESKTOP_EXTENSION_SCREENSHOT_LIMIT = 4;
|
|
15228
|
+
var DESKTOP_EXTENSION_SCREENSHOT_MAX_BYTES = 512 * 1024;
|
|
15229
|
+
var DESKTOP_EXTENSION_LIST_SCREENSHOTS_MAX_BYTES = 8 * 1024 * 1024;
|
|
15230
|
+
var DESKTOP_EXTENSION_SNAPSHOT_MAX_BYTES = 8 * 1024 * 1024;
|
|
15231
|
+
var DESKTOP_EXTENSION_ASSET_MAX_BYTES = 16 * 1024 * 1024;
|
|
15232
|
+
var DESKTOP_EXTENSION_SETTINGS_MAX_BYTES = 1024 * 1024;
|
|
15233
|
+
var desktopExtensionIdSchema = installedPluginIdSchema;
|
|
15234
|
+
var desktopExtensionSlotSchema = external_exports.enum([
|
|
15235
|
+
"sidebar.thread-layout",
|
|
15236
|
+
"sidebar.thread-badge",
|
|
15237
|
+
"appearance.theme"
|
|
15238
|
+
]);
|
|
15239
|
+
var desktopExtensionCategorySchema = external_exports.enum([
|
|
15240
|
+
"appearance",
|
|
15241
|
+
"interface",
|
|
15242
|
+
"workflow",
|
|
15243
|
+
"analytics",
|
|
15244
|
+
"integrations",
|
|
15245
|
+
"tools"
|
|
15246
|
+
]);
|
|
15247
|
+
var extensionName = external_exports.string().trim().min(1).max(128);
|
|
15248
|
+
function desktopExtensionScreenshotMimeType(resource) {
|
|
15249
|
+
switch (resource.match(/\.([^./]+)$/u)?.[1]?.toLowerCase()) {
|
|
15250
|
+
case "png":
|
|
15251
|
+
return "image/png";
|
|
15252
|
+
case "jpg":
|
|
15253
|
+
case "jpeg":
|
|
15254
|
+
return "image/jpeg";
|
|
15255
|
+
case "webp":
|
|
15256
|
+
return "image/webp";
|
|
15257
|
+
default:
|
|
15258
|
+
return void 0;
|
|
15259
|
+
}
|
|
15260
|
+
}
|
|
15261
|
+
var hasPortableSegments = (resource) => resource.split("/").every((segment) => !/[. ]$/u.test(segment));
|
|
15262
|
+
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");
|
|
15263
|
+
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) => {
|
|
15264
|
+
const { username, password } = new URL(value);
|
|
15265
|
+
return !username && !password && !/[\\\s]/u.test(value);
|
|
15266
|
+
}, "URL must not contain credentials, backslashes, or whitespace");
|
|
15267
|
+
function localizedText(text2) {
|
|
15268
|
+
return external_exports.strictObject({ en: text2, "zh-CN": text2 });
|
|
15269
|
+
}
|
|
15270
|
+
var desktopExtensionLocalizedTextSchema = localizedText(external_exports.string().trim().min(1));
|
|
15271
|
+
var categoriesSchema = external_exports.array(desktopExtensionCategorySchema).max(desktopExtensionCategorySchema.options.length).refine((categories) => new Set(categories).size === categories.length, "Duplicate categories");
|
|
15272
|
+
var slotsSchema = external_exports.array(desktopExtensionSlotSchema).max(desktopExtensionSlotSchema.options.length).refine((slots) => new Set(slots).size === slots.length, "Duplicate slots");
|
|
15273
|
+
var settingField = {
|
|
15274
|
+
key: external_exports.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/u),
|
|
15275
|
+
label: desktopExtensionLocalizedTextSchema,
|
|
15276
|
+
description: desktopExtensionLocalizedTextSchema.optional()
|
|
15277
|
+
};
|
|
15278
|
+
var numericSetting = {
|
|
15279
|
+
...settingField,
|
|
15280
|
+
step: external_exports.number().positive().optional(),
|
|
15281
|
+
default: external_exports.number().optional()
|
|
15282
|
+
};
|
|
15283
|
+
var settingOption = external_exports.strictObject({
|
|
15284
|
+
value: external_exports.string(),
|
|
15285
|
+
label: desktopExtensionLocalizedTextSchema
|
|
15286
|
+
});
|
|
15287
|
+
var desktopExtensionSettingFieldSchema = external_exports.discriminatedUnion("type", [
|
|
15288
|
+
external_exports.strictObject({
|
|
15289
|
+
...settingField,
|
|
15290
|
+
type: external_exports.literal("boolean"),
|
|
15291
|
+
default: external_exports.boolean().optional()
|
|
15292
|
+
}),
|
|
15293
|
+
external_exports.strictObject({
|
|
15294
|
+
...settingField,
|
|
15295
|
+
type: external_exports.literal("string"),
|
|
15296
|
+
placeholder: desktopExtensionLocalizedTextSchema.optional(),
|
|
15297
|
+
default: external_exports.string().optional()
|
|
15298
|
+
}),
|
|
15299
|
+
external_exports.strictObject({
|
|
15300
|
+
...numericSetting,
|
|
15301
|
+
type: external_exports.literal("number"),
|
|
15302
|
+
min: external_exports.number().optional(),
|
|
15303
|
+
max: external_exports.number().optional()
|
|
15304
|
+
}),
|
|
15305
|
+
external_exports.strictObject({
|
|
15306
|
+
...numericSetting,
|
|
15307
|
+
type: external_exports.literal("range"),
|
|
15308
|
+
min: external_exports.number(),
|
|
15309
|
+
max: external_exports.number()
|
|
15310
|
+
}),
|
|
15311
|
+
external_exports.strictObject({
|
|
15312
|
+
...settingField,
|
|
15313
|
+
type: external_exports.literal("select"),
|
|
15314
|
+
options: external_exports.array(settingOption).min(1),
|
|
15315
|
+
default: external_exports.string().optional()
|
|
15316
|
+
})
|
|
15317
|
+
]).superRefine((field2, ctx) => {
|
|
15318
|
+
const issue2 = (path6, message) => ctx.addIssue({ code: "custom", path: [path6], message });
|
|
15319
|
+
if (field2.type === "number" || field2.type === "range") {
|
|
15320
|
+
const { min = -Infinity, max = Infinity, default: value } = field2;
|
|
15321
|
+
if (min > max)
|
|
15322
|
+
issue2("max", "Must be at least min");
|
|
15323
|
+
if (value !== void 0 && (value < min || value > max))
|
|
15324
|
+
issue2("default", "Must be within min and max");
|
|
15325
|
+
} else if (field2.type === "select") {
|
|
15326
|
+
const values = new Set(field2.options.map(({ value }) => value));
|
|
15327
|
+
if (values.size !== field2.options.length)
|
|
15328
|
+
issue2("options", "Duplicate option values");
|
|
15329
|
+
if (field2.default !== void 0 && !values.has(field2.default))
|
|
15330
|
+
issue2("default", "Must match an option value");
|
|
15331
|
+
}
|
|
15332
|
+
});
|
|
15333
|
+
var manifestHeader = external_exports.object({
|
|
15334
|
+
manifestVersion: external_exports.int().positive(),
|
|
15335
|
+
id: desktopExtensionIdSchema,
|
|
15336
|
+
name: external_exports.union([extensionName, localizedText(extensionName)]),
|
|
15337
|
+
version: external_exports.string().min(1).max(128),
|
|
15338
|
+
desktopApi: external_exports.int().positive()
|
|
15339
|
+
}).passthrough();
|
|
15340
|
+
var desktopExtensionManifestSchema = manifestHeader.extend({
|
|
15341
|
+
manifestVersion: external_exports.literal(1),
|
|
15342
|
+
desktopApi: external_exports.literal(DESKTOP_EXTENSION_API_VERSION),
|
|
15343
|
+
description: external_exports.strictObject({ en: external_exports.string().max(4096), "zh-CN": external_exports.string().max(4096).optional() }).optional(),
|
|
15344
|
+
author: external_exports.string().trim().min(1).max(128).optional(),
|
|
15345
|
+
repository: desktopExtensionHttpUrlSchema.optional(),
|
|
15346
|
+
details: external_exports.strictObject({ en: external_exports.string().max(16384), "zh-CN": external_exports.string().max(16384).optional() }).optional(),
|
|
15347
|
+
icon: imagePathSchema.optional(),
|
|
15348
|
+
screenshots: external_exports.array(imagePathSchema).max(DESKTOP_EXTENSION_SCREENSHOT_LIMIT).refine((screenshots) => new Set(screenshots).size === screenshots.length, "Duplicate screenshots").optional(),
|
|
15349
|
+
desktop: external_exports.strictObject({
|
|
15350
|
+
script: pluginRelativeResourceSchema,
|
|
15351
|
+
style: pluginRelativeResourceSchema.optional()
|
|
15352
|
+
}).optional(),
|
|
15353
|
+
backend: external_exports.strictObject({ script: pluginRelativeResourceSchema.refine(hasPortableSegments) }).optional(),
|
|
15354
|
+
slots: slotsSchema.default(() => []),
|
|
15355
|
+
settingsSchema: external_exports.array(desktopExtensionSettingFieldSchema).max(32).refine((fields) => new Set(fields.map(({ key }) => key)).size === fields.length, "Duplicate setting keys").optional(),
|
|
15356
|
+
categories: categoriesSchema.optional()
|
|
15357
|
+
}).strict().refine((manifest) => manifest.desktop !== void 0 || manifest.backend !== void 0, "Expected at least one desktop or backend entry");
|
|
15358
|
+
var desktopExtensionHashSchema = external_exports.string().regex(/^[a-f0-9]{64}$/u);
|
|
15359
|
+
var desktopExtensionStatusSchema = external_exports.strictObject({
|
|
15360
|
+
state: external_exports.enum([
|
|
15361
|
+
"running",
|
|
15362
|
+
"disabled",
|
|
15363
|
+
"invalid",
|
|
15364
|
+
"incompatible",
|
|
15365
|
+
"conflict",
|
|
15366
|
+
"failed",
|
|
15367
|
+
"waiting"
|
|
15368
|
+
]),
|
|
15369
|
+
hash: desktopExtensionHashSchema.optional(),
|
|
15370
|
+
error: external_exports.string().optional(),
|
|
15371
|
+
conflictWith: desktopExtensionIdSchema.optional()
|
|
15372
|
+
});
|
|
15373
|
+
var desktopExtensionsDiagnosticSchema = external_exports.strictObject({
|
|
15374
|
+
controllerPid: external_exports.int().positive(),
|
|
15375
|
+
targetId: external_exports.string().nullable(),
|
|
15376
|
+
updatedAt: external_exports.iso.datetime(),
|
|
15377
|
+
handledReloadToken: external_exports.uuid().optional(),
|
|
15378
|
+
extensions: external_exports.record(external_exports.string(), desktopExtensionStatusSchema),
|
|
15379
|
+
surfaces: external_exports.record(external_exports.string(), desktopExtensionStatusSchema).optional()
|
|
15407
15380
|
});
|
|
15408
|
-
var
|
|
15409
|
-
|
|
15410
|
-
|
|
15411
|
-
}
|
|
15412
|
-
var
|
|
15413
|
-
|
|
15414
|
-
|
|
15381
|
+
var desktopExtensionTrustTierSchema = external_exports.enum(["official", "community"]);
|
|
15382
|
+
function isGitHubDesktopExtensionZipballUrl(url2) {
|
|
15383
|
+
return url2.origin === "https://api.github.com" && /^\/repos\/[\w-]+\/[\w.-]+\/zipball(?:\/[^/]+)?\/?$/u.test(url2.pathname);
|
|
15384
|
+
}
|
|
15385
|
+
var desktopExtensionZipUrlSchema = desktopExtensionHttpUrlSchema.refine((input2) => {
|
|
15386
|
+
const url2 = new URL(input2);
|
|
15387
|
+
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);
|
|
15388
|
+
}, "Expected a .zip download URL or a GitHub zipball URL");
|
|
15389
|
+
var desktopExtensionCatalogEntrySchema = external_exports.strictObject({
|
|
15390
|
+
id: desktopExtensionIdSchema,
|
|
15391
|
+
version: external_exports.string().trim().min(1).max(128),
|
|
15392
|
+
name: desktopExtensionLocalizedTextSchema.extend({ en: extensionName, "zh-CN": extensionName }),
|
|
15393
|
+
description: localizedText(external_exports.string().trim().min(1).max(4096)),
|
|
15394
|
+
details: localizedText(external_exports.string().trim().min(1).max(16384)).optional(),
|
|
15395
|
+
author: external_exports.string().trim().min(1).max(128),
|
|
15396
|
+
repository: desktopExtensionHttpUrlSchema,
|
|
15397
|
+
stars: external_exports.number().int().min(0).optional(),
|
|
15398
|
+
downloads: external_exports.number().int().min(0).optional(),
|
|
15399
|
+
categories: categoriesSchema.optional(),
|
|
15400
|
+
trustTier: desktopExtensionTrustTierSchema.default("community"),
|
|
15401
|
+
icon: desktopExtensionHttpUrlSchema.optional(),
|
|
15402
|
+
screenshots: external_exports.array(desktopExtensionHttpUrlSchema).max(DESKTOP_EXTENSION_SCREENSHOT_LIMIT).optional(),
|
|
15403
|
+
downloadUrl: desktopExtensionZipUrlSchema,
|
|
15404
|
+
sha256: desktopExtensionHashSchema,
|
|
15405
|
+
slots: slotsSchema.optional(),
|
|
15406
|
+
publishedAt: external_exports.string().optional(),
|
|
15407
|
+
updatedAt: external_exports.string().optional(),
|
|
15408
|
+
minCodexHostVersion: external_exports.string().optional()
|
|
15409
|
+
});
|
|
15410
|
+
var desktopExtensionCatalogSchema = external_exports.strictObject({
|
|
15411
|
+
schemaVersion: external_exports.literal(1),
|
|
15412
|
+
generatedAt: external_exports.string(),
|
|
15413
|
+
extensions: external_exports.array(desktopExtensionCatalogEntrySchema).refine((entries) => new Set(entries.map(({ id: id2 }) => id2)).size === entries.length, "Duplicate extension IDs")
|
|
15414
|
+
});
|
|
15415
|
+
var desktopExtensionBackendMethodSchema = external_exports.string().trim().min(1).max(128);
|
|
15416
|
+
|
|
15417
|
+
// ../../shared-contracts/dist/host-extensions.js
|
|
15418
|
+
var reservedName = /^(?:con|prn|aux|nul|com[1-9¹²³]|lpt[1-9¹²³]) *(?:\.|$)/iu;
|
|
15419
|
+
var HOST_EXTENSION_PAGE_API_VERSION = 1;
|
|
15420
|
+
var hostExtensionIdSchema = desktopExtensionIdSchema.refine((id2) => !reservedName.test(id2), "Reserved extension ID");
|
|
15421
|
+
var hostExtensionTargetSchema = external_exports.enum(["desktop", "web"]);
|
|
15422
|
+
var hostExtensionDigestSchema = desktopExtensionHashSchema;
|
|
15423
|
+
var hostExtensionActivationIdSchema = external_exports.uuid();
|
|
15424
|
+
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((path6) => path6.split("/").length <= 32, "Extension resources may be at most 32 segments deep");
|
|
15425
|
+
var legacy = desktopExtensionManifestSchema.shape;
|
|
15426
|
+
var localized = (max, min = 0) => external_exports.strictObject({
|
|
15427
|
+
en: external_exports.string().trim().min(min).max(max),
|
|
15428
|
+
"zh-CN": external_exports.string().trim().min(min).max(max)
|
|
15429
|
+
});
|
|
15430
|
+
var resourceWithSuffix = (suffix) => hostExtensionResourcePathSchema.refine((path6) => path6.endsWith(suffix), `Expected a ${suffix} file`);
|
|
15431
|
+
var moduleEntry = resourceWithSuffix(".mjs");
|
|
15432
|
+
var style = resourceWithSuffix(".css").optional();
|
|
15433
|
+
var hostExtensionCanonicalPath = (path6) => path6.normalize("NFC").toLowerCase();
|
|
15434
|
+
var hostExtensionManifestV2Schema = external_exports.strictObject({
|
|
15435
|
+
manifestVersion: external_exports.literal(2),
|
|
15436
|
+
id: hostExtensionIdSchema,
|
|
15437
|
+
name: localized(128, 1),
|
|
15438
|
+
version: external_exports.string().trim().min(1).max(128),
|
|
15439
|
+
description: localized(4096),
|
|
15440
|
+
details: localized(16384).optional(),
|
|
15441
|
+
author: legacy.author,
|
|
15442
|
+
repository: legacy.repository,
|
|
15443
|
+
icon: legacy.icon.refine((path6) => path6 === void 0 || hostExtensionResourcePathSchema.safeParse(path6).success),
|
|
15444
|
+
screenshots: legacy.screenshots.refine((paths) => paths === void 0 || paths.every((path6) => hostExtensionResourcePathSchema.safeParse(path6).success)),
|
|
15445
|
+
categories: legacy.categories,
|
|
15446
|
+
settingsSchema: legacy.settingsSchema,
|
|
15447
|
+
slots: legacy.slots.removeDefault().optional(),
|
|
15448
|
+
page: external_exports.strictObject({
|
|
15449
|
+
apiVersion: external_exports.literal(HOST_EXTENSION_PAGE_API_VERSION),
|
|
15450
|
+
entry: moduleEntry,
|
|
15451
|
+
style,
|
|
15452
|
+
title: localized(128, 1).optional()
|
|
15453
|
+
}).optional(),
|
|
15454
|
+
widget: external_exports.strictObject({
|
|
15455
|
+
apiVersion: external_exports.literal(HOST_EXTENSION_PAGE_API_VERSION),
|
|
15456
|
+
entry: moduleEntry,
|
|
15457
|
+
style
|
|
15458
|
+
}).optional(),
|
|
15459
|
+
desktop: external_exports.strictObject({ apiVersion: external_exports.literal(1), script: resourceWithSuffix(".js"), style }).optional(),
|
|
15460
|
+
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(),
|
|
15461
|
+
backend: external_exports.strictObject({ apiVersion: external_exports.literal(1), entry: moduleEntry }).optional()
|
|
15462
|
+
}).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" });
|
|
15463
|
+
function targetsForCapabilities({ hasPage, hasWidget, hasDesktop, hasWeb, hasBackend }) {
|
|
15464
|
+
if (hasPage || hasWidget || hasBackend && !hasDesktop && !hasWeb)
|
|
15465
|
+
return ["desktop", "web"];
|
|
15466
|
+
const targets = [];
|
|
15467
|
+
if (hasDesktop)
|
|
15468
|
+
targets.push("desktop");
|
|
15469
|
+
if (hasWeb)
|
|
15470
|
+
targets.push("web");
|
|
15471
|
+
return targets;
|
|
15472
|
+
}
|
|
15473
|
+
var hostExtensionBackendMethodSchema = desktopExtensionBackendMethodSchema;
|
|
15474
|
+
|
|
15475
|
+
// ../../shared-contracts/dist/host-extension-management.js
|
|
15476
|
+
var HOST_EXTENSION_ZIP_MAX_BYTES = DESKTOP_EXTENSION_ZIP_MAX_BYTES;
|
|
15477
|
+
var hostExtensionRevisionSchema = external_exports.int().nonnegative();
|
|
15478
|
+
var hostExtensionConfigurationSchema = external_exports.strictObject({
|
|
15479
|
+
revision: hostExtensionRevisionSchema,
|
|
15480
|
+
enabled: external_exports.array(hostExtensionIdSchema).max(DESKTOP_EXTENSION_LIMIT).refine((ids) => new Set(ids).size === ids.length, "Duplicate extension IDs")
|
|
15481
|
+
});
|
|
15482
|
+
var { downloadUrl, ...catalogMetadata } = desktopExtensionCatalogEntrySchema.shape;
|
|
15483
|
+
var hostExtensionCatalogEntrySchema = external_exports.object({
|
|
15484
|
+
...catalogMetadata,
|
|
15485
|
+
id: hostExtensionIdSchema,
|
|
15486
|
+
format: external_exports.literal("codexhost"),
|
|
15487
|
+
targets: external_exports.array(hostExtensionTargetSchema).min(1).max(2).refine((targets) => new Set(targets).size === targets.length, "Duplicate targets"),
|
|
15488
|
+
apis: external_exports.strictObject({
|
|
15489
|
+
page: external_exports.int().positive().optional(),
|
|
15490
|
+
widget: external_exports.int().positive().optional(),
|
|
15491
|
+
desktop: external_exports.int().positive().optional(),
|
|
15492
|
+
web: external_exports.int().positive().optional(),
|
|
15493
|
+
backend: external_exports.int().positive().optional()
|
|
15494
|
+
}),
|
|
15495
|
+
downloadUrl: downloadUrl.refine((url2) => url2.startsWith("https://"), "Expected HTTPS")
|
|
15496
|
+
}).refine(({ targets, apis }) => {
|
|
15497
|
+
const derived = targetsForCapabilities({
|
|
15498
|
+
hasPage: Boolean(apis.page),
|
|
15499
|
+
hasWidget: Boolean(apis.widget),
|
|
15500
|
+
hasDesktop: Boolean(apis.desktop),
|
|
15501
|
+
hasWeb: Boolean(apis.web),
|
|
15502
|
+
hasBackend: Boolean(apis.backend)
|
|
15503
|
+
});
|
|
15504
|
+
return targets.length === derived.length && derived.every((target2) => targets.includes(target2));
|
|
15505
|
+
}, "Catalog targets must match the declared APIs");
|
|
15506
|
+
var hostExtensionCatalogSchema = external_exports.object({
|
|
15507
|
+
schemaVersion: external_exports.literal(2),
|
|
15508
|
+
generatedAt: external_exports.string().min(1),
|
|
15509
|
+
extensions: external_exports.array(hostExtensionCatalogEntrySchema).max(1e4).refine((entries) => new Set(entries.map(({ id: id2 }) => id2)).size === entries.length, "Duplicate extension IDs")
|
|
15510
|
+
});
|
|
15511
|
+
var hostExtensionsCatalogResultSchema = hostExtensionCatalogSchema.extend({
|
|
15512
|
+
catalogUrl: desktopExtensionHttpUrlSchema,
|
|
15513
|
+
fetchedAt: external_exports.iso.datetime(),
|
|
15514
|
+
cached: external_exports.boolean()
|
|
15515
|
+
});
|
|
15516
|
+
var id = { id: hostExtensionIdSchema };
|
|
15517
|
+
var active = {
|
|
15518
|
+
...id,
|
|
15519
|
+
activationId: hostExtensionActivationIdSchema,
|
|
15520
|
+
digest: hostExtensionDigestSchema
|
|
15521
|
+
};
|
|
15522
|
+
var optionalActivation = { ...id, activationId: active.activationId.optional() };
|
|
15523
|
+
var filePath = external_exports.string().min(1).max(4096).refine((path6) => /^(?:\/|[a-z]:[/\\])/iu.test(path6) && !path6.includes("\0") && !path6.split(/[/\\]/u).some((part) => part === "." || part === ".."), "Expected an absolute local path without dot segments");
|
|
15524
|
+
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");
|
|
15525
|
+
function base643(maxBytes) {
|
|
15526
|
+
return external_exports.string().max(4 * Math.ceil(maxBytes / 3)).refine((value) => {
|
|
15527
|
+
const padding = value.endsWith("==") ? 2 : value.endsWith("=") ? 1 : 0;
|
|
15528
|
+
return value.length % 4 === 0 && value.length * 3 / 4 - padding <= maxBytes && /^[A-Za-z0-9+/]*={0,2}$/u.test(value);
|
|
15529
|
+
}, "Expected bounded standard padded base64");
|
|
15530
|
+
}
|
|
15531
|
+
var hostExtensionGitHubSourceSchema = external_exports.strictObject({
|
|
15532
|
+
type: external_exports.literal("github"),
|
|
15533
|
+
repository: external_exports.string().max(150).regex(/^[a-z0-9-]+\/[a-z0-9_-][a-z0-9_.-]*$/iu),
|
|
15534
|
+
ref: gitRef.optional(),
|
|
15535
|
+
tag: gitRef.optional(),
|
|
15536
|
+
asset: external_exports.string().max(255).regex(/^[a-z0-9_.-]+\.zip$/iu).optional(),
|
|
15537
|
+
subpath: hostExtensionResourcePathSchema.optional()
|
|
15538
|
+
}).refine(({ ref, tag, asset }) => !ref || !tag && !asset, "Use either a zipball ref or a release tag/asset");
|
|
15539
|
+
var hostExtensionInstallSourceSchema = external_exports.union([
|
|
15540
|
+
external_exports.strictObject({ type: external_exports.literal("catalog"), ...id }),
|
|
15541
|
+
hostExtensionGitHubSourceSchema,
|
|
15542
|
+
external_exports.strictObject({ type: external_exports.literal("zip"), base64: base643(HOST_EXTENSION_ZIP_MAX_BYTES).min(4) }),
|
|
15543
|
+
external_exports.strictObject({ type: external_exports.literal("zip"), localZipPath: filePath }),
|
|
15544
|
+
external_exports.strictObject({ type: external_exports.literal("localDir"), localDir: filePath })
|
|
15415
15545
|
]);
|
|
15416
|
-
var
|
|
15417
|
-
|
|
15418
|
-
|
|
15419
|
-
|
|
15420
|
-
|
|
15421
|
-
purpose: external_exports.literal("availability").optional()
|
|
15422
|
-
}).strict();
|
|
15423
|
-
var harnessWebUiOpenParamsSchema = external_exports.object({
|
|
15424
|
-
harnessId: harnessIdSchema
|
|
15425
|
-
}).strict();
|
|
15426
|
-
var harnessWebUiOpenResultSchema = external_exports.object({}).strict();
|
|
15427
|
-
var threadModelSelectParamsSchema = external_exports.object({
|
|
15428
|
-
threadId: hostThreadIdSchema,
|
|
15429
|
-
model: harnessModelRefSchema
|
|
15430
|
-
}).strict();
|
|
15431
|
-
var threadThinkingSelectParamsSchema = external_exports.object({
|
|
15432
|
-
threadId: hostThreadIdSchema,
|
|
15433
|
-
thinkingOptionId: harnessThinkingOptionIdSchema
|
|
15434
|
-
}).strict();
|
|
15435
|
-
var threadInspectionParamsSchema = external_exports.object({
|
|
15436
|
-
threadId: hostThreadIdSchema,
|
|
15437
|
-
includeReferenceCapability: external_exports.boolean().optional()
|
|
15438
|
-
}).strict();
|
|
15439
|
-
var codexThreadInspectionSchema = external_exports.object({
|
|
15440
|
-
owner: external_exports.literal("codex"),
|
|
15441
|
-
locked: external_exports.boolean(),
|
|
15442
|
-
effectiveModel: harnessModelRefSchema.optional(),
|
|
15443
|
-
resolvedModelLabel: harnessResolvedModelLabelSchema.optional(),
|
|
15444
|
-
effectiveThinkingOptionId: harnessThinkingOptionIdSchema.optional(),
|
|
15445
|
-
effectivePermissionModeId: harnessPermissionModeIdSchema.optional(),
|
|
15446
|
-
history: harnessHistoryCapabilitiesSchema.optional(),
|
|
15447
|
-
supportsThreadReferences: external_exports.literal(true).optional()
|
|
15448
|
-
}).strict();
|
|
15449
|
-
var externalThreadInspectionSchema = external_exports.object({
|
|
15450
|
-
owner: external_exports.literal("external"),
|
|
15451
|
-
harnessId: nonBlankTextSchema2.max(256),
|
|
15452
|
-
transportModelId: nonBlankTextSchema2.max(1024),
|
|
15453
|
-
effectiveModel: harnessModelRefSchema.optional(),
|
|
15454
|
-
resolvedModelLabel: harnessResolvedModelLabelSchema.optional(),
|
|
15455
|
-
effectiveThinkingOptionId: harnessThinkingOptionIdSchema.optional(),
|
|
15456
|
-
availableThinkingOptions: harnessThinkingOptionsSchema.optional(),
|
|
15457
|
-
effectivePermissionModeId: harnessPermissionModeIdSchema.optional(),
|
|
15458
|
-
history: harnessHistoryCapabilitiesSchema,
|
|
15459
|
-
usage: threadUsageSnapshotSchema.optional(),
|
|
15460
|
-
locked: external_exports.literal(true)
|
|
15461
|
-
}).strict();
|
|
15462
|
-
var threadInspectionSchema = external_exports.discriminatedUnion("owner", [
|
|
15463
|
-
codexThreadInspectionSchema,
|
|
15464
|
-
externalThreadInspectionSchema
|
|
15546
|
+
var hostExtensionProvenanceSchema = external_exports.discriminatedUnion("type", [
|
|
15547
|
+
external_exports.strictObject({ type: external_exports.literal("catalog"), ...id }),
|
|
15548
|
+
hostExtensionGitHubSourceSchema,
|
|
15549
|
+
external_exports.strictObject({ type: external_exports.literal("zip") }),
|
|
15550
|
+
external_exports.strictObject({ type: external_exports.literal("localDir") })
|
|
15465
15551
|
]);
|
|
15466
|
-
var
|
|
15467
|
-
|
|
15468
|
-
|
|
15469
|
-
|
|
15470
|
-
|
|
15471
|
-
if (seen.has(threadId)) {
|
|
15472
|
-
context.addIssue({
|
|
15473
|
-
code: "custom",
|
|
15474
|
-
message: "Thread ownership-list IDs must be unique",
|
|
15475
|
-
path: ["threadIds", index]
|
|
15476
|
-
});
|
|
15477
|
-
}
|
|
15478
|
-
seen.add(threadId);
|
|
15479
|
-
}
|
|
15552
|
+
var hostExtensionInstallationSchema = external_exports.strictObject({
|
|
15553
|
+
...active,
|
|
15554
|
+
manifest: hostExtensionManifestV2Schema,
|
|
15555
|
+
installedAt: external_exports.iso.datetime(),
|
|
15556
|
+
source: hostExtensionProvenanceSchema.optional()
|
|
15480
15557
|
});
|
|
15481
|
-
var
|
|
15482
|
-
|
|
15483
|
-
|
|
15484
|
-
|
|
15485
|
-
|
|
15486
|
-
|
|
15487
|
-
|
|
15488
|
-
|
|
15489
|
-
|
|
15490
|
-
|
|
15491
|
-
|
|
15492
|
-
|
|
15558
|
+
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);
|
|
15559
|
+
var desktopConflict = { desktopConflictWith: hostExtensionIdSchema.optional() };
|
|
15560
|
+
var backendState = external_exports.enum(["none", "inactive", "starting", "running", "failed"]);
|
|
15561
|
+
var hostExtensionListItemSchema = external_exports.discriminatedUnion("state", [
|
|
15562
|
+
hostExtensionInstallationSchema.extend({
|
|
15563
|
+
state: external_exports.literal("valid"),
|
|
15564
|
+
enabled: external_exports.boolean(),
|
|
15565
|
+
...desktopConflict,
|
|
15566
|
+
iconDataUrl: rasterDataUrlSchema(DESKTOP_EXTENSION_ICON_MAX_BYTES).optional(),
|
|
15567
|
+
screenshotDataUrls: external_exports.array(rasterDataUrlSchema(DESKTOP_EXTENSION_SCREENSHOT_MAX_BYTES)).max(DESKTOP_EXTENSION_SCREENSHOT_LIMIT).optional(),
|
|
15568
|
+
backendState: backendState.optional(),
|
|
15569
|
+
backendError: external_exports.string().optional()
|
|
15570
|
+
}),
|
|
15571
|
+
external_exports.strictObject({
|
|
15572
|
+
state: external_exports.enum(["invalid", "incompatible"]),
|
|
15573
|
+
id: external_exports.string().min(1),
|
|
15574
|
+
enabled: external_exports.boolean(),
|
|
15575
|
+
error: external_exports.string()
|
|
15576
|
+
})
|
|
15493
15577
|
]);
|
|
15494
|
-
var
|
|
15495
|
-
|
|
15496
|
-
|
|
15497
|
-
|
|
15498
|
-
|
|
15499
|
-
|
|
15500
|
-
|
|
15501
|
-
|
|
15502
|
-
|
|
15503
|
-
|
|
15504
|
-
|
|
15505
|
-
|
|
15506
|
-
|
|
15507
|
-
|
|
15578
|
+
var hostExtensionsListResultSchema = external_exports.strictObject({
|
|
15579
|
+
revision: hostExtensionRevisionSchema,
|
|
15580
|
+
configuration: hostExtensionConfigurationSchema,
|
|
15581
|
+
diagnostics: external_exports.array(external_exports.string()),
|
|
15582
|
+
extensions: external_exports.array(hostExtensionListItemSchema)
|
|
15583
|
+
});
|
|
15584
|
+
var hostExtensionRuntimeEntrySchema = hostExtensionInstallationSchema.extend({
|
|
15585
|
+
...desktopConflict,
|
|
15586
|
+
settingsRevision: hostExtensionRevisionSchema
|
|
15587
|
+
});
|
|
15588
|
+
var hostExtensionsSnapshotResultSchema = external_exports.strictObject({
|
|
15589
|
+
/** The Host publishes this revision in extensions-changed, independent of enabled.json's revision. */
|
|
15590
|
+
revision: hostExtensionRevisionSchema,
|
|
15591
|
+
// Enabled, valid activations only. A Desktop conflict does not hide other capabilities.
|
|
15592
|
+
extensions: external_exports.array(hostExtensionRuntimeEntrySchema).max(DESKTOP_EXTENSION_LIMIT)
|
|
15593
|
+
});
|
|
15594
|
+
var HOST_EXTENSIONS_RPC = {
|
|
15595
|
+
list: "codexhost/extensions/list",
|
|
15596
|
+
snapshot: "codexhost/extensions/snapshot",
|
|
15597
|
+
catalog: "codexhost/extensions/catalog",
|
|
15598
|
+
install: "codexhost/extensions/install",
|
|
15599
|
+
update: "codexhost/extensions/update",
|
|
15600
|
+
enable: "codexhost/extensions/enable",
|
|
15601
|
+
disable: "codexhost/extensions/disable",
|
|
15602
|
+
uninstall: "codexhost/extensions/uninstall",
|
|
15603
|
+
recover: "codexhost/extensions/recover",
|
|
15604
|
+
asset: "codexhost/extensions/asset",
|
|
15605
|
+
settingsGet: "codexhost/extensions/settings/get",
|
|
15606
|
+
settingsSet: "codexhost/extensions/settings/set",
|
|
15607
|
+
backendInvoke: "codexhost/extensions/backend/invoke"
|
|
15608
|
+
};
|
|
15609
|
+
var HOST_EXTENSION_MANAGEMENT_METHODS = Object.freeze(Object.values(HOST_EXTENSIONS_RPC));
|
|
15610
|
+
var methods = new Set(HOST_EXTENSION_MANAGEMENT_METHODS);
|
|
15611
|
+
var noParams = external_exports.strictObject({});
|
|
15612
|
+
var expectedRevision = { expectedRevision: hostExtensionRevisionSchema };
|
|
15613
|
+
var selection = external_exports.strictObject({ ...id, ...expectedRevision });
|
|
15614
|
+
var installationResult = hostExtensionInstallationSchema.extend({ replaced: external_exports.boolean() });
|
|
15615
|
+
var mutationResult = external_exports.discriminatedUnion("state", [
|
|
15616
|
+
external_exports.strictObject({ state: external_exports.literal("saved"), configuration: hostExtensionConfigurationSchema }),
|
|
15617
|
+
external_exports.strictObject({ state: external_exports.literal("revision-conflict"), revision: hostExtensionRevisionSchema })
|
|
15618
|
+
]);
|
|
15619
|
+
var hostExtensionsAssetParamsSchema = external_exports.strictObject({
|
|
15620
|
+
...optionalActivation,
|
|
15621
|
+
digest: active.digest.optional(),
|
|
15622
|
+
path: hostExtensionResourcePathSchema
|
|
15623
|
+
});
|
|
15624
|
+
var hostExtensionsAssetResultSchema = external_exports.strictObject({
|
|
15625
|
+
mimeType: external_exports.string().min(1),
|
|
15626
|
+
base64: base643(DESKTOP_EXTENSION_ASSET_MAX_BYTES),
|
|
15627
|
+
digest: active.digest
|
|
15628
|
+
});
|
|
15629
|
+
var hostExtensionSettingsSchema = external_exports.strictObject({
|
|
15630
|
+
settingsRevision: hostExtensionRevisionSchema,
|
|
15631
|
+
values: jsonObjectSchema
|
|
15508
15632
|
});
|
|
15509
|
-
var
|
|
15510
|
-
|
|
15511
|
-
|
|
15512
|
-
|
|
15513
|
-
|
|
15514
|
-
|
|
15515
|
-
|
|
15516
|
-
|
|
15517
|
-
|
|
15518
|
-
|
|
15519
|
-
|
|
15520
|
-
|
|
15521
|
-
|
|
15522
|
-
|
|
15523
|
-
|
|
15524
|
-
|
|
15525
|
-
|
|
15526
|
-
|
|
15527
|
-
|
|
15528
|
-
}
|
|
15529
|
-
|
|
15530
|
-
|
|
15531
|
-
|
|
15532
|
-
|
|
15633
|
+
var hostExtensionsRpcSchemas = {
|
|
15634
|
+
[HOST_EXTENSIONS_RPC.list]: { params: noParams, result: hostExtensionsListResultSchema },
|
|
15635
|
+
[HOST_EXTENSIONS_RPC.snapshot]: { params: noParams, result: hostExtensionsSnapshotResultSchema },
|
|
15636
|
+
[HOST_EXTENSIONS_RPC.catalog]: {
|
|
15637
|
+
params: external_exports.strictObject({ forceRefresh: external_exports.boolean().optional() }),
|
|
15638
|
+
result: hostExtensionsCatalogResultSchema
|
|
15639
|
+
},
|
|
15640
|
+
[HOST_EXTENSIONS_RPC.install]: {
|
|
15641
|
+
params: external_exports.strictObject({ source: hostExtensionInstallSourceSchema }),
|
|
15642
|
+
result: installationResult
|
|
15643
|
+
},
|
|
15644
|
+
[HOST_EXTENSIONS_RPC.update]: {
|
|
15645
|
+
params: external_exports.strictObject({
|
|
15646
|
+
...id,
|
|
15647
|
+
expectedDigest: active.digest,
|
|
15648
|
+
expectedActivationId: active.activationId.optional(),
|
|
15649
|
+
source: hostExtensionInstallSourceSchema.optional()
|
|
15650
|
+
}),
|
|
15651
|
+
result: installationResult
|
|
15652
|
+
},
|
|
15653
|
+
[HOST_EXTENSIONS_RPC.enable]: { params: selection, result: mutationResult },
|
|
15654
|
+
[HOST_EXTENSIONS_RPC.disable]: { params: selection, result: mutationResult },
|
|
15655
|
+
[HOST_EXTENSIONS_RPC.uninstall]: {
|
|
15656
|
+
params: external_exports.strictObject({
|
|
15657
|
+
...id,
|
|
15658
|
+
removeData: external_exports.boolean().optional(),
|
|
15659
|
+
expectedDigest: active.digest.optional()
|
|
15660
|
+
}),
|
|
15661
|
+
result: external_exports.strictObject({ ...id, removed: external_exports.boolean() })
|
|
15662
|
+
},
|
|
15663
|
+
[HOST_EXTENSIONS_RPC.recover]: {
|
|
15664
|
+
params: external_exports.strictObject({ expectedRevision: expectedRevision.expectedRevision.optional() }),
|
|
15665
|
+
result: mutationResult
|
|
15666
|
+
},
|
|
15667
|
+
[HOST_EXTENSIONS_RPC.asset]: {
|
|
15668
|
+
params: hostExtensionsAssetParamsSchema,
|
|
15669
|
+
result: hostExtensionsAssetResultSchema
|
|
15670
|
+
},
|
|
15671
|
+
[HOST_EXTENSIONS_RPC.settingsGet]: {
|
|
15672
|
+
params: external_exports.strictObject(optionalActivation),
|
|
15673
|
+
result: hostExtensionSettingsSchema
|
|
15674
|
+
},
|
|
15675
|
+
[HOST_EXTENSIONS_RPC.settingsSet]: {
|
|
15676
|
+
params: external_exports.strictObject({
|
|
15677
|
+
...optionalActivation,
|
|
15678
|
+
expectedSettingsRevision: hostExtensionRevisionSchema,
|
|
15679
|
+
values: jsonObjectSchema
|
|
15680
|
+
}),
|
|
15681
|
+
result: hostExtensionSettingsSchema
|
|
15682
|
+
},
|
|
15683
|
+
[HOST_EXTENSIONS_RPC.backendInvoke]: {
|
|
15684
|
+
params: external_exports.strictObject({
|
|
15685
|
+
...optionalActivation,
|
|
15686
|
+
method: hostExtensionBackendMethodSchema,
|
|
15687
|
+
params: jsonValueSchema.optional()
|
|
15688
|
+
}),
|
|
15689
|
+
result: external_exports.strictObject({ result: jsonValueSchema })
|
|
15690
|
+
}
|
|
15691
|
+
};
|
|
15533
15692
|
|
|
15534
15693
|
// ../../shared-contracts/dist/thread-archive-confirm.js
|
|
15535
15694
|
var THREAD_ARCHIVE_CONFIRM_METHOD = "codexhost/thread/archive/confirm";
|
|
@@ -15575,6 +15734,8 @@ var CLIENT_CHANNEL_METHODS = [
|
|
|
15575
15734
|
"codexhost/workspace/read",
|
|
15576
15735
|
"codexhost/thread/tree/read",
|
|
15577
15736
|
"codexhost/thread/pins/list",
|
|
15737
|
+
"codexhost/thread/sections/list",
|
|
15738
|
+
"codexhost/thread/sections/move",
|
|
15578
15739
|
"codexhost/thread/pins/set",
|
|
15579
15740
|
"codexhost/harness/plugins/list",
|
|
15580
15741
|
"codexhost/harness/inspect",
|
|
@@ -15592,7 +15753,7 @@ var CLIENT_CHANNEL_METHODS = [
|
|
|
15592
15753
|
"codexhost/harness/session-import/list",
|
|
15593
15754
|
"codexhost/harness/session-import/import",
|
|
15594
15755
|
// Host settings shared across Desktop and Web.
|
|
15595
|
-
...
|
|
15756
|
+
...HOST_EXTENSION_MANAGEMENT_METHODS,
|
|
15596
15757
|
"codexhost/harness/installation",
|
|
15597
15758
|
"codexhost/harness/installation/start",
|
|
15598
15759
|
"codexhost/harness/installation/status",
|
|
@@ -15613,8 +15774,21 @@ var CLIENT_CHANNEL_METHODS = [
|
|
|
15613
15774
|
"codexhost/update/check",
|
|
15614
15775
|
"codexhost/update/start",
|
|
15615
15776
|
"codexhost/update/status",
|
|
15777
|
+
"codexhost/announcement/get",
|
|
15778
|
+
"codexhost/announcement/acknowledge",
|
|
15616
15779
|
"codexhost/sessions/loaded/list"
|
|
15617
15780
|
];
|
|
15781
|
+
var clientThreadSectionsSchema = external_exports.object({
|
|
15782
|
+
sections: external_exports.array(external_exports.object({
|
|
15783
|
+
id: external_exports.string().min(1),
|
|
15784
|
+
name: external_exports.string().min(1),
|
|
15785
|
+
threads: external_exports.array(jsonObjectSchema)
|
|
15786
|
+
}).strict())
|
|
15787
|
+
}).strict();
|
|
15788
|
+
var clientThreadSectionMoveSchema = external_exports.object({
|
|
15789
|
+
threadId: external_exports.string().min(1).max(1024),
|
|
15790
|
+
sectionId: external_exports.string().min(1).max(1024).nullable()
|
|
15791
|
+
}).strict();
|
|
15618
15792
|
var clientThreadPinsSchema = external_exports.object({ threadIds: external_exports.array(external_exports.string().min(1)) }).strict();
|
|
15619
15793
|
var clientThreadPinParamsSchema = external_exports.object({ threadId: external_exports.string().min(1).max(1024), pinned: external_exports.boolean() }).strict();
|
|
15620
15794
|
var clientThreadTreeReadParamsSchema = external_exports.object({}).strict();
|
|
@@ -15653,6 +15827,11 @@ var clientChannelEventSchema = external_exports.discriminatedUnion("type", [
|
|
|
15653
15827
|
cursor: clientChannelCursorSchema,
|
|
15654
15828
|
revision: external_exports.number().int().nonnegative()
|
|
15655
15829
|
}),
|
|
15830
|
+
external_exports.object({
|
|
15831
|
+
type: external_exports.literal("extensions-changed"),
|
|
15832
|
+
cursor: clientChannelCursorSchema,
|
|
15833
|
+
revision: hostExtensionRevisionSchema
|
|
15834
|
+
}),
|
|
15656
15835
|
external_exports.object({
|
|
15657
15836
|
type: external_exports.literal("hello"),
|
|
15658
15837
|
version: external_exports.literal(1),
|
|
@@ -16089,7 +16268,7 @@ var DEFAULT_IDLE_RELEASE_SETTINGS = Object.freeze({
|
|
|
16089
16268
|
|
|
16090
16269
|
// ../../shared-contracts/dist/harness-preferences.js
|
|
16091
16270
|
var harnessPreferenceScopeSchema = external_exports.string().regex(/^external$/u);
|
|
16092
|
-
var preferenceHarnessKey = harnessIdSchema.transform((
|
|
16271
|
+
var preferenceHarnessKey = harnessIdSchema.transform((id2) => String(id2));
|
|
16093
16272
|
var harnessDefaultConfigurationSchema = external_exports.strictObject({
|
|
16094
16273
|
model: harnessModelRefSchema.optional(),
|
|
16095
16274
|
thinkingOptionId: harnessThinkingOptionIdSchema.optional(),
|
|
@@ -16099,11 +16278,19 @@ var newThreadDefaultsSchema = external_exports.strictObject({
|
|
|
16099
16278
|
lastHarness: harnessIdSchema.optional(),
|
|
16100
16279
|
byHarness: external_exports.record(preferenceHarnessKey, harnessDefaultConfigurationSchema)
|
|
16101
16280
|
});
|
|
16281
|
+
var harnessDelegationDefaultSchema = external_exports.strictObject({
|
|
16282
|
+
model: harnessModelRefSchema.optional(),
|
|
16283
|
+
thinkingOptionId: harnessThinkingOptionIdSchema.optional()
|
|
16284
|
+
}).refine((value) => Boolean(value.model || value.thinkingOptionId), "A delegation default must contain a Model or Thinking option");
|
|
16285
|
+
var delegationDefaultsSchema = external_exports.strictObject({
|
|
16286
|
+
byHarness: external_exports.record(preferenceHarnessKey, harnessDelegationDefaultSchema)
|
|
16287
|
+
});
|
|
16102
16288
|
var modelId = external_exports.string().min(1).max(1024);
|
|
16103
16289
|
var harnessPreferenceValuesSchema = external_exports.strictObject({
|
|
16104
16290
|
idleRelease: idleReleaseSettingsSchema.optional(),
|
|
16105
16291
|
favorites: external_exports.record(preferenceHarnessKey, external_exports.array(modelId).max(2048)).default({}),
|
|
16106
|
-
newThread: newThreadDefaultsSchema.optional()
|
|
16292
|
+
newThread: newThreadDefaultsSchema.optional(),
|
|
16293
|
+
delegation: delegationDefaultsSchema.optional()
|
|
16107
16294
|
});
|
|
16108
16295
|
var harnessPreferenceSnapshotSchema = external_exports.strictObject({
|
|
16109
16296
|
scope: harnessPreferenceScopeSchema,
|
|
@@ -16131,6 +16318,11 @@ var harnessPreferenceOperationSchema = external_exports.discriminatedUnion("kind
|
|
|
16131
16318
|
lastHarness: harnessIdSchema.optional(),
|
|
16132
16319
|
harnessId: harnessIdSchema.optional(),
|
|
16133
16320
|
configuration: harnessDefaultConfigurationSchema.optional()
|
|
16321
|
+
}),
|
|
16322
|
+
external_exports.strictObject({
|
|
16323
|
+
kind: external_exports.literal("delegation"),
|
|
16324
|
+
harnessId: harnessIdSchema,
|
|
16325
|
+
configuration: harnessDelegationDefaultSchema.nullable()
|
|
16134
16326
|
})
|
|
16135
16327
|
]);
|
|
16136
16328
|
var harnessPreferencePatchSchema = external_exports.strictObject({
|
|
@@ -16138,8 +16330,8 @@ var harnessPreferencePatchSchema = external_exports.strictObject({
|
|
|
16138
16330
|
operations: external_exports.array(harnessPreferenceOperationSchema).min(1).max(256),
|
|
16139
16331
|
initializeOnly: external_exports.boolean().optional(),
|
|
16140
16332
|
expectedRevision: external_exports.number().int().nonnegative().optional()
|
|
16141
|
-
}).superRefine((
|
|
16142
|
-
for (const operation of
|
|
16333
|
+
}).superRefine((input2, ctx) => {
|
|
16334
|
+
for (const operation of input2.operations) {
|
|
16143
16335
|
if (operation.kind === "newThread" && (!operation.lastHarness && !operation.configuration || Boolean(operation.harnessId) !== Boolean(operation.configuration)))
|
|
16144
16336
|
ctx.addIssue({
|
|
16145
16337
|
code: "custom",
|
|
@@ -16541,13 +16733,18 @@ var harnessLaunchSettingsSchema = external_exports.object({
|
|
|
16541
16733
|
// ../../shared-contracts/dist/harness-installation.js
|
|
16542
16734
|
var harnessInstallationParamsSchema = external_exports.object({
|
|
16543
16735
|
harnessId: harnessIdSchema,
|
|
16544
|
-
action: external_exports.enum(["check", "update", "install"])
|
|
16545
|
-
|
|
16736
|
+
action: external_exports.enum(["check", "update", "install"]),
|
|
16737
|
+
confirmedVersion: external_exports.string().min(1).max(128).optional()
|
|
16738
|
+
}).strict().refine(({ action, confirmedVersion }) => action === "update" || confirmedVersion === void 0);
|
|
16546
16739
|
var harnessInstallationStateSchema = external_exports.object({
|
|
16547
16740
|
currentVersion: external_exports.string().min(1).max(128),
|
|
16548
16741
|
latestVersion: external_exports.string().min(1).max(128),
|
|
16549
16742
|
updateAvailable: external_exports.boolean(),
|
|
16550
16743
|
canUpdate: external_exports.boolean(),
|
|
16744
|
+
/** Present when the Adapter has a verified list and the available target is outside it. */
|
|
16745
|
+
latestVerifiedVersion: external_exports.string().min(1).max(128).optional(),
|
|
16746
|
+
/** Update preflight stopped before running the installer; latestVersion needs confirmation. */
|
|
16747
|
+
confirmationRequired: external_exports.literal(true).optional(),
|
|
16551
16748
|
/** Defaults to CLI; some Harnesses ship only inside a desktop application. */
|
|
16552
16749
|
versionKind: external_exports.enum(["cli", "application"]).optional(),
|
|
16553
16750
|
/** Official download opened by the user; does not imply an automatic installation. */
|
|
@@ -16877,6 +17074,38 @@ var updateStatusResultSchema = external_exports.strictObject({
|
|
|
16877
17074
|
status: updateStatusSchema.nullable()
|
|
16878
17075
|
});
|
|
16879
17076
|
|
|
17077
|
+
// ../../shared-contracts/dist/release-announcement.js
|
|
17078
|
+
var RELEASE_ANNOUNCEMENT_MAX_THEMES = 12;
|
|
17079
|
+
var releaseAnnouncementThemeSchema = external_exports.strictObject({
|
|
17080
|
+
icon: external_exports.string().min(1).max(16).optional(),
|
|
17081
|
+
title: external_exports.string().min(1).max(120),
|
|
17082
|
+
body: external_exports.string().min(1).max(1200),
|
|
17083
|
+
contributors: external_exports.array(external_exports.string().min(1).max(39)).max(30)
|
|
17084
|
+
});
|
|
17085
|
+
var releaseAnnouncementContentSchema = external_exports.strictObject({
|
|
17086
|
+
summary: external_exports.string().min(1).max(600).optional(),
|
|
17087
|
+
themes: external_exports.array(releaseAnnouncementThemeSchema).min(1).max(RELEASE_ANNOUNCEMENT_MAX_THEMES)
|
|
17088
|
+
});
|
|
17089
|
+
var releaseAnnouncementSchema = external_exports.strictObject({
|
|
17090
|
+
version: updateSemanticVersionSchema,
|
|
17091
|
+
publishedAt: external_exports.iso.datetime(),
|
|
17092
|
+
url: external_exports.string().max(300).regex(/^https:\/\/github\.com\/BytePioneer-AI\/codex-host\/releases\/tag\/v[0-9A-Za-z.+-]+$/u),
|
|
17093
|
+
zh: releaseAnnouncementContentSchema.nullable(),
|
|
17094
|
+
en: releaseAnnouncementContentSchema.nullable()
|
|
17095
|
+
}).refine((value) => value.zh !== null || value.en !== null, {
|
|
17096
|
+
message: "an announcement needs at least one language"
|
|
17097
|
+
});
|
|
17098
|
+
var releaseAnnouncementGetParamsSchema = external_exports.strictObject({
|
|
17099
|
+
manual: external_exports.boolean().optional()
|
|
17100
|
+
});
|
|
17101
|
+
var releaseAnnouncementGetResultSchema = external_exports.strictObject({
|
|
17102
|
+
announcement: releaseAnnouncementSchema.nullable(),
|
|
17103
|
+
unread: external_exports.boolean()
|
|
17104
|
+
});
|
|
17105
|
+
var releaseAnnouncementAcknowledgeParamsSchema = external_exports.strictObject({
|
|
17106
|
+
version: updateSemanticVersionSchema
|
|
17107
|
+
});
|
|
17108
|
+
|
|
16880
17109
|
// ../../shared-contracts/dist/thread-watch-notice.js
|
|
16881
17110
|
var THREAD_WATCH_NOTICE_OUTCOMES = [
|
|
16882
17111
|
"completed",
|
|
@@ -16924,17 +17153,67 @@ var remoteSshSetupResultSchema = external_exports.object({ state: external_expor
|
|
|
16924
17153
|
|
|
16925
17154
|
// ../../shared-contracts/dist/remote-sessions.js
|
|
16926
17155
|
var REMOTE_CONTROLLER_REQUEST_MAX_BYTES = 16 * 1024;
|
|
16927
|
-
var
|
|
17156
|
+
var REMOTE_IDENTITY_MAX_LENGTH = 1024;
|
|
17157
|
+
var identity = external_exports.string().min(1).max(REMOTE_IDENTITY_MAX_LENGTH);
|
|
16928
17158
|
var target = { hostId: identity.regex(/^remote-(?:ssh(?:-|:)|control:)/u) };
|
|
16929
17159
|
var thread = { ...target, threadId: identity };
|
|
17160
|
+
var text = external_exports.string().min(1).max(8e3);
|
|
17161
|
+
var input = { text, requestId: identity };
|
|
17162
|
+
var remoteDeliveryReplySchema = external_exports.discriminatedUnion("accepted", [
|
|
17163
|
+
external_exports.object({ accepted: external_exports.literal(true), startQueuedItemId: identity.optional() }),
|
|
17164
|
+
external_exports.object({
|
|
17165
|
+
accepted: external_exports.literal(false),
|
|
17166
|
+
code: external_exports.enum([
|
|
17167
|
+
"remote/queue-unavailable",
|
|
17168
|
+
"remote/steer-unavailable",
|
|
17169
|
+
"remote/turn-changed",
|
|
17170
|
+
"remote/send-rejected",
|
|
17171
|
+
"session/queue-item-not-found",
|
|
17172
|
+
"session/queue-item-starting"
|
|
17173
|
+
]),
|
|
17174
|
+
message: external_exports.string()
|
|
17175
|
+
})
|
|
17176
|
+
]);
|
|
17177
|
+
var remoteQueueSnapshotSchema = external_exports.discriminatedUnion("available", [
|
|
17178
|
+
external_exports.object({ available: external_exports.literal(false) }),
|
|
17179
|
+
external_exports.object({
|
|
17180
|
+
available: external_exports.literal(true),
|
|
17181
|
+
items: external_exports.array(external_exports.object({ id: identity, clientUserMessageId: identity, preview: external_exports.string().max(801) })).max(100)
|
|
17182
|
+
})
|
|
17183
|
+
]);
|
|
16930
17184
|
var remoteSessionOperationSchema = external_exports.discriminatedUnion("kind", [
|
|
16931
17185
|
external_exports.strictObject({ kind: external_exports.literal("hosts") }),
|
|
17186
|
+
external_exports.strictObject({
|
|
17187
|
+
kind: external_exports.literal("create"),
|
|
17188
|
+
...target,
|
|
17189
|
+
cwd: external_exports.string().min(1).max(8192),
|
|
17190
|
+
epoch: identity
|
|
17191
|
+
}),
|
|
17192
|
+
external_exports.strictObject({ kind: external_exports.literal("projectHarnesses"), ...target, epoch: identity }),
|
|
17193
|
+
external_exports.strictObject({
|
|
17194
|
+
kind: external_exports.literal("inspectHarness"),
|
|
17195
|
+
...target,
|
|
17196
|
+
epoch: identity,
|
|
17197
|
+
cwd: external_exports.string().min(1).max(8192),
|
|
17198
|
+
harnessId: identity
|
|
17199
|
+
}),
|
|
17200
|
+
external_exports.strictObject({
|
|
17201
|
+
kind: external_exports.literal("startSelected"),
|
|
17202
|
+
...target,
|
|
17203
|
+
epoch: identity,
|
|
17204
|
+
cwd: external_exports.string().min(1).max(8192),
|
|
17205
|
+
harnessId: identity,
|
|
17206
|
+
model: external_exports.string().min(1).max(4096),
|
|
17207
|
+
serviceTier: external_exports.enum(["priority", "ultrafast"]).optional(),
|
|
17208
|
+
reasoningEffort: identity.optional()
|
|
17209
|
+
}),
|
|
16932
17210
|
external_exports.strictObject({ kind: external_exports.literal("status"), ...thread }),
|
|
16933
17211
|
external_exports.strictObject({
|
|
16934
17212
|
kind: external_exports.literal("list"),
|
|
16935
17213
|
...target,
|
|
16936
17214
|
cursor: external_exports.string().nullable(),
|
|
16937
|
-
archived: external_exports.boolean()
|
|
17215
|
+
archived: external_exports.boolean(),
|
|
17216
|
+
includeLoaded: external_exports.literal(true).optional()
|
|
16938
17217
|
}),
|
|
16939
17218
|
external_exports.strictObject({
|
|
16940
17219
|
kind: external_exports.literal("read"),
|
|
@@ -16954,16 +17233,35 @@ var remoteSessionOperationSchema = external_exports.discriminatedUnion("kind", [
|
|
|
16954
17233
|
...thread,
|
|
16955
17234
|
epoch: identity,
|
|
16956
17235
|
modelId: identity.optional(),
|
|
17236
|
+
serviceTier: harnessModelServiceTierSchema.optional(),
|
|
16957
17237
|
thinkingOptionId: identity.optional(),
|
|
16958
17238
|
permissionModeId: identity.optional()
|
|
16959
|
-
}).refine((value) => [value.modelId, value.thinkingOptionId, value.permissionModeId].filter((v) => v !== void 0).length === 1, "Select exactly one remote setting"),
|
|
17239
|
+
}).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, {
|
|
17240
|
+
message: "A service tier requires a Model ID"
|
|
17241
|
+
}),
|
|
16960
17242
|
external_exports.strictObject({
|
|
16961
17243
|
kind: external_exports.literal("prompt"),
|
|
16962
17244
|
...thread,
|
|
16963
17245
|
epoch: identity,
|
|
16964
|
-
text
|
|
17246
|
+
text,
|
|
16965
17247
|
requestId: identity.optional()
|
|
16966
17248
|
}),
|
|
17249
|
+
external_exports.strictObject({ kind: external_exports.literal("queue"), ...thread, epoch: identity }),
|
|
17250
|
+
external_exports.strictObject({
|
|
17251
|
+
kind: external_exports.literal("delivery"),
|
|
17252
|
+
...thread,
|
|
17253
|
+
epoch: identity,
|
|
17254
|
+
action: external_exports.discriminatedUnion("kind", [
|
|
17255
|
+
external_exports.strictObject({ kind: external_exports.literal("enqueue"), ...input }),
|
|
17256
|
+
external_exports.strictObject({ kind: external_exports.literal("steer"), ...input, turnId: identity }),
|
|
17257
|
+
external_exports.strictObject({ kind: external_exports.literal("remove"), itemId: identity }),
|
|
17258
|
+
external_exports.strictObject({
|
|
17259
|
+
kind: external_exports.literal("start"),
|
|
17260
|
+
itemId: identity,
|
|
17261
|
+
onlyIfHead: external_exports.literal(true).optional()
|
|
17262
|
+
})
|
|
17263
|
+
])
|
|
17264
|
+
}),
|
|
16967
17265
|
external_exports.strictObject({ kind: external_exports.literal("interrupt"), ...thread, epoch: identity, turnId: identity }),
|
|
16968
17266
|
external_exports.strictObject({
|
|
16969
17267
|
kind: external_exports.literal("rename"),
|
|
@@ -17006,7 +17304,7 @@ var remoteConnectionsRequestSchema = external_exports.discriminatedUnion("action
|
|
|
17006
17304
|
external_exports.strictObject({ action: external_exports.literal("catalog") }),
|
|
17007
17305
|
external_exports.strictObject({
|
|
17008
17306
|
action: external_exports.literal("read-thread"),
|
|
17009
|
-
hostId: hostId.refine((
|
|
17307
|
+
hostId: hostId.refine((id2) => id2 !== "local"),
|
|
17010
17308
|
input: delegationReadParamsSchema
|
|
17011
17309
|
}),
|
|
17012
17310
|
external_exports.strictObject({
|
|
@@ -17020,7 +17318,7 @@ var remoteConnectionsRequestSchema = external_exports.discriminatedUnion("action
|
|
|
17020
17318
|
external_exports.strictObject({ action: external_exports.literal("runtime"), hostId }),
|
|
17021
17319
|
external_exports.strictObject({
|
|
17022
17320
|
action: external_exports.literal("update"),
|
|
17023
|
-
hostId: hostId.refine((
|
|
17321
|
+
hostId: hostId.refine((id2) => id2 !== "local"),
|
|
17024
17322
|
version: remoteUpdateParamsSchema.shape.version
|
|
17025
17323
|
})
|
|
17026
17324
|
]);
|
|
@@ -17084,7 +17382,7 @@ function invalidRequest(message) {
|
|
|
17084
17382
|
return { code: "invalidRequest", message, retryable: false };
|
|
17085
17383
|
}
|
|
17086
17384
|
function validateHostApprovalResponse(interaction, response) {
|
|
17087
|
-
return interaction.actions.some(({ id }) =>
|
|
17385
|
+
return interaction.actions.some(({ id: id2 }) => id2 === response.actionId) ? null : invalidRequest("Approval Response contains an undeclared action ID");
|
|
17088
17386
|
}
|
|
17089
17387
|
|
|
17090
17388
|
// ../../harness-adapter/dist/question.js
|
|
@@ -17092,7 +17390,7 @@ function invalidRequest2(message) {
|
|
|
17092
17390
|
return { code: "invalidRequest", message, retryable: false };
|
|
17093
17391
|
}
|
|
17094
17392
|
function validateHostQuestionResponse(interaction, response) {
|
|
17095
|
-
const questionIds = new Set(interaction.questions.map(({ id }) =>
|
|
17393
|
+
const questionIds = new Set(interaction.questions.map(({ id: id2 }) => id2));
|
|
17096
17394
|
if (response.cancelled) {
|
|
17097
17395
|
return Object.keys(response.answers).length === 0 ? null : invalidRequest2("Cancelled Question Response must not contain answers");
|
|
17098
17396
|
}
|
|
@@ -17140,6 +17438,18 @@ function validateHostInteractionResponse(interaction, response) {
|
|
|
17140
17438
|
return response.type === "approval" ? validateHostApprovalResponse(interaction, response) : invalidRequest3("Interaction Response type does not match the pending Interaction");
|
|
17141
17439
|
}
|
|
17142
17440
|
|
|
17441
|
+
// ../../harness-adapter/dist/legacy-model-ref.js
|
|
17442
|
+
import { Buffer as Buffer2 } from "node:buffer";
|
|
17443
|
+
function normalizeLegacyBase64ModelRef(ref, catalog, prefix) {
|
|
17444
|
+
if (ref.serviceTier || !ref.id.startsWith(prefix))
|
|
17445
|
+
return void 0;
|
|
17446
|
+
const encoded = ref.id.slice(prefix.length);
|
|
17447
|
+
const id2 = Buffer2.from(encoded, "base64url").toString("utf8");
|
|
17448
|
+
if (Buffer2.from(id2).toString("base64url") !== encoded)
|
|
17449
|
+
return void 0;
|
|
17450
|
+
return catalog.models.find(({ ref: ref2 }) => ref2.id === id2 && !ref2.serviceTier)?.ref;
|
|
17451
|
+
}
|
|
17452
|
+
|
|
17143
17453
|
// ../../harness-adapter/dist/output-channel.js
|
|
17144
17454
|
var HarnessOutputChannel = class {
|
|
17145
17455
|
outputs;
|
|
@@ -17212,7 +17522,8 @@ var tokenFields = [
|
|
|
17212
17522
|
var safeIntegerFields = [
|
|
17213
17523
|
"planFiveHourResetsAtUnix",
|
|
17214
17524
|
"planSevenDayResetsAtUnix",
|
|
17215
|
-
"timeToFirstOutputMs"
|
|
17525
|
+
"timeToFirstOutputMs",
|
|
17526
|
+
"latestRequestTimeToFirstOutputMs"
|
|
17216
17527
|
];
|
|
17217
17528
|
var percentFields = [
|
|
17218
17529
|
"cacheHitRatePercent",
|
|
@@ -17291,7 +17602,10 @@ function devinModes(info) {
|
|
|
17291
17602
|
throw new Error("Devin returned no usable permission mode catalog");
|
|
17292
17603
|
return harnessPermissionModeCatalogSchema.parse({ modes, defaultModeId: current });
|
|
17293
17604
|
}
|
|
17294
|
-
var devinModelRef = (nativeId) => harnessModelRefSchema.parse({ id:
|
|
17605
|
+
var devinModelRef = (nativeId) => harnessModelRefSchema.parse({ id: nativeId });
|
|
17606
|
+
function normalizeStoredDevinModelRef(ref, catalog) {
|
|
17607
|
+
return normalizeLegacyBase64ModelRef(ref, catalog, "devin.");
|
|
17608
|
+
}
|
|
17295
17609
|
function devinModels(info) {
|
|
17296
17610
|
const option = info.configOptions?.find((option2) => option2.category === "model") ?? info.configOptions?.find((option2) => option2.id === "model");
|
|
17297
17611
|
if (!option || option.type !== "select")
|
|
@@ -17336,23 +17650,22 @@ function devinCatalog(info) {
|
|
|
17336
17650
|
ref: devinModelRef(model2.value),
|
|
17337
17651
|
label: model2.name,
|
|
17338
17652
|
// ACP describes the active Model's options, not all other Models' capabilities.
|
|
17339
|
-
...model2.value === native.current ? { supportedThinkingOptionIds: thinking.options.map(({ id }) =>
|
|
17653
|
+
...model2.value === native.current ? { supportedThinkingOptionIds: thinking.options.map(({ id: id2 }) => id2) } : {}
|
|
17340
17654
|
}));
|
|
17341
17655
|
if (!models.length)
|
|
17342
17656
|
throw new Error("Devin returned no model catalog");
|
|
17343
17657
|
const current = native.current;
|
|
17344
17658
|
return {
|
|
17345
17659
|
models,
|
|
17346
|
-
|
|
17660
|
+
defaultModel: devinModelRef(current),
|
|
17347
17661
|
thinkingOptions: thinking.options,
|
|
17348
17662
|
...thinking.current ? { defaultThinkingOptionId: thinking.current } : {}
|
|
17349
17663
|
};
|
|
17350
17664
|
}
|
|
17351
17665
|
function devinNativeModel(info, ref) {
|
|
17352
|
-
|
|
17353
|
-
if (!native)
|
|
17666
|
+
if (!devinModels(info).models.some((model2) => model2.value === ref))
|
|
17354
17667
|
throw new Error("Model is not in this Devin session's native catalog");
|
|
17355
|
-
return
|
|
17668
|
+
return ref;
|
|
17356
17669
|
}
|
|
17357
17670
|
|
|
17358
17671
|
// dist/transport.js
|
|
@@ -19211,8 +19524,8 @@ var RequestResponder = class {
|
|
|
19211
19524
|
signal;
|
|
19212
19525
|
finishRequest;
|
|
19213
19526
|
didRespond = false;
|
|
19214
|
-
constructor(
|
|
19215
|
-
this.id =
|
|
19527
|
+
constructor(id2, sendResult, signal = new AbortController().signal, finishRequest) {
|
|
19528
|
+
this.id = id2;
|
|
19216
19529
|
this.sendResult = sendResult;
|
|
19217
19530
|
this.signal = signal;
|
|
19218
19531
|
this.finishRequest = finishRequest;
|
|
@@ -19503,7 +19816,7 @@ var Connection = class {
|
|
|
19503
19816
|
return this.sendWireMessage({ jsonrpc: "2.0", method, params });
|
|
19504
19817
|
}
|
|
19505
19818
|
prepareRequest(method, params, mapResponse, options = {}) {
|
|
19506
|
-
const
|
|
19819
|
+
const id2 = this.nextRequestId++;
|
|
19507
19820
|
let cancel = () => {
|
|
19508
19821
|
};
|
|
19509
19822
|
const response = new Promise((resolve, reject) => {
|
|
@@ -19523,7 +19836,7 @@ var Connection = class {
|
|
|
19523
19836
|
}
|
|
19524
19837
|
pendingResponse.cancellationSent = true;
|
|
19525
19838
|
pendingResponse.cleanup?.();
|
|
19526
|
-
void this.sendCancelRequest(
|
|
19839
|
+
void this.sendCancelRequest(id2).catch(() => {
|
|
19527
19840
|
});
|
|
19528
19841
|
};
|
|
19529
19842
|
options.cancellationSignal?.addEventListener("abort", cancel, {
|
|
@@ -19532,12 +19845,12 @@ var Connection = class {
|
|
|
19532
19845
|
pendingResponse.cleanup = () => {
|
|
19533
19846
|
options.cancellationSignal?.removeEventListener("abort", cancel);
|
|
19534
19847
|
};
|
|
19535
|
-
this.pendingResponses.set(
|
|
19848
|
+
this.pendingResponses.set(id2, pendingResponse);
|
|
19536
19849
|
});
|
|
19537
19850
|
response.catch(() => {
|
|
19538
19851
|
});
|
|
19539
19852
|
return {
|
|
19540
|
-
message: { jsonrpc: "2.0", id, method, params },
|
|
19853
|
+
message: { jsonrpc: "2.0", id: id2, method, params },
|
|
19541
19854
|
response,
|
|
19542
19855
|
cancel: () => cancel()
|
|
19543
19856
|
};
|
|
@@ -20045,7 +20358,7 @@ var LineBuffer = class {
|
|
|
20045
20358
|
};
|
|
20046
20359
|
|
|
20047
20360
|
// ../../../node_modules/@agentclientprotocol/sdk/dist/stream.js
|
|
20048
|
-
function ndJsonStream(output,
|
|
20361
|
+
function ndJsonStream(output, input2) {
|
|
20049
20362
|
const textEncoder = new TextEncoder();
|
|
20050
20363
|
const textDecoder = new TextDecoder();
|
|
20051
20364
|
let cancelled = false;
|
|
@@ -20068,7 +20381,7 @@ function ndJsonStream(output, input) {
|
|
|
20068
20381
|
}
|
|
20069
20382
|
}
|
|
20070
20383
|
};
|
|
20071
|
-
const reader =
|
|
20384
|
+
const reader = input2.getReader();
|
|
20072
20385
|
inputReader = reader;
|
|
20073
20386
|
try {
|
|
20074
20387
|
while (true) {
|
|
@@ -20151,8 +20464,8 @@ var zGuardCreateElicitationResponseCancel = object({
|
|
|
20151
20464
|
});
|
|
20152
20465
|
|
|
20153
20466
|
// ../../../node_modules/@agentclientprotocol/sdk/dist/acp.js
|
|
20154
|
-
function ndJsonStream2(output,
|
|
20155
|
-
return ndJsonStream(output,
|
|
20467
|
+
function ndJsonStream2(output, input2) {
|
|
20468
|
+
return ndJsonStream(output, input2);
|
|
20156
20469
|
}
|
|
20157
20470
|
function emptyObjectResponse(response) {
|
|
20158
20471
|
return response ?? {};
|
|
@@ -20174,7 +20487,7 @@ function memoryStreamPair() {
|
|
|
20174
20487
|
}
|
|
20175
20488
|
];
|
|
20176
20489
|
}
|
|
20177
|
-
var
|
|
20490
|
+
var methods2 = {
|
|
20178
20491
|
agent: {
|
|
20179
20492
|
initialize: AGENT_METHODS.initialize,
|
|
20180
20493
|
authenticate: AGENT_METHODS.authenticate,
|
|
@@ -21546,10 +21859,10 @@ function executableExtensions(command, platform, environment) {
|
|
|
21546
21859
|
return [""];
|
|
21547
21860
|
return (environmentValue(environment, "PATHEXT") ?? ".COM;.EXE;.BAT;.CMD").split(";").map((extension) => extension.trim()).filter(Boolean);
|
|
21548
21861
|
}
|
|
21549
|
-
function isExecutableFile(
|
|
21862
|
+
function isExecutableFile(filePath2, platform) {
|
|
21550
21863
|
try {
|
|
21551
|
-
fs.accessSync(
|
|
21552
|
-
return fs.statSync(
|
|
21864
|
+
fs.accessSync(filePath2, platform === "win32" ? fs.constants.F_OK : fs.constants.X_OK);
|
|
21865
|
+
return fs.statSync(filePath2).isFile();
|
|
21553
21866
|
} catch {
|
|
21554
21867
|
return false;
|
|
21555
21868
|
}
|
|
@@ -21647,8 +21960,8 @@ var VERSION_MANAGER_ROOTS = "<version-managers>";
|
|
|
21647
21960
|
function installRootExtensions(platform) {
|
|
21648
21961
|
return platform === "win32" ? [".exe", ".cmd"] : [""];
|
|
21649
21962
|
}
|
|
21650
|
-
function resolveHomeDirectory(
|
|
21651
|
-
return
|
|
21963
|
+
function resolveHomeDirectory(input2) {
|
|
21964
|
+
return input2.homeDirectory ?? environmentValue(input2.environment, "HOME") ?? environmentValue(input2.environment, "USERPROFILE") ?? os.homedir();
|
|
21652
21965
|
}
|
|
21653
21966
|
function templateVariables(environment, platform, home) {
|
|
21654
21967
|
const pathFlavor = targetPath(platform);
|
|
@@ -21681,36 +21994,36 @@ function expandInstallRoot(template, environment, platform, home) {
|
|
|
21681
21994
|
});
|
|
21682
21995
|
return unresolved ? void 0 : joinTemplate(platform, substituted);
|
|
21683
21996
|
}
|
|
21684
|
-
function installRootDirectories(spec,
|
|
21997
|
+
function installRootDirectories(spec, input2, dependencies, platform, home) {
|
|
21685
21998
|
const templates = (platform === "win32" ? spec.installRoots?.windows : spec.installRoots?.posix) ?? [];
|
|
21686
21999
|
const directories = [];
|
|
21687
22000
|
for (const template of templates) {
|
|
21688
22001
|
if (template === VERSION_MANAGER_ROOTS) {
|
|
21689
22002
|
directories.push(...versionManagerBinaryDirectories({
|
|
21690
22003
|
platform,
|
|
21691
|
-
environment:
|
|
22004
|
+
environment: input2.environment,
|
|
21692
22005
|
home,
|
|
21693
22006
|
...dependencies.subdirectories ? { subdirectories: dependencies.subdirectories } : {}
|
|
21694
22007
|
}));
|
|
21695
22008
|
continue;
|
|
21696
22009
|
}
|
|
21697
|
-
const directory = expandInstallRoot(template,
|
|
22010
|
+
const directory = expandInstallRoot(template, input2.environment, platform, home);
|
|
21698
22011
|
if (directory !== void 0)
|
|
21699
22012
|
directories.push(directory);
|
|
21700
22013
|
}
|
|
21701
22014
|
return directories;
|
|
21702
22015
|
}
|
|
21703
|
-
function harnessCandidates(spec,
|
|
21704
|
-
const platform =
|
|
22016
|
+
function harnessCandidates(spec, input2, dependencies = {}) {
|
|
22017
|
+
const platform = input2.platform ?? process.platform;
|
|
21705
22018
|
const pathFlavor = targetPath(platform);
|
|
21706
|
-
const configured =
|
|
22019
|
+
const configured = input2.command ?? (spec.commandEnvironmentVariable ? environmentValue(input2.environment, spec.commandEnvironmentVariable) : void 0);
|
|
21707
22020
|
const command = configured ?? spec.command;
|
|
21708
22021
|
if (pathFlavor.isAbsolute(command) || command.includes("/") || command.includes("\\")) {
|
|
21709
22022
|
return [{ candidate: command, source: "configured" }];
|
|
21710
22023
|
}
|
|
21711
22024
|
const candidates = [];
|
|
21712
|
-
const extensions = executableExtensions(command, platform,
|
|
21713
|
-
for (const directory of pathDirectories(
|
|
22025
|
+
const extensions = executableExtensions(command, platform, input2.environment);
|
|
22026
|
+
for (const directory of pathDirectories(input2.environment, platform)) {
|
|
21714
22027
|
for (const extension of extensions) {
|
|
21715
22028
|
candidates.push({
|
|
21716
22029
|
candidate: pathFlavor.join(directory, command + extension),
|
|
@@ -21720,8 +22033,8 @@ function harnessCandidates(spec, input, dependencies = {}) {
|
|
|
21720
22033
|
}
|
|
21721
22034
|
if (configured !== void 0)
|
|
21722
22035
|
return candidates;
|
|
21723
|
-
const home = resolveHomeDirectory(
|
|
21724
|
-
for (const directory of installRootDirectories(spec,
|
|
22036
|
+
const home = resolveHomeDirectory(input2);
|
|
22037
|
+
for (const directory of installRootDirectories(spec, input2, dependencies, platform, home)) {
|
|
21725
22038
|
for (const extension of installRootExtensions(platform)) {
|
|
21726
22039
|
candidates.push({
|
|
21727
22040
|
candidate: pathFlavor.join(directory, spec.command + extension),
|
|
@@ -21731,12 +22044,12 @@ function harnessCandidates(spec, input, dependencies = {}) {
|
|
|
21731
22044
|
}
|
|
21732
22045
|
return candidates;
|
|
21733
22046
|
}
|
|
21734
|
-
function resolveHarnessExecutable(spec,
|
|
21735
|
-
const platform =
|
|
22047
|
+
function resolveHarnessExecutable(spec, input2, dependencies = {}) {
|
|
22048
|
+
const platform = input2.platform ?? process.platform;
|
|
21736
22049
|
const isExecutable = dependencies.isExecutable ?? ((candidate) => isExecutableFile(candidate, platform));
|
|
21737
22050
|
const runnable = spec.runnableCandidate ?? ((candidate) => candidate);
|
|
21738
22051
|
const context = { platform, isExecutable };
|
|
21739
|
-
for (const { candidate, source } of harnessCandidates(spec,
|
|
22052
|
+
for (const { candidate, source } of harnessCandidates(spec, input2, dependencies)) {
|
|
21740
22053
|
const executable = runnable(candidate, context);
|
|
21741
22054
|
if (executable !== void 0 && isExecutable(executable))
|
|
21742
22055
|
return { executable, source };
|
|
@@ -22891,13 +23204,13 @@ var DevinTransport = class {
|
|
|
22891
23204
|
throw new Error("Devin session is not open");
|
|
22892
23205
|
return this.#bounded(this.#connection.setSessionConfigOption({ sessionId: this.sessionId, configId, value }));
|
|
22893
23206
|
}
|
|
22894
|
-
async prompt(
|
|
23207
|
+
async prompt(text2, callbacks) {
|
|
22895
23208
|
if (!this.#connection || this.#closed || this.#callbacks)
|
|
22896
23209
|
throw new Error("Devin session is closed or busy");
|
|
22897
23210
|
this.#callbacks = callbacks;
|
|
22898
23211
|
try {
|
|
22899
23212
|
return await Promise.race([
|
|
22900
|
-
this.#connection.prompt({ sessionId: this.sessionId, prompt: [{ type: "text", text }] }),
|
|
23213
|
+
this.#connection.prompt({ sessionId: this.sessionId, prompt: [{ type: "text", text: text2 }] }),
|
|
22901
23214
|
this.#failed
|
|
22902
23215
|
]);
|
|
22903
23216
|
} finally {
|
|
@@ -23001,9 +23314,9 @@ function projectCandidate(row) {
|
|
|
23001
23314
|
running: rowIsLocked(row)
|
|
23002
23315
|
};
|
|
23003
23316
|
}
|
|
23004
|
-
async function listDevinSessionCandidates(
|
|
23317
|
+
async function listDevinSessionCandidates(input2) {
|
|
23005
23318
|
const candidates = [];
|
|
23006
|
-
for (const row of await listDevinSessions(
|
|
23319
|
+
for (const row of await listDevinSessions(input2.connection)) {
|
|
23007
23320
|
if (typeof row.sessionId !== "string" || row.sessionId.length === 0)
|
|
23008
23321
|
continue;
|
|
23009
23322
|
const candidate = projectCandidate(row);
|
|
@@ -23012,8 +23325,8 @@ async function listDevinSessionCandidates(input) {
|
|
|
23012
23325
|
}
|
|
23013
23326
|
return candidates;
|
|
23014
23327
|
}
|
|
23015
|
-
async function resolveDevinSessionCandidate(
|
|
23016
|
-
const row = (await listDevinSessions(
|
|
23328
|
+
async function resolveDevinSessionCandidate(input2) {
|
|
23329
|
+
const row = (await listDevinSessions(input2.connection)).find(({ sessionId }) => sessionId === input2.nativeSessionId);
|
|
23017
23330
|
if (!row)
|
|
23018
23331
|
return null;
|
|
23019
23332
|
const candidate = projectCandidate(row);
|
|
@@ -23426,9 +23739,9 @@ function createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr, oldHeader
|
|
|
23426
23739
|
} }));
|
|
23427
23740
|
}
|
|
23428
23741
|
}
|
|
23429
|
-
function splitLines(
|
|
23430
|
-
const hasTrailingNl =
|
|
23431
|
-
const result =
|
|
23742
|
+
function splitLines(text2) {
|
|
23743
|
+
const hasTrailingNl = text2.endsWith("\n");
|
|
23744
|
+
const result = text2.split("\n").map((line) => line + "\n");
|
|
23432
23745
|
if (hasTrailingNl) {
|
|
23433
23746
|
result.pop();
|
|
23434
23747
|
} else {
|
|
@@ -23539,11 +23852,11 @@ var DevinTurnOutput = class {
|
|
|
23539
23852
|
const { item } = tool;
|
|
23540
23853
|
if (update.content != null) {
|
|
23541
23854
|
tool.changes = devinFileChanges(update.content);
|
|
23542
|
-
const
|
|
23855
|
+
const text2 = update.content.flatMap((content) => content.type === "content" && content.content.type === "text" ? [content.content.text] : content.type === "diff" ? [`${content.path}
|
|
23543
23856
|
${content.newText}`] : []).join("\n");
|
|
23544
23857
|
item.output = {
|
|
23545
|
-
content: [{ type: "text", text:
|
|
23546
|
-
truncated:
|
|
23858
|
+
content: [{ type: "text", text: text2.slice(0, TOOL_OUTPUT_LIMIT) }],
|
|
23859
|
+
truncated: text2.length > TOOL_OUTPUT_LIMIT
|
|
23547
23860
|
};
|
|
23548
23861
|
this.emit({
|
|
23549
23862
|
type: "item.updated",
|
|
@@ -23616,12 +23929,12 @@ function devinSnapshot(sessionId, replay) {
|
|
|
23616
23929
|
const key = devinReplayTurnKey(notification);
|
|
23617
23930
|
if (!key)
|
|
23618
23931
|
throw new Error("Devin replay user message has no stable native identity");
|
|
23619
|
-
const
|
|
23932
|
+
const text2 = notification.update.content.type === "text" ? notification.update.content.text : "";
|
|
23620
23933
|
const last = groups.at(-1);
|
|
23621
23934
|
if (last && last.key === key)
|
|
23622
|
-
last.text +=
|
|
23935
|
+
last.text += text2;
|
|
23623
23936
|
else
|
|
23624
|
-
groups.push({ key, text, events: [] });
|
|
23937
|
+
groups.push({ key, text: text2, events: [] });
|
|
23625
23938
|
} else
|
|
23626
23939
|
groups.at(-1)?.events.push(notification);
|
|
23627
23940
|
}
|
|
@@ -23808,17 +24121,17 @@ function comparable(snapshot) {
|
|
|
23808
24121
|
return { ...turn, nativeTurnKey: nativeTurnRef.nativeTurnKey };
|
|
23809
24122
|
});
|
|
23810
24123
|
}
|
|
23811
|
-
async function deriveDevinHistory(
|
|
24124
|
+
async function deriveDevinHistory(input2, source, options) {
|
|
23812
24125
|
if (!source.nativeHistory)
|
|
23813
24126
|
throw new DevinHistoryError("unsupported", "Devin did not negotiate the native revert extension");
|
|
23814
|
-
const cwd = path4.resolve(
|
|
24127
|
+
const cwd = path4.resolve(input2.cwd);
|
|
23815
24128
|
if (path4.resolve(source.options.cwd) !== cwd)
|
|
23816
24129
|
throw new DevinHistoryError("unsupported", "Devin cross-cwd history derivation is not supported");
|
|
23817
24130
|
await source.verifyCwd(cwd);
|
|
23818
24131
|
const before = await readHistory(source);
|
|
23819
24132
|
let count2;
|
|
23820
|
-
if (
|
|
23821
|
-
const index = before.snapshot.turns.findIndex((turn) => turn.checkpoint?.checkpointId ===
|
|
24133
|
+
if (input2.kind === "fork") {
|
|
24134
|
+
const index = before.snapshot.turns.findIndex((turn) => turn.checkpoint?.checkpointId === input2.checkpoint.checkpointId);
|
|
23822
24135
|
if (index < 0)
|
|
23823
24136
|
throw new DevinHistoryError("checkpointNotFound", "Devin checkpoint is not on the source history");
|
|
23824
24137
|
count2 = index + 1;
|
|
@@ -23837,10 +24150,10 @@ async function deriveDevinHistory(input, source, options) {
|
|
|
23837
24150
|
const response = await source.historyRequest("forkFromStep", {
|
|
23838
24151
|
stepId: checkpoint.checkpointId
|
|
23839
24152
|
});
|
|
23840
|
-
const
|
|
23841
|
-
if (typeof
|
|
24153
|
+
const id2 = response?.forkedSessionId;
|
|
24154
|
+
if (typeof id2 !== "string" || !id2.trim() || id2 === source.sessionId)
|
|
23842
24155
|
throw new Error("Devin fork did not return an independent native Session ID");
|
|
23843
|
-
childId =
|
|
24156
|
+
childId = id2;
|
|
23844
24157
|
}
|
|
23845
24158
|
const info = await child.open(childId);
|
|
23846
24159
|
childId = child.sessionId;
|
|
@@ -23885,6 +24198,7 @@ function rejected(code, message) {
|
|
|
23885
24198
|
}
|
|
23886
24199
|
var DevinAdapter = class {
|
|
23887
24200
|
options;
|
|
24201
|
+
normalizeStoredModelRef = normalizeStoredDevinModelRef;
|
|
23888
24202
|
harnessId = harnessIdSchema.parse("devin");
|
|
23889
24203
|
sessionImport = {
|
|
23890
24204
|
listCandidates: () => this.#listImportCandidates(),
|
|
@@ -23893,6 +24207,7 @@ var DevinAdapter = class {
|
|
|
23893
24207
|
#sessions = /* @__PURE__ */ new Set();
|
|
23894
24208
|
#probes = /* @__PURE__ */ new Set();
|
|
23895
24209
|
#inspections = /* @__PURE__ */ new Map();
|
|
24210
|
+
#inspectionTasks = /* @__PURE__ */ new Set();
|
|
23896
24211
|
#closed = false;
|
|
23897
24212
|
#closePromise;
|
|
23898
24213
|
constructor(options = {}) {
|
|
@@ -23906,21 +24221,25 @@ var DevinAdapter = class {
|
|
|
23906
24221
|
...this.options.timeoutMs ? { timeoutMs: this.options.timeoutMs } : {}
|
|
23907
24222
|
};
|
|
23908
24223
|
}
|
|
23909
|
-
async inspect(
|
|
24224
|
+
async inspect(input2 = {}) {
|
|
23910
24225
|
if (this.#closed)
|
|
23911
24226
|
return {
|
|
23912
24227
|
status: "unavailable",
|
|
23913
24228
|
error: { code: "unavailable", message: "Devin adapter is closed", retryable: false }
|
|
23914
24229
|
};
|
|
23915
|
-
const cwd = path5.resolve(
|
|
23916
|
-
const key =
|
|
23917
|
-
if (input.purpose === "availability" && input.refresh && !this.#inspections.get(cwd)?.pending)
|
|
23918
|
-
this.#inspections.delete(cwd);
|
|
24230
|
+
const cwd = path5.resolve(input2.cwd ?? process.cwd());
|
|
24231
|
+
const key = input2.purpose === "availability" ? JSON.stringify([cwd, input2.purpose]) : cwd;
|
|
23919
24232
|
const cached2 = this.#inspections.get(key);
|
|
23920
|
-
if (
|
|
23921
|
-
|
|
24233
|
+
if (input2.refresh) {
|
|
24234
|
+
this.#inspections.clear();
|
|
24235
|
+
if (cached2 && this.#inspectionTasks.has(cached2))
|
|
24236
|
+
this.#inspections.set(key, cached2);
|
|
24237
|
+
}
|
|
24238
|
+
const current = this.#inspections.get(key);
|
|
24239
|
+
if (current)
|
|
24240
|
+
return current;
|
|
23922
24241
|
const result = (async () => {
|
|
23923
|
-
if (
|
|
24242
|
+
if (input2.purpose === "availability") {
|
|
23924
24243
|
try {
|
|
23925
24244
|
return await this.#withProbeConnection(async (transport2) => {
|
|
23926
24245
|
await transport2.listSessions();
|
|
@@ -23965,55 +24284,53 @@ var DevinAdapter = class {
|
|
|
23965
24284
|
await transport.close();
|
|
23966
24285
|
}
|
|
23967
24286
|
})();
|
|
23968
|
-
|
|
23969
|
-
this.#
|
|
23970
|
-
void result.finally(() =>
|
|
23971
|
-
entry.pending = false;
|
|
23972
|
-
});
|
|
24287
|
+
this.#inspections.set(key, result);
|
|
24288
|
+
this.#inspectionTasks.add(result);
|
|
24289
|
+
void result.finally(() => this.#inspectionTasks.delete(result));
|
|
23973
24290
|
return result;
|
|
23974
24291
|
}
|
|
23975
|
-
async open(
|
|
24292
|
+
async open(input2) {
|
|
23976
24293
|
if (this.#closed)
|
|
23977
24294
|
return rejected("invalidState", "Devin adapter is closed");
|
|
23978
|
-
if (
|
|
24295
|
+
if (input2.kind === "resume" && input2.nativeRef.harnessId !== this.harnessId)
|
|
23979
24296
|
return rejected("invalidRequest", "Session belongs to another Harness");
|
|
23980
|
-
if (
|
|
24297
|
+
if (input2.kind === "create" && input2.executionPolicy === "unattended-full-access" && input2.permissionModeId !== void 0 && input2.permissionModeId !== "bypass")
|
|
23981
24298
|
return rejected("invalidRequest", "unattended-full-access requires Devin bypass mode");
|
|
23982
|
-
const options = this.transportOptions(
|
|
24299
|
+
const options = this.transportOptions(input2.cwd, input2.environment);
|
|
23983
24300
|
let transport;
|
|
23984
24301
|
let session;
|
|
23985
24302
|
try {
|
|
23986
24303
|
let info;
|
|
23987
|
-
if (
|
|
23988
|
-
({ transport, info } = await this.#derive(
|
|
24304
|
+
if (input2.kind === "fork" || input2.kind === "rollbackLastTurn") {
|
|
24305
|
+
({ transport, info } = await this.#derive(input2));
|
|
23989
24306
|
} else {
|
|
23990
24307
|
transport = new DevinTransport(options);
|
|
23991
|
-
info = await transport.open(
|
|
24308
|
+
info = await transport.open(input2.kind === "resume" ? input2.nativeRef.nativeSessionId : void 0);
|
|
23992
24309
|
}
|
|
23993
|
-
if (
|
|
24310
|
+
if (input2.kind === "resume") {
|
|
23994
24311
|
const sessionId = transport.sessionId;
|
|
23995
24312
|
const known = new Set(devinSnapshot(transport.sessionId, transport.replay).turns.map((turn) => turn.nativeTurnRef.nativeTurnKey));
|
|
23996
|
-
if (
|
|
24313
|
+
if (input2.knownTurnRefs?.some((ref) => ref.harnessId !== this.harnessId || ref.nativeSessionId !== sessionId || !known.has(ref.nativeTurnKey)))
|
|
23997
24314
|
throw new Error("Saved Devin turn identity no longer exists in native history");
|
|
23998
24315
|
}
|
|
23999
24316
|
const openedSession = new DevinSession(transport, info, () => {
|
|
24000
24317
|
this.#sessions.delete(openedSession);
|
|
24001
|
-
},
|
|
24318
|
+
}, input2.kind === "create");
|
|
24002
24319
|
session = openedSession;
|
|
24003
|
-
if ("model" in
|
|
24004
|
-
const selected = await session.execute({ type: "model.select", model:
|
|
24320
|
+
if ("model" in input2 && input2.model) {
|
|
24321
|
+
const selected = await session.execute({ type: "model.select", model: input2.model });
|
|
24005
24322
|
if (!selected.ok)
|
|
24006
24323
|
throw new DevinHistoryError(selected.error.code, selected.error.message);
|
|
24007
24324
|
}
|
|
24008
|
-
if ("thinkingOptionId" in
|
|
24325
|
+
if ("thinkingOptionId" in input2 && input2.thinkingOptionId) {
|
|
24009
24326
|
const selected = await session.execute({
|
|
24010
24327
|
type: "thinking.select",
|
|
24011
|
-
thinkingOptionId:
|
|
24328
|
+
thinkingOptionId: input2.thinkingOptionId
|
|
24012
24329
|
});
|
|
24013
24330
|
if (!selected.ok)
|
|
24014
24331
|
throw new DevinHistoryError(selected.error.code, selected.error.message);
|
|
24015
24332
|
}
|
|
24016
|
-
const permissionModeId = ("permissionModeId" in
|
|
24333
|
+
const permissionModeId = ("permissionModeId" in input2 ? input2.permissionModeId : void 0) ?? (input2.kind === "create" && input2.executionPolicy === "unattended-full-access" ? harnessPermissionModeIdSchema.parse("bypass") : void 0);
|
|
24017
24334
|
if (permissionModeId) {
|
|
24018
24335
|
const selected = await session.execute({
|
|
24019
24336
|
type: "permissionMode.select",
|
|
@@ -24022,9 +24339,9 @@ var DevinAdapter = class {
|
|
|
24022
24339
|
if (!selected.ok)
|
|
24023
24340
|
throw new DevinHistoryError(selected.error.code, selected.error.message);
|
|
24024
24341
|
}
|
|
24025
|
-
if (
|
|
24342
|
+
if (input2.kind === "rollbackLastTurn") {
|
|
24026
24343
|
const state = session.initialState;
|
|
24027
|
-
if (
|
|
24344
|
+
if (input2.model && !isDeepStrictEqual2(state.effectiveModel, input2.model) || input2.thinkingOptionId && state.effectiveThinkingOptionId !== input2.thinkingOptionId || input2.permissionModeId && state.effectivePermissionModeId !== input2.permissionModeId)
|
|
24028
24345
|
throw new Error("Devin rollback did not preserve the requested configuration");
|
|
24029
24346
|
}
|
|
24030
24347
|
if (this.#closed)
|
|
@@ -24041,27 +24358,27 @@ var DevinAdapter = class {
|
|
|
24041
24358
|
} catch {
|
|
24042
24359
|
failure.message += "; session resource cleanup failed";
|
|
24043
24360
|
}
|
|
24044
|
-
if ((
|
|
24361
|
+
if ((input2.kind === "fork" || input2.kind === "rollbackLastTurn") && transport?.sessionId)
|
|
24045
24362
|
failure.message += `; native child ${transport.sessionId} may remain on disk (safe deletion unavailable)`;
|
|
24046
24363
|
failure.message = sanitizeDiagnosticTail(failure.message);
|
|
24047
24364
|
return { ok: false, error: failure };
|
|
24048
24365
|
}
|
|
24049
24366
|
}
|
|
24050
|
-
async #derive(
|
|
24051
|
-
if (
|
|
24367
|
+
async #derive(input2) {
|
|
24368
|
+
if (input2.sourceRef.harnessId !== this.harnessId)
|
|
24052
24369
|
throw new DevinHistoryError("invalidRequest", "Session belongs to another Harness");
|
|
24053
|
-
if (
|
|
24370
|
+
if (input2.kind === "fork" && (input2.checkpoint.harnessId !== this.harnessId || input2.checkpoint.nativeSessionId !== input2.sourceRef.nativeSessionId))
|
|
24054
24371
|
throw new DevinHistoryError("checkpointNotFound", "Checkpoint does not belong to the source Session");
|
|
24055
|
-
const options = this.transportOptions(
|
|
24056
|
-
const live = [...this.#sessions].find((session) => session.transport.sessionId ===
|
|
24372
|
+
const options = this.transportOptions(input2.cwd, input2.environment);
|
|
24373
|
+
const live = [...this.#sessions].find((session) => session.transport.sessionId === input2.sourceRef.nativeSessionId);
|
|
24057
24374
|
if (live)
|
|
24058
|
-
return live.withHistory(() => deriveDevinHistory(
|
|
24375
|
+
return live.withHistory(() => deriveDevinHistory(input2, live.transport, options));
|
|
24059
24376
|
const source = new DevinTransport(options);
|
|
24060
24377
|
let derived;
|
|
24061
24378
|
let derivationError;
|
|
24062
24379
|
try {
|
|
24063
|
-
await source.open(
|
|
24064
|
-
derived = await deriveDevinHistory(
|
|
24380
|
+
await source.open(input2.sourceRef.nativeSessionId, true);
|
|
24381
|
+
derived = await deriveDevinHistory(input2, source, options);
|
|
24065
24382
|
return derived;
|
|
24066
24383
|
} catch (error51) {
|
|
24067
24384
|
derivationError = error51;
|
|
@@ -24145,7 +24462,7 @@ var DevinAdapter = class {
|
|
|
24145
24462
|
...[...this.#sessions].map((session) => session.close()),
|
|
24146
24463
|
...[...this.#probes].map((transport) => transport.close())
|
|
24147
24464
|
]);
|
|
24148
|
-
await Promise.allSettled(
|
|
24465
|
+
await Promise.allSettled(this.#inspectionTasks);
|
|
24149
24466
|
this.#inspections.clear();
|
|
24150
24467
|
})();
|
|
24151
24468
|
return this.#closePromise;
|
|
@@ -24258,8 +24575,8 @@ var DevinSession = class {
|
|
|
24258
24575
|
if (command.type === "turn.cancel") {
|
|
24259
24576
|
if (!this.#active || this.#active.command.turnId !== command.turnId)
|
|
24260
24577
|
return rejected("invalidState", "Devin turn is not active");
|
|
24261
|
-
const
|
|
24262
|
-
|
|
24578
|
+
const active2 = this.#active;
|
|
24579
|
+
active2.cancelled = true;
|
|
24263
24580
|
this.#interactions.cancel();
|
|
24264
24581
|
try {
|
|
24265
24582
|
await this.transport.cancel();
|
|
@@ -24267,10 +24584,10 @@ var DevinSession = class {
|
|
|
24267
24584
|
await this.transport.close();
|
|
24268
24585
|
}
|
|
24269
24586
|
const timer = setTimeout(() => {
|
|
24270
|
-
if (this.#active ===
|
|
24587
|
+
if (this.#active === active2)
|
|
24271
24588
|
void this.transport.close();
|
|
24272
24589
|
}, 5e3);
|
|
24273
|
-
void
|
|
24590
|
+
void active2.task.finally(() => clearTimeout(timer));
|
|
24274
24591
|
return { ok: true, value: { cancellationRequested: true } };
|
|
24275
24592
|
}
|
|
24276
24593
|
if (this.#configuring || this.#active && command.type !== "model.select" && command.type !== "thinking.select")
|
|
@@ -24281,9 +24598,9 @@ var DevinSession = class {
|
|
|
24281
24598
|
if (!command.input.length || command.input.some((part) => part.type !== "text") || !command.input.some((part) => part.text.trim()))
|
|
24282
24599
|
return rejected("invalidRequest", "Devin requires nonempty text input");
|
|
24283
24600
|
this.#submitted.add(command.turnId);
|
|
24284
|
-
const
|
|
24285
|
-
this.#active =
|
|
24286
|
-
|
|
24601
|
+
const active2 = { command, cancelled: false, task: Promise.resolve() };
|
|
24602
|
+
this.#active = active2;
|
|
24603
|
+
active2.task = this.#run(command);
|
|
24287
24604
|
return { ok: true, value: { turnId: command.turnId } };
|
|
24288
24605
|
}
|
|
24289
24606
|
const thinking = devinThinking(this.info);
|
|
@@ -24414,14 +24731,14 @@ var DevinSession = class {
|
|
|
24414
24731
|
if (this.#closed)
|
|
24415
24732
|
return;
|
|
24416
24733
|
this.#closed = true;
|
|
24417
|
-
const
|
|
24418
|
-
if (
|
|
24419
|
-
|
|
24734
|
+
const active2 = this.#active;
|
|
24735
|
+
if (active2)
|
|
24736
|
+
active2.cancelled = true;
|
|
24420
24737
|
this.#interactions.cancel();
|
|
24421
24738
|
this.transport.onConfigOptions = void 0;
|
|
24422
24739
|
try {
|
|
24423
24740
|
await this.transport.close();
|
|
24424
|
-
await
|
|
24741
|
+
await active2?.task;
|
|
24425
24742
|
} finally {
|
|
24426
24743
|
this.#channel.end();
|
|
24427
24744
|
this.onClose();
|