@covro/covro 0.1.0-dev.1 → 0.1.0-dev.39202054561.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/update-worker.cjs
CHANGED
|
@@ -33,9 +33,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
33
33
|
mod
|
|
34
34
|
));
|
|
35
35
|
|
|
36
|
-
//
|
|
36
|
+
// node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/polyfills.js
|
|
37
37
|
var require_polyfills = __commonJS({
|
|
38
|
-
"
|
|
38
|
+
"node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/polyfills.js"(exports2, module2) {
|
|
39
39
|
var constants3 = require("constants");
|
|
40
40
|
var origCwd = process.cwd;
|
|
41
41
|
var cwd = null;
|
|
@@ -321,9 +321,9 @@ var require_polyfills = __commonJS({
|
|
|
321
321
|
}
|
|
322
322
|
});
|
|
323
323
|
|
|
324
|
-
//
|
|
324
|
+
// node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/legacy-streams.js
|
|
325
325
|
var require_legacy_streams = __commonJS({
|
|
326
|
-
"
|
|
326
|
+
"node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/legacy-streams.js"(exports2, module2) {
|
|
327
327
|
var Stream = require("stream").Stream;
|
|
328
328
|
module2.exports = legacy;
|
|
329
329
|
function legacy(fs) {
|
|
@@ -417,9 +417,9 @@ var require_legacy_streams = __commonJS({
|
|
|
417
417
|
}
|
|
418
418
|
});
|
|
419
419
|
|
|
420
|
-
//
|
|
420
|
+
// node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/clone.js
|
|
421
421
|
var require_clone = __commonJS({
|
|
422
|
-
"
|
|
422
|
+
"node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/clone.js"(exports2, module2) {
|
|
423
423
|
"use strict";
|
|
424
424
|
module2.exports = clone2;
|
|
425
425
|
var getPrototypeOf = Object.getPrototypeOf || function(obj) {
|
|
@@ -440,9 +440,9 @@ var require_clone = __commonJS({
|
|
|
440
440
|
}
|
|
441
441
|
});
|
|
442
442
|
|
|
443
|
-
//
|
|
443
|
+
// node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/graceful-fs.js
|
|
444
444
|
var require_graceful_fs = __commonJS({
|
|
445
|
-
"
|
|
445
|
+
"node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/graceful-fs.js"(exports2, module2) {
|
|
446
446
|
var fs = require("fs");
|
|
447
447
|
var polyfills = require_polyfills();
|
|
448
448
|
var legacy = require_legacy_streams();
|
|
@@ -810,9 +810,9 @@ var require_graceful_fs = __commonJS({
|
|
|
810
810
|
}
|
|
811
811
|
});
|
|
812
812
|
|
|
813
|
-
//
|
|
813
|
+
// node_modules/.pnpm/retry@0.12.0/node_modules/retry/lib/retry_operation.js
|
|
814
814
|
var require_retry_operation = __commonJS({
|
|
815
|
-
"
|
|
815
|
+
"node_modules/.pnpm/retry@0.12.0/node_modules/retry/lib/retry_operation.js"(exports2, module2) {
|
|
816
816
|
function RetryOperation(timeouts, options) {
|
|
817
817
|
if (typeof options === "boolean") {
|
|
818
818
|
options = { forever: options };
|
|
@@ -941,9 +941,9 @@ var require_retry_operation = __commonJS({
|
|
|
941
941
|
}
|
|
942
942
|
});
|
|
943
943
|
|
|
944
|
-
//
|
|
944
|
+
// node_modules/.pnpm/retry@0.12.0/node_modules/retry/lib/retry.js
|
|
945
945
|
var require_retry = __commonJS({
|
|
946
|
-
"
|
|
946
|
+
"node_modules/.pnpm/retry@0.12.0/node_modules/retry/lib/retry.js"(exports2) {
|
|
947
947
|
var RetryOperation = require_retry_operation();
|
|
948
948
|
exports2.operation = function(options) {
|
|
949
949
|
var timeouts = exports2.timeouts(options);
|
|
@@ -1027,16 +1027,16 @@ var require_retry = __commonJS({
|
|
|
1027
1027
|
}
|
|
1028
1028
|
});
|
|
1029
1029
|
|
|
1030
|
-
//
|
|
1030
|
+
// node_modules/.pnpm/retry@0.12.0/node_modules/retry/index.js
|
|
1031
1031
|
var require_retry2 = __commonJS({
|
|
1032
|
-
"
|
|
1032
|
+
"node_modules/.pnpm/retry@0.12.0/node_modules/retry/index.js"(exports2, module2) {
|
|
1033
1033
|
module2.exports = require_retry();
|
|
1034
1034
|
}
|
|
1035
1035
|
});
|
|
1036
1036
|
|
|
1037
|
-
//
|
|
1037
|
+
// node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/signals.js
|
|
1038
1038
|
var require_signals = __commonJS({
|
|
1039
|
-
"
|
|
1039
|
+
"node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/signals.js"(exports2, module2) {
|
|
1040
1040
|
module2.exports = [
|
|
1041
1041
|
"SIGABRT",
|
|
1042
1042
|
"SIGALRM",
|
|
@@ -1071,9 +1071,9 @@ var require_signals = __commonJS({
|
|
|
1071
1071
|
}
|
|
1072
1072
|
});
|
|
1073
1073
|
|
|
1074
|
-
//
|
|
1074
|
+
// node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/index.js
|
|
1075
1075
|
var require_signal_exit = __commonJS({
|
|
1076
|
-
"
|
|
1076
|
+
"node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/index.js"(exports2, module2) {
|
|
1077
1077
|
var process2 = global.process;
|
|
1078
1078
|
var processOk = function(process3) {
|
|
1079
1079
|
return process3 && typeof process3 === "object" && typeof process3.removeListener === "function" && typeof process3.emit === "function" && typeof process3.reallyExit === "function" && typeof process3.listeners === "function" && typeof process3.kill === "function" && typeof process3.pid === "number" && typeof process3.on === "function";
|
|
@@ -1230,9 +1230,9 @@ var require_signal_exit = __commonJS({
|
|
|
1230
1230
|
}
|
|
1231
1231
|
});
|
|
1232
1232
|
|
|
1233
|
-
//
|
|
1233
|
+
// node_modules/.pnpm/proper-lockfile@4.1.2/node_modules/proper-lockfile/lib/mtime-precision.js
|
|
1234
1234
|
var require_mtime_precision = __commonJS({
|
|
1235
|
-
"
|
|
1235
|
+
"node_modules/.pnpm/proper-lockfile@4.1.2/node_modules/proper-lockfile/lib/mtime-precision.js"(exports2, module2) {
|
|
1236
1236
|
"use strict";
|
|
1237
1237
|
var cacheSymbol = /* @__PURE__ */ Symbol();
|
|
1238
1238
|
function probe(file2, fs, callback) {
|
|
@@ -1272,9 +1272,9 @@ var require_mtime_precision = __commonJS({
|
|
|
1272
1272
|
}
|
|
1273
1273
|
});
|
|
1274
1274
|
|
|
1275
|
-
//
|
|
1275
|
+
// node_modules/.pnpm/proper-lockfile@4.1.2/node_modules/proper-lockfile/lib/lockfile.js
|
|
1276
1276
|
var require_lockfile = __commonJS({
|
|
1277
|
-
"
|
|
1277
|
+
"node_modules/.pnpm/proper-lockfile@4.1.2/node_modules/proper-lockfile/lib/lockfile.js"(exports2, module2) {
|
|
1278
1278
|
"use strict";
|
|
1279
1279
|
var path = require("path");
|
|
1280
1280
|
var fs = require_graceful_fs();
|
|
@@ -1509,9 +1509,9 @@ var require_lockfile = __commonJS({
|
|
|
1509
1509
|
}
|
|
1510
1510
|
});
|
|
1511
1511
|
|
|
1512
|
-
//
|
|
1512
|
+
// node_modules/.pnpm/proper-lockfile@4.1.2/node_modules/proper-lockfile/lib/adapter.js
|
|
1513
1513
|
var require_adapter = __commonJS({
|
|
1514
|
-
"
|
|
1514
|
+
"node_modules/.pnpm/proper-lockfile@4.1.2/node_modules/proper-lockfile/lib/adapter.js"(exports2, module2) {
|
|
1515
1515
|
"use strict";
|
|
1516
1516
|
var fs = require_graceful_fs();
|
|
1517
1517
|
function createSyncFs(fs2) {
|
|
@@ -1574,9 +1574,9 @@ var require_adapter = __commonJS({
|
|
|
1574
1574
|
}
|
|
1575
1575
|
});
|
|
1576
1576
|
|
|
1577
|
-
//
|
|
1577
|
+
// node_modules/.pnpm/proper-lockfile@4.1.2/node_modules/proper-lockfile/index.js
|
|
1578
1578
|
var require_proper_lockfile = __commonJS({
|
|
1579
|
-
"
|
|
1579
|
+
"node_modules/.pnpm/proper-lockfile@4.1.2/node_modules/proper-lockfile/index.js"(exports2, module2) {
|
|
1580
1580
|
"use strict";
|
|
1581
1581
|
var lockfile3 = require_lockfile();
|
|
1582
1582
|
var { toPromise, toSync, toSyncOptions } = require_adapter();
|
|
@@ -1613,7 +1613,7 @@ var require_proper_lockfile = __commonJS({
|
|
|
1613
1613
|
// src/shared/package.ts
|
|
1614
1614
|
var npmPackageName = "@covro/covro";
|
|
1615
1615
|
|
|
1616
|
-
//
|
|
1616
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/classic/external.js
|
|
1617
1617
|
var external_exports = {};
|
|
1618
1618
|
__export(external_exports, {
|
|
1619
1619
|
$brand: () => $brand,
|
|
@@ -1876,7 +1876,7 @@ __export(external_exports, {
|
|
|
1876
1876
|
xor: () => xor
|
|
1877
1877
|
});
|
|
1878
1878
|
|
|
1879
|
-
//
|
|
1879
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/index.js
|
|
1880
1880
|
var core_exports2 = {};
|
|
1881
1881
|
__export(core_exports2, {
|
|
1882
1882
|
$ZodAny: () => $ZodAny,
|
|
@@ -2193,7 +2193,7 @@ __export(core_exports2, {
|
|
|
2193
2193
|
withParser: () => withParser
|
|
2194
2194
|
});
|
|
2195
2195
|
|
|
2196
|
-
//
|
|
2196
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/util.js
|
|
2197
2197
|
var util_exports = {};
|
|
2198
2198
|
__export(util_exports, {
|
|
2199
2199
|
BIGINT_FORMAT_RANGES: () => BIGINT_FORMAT_RANGES,
|
|
@@ -3049,7 +3049,7 @@ function constantCatch(value) {
|
|
|
3049
3049
|
return fn;
|
|
3050
3050
|
}
|
|
3051
3051
|
|
|
3052
|
-
//
|
|
3052
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/core.js
|
|
3053
3053
|
var _a;
|
|
3054
3054
|
var NEVER = /* @__PURE__ */ Object.freeze({
|
|
3055
3055
|
status: "aborted"
|
|
@@ -3171,7 +3171,7 @@ function config(newConfig) {
|
|
|
3171
3171
|
return globalConfig;
|
|
3172
3172
|
}
|
|
3173
3173
|
|
|
3174
|
-
//
|
|
3174
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/errors.js
|
|
3175
3175
|
function _getMessage() {
|
|
3176
3176
|
const internals = this._zod;
|
|
3177
3177
|
internals.message ?? (internals.message = JSON.stringify(internals.def, jsonStringifyReplacer, 2));
|
|
@@ -3363,7 +3363,7 @@ function prettifyError(error62) {
|
|
|
3363
3363
|
return lines.join("\n");
|
|
3364
3364
|
}
|
|
3365
3365
|
|
|
3366
|
-
//
|
|
3366
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/parse.js
|
|
3367
3367
|
function finalizeParams(callee, params) {
|
|
3368
3368
|
return { callee: params?.callee ?? callee, Err: params?.Err };
|
|
3369
3369
|
}
|
|
@@ -3523,7 +3523,7 @@ var _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {
|
|
|
3523
3523
|
};
|
|
3524
3524
|
var safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync($ZodRealError);
|
|
3525
3525
|
|
|
3526
|
-
//
|
|
3526
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/regexes.js
|
|
3527
3527
|
var regexes_exports = {};
|
|
3528
3528
|
__export(regexes_exports, {
|
|
3529
3529
|
anyString: () => anyString,
|
|
@@ -3695,7 +3695,7 @@ var sha512_hex = /^[0-9a-fA-F]{128}$/;
|
|
|
3695
3695
|
var sha512_base64 = /* @__PURE__ */ fixedBase64(86, "==");
|
|
3696
3696
|
var sha512_base64url = /* @__PURE__ */ fixedBase64url(86);
|
|
3697
3697
|
|
|
3698
|
-
//
|
|
3698
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/checks.js
|
|
3699
3699
|
var $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => {
|
|
3700
3700
|
var _a3;
|
|
3701
3701
|
inst._zod ?? (inst._zod = {});
|
|
@@ -4171,7 +4171,7 @@ var $ZodCheckOverwrite = /* @__PURE__ */ $constructor("$ZodCheckOverwrite", (ins
|
|
|
4171
4171
|
};
|
|
4172
4172
|
});
|
|
4173
4173
|
|
|
4174
|
-
//
|
|
4174
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/doc.js
|
|
4175
4175
|
var Doc = class {
|
|
4176
4176
|
constructor(args = [], closed = {}) {
|
|
4177
4177
|
this.content = [];
|
|
@@ -4212,14 +4212,14 @@ ${content.join("\n")}
|
|
|
4212
4212
|
}
|
|
4213
4213
|
};
|
|
4214
4214
|
|
|
4215
|
-
//
|
|
4215
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/versions.js
|
|
4216
4216
|
var version = {
|
|
4217
4217
|
major: 4,
|
|
4218
4218
|
minor: 6,
|
|
4219
4219
|
patch: 6
|
|
4220
4220
|
};
|
|
4221
4221
|
|
|
4222
|
-
//
|
|
4222
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/schemas.js
|
|
4223
4223
|
var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
4224
4224
|
var _a3;
|
|
4225
4225
|
inst ?? (inst = {});
|
|
@@ -6661,7 +6661,7 @@ function handleRefineResult(result, payload, input2, inst) {
|
|
|
6661
6661
|
}
|
|
6662
6662
|
}
|
|
6663
6663
|
|
|
6664
|
-
//
|
|
6664
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/memoizer.js
|
|
6665
6665
|
var $ZodCyclicError = class extends Error {
|
|
6666
6666
|
constructor() {
|
|
6667
6667
|
super(`Cannot parse a reference cycle that closes through a transform`);
|
|
@@ -6938,7 +6938,7 @@ function isBackEdge(ctx, value) {
|
|
|
6938
6938
|
return backEdges !== void 0 && isRef(value) && backEdges.has(value);
|
|
6939
6939
|
}
|
|
6940
6940
|
|
|
6941
|
-
//
|
|
6941
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/locales/index.js
|
|
6942
6942
|
var locales_exports = {};
|
|
6943
6943
|
__export(locales_exports, {
|
|
6944
6944
|
ar: () => ar_default,
|
|
@@ -7006,7 +7006,7 @@ __export(locales_exports, {
|
|
|
7006
7006
|
zhTW: () => zh_TW_default
|
|
7007
7007
|
});
|
|
7008
7008
|
|
|
7009
|
-
//
|
|
7009
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/locales/ar.js
|
|
7010
7010
|
var error = () => {
|
|
7011
7011
|
const Sizable = {
|
|
7012
7012
|
string: { unit: "\u062D\u0631\u0641", verb: "\u0623\u0646 \u064A\u062D\u0648\u064A" },
|
|
@@ -7118,7 +7118,7 @@ function ar_default() {
|
|
|
7118
7118
|
};
|
|
7119
7119
|
}
|
|
7120
7120
|
|
|
7121
|
-
//
|
|
7121
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/locales/az.js
|
|
7122
7122
|
var error2 = () => {
|
|
7123
7123
|
const Sizable = {
|
|
7124
7124
|
string: { unit: "simvol", verb: "olmal\u0131d\u0131r" },
|
|
@@ -7229,7 +7229,7 @@ function az_default() {
|
|
|
7229
7229
|
};
|
|
7230
7230
|
}
|
|
7231
7231
|
|
|
7232
|
-
//
|
|
7232
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/locales/be.js
|
|
7233
7233
|
function getBelarusianPlural(count, one, few, many) {
|
|
7234
7234
|
const absCount = Math.abs(count);
|
|
7235
7235
|
const lastDigit = absCount % 10;
|
|
@@ -7398,7 +7398,7 @@ function be_default() {
|
|
|
7398
7398
|
};
|
|
7399
7399
|
}
|
|
7400
7400
|
|
|
7401
|
-
//
|
|
7401
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/locales/bg.js
|
|
7402
7402
|
var error4 = () => {
|
|
7403
7403
|
const Sizable = {
|
|
7404
7404
|
string: { unit: "\u0441\u0438\u043C\u0432\u043E\u043B\u0430", verb: "\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430" },
|
|
@@ -7524,7 +7524,7 @@ function bg_default() {
|
|
|
7524
7524
|
};
|
|
7525
7525
|
}
|
|
7526
7526
|
|
|
7527
|
-
//
|
|
7527
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/locales/bn.js
|
|
7528
7528
|
var error5 = () => {
|
|
7529
7529
|
const Sizable = {
|
|
7530
7530
|
string: { unit: "\u0985\u0995\u09CD\u09B7\u09B0", verb: "\u09A5\u09BE\u0995\u09A4\u09C7 \u09B9\u09AC\u09C7" },
|
|
@@ -7638,7 +7638,7 @@ function bn_default() {
|
|
|
7638
7638
|
};
|
|
7639
7639
|
}
|
|
7640
7640
|
|
|
7641
|
-
//
|
|
7641
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/locales/ca.js
|
|
7642
7642
|
var error6 = () => {
|
|
7643
7643
|
const Sizable = {
|
|
7644
7644
|
string: { unit: "car\xE0cters", verb: "contenir" },
|
|
@@ -7752,7 +7752,7 @@ function ca_default() {
|
|
|
7752
7752
|
};
|
|
7753
7753
|
}
|
|
7754
7754
|
|
|
7755
|
-
//
|
|
7755
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/locales/ckb.js
|
|
7756
7756
|
var error7 = () => {
|
|
7757
7757
|
const Sizable = {
|
|
7758
7758
|
string: { unit: "\u067E\u06CC\u062A", verb: "\u0628\u06CE\u062A" },
|
|
@@ -7885,7 +7885,7 @@ function ckb_default() {
|
|
|
7885
7885
|
};
|
|
7886
7886
|
}
|
|
7887
7887
|
|
|
7888
|
-
//
|
|
7888
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/locales/cs.js
|
|
7889
7889
|
var error8 = () => {
|
|
7890
7890
|
const Sizable = {
|
|
7891
7891
|
string: { unit: "znak\u016F", verb: "m\xEDt" },
|
|
@@ -8002,7 +8002,7 @@ function cs_default() {
|
|
|
8002
8002
|
};
|
|
8003
8003
|
}
|
|
8004
8004
|
|
|
8005
|
-
//
|
|
8005
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/locales/da.js
|
|
8006
8006
|
var error9 = () => {
|
|
8007
8007
|
const Sizable = {
|
|
8008
8008
|
string: { unit: "tegn", verb: "havde" },
|
|
@@ -8123,7 +8123,7 @@ function da_default() {
|
|
|
8123
8123
|
};
|
|
8124
8124
|
}
|
|
8125
8125
|
|
|
8126
|
-
//
|
|
8126
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/locales/de.js
|
|
8127
8127
|
var error10 = () => {
|
|
8128
8128
|
const Sizable = {
|
|
8129
8129
|
string: { unit: "Zeichen", verb: "zu haben" },
|
|
@@ -8237,7 +8237,7 @@ function de_default() {
|
|
|
8237
8237
|
};
|
|
8238
8238
|
}
|
|
8239
8239
|
|
|
8240
|
-
//
|
|
8240
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/locales/el.js
|
|
8241
8241
|
var error11 = () => {
|
|
8242
8242
|
const Sizable = {
|
|
8243
8243
|
string: { unit: "\u03C7\u03B1\u03C1\u03B1\u03BA\u03C4\u03AE\u03C1\u03B5\u03C2", verb: "\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9" },
|
|
@@ -8350,7 +8350,7 @@ function el_default() {
|
|
|
8350
8350
|
};
|
|
8351
8351
|
}
|
|
8352
8352
|
|
|
8353
|
-
//
|
|
8353
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/locales/en.js
|
|
8354
8354
|
var error12 = () => {
|
|
8355
8355
|
const Sizable = {
|
|
8356
8356
|
string: { unit: "characters", verb: "to have" },
|
|
@@ -8475,7 +8475,7 @@ function en_default() {
|
|
|
8475
8475
|
};
|
|
8476
8476
|
}
|
|
8477
8477
|
|
|
8478
|
-
//
|
|
8478
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/locales/eo.js
|
|
8479
8479
|
var error13 = () => {
|
|
8480
8480
|
const Sizable = {
|
|
8481
8481
|
string: { unit: "karaktrojn", verb: "havi" },
|
|
@@ -8590,7 +8590,7 @@ function eo_default() {
|
|
|
8590
8590
|
};
|
|
8591
8591
|
}
|
|
8592
8592
|
|
|
8593
|
-
//
|
|
8593
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/locales/es.js
|
|
8594
8594
|
var error14 = () => {
|
|
8595
8595
|
const Sizable = {
|
|
8596
8596
|
string: { unit: "caracteres", verb: "tener" },
|
|
@@ -8727,7 +8727,7 @@ function es_default() {
|
|
|
8727
8727
|
};
|
|
8728
8728
|
}
|
|
8729
8729
|
|
|
8730
|
-
//
|
|
8730
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/locales/fa.js
|
|
8731
8731
|
var error15 = () => {
|
|
8732
8732
|
const Sizable = {
|
|
8733
8733
|
string: { unit: "\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631", verb: "\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F" },
|
|
@@ -8847,7 +8847,7 @@ function fa_default() {
|
|
|
8847
8847
|
};
|
|
8848
8848
|
}
|
|
8849
8849
|
|
|
8850
|
-
//
|
|
8850
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/locales/fi.js
|
|
8851
8851
|
var error16 = () => {
|
|
8852
8852
|
const Sizable = {
|
|
8853
8853
|
string: { unit: "merkki\xE4", subject: "merkkijonon" },
|
|
@@ -8965,7 +8965,7 @@ function fi_default() {
|
|
|
8965
8965
|
};
|
|
8966
8966
|
}
|
|
8967
8967
|
|
|
8968
|
-
//
|
|
8968
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/locales/fr.js
|
|
8969
8969
|
var error17 = () => {
|
|
8970
8970
|
const Sizable = {
|
|
8971
8971
|
string: { unit: "caract\xE8res", verb: "avoir" },
|
|
@@ -9095,7 +9095,7 @@ function fr_default() {
|
|
|
9095
9095
|
};
|
|
9096
9096
|
}
|
|
9097
9097
|
|
|
9098
|
-
//
|
|
9098
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/locales/fr-CA.js
|
|
9099
9099
|
var error18 = () => {
|
|
9100
9100
|
const Sizable = {
|
|
9101
9101
|
string: { unit: "caract\xE8res", verb: "avoir" },
|
|
@@ -9208,7 +9208,7 @@ function fr_CA_default() {
|
|
|
9208
9208
|
};
|
|
9209
9209
|
}
|
|
9210
9210
|
|
|
9211
|
-
//
|
|
9211
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/locales/gu.js
|
|
9212
9212
|
var error19 = () => {
|
|
9213
9213
|
const Sizable = {
|
|
9214
9214
|
string: { unit: "\u0A85\u0A95\u0ACD\u0AB7\u0AB0", verb: "\u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F" },
|
|
@@ -9322,7 +9322,7 @@ function gu_default() {
|
|
|
9322
9322
|
};
|
|
9323
9323
|
}
|
|
9324
9324
|
|
|
9325
|
-
//
|
|
9325
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/locales/he.js
|
|
9326
9326
|
var error20 = () => {
|
|
9327
9327
|
const TypeNames = {
|
|
9328
9328
|
string: { label: "\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA", gender: "f" },
|
|
@@ -9524,7 +9524,7 @@ function he_default() {
|
|
|
9524
9524
|
};
|
|
9525
9525
|
}
|
|
9526
9526
|
|
|
9527
|
-
//
|
|
9527
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/locales/hi.js
|
|
9528
9528
|
var error21 = () => {
|
|
9529
9529
|
const Sizable = {
|
|
9530
9530
|
string: { unit: "\u0905\u0915\u094D\u0937\u0930", verb: "\u0930\u0916\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F" },
|
|
@@ -9636,7 +9636,7 @@ function hi_default() {
|
|
|
9636
9636
|
};
|
|
9637
9637
|
}
|
|
9638
9638
|
|
|
9639
|
-
//
|
|
9639
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/locales/hr.js
|
|
9640
9640
|
var error22 = () => {
|
|
9641
9641
|
const Sizable = {
|
|
9642
9642
|
string: { unit: "znakova", verb: "imati" },
|
|
@@ -9763,7 +9763,7 @@ function hr_default() {
|
|
|
9763
9763
|
};
|
|
9764
9764
|
}
|
|
9765
9765
|
|
|
9766
|
-
//
|
|
9766
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/locales/hu.js
|
|
9767
9767
|
var error23 = () => {
|
|
9768
9768
|
const Sizable = {
|
|
9769
9769
|
string: { unit: "karakter", verb: "legyen" },
|
|
@@ -9877,7 +9877,7 @@ function hu_default() {
|
|
|
9877
9877
|
};
|
|
9878
9878
|
}
|
|
9879
9879
|
|
|
9880
|
-
//
|
|
9880
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/locales/hy.js
|
|
9881
9881
|
function getArmenianPlural(count, one, many) {
|
|
9882
9882
|
return Math.abs(count) === 1 ? one : many;
|
|
9883
9883
|
}
|
|
@@ -10036,7 +10036,7 @@ function hy_default() {
|
|
|
10036
10036
|
};
|
|
10037
10037
|
}
|
|
10038
10038
|
|
|
10039
|
-
//
|
|
10039
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/locales/id.js
|
|
10040
10040
|
var error25 = () => {
|
|
10041
10041
|
const Sizable = {
|
|
10042
10042
|
string: { unit: "karakter", verb: "memiliki" },
|
|
@@ -10148,7 +10148,7 @@ function id_default() {
|
|
|
10148
10148
|
};
|
|
10149
10149
|
}
|
|
10150
10150
|
|
|
10151
|
-
//
|
|
10151
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/locales/is.js
|
|
10152
10152
|
var error26 = () => {
|
|
10153
10153
|
const Sizable = {
|
|
10154
10154
|
string: { unit: "stafi", verb: "a\xF0 hafa" },
|
|
@@ -10263,7 +10263,7 @@ function is_default() {
|
|
|
10263
10263
|
};
|
|
10264
10264
|
}
|
|
10265
10265
|
|
|
10266
|
-
//
|
|
10266
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/locales/it.js
|
|
10267
10267
|
var error27 = () => {
|
|
10268
10268
|
const Sizable = {
|
|
10269
10269
|
string: { unit: "caratteri", verb: "avere" },
|
|
@@ -10377,7 +10377,7 @@ function it_default() {
|
|
|
10377
10377
|
};
|
|
10378
10378
|
}
|
|
10379
10379
|
|
|
10380
|
-
//
|
|
10380
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/locales/ja.js
|
|
10381
10381
|
var error28 = () => {
|
|
10382
10382
|
const Sizable = {
|
|
10383
10383
|
string: { unit: "\u6587\u5B57", verb: "\u3067\u3042\u308B" },
|
|
@@ -10490,7 +10490,7 @@ function ja_default() {
|
|
|
10490
10490
|
};
|
|
10491
10491
|
}
|
|
10492
10492
|
|
|
10493
|
-
//
|
|
10493
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/locales/ka.js
|
|
10494
10494
|
var error29 = () => {
|
|
10495
10495
|
const Sizable = {
|
|
10496
10496
|
string: { unit: "\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD", verb: "\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1" },
|
|
@@ -10608,7 +10608,7 @@ function ka_default() {
|
|
|
10608
10608
|
};
|
|
10609
10609
|
}
|
|
10610
10610
|
|
|
10611
|
-
//
|
|
10611
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/locales/km.js
|
|
10612
10612
|
var error30 = () => {
|
|
10613
10613
|
const Sizable = {
|
|
10614
10614
|
string: { unit: "\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A", verb: "\u1782\u17BD\u179A\u1798\u17B6\u1793" },
|
|
@@ -10724,12 +10724,12 @@ function km_default() {
|
|
|
10724
10724
|
};
|
|
10725
10725
|
}
|
|
10726
10726
|
|
|
10727
|
-
//
|
|
10727
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/locales/kh.js
|
|
10728
10728
|
function kh_default() {
|
|
10729
10729
|
return km_default();
|
|
10730
10730
|
}
|
|
10731
10731
|
|
|
10732
|
-
//
|
|
10732
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/locales/kn.js
|
|
10733
10733
|
var error31 = () => {
|
|
10734
10734
|
const Sizable = {
|
|
10735
10735
|
string: { unit: "\u0C85\u0C95\u0CCD\u0CB7\u0CB0\u0C97\u0CB3\u0CC1", verb: "\u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1" },
|
|
@@ -10845,7 +10845,7 @@ function kn_default() {
|
|
|
10845
10845
|
};
|
|
10846
10846
|
}
|
|
10847
10847
|
|
|
10848
|
-
//
|
|
10848
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/locales/ko.js
|
|
10849
10849
|
var error32 = () => {
|
|
10850
10850
|
const Sizable = {
|
|
10851
10851
|
string: { unit: "\uBB38\uC790", verb: "to have" },
|
|
@@ -10962,7 +10962,7 @@ function ko_default() {
|
|
|
10962
10962
|
};
|
|
10963
10963
|
}
|
|
10964
10964
|
|
|
10965
|
-
//
|
|
10965
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/locales/lt.js
|
|
10966
10966
|
var capitalizeFirstCharacter = (text) => {
|
|
10967
10967
|
return text.charAt(0).toUpperCase() + text.slice(1);
|
|
10968
10968
|
};
|
|
@@ -11170,7 +11170,7 @@ function lt_default() {
|
|
|
11170
11170
|
};
|
|
11171
11171
|
}
|
|
11172
11172
|
|
|
11173
|
-
//
|
|
11173
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/locales/mk.js
|
|
11174
11174
|
var error34 = () => {
|
|
11175
11175
|
const Sizable = {
|
|
11176
11176
|
string: { unit: "\u0437\u043D\u0430\u0446\u0438", verb: "\u0434\u0430 \u0438\u043C\u0430\u0430\u0442" },
|
|
@@ -11285,7 +11285,7 @@ function mk_default() {
|
|
|
11285
11285
|
};
|
|
11286
11286
|
}
|
|
11287
11287
|
|
|
11288
|
-
//
|
|
11288
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/locales/ms.js
|
|
11289
11289
|
var error35 = () => {
|
|
11290
11290
|
const Sizable = {
|
|
11291
11291
|
string: { unit: "aksara", verb: "mempunyai" },
|
|
@@ -11398,7 +11398,7 @@ function ms_default() {
|
|
|
11398
11398
|
};
|
|
11399
11399
|
}
|
|
11400
11400
|
|
|
11401
|
-
//
|
|
11401
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/locales/ne.js
|
|
11402
11402
|
var error36 = () => {
|
|
11403
11403
|
const Sizable = {
|
|
11404
11404
|
string: { unit: "\u0905\u0915\u094D\u0937\u0930", verb: "\u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B" },
|
|
@@ -11510,7 +11510,7 @@ function ne_default() {
|
|
|
11510
11510
|
};
|
|
11511
11511
|
}
|
|
11512
11512
|
|
|
11513
|
-
//
|
|
11513
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/locales/nl.js
|
|
11514
11514
|
var error37 = () => {
|
|
11515
11515
|
const Sizable = {
|
|
11516
11516
|
string: { unit: "tekens", verb: "heeft" },
|
|
@@ -11626,7 +11626,7 @@ function nl_default() {
|
|
|
11626
11626
|
};
|
|
11627
11627
|
}
|
|
11628
11628
|
|
|
11629
|
-
//
|
|
11629
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/locales/nn.js
|
|
11630
11630
|
var error38 = () => {
|
|
11631
11631
|
const Sizable = {
|
|
11632
11632
|
string: { unit: "teikn", verb: "\xE5 ha" },
|
|
@@ -11740,7 +11740,7 @@ function nn_default() {
|
|
|
11740
11740
|
};
|
|
11741
11741
|
}
|
|
11742
11742
|
|
|
11743
|
-
//
|
|
11743
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/locales/no.js
|
|
11744
11744
|
var error39 = () => {
|
|
11745
11745
|
const Sizable = {
|
|
11746
11746
|
string: { unit: "tegn", verb: "\xE5 ha" },
|
|
@@ -11854,7 +11854,7 @@ function no_default() {
|
|
|
11854
11854
|
};
|
|
11855
11855
|
}
|
|
11856
11856
|
|
|
11857
|
-
//
|
|
11857
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/locales/ota.js
|
|
11858
11858
|
var error40 = () => {
|
|
11859
11859
|
const Sizable = {
|
|
11860
11860
|
string: { unit: "harf", verb: "olmal\u0131d\u0131r" },
|
|
@@ -11969,7 +11969,7 @@ function ota_default() {
|
|
|
11969
11969
|
};
|
|
11970
11970
|
}
|
|
11971
11971
|
|
|
11972
|
-
//
|
|
11972
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/locales/ps.js
|
|
11973
11973
|
var error41 = () => {
|
|
11974
11974
|
const Sizable = {
|
|
11975
11975
|
string: { unit: "\u062A\u0648\u06A9\u064A", verb: "\u0648\u0644\u0631\u064A" },
|
|
@@ -12089,7 +12089,7 @@ function ps_default() {
|
|
|
12089
12089
|
};
|
|
12090
12090
|
}
|
|
12091
12091
|
|
|
12092
|
-
//
|
|
12092
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/locales/pl.js
|
|
12093
12093
|
var error42 = () => {
|
|
12094
12094
|
const Sizable = {
|
|
12095
12095
|
string: { unit: "znak\xF3w", verb: "mie\u0107" },
|
|
@@ -12204,7 +12204,7 @@ function pl_default() {
|
|
|
12204
12204
|
};
|
|
12205
12205
|
}
|
|
12206
12206
|
|
|
12207
|
-
//
|
|
12207
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/locales/pt.js
|
|
12208
12208
|
var error43 = () => {
|
|
12209
12209
|
const Sizable = {
|
|
12210
12210
|
string: { unit: "caracteres" },
|
|
@@ -12348,7 +12348,7 @@ function pt_default() {
|
|
|
12348
12348
|
};
|
|
12349
12349
|
}
|
|
12350
12350
|
|
|
12351
|
-
//
|
|
12351
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/locales/pt-BR.js
|
|
12352
12352
|
var error44 = () => {
|
|
12353
12353
|
const Sizable = {
|
|
12354
12354
|
string: { unit: "caracteres" },
|
|
@@ -12493,7 +12493,7 @@ function pt_BR_default() {
|
|
|
12493
12493
|
};
|
|
12494
12494
|
}
|
|
12495
12495
|
|
|
12496
|
-
//
|
|
12496
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/locales/ro.js
|
|
12497
12497
|
var error45 = () => {
|
|
12498
12498
|
const Sizable = {
|
|
12499
12499
|
string: { unit: "caractere", verb: "s\u0103 aib\u0103" },
|
|
@@ -12616,7 +12616,7 @@ function ro_default() {
|
|
|
12616
12616
|
};
|
|
12617
12617
|
}
|
|
12618
12618
|
|
|
12619
|
-
//
|
|
12619
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/locales/ru.js
|
|
12620
12620
|
function getRussianPlural(count, one, few, many) {
|
|
12621
12621
|
const absCount = Math.abs(count);
|
|
12622
12622
|
const lastDigit = absCount % 10;
|
|
@@ -12785,7 +12785,7 @@ function ru_default() {
|
|
|
12785
12785
|
};
|
|
12786
12786
|
}
|
|
12787
12787
|
|
|
12788
|
-
//
|
|
12788
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/locales/sk.js
|
|
12789
12789
|
var error47 = () => {
|
|
12790
12790
|
const Sizable = {
|
|
12791
12791
|
string: { unit: "znakov", verb: "ma\u0165" },
|
|
@@ -12902,7 +12902,7 @@ function sk_default() {
|
|
|
12902
12902
|
};
|
|
12903
12903
|
}
|
|
12904
12904
|
|
|
12905
|
-
//
|
|
12905
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/locales/sl.js
|
|
12906
12906
|
var error48 = () => {
|
|
12907
12907
|
const Sizable = {
|
|
12908
12908
|
string: { unit: "znakov", verb: "imeti" },
|
|
@@ -13017,7 +13017,7 @@ function sl_default() {
|
|
|
13017
13017
|
};
|
|
13018
13018
|
}
|
|
13019
13019
|
|
|
13020
|
-
//
|
|
13020
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/locales/sv.js
|
|
13021
13021
|
var error49 = () => {
|
|
13022
13022
|
const Sizable = {
|
|
13023
13023
|
string: { unit: "tecken", verb: "att ha" },
|
|
@@ -13133,7 +13133,7 @@ function sv_default() {
|
|
|
13133
13133
|
};
|
|
13134
13134
|
}
|
|
13135
13135
|
|
|
13136
|
-
//
|
|
13136
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/locales/ta.js
|
|
13137
13137
|
var error50 = () => {
|
|
13138
13138
|
const Sizable = {
|
|
13139
13139
|
string: { unit: "\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD", verb: "\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD" },
|
|
@@ -13249,7 +13249,7 @@ function ta_default() {
|
|
|
13249
13249
|
};
|
|
13250
13250
|
}
|
|
13251
13251
|
|
|
13252
|
-
//
|
|
13252
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/locales/tg.js
|
|
13253
13253
|
var error51 = () => {
|
|
13254
13254
|
const Sizable = {
|
|
13255
13255
|
string: { unit: "\u0430\u043B\u043E\u043C\u0430\u0442", verb: "\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434" },
|
|
@@ -13366,7 +13366,7 @@ function tg_default() {
|
|
|
13366
13366
|
};
|
|
13367
13367
|
}
|
|
13368
13368
|
|
|
13369
|
-
//
|
|
13369
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/locales/th.js
|
|
13370
13370
|
var error52 = () => {
|
|
13371
13371
|
const Sizable = {
|
|
13372
13372
|
string: { unit: "\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23", verb: "\u0E04\u0E27\u0E23\u0E21\u0E35" },
|
|
@@ -13482,7 +13482,7 @@ function th_default() {
|
|
|
13482
13482
|
};
|
|
13483
13483
|
}
|
|
13484
13484
|
|
|
13485
|
-
//
|
|
13485
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/locales/tk.js
|
|
13486
13486
|
var error53 = () => {
|
|
13487
13487
|
const Sizable = {
|
|
13488
13488
|
string: { unit: "simwol", verb: "bolmaly" },
|
|
@@ -13590,7 +13590,7 @@ function tk_default() {
|
|
|
13590
13590
|
};
|
|
13591
13591
|
}
|
|
13592
13592
|
|
|
13593
|
-
//
|
|
13593
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/locales/tr.js
|
|
13594
13594
|
var error54 = () => {
|
|
13595
13595
|
const Sizable = {
|
|
13596
13596
|
string: { unit: "karakter", verb: "olmal\u0131" },
|
|
@@ -13701,7 +13701,7 @@ function tr_default() {
|
|
|
13701
13701
|
};
|
|
13702
13702
|
}
|
|
13703
13703
|
|
|
13704
|
-
//
|
|
13704
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/locales/uk.js
|
|
13705
13705
|
var error55 = () => {
|
|
13706
13706
|
const Sizable = {
|
|
13707
13707
|
string: { unit: "\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432", verb: "\u043C\u0430\u0442\u0438\u043C\u0435" },
|
|
@@ -13815,12 +13815,12 @@ function uk_default() {
|
|
|
13815
13815
|
};
|
|
13816
13816
|
}
|
|
13817
13817
|
|
|
13818
|
-
//
|
|
13818
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/locales/ua.js
|
|
13819
13819
|
function ua_default() {
|
|
13820
13820
|
return uk_default();
|
|
13821
13821
|
}
|
|
13822
13822
|
|
|
13823
|
-
//
|
|
13823
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/locales/ur.js
|
|
13824
13824
|
var error56 = () => {
|
|
13825
13825
|
const Sizable = {
|
|
13826
13826
|
string: { unit: "\u062D\u0631\u0648\u0641", verb: "\u06C1\u0648\u0646\u0627" },
|
|
@@ -13936,7 +13936,7 @@ function ur_default() {
|
|
|
13936
13936
|
};
|
|
13937
13937
|
}
|
|
13938
13938
|
|
|
13939
|
-
//
|
|
13939
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/locales/uz.js
|
|
13940
13940
|
var error57 = () => {
|
|
13941
13941
|
const Sizable = {
|
|
13942
13942
|
string: { unit: "belgi", verb: "bo\u2018lishi kerak" },
|
|
@@ -14050,7 +14050,7 @@ function uz_default() {
|
|
|
14050
14050
|
};
|
|
14051
14051
|
}
|
|
14052
14052
|
|
|
14053
|
-
//
|
|
14053
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/locales/vi.js
|
|
14054
14054
|
var error58 = () => {
|
|
14055
14055
|
const Sizable = {
|
|
14056
14056
|
string: { unit: "k\xFD t\u1EF1", verb: "c\xF3" },
|
|
@@ -14164,7 +14164,7 @@ function vi_default() {
|
|
|
14164
14164
|
};
|
|
14165
14165
|
}
|
|
14166
14166
|
|
|
14167
|
-
//
|
|
14167
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/locales/zh-CN.js
|
|
14168
14168
|
var error59 = () => {
|
|
14169
14169
|
const Sizable = {
|
|
14170
14170
|
string: { unit: "\u5B57\u7B26", verb: "\u5305\u542B" },
|
|
@@ -14279,7 +14279,7 @@ function zh_CN_default() {
|
|
|
14279
14279
|
};
|
|
14280
14280
|
}
|
|
14281
14281
|
|
|
14282
|
-
//
|
|
14282
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/locales/zh-TW.js
|
|
14283
14283
|
var error60 = () => {
|
|
14284
14284
|
const Sizable = {
|
|
14285
14285
|
string: { unit: "\u5B57\u5143", verb: "\u64C1\u6709" },
|
|
@@ -14392,7 +14392,7 @@ function zh_TW_default() {
|
|
|
14392
14392
|
};
|
|
14393
14393
|
}
|
|
14394
14394
|
|
|
14395
|
-
//
|
|
14395
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/locales/yo.js
|
|
14396
14396
|
var error61 = () => {
|
|
14397
14397
|
const Sizable = {
|
|
14398
14398
|
string: { unit: "\xE0mi", verb: "n\xED" },
|
|
@@ -14505,7 +14505,7 @@ function yo_default() {
|
|
|
14505
14505
|
};
|
|
14506
14506
|
}
|
|
14507
14507
|
|
|
14508
|
-
//
|
|
14508
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/registries.js
|
|
14509
14509
|
var _a2;
|
|
14510
14510
|
var $output = /* @__PURE__ */ Symbol("ZodOutput");
|
|
14511
14511
|
var $input = /* @__PURE__ */ Symbol("ZodInput");
|
|
@@ -14555,7 +14555,7 @@ function registry() {
|
|
|
14555
14555
|
(_a2 = globalThis).__zod_globalRegistry ?? (_a2.__zod_globalRegistry = registry());
|
|
14556
14556
|
var globalRegistry = globalThis.__zod_globalRegistry;
|
|
14557
14557
|
|
|
14558
|
-
//
|
|
14558
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/compile.js
|
|
14559
14559
|
var INVALID = /* @__PURE__ */ Symbol.for("zod.compile.invalid");
|
|
14560
14560
|
var FALLBACK_FLAG = /* @__PURE__ */ Symbol.for("zod.compile.fallback");
|
|
14561
14561
|
var ZodCompileAsyncError = class extends Error {
|
|
@@ -16165,7 +16165,7 @@ function generateTransformCheck(doc, ctx, schema, accessor) {
|
|
|
16165
16165
|
return accessor;
|
|
16166
16166
|
}
|
|
16167
16167
|
|
|
16168
|
-
//
|
|
16168
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/api.js
|
|
16169
16169
|
function snapshotChecks(def) {
|
|
16170
16170
|
if (def.checks)
|
|
16171
16171
|
def.checks = [...def.checks];
|
|
@@ -17224,7 +17224,7 @@ function _stringFormat(Class2, format, fnOrRegex, _params = {}) {
|
|
|
17224
17224
|
return inst;
|
|
17225
17225
|
}
|
|
17226
17226
|
|
|
17227
|
-
//
|
|
17227
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/to-json-schema.js
|
|
17228
17228
|
function assignProps(target, ...sources) {
|
|
17229
17229
|
for (const source of sources) {
|
|
17230
17230
|
for (const key of Reflect.ownKeys(source)) {
|
|
@@ -17754,7 +17754,7 @@ var createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) =
|
|
|
17754
17754
|
return finalize(ctx, schema);
|
|
17755
17755
|
};
|
|
17756
17756
|
|
|
17757
|
-
//
|
|
17757
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/json-schema-processors.js
|
|
17758
17758
|
var narrowMin = (agg, key, value) => {
|
|
17759
17759
|
if (agg[key] === void 0 || value > agg[key])
|
|
17760
17760
|
agg[key] = value;
|
|
@@ -18502,7 +18502,7 @@ function toJSONSchema(input2, params) {
|
|
|
18502
18502
|
return finalize(ctx, input2);
|
|
18503
18503
|
}
|
|
18504
18504
|
|
|
18505
|
-
//
|
|
18505
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/json-schema-generator.js
|
|
18506
18506
|
var JSONSchemaGenerator = class {
|
|
18507
18507
|
/** @deprecated Access via ctx instead */
|
|
18508
18508
|
get metadataRegistry() {
|
|
@@ -18580,10 +18580,10 @@ var JSONSchemaGenerator = class {
|
|
|
18580
18580
|
}
|
|
18581
18581
|
};
|
|
18582
18582
|
|
|
18583
|
-
//
|
|
18583
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/json-schema.js
|
|
18584
18584
|
var json_schema_exports = {};
|
|
18585
18585
|
|
|
18586
|
-
//
|
|
18586
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/classic/schemas.js
|
|
18587
18587
|
var schemas_exports2 = {};
|
|
18588
18588
|
__export(schemas_exports2, {
|
|
18589
18589
|
ZodAny: () => ZodAny,
|
|
@@ -18764,7 +18764,7 @@ __export(schemas_exports2, {
|
|
|
18764
18764
|
xor: () => xor
|
|
18765
18765
|
});
|
|
18766
18766
|
|
|
18767
|
-
//
|
|
18767
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/classic/checks.js
|
|
18768
18768
|
var checks_exports2 = {};
|
|
18769
18769
|
__export(checks_exports2, {
|
|
18770
18770
|
endsWith: () => _endsWith,
|
|
@@ -18799,7 +18799,7 @@ __export(checks_exports2, {
|
|
|
18799
18799
|
uppercase: () => _uppercase
|
|
18800
18800
|
});
|
|
18801
18801
|
|
|
18802
|
-
//
|
|
18802
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/classic/errors.js
|
|
18803
18803
|
var _installedErrorProtos = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);
|
|
18804
18804
|
function _lazyMethod(proto, key, make) {
|
|
18805
18805
|
Object.defineProperty(proto, key, {
|
|
@@ -18845,7 +18845,7 @@ var ZodRealError = /* @__PURE__ */ $constructor("ZodError", initializer2, void 0
|
|
|
18845
18845
|
Parent: Error
|
|
18846
18846
|
});
|
|
18847
18847
|
|
|
18848
|
-
//
|
|
18848
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/classic/parse.js
|
|
18849
18849
|
var parse2 = /* @__PURE__ */ _parse(ZodRealError);
|
|
18850
18850
|
var parseAsync2 = /* @__PURE__ */ _parseAsync(ZodRealError);
|
|
18851
18851
|
var safeParse2 = /* @__PURE__ */ _safeParse(ZodRealError);
|
|
@@ -18859,7 +18859,7 @@ var safeDecode2 = /* @__PURE__ */ _safeDecode(ZodRealError);
|
|
|
18859
18859
|
var safeEncodeAsync2 = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
|
|
18860
18860
|
var safeDecodeAsync2 = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
|
|
18861
18861
|
|
|
18862
|
-
//
|
|
18862
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/classic/schemas.js
|
|
18863
18863
|
function _ensureDefaultLocale() {
|
|
18864
18864
|
if (!globalConfig.localeError)
|
|
18865
18865
|
config(en_default());
|
|
@@ -20324,7 +20324,7 @@ function preprocess(fn, schema) {
|
|
|
20324
20324
|
});
|
|
20325
20325
|
}
|
|
20326
20326
|
|
|
20327
|
-
//
|
|
20327
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/classic/compat.js
|
|
20328
20328
|
var ZodIssueCode = {
|
|
20329
20329
|
invalid_type: "invalid_type",
|
|
20330
20330
|
too_big: "too_big",
|
|
@@ -20350,7 +20350,7 @@ var ZodFirstPartyTypeKind;
|
|
|
20350
20350
|
/* @__PURE__ */ (function(ZodFirstPartyTypeKind2) {
|
|
20351
20351
|
})(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));
|
|
20352
20352
|
|
|
20353
|
-
//
|
|
20353
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/classic/iso.js
|
|
20354
20354
|
var iso_exports = {};
|
|
20355
20355
|
__export(iso_exports, {
|
|
20356
20356
|
ZodISODate: () => ZodISODate,
|
|
@@ -20375,7 +20375,7 @@ function duration2(params) {
|
|
|
20375
20375
|
return _isoDuration(ZodISODuration, params);
|
|
20376
20376
|
}
|
|
20377
20377
|
|
|
20378
|
-
//
|
|
20378
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/classic/from-json-schema.js
|
|
20379
20379
|
var z = {
|
|
20380
20380
|
...schemas_exports2,
|
|
20381
20381
|
...checks_exports2,
|
|
@@ -21108,7 +21108,7 @@ function fromJSONSchema(schema, params) {
|
|
|
21108
21108
|
return convertSchema(normalized, ctx);
|
|
21109
21109
|
}
|
|
21110
21110
|
|
|
21111
|
-
//
|
|
21111
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/visit.js
|
|
21112
21112
|
var RESOLVING = /* @__PURE__ */ Symbol("z.visit/resolving");
|
|
21113
21113
|
function visit(schema, fnOrHandlers) {
|
|
21114
21114
|
const fn = typeof fnOrHandlers === "function" ? fnOrHandlers : (node2, rewritten) => {
|
|
@@ -21263,7 +21263,7 @@ function visit(schema, fnOrHandlers) {
|
|
|
21263
21263
|
return run2(schema);
|
|
21264
21264
|
}
|
|
21265
21265
|
|
|
21266
|
-
//
|
|
21266
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/classic/deep-partial.js
|
|
21267
21267
|
function deepPartial(schema) {
|
|
21268
21268
|
return visit(schema, {
|
|
21269
21269
|
object: (s) => s.partial(),
|
|
@@ -21275,7 +21275,7 @@ function deepPartial(schema) {
|
|
|
21275
21275
|
});
|
|
21276
21276
|
}
|
|
21277
21277
|
|
|
21278
|
-
//
|
|
21278
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/classic/in-out.js
|
|
21279
21279
|
function withChecks(side, checks) {
|
|
21280
21280
|
if (!checks?.length)
|
|
21281
21281
|
return side;
|
|
@@ -21305,7 +21305,7 @@ function output(schema) {
|
|
|
21305
21305
|
});
|
|
21306
21306
|
}
|
|
21307
21307
|
|
|
21308
|
-
//
|
|
21308
|
+
// node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/classic/coerce.js
|
|
21309
21309
|
var coerce_exports = {};
|
|
21310
21310
|
__export(coerce_exports, {
|
|
21311
21311
|
bigint: () => bigint3,
|
|
@@ -80,4 +80,4 @@ Error generating stack: `+e.message+`
|
|
|
80
80
|
`)}\n/rename 必须提供名称,其他命令无需参数。输入 // 可发送以 / 开头的普通消息。`};if(n===`status`)return i.openStatus(),{message:`已打开状态诊断;可在面板中刷新或核对提交。`};if(i.project?.id!==t.project?.id||i.selectedId!==t.selectedId)return{error:!0,message:`当前项目或会话已切换,请重新选择命令。`};let a=jC(n,i);if(a)return{error:!0,message:a};if(n===`rename`){let e=ze(r);if(e)return{error:!0,message:e}}let o=i.thread,s=`/api/threads/${encodeURIComponent(o?.id??``)}`;try{if(n===`export`){let{partial:e}=await i.exportThread(o.id);return{message:e?`已发起 Markdown 下载;存在未完成、状态待确认或截断内容,请查看文件内说明。`:`已发起已保存历史的 Markdown 下载。图片和内部记录的省略范围已在文件中说明。`}}let e;if(n===`new`)return{draftKey:i.openDraft(),message:`已打开新会话输入页,发送首条消息时创建会话。`};if(n===`fork`)e=await i.run(`fork`,o.id,`${s}/fork`,{settings:i.settings});else if(n===`review`)e=await i.run(`review`,o.id,`${s}/review`);else if(n===`rename`)e=await i.run(`rename`,o.id,`${s}/rename`,{name:r.trim()});else if(n===`resume`)i.onResumeAttempt(),e=await i.run(`resume`,o.id,`${s}/resume`),await i.refreshThread();else if(n===`compact`)e=await i.run(`compact`,o.id,`${s}/compact`);else{let t=o.turns.findLast(e=>al(e.status));e=await i.run(`interrupt`,o.id,`${s}/interrupt`,{expectedTurnId:t.id})}return MC(n,e)}catch(e){return{error:!0,message:gn(e)}}}}))}function PC(e){let[t,n]=(0,O.useState)({}),r=(0,O.useRef)(t),i=(0,O.useId)(),a=(0,O.useRef)(!1);$n(`composer`,()=>{if(a.current||Object.values(r.current).some(e=>e.images.some(e=>!e.dataUrl)))throw Error(`正在输入或读取图片,完成后会自动加载新版`);return r.current},e=>{r.current={...e,...r.current},n(r.current)});let o=(0,O.useRef)(-1/0),s=(0,O.useRef)(new Set),c=(0,O.useRef)(new Map),l=(0,O.useRef)(null),u=(0,O.useId)(),[d,f]=(0,O.useState)(!1),[p,m]=(0,O.useState)({key:``,text:``,selectedIndex:0,dismissed:!1}),[h,g]=(0,O.useState)({}),[_,v]=(0,O.useState)([]),y=e.draftKey,b=(0,O.useRef)(new WeakSet);(0,O.useEffect)(()=>{for(let t of Object.values(e.sentDrafts))b.current.has(t)||(b.current.add(t),c.current.get(t.key)?.text.replace(/^(\s*)\/\//,`$1/`)===t.text&&te(t.key))},[e.sentDrafts]),(0,O.useEffect)(()=>{a.current=!1,o.current=-1/0,m({key:``,text:``,selectedIndex:0,dismissed:!1})},[y]);let x=t[y]??sb,{text:S,images:C}=x,w=DC(S),T=OC(e.commands,S),E=p.key===y&&p.text===S?p:void 0,D=Math.min(E?.selectedIndex??0,Math.max(0,T.length-1)),k=!!(w&&d&&!E?.dismissed),A=k?T[D]:e.commands.find(e=>e.name===w?.name),j=_.includes(y);function M(e){m({key:y,text:S,selectedIndex:e,dismissed:!1})}function N(){m({key:y,text:S,selectedIndex:D,dismissed:!0})}async function ee(t){if(s.current.has(y)||a.current)return;let n=r.current[y]??sb,i=DC(n.text);if(!i)return;let o=t?`/${t.name}${i.arguments?` ${i.arguments}`:``}`:n.text,c=n.images.length?`Slash 命令不能附带图片。请先移除图片,或改为普通消息。`:kC(o,e.commands);if(c){g(e=>({...e,[y]:{message:c,error:!0}}));return}let l=e.commands.find(e=>e.name===DC(o)?.name);if(l){s.current.add(y),v(e=>[...e,y]),g(e=>({...e,[y]:{message:`正在执行 /${l.name}…`}})),N();try{let e=await l.run(DC(o)?.arguments);g(t=>({...t,[y]:e,[e.draftKey??y]:e})),e.error||F(y,e=>({...e,text:e.text===n.text?``:e.text}))}catch(e){g(t=>({...t,[y]:{error:!0,message:e instanceof Error?e.message:`命令执行失败,请重试。`}}))}finally{s.current.delete(y),v(e=>e.filter(e=>e!==y))}}}let P=C.some(e=>!e.dataUrl);function F(e,t){let i={...r.current,[e]:t(r.current[e]??sb)};r.current=i,n(i)}function te(e){let t=c.current.get(e);t&&(c.current.delete(e),F(e,e=>({text:e.text===t.text?``:e.text,images:e.images.filter(e=>!t.images.some(t=>t.id===e.id)),error:e.error===t.error?void 0:e.error})))}function I(e){if(e.defaultPrevented)return;let t=Array.from(e.clipboardData.files);if(!t.length)return;e.preventDefault();let n=cb(t,(r.current[y]??sb).images);if(n){F(y,e=>({...e,error:n}));return}let i=t.map(e=>({id:crypto.randomUUID(),name:e.name||`粘贴的图片`,size:e.size})),a=e.clipboardData.getData(`text/plain`),o=e.currentTarget.selectionStart,s=e.currentTarget.selectionEnd;F(y,e=>({text:a?(e.text.slice(0,o)+a+e.text.slice(s)).slice(0,1e5):e.text,images:[...e.images,...i]})),t.forEach((e,t)=>{let n=i[t].id;lb(e).then(e=>F(y,t=>({...t,images:t.images.map(t=>t.id===n?{...t,dataUrl:e}:t)})),()=>F(y,e=>e.images.some(e=>e.id===n)?{...e,images:e.images.filter(e=>e.id!==n),error:`图片读取失败,请重新粘贴。`}:e))})}let ne=!!(e.thread?.managed&&al(e.thread.status)),L=e.thread&&!e.thread.managed&&!e.thread.archived,R=L?e.thread?.resumeError:void 0,z=R?.code===`THREAD_IN_USE`,re=!(!e.thread&&!e.projectId||e.threadLoading||L||!S.trim()&&!C.length||P||e.disabled||e.submitting);async function ie(){if(w){await ee(k?T[D]:void 0);return}if(!re||s.current.has(y))return;let t=r.current[y]??sb;if(!t.text.trim()&&!t.images.length||t.images.some(e=>!e.dataUrl))return;s.current.add(y),c.current.set(y,t);let n=t.text,i=t.images;try{await e.onSend(n.replace(/^(\s*)\/\//,`$1/`),ne,i.length?i.map(e=>e.dataUrl):void 0)&&te(y)}finally{s.current.delete(y)}}return(0,W.jsxs)(`div`,{className:`composer-region`,children:[e.submitting&&(0,W.jsxs)(`p`,{className:`composer-resume-status`,role:`status`,children:[(0,W.jsx)(J,{name:`refresh`,size:14}),e.thread?`正在提交消息…`:`正在创建会话并发送首条消息…`]}),L&&e.resuming&&(0,W.jsxs)(`p`,{className:`composer-resume-status`,role:`status`,children:[(0,W.jsx)(J,{name:`refresh`,size:14}),`正在恢复会话…`]}),L&&e.resumeAttempted&&!e.resuming&&!R&&e.canResume&&(0,W.jsx)(q,{size:`sm`,variant:`secondary`,onClick:e.onResume,children:`重试恢复`}),R&&!e.resuming&&(0,W.jsxs)(`div`,{className:`session-resume-notice`,role:`status`,children:[(0,W.jsx)(`strong`,{children:z?`此会话正被其他进程使用`:`无法恢复会话`}),(0,W.jsx)(`p`,{children:z?`可以 Fork 已保存的历史继续对话,或在原进程释放会话后重试。新会话使用同一项目目录。`:R.message}),z&&(0,W.jsxs)(q,{size:`sm`,variant:`secondary`,disabled:!e.canFork,onClick:e.onFork,children:[(0,W.jsx)(J,{name:`fork`,size:14}),e.forking?`正在确认 Fork…`:`Fork 为新会话`]}),(0,W.jsx)(q,{size:`sm`,disabled:!e.canResume,onClick:e.onResume,children:`重试恢复`})]}),(0,W.jsxs)(`div`,{className:`composer-box`,children:[h[y]&&(0,W.jsx)(`p`,{className:`slash-feedback`,role:h[y].error?`alert`:`status`,children:h[y].message}),k&&(0,W.jsx)(EC,{id:u,commands:T,selectedIndex:D,onSelect:M,onExecute:e=>{l.current?.focus(),ee(e)}}),C.length>0&&(0,W.jsx)(`ul`,{className:`composer-images`,"aria-label":`待发送的图片`,children:C.map((e,t)=>(0,W.jsxs)(`li`,{children:[e.dataUrl?(0,W.jsx)(`img`,{src:e.dataUrl,alt:`待发送的图片 ${t+1}`}):(0,W.jsx)(`span`,{role:`status`,children:`读取中…`}),(0,W.jsx)(Ic,{asChild:!0,content:e.name,children:(0,W.jsx)(`span`,{className:`composer-image-name`,children:e.name})}),(0,W.jsx)(q,{variant:`secondary`,size:`sm`,"aria-label":`移除图片 ${t+1}`,onClick:()=>F(y,t=>({...t,error:void 0,images:t.images.filter(t=>t.id!==e.id)})),children:(0,W.jsx)(J,{name:`close`,size:13})})]},e.id))}),x.error&&(0,W.jsx)(`p`,{className:`composer-image-error`,role:`alert`,children:x.error}),(0,W.jsx)(`textarea`,{ref:l,"aria-label":ne?`追加要求`:`任务内容`,"aria-haspopup":`listbox`,"aria-controls":k?u:void 0,"aria-autocomplete":`list`,"aria-activedescendant":k&&T[D]?`${u}-${T[D].name}`:void 0,value:S,readOnly:!!e.thread?.archived,placeholder:e.thread?.archived?`取消归档后可继续对话…`:ne?`补充要求或调整方向…`:`描述任务、粘贴图片,或输入 / 查看命令…`,maxLength:1e5,onChange:e=>{F(y,t=>({...t,text:e.target.value})),m({key:y,text:e.target.value,selectedIndex:0,dismissed:!1}),g(e=>{let t={...e};return delete t[y],t})},onPaste:I,onFocus:()=>f(!0),onCompositionStart:()=>{a.current=!0},onCompositionEnd:()=>{a.current=!1,o.current=performance.now()},onBlur:()=>{f(!1),a.current=!1,o.current=-1/0},onKeyDown:e=>{if((!e.defaultPrevented||k&&e.key===`Escape`)&&!(e.nativeEvent.isComposing||e.nativeEvent.keyCode===229||a.current)){if(performance.now()-o.current<100)e.key===`Enter`&&!e.shiftKey&&e.preventDefault();else{if(k&&!e.shiftKey&&!e.altKey&&!e.metaKey&&!e.ctrlKey){if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault(),T.length&&M((D+(e.key===`ArrowDown`?1:-1)+T.length)%T.length);return}if(e.key===`Escape`){e.preventDefault(),N();return}}e.key!==`Enter`||e.shiftKey||(e.preventDefault(),!e.repeat&&ie())}}},onKeyUp:e=>{e.key===`Enter`&&(o.current=-1/0)},rows:3}),(0,W.jsxs)(TC,{settings:e.settings,projectName:e.projectName,models:e.models,onChange:e.onSettings,onSaveModelDefaults:e.onSaveModelDefaults,savingModelDefaults:e.savingModelDefaults,thread:e.thread,projectId:e.projectId,runtimeKey:e.runtimeKey,threadLoading:e.threadLoading,disabled:e.disabled||!!e.threadLoading||ne||e.submitting||e.resuming||e.forking,children:[ne&&(0,W.jsx)(Ic,{content:`中断`,children:(0,W.jsxs)(q,{"aria-label":e.interrupting?`请求中…`:`中断`,variant:`secondary`,size:`sm`,onClick:e.onInterrupt,disabled:!e.canInterrupt||e.interrupting,children:[(0,W.jsx)(J,{name:`stop`,size:13}),(0,W.jsx)(`span`,{className:`composer-action-label`,children:e.interrupting?`请求中…`:`中断`})]})}),(0,W.jsx)(Ic,{id:i,className:`composer-submit`,content:w?`Enter 执行命令 / Esc 关闭菜单`:`Enter 发送 / Shift + Enter 换行`,children:(0,W.jsxs)(q,{size:`sm`,"aria-label":w?j?`正在执行命令…`:`执行命令`:e.submitting?`正在提交…`:ne?`追加要求`:`发送任务`,"aria-describedby":i,onPointerDown:e=>{w&&e.preventDefault()},onClick:()=>{ie()},disabled:w?j||!!A?.unavailableReason:!re,children:[(0,W.jsx)(J,{name:`send`,size:14}),(0,W.jsx)(`span`,{className:`composer-action-label`,children:w?j?`正在执行…`:`执行命令`:e.submitting?`正在提交…`:ne?`追加要求`:`发送任务`})]})})]})]}),(0,W.jsx)(`p`,{className:`composer-note`,children:ne?`关闭页面不会停止任务。中断以 Codex 返回的实际状态为准。`:`Codex 使用服务器项目与权限执行,请核对操作和变更。`})]})}var FC={read:`读取`,write:`写入`,deny:`禁止访问`};function IC({request:e}){let t=e.fileSystem,n=[...t?.read.map(e=>({path:e,access:`read`}))??[],...t?.write.map(e=>({path:e,access:`write`}))??[],...t?.entries??[]];return(0,W.jsxs)(`div`,{className:`permission-details`,children:[e.network!==void 0&&(0,W.jsxs)(`div`,{className:`permission-network`,children:[(0,W.jsx)(`strong`,{children:`网络访问`}),(0,W.jsx)(`span`,{children:e.network===!0?`允许访问网络`:e.network===!1?`不开放额外网络访问`:`未指定网络访问变更`})]}),n.length>0&&(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`h4`,{children:`文件与目录`}),(0,W.jsx)(`ul`,{className:`permission-paths`,children:n.map((e,t)=>(0,W.jsxs)(`li`,{children:[(0,W.jsx)(`span`,{className:`permission-access permission-access-${e.access}`,children:FC[e.access]??e.access}),(0,W.jsx)(`code`,{children:e.path})]},`${e.access}-${e.path}-${t}`))})]}),t?.globScanMaxDepth!==void 0&&(0,W.jsxs)(`p`,{children:[`目录匹配搜索深度:`,t.globScanMaxDepth]}),e.network===void 0&&n.length===0&&(0,W.jsx)(`p`,{children:`未请求额外网络或文件访问权限。`})]})}var LC=class extends Error{code;status;details;constructor(e,t,n=400,r){super(t),this.code=e,this.status=n,this.details=r,this.name=`AppError`}toJSON(e){return{code:this.code,message:this.message,...e?{clientOperationId:e}:{},...this.details===void 0?{}:{details:this.details}}}},RC=e=>{throw new LC(`VALIDATION_ERROR`,e)};function zC(e){if(!/^\d{4}-\d{2}-\d{2}$/.test(e))return!1;let t=new Date(`${e}T00:00:00.000Z`);return Number.isFinite(t.getTime())&&t.toISOString().slice(0,10)===e}function BC(e,t){switch(e){case`email`:return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t);case`uri`:try{return!/\s/.test(t)&&!!new URL(t).protocol}catch{return!1}case`date`:return zC(t);case`date-time`:{let e=/^(\d{4}-\d{2}-\d{2})[Tt](\d{2}):(\d{2}):(\d{2})(?:\.\d+)?(?:[Zz]|[+-](\d{2}):(\d{2}))$/.exec(t);return!!(e&&zC(e[1])&&Number(e[2])<=23&&Number(e[3])<=59&&Number(e[4])<=59&&(e[5]===void 0||Number(e[5])<=23)&&(e[6]===void 0||Number(e[6])<=59)&&Number.isFinite(Date.parse(t)))}default:return!0}}function VC(e,t){let n=()=>RC(`“${e.title}”的回答不符合字段要求`);switch(e.type){case`string`:if(typeof t!=`string`)n();else{let r=[...t].length;(e.minLength!==void 0&&r<e.minLength||e.maxLength!==void 0&&r>e.maxLength||t.length>1e4||!BC(e.format,t))&&n()}break;case`number`:case`integer`:(typeof t!=`number`||!Number.isFinite(t)||e.type===`integer`&&!Number.isSafeInteger(t)||e.minimum!==void 0&&t<e.minimum||e.maximum!==void 0&&t>e.maximum)&&n();break;case`boolean`:typeof t!=`boolean`&&n();break;case`enum`:(typeof t!=`string`||t.length>1e4||!e.options?.some(e=>e.value===t))&&n();break;case`multiEnum`:(!Array.isArray(t)||t.some(t=>typeof t!=`string`||t.length>1e4||!e.options?.some(e=>e.value===t))||t.length>500||new Set(t).size!==t.length||e.minItems!==void 0&&t.length<e.minItems||e.maxItems!==void 0&&t.length>e.maxItems)&&n()}}function HC(e){switch(e){case`pending`:return`需要你处理`;case`responding`:return`正在提交…`;case`responded`:return`已处理`;case`expired`:return`请求已失效`}}function UC(e){return Object.fromEntries(e.filter(e=>e.default!==void 0).map(e=>[e.name,typeof e.default==`number`?String(e.default):e.default]))}function WC(e){let t=[];return e.type===`integer`&&t.push(`填写整数`),e.minimum!==void 0&&t.push(`最小 ${e.minimum}`),e.maximum!==void 0&&t.push(`最大 ${e.maximum}`),e.minLength!==void 0&&t.push(`至少 ${e.minLength} 个字符`),e.maxLength!==void 0&&t.push(`最多 ${e.maxLength} 个字符`),e.minItems!==void 0&&t.push(`至少选择 ${e.minItems} 项`),e.maxItems!==void 0&&t.push(`最多选择 ${e.maxItems} 项`),e.format===`date-time`&&t.push(`日期与时间需包含时区,例如 2026-10-14T12:30:00+08:00`),t.join(` · `)}function GC(e,t){let n=Object.create(null),r=Object.create(null);for(let i of e){let e=Object.hasOwn(t,i.name)?t[i.name]:void 0;if(e===void 0||(i.type===`number`||i.type===`integer`)&&e===``){i.required&&(r[i.name]=`请填写此必填项。`);continue}let a=i.type===`number`||i.type===`integer`?Number(e):e;try{VC(i,a),n[i.name]=a}catch(e){r[i.name]=e instanceof Error?e.message:`请检查此字段的填写要求。`}}return{content:n,errors:r}}function KC(e){if(e)try{let t=new URL(e);return(t.protocol===`https:`||t.protocol===`http:`)&&!t.username&&!t.password?t.href:void 0}catch{return}}function qC({request:e,actionId:t,status:n,disabled:r,onResolve:i}){let a=e.fields??[],o=n===`pending`?e.approval?`允许本次`:e.mode===`url`?`我已完成`:a.length===0?`确认继续`:a.every(e=>[`boolean`,`enum`,`multiEnum`].includes(e.type))?`确认选择`:`提交回答`:HC(n),[s,c]=(0,O.useState)(()=>UC(a)),[l,u]=(0,O.useState)(!1),{content:d,errors:f}=GC(a,s),p=KC(e.url),m=e.schemaError||(e.mode===`url`&&!p?`此请求没有可安全打开的 HTTP 或 HTTPS 地址,无法确认完成。`:void 0),h=(e,t)=>c(n=>({...n,[e]:t}));return(0,W.jsxs)(`form`,{className:`elicitation-form`,noValidate:!0,onSubmit:t=>{t.preventDefault(),!(r||m)&&(u(!0),!(e.mode===`form`&&Object.keys(f).length>0)&&i(e.mode===`form`&&!e.approval?{decision:`accept`,content:d}:{decision:`accept`}))},children:[(0,W.jsxs)(`p`,{className:`elicitation-source`,children:[`来源:`,(0,W.jsx)(`strong`,{children:e.serverName})]}),e.approval?.allowSession&&(0,W.jsx)(`p`,{className:`elicitation-scope subtle`,children:`本会话允许仅适用于当前请求对应的工具或连接范围,并受审批策略约束;新会话需重新确认。`}),m&&(0,W.jsx)(`p`,{className:`elicitation-error`,role:`alert`,children:m}),e.mode===`url`?(0,W.jsxs)(`div`,{className:`elicitation-url`,children:[(0,W.jsx)(`span`,{children:`访问地址`}),(0,W.jsx)(`code`,{children:e.url??`未提供地址`}),p&&(0,W.jsx)(`a`,{href:p,target:`_blank`,rel:`noopener noreferrer`,referrerPolicy:`no-referrer`,children:`在新标签页打开`}),(0,W.jsx)(`p`,{children:`完成页面中的操作后,点击“我已完成”继续。`})]}):!m&&(0,W.jsx)(`div`,{className:`elicitation-fields`,children:a.map((e,n)=>{let i=`elicitation-${t}-${n}`,a=WC(e),o=l?f[e.name]:void 0,c=Object.hasOwn(s,e.name)?s[e.name]:void 0,u=[e.description&&`${i}-description`,a&&`${i}-hint`,o&&`${i}-error`].filter(Boolean).join(` `)||void 0;return(0,W.jsxs)(`div`,{className:`elicitation-field`,children:[(0,W.jsxs)(`div`,{className:`elicitation-field-heading`,children:[(0,W.jsxs)(`label`,{id:`${i}-label`,htmlFor:e.type===`multiEnum`?void 0:i,children:[e.title,(0,W.jsx)(`span`,{className:`field-necessity`,"aria-hidden":`true`,children:e.required?`必填`:`可选`})]}),!e.required&&c!==void 0&&(0,W.jsxs)(`button`,{type:`button`,className:`field-unset`,disabled:r,onClick:()=>h(e.name,void 0),children:[`不填写`,(0,W.jsx)(`span`,{className:`sr-only`,children:e.title})]})]}),e.description&&(0,W.jsx)(`p`,{id:`${i}-description`,className:`field-description`,children:e.description}),e.type===`boolean`||e.type===`enum`?(0,W.jsxs)(`select`,{id:i,className:`text-input`,value:c===void 0?``:e.type===`boolean`?c?`true`:`false`:`option:${String(c)}`,disabled:r,"aria-required":e.required,"aria-invalid":!!o,"aria-describedby":u,onChange:t=>h(e.name,t.target.value===``?void 0:e.type===`boolean`?t.target.value===`true`:t.target.value.slice(7)),children:[(0,W.jsx)(`option`,{value:``,children:`请选择`}),e.type===`boolean`?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`option`,{value:`true`,children:`是`}),(0,W.jsx)(`option`,{value:`false`,children:`否`})]}):e.options?.map(e=>(0,W.jsx)(`option`,{value:`option:${e.value}`,children:e.label},e.value))]}):e.type===`multiEnum`?(0,W.jsx)(`div`,{role:`group`,"aria-labelledby":`${i}-label`,"aria-describedby":u,"aria-invalid":!!o,className:`elicitation-multi-options`,children:e.options?.map(t=>(0,W.jsxs)(`label`,{className:`question-option`,children:[(0,W.jsx)(`input`,{type:`checkbox`,disabled:r,checked:Array.isArray(c)&&c.includes(t.value),onChange:n=>{let r=Array.isArray(c)?c:[];h(e.name,n.target.checked?[...r,t.value]:r.filter(e=>e!==t.value))}}),(0,W.jsx)(`span`,{children:t.label})]},t.value))}):(0,W.jsx)(`input`,{id:i,className:`text-input`,type:e.type===`number`||e.type===`integer`?`number`:e.format===`email`?`email`:e.format===`uri`?`url`:e.format===`date`?`date`:`text`,value:typeof c==`string`?c:``,step:e.type===`integer`?1:`any`,min:e.minimum,max:e.maximum,disabled:r,"aria-required":e.required,"aria-invalid":!!o,"aria-describedby":u,placeholder:e.required?void 0:`未填写(可选)`,autoComplete:`off`,onChange:t=>h(e.name,t.target.value)}),a&&(0,W.jsx)(`p`,{id:`${i}-hint`,className:`field-hint`,children:a}),o&&(0,W.jsx)(`p`,{id:`${i}-error`,className:`elicitation-error`,role:`alert`,children:o})]},e.name)})}),l&&Object.keys(f).length>0&&!m&&(0,W.jsx)(`p`,{className:`elicitation-error`,role:`alert`,children:`请检查标出的字段后再提交。`}),(0,W.jsxs)(`div`,{className:`action-options`,children:[!m&&(0,W.jsx)(q,{type:`submit`,disabled:r,children:o}),!m&&e.approval?.allowSession&&(0,W.jsx)(q,{variant:`secondary`,disabled:r,onClick:()=>i({decision:`accept`,persist:`session`}),children:`本会话允许`}),(0,W.jsx)(q,{variant:`secondary`,disabled:r,onClick:()=>i({decision:`decline`}),children:`拒绝`}),(0,W.jsx)(q,{variant:`ghost`,disabled:r,onClick:()=>i({decision:`cancel`}),children:`取消`})]})]})}function JC({action:e,disabled:t,onResolve:n}){let[r,i]=(0,O.useState)({}),[a,o]=(0,O.useState)({}),s=e.status===`pending`,c=e.questions??[],l=e=>r[e]===`__other__`?a[e]?.trim()??``:r[e]?.trim()??``,u=c.length>0&&c.every(e=>l(e.id)),d=c.length>0&&c.every(e=>e.options.length>0&&r[e.id]!==`__other__`);return(0,W.jsxs)(`section`,{className:`action-card${e.kind===`unsupported`?` action-card-unsupported`:``}`,"aria-label":e.title,children:[(0,W.jsxs)(`div`,{className:`action-heading`,children:[(0,W.jsx)(`span`,{className:`action-icon`,children:(0,W.jsx)(J,{name:e.kind===`questions`?`chat`:`alert`,size:17})}),(0,W.jsx)(`h3`,{children:e.title}),(0,W.jsx)(`span`,{className:`action-state`,children:e.kind===`unsupported`&&e.status===`expired`?`请求未能处理`:HC(e.status)})]}),e.reason&&(0,W.jsx)(`p`,{children:e.reason}),e.cwd&&(0,W.jsxs)(`p`,{className:`mono subtle action-cwd`,children:[(0,W.jsx)(`span`,{children:`工作目录:`}),e.cwd]}),e.command&&(0,W.jsx)(`pre`,{className:`command`,children:(0,W.jsx)(`code`,{children:e.command})}),e.kind===`permissions`&&e.permissionRequest&&(0,W.jsx)(IC,{request:e.permissionRequest}),e.details!==void 0&&(0,W.jsxs)(`details`,{className:`raw-details`,open:e.kind===`network`||e.kind===`file`||void 0,children:[(0,W.jsx)(`summary`,{children:e.kind===`network`?`网络访问目标`:e.kind===`file`?`变更详情`:e.kind===`permissions`||e.kind===`elicitation`?`技术详情`:`请求详情`}),(0,W.jsx)(`pre`,{children:JSON.stringify(e.details,null,2)})]}),e.kind===`elicitation`&&e.elicitation?(0,W.jsx)(qC,{request:e.elicitation,actionId:e.actionId,status:e.status,disabled:t||!s,onResolve:n}):e.kind===`questions`?(0,W.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),!t&&s&&u&&n({answers:Object.fromEntries(c.map(e=>[e.id,[l(e.id)]]))})},children:[c.map(n=>(0,W.jsxs)(`fieldset`,{disabled:t||!s,children:[(0,W.jsx)(`legend`,{children:n.header}),(0,W.jsx)(`p`,{children:n.question}),n.options.map((t,a)=>(0,W.jsxs)(`label`,{className:`question-option`,children:[(0,W.jsx)(`input`,{type:`radio`,name:`${e.actionId}-${n.id}`,value:t.label,checked:r[n.id]===t.label,onChange:()=>i(e=>({...e,[n.id]:t.label}))}),(0,W.jsxs)(`span`,{children:[(0,W.jsx)(`strong`,{children:t.label}),(0,W.jsx)(`small`,{children:t.description})]}),(0,W.jsx)(`span`,{className:`option-number`,children:a+1})]},t.label)),n.options.length>0&&n.isOther&&(0,W.jsxs)(`label`,{className:`question-option`,children:[(0,W.jsx)(`input`,{type:`radio`,name:`${e.actionId}-${n.id}`,checked:r[n.id]===`__other__`,onChange:()=>i(e=>({...e,[n.id]:`__other__`}))}),(0,W.jsx)(`span`,{children:`其他回答`})]}),(n.options.length===0||r[n.id]===`__other__`)&&(0,W.jsx)(`input`,{className:`text-input`,type:n.isSecret?`password`:`text`,"aria-label":`${n.header}:自由回答`,value:n.options.length===0?r[n.id]??``:a[n.id]??``,maxLength:1e4,onChange:e=>n.options.length===0?i(t=>({...t,[n.id]:e.target.value})):o(t=>({...t,[n.id]:e.target.value})),placeholder:`输入你的回答`,autoComplete:`off`})]},n.id)),(0,W.jsx)(q,{type:`submit`,disabled:t||!s||!u,children:s?d?`确认选择`:`提交回答`:HC(e.status)})]}):(0,W.jsx)(`div`,{className:`action-options`,children:e.options.map(e=>(0,W.jsx)(q,{variant:/decline|cancel|reject|deny/i.test(e.id)?`secondary`:`default`,disabled:t||!s,onClick:()=>n({decision:e.id}),children:e.label},e.id))}),e.kind===`unsupported`&&(0,W.jsx)(`p`,{className:`inline-error`,children:`当前版本不支持此交互请求,未发送批准。请查看兼容性诊断。`})]})}var YC={connecting:`正在连接`,connected:`实时连接正常`,disconnected:`连接已断开`,authenticationRequired:`需要重新登录`},XC={accepted:`网关已接受`,dispatching:`等待上游确认`,acknowledged:`上游已确认提交`,failed:`提交失败`,unknown:`提交结果待核对`};function ZC({connection:e}){return(0,W.jsxs)(`span`,{className:`connection-badge connection-${e}`,children:[(0,W.jsx)(`span`,{className:`status-dot`}),YC[e]]})}function QC({entry:e,thread:t,onReconcile:n,onDiscardMissing:r,busy:i,refreshing:a}){let[o,s]=(0,O.useState)(!1),[c,l]=(0,O.useState)(!1),u=e.operation?.execution,d=e.kind===`fork`,f=!!(t&&al(t.status)&&u?.threadId===t.id),p=!!(!d&&t&&al(t.status)&&e.target===t.id);return(0,W.jsxs)(`div`,{className:`operation-card`,children:[(0,W.jsxs)(`div`,{className:`operation-title`,children:[(0,W.jsx)(`strong`,{children:XC[e.status]}),(0,W.jsx)(`span`,{children:hn(e.createdAt)})]}),(0,W.jsxs)(`dl`,{children:[(0,W.jsx)(`dt`,{children:`操作`}),(0,W.jsx)(`dd`,{children:e.kind}),(0,W.jsx)(`dt`,{children:`目标`}),(0,W.jsx)(`dd`,{children:e.target}),(0,W.jsx)(`dt`,{children:`操作 ID`}),(0,W.jsx)(`dd`,{children:e.clientOperationId}),u&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`dt`,{children:`会话`}),(0,W.jsx)(`dd`,{children:u.threadId}),(0,W.jsx)(`dt`,{children:`工作区`}),(0,W.jsx)(`dd`,{children:u.workspaceKey}),(0,W.jsx)(`dt`,{children:`运行状态`}),(0,W.jsx)(`dd`,{children:u.ended?`已经结束`:`尚未确认终结`})]})]}),(e.lookupError?.message||e.error)&&(0,W.jsx)(`p`,{className:`inline-error`,role:`alert`,children:e.lookupError?.message??e.error}),bn(e)&&(0,W.jsxs)(`div`,{className:`reconcile`,children:[(0,W.jsx)(`p`,{children:`请先检查会话历史、会话列表和原执行环境。清理仅移除此浏览器的待核对记录,不会停止任务或重新提交。`}),p?(0,W.jsx)(`p`,{children:`当前会话仍在执行,请等待结束或正常中断后再核对。`}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`label`,{children:[(0,W.jsx)(`input`,{type:`checkbox`,checked:c,onChange:e=>l(e.target.checked)}),`我已检查历史和原执行环境,确认无需继续核对这笔提交`]}),(0,W.jsx)(q,{variant:`secondary`,size:`sm`,disabled:!c||i||a,onClick:()=>r(e.clientOperationId),children:`清除此浏览器的待核对记录`})]})]}),e.kind===`confirmCompatibility`&&e.status===`unknown`&&(0,W.jsx)(`p`,{className:`subtle`,children:`兼容性确认结果待核对,请刷新状态。此记录不代表任务执行,也不会自动重新提交。`}),e.kind!==`confirmCompatibility`&&Cn(e)&&!e.lookupError?.missing&&!e.operation?.reconciliation&&(0,W.jsxs)(`div`,{className:`reconcile`,children:[(0,W.jsx)(`p`,{children:d?`请先刷新会话列表,检查是否已生成包含原历史的新会话。核对此次 Fork 不会停止原任务或改变原任务的执行状态。`:`不会自动重发任务。先检查会话历史和原执行环境,再核对这笔提交。`}),f?(0,W.jsx)(`p`,{children:`当前任务仍在执行,请使用输入区的中断按钮。`}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`label`,{children:[(0,W.jsx)(`input`,{type:`checkbox`,checked:o,onChange:e=>s(e.target.checked)}),d?`我已检查会话列表和历史,核实此次 Fork 的结果`:`我已核实对应旧运行已经结束`]}),(0,W.jsx)(q,{variant:`secondary`,size:`sm`,disabled:!o||i||a,onClick:()=>n(e.clientOperationId),children:i?`正在提交核对…`:d?`核对此次 Fork`:`核对并解除旧占用`})]})]}),e.operation?.reconciliation&&(0,W.jsxs)(`p`,{className:`subtle`,children:[`已于 `,hn(e.operation.reconciliation.at),` `,d?`人工核对 Fork 结果。原任务状态不变。`:`人工核对旧运行结束。`,`保留原始提交状态。`]})]})}function $C({system:e,connection:t,operations:n,thread:r,onRefresh:i,onReconcile:a,onDiscardMissing:o,busy:s,open:c,onOpenChange:l,refreshing:u}){let d=(0,O.useRef)(null);return(0,O.useEffect)(()=>{c&&d.current?.focus()},[c]),(0,W.jsxs)(`details`,{className:`diagnostics`,open:c,onToggle:e=>l(e.currentTarget.open),children:[(0,W.jsxs)(`summary`,{children:[(0,W.jsx)(J,{name:`settings`,size:16}),`状态诊断`,n.length>0&&(0,W.jsx)(`span`,{className:`count-badge`,children:n.length})]}),(0,W.jsxs)(`div`,{className:`diagnostics-panel`,id:`diagnostics-panel`,ref:d,tabIndex:-1,role:`region`,"aria-label":`状态诊断详情`,"aria-busy":u,children:[(0,W.jsxs)(`div`,{className:`diagnostics-heading`,children:[(0,W.jsx)(`h2`,{children:`运行状态`}),(0,W.jsxs)(q,{variant:`ghost`,size:`sm`,disabled:u,onClick:i,children:[(0,W.jsx)(J,{name:`refresh`,size:14}),u?`正在核对…`:`刷新状态`]})]}),(0,W.jsxs)(`section`,{className:`operation-section`,children:[(0,W.jsx)(`h3`,{children:`操作与状态核对`}),(0,W.jsx)(`p`,{className:`subtle`,role:`status`,children:u?`正在核对会话历史和提交回执…`:r?.status===`unknown`?`会话状态仍待核对。请检查操作记录和原执行环境。`:n.length>0?`请查看提交记录;核对不会自动重发任务。`:`没有待核对的提交。`}),n.map(e=>(0,W.jsx)(QC,{entry:e,thread:r,onReconcile:a,onDiscardMissing:o,busy:s.includes(`reconcile:${e.clientOperationId}`)||s.includes(`${e.kind}:${e.target}`),refreshing:u},e.clientOperationId))]}),(0,W.jsxs)(`dl`,{children:[(0,W.jsx)(`dt`,{children:`网页连接`}),(0,W.jsx)(`dd`,{children:YC[t]}),(0,W.jsx)(`dt`,{children:`Codex`}),(0,W.jsx)(`dd`,{children:e?.ready?`已就绪`:e?.connection===`starting`?`启动中`:`不可用`}),(0,W.jsx)(`dt`,{children:`账户认证`}),(0,W.jsx)(`dd`,{children:e?.authenticated===!0?`可用`:e?.authenticated===!1?`需要在本机登录 Codex`:`尚未确认`}),(0,W.jsx)(`dt`,{children:`运行版本`}),(0,W.jsx)(`dd`,{children:e?.codexVersion??`未检测到`}),(0,W.jsx)(`dt`,{children:`已验证版本`}),(0,W.jsx)(`dd`,{children:e?.verifiedVersion??`读取中`}),(0,W.jsx)(`dt`,{children:`兼容性`}),(0,W.jsx)(`dd`,{children:e?.compatibility===`verified`?`版本已验证`:e?.compatibility===`unverified`?e.compatibilityConfirmation===`confirmed`?`当前版本未经验证 · 已确认继续`:`当前版本未经验证 · 待确认`:`不可用`}),(0,W.jsx)(`dt`,{children:`入口认证`}),(0,W.jsx)(`dd`,{children:e?.authMode===`cloudflare-access`?`Cloudflare Access`:`本机模式`})]}),e?.error&&(0,W.jsx)(`p`,{className:`inline-error`,children:e.error}),e&&(0,W.jsxs)(`details`,{className:`raw-details`,children:[(0,W.jsx)(`summary`,{children:`已支持能力`}),(0,W.jsx)(`p`,{children:e.capabilities.join(` · `)||`暂无`})]})]})]})}async function ew(e){let t=await fetch(`/api/threads/${encodeURIComponent(e)}/export`,{credentials:`same-origin`,cache:`no-store`,headers:{Accept:`text/markdown`},signal:AbortSignal.timeout(35e3)}),n=t.headers.get(`content-type`)??``;if(!t.ok||!n.includes(`text/markdown`)){if(n.includes(`application/json`)){let e=await t.json();throw new Ee(t.status,e.error??{code:`EXPORT_FAILED`,message:`无法读取会话历史,未下载文件。`})}throw new Ee(t.status===200?401:t.status,{code:`AUTH_REQUIRED`,message:`登录已过期或历史接口未返回 Markdown,请重新登录后重试。`})}let r=/filename="(codex-thread-[A-Za-z0-9_-]+\.md)"/.exec(t.headers.get(`content-disposition`)??``)?.[1];if(!r)throw Error(`导出响应缺少有效文件名,未下载文件。`);let i=t.headers.get(`x-export-completeness`);if(i!==`partial`&&i!==`saved-history`)throw Error(`导出响应缺少历史完整性说明,未下载文件。`);let a=await t.blob(),o=URL.createObjectURL(a),s=document.createElement(`a`);s.href=o,s.download=r,document.body.append(s);try{s.click()}finally{s.remove(),setTimeout(()=>URL.revokeObjectURL(o),1e3)}return{partial:i===`partial`}}function tw(e){let{system:t}=e,n=(0,O.useRef)(null),[r,i]=(0,O.useState)(),[a,o]=(0,O.useState)(),s=jn(t),c=Nn(t,r,a);(0,O.useEffect)(()=>{e.onOpenChange?.(c)},[c,e.onOpenChange]),(0,O.useEffect)(()=>{let e=n.current;if(e)return c&&!e.open?e.showModal():!c&&e.open&&e.close(),()=>{e.open&&e.close()}},[c]);function l(){i(s),o(void 0)}return(0,W.jsxs)(W.Fragment,{children:[t?.compatibility===`unverified`&&(0,W.jsxs)(`div`,{className:`compatibility-banner compatibility-notice`,role:`status`,children:[(0,W.jsxs)(`span`,{children:[`当前 Codex `,t.codexVersion,` 尚未验证兼容性,部分功能可能无法正常使用。`,t.compatibilityConfirmation===`confirmed`?` 已确认继续;这不代表版本已验证。`:` 使用前需要确认。`]}),t.compatibilityConfirmation===`required`&&(0,W.jsx)(q,{variant:`ghost`,size:`sm`,onClick:()=>o(s),children:`查看兼容性提示`})]}),(0,W.jsxs)(`dialog`,{ref:n,className:`compatibility-dialog`,"aria-labelledby":`compatibility-title`,"aria-describedby":`compatibility-description`,onCancel:e=>{e.preventDefault(),l()},children:[(0,W.jsxs)(`div`,{className:`compatibility-dialog-heading`,children:[(0,W.jsx)(J,{name:`alert`,size:22}),(0,W.jsx)(`h2`,{id:`compatibility-title`,children:`Codex 版本兼容性未经验证`})]}),(0,W.jsx)(`p`,{id:`compatibility-description`,children:`当前运行的 Codex 版本尚未验证,部分功能可能无法正常使用。确认继续后仍将保留兼容性提示。`}),(0,W.jsxs)(`dl`,{children:[(0,W.jsx)(`dt`,{children:`运行版本`}),(0,W.jsx)(`dd`,{children:t?.codexVersion??`未检测到`}),(0,W.jsx)(`dt`,{children:`已验证版本`}),(0,W.jsx)(`dd`,{children:t?.verifiedVersion??`读取中`})]}),t?.ready?!e.canConfirm&&(0,W.jsx)(`p`,{className:`subtle`,role:`status`,children:`请等待连接和 Codex 认证恢复后再确认。`}):(0,W.jsx)(`p`,{className:`inline-error`,role:`status`,children:`Codex 当前不可用,无法确认继续。请关闭此提示后查看状态诊断。`}),e.error&&(0,W.jsx)(`p`,{className:`inline-error`,role:`alert`,children:e.error}),e.uncertain&&(0,W.jsxs)(`div`,{className:`compatibility-uncertain`,role:`status`,children:[(0,W.jsx)(`p`,{children:`确认请求的结果尚待核对。可刷新状态,或重新确认当前运行版本的使用许可;不会重发任务。`}),(0,W.jsx)(q,{variant:`secondary`,size:`sm`,onClick:e.onRefresh,children:`刷新确认状态`}),t?.ready&&(0,W.jsx)(q,{variant:`secondary`,size:`sm`,disabled:!e.canConfirm||e.submitting,onClick:e.onReconfirm,children:`重新确认`})]}),(0,W.jsx)(`p`,{className:`subtle`,children:`关闭提示后仍可查看诊断或中断当前任务。确认不会自动发送任务,未发送的草稿会保留。`}),(0,W.jsxs)(`div`,{className:`compatibility-dialog-actions`,children:[(0,W.jsx)(q,{variant:`secondary`,autoFocus:!0,onClick:l,children:`暂不使用`}),t?.ready&&(0,W.jsx)(q,{disabled:!e.canConfirm||e.submitting||e.uncertain,onClick:e.onConfirm,children:e.submitting?`正在确认…`:`确认继续`})]})]})]})}function nw(e){let t=(0,O.useRef)(null),n=(0,O.useRef)(!1),[r,i]=(0,O.useState)(``),[a,o]=(0,O.useState)(e.project?.name??``),[s,c]=(0,O.useState)(!1),[l,u]=(0,O.useState)(!1),[d,f]=(0,O.useState)(),p=e.disabled||l,m=s?`移除项目`:e.project?`管理项目`:`添加服务器项目`;(0,O.useEffect)(()=>{let e=t.current;return e?.showModal(),()=>e?.close()},[]);async function h(){if(!(p||n.current)){n.current=!0,u(!0),f(void 0);try{e.project?s?await e.onRemove(e.project.id):await e.onRename(e.project.id,a.trim()):await e.onAdd({path:r.trim(),...a.trim()?{name:a.trim()}:{}}),e.onClose()}catch(e){f(gn(e))}finally{n.current=!1,u(!1)}}}return(0,W.jsxs)(`dialog`,{ref:t,className:`project-dialog`,"aria-labelledby":`project-dialog-title`,"aria-describedby":`project-dialog-description`,onCancel:t=>{t.preventDefault(),l||e.onClose()},children:[(0,W.jsxs)(`div`,{className:`project-dialog-heading`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(J,{name:`folder`,size:20}),(0,W.jsx)(`h2`,{id:`project-dialog-title`,children:m})]}),(0,W.jsx)(q,{variant:`ghost`,size:`icon`,"aria-label":`关闭项目管理`,disabled:l,onClick:e.onClose,children:(0,W.jsx)(J,{name:`close`,size:17})})]}),(0,W.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),h()},children:[s?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`p`,{id:`project-dialog-description`,children:[`确定从工作空间移除「`,e.project?.name,`」?`]}),(0,W.jsxs)(`div`,{className:`project-removal-note`,children:[(0,W.jsx)(`p`,{children:`只移除项目列表中的记录,服务器上的文件和会话历史都会保留。`}),(0,W.jsx)(`p`,{children:`之后重新添加同一目录,即可继续访问原有会话。进行中的任务或未确认的操作需要先处理完成。`})]})]}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`p`,{id:`project-dialog-description`,children:e.project?`为项目设置便于识别的名称,或从工作空间移除项目。`:`添加运行 Codex Web UI 的服务器上已有的目录。添加后即可查看历史会话并开始工作。`}),e.project?(0,W.jsxs)(`div`,{className:`project-directory`,children:[(0,W.jsx)(`span`,{children:`服务器目录`}),(0,W.jsx)(`code`,{children:e.project.rootPath})]}):(0,W.jsxs)(`label`,{className:`project-field`,children:[(0,W.jsx)(`span`,{children:`服务器目录`}),(0,W.jsx)(`input`,{autoFocus:!0,required:!0,autoComplete:`off`,spellCheck:!1,placeholder:`/home/you/code/my-project`,value:r,onChange:e=>i(e.target.value),"aria-describedby":`project-path-help`,"aria-label":`服务器目录`,disabled:p}),(0,W.jsx)(`small`,{id:`project-path-help`,children:`填写服务器上的绝对路径,不是当前浏览器所在设备的目录。目录需要已存在,且服务有权访问。`})]}),(0,W.jsxs)(`label`,{className:`project-field`,children:[(0,W.jsx)(`span`,{children:e.project?`项目名称`:`项目名称(可选)`}),(0,W.jsx)(`input`,{autoFocus:!!e.project,required:!!e.project,maxLength:100,placeholder:`默认使用目录名称`,value:a,onChange:e=>o(e.target.value),disabled:p})]})]}),d&&(0,W.jsx)(`p`,{className:`inline-error project-dialog-error`,role:`alert`,children:d}),e.disabled&&(0,W.jsx)(`p`,{className:`subtle`,children:`登录已过期,请重新登录后管理项目。`}),(0,W.jsxs)(`div`,{className:`project-dialog-actions`,children:[e.project&&!s&&(0,W.jsx)(q,{className:`project-remove-button`,variant:`ghost`,disabled:p,onClick:()=>{f(void 0),c(!0)},children:`移除项目…`}),(0,W.jsx)(q,{variant:`secondary`,disabled:l,onClick:()=>{s?(f(void 0),c(!1)):e.onClose()},children:s?`返回`:`取消`}),(0,W.jsx)(q,{type:`submit`,variant:s?`destructive`:`default`,disabled:p||!s&&(e.project?!a.trim():!r.trim()),children:l?s?`正在移除…`:`正在保存…`:s?`确认移除`:e.project?`保存名称`:`添加项目`})]})]})]})}function rw({notifications:e,onClose:t}){let n=(0,O.useRef)(null);(0,O.useEffect)(()=>{let e=n.current;return e?.showModal(),()=>e?.close()},[]);let{enabled:r,access:i,requesting:a,error:o}=e,s=r&&i===`granted`,c={default:`尚未授权`,granted:`已授权`,denied:`已被浏览器阻止`,unsupported:`当前浏览器不支持`,insecure:`需要安全连接`}[i],l=![`default`,`granted`].includes(i);return(0,W.jsxs)(`dialog`,{ref:n,className:`project-dialog notification-dialog`,"aria-labelledby":`notification-dialog-title`,onCancel:e=>{e.preventDefault(),t()},children:[(0,W.jsxs)(`div`,{className:`project-dialog-heading`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(F,{size:20,"aria-hidden":`true`}),(0,W.jsx)(`h2`,{id:`notification-dialog-title`,children:`工作完成通知`})]}),(0,W.jsx)(q,{variant:`ghost`,size:`icon`,"aria-label":`关闭通知设置`,onClick:t,children:(0,W.jsx)(J,{name:`close`,size:17})})]}),(0,W.jsx)(`p`,{children:`每轮工作结束时显示项目、会话及结果,点击通知可返回对应会话。`}),(0,W.jsxs)(`div`,{className:`notification-control`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`strong`,{children:`浏览器通知`}),(0,W.jsxs)(`span`,{role:`status`,children:[c,` · `,s?`已开启`:`未开启`]})]}),(0,W.jsx)(q,{role:`switch`,"aria-label":`浏览器通知`,"aria-checked":s,"aria-describedby":`notification-permission-help`,variant:s?`secondary`:`default`,size:`sm`,disabled:a||l,onClick:()=>void e.toggle(),children:a?`等待授权…`:s?`关闭通知`:`启用通知`})]}),(0,W.jsx)(`p`,{id:`notification-permission-help`,className:`notification-help`,children:i===`denied`?`请在浏览器的站点设置中允许通知,再回到此页面开启。`:i===`insecure`?`请使用 HTTPS 访问。localhost 或 127.0.0.1 可用于本机访问。`:i===`unsupported`?`请使用支持系统通知的桌面浏览器。页内状态与未读提示仍然可用。`:`只有点击启用后才会请求授权。此设置在当前浏览器的本站标签页间共享。`}),r&&i===`granted`&&(0,W.jsx)(q,{variant:`secondary`,size:`sm`,onClick:e.test,children:`发送测试通知`}),o&&(0,W.jsx)(`p`,{className:`inline-error`,role:`alert`,children:o}),(0,W.jsxs)(`section`,{className:`notification-background`,"aria-labelledby":`notification-background-title`,children:[(0,W.jsx)(`h3`,{id:`notification-background-title`,children:`后台通知与页面休眠`}),(0,W.jsx)(`p`,{children:`请保持页面和浏览器运行。普通后台状态可接收通知;页面被冻结或被回收期间,无法保证及时通知。恢复页面后会同步结果与未读提示。`}),(0,W.jsxs)(`details`,{children:[(0,W.jsx)(`summary`,{children:`如何让本站保持活跃`}),(0,W.jsxs)(`ul`,{children:[(0,W.jsxs)(`li`,{children:[`Chrome:设置 → 性能 → 始终保持这些网站活跃,添加本站。`,(0,W.jsx)(`a`,{href:`https://support.google.com/chrome/answer/12929150?hl=zh-Hans`,target:`_blank`,rel:`noreferrer`,children:`设置说明`})]}),(0,W.jsxs)(`li`,{children:[`Edge:设置 → 系统和性能 → 性能 → 始终保持这些网站活跃(或「从不将这些网站置于睡眠状态」),添加本站。`,(0,W.jsx)(`a`,{href:`https://support.microsoft.com/edge/learn-about-performance-features-in-microsoft-edge`,target:`_blank`,rel:`noreferrer`,children:`设置说明`})]})]}),(0,W.jsx)(`p`,{children:`需要在浏览器中手动设置,具体名称可能随版本变化。`})]})]})]})}var iw=[{key:`host`,label:`监听地址`,group:`network`,help:`本机模式使用 127.0.0.1、localhost 或 ::1。`},{key:`port`,label:`监听端口`,group:`network`,type:`number`,help:`范围 1–65535;修改后使用新端口访问。`},{key:`publicOrigin`,label:`允许访问地址`,group:`network`,multiline:!0,help:`每行一个完整的 HTTP(S) 地址,仅包含协议、主机和端口。`},{key:`issuer`,label:`Access 团队地址`,group:`network`,help:`例如 https://your-team.cloudflareaccess.com`},{key:`audience`,label:`Access 应用 AUD`,group:`network`,help:`填写 Cloudflare Access 应用的 Audience。`},{key:`binary`,label:`Codex 可执行文件`,group:`codex`,help:`可填写 codex 或服务器上的绝对路径。`},{key:`home`,label:`CODEX_HOME(可选)`,group:`codex`,help:`留空继承服务进程环境;指定时必须填写服务器上的绝对路径。`},{key:`requestTimeoutMs`,label:`请求超时(毫秒)`,group:`codex`,type:`number`,help:`范围 100–300000,默认 30000。`},{key:`maxLineBytes`,label:`Codex 单行消息上限(字节)`,group:`advanced`,type:`number`,help:`范围 1024–268435456,默认 67108864。`},{key:`eventBytes`,label:`事件缓冲上限(字节)`,group:`advanced`,type:`number`,help:`范围 1024–67108864,默认 16777216。`},{key:`wsBytes`,label:`WebSocket 缓冲上限(字节)`,group:`advanced`,type:`number`,help:`范围 1024–16777216,默认 4194304。`},{key:`itemBytes`,label:`单项内容上限(字节)`,group:`advanced`,type:`number`,help:`范围 1024–8388608,默认 2097152。`},{key:`developmentOrigins`,label:`开发环境来源`,group:`advanced`,multiline:!0,help:`每行一个本机 HTTP(S) 来源,仅在 --dev 模式使用。`}];function aw(e){return{host:e.host,port:String(e.port),publicOrigin:e.publicOrigin.join(`
|
|
81
81
|
`),developmentOrigins:e.developmentOrigins.join(`
|
|
82
82
|
`),mode:e.auth.mode,issuer:e.auth.mode===`cloudflare-access`?e.auth.issuer:``,audience:e.auth.mode===`cloudflare-access`?e.auth.audience:``,binary:e.codex.binary,home:e.codex.home??``,requestTimeoutMs:String(e.codex.requestTimeoutMs),maxLineBytes:String(e.codex.maxLineBytes),eventBytes:String(e.limits.eventBytes),wsBytes:String(e.limits.wsBytes),itemBytes:String(e.limits.itemBytes)}}var ow=e=>e.split(`
|
|
83
|
-
`).map(e=>e.trim()).filter(Boolean);function sw(e,t){return{...t,host:e.host.trim(),port:Number(e.port),publicOrigin:ow(e.publicOrigin),developmentOrigins:ow(e.developmentOrigins),auth:e.mode===`local`?{mode:`local`}:{mode:e.mode,issuer:e.issuer.trim(),audience:e.audience.trim()},codex:{binary:e.binary.trim(),...e.home.trim()?{home:e.home.trim()}:{},requestTimeoutMs:Number(e.requestTimeoutMs),maxLineBytes:Number(e.maxLineBytes)},limits:{eventBytes:Number(e.eventBytes),wsBytes:Number(e.wsBytes),itemBytes:Number(e.itemBytes)}}}function cw(e,t){let n=aw(e),r=aw(t);return[...n.mode===r.mode?[]:[{label:`认证模式`,before:n.mode,after:r.mode}],...iw.filter(e=>!([`issuer`,`audience`].includes(e.key)&&r.mode===`local`)&&n[e.key]!==r[e.key]).map(e=>({label:e.label,before:n[e.key],after:r[e.key]}))]}var lw=e=>e instanceof Error?e.message:`操作失败,请重试。`;function uw({onClose:e}){let t=(0,O.useRef)(null),n=(0,O.useRef)(null),[r,i]=(0,O.useState)(),[a,o]=(0,O.useState)(),[s,c]=(0,O.useState)(),[l,u]=(0,O.useState)(),[d,f]=(0,O.useState)(!0),[p,m]=(0,O.useState)(``),[h,g]=(0,O.useState)(``),[_,v]=(0,O.useState)(!1),[y,b]=(0,O.useState)(!1),x=!!r&&!!a&&JSON.stringify(sw(a,r.saved))!==JSON.stringify(r.saved);(0,O.useEffect)(()=>{t.current?.showModal();let e=new AbortController;return Oe.gatewayConfig().then(t=>{e.signal.aborted||(i(t),o(aw(t.saved)))}).catch(t=>{e.signal.aborted||m(lw(t))}).finally(()=>{e.signal.aborted||f(!1)}),()=>{e.abort(),t.current?.close()}},[]),(0,O.useEffect)(()=>{let e=e=>{x&&e.preventDefault()};return window.addEventListener(`beforeunload`,e),()=>window.removeEventListener(`beforeunload`,e)},[x]);let S=()=>{d||(x||l?b(!0):e())};async function C(e){f(!0),m(``),g(``);try{await e()}catch(e){m(lw(e)),e instanceof Ee&&e.problem.code===`CONFIG_CONFLICT`&&v(!0)}finally{f(!1)}}async function w(){await C(async()=>{let e=await Oe.gatewayConfig();i(e),o(aw(e.saved)),c(void 0),u(void 0),v(!1)})}async function T(e){let t=e.target.files?.[0];e.target.value=``,t&&await C(async()=>{if(t.size>262144)throw Error(`配置文件不能超过 256 KiB。`);let e;try{e=JSON.parse(await t.text())}catch{throw Error(`无法解析 JSON,请检查配置文件格式。`)}u(await Oe.importGatewayConfig(e)),c(void 0)})}async function E(){await C(async()=>{let e=await Oe.exportGatewayConfig(),t=URL.createObjectURL(new Blob([`${JSON.stringify(e,null,2)}\n`],{type:`application/json`})),n=document.createElement(`a`);n.href=t,n.download=`codex-web-config.json`,document.body.append(n),n.click(),n.remove(),setTimeout(()=>URL.revokeObjectURL(t),1e3),g(`已导出配置文件中的已保存配置;未保存的编辑不包含在内。`)})}let D=r&&aw(r.running),k=l?.config??s,A=r&&k?cw(r.saved,k):[];function j(e){if(!a||!D||[`issuer`,`audience`].includes(e.key)&&a.mode!==`cloudflare-access`)return null;let t={id:`gateway-${e.key}`,"aria-labelledby":`gateway-${e.key}-label`,"aria-describedby":`gateway-${e.key}-help`,value:a[e.key],disabled:d||!r?.writable,onChange:t=>{o({...a,[e.key]:t.target.value}),g(``)}};return(0,W.jsxs)(`label`,{className:`project-field`,htmlFor:t.id,children:[(0,W.jsx)(`span`,{id:`gateway-${e.key}-label`,children:e.label}),`multiline`in e?(0,W.jsx)(`textarea`,{...t,rows:3,spellCheck:!1}):(0,W.jsx)(`input`,{...t,type:`type`in e?e.type:`text`,spellCheck:!1}),(0,W.jsx)(`small`,{id:`gateway-${e.key}-help`,children:e.help}),a[e.key]!==D[e.key]&&(0,W.jsxs)(`small`,{className:`gateway-running`,children:[`当前运行:`,D[e.key]||`未设置`]})]},e.key)}return(0,W.jsxs)(`dialog`,{ref:t,className:`project-dialog gateway-dialog`,"aria-labelledby":`gateway-title`,onCancel:e=>{e.preventDefault(),S()},children:[(0,W.jsxs)(`div`,{className:`project-dialog-heading`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(_e,{size:20,"aria-hidden":`true`}),(0,W.jsx)(`h2`,{id:`gateway-title`,children:`服务配置`})]}),(0,W.jsx)(q,{variant:`ghost`,size:`icon`,"aria-label":`关闭服务配置`,disabled:d,onClick:S,children:(0,W.jsx)(J,{name:`close`,size:17})})]}),(0,W.jsx)(`p`,{className:`gateway-intro`,children:`配置运行此网页服务的电脑。保存后需手动重启服务生效。`}),p&&(0,W.jsx)(`p`,{className:`gateway-error`,role:`alert`,children:p}),!r&&(0,W.jsx)(q,{variant:`secondary`,disabled:d,onClick:()=>void w(),children:d?`正在读取配置…`:`重新读取配置`}),r&&a&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:`gateway-file`,children:[(0,W.jsx)(`span`,{children:`配置文件`}),(0,W.jsx)(`code`,{children:r.path})]}),(0,W.jsxs)(`div`,{className:`gateway-status`,role:`status`,"data-pending":r.restartRequired,children:[(0,W.jsx)(`strong`,{children:r.restartRequired?`已保存,待重启生效`:`已保存配置与当前运行配置一致`}),(0,W.jsx)(`span`,{children:`保存不会重启服务或中断当前任务。`})]}),!r.writable&&(0,W.jsx)(`p`,{className:`gateway-error`,children:r.readOnlyReason}),h&&(0,W.jsx)(`p`,{className:`gateway-notice`,role:`status`,children:h}),_&&(0,W.jsxs)(`div`,{className:`gateway-conflict`,children:[(0,W.jsx)(`p`,{children:`重新读取会丢弃当前编辑,并载入文件的最新内容。`}),(0,W.jsx)(q,{variant:`secondary`,disabled:d,onClick:()=>void w(),children:`丢弃编辑并重新读取`})]}),y?(0,W.jsxs)(`section`,{className:`gateway-review`,"aria-label":`放弃编辑确认`,children:[(0,W.jsx)(`h3`,{children:`放弃未保存的更改?`}),(0,W.jsx)(`p`,{children:`配置文件尚未修改。`}),(0,W.jsxs)(`div`,{className:`project-dialog-actions`,children:[(0,W.jsx)(q,{variant:`secondary`,onClick:()=>b(!1),children:`继续编辑`}),(0,W.jsx)(q,{variant:`destructive`,onClick:e,children:`放弃更改并关闭`})]})]}):k?(0,W.jsxs)(`section`,{className:`gateway-review`,"aria-label":l?`导入配置预览`:`保存配置预览`,children:[(0,W.jsx)(`h3`,{children:l?`预览导入配置`:`确认配置更改`}),(0,W.jsx)(`p`,{children:l?`应用到表单后仍需检查并保存,才会修改配置文件。导入将替换当前表单中的可编辑配置。`:`以下更改将在服务重启后生效。请确认新的访问地址和认证配置。`}),l&&(0,W.jsxs)(`p`,{children:[`保留当前数据目录和项目初始配置。`,l.preserved.length>0?`已忽略导入文件中的 ${l.preserved.join(`、`)}。`:``]}),A.length?(0,W.jsx)(`div`,{className:`gateway-changes`,children:A.map(e=>(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`strong`,{children:e.label}),(0,W.jsxs)(`span`,{children:[`已保存:`,e.before||`未设置`]}),(0,W.jsxs)(`span`,{children:[`更改为:`,e.after||`未设置`]})]},e.label))}):(0,W.jsx)(`p`,{children:`与已保存配置没有差异。`}),(0,W.jsxs)(`details`,{className:`gateway-json`,children:[(0,W.jsx)(`summary`,{children:`查看完整 JSON`}),(0,W.jsx)(`pre`,{children:JSON.stringify(k,null,2)})]}),(0,W.jsxs)(`div`,{className:`project-dialog-actions`,children:[(0,W.jsx)(q,{variant:`secondary`,disabled:d,onClick:()=>{u(void 0),c(void 0)},children:`返回编辑`}),l?(0,W.jsx)(q,{disabled:d,onClick:()=>{o(aw(l.config)),u(void 0),g(`导入配置已应用到表单,尚未保存。`)},children:`应用到表单`}):(0,W.jsx)(q,{disabled:d||_||!A.length,onClick:()=>void C(async()=>{let e=await Oe.saveGatewayConfig(r.revision,k);i(e),o(aw(e.saved)),c(void 0),g(e.restartRequired?`配置已保存。请在方便时手动重启服务。`:`配置已保存,与当前运行配置一致。`)}),children:d?`正在保存…`:`确认保存`})]})]}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:`gateway-tools`,children:[(0,W.jsxs)(q,{variant:`secondary`,size:`sm`,disabled:d||!r.writable,onClick:()=>n.current?.click(),children:[(0,W.jsx)(ye,{size:15,"aria-hidden":`true`}),`导入配置`]}),(0,W.jsxs)(q,{variant:`secondary`,size:`sm`,disabled:d,onClick:()=>void E(),children:[(0,W.jsx)(ce,{size:15,"aria-hidden":`true`}),`导出已保存配置`]}),(0,W.jsx)(`input`,{ref:n,type:`file`,accept:`.json,application/json`,"aria-label":`选择配置文件`,hidden:!0,onChange:e=>void T(e)})]}),(0,W.jsx)(`p`,{className:`gateway-help`,children:`导入仅更新服务设置;导出包含文件中的项目初始配置,不包含页面注册项目、会话、数据库或登录凭据。`}),(0,W.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),C(async()=>{c((await Oe.importGatewayConfig(sw(a,r.saved))).config)})},children:[(0,W.jsxs)(`fieldset`,{disabled:d||!r.writable,children:[(0,W.jsxs)(`section`,{className:`gateway-section`,children:[(0,W.jsx)(`h3`,{children:`网络与访问`}),(0,W.jsxs)(`div`,{className:`gateway-fields`,children:[iw.filter(e=>e.group===`network`).map(j),(0,W.jsxs)(`label`,{className:`project-field`,children:[(0,W.jsx)(`span`,{children:`认证模式`}),(0,W.jsxs)(`select`,{"aria-label":`认证模式`,value:a.mode,onChange:e=>o({...a,mode:e.target.value}),children:[(0,W.jsx)(`option`,{value:`local`,children:`本机 / Tailscale(local)`}),(0,W.jsx)(`option`,{value:`cloudflare-access`,children:`Cloudflare Access`})]}),(0,W.jsx)(`small`,{children:`本机模式仅监听回环地址;公开互联网入口使用 Cloudflare Access。`}),a.mode!==D?.mode&&(0,W.jsxs)(`small`,{className:`gateway-running`,children:[`当前运行:`,D?.mode]})]})]})]}),(0,W.jsxs)(`section`,{className:`gateway-section`,children:[(0,W.jsx)(`h3`,{children:`Codex`}),(0,W.jsx)(`div`,{className:`gateway-fields`,children:iw.filter(e=>e.group===`codex`).map(j)})]}),(0,W.jsxs)(`section`,{className:`gateway-section`,children:[(0,W.jsx)(`h3`,{children:`数据与项目`}),(0,W.jsxs)(`div`,{className:`gateway-file`,children:[(0,W.jsx)(`span`,{children:`数据目录(只读)`}),(0,W.jsx)(`code`,{children:r.saved.dataDir}),(0,W.jsx)(`span`,{children:`当前运行目录`}),(0,W.jsx)(`code`,{children:r.running.dataDir})]}),(0,W.jsx)(`p`,{className:`gateway-help`,children:`数据目录变更需要迁移数据库,请在服务停止后处理。项目请在侧栏添加、重命名或移除;此处不覆盖已保存的项目管理结果。`})]}),(0,W.jsxs)(`details`,{className:`gateway-section`,children:[(0,W.jsx)(`summary`,{children:`高级设置`}),(0,W.jsx)(`div`,{className:`gateway-fields`,children:iw.filter(e=>e.group===`advanced`).map(j)})]})]}),(0,W.jsxs)(`div`,{className:`gateway-save-bar`,children:[(0,W.jsx)(`span`,{children:x?`有未保存的更改`:`没有未保存的更改`}),(0,W.jsx)(q,{type:`submit`,disabled:d||!x||!r.writable||_,children:d?`正在校验…`:`检查更改`})]})]})]})]})]})}var dw=[`stable`,`beta`,`dev`],fw=e=>!!(e&&[`installing`,`waiting`,`stopping`,`verifying`].includes(e.phase)),pw={stable:`稳定版`,beta:`预览版`,dev:`开发版`},mw={installing:`正在安装候选版本`,waiting:`等待任务空闲`,stopping:`正在备份并重启`,verifying:`正在验证新版`,succeeded:`升级成功`,rolledBack:`已恢复上一版本`,failed:`升级失败`},hw={verified:`已验证`,unverified:`尚未验证`,unsupported:`明确不支持`,unknown:`无法确认`};function gw({title:e,value:t}){return(0,W.jsxs)(`section`,{className:`update-codex`,"aria-label":e,"data-state":t.status,children:[(0,W.jsx)(`h3`,{children:e}),(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`span`,{children:`Codex CLI`}),(0,W.jsx)(`strong`,{children:t.version??`未识别`}),(0,W.jsx)(`span`,{className:`update-codex-status`,children:hw[t.status]})]}),t.manifest&&(0,W.jsxs)(`p`,{className:`subtle`,children:[`推荐:`,t.manifest.recommended,` · 已验证:`,t.manifest.verified.join(`、`)]}),t.reason&&(0,W.jsx)(`p`,{children:t.reason})]})}function _w({updates:e,onClose:t}){let n=(0,O.useRef)(null),{status:r,busy:i,error:a,reloadError:o}=e,[s,c]=(0,O.useState)(),l=s??r?.settings.channel??`stable`,[u,d]=(0,O.useState)(!1),f=r?.available?.channel===l?r.available:void 0,p=fw(r?.run),m=f?.version===r?.version,[h,g]=(0,O.useState)(),_=JSON.stringify([l,f?.version,f?.codex]),v=h===_,y=f?.codex,b=!m&&y?.status===`unverified`,x=!m&&f&&(!y||y.status===`unknown`||y.status===`unsupported`||b&&!v);return(0,O.useEffect)(()=>{g(void 0)},[_]),(0,O.useEffect)(()=>{let e=n.current;return e?.showModal(),()=>e?.close()},[]),(0,W.jsxs)(`dialog`,{ref:n,className:`project-dialog update-dialog`,"aria-labelledby":`update-title`,onCancel:e=>{e.preventDefault(),t()},children:[(0,W.jsxs)(`div`,{className:`project-dialog-heading`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(ie,{size:20,"aria-hidden":`true`}),(0,W.jsx)(`h2`,{id:`update-title`,children:`Covro 更新`})]}),(0,W.jsx)(q,{variant:`ghost`,size:`icon`,"aria-label":`关闭更新设置`,onClick:t,children:(0,W.jsx)(J,{name:`close`,size:17})})]}),(0,W.jsxs)(`div`,{className:`update-version`,children:[(0,W.jsx)(`span`,{children:`当前 Covro`}),(0,W.jsx)(`strong`,{children:r?.version??`读取中…`}),r?.commit&&(0,W.jsx)(`code`,{children:r.commit.slice(0,8)})]}),r?.codex&&(0,W.jsx)(gw,{title:`当前 Codex`,value:r.codex}),(0,W.jsxs)(`label`,{className:`update-channel`,children:[`版本渠道`,(0,W.jsx)(`select`,{"aria-label":`版本渠道`,value:l,disabled:i||p,onChange:t=>{let n=t.target.value;c(n),d(!1),g(void 0),e.check(n)},children:dw.map(e=>(0,W.jsx)(`option`,{value:e,children:pw[e]},e))})]}),(0,W.jsx)(`p`,{className:`subtle`,children:l===`stable`?`经过验证的正式版本,适合日常使用。`:l===`beta`?`提前体验准备发布的功能。`:`跟随通过检查的 main 提交,适合开发者体验和验证新功能。`}),(0,W.jsxs)(`div`,{className:`update-control`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`strong`,{children:`空闲时自动升级`}),(0,W.jsx)(`p`,{className:`subtle`,children:`定期检查当前渠道,已验证的 Codex 组合在任务结束后安装并重启。`})]}),(0,W.jsx)(q,{role:`switch`,"aria-label":`空闲时自动升级`,"aria-checked":r?.settings.automatic??!1,variant:`secondary`,size:`sm`,disabled:i||p||!r?.supported,onClick:()=>r&&void e.configure({...r.settings,automatic:!r.settings.automatic}),children:r?.settings.automatic?`已开启`:`已关闭`})]}),r&&l!==r.settings.channel&&(0,W.jsxs)(`p`,{className:`subtle`,children:[`当前订阅:`,pw[r.settings.channel],`。成功更新后切换到`,pw[l],`。`]}),f&&(0,W.jsxs)(`div`,{className:`update-available`,children:[(0,W.jsx)(`span`,{children:m?`此渠道已是当前版本`:f.downgrade?`目标版本`:`可用版本`}),(0,W.jsx)(`strong`,{children:f.version}),f.commit&&(0,W.jsx)(`code`,{children:f.commit.slice(0,8)})]}),f?.codex&&(0,W.jsx)(gw,{title:`目标版本兼容性`,value:f.codex}),b&&(0,W.jsxs)(`label`,{className:`update-downgrade update-codex-consent`,children:[(0,W.jsx)(`input`,{type:`checkbox`,"aria-label":`允许尝试未验证的 Codex 组合`,checked:v,disabled:i||p,onChange:e=>g(e.target.checked?_:void 0)}),`我确认尝试 Codex `,y?.version,` 与 Covro `,f?.version,` `,`的未验证组合;此确认仅用于本次升级。`]}),f&&!m&&f.channel===r?.settings.channel&&r.settings.automatic&&y?.status!==`verified`&&(0,W.jsx)(`p`,{className:`update-notice`,role:`status`,children:y?.status===`unverified`?`自动升级已暂停。可以调整 Codex 版本后重新检查,或勾选确认后手动尝试。`:`自动升级已暂停。请先恢复 Codex 连接、调整版本或等待含有效兼容声明的发行版,再重新检查。`}),(0,W.jsxs)(`div`,{className:`update-buttons`,children:[(0,W.jsx)(q,{variant:`secondary`,disabled:i||p,onClick:()=>void e.check(l),children:i?`正在处理…`:`检查更新`}),(0,W.jsx)(q,{disabled:i||p||!f||!r?.supported||!!x||f.downgrade&&!u||m&&l===r.settings.channel,onClick:()=>void e.start(l,u,b&&v&&f?.codex.version?{version:f.codex.version,target:f.version}:void 0),children:m?`使用此渠道`:f?.downgrade?`切换并重启`:`升级并重启`})]}),f?.downgrade&&(0,W.jsxs)(`label`,{className:`update-downgrade`,children:[(0,W.jsx)(`input`,{type:`checkbox`,checked:u,onChange:e=>d(e.target.checked)}),`允许降级;数据库不兼容时仍会阻止切换`]}),r?.run&&(0,W.jsxs)(`section`,{className:`update-progress`,"data-phase":r.run.phase,role:`status`,children:[(0,W.jsx)(`strong`,{children:mw[r.run.phase]}),(0,W.jsxs)(`span`,{children:[r.run.from,` → `,r.run.target]}),(0,W.jsx)(`p`,{children:r.run.message}),p&&(0,W.jsx)(`progress`,{"aria-label":`升级进度`})]}),(a||r?.checkError||o)&&(0,W.jsx)(`p`,{className:`inline-error`,role:`alert`,children:o??a??r?.checkError}),!r?.supported&&r?.unsupportedReason&&(0,W.jsx)(`p`,{className:`update-notice`,children:r.unsupportedReason}),(0,W.jsxs)(`p`,{className:`update-source`,children:[`版本来源:npm 官方 registry · `,l===`stable`?`latest`:l,(0,W.jsxs)(`a`,{href:`https://github.com/yuzheng14/codex-web-ui/releases`,target:`_blank`,rel:`noreferrer`,children:[`更新记录 `,(0,W.jsx)(ue,{size:12,"aria-hidden":`true`})]})]}),(0,W.jsx)(`p`,{className:`subtle`,children:`升级保留配置、项目和会话记录。页面关闭也会继续处理,重启后自动恢复连接。`})]})}function vw(){let[e,t]=(0,O.useState)(),[n,r]=(0,O.useState)(),[i,a]=(0,O.useState)(!1),[o,s]=(0,O.useState)(),c=(0,O.useRef)(!1),l=(0,O.useRef)(!0),u=(0,O.useRef)(0),d=(0,O.useCallback)(async e=>{if(l.current&&(t(e),r(void 0),e.version!==`unknown`&&e.version!==`0.1.0-dev.1`&&!c.current&&(!e.run||e.run.committed||[`rolledBack`,`failed`].includes(e.run.phase)))){c.current=!0;try{await er()}catch(e){c.current=!1,s(e instanceof Error?e.message:`草稿未能备份,暂缓重载页面`)}}},[]);(0,O.useEffect)(()=>{l.current=!0;let e=!0,t=!1,n=async()=>{if(t)return;t=!0;let n=u.current;try{let t=await De(`/api/updates`);e&&n===u.current&&await d(t)}catch{e&&r(`连接暂时中断,正在等待服务恢复…`)}finally{t=!1}};n();let i=setInterval(()=>void n(),5e3);return()=>{l.current=!1,e=!1,clearInterval(i)}},[d]);let f=(0,O.useCallback)(async(e,t)=>{u.current++,a(!0),r(void 0);try{await d(await De(e,t))}catch(e){r(e instanceof Error?e.message:`操作未能确认,请查看升级状态`)}finally{a(!1),u.current++}},[d]);return{status:e,error:n,busy:i,reloadError:o,check:e=>f(`/api/updates/check`,{channel:e}),configure:e=>f(`/api/updates/settings`,e),start:(e,t,n)=>f(`/api/updates/run`,{clientOperationId:crypto.randomUUID(),channel:e,allowDowngrade:t,codexConfirmation:n})}}var yw=encodeURIComponent;function bw({threadId:e,children:t}){return(0,W.jsx)(`div`,{className:`app-shell`,children:(0,W.jsx)(Dy,{threadId:e,children:t})})}function xw(){let e=nr(),t=vw(),[n,r]=(0,O.useState)(!1),{isUnreadCompletion:i,markCompletedRead:a}=sr(),[o,s]=(0,O.useState)(!1),[c,l]=(0,O.useState)(!1),[u,d]=(0,O.useState)(!1);(0,O.useEffect)(()=>{let e=window.matchMedia(`(min-width: 761px)`),t=()=>{e.matches&&s(!1)};return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[]);let[f,p]=(0,O.useState)(!1),[m,h]=(0,O.useState)(!1),g=(0,O.useRef)(!1),[_,v]=(0,O.useState)(),[y,b]=(0,O.useState)(!1),[x,S]=(0,O.useState)(!1),C=(0,O.useRef)(!1),w=e.projects.find(t=>t.id===e.projectId),T=_?.kind===`manage`?e.projects.find(e=>e.id===_.id):void 0;(0,O.useEffect)(()=>{_?.kind===`manage`&&!T&&v(void 0)},[_,T]);let E=()=>{s(!1),v({kind:`add`})},{thread:D,system:k}=e,A=(0,O.useRef)(void 0),j=!(!k?.ready||k.authenticated===!1||e.connection!==`connected`||e.authRequired),M=j&&!!w?.available&&!Mn(k),N=Pn(k,e.connection,e.authRequired),P=jn(k)??``,F=(t,n=D?.id??``)=>e.busy.includes(`${t}:${n}`),te=t=>e.operations.some(e=>Tn(e,t)),I=D?.turns.findLast(e=>al(e.status)),ne=D?.actions.filter(e=>e.status===`pending`||e.status===`responding`||e.kind===`unsupported`&&e.status===`expired`)??[],L=D?te(D.id)&&!F(`resume`)||D.managed&&D.status===`unknown`||D.execution&&!D.execution.ended&&D.status===`unknown`:!F(`create`,e.projectId)&&te(e.projectId),R=!!(D&&(!M||D.archived||te(D.id)||F(`resume`)||D.execution&&!D.execution.ended)),{run:z,refreshThread:re}=e,ie=(0,O.useCallback)(()=>{D&&!R&&(A.current=`${k?.codexEpoch}:${D.id}`,z(`resume`,D.id,`/api/threads/${yw(D.id)}/resume`).then(()=>re()))},[D,R,k?.codexEpoch,z,re]);(0,O.useEffect)(()=>{if((!k?.ready||D?.archived)&&(A.current=void 0),!D||D.managed||R)return;let e=`${k?.codexEpoch}:${D.id}`;A.current!==e&&ie()},[D,k?.ready,k?.codexEpoch,R,ie]);let ae=!!(D&&e.operations.some(e=>e.kind===`fork`&&Tn(e,D.id))),oe=k?.capabilities.includes(`thread/fork`)??!1,se=t=>F(`fork`,t)||e.operations.some(e=>e.kind===`fork`&&Tn(e,t)),ce=t=>{if(se(t.id))return`正在确认 Fork…请等待提交回执,暂时不能再次 Fork。`;if(!oe)return`当前 Codex 版本不支持 Fork 会话。`;if(!j)return`连接恢复且 Codex 就绪后可 Fork 会话。`;if(!e.projects.find(e=>e.id===t.projectId)?.available)return`项目目录不可用,恢复后可 Fork 会话。`;if(Mn(k))return`请先确认当前 Codex 版本的兼容性。`;if(t.historyVisible===!1||t.id===D?.id&&!D.turns.length)return`发送首条消息后可 Fork 已保存的历史。`},le=!!(D&&se(D.id)),ue=!(!D?.turns.length||ce(D)),B=async t=>{if(!ce(t))return e.run(`fork`,t.id,`/api/threads/${yw(t.id)}/fork`,t.id===D?.id?{settings:e.settings}:{})},de=()=>{D&&ue&&B(D)},fe=e.connection!==`connected`,pe=e.operations.filter(e=>e.kind===`confirmCompatibility`&&e.target===P),me=y||F(`confirmCompatibility`,P)||pe.some(e=>e.status===`accepted`||e.status===`dispatching`),ge=pe.some(e=>e.status===`unknown`&&!e.operation?.reconciliation);async function _e(){if(!g.current){g.current=!0,h(!0);try{await Promise.all([e.refreshSystem(),e.refreshThread()]),await e.refreshOperations(!0)}finally{g.current=!1,h(!1)}}}async function ve(){if(N&&!C.current){C.current=!0,b(!0);try{let t=await e.refreshSystem(),n=In(P,t,e.connection,e.authRequired);if(!n)return;await e.run(`confirmCompatibility`,P,`/api/system/compatibility/confirm`,n)}finally{C.current=!1,b(!1)}}}let ye={project:w,selectedId:e.selectedId,thread:D,system:k,connection:e.connection,authRequired:e.authRequired,settings:e.settings,openDraft:e.openDraft,busy:e.busy,operations:e.operations,run:e.run,onResumeAttempt:()=>{A.current=`${k?.codexEpoch}:${D?.id}`},refreshThread:e.refreshThread,openStatus:()=>p(!0),exportThread:ew},be=(0,O.useRef)(ye);be.current=ye;let xe=NC(()=>be.current),Se=xe.find(e=>e.name===`rename`);async function Ce(t,n,r){return!M||e.restoringSelection||e.savingModelDefaults?!1:D?n&&!I?!1:(await e.run(n?`steer`:`send`,D.id,`/api/threads/${yw(D.id)}/${n?`steer`:`turns`}`,n?{text:t,images:r,expectedTurnId:I.id}:{text:t,images:r,settings:e.settings},{kind:`send`,key:e.draftKey,text:t,images:r}))?.status===`acknowledged`:!e.selectedId&&e.sendFirstMessage(t,r)}return(0,W.jsxs)(bw,{threadId:D?.id,children:[(0,W.jsx)(dl,{onGatewaySettings:()=>{s(!1),d(!0)},onUpdates:()=>{s(!1),r(!0)},appVersion:t.status?.version,updateAvailable:!!(t.status?.available&&t.status.available.version!==t.status.version),updating:fw(t.status?.run),onNotificationSettings:()=>{s(!1),l(!0)},notificationStatus:e.notifications.error?`请检查设置`:e.notifications.enabled&&e.notifications.access===`granted`?`已开启`:`未开启`,archiveView:e.archiveView,onArchiveView:e.setArchiveView,onArchive:(t,n)=>{e.archiveThread(t,n)},onFork:e=>{B(e).then(e=>{e?.status===`acknowledged`&&s(!1)})},forkDisabledReason:ce,forking:se,archiveDisabledReason:t=>{if(F(`archive`,t.id))return`正在保存…`;if(te(t.id))return`请先核对会话操作的结果`;if(!j)return`连接恢复后可操作`;if(Mn(k))return`请先确认 Codex 版本兼容性`;if(!k?.capabilities.includes(t.archived?`thread/unarchive`:`thread/archive`))return`当前 Codex 不支持此操作`;if(!e.projects.find(e=>e.id===t.projectId)?.available)return`项目目录不可用`;if(!t.archived&&(al(t.status)||t.pendingActionCount>0))return`任务结束并处理完待办后可归档`;if(!t.archived&&t.managed&&t.status===`unknown`)return`会话状态待核对,暂时无法归档`},projects:e.projects,projectsLoaded:e.projectsLoaded,projectId:e.projectId,onProject:t=>{e.setProjectId(t),s(!1)},projectThreads:e.projectThreads,selectedId:e.selectedId,isUnreadCompletion:i,onThread:(t,n)=>{e.selectThread(t,n)},onMore:(t,n)=>{e.loadProjectThreads(t,n)},onRetry:t=>{e.loadProjectThreads(t,e.projectThreads[t]?.retryCursor)},onRefresh:()=>{e.refreshProjects().then(e.refreshProjectsThreads)},onAddProject:E,onManageProject:e=>{s(!1),v({kind:`manage`,id:e.id})},canManageProjects:!e.authRequired,onCreate:t=>{e.setProjectId(t),s(!1)},creating:t=>e.firstMessages.includes(t)||F(`create`,t)||te(t),canCreate:t=>j&&!e.savingModelDefaults&&!Mn(k)&&!!e.projects.find(e=>e.id===t)?.available,offline:fe,open:o,onClose:()=>s(!1)}),(0,W.jsxs)(`main`,{className:`main-panel`,children:[(0,W.jsxs)(`header`,{className:`topbar`,children:[(0,W.jsxs)(`div`,{className:`topbar-title`,children:[(0,W.jsx)(q,{className:`mobile-only`,variant:`ghost`,size:`icon`,"aria-label":`打开项目与会话`,onClick:()=>s(!0),children:(0,W.jsx)(J,{name:`menu`})}),(0,W.jsxs)(`div`,{children:[(0,W.jsxs)(`div`,{className:`breadcrumb`,children:[w?.name??`工作空间`,(0,W.jsx)(J,{name:`chevron`,size:12}),(0,W.jsx)(`span`,{children:D?`会话`:`新会话`})]}),D?(0,W.jsx)(ab,{title:D.title||`新会话`,rename:Se,pending:!!(D&&e.operations.some(e=>e.kind===`rename`&&Tn(e,D.id)))},`${D.projectId}:${D.id}`):(0,W.jsx)(`h1`,{children:`开始你的下一项任务`})]})]}),(0,W.jsxs)(`div`,{className:`topbar-status`,children:[D&&(0,W.jsx)(ol,{status:D.status,offline:fe}),(0,W.jsx)(ZC,{connection:e.connection}),D?.forkedFromId&&(0,W.jsx)(Ic,{id:`thread-source-hint`,content:`返回原会话`,children:(0,W.jsx)(q,{variant:`ghost`,size:`icon`,"aria-label":`返回原会话`,"aria-describedby":`thread-source-hint`,onClick:()=>{e.selectThread(D.forkedFromId)},children:(0,W.jsx)(ee,{size:16})})}),(0,W.jsx)($C,{system:k,connection:e.connection,operations:e.operations,thread:D,busy:e.busy,open:f,onOpenChange:p,refreshing:m,onDiscardMissing:e.discardMissingOperation,onRefresh:()=>{_e(),fe&&e.retryConnection()},onReconcile:t=>{e.run(`reconcile`,t,`/api/operations/${yw(t)}/reconcile`,{confirmEnded:!0}).then(e=>{if(e?.status===`acknowledged`)return _e()})}})]})]}),k?.demo&&(0,W.jsx)(`div`,{className:`demo-banner`,children:`模拟测试模式 · 当前执行结果来自显式启用的测试 app-server`}),e.authRequired?(0,W.jsxs)(`div`,{className:`error-banner persistent-banner`,role:`alert`,children:[(0,W.jsx)(J,{name:`alert`}),`登录已过期。任务不会因页面断开而被取消。`,(0,W.jsx)(`a`,{className:`button button-secondary button-small`,href:`/`,children:`重新打开登录入口`})]}):fe&&(0,W.jsxs)(`div`,{className:`connection-banner`,role:`status`,children:[(0,W.jsxs)(`span`,{children:[`实时连接`,e.connection===`connecting`?`正在建立`:`已断开,正在重连`,`。当前显示上次已知状态。`]}),(0,W.jsx)(q,{variant:`ghost`,size:`sm`,onClick:e.retryConnection,children:`立即重连`})]}),k&&!k.ready&&(0,W.jsxs)(`div`,{className:`error-banner persistent-banner`,role:`alert`,children:[`Codex 尚不可用:`,k.error??`请在私人电脑上检查 Codex 安装、认证与服务状态。`]}),(0,W.jsx)(tw,{system:k,onOpenChange:S,canConfirm:N,submitting:me,uncertain:ge,error:e.error,onRefresh:()=>{e.refreshSystem(),e.refreshOperations()},onConfirm:()=>{ve()},onReconfirm:()=>{ve()}}),e.error&&(0,W.jsxs)(`div`,{className:`error-banner dismissible`,role:`alert`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`span`,{children:e.error}),e.errorDetails!==void 0&&(0,W.jsxs)(`details`,{className:`raw-details`,children:[(0,W.jsx)(`summary`,{children:`错误详情`}),(0,W.jsx)(`pre`,{children:JSON.stringify(e.errorDetails,null,2)})]})]}),(0,W.jsx)(q,{variant:`ghost`,size:`icon`,"aria-label":`关闭错误提示`,onClick:e.clearError,children:(0,W.jsx)(J,{name:`close`,size:15})})]}),e.operations.filter(e=>e.mutation).map(e=>(0,W.jsxs)(`div`,{className:`archive-notice mutation-notice`,role:`status`,children:[e.kind===`rename`?(0,W.jsx)(he,{size:16}):(0,W.jsx)(J,{name:`archive`,size:16}),(0,W.jsx)(`span`,{children:e.kind===`rename`?e.status===`unknown`?`重命名结果待确认`:`正在保存会话名称…`:e.mutation.archived?e.status===`unknown`?`归档结果待确认`:`正在归档会话…`:e.status===`unknown`?`取消归档结果待确认`:`正在取消归档…`}),e.status===`unknown`&&(0,W.jsx)(q,{variant:`secondary`,size:`sm`,disabled:m,onClick:()=>void _e(),children:m?`正在核对…`:`核对提交`})]},e.clientOperationId)),D?.archived&&(0,W.jsxs)(`div`,{className:`archive-notice`,role:`status`,children:[(0,W.jsx)(J,{name:`archive`,size:18}),(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`strong`,{children:`此会话已归档`}),(0,W.jsx)(`p`,{children:`历史已保留。取消归档后可继续对话。`})]}),(0,W.jsx)(q,{variant:`secondary`,size:`sm`,disabled:!M||te(D.id)||F(`archive`)||!k?.capabilities.includes(`thread/unarchive`),onClick:()=>{e.archiveThread(D.id,!1)},children:F(`archive`)?`正在保存…`:`取消归档`})]}),(0,W.jsx)(rb,{thread:D,readingEnabled:!o&&!_&&!f&&!e.authRequired&&!x,onReadCompleted:a,offline:fe,projectName:w?.name,needsProject:e.projectsLoaded&&e.projects.length===0,canAddProject:!e.authRequired,onAddProject:E,questionControls:{disabled:!M||!D?.managed||!!D.archived||!!L||F(`send`)||F(`steer`)||F(`resume`),onReply:async e=>Ce(My(e),!!I)}}),(0,W.jsxs)(`div`,{className:`bottom-region`,children:[ne.length>0&&(0,W.jsx)(`div`,{className:`pending-actions`,"aria-label":`待处理请求`,children:ne.map(t=>(0,W.jsx)(JC,{action:t,disabled:!M||F(`resolve`,t.actionId)||te(t.actionId),onResolve:n=>{e.run(`resolve`,t.actionId,`/api/actions/${yw(t.actionId)}/resolve`,{resolution:n})}},t.actionId))}),L&&(0,W.jsxs)(`div`,{className:`pending-notice`,role:`status`,children:[(0,W.jsx)(J,{name:`alert`,size:15}),(0,W.jsx)(`span`,{children:D?ae?`Fork 结果尚未确认。请核对提交,暂时不能再次 Fork。`:`提交结果尚未确认。请核对提交,也可以 Fork 已保存的历史为新会话。`:`新建会话的提交结果尚未确认。请先核对提交,避免重复创建。`}),(0,W.jsx)(q,{variant:`ghost`,size:`sm`,disabled:m,"aria-expanded":f,"aria-controls":`diagnostics-panel`,onClick:()=>{p(!0),_e()},children:m?`正在核对…`:`核对提交`}),D&&!ae&&(0,W.jsx)(q,{variant:`secondary`,size:`sm`,disabled:!ue,onClick:de,children:`Fork 为新会话`})]}),(0,W.jsx)(PC,{commands:xe,thread:D,threadLoading:e.restoringSelection||!(!e.selectedId||D),draftKey:e.draftKey,sentDrafts:e.sentDrafts,projectName:w?.name,projectId:w?.available?w.id:void 0,runtimeKey:k?.ready&&e.connection===`connected`?`${k.codexEpoch}:${e.runtimeDefaultsRevision}`:void 0,settings:e.settings,models:k?.models??[],onSettings:e.setSettings,onSaveModelDefaults:e.saveModelDefaults,savingModelDefaults:e.savingModelDefaults,disabled:!M||e.restoringSelection||!!L||!!D?.archived,canInterrupt:j&&!!(D?.managed&&I),submitting:e.firstMessages.includes(e.projectId)||F(`send`)||F(`steer`),interrupting:F(`interrupt`),resuming:F(`resume`),canResume:!R,resumeAttempted:A.current===`${k?.codexEpoch}:${D?.id}`,canFork:ue,forking:le,onFork:de,onResume:ie,onInterrupt:()=>{D&&I&&e.run(`interrupt`,D.id,`/api/threads/${yw(D.id)}/interrupt`,{expectedTurnId:I.id})},onSend:Ce})]})]}),_&&(_.kind===`add`||T)&&(0,W.jsx)(nw,{project:T,disabled:e.authRequired,onAdd:e.addProject,onRename:e.renameProject,onRemove:e.removeProject,onClose:()=>v(e=>e===_?void 0:e)},_.kind===`add`?`add`:_.id),c&&(0,W.jsx)(rw,{notifications:e.notifications,onClose:()=>l(!1)}),u&&(0,W.jsx)(uw,{onClose:()=>d(!1)}),n&&(0,W.jsx)(_w,{updates:t,onClose:()=>r(!1)})]})}(0,we.createRoot)(document.getElementById(`root`)).render((0,W.jsx)(O.StrictMode,{children:(0,W.jsx)(xw,{})}));
|
|
83
|
+
`).map(e=>e.trim()).filter(Boolean);function sw(e,t){return{...t,host:e.host.trim(),port:Number(e.port),publicOrigin:ow(e.publicOrigin),developmentOrigins:ow(e.developmentOrigins),auth:e.mode===`local`?{mode:`local`}:{mode:e.mode,issuer:e.issuer.trim(),audience:e.audience.trim()},codex:{binary:e.binary.trim(),...e.home.trim()?{home:e.home.trim()}:{},requestTimeoutMs:Number(e.requestTimeoutMs),maxLineBytes:Number(e.maxLineBytes)},limits:{eventBytes:Number(e.eventBytes),wsBytes:Number(e.wsBytes),itemBytes:Number(e.itemBytes)}}}function cw(e,t){let n=aw(e),r=aw(t);return[...n.mode===r.mode?[]:[{label:`认证模式`,before:n.mode,after:r.mode}],...iw.filter(e=>!([`issuer`,`audience`].includes(e.key)&&r.mode===`local`)&&n[e.key]!==r[e.key]).map(e=>({label:e.label,before:n[e.key],after:r[e.key]}))]}var lw=e=>e instanceof Error?e.message:`操作失败,请重试。`;function uw({onClose:e}){let t=(0,O.useRef)(null),n=(0,O.useRef)(null),[r,i]=(0,O.useState)(),[a,o]=(0,O.useState)(),[s,c]=(0,O.useState)(),[l,u]=(0,O.useState)(),[d,f]=(0,O.useState)(!0),[p,m]=(0,O.useState)(``),[h,g]=(0,O.useState)(``),[_,v]=(0,O.useState)(!1),[y,b]=(0,O.useState)(!1),x=!!r&&!!a&&JSON.stringify(sw(a,r.saved))!==JSON.stringify(r.saved);(0,O.useEffect)(()=>{t.current?.showModal();let e=new AbortController;return Oe.gatewayConfig().then(t=>{e.signal.aborted||(i(t),o(aw(t.saved)))}).catch(t=>{e.signal.aborted||m(lw(t))}).finally(()=>{e.signal.aborted||f(!1)}),()=>{e.abort(),t.current?.close()}},[]),(0,O.useEffect)(()=>{let e=e=>{x&&e.preventDefault()};return window.addEventListener(`beforeunload`,e),()=>window.removeEventListener(`beforeunload`,e)},[x]);let S=()=>{d||(x||l?b(!0):e())};async function C(e){f(!0),m(``),g(``);try{await e()}catch(e){m(lw(e)),e instanceof Ee&&e.problem.code===`CONFIG_CONFLICT`&&v(!0)}finally{f(!1)}}async function w(){await C(async()=>{let e=await Oe.gatewayConfig();i(e),o(aw(e.saved)),c(void 0),u(void 0),v(!1)})}async function T(e){let t=e.target.files?.[0];e.target.value=``,t&&await C(async()=>{if(t.size>262144)throw Error(`配置文件不能超过 256 KiB。`);let e;try{e=JSON.parse(await t.text())}catch{throw Error(`无法解析 JSON,请检查配置文件格式。`)}u(await Oe.importGatewayConfig(e)),c(void 0)})}async function E(){await C(async()=>{let e=await Oe.exportGatewayConfig(),t=URL.createObjectURL(new Blob([`${JSON.stringify(e,null,2)}\n`],{type:`application/json`})),n=document.createElement(`a`);n.href=t,n.download=`codex-web-config.json`,document.body.append(n),n.click(),n.remove(),setTimeout(()=>URL.revokeObjectURL(t),1e3),g(`已导出配置文件中的已保存配置;未保存的编辑不包含在内。`)})}let D=r&&aw(r.running),k=l?.config??s,A=r&&k?cw(r.saved,k):[];function j(e){if(!a||!D||[`issuer`,`audience`].includes(e.key)&&a.mode!==`cloudflare-access`)return null;let t={id:`gateway-${e.key}`,"aria-labelledby":`gateway-${e.key}-label`,"aria-describedby":`gateway-${e.key}-help`,value:a[e.key],disabled:d||!r?.writable,onChange:t=>{o({...a,[e.key]:t.target.value}),g(``)}};return(0,W.jsxs)(`label`,{className:`project-field`,htmlFor:t.id,children:[(0,W.jsx)(`span`,{id:`gateway-${e.key}-label`,children:e.label}),`multiline`in e?(0,W.jsx)(`textarea`,{...t,rows:3,spellCheck:!1}):(0,W.jsx)(`input`,{...t,type:`type`in e?e.type:`text`,spellCheck:!1}),(0,W.jsx)(`small`,{id:`gateway-${e.key}-help`,children:e.help}),a[e.key]!==D[e.key]&&(0,W.jsxs)(`small`,{className:`gateway-running`,children:[`当前运行:`,D[e.key]||`未设置`]})]},e.key)}return(0,W.jsxs)(`dialog`,{ref:t,className:`project-dialog gateway-dialog`,"aria-labelledby":`gateway-title`,onCancel:e=>{e.preventDefault(),S()},children:[(0,W.jsxs)(`div`,{className:`project-dialog-heading`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(_e,{size:20,"aria-hidden":`true`}),(0,W.jsx)(`h2`,{id:`gateway-title`,children:`服务配置`})]}),(0,W.jsx)(q,{variant:`ghost`,size:`icon`,"aria-label":`关闭服务配置`,disabled:d,onClick:S,children:(0,W.jsx)(J,{name:`close`,size:17})})]}),(0,W.jsx)(`p`,{className:`gateway-intro`,children:`配置运行此网页服务的电脑。保存后需手动重启服务生效。`}),p&&(0,W.jsx)(`p`,{className:`gateway-error`,role:`alert`,children:p}),!r&&(0,W.jsx)(q,{variant:`secondary`,disabled:d,onClick:()=>void w(),children:d?`正在读取配置…`:`重新读取配置`}),r&&a&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:`gateway-file`,children:[(0,W.jsx)(`span`,{children:`配置文件`}),(0,W.jsx)(`code`,{children:r.path})]}),(0,W.jsxs)(`div`,{className:`gateway-status`,role:`status`,"data-pending":r.restartRequired,children:[(0,W.jsx)(`strong`,{children:r.restartRequired?`已保存,待重启生效`:`已保存配置与当前运行配置一致`}),(0,W.jsx)(`span`,{children:`保存不会重启服务或中断当前任务。`})]}),!r.writable&&(0,W.jsx)(`p`,{className:`gateway-error`,children:r.readOnlyReason}),h&&(0,W.jsx)(`p`,{className:`gateway-notice`,role:`status`,children:h}),_&&(0,W.jsxs)(`div`,{className:`gateway-conflict`,children:[(0,W.jsx)(`p`,{children:`重新读取会丢弃当前编辑,并载入文件的最新内容。`}),(0,W.jsx)(q,{variant:`secondary`,disabled:d,onClick:()=>void w(),children:`丢弃编辑并重新读取`})]}),y?(0,W.jsxs)(`section`,{className:`gateway-review`,"aria-label":`放弃编辑确认`,children:[(0,W.jsx)(`h3`,{children:`放弃未保存的更改?`}),(0,W.jsx)(`p`,{children:`配置文件尚未修改。`}),(0,W.jsxs)(`div`,{className:`project-dialog-actions`,children:[(0,W.jsx)(q,{variant:`secondary`,onClick:()=>b(!1),children:`继续编辑`}),(0,W.jsx)(q,{variant:`destructive`,onClick:e,children:`放弃更改并关闭`})]})]}):k?(0,W.jsxs)(`section`,{className:`gateway-review`,"aria-label":l?`导入配置预览`:`保存配置预览`,children:[(0,W.jsx)(`h3`,{children:l?`预览导入配置`:`确认配置更改`}),(0,W.jsx)(`p`,{children:l?`应用到表单后仍需检查并保存,才会修改配置文件。导入将替换当前表单中的可编辑配置。`:`以下更改将在服务重启后生效。请确认新的访问地址和认证配置。`}),l&&(0,W.jsxs)(`p`,{children:[`保留当前数据目录和项目初始配置。`,l.preserved.length>0?`已忽略导入文件中的 ${l.preserved.join(`、`)}。`:``]}),A.length?(0,W.jsx)(`div`,{className:`gateway-changes`,children:A.map(e=>(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`strong`,{children:e.label}),(0,W.jsxs)(`span`,{children:[`已保存:`,e.before||`未设置`]}),(0,W.jsxs)(`span`,{children:[`更改为:`,e.after||`未设置`]})]},e.label))}):(0,W.jsx)(`p`,{children:`与已保存配置没有差异。`}),(0,W.jsxs)(`details`,{className:`gateway-json`,children:[(0,W.jsx)(`summary`,{children:`查看完整 JSON`}),(0,W.jsx)(`pre`,{children:JSON.stringify(k,null,2)})]}),(0,W.jsxs)(`div`,{className:`project-dialog-actions`,children:[(0,W.jsx)(q,{variant:`secondary`,disabled:d,onClick:()=>{u(void 0),c(void 0)},children:`返回编辑`}),l?(0,W.jsx)(q,{disabled:d,onClick:()=>{o(aw(l.config)),u(void 0),g(`导入配置已应用到表单,尚未保存。`)},children:`应用到表单`}):(0,W.jsx)(q,{disabled:d||_||!A.length,onClick:()=>void C(async()=>{let e=await Oe.saveGatewayConfig(r.revision,k);i(e),o(aw(e.saved)),c(void 0),g(e.restartRequired?`配置已保存。请在方便时手动重启服务。`:`配置已保存,与当前运行配置一致。`)}),children:d?`正在保存…`:`确认保存`})]})]}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:`gateway-tools`,children:[(0,W.jsxs)(q,{variant:`secondary`,size:`sm`,disabled:d||!r.writable,onClick:()=>n.current?.click(),children:[(0,W.jsx)(ye,{size:15,"aria-hidden":`true`}),`导入配置`]}),(0,W.jsxs)(q,{variant:`secondary`,size:`sm`,disabled:d,onClick:()=>void E(),children:[(0,W.jsx)(ce,{size:15,"aria-hidden":`true`}),`导出已保存配置`]}),(0,W.jsx)(`input`,{ref:n,type:`file`,accept:`.json,application/json`,"aria-label":`选择配置文件`,hidden:!0,onChange:e=>void T(e)})]}),(0,W.jsx)(`p`,{className:`gateway-help`,children:`导入仅更新服务设置;导出包含文件中的项目初始配置,不包含页面注册项目、会话、数据库或登录凭据。`}),(0,W.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),C(async()=>{c((await Oe.importGatewayConfig(sw(a,r.saved))).config)})},children:[(0,W.jsxs)(`fieldset`,{disabled:d||!r.writable,children:[(0,W.jsxs)(`section`,{className:`gateway-section`,children:[(0,W.jsx)(`h3`,{children:`网络与访问`}),(0,W.jsxs)(`div`,{className:`gateway-fields`,children:[iw.filter(e=>e.group===`network`).map(j),(0,W.jsxs)(`label`,{className:`project-field`,children:[(0,W.jsx)(`span`,{children:`认证模式`}),(0,W.jsxs)(`select`,{"aria-label":`认证模式`,value:a.mode,onChange:e=>o({...a,mode:e.target.value}),children:[(0,W.jsx)(`option`,{value:`local`,children:`本机 / Tailscale(local)`}),(0,W.jsx)(`option`,{value:`cloudflare-access`,children:`Cloudflare Access`})]}),(0,W.jsx)(`small`,{children:`本机模式仅监听回环地址;公开互联网入口使用 Cloudflare Access。`}),a.mode!==D?.mode&&(0,W.jsxs)(`small`,{className:`gateway-running`,children:[`当前运行:`,D?.mode]})]})]})]}),(0,W.jsxs)(`section`,{className:`gateway-section`,children:[(0,W.jsx)(`h3`,{children:`Codex`}),(0,W.jsx)(`div`,{className:`gateway-fields`,children:iw.filter(e=>e.group===`codex`).map(j)})]}),(0,W.jsxs)(`section`,{className:`gateway-section`,children:[(0,W.jsx)(`h3`,{children:`数据与项目`}),(0,W.jsxs)(`div`,{className:`gateway-file`,children:[(0,W.jsx)(`span`,{children:`数据目录(只读)`}),(0,W.jsx)(`code`,{children:r.saved.dataDir}),(0,W.jsx)(`span`,{children:`当前运行目录`}),(0,W.jsx)(`code`,{children:r.running.dataDir})]}),(0,W.jsx)(`p`,{className:`gateway-help`,children:`数据目录变更需要迁移数据库,请在服务停止后处理。项目请在侧栏添加、重命名或移除;此处不覆盖已保存的项目管理结果。`})]}),(0,W.jsxs)(`details`,{className:`gateway-section`,children:[(0,W.jsx)(`summary`,{children:`高级设置`}),(0,W.jsx)(`div`,{className:`gateway-fields`,children:iw.filter(e=>e.group===`advanced`).map(j)})]})]}),(0,W.jsxs)(`div`,{className:`gateway-save-bar`,children:[(0,W.jsx)(`span`,{children:x?`有未保存的更改`:`没有未保存的更改`}),(0,W.jsx)(q,{type:`submit`,disabled:d||!x||!r.writable||_,children:d?`正在校验…`:`检查更改`})]})]})]})]})]})}var dw=[`stable`,`beta`,`dev`],fw=e=>!!(e&&[`installing`,`waiting`,`stopping`,`verifying`].includes(e.phase)),pw={stable:`稳定版`,beta:`预览版`,dev:`开发版`},mw={installing:`正在安装候选版本`,waiting:`等待任务空闲`,stopping:`正在备份并重启`,verifying:`正在验证新版`,succeeded:`升级成功`,rolledBack:`已恢复上一版本`,failed:`升级失败`},hw={verified:`已验证`,unverified:`尚未验证`,unsupported:`明确不支持`,unknown:`无法确认`};function gw({title:e,value:t}){return(0,W.jsxs)(`section`,{className:`update-codex`,"aria-label":e,"data-state":t.status,children:[(0,W.jsx)(`h3`,{children:e}),(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`span`,{children:`Codex CLI`}),(0,W.jsx)(`strong`,{children:t.version??`未识别`}),(0,W.jsx)(`span`,{className:`update-codex-status`,children:hw[t.status]})]}),t.manifest&&(0,W.jsxs)(`p`,{className:`subtle`,children:[`推荐:`,t.manifest.recommended,` · 已验证:`,t.manifest.verified.join(`、`)]}),t.reason&&(0,W.jsx)(`p`,{children:t.reason})]})}function _w({updates:e,onClose:t}){let n=(0,O.useRef)(null),{status:r,busy:i,error:a,reloadError:o}=e,[s,c]=(0,O.useState)(),l=s??r?.settings.channel??`stable`,[u,d]=(0,O.useState)(!1),f=r?.available?.channel===l?r.available:void 0,p=fw(r?.run),m=f?.version===r?.version,[h,g]=(0,O.useState)(),_=JSON.stringify([l,f?.version,f?.codex]),v=h===_,y=f?.codex,b=!m&&y?.status===`unverified`,x=!m&&f&&(!y||y.status===`unknown`||y.status===`unsupported`||b&&!v);return(0,O.useEffect)(()=>{g(void 0)},[_]),(0,O.useEffect)(()=>{let e=n.current;return e?.showModal(),()=>e?.close()},[]),(0,W.jsxs)(`dialog`,{ref:n,className:`project-dialog update-dialog`,"aria-labelledby":`update-title`,onCancel:e=>{e.preventDefault(),t()},children:[(0,W.jsxs)(`div`,{className:`project-dialog-heading`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(ie,{size:20,"aria-hidden":`true`}),(0,W.jsx)(`h2`,{id:`update-title`,children:`Covro 更新`})]}),(0,W.jsx)(q,{variant:`ghost`,size:`icon`,"aria-label":`关闭更新设置`,onClick:t,children:(0,W.jsx)(J,{name:`close`,size:17})})]}),(0,W.jsxs)(`div`,{className:`update-version`,children:[(0,W.jsx)(`span`,{children:`当前 Covro`}),(0,W.jsx)(`strong`,{children:r?.version??`读取中…`}),r?.commit&&(0,W.jsx)(`code`,{children:r.commit.slice(0,8)})]}),r?.codex&&(0,W.jsx)(gw,{title:`当前 Codex`,value:r.codex}),(0,W.jsxs)(`label`,{className:`update-channel`,children:[`版本渠道`,(0,W.jsx)(`select`,{"aria-label":`版本渠道`,value:l,disabled:i||p,onChange:t=>{let n=t.target.value;c(n),d(!1),g(void 0),e.check(n)},children:dw.map(e=>(0,W.jsx)(`option`,{value:e,children:pw[e]},e))})]}),(0,W.jsx)(`p`,{className:`subtle`,children:l===`stable`?`经过验证的正式版本,适合日常使用。`:l===`beta`?`提前体验准备发布的功能。`:`跟随通过检查的 main 提交,适合开发者体验和验证新功能。`}),(0,W.jsxs)(`div`,{className:`update-control`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`strong`,{children:`空闲时自动升级`}),(0,W.jsx)(`p`,{className:`subtle`,children:`定期检查当前渠道,已验证的 Codex 组合在任务结束后安装并重启。`})]}),(0,W.jsx)(q,{role:`switch`,"aria-label":`空闲时自动升级`,"aria-checked":r?.settings.automatic??!1,variant:`secondary`,size:`sm`,disabled:i||p||!r?.supported,onClick:()=>r&&void e.configure({...r.settings,automatic:!r.settings.automatic}),children:r?.settings.automatic?`已开启`:`已关闭`})]}),r&&l!==r.settings.channel&&(0,W.jsxs)(`p`,{className:`subtle`,children:[`当前订阅:`,pw[r.settings.channel],`。成功更新后切换到`,pw[l],`。`]}),f&&(0,W.jsxs)(`div`,{className:`update-available`,children:[(0,W.jsx)(`span`,{children:m?`此渠道已是当前版本`:f.downgrade?`目标版本`:`可用版本`}),(0,W.jsx)(`strong`,{children:f.version}),f.commit&&(0,W.jsx)(`code`,{children:f.commit.slice(0,8)})]}),f?.codex&&(0,W.jsx)(gw,{title:`目标版本兼容性`,value:f.codex}),b&&(0,W.jsxs)(`label`,{className:`update-downgrade update-codex-consent`,children:[(0,W.jsx)(`input`,{type:`checkbox`,"aria-label":`允许尝试未验证的 Codex 组合`,checked:v,disabled:i||p,onChange:e=>g(e.target.checked?_:void 0)}),`我确认尝试 Codex `,y?.version,` 与 Covro `,f?.version,` `,`的未验证组合;此确认仅用于本次升级。`]}),f&&!m&&f.channel===r?.settings.channel&&r.settings.automatic&&y?.status!==`verified`&&(0,W.jsx)(`p`,{className:`update-notice`,role:`status`,children:y?.status===`unverified`?`自动升级已暂停。可以调整 Codex 版本后重新检查,或勾选确认后手动尝试。`:`自动升级已暂停。请先恢复 Codex 连接、调整版本或等待含有效兼容声明的发行版,再重新检查。`}),(0,W.jsxs)(`div`,{className:`update-buttons`,children:[(0,W.jsx)(q,{variant:`secondary`,disabled:i||p,onClick:()=>void e.check(l),children:i?`正在处理…`:`检查更新`}),(0,W.jsx)(q,{disabled:i||p||!f||!r?.supported||!!x||f.downgrade&&!u||m&&l===r.settings.channel,onClick:()=>void e.start(l,u,b&&v&&f?.codex.version?{version:f.codex.version,target:f.version}:void 0),children:m?`使用此渠道`:f?.downgrade?`切换并重启`:`升级并重启`})]}),f?.downgrade&&(0,W.jsxs)(`label`,{className:`update-downgrade`,children:[(0,W.jsx)(`input`,{type:`checkbox`,checked:u,onChange:e=>d(e.target.checked)}),`允许降级;数据库不兼容时仍会阻止切换`]}),r?.run&&(0,W.jsxs)(`section`,{className:`update-progress`,"data-phase":r.run.phase,role:`status`,children:[(0,W.jsx)(`strong`,{children:mw[r.run.phase]}),(0,W.jsxs)(`span`,{children:[r.run.from,` → `,r.run.target]}),(0,W.jsx)(`p`,{children:r.run.message}),p&&(0,W.jsx)(`progress`,{"aria-label":`升级进度`})]}),(a||r?.checkError||o)&&(0,W.jsx)(`p`,{className:`inline-error`,role:`alert`,children:o??a??r?.checkError}),!r?.supported&&r?.unsupportedReason&&(0,W.jsx)(`p`,{className:`update-notice`,children:r.unsupportedReason}),(0,W.jsxs)(`p`,{className:`update-source`,children:[`版本来源:npm 官方 registry · `,l===`stable`?`latest`:l,(0,W.jsxs)(`a`,{href:`https://github.com/yuzheng14/codex-web-ui/releases`,target:`_blank`,rel:`noreferrer`,children:[`更新记录 `,(0,W.jsx)(ue,{size:12,"aria-hidden":`true`})]})]}),(0,W.jsx)(`p`,{className:`subtle`,children:`升级保留配置、项目和会话记录。页面关闭也会继续处理,重启后自动恢复连接。`})]})}function vw(){let[e,t]=(0,O.useState)(),[n,r]=(0,O.useState)(),[i,a]=(0,O.useState)(!1),[o,s]=(0,O.useState)(),c=(0,O.useRef)(!1),l=(0,O.useRef)(!0),u=(0,O.useRef)(0),d=(0,O.useCallback)(async e=>{if(l.current&&(t(e),r(void 0),e.version!==`unknown`&&e.version!==`0.1.0-dev.39202054561.1`&&!c.current&&(!e.run||e.run.committed||[`rolledBack`,`failed`].includes(e.run.phase)))){c.current=!0;try{await er()}catch(e){c.current=!1,s(e instanceof Error?e.message:`草稿未能备份,暂缓重载页面`)}}},[]);(0,O.useEffect)(()=>{l.current=!0;let e=!0,t=!1,n=async()=>{if(t)return;t=!0;let n=u.current;try{let t=await De(`/api/updates`);e&&n===u.current&&await d(t)}catch{e&&r(`连接暂时中断,正在等待服务恢复…`)}finally{t=!1}};n();let i=setInterval(()=>void n(),5e3);return()=>{l.current=!1,e=!1,clearInterval(i)}},[d]);let f=(0,O.useCallback)(async(e,t)=>{u.current++,a(!0),r(void 0);try{await d(await De(e,t))}catch(e){r(e instanceof Error?e.message:`操作未能确认,请查看升级状态`)}finally{a(!1),u.current++}},[d]);return{status:e,error:n,busy:i,reloadError:o,check:e=>f(`/api/updates/check`,{channel:e}),configure:e=>f(`/api/updates/settings`,e),start:(e,t,n)=>f(`/api/updates/run`,{clientOperationId:crypto.randomUUID(),channel:e,allowDowngrade:t,codexConfirmation:n})}}var yw=encodeURIComponent;function bw({threadId:e,children:t}){return(0,W.jsx)(`div`,{className:`app-shell`,children:(0,W.jsx)(Dy,{threadId:e,children:t})})}function xw(){let e=nr(),t=vw(),[n,r]=(0,O.useState)(!1),{isUnreadCompletion:i,markCompletedRead:a}=sr(),[o,s]=(0,O.useState)(!1),[c,l]=(0,O.useState)(!1),[u,d]=(0,O.useState)(!1);(0,O.useEffect)(()=>{let e=window.matchMedia(`(min-width: 761px)`),t=()=>{e.matches&&s(!1)};return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[]);let[f,p]=(0,O.useState)(!1),[m,h]=(0,O.useState)(!1),g=(0,O.useRef)(!1),[_,v]=(0,O.useState)(),[y,b]=(0,O.useState)(!1),[x,S]=(0,O.useState)(!1),C=(0,O.useRef)(!1),w=e.projects.find(t=>t.id===e.projectId),T=_?.kind===`manage`?e.projects.find(e=>e.id===_.id):void 0;(0,O.useEffect)(()=>{_?.kind===`manage`&&!T&&v(void 0)},[_,T]);let E=()=>{s(!1),v({kind:`add`})},{thread:D,system:k}=e,A=(0,O.useRef)(void 0),j=!(!k?.ready||k.authenticated===!1||e.connection!==`connected`||e.authRequired),M=j&&!!w?.available&&!Mn(k),N=Pn(k,e.connection,e.authRequired),P=jn(k)??``,F=(t,n=D?.id??``)=>e.busy.includes(`${t}:${n}`),te=t=>e.operations.some(e=>Tn(e,t)),I=D?.turns.findLast(e=>al(e.status)),ne=D?.actions.filter(e=>e.status===`pending`||e.status===`responding`||e.kind===`unsupported`&&e.status===`expired`)??[],L=D?te(D.id)&&!F(`resume`)||D.managed&&D.status===`unknown`||D.execution&&!D.execution.ended&&D.status===`unknown`:!F(`create`,e.projectId)&&te(e.projectId),R=!!(D&&(!M||D.archived||te(D.id)||F(`resume`)||D.execution&&!D.execution.ended)),{run:z,refreshThread:re}=e,ie=(0,O.useCallback)(()=>{D&&!R&&(A.current=`${k?.codexEpoch}:${D.id}`,z(`resume`,D.id,`/api/threads/${yw(D.id)}/resume`).then(()=>re()))},[D,R,k?.codexEpoch,z,re]);(0,O.useEffect)(()=>{if((!k?.ready||D?.archived)&&(A.current=void 0),!D||D.managed||R)return;let e=`${k?.codexEpoch}:${D.id}`;A.current!==e&&ie()},[D,k?.ready,k?.codexEpoch,R,ie]);let ae=!!(D&&e.operations.some(e=>e.kind===`fork`&&Tn(e,D.id))),oe=k?.capabilities.includes(`thread/fork`)??!1,se=t=>F(`fork`,t)||e.operations.some(e=>e.kind===`fork`&&Tn(e,t)),ce=t=>{if(se(t.id))return`正在确认 Fork…请等待提交回执,暂时不能再次 Fork。`;if(!oe)return`当前 Codex 版本不支持 Fork 会话。`;if(!j)return`连接恢复且 Codex 就绪后可 Fork 会话。`;if(!e.projects.find(e=>e.id===t.projectId)?.available)return`项目目录不可用,恢复后可 Fork 会话。`;if(Mn(k))return`请先确认当前 Codex 版本的兼容性。`;if(t.historyVisible===!1||t.id===D?.id&&!D.turns.length)return`发送首条消息后可 Fork 已保存的历史。`},le=!!(D&&se(D.id)),ue=!(!D?.turns.length||ce(D)),B=async t=>{if(!ce(t))return e.run(`fork`,t.id,`/api/threads/${yw(t.id)}/fork`,t.id===D?.id?{settings:e.settings}:{})},de=()=>{D&&ue&&B(D)},fe=e.connection!==`connected`,pe=e.operations.filter(e=>e.kind===`confirmCompatibility`&&e.target===P),me=y||F(`confirmCompatibility`,P)||pe.some(e=>e.status===`accepted`||e.status===`dispatching`),ge=pe.some(e=>e.status===`unknown`&&!e.operation?.reconciliation);async function _e(){if(!g.current){g.current=!0,h(!0);try{await Promise.all([e.refreshSystem(),e.refreshThread()]),await e.refreshOperations(!0)}finally{g.current=!1,h(!1)}}}async function ve(){if(N&&!C.current){C.current=!0,b(!0);try{let t=await e.refreshSystem(),n=In(P,t,e.connection,e.authRequired);if(!n)return;await e.run(`confirmCompatibility`,P,`/api/system/compatibility/confirm`,n)}finally{C.current=!1,b(!1)}}}let ye={project:w,selectedId:e.selectedId,thread:D,system:k,connection:e.connection,authRequired:e.authRequired,settings:e.settings,openDraft:e.openDraft,busy:e.busy,operations:e.operations,run:e.run,onResumeAttempt:()=>{A.current=`${k?.codexEpoch}:${D?.id}`},refreshThread:e.refreshThread,openStatus:()=>p(!0),exportThread:ew},be=(0,O.useRef)(ye);be.current=ye;let xe=NC(()=>be.current),Se=xe.find(e=>e.name===`rename`);async function Ce(t,n,r){return!M||e.restoringSelection||e.savingModelDefaults?!1:D?n&&!I?!1:(await e.run(n?`steer`:`send`,D.id,`/api/threads/${yw(D.id)}/${n?`steer`:`turns`}`,n?{text:t,images:r,expectedTurnId:I.id}:{text:t,images:r,settings:e.settings},{kind:`send`,key:e.draftKey,text:t,images:r}))?.status===`acknowledged`:!e.selectedId&&e.sendFirstMessage(t,r)}return(0,W.jsxs)(bw,{threadId:D?.id,children:[(0,W.jsx)(dl,{onGatewaySettings:()=>{s(!1),d(!0)},onUpdates:()=>{s(!1),r(!0)},appVersion:t.status?.version,updateAvailable:!!(t.status?.available&&t.status.available.version!==t.status.version),updating:fw(t.status?.run),onNotificationSettings:()=>{s(!1),l(!0)},notificationStatus:e.notifications.error?`请检查设置`:e.notifications.enabled&&e.notifications.access===`granted`?`已开启`:`未开启`,archiveView:e.archiveView,onArchiveView:e.setArchiveView,onArchive:(t,n)=>{e.archiveThread(t,n)},onFork:e=>{B(e).then(e=>{e?.status===`acknowledged`&&s(!1)})},forkDisabledReason:ce,forking:se,archiveDisabledReason:t=>{if(F(`archive`,t.id))return`正在保存…`;if(te(t.id))return`请先核对会话操作的结果`;if(!j)return`连接恢复后可操作`;if(Mn(k))return`请先确认 Codex 版本兼容性`;if(!k?.capabilities.includes(t.archived?`thread/unarchive`:`thread/archive`))return`当前 Codex 不支持此操作`;if(!e.projects.find(e=>e.id===t.projectId)?.available)return`项目目录不可用`;if(!t.archived&&(al(t.status)||t.pendingActionCount>0))return`任务结束并处理完待办后可归档`;if(!t.archived&&t.managed&&t.status===`unknown`)return`会话状态待核对,暂时无法归档`},projects:e.projects,projectsLoaded:e.projectsLoaded,projectId:e.projectId,onProject:t=>{e.setProjectId(t),s(!1)},projectThreads:e.projectThreads,selectedId:e.selectedId,isUnreadCompletion:i,onThread:(t,n)=>{e.selectThread(t,n)},onMore:(t,n)=>{e.loadProjectThreads(t,n)},onRetry:t=>{e.loadProjectThreads(t,e.projectThreads[t]?.retryCursor)},onRefresh:()=>{e.refreshProjects().then(e.refreshProjectsThreads)},onAddProject:E,onManageProject:e=>{s(!1),v({kind:`manage`,id:e.id})},canManageProjects:!e.authRequired,onCreate:t=>{e.setProjectId(t),s(!1)},creating:t=>e.firstMessages.includes(t)||F(`create`,t)||te(t),canCreate:t=>j&&!e.savingModelDefaults&&!Mn(k)&&!!e.projects.find(e=>e.id===t)?.available,offline:fe,open:o,onClose:()=>s(!1)}),(0,W.jsxs)(`main`,{className:`main-panel`,children:[(0,W.jsxs)(`header`,{className:`topbar`,children:[(0,W.jsxs)(`div`,{className:`topbar-title`,children:[(0,W.jsx)(q,{className:`mobile-only`,variant:`ghost`,size:`icon`,"aria-label":`打开项目与会话`,onClick:()=>s(!0),children:(0,W.jsx)(J,{name:`menu`})}),(0,W.jsxs)(`div`,{children:[(0,W.jsxs)(`div`,{className:`breadcrumb`,children:[w?.name??`工作空间`,(0,W.jsx)(J,{name:`chevron`,size:12}),(0,W.jsx)(`span`,{children:D?`会话`:`新会话`})]}),D?(0,W.jsx)(ab,{title:D.title||`新会话`,rename:Se,pending:!!(D&&e.operations.some(e=>e.kind===`rename`&&Tn(e,D.id)))},`${D.projectId}:${D.id}`):(0,W.jsx)(`h1`,{children:`开始你的下一项任务`})]})]}),(0,W.jsxs)(`div`,{className:`topbar-status`,children:[D&&(0,W.jsx)(ol,{status:D.status,offline:fe}),(0,W.jsx)(ZC,{connection:e.connection}),D?.forkedFromId&&(0,W.jsx)(Ic,{id:`thread-source-hint`,content:`返回原会话`,children:(0,W.jsx)(q,{variant:`ghost`,size:`icon`,"aria-label":`返回原会话`,"aria-describedby":`thread-source-hint`,onClick:()=>{e.selectThread(D.forkedFromId)},children:(0,W.jsx)(ee,{size:16})})}),(0,W.jsx)($C,{system:k,connection:e.connection,operations:e.operations,thread:D,busy:e.busy,open:f,onOpenChange:p,refreshing:m,onDiscardMissing:e.discardMissingOperation,onRefresh:()=>{_e(),fe&&e.retryConnection()},onReconcile:t=>{e.run(`reconcile`,t,`/api/operations/${yw(t)}/reconcile`,{confirmEnded:!0}).then(e=>{if(e?.status===`acknowledged`)return _e()})}})]})]}),k?.demo&&(0,W.jsx)(`div`,{className:`demo-banner`,children:`模拟测试模式 · 当前执行结果来自显式启用的测试 app-server`}),e.authRequired?(0,W.jsxs)(`div`,{className:`error-banner persistent-banner`,role:`alert`,children:[(0,W.jsx)(J,{name:`alert`}),`登录已过期。任务不会因页面断开而被取消。`,(0,W.jsx)(`a`,{className:`button button-secondary button-small`,href:`/`,children:`重新打开登录入口`})]}):fe&&(0,W.jsxs)(`div`,{className:`connection-banner`,role:`status`,children:[(0,W.jsxs)(`span`,{children:[`实时连接`,e.connection===`connecting`?`正在建立`:`已断开,正在重连`,`。当前显示上次已知状态。`]}),(0,W.jsx)(q,{variant:`ghost`,size:`sm`,onClick:e.retryConnection,children:`立即重连`})]}),k&&!k.ready&&(0,W.jsxs)(`div`,{className:`error-banner persistent-banner`,role:`alert`,children:[`Codex 尚不可用:`,k.error??`请在私人电脑上检查 Codex 安装、认证与服务状态。`]}),(0,W.jsx)(tw,{system:k,onOpenChange:S,canConfirm:N,submitting:me,uncertain:ge,error:e.error,onRefresh:()=>{e.refreshSystem(),e.refreshOperations()},onConfirm:()=>{ve()},onReconfirm:()=>{ve()}}),e.error&&(0,W.jsxs)(`div`,{className:`error-banner dismissible`,role:`alert`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`span`,{children:e.error}),e.errorDetails!==void 0&&(0,W.jsxs)(`details`,{className:`raw-details`,children:[(0,W.jsx)(`summary`,{children:`错误详情`}),(0,W.jsx)(`pre`,{children:JSON.stringify(e.errorDetails,null,2)})]})]}),(0,W.jsx)(q,{variant:`ghost`,size:`icon`,"aria-label":`关闭错误提示`,onClick:e.clearError,children:(0,W.jsx)(J,{name:`close`,size:15})})]}),e.operations.filter(e=>e.mutation).map(e=>(0,W.jsxs)(`div`,{className:`archive-notice mutation-notice`,role:`status`,children:[e.kind===`rename`?(0,W.jsx)(he,{size:16}):(0,W.jsx)(J,{name:`archive`,size:16}),(0,W.jsx)(`span`,{children:e.kind===`rename`?e.status===`unknown`?`重命名结果待确认`:`正在保存会话名称…`:e.mutation.archived?e.status===`unknown`?`归档结果待确认`:`正在归档会话…`:e.status===`unknown`?`取消归档结果待确认`:`正在取消归档…`}),e.status===`unknown`&&(0,W.jsx)(q,{variant:`secondary`,size:`sm`,disabled:m,onClick:()=>void _e(),children:m?`正在核对…`:`核对提交`})]},e.clientOperationId)),D?.archived&&(0,W.jsxs)(`div`,{className:`archive-notice`,role:`status`,children:[(0,W.jsx)(J,{name:`archive`,size:18}),(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`strong`,{children:`此会话已归档`}),(0,W.jsx)(`p`,{children:`历史已保留。取消归档后可继续对话。`})]}),(0,W.jsx)(q,{variant:`secondary`,size:`sm`,disabled:!M||te(D.id)||F(`archive`)||!k?.capabilities.includes(`thread/unarchive`),onClick:()=>{e.archiveThread(D.id,!1)},children:F(`archive`)?`正在保存…`:`取消归档`})]}),(0,W.jsx)(rb,{thread:D,readingEnabled:!o&&!_&&!f&&!e.authRequired&&!x,onReadCompleted:a,offline:fe,projectName:w?.name,needsProject:e.projectsLoaded&&e.projects.length===0,canAddProject:!e.authRequired,onAddProject:E,questionControls:{disabled:!M||!D?.managed||!!D.archived||!!L||F(`send`)||F(`steer`)||F(`resume`),onReply:async e=>Ce(My(e),!!I)}}),(0,W.jsxs)(`div`,{className:`bottom-region`,children:[ne.length>0&&(0,W.jsx)(`div`,{className:`pending-actions`,"aria-label":`待处理请求`,children:ne.map(t=>(0,W.jsx)(JC,{action:t,disabled:!M||F(`resolve`,t.actionId)||te(t.actionId),onResolve:n=>{e.run(`resolve`,t.actionId,`/api/actions/${yw(t.actionId)}/resolve`,{resolution:n})}},t.actionId))}),L&&(0,W.jsxs)(`div`,{className:`pending-notice`,role:`status`,children:[(0,W.jsx)(J,{name:`alert`,size:15}),(0,W.jsx)(`span`,{children:D?ae?`Fork 结果尚未确认。请核对提交,暂时不能再次 Fork。`:`提交结果尚未确认。请核对提交,也可以 Fork 已保存的历史为新会话。`:`新建会话的提交结果尚未确认。请先核对提交,避免重复创建。`}),(0,W.jsx)(q,{variant:`ghost`,size:`sm`,disabled:m,"aria-expanded":f,"aria-controls":`diagnostics-panel`,onClick:()=>{p(!0),_e()},children:m?`正在核对…`:`核对提交`}),D&&!ae&&(0,W.jsx)(q,{variant:`secondary`,size:`sm`,disabled:!ue,onClick:de,children:`Fork 为新会话`})]}),(0,W.jsx)(PC,{commands:xe,thread:D,threadLoading:e.restoringSelection||!(!e.selectedId||D),draftKey:e.draftKey,sentDrafts:e.sentDrafts,projectName:w?.name,projectId:w?.available?w.id:void 0,runtimeKey:k?.ready&&e.connection===`connected`?`${k.codexEpoch}:${e.runtimeDefaultsRevision}`:void 0,settings:e.settings,models:k?.models??[],onSettings:e.setSettings,onSaveModelDefaults:e.saveModelDefaults,savingModelDefaults:e.savingModelDefaults,disabled:!M||e.restoringSelection||!!L||!!D?.archived,canInterrupt:j&&!!(D?.managed&&I),submitting:e.firstMessages.includes(e.projectId)||F(`send`)||F(`steer`),interrupting:F(`interrupt`),resuming:F(`resume`),canResume:!R,resumeAttempted:A.current===`${k?.codexEpoch}:${D?.id}`,canFork:ue,forking:le,onFork:de,onResume:ie,onInterrupt:()=>{D&&I&&e.run(`interrupt`,D.id,`/api/threads/${yw(D.id)}/interrupt`,{expectedTurnId:I.id})},onSend:Ce})]})]}),_&&(_.kind===`add`||T)&&(0,W.jsx)(nw,{project:T,disabled:e.authRequired,onAdd:e.addProject,onRename:e.renameProject,onRemove:e.removeProject,onClose:()=>v(e=>e===_?void 0:e)},_.kind===`add`?`add`:_.id),c&&(0,W.jsx)(rw,{notifications:e.notifications,onClose:()=>l(!1)}),u&&(0,W.jsx)(uw,{onClose:()=>d(!1)}),n&&(0,W.jsx)(_w,{updates:t,onClose:()=>r(!1)})]})}(0,we.createRoot)(document.getElementById(`root`)).render((0,W.jsx)(O.StrictMode,{children:(0,W.jsx)(xw,{})}));
|
package/dist/web/index.html
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<meta name="theme-color" content="#f7f8fa" />
|
|
7
7
|
<link rel="icon" type="image/svg+xml" href="/covro.svg" />
|
|
8
8
|
<title>Covro · 工作空间</title>
|
|
9
|
-
<script type="module" crossorigin src="/assets/index-
|
|
9
|
+
<script type="module" crossorigin src="/assets/index-C9imDXx3.js"></script>
|
|
10
10
|
<link rel="stylesheet" crossorigin href="/assets/index-L3S1ZiO0.css">
|
|
11
11
|
</head>
|
|
12
12
|
<body>
|