toc-ocra 0.3.8 → 0.3.10
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/cli/cli.mjs +344 -329
- package/dist/plugin/renderer.js.map +1 -1
- package/dist/service/agent.mjs +220 -205
- package/dist/src/platform/posix.js +8 -1
- package/dist/src/platform/posix.js.map +1 -1
- package/dist/src/providers/kiro-auth.d.ts +5 -4
- package/dist/src/providers/kiro-auth.js +33 -32
- package/dist/src/providers/kiro-auth.js.map +1 -1
- package/dist/src/providers/model-catalog.js +2 -5
- package/dist/src/providers/model-catalog.js.map +1 -1
- package/dist/src/runs/run-supervisor.js +11 -0
- package/dist/src/runs/run-supervisor.js.map +1 -1
- package/package.json +1 -1
package/dist/service/agent.mjs
CHANGED
|
@@ -7,7 +7,7 @@ var __export = (target, all) => {
|
|
|
7
7
|
|
|
8
8
|
// src/plugin-service.ts
|
|
9
9
|
import { existsSync as existsSync7 } from "node:fs";
|
|
10
|
-
import { delimiter as delimiter5, join as
|
|
10
|
+
import { delimiter as delimiter5, join as join22 } from "node:path";
|
|
11
11
|
|
|
12
12
|
// src/config.ts
|
|
13
13
|
import { randomUUID } from "node:crypto";
|
|
@@ -16,7 +16,7 @@ import { chmod, mkdir, rename, writeFile } from "node:fs/promises";
|
|
|
16
16
|
import { homedir, hostname as hostname3, platform } from "node:os";
|
|
17
17
|
import { delimiter, dirname, join, resolve, sep } from "node:path";
|
|
18
18
|
|
|
19
|
-
//
|
|
19
|
+
// node_modules/zod/v4/classic/external.js
|
|
20
20
|
var external_exports = {};
|
|
21
21
|
__export(external_exports, {
|
|
22
22
|
$brand: () => $brand,
|
|
@@ -279,7 +279,7 @@ __export(external_exports, {
|
|
|
279
279
|
xor: () => xor
|
|
280
280
|
});
|
|
281
281
|
|
|
282
|
-
//
|
|
282
|
+
// node_modules/zod/v4/core/index.js
|
|
283
283
|
var core_exports2 = {};
|
|
284
284
|
__export(core_exports2, {
|
|
285
285
|
$ZodAny: () => $ZodAny,
|
|
@@ -596,7 +596,7 @@ __export(core_exports2, {
|
|
|
596
596
|
withParser: () => withParser
|
|
597
597
|
});
|
|
598
598
|
|
|
599
|
-
//
|
|
599
|
+
// node_modules/zod/v4/core/util.js
|
|
600
600
|
var util_exports = {};
|
|
601
601
|
__export(util_exports, {
|
|
602
602
|
BIGINT_FORMAT_RANGES: () => BIGINT_FORMAT_RANGES,
|
|
@@ -1452,7 +1452,7 @@ function constantCatch(value) {
|
|
|
1452
1452
|
return fn;
|
|
1453
1453
|
}
|
|
1454
1454
|
|
|
1455
|
-
//
|
|
1455
|
+
// node_modules/zod/v4/core/core.js
|
|
1456
1456
|
var _a;
|
|
1457
1457
|
var NEVER = /* @__PURE__ */ Object.freeze({
|
|
1458
1458
|
status: "aborted"
|
|
@@ -1574,7 +1574,7 @@ function config(newConfig) {
|
|
|
1574
1574
|
return globalConfig;
|
|
1575
1575
|
}
|
|
1576
1576
|
|
|
1577
|
-
//
|
|
1577
|
+
// node_modules/zod/v4/core/errors.js
|
|
1578
1578
|
function _getMessage() {
|
|
1579
1579
|
const internals = this._zod;
|
|
1580
1580
|
internals.message ?? (internals.message = JSON.stringify(internals.def, jsonStringifyReplacer, 2));
|
|
@@ -1766,7 +1766,7 @@ function prettifyError(error62) {
|
|
|
1766
1766
|
return lines.join("\n");
|
|
1767
1767
|
}
|
|
1768
1768
|
|
|
1769
|
-
//
|
|
1769
|
+
// node_modules/zod/v4/core/parse.js
|
|
1770
1770
|
function finalizeParams(callee, params) {
|
|
1771
1771
|
return { callee: params?.callee ?? callee, Err: params?.Err };
|
|
1772
1772
|
}
|
|
@@ -1926,7 +1926,7 @@ var _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {
|
|
|
1926
1926
|
};
|
|
1927
1927
|
var safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync($ZodRealError);
|
|
1928
1928
|
|
|
1929
|
-
//
|
|
1929
|
+
// node_modules/zod/v4/core/regexes.js
|
|
1930
1930
|
var regexes_exports = {};
|
|
1931
1931
|
__export(regexes_exports, {
|
|
1932
1932
|
anyString: () => anyString,
|
|
@@ -2098,7 +2098,7 @@ var sha512_hex = /^[0-9a-fA-F]{128}$/;
|
|
|
2098
2098
|
var sha512_base64 = /* @__PURE__ */ fixedBase64(86, "==");
|
|
2099
2099
|
var sha512_base64url = /* @__PURE__ */ fixedBase64url(86);
|
|
2100
2100
|
|
|
2101
|
-
//
|
|
2101
|
+
// node_modules/zod/v4/core/checks.js
|
|
2102
2102
|
var $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => {
|
|
2103
2103
|
var _a3;
|
|
2104
2104
|
inst._zod ?? (inst._zod = {});
|
|
@@ -2574,7 +2574,7 @@ var $ZodCheckOverwrite = /* @__PURE__ */ $constructor("$ZodCheckOverwrite", (ins
|
|
|
2574
2574
|
};
|
|
2575
2575
|
});
|
|
2576
2576
|
|
|
2577
|
-
//
|
|
2577
|
+
// node_modules/zod/v4/core/doc.js
|
|
2578
2578
|
var Doc = class {
|
|
2579
2579
|
constructor(args = [], closed = {}) {
|
|
2580
2580
|
this.content = [];
|
|
@@ -2615,14 +2615,14 @@ ${content.join("\n")}
|
|
|
2615
2615
|
}
|
|
2616
2616
|
};
|
|
2617
2617
|
|
|
2618
|
-
//
|
|
2618
|
+
// node_modules/zod/v4/core/versions.js
|
|
2619
2619
|
var version = {
|
|
2620
2620
|
major: 4,
|
|
2621
2621
|
minor: 6,
|
|
2622
2622
|
patch: 7
|
|
2623
2623
|
};
|
|
2624
2624
|
|
|
2625
|
-
//
|
|
2625
|
+
// node_modules/zod/v4/core/schemas.js
|
|
2626
2626
|
var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
2627
2627
|
var _a3;
|
|
2628
2628
|
inst ?? (inst = {});
|
|
@@ -5064,7 +5064,7 @@ function handleRefineResult(result, payload, input2, inst) {
|
|
|
5064
5064
|
}
|
|
5065
5065
|
}
|
|
5066
5066
|
|
|
5067
|
-
//
|
|
5067
|
+
// node_modules/zod/v4/core/memoizer.js
|
|
5068
5068
|
var $ZodCyclicError = class extends Error {
|
|
5069
5069
|
constructor() {
|
|
5070
5070
|
super(`Cannot parse a reference cycle that closes through a transform`);
|
|
@@ -5341,7 +5341,7 @@ function isBackEdge(ctx, value) {
|
|
|
5341
5341
|
return backEdges !== void 0 && isRef(value) && backEdges.has(value);
|
|
5342
5342
|
}
|
|
5343
5343
|
|
|
5344
|
-
//
|
|
5344
|
+
// node_modules/zod/v4/locales/index.js
|
|
5345
5345
|
var locales_exports = {};
|
|
5346
5346
|
__export(locales_exports, {
|
|
5347
5347
|
ar: () => ar_default,
|
|
@@ -5409,7 +5409,7 @@ __export(locales_exports, {
|
|
|
5409
5409
|
zhTW: () => zh_TW_default
|
|
5410
5410
|
});
|
|
5411
5411
|
|
|
5412
|
-
//
|
|
5412
|
+
// node_modules/zod/v4/locales/ar.js
|
|
5413
5413
|
var error = () => {
|
|
5414
5414
|
const Sizable = {
|
|
5415
5415
|
string: { unit: "\u062D\u0631\u0641", verb: "\u0623\u0646 \u064A\u062D\u0648\u064A" },
|
|
@@ -5521,7 +5521,7 @@ function ar_default() {
|
|
|
5521
5521
|
};
|
|
5522
5522
|
}
|
|
5523
5523
|
|
|
5524
|
-
//
|
|
5524
|
+
// node_modules/zod/v4/locales/az.js
|
|
5525
5525
|
var error2 = () => {
|
|
5526
5526
|
const Sizable = {
|
|
5527
5527
|
string: { unit: "simvol", verb: "olmal\u0131d\u0131r" },
|
|
@@ -5632,7 +5632,7 @@ function az_default() {
|
|
|
5632
5632
|
};
|
|
5633
5633
|
}
|
|
5634
5634
|
|
|
5635
|
-
//
|
|
5635
|
+
// node_modules/zod/v4/locales/be.js
|
|
5636
5636
|
function getBelarusianPlural(count2, one, few, many) {
|
|
5637
5637
|
const absCount = Math.abs(count2);
|
|
5638
5638
|
const lastDigit = absCount % 10;
|
|
@@ -5801,7 +5801,7 @@ function be_default() {
|
|
|
5801
5801
|
};
|
|
5802
5802
|
}
|
|
5803
5803
|
|
|
5804
|
-
//
|
|
5804
|
+
// node_modules/zod/v4/locales/bg.js
|
|
5805
5805
|
var error4 = () => {
|
|
5806
5806
|
const Sizable = {
|
|
5807
5807
|
string: { unit: "\u0441\u0438\u043C\u0432\u043E\u043B\u0430", verb: "\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430" },
|
|
@@ -5927,7 +5927,7 @@ function bg_default() {
|
|
|
5927
5927
|
};
|
|
5928
5928
|
}
|
|
5929
5929
|
|
|
5930
|
-
//
|
|
5930
|
+
// node_modules/zod/v4/locales/bn.js
|
|
5931
5931
|
var error5 = () => {
|
|
5932
5932
|
const Sizable = {
|
|
5933
5933
|
string: { unit: "\u0985\u0995\u09CD\u09B7\u09B0", verb: "\u09A5\u09BE\u0995\u09A4\u09C7 \u09B9\u09AC\u09C7" },
|
|
@@ -6041,7 +6041,7 @@ function bn_default() {
|
|
|
6041
6041
|
};
|
|
6042
6042
|
}
|
|
6043
6043
|
|
|
6044
|
-
//
|
|
6044
|
+
// node_modules/zod/v4/locales/ca.js
|
|
6045
6045
|
var error6 = () => {
|
|
6046
6046
|
const Sizable = {
|
|
6047
6047
|
string: { unit: "car\xE0cters", verb: "contenir" },
|
|
@@ -6155,7 +6155,7 @@ function ca_default() {
|
|
|
6155
6155
|
};
|
|
6156
6156
|
}
|
|
6157
6157
|
|
|
6158
|
-
//
|
|
6158
|
+
// node_modules/zod/v4/locales/ckb.js
|
|
6159
6159
|
var error7 = () => {
|
|
6160
6160
|
const Sizable = {
|
|
6161
6161
|
string: { unit: "\u067E\u06CC\u062A", verb: "\u0628\u06CE\u062A" },
|
|
@@ -6288,7 +6288,7 @@ function ckb_default() {
|
|
|
6288
6288
|
};
|
|
6289
6289
|
}
|
|
6290
6290
|
|
|
6291
|
-
//
|
|
6291
|
+
// node_modules/zod/v4/locales/cs.js
|
|
6292
6292
|
var error8 = () => {
|
|
6293
6293
|
const Sizable = {
|
|
6294
6294
|
string: { unit: "znak\u016F", verb: "m\xEDt" },
|
|
@@ -6405,7 +6405,7 @@ function cs_default() {
|
|
|
6405
6405
|
};
|
|
6406
6406
|
}
|
|
6407
6407
|
|
|
6408
|
-
//
|
|
6408
|
+
// node_modules/zod/v4/locales/da.js
|
|
6409
6409
|
var error9 = () => {
|
|
6410
6410
|
const Sizable = {
|
|
6411
6411
|
string: { unit: "tegn", verb: "havde" },
|
|
@@ -6526,7 +6526,7 @@ function da_default() {
|
|
|
6526
6526
|
};
|
|
6527
6527
|
}
|
|
6528
6528
|
|
|
6529
|
-
//
|
|
6529
|
+
// node_modules/zod/v4/locales/de.js
|
|
6530
6530
|
var error10 = () => {
|
|
6531
6531
|
const Sizable = {
|
|
6532
6532
|
string: { unit: "Zeichen", verb: "zu haben" },
|
|
@@ -6640,7 +6640,7 @@ function de_default() {
|
|
|
6640
6640
|
};
|
|
6641
6641
|
}
|
|
6642
6642
|
|
|
6643
|
-
//
|
|
6643
|
+
// node_modules/zod/v4/locales/el.js
|
|
6644
6644
|
var error11 = () => {
|
|
6645
6645
|
const Sizable = {
|
|
6646
6646
|
string: { unit: "\u03C7\u03B1\u03C1\u03B1\u03BA\u03C4\u03AE\u03C1\u03B5\u03C2", verb: "\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9" },
|
|
@@ -6753,7 +6753,7 @@ function el_default() {
|
|
|
6753
6753
|
};
|
|
6754
6754
|
}
|
|
6755
6755
|
|
|
6756
|
-
//
|
|
6756
|
+
// node_modules/zod/v4/locales/en.js
|
|
6757
6757
|
var error12 = () => {
|
|
6758
6758
|
const Sizable = {
|
|
6759
6759
|
string: { unit: "characters", verb: "to have" },
|
|
@@ -6878,7 +6878,7 @@ function en_default() {
|
|
|
6878
6878
|
};
|
|
6879
6879
|
}
|
|
6880
6880
|
|
|
6881
|
-
//
|
|
6881
|
+
// node_modules/zod/v4/locales/eo.js
|
|
6882
6882
|
var error13 = () => {
|
|
6883
6883
|
const Sizable = {
|
|
6884
6884
|
string: { unit: "karaktrojn", verb: "havi" },
|
|
@@ -6993,7 +6993,7 @@ function eo_default() {
|
|
|
6993
6993
|
};
|
|
6994
6994
|
}
|
|
6995
6995
|
|
|
6996
|
-
//
|
|
6996
|
+
// node_modules/zod/v4/locales/es.js
|
|
6997
6997
|
var error14 = () => {
|
|
6998
6998
|
const Sizable = {
|
|
6999
6999
|
string: { unit: "caracteres", verb: "tener" },
|
|
@@ -7130,7 +7130,7 @@ function es_default() {
|
|
|
7130
7130
|
};
|
|
7131
7131
|
}
|
|
7132
7132
|
|
|
7133
|
-
//
|
|
7133
|
+
// node_modules/zod/v4/locales/fa.js
|
|
7134
7134
|
var error15 = () => {
|
|
7135
7135
|
const Sizable = {
|
|
7136
7136
|
string: { unit: "\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631", verb: "\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F" },
|
|
@@ -7250,7 +7250,7 @@ function fa_default() {
|
|
|
7250
7250
|
};
|
|
7251
7251
|
}
|
|
7252
7252
|
|
|
7253
|
-
//
|
|
7253
|
+
// node_modules/zod/v4/locales/fi.js
|
|
7254
7254
|
var error16 = () => {
|
|
7255
7255
|
const Sizable = {
|
|
7256
7256
|
string: { unit: "merkki\xE4", subject: "merkkijonon" },
|
|
@@ -7368,7 +7368,7 @@ function fi_default() {
|
|
|
7368
7368
|
};
|
|
7369
7369
|
}
|
|
7370
7370
|
|
|
7371
|
-
//
|
|
7371
|
+
// node_modules/zod/v4/locales/fr.js
|
|
7372
7372
|
var error17 = () => {
|
|
7373
7373
|
const Sizable = {
|
|
7374
7374
|
string: { unit: "caract\xE8res", verb: "avoir" },
|
|
@@ -7498,7 +7498,7 @@ function fr_default() {
|
|
|
7498
7498
|
};
|
|
7499
7499
|
}
|
|
7500
7500
|
|
|
7501
|
-
//
|
|
7501
|
+
// node_modules/zod/v4/locales/fr-CA.js
|
|
7502
7502
|
var error18 = () => {
|
|
7503
7503
|
const Sizable = {
|
|
7504
7504
|
string: { unit: "caract\xE8res", verb: "avoir" },
|
|
@@ -7611,7 +7611,7 @@ function fr_CA_default() {
|
|
|
7611
7611
|
};
|
|
7612
7612
|
}
|
|
7613
7613
|
|
|
7614
|
-
//
|
|
7614
|
+
// node_modules/zod/v4/locales/gu.js
|
|
7615
7615
|
var error19 = () => {
|
|
7616
7616
|
const Sizable = {
|
|
7617
7617
|
string: { unit: "\u0A85\u0A95\u0ACD\u0AB7\u0AB0", verb: "\u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F" },
|
|
@@ -7725,7 +7725,7 @@ function gu_default() {
|
|
|
7725
7725
|
};
|
|
7726
7726
|
}
|
|
7727
7727
|
|
|
7728
|
-
//
|
|
7728
|
+
// node_modules/zod/v4/locales/he.js
|
|
7729
7729
|
var error20 = () => {
|
|
7730
7730
|
const TypeNames = {
|
|
7731
7731
|
string: { label: "\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA", gender: "f" },
|
|
@@ -7927,7 +7927,7 @@ function he_default() {
|
|
|
7927
7927
|
};
|
|
7928
7928
|
}
|
|
7929
7929
|
|
|
7930
|
-
//
|
|
7930
|
+
// node_modules/zod/v4/locales/hi.js
|
|
7931
7931
|
var error21 = () => {
|
|
7932
7932
|
const Sizable = {
|
|
7933
7933
|
string: { unit: "\u0905\u0915\u094D\u0937\u0930", verb: "\u0930\u0916\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F" },
|
|
@@ -8039,7 +8039,7 @@ function hi_default() {
|
|
|
8039
8039
|
};
|
|
8040
8040
|
}
|
|
8041
8041
|
|
|
8042
|
-
//
|
|
8042
|
+
// node_modules/zod/v4/locales/hr.js
|
|
8043
8043
|
var error22 = () => {
|
|
8044
8044
|
const Sizable = {
|
|
8045
8045
|
string: { unit: "znakova", verb: "imati" },
|
|
@@ -8166,7 +8166,7 @@ function hr_default() {
|
|
|
8166
8166
|
};
|
|
8167
8167
|
}
|
|
8168
8168
|
|
|
8169
|
-
//
|
|
8169
|
+
// node_modules/zod/v4/locales/hu.js
|
|
8170
8170
|
var error23 = () => {
|
|
8171
8171
|
const Sizable = {
|
|
8172
8172
|
string: { unit: "karakter", verb: "legyen" },
|
|
@@ -8280,7 +8280,7 @@ function hu_default() {
|
|
|
8280
8280
|
};
|
|
8281
8281
|
}
|
|
8282
8282
|
|
|
8283
|
-
//
|
|
8283
|
+
// node_modules/zod/v4/locales/hy.js
|
|
8284
8284
|
function getArmenianPlural(count2, one, many) {
|
|
8285
8285
|
return Math.abs(count2) === 1 ? one : many;
|
|
8286
8286
|
}
|
|
@@ -8439,7 +8439,7 @@ function hy_default() {
|
|
|
8439
8439
|
};
|
|
8440
8440
|
}
|
|
8441
8441
|
|
|
8442
|
-
//
|
|
8442
|
+
// node_modules/zod/v4/locales/id.js
|
|
8443
8443
|
var error25 = () => {
|
|
8444
8444
|
const Sizable = {
|
|
8445
8445
|
string: { unit: "karakter", verb: "memiliki" },
|
|
@@ -8551,7 +8551,7 @@ function id_default() {
|
|
|
8551
8551
|
};
|
|
8552
8552
|
}
|
|
8553
8553
|
|
|
8554
|
-
//
|
|
8554
|
+
// node_modules/zod/v4/locales/is.js
|
|
8555
8555
|
var error26 = () => {
|
|
8556
8556
|
const Sizable = {
|
|
8557
8557
|
string: { unit: "stafi", verb: "a\xF0 hafa" },
|
|
@@ -8666,7 +8666,7 @@ function is_default() {
|
|
|
8666
8666
|
};
|
|
8667
8667
|
}
|
|
8668
8668
|
|
|
8669
|
-
//
|
|
8669
|
+
// node_modules/zod/v4/locales/it.js
|
|
8670
8670
|
var error27 = () => {
|
|
8671
8671
|
const Sizable = {
|
|
8672
8672
|
string: { unit: "caratteri", verb: "avere" },
|
|
@@ -8780,7 +8780,7 @@ function it_default() {
|
|
|
8780
8780
|
};
|
|
8781
8781
|
}
|
|
8782
8782
|
|
|
8783
|
-
//
|
|
8783
|
+
// node_modules/zod/v4/locales/ja.js
|
|
8784
8784
|
var error28 = () => {
|
|
8785
8785
|
const Sizable = {
|
|
8786
8786
|
string: { unit: "\u6587\u5B57", verb: "\u3067\u3042\u308B" },
|
|
@@ -8893,7 +8893,7 @@ function ja_default() {
|
|
|
8893
8893
|
};
|
|
8894
8894
|
}
|
|
8895
8895
|
|
|
8896
|
-
//
|
|
8896
|
+
// node_modules/zod/v4/locales/ka.js
|
|
8897
8897
|
var error29 = () => {
|
|
8898
8898
|
const Sizable = {
|
|
8899
8899
|
string: { unit: "\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD", verb: "\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1" },
|
|
@@ -9011,7 +9011,7 @@ function ka_default() {
|
|
|
9011
9011
|
};
|
|
9012
9012
|
}
|
|
9013
9013
|
|
|
9014
|
-
//
|
|
9014
|
+
// node_modules/zod/v4/locales/km.js
|
|
9015
9015
|
var error30 = () => {
|
|
9016
9016
|
const Sizable = {
|
|
9017
9017
|
string: { unit: "\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A", verb: "\u1782\u17BD\u179A\u1798\u17B6\u1793" },
|
|
@@ -9127,12 +9127,12 @@ function km_default() {
|
|
|
9127
9127
|
};
|
|
9128
9128
|
}
|
|
9129
9129
|
|
|
9130
|
-
//
|
|
9130
|
+
// node_modules/zod/v4/locales/kh.js
|
|
9131
9131
|
function kh_default() {
|
|
9132
9132
|
return km_default();
|
|
9133
9133
|
}
|
|
9134
9134
|
|
|
9135
|
-
//
|
|
9135
|
+
// node_modules/zod/v4/locales/kn.js
|
|
9136
9136
|
var error31 = () => {
|
|
9137
9137
|
const Sizable = {
|
|
9138
9138
|
string: { unit: "\u0C85\u0C95\u0CCD\u0CB7\u0CB0\u0C97\u0CB3\u0CC1", verb: "\u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1" },
|
|
@@ -9248,7 +9248,7 @@ function kn_default() {
|
|
|
9248
9248
|
};
|
|
9249
9249
|
}
|
|
9250
9250
|
|
|
9251
|
-
//
|
|
9251
|
+
// node_modules/zod/v4/locales/ko.js
|
|
9252
9252
|
var error32 = () => {
|
|
9253
9253
|
const Sizable = {
|
|
9254
9254
|
string: { unit: "\uBB38\uC790", verb: "to have" },
|
|
@@ -9365,7 +9365,7 @@ function ko_default() {
|
|
|
9365
9365
|
};
|
|
9366
9366
|
}
|
|
9367
9367
|
|
|
9368
|
-
//
|
|
9368
|
+
// node_modules/zod/v4/locales/lt.js
|
|
9369
9369
|
var capitalizeFirstCharacter = (text3) => {
|
|
9370
9370
|
return text3.charAt(0).toUpperCase() + text3.slice(1);
|
|
9371
9371
|
};
|
|
@@ -9573,7 +9573,7 @@ function lt_default() {
|
|
|
9573
9573
|
};
|
|
9574
9574
|
}
|
|
9575
9575
|
|
|
9576
|
-
//
|
|
9576
|
+
// node_modules/zod/v4/locales/mk.js
|
|
9577
9577
|
var error34 = () => {
|
|
9578
9578
|
const Sizable = {
|
|
9579
9579
|
string: { unit: "\u0437\u043D\u0430\u0446\u0438", verb: "\u0434\u0430 \u0438\u043C\u0430\u0430\u0442" },
|
|
@@ -9688,7 +9688,7 @@ function mk_default() {
|
|
|
9688
9688
|
};
|
|
9689
9689
|
}
|
|
9690
9690
|
|
|
9691
|
-
//
|
|
9691
|
+
// node_modules/zod/v4/locales/ms.js
|
|
9692
9692
|
var error35 = () => {
|
|
9693
9693
|
const Sizable = {
|
|
9694
9694
|
string: { unit: "aksara", verb: "mempunyai" },
|
|
@@ -9801,7 +9801,7 @@ function ms_default() {
|
|
|
9801
9801
|
};
|
|
9802
9802
|
}
|
|
9803
9803
|
|
|
9804
|
-
//
|
|
9804
|
+
// node_modules/zod/v4/locales/ne.js
|
|
9805
9805
|
var error36 = () => {
|
|
9806
9806
|
const Sizable = {
|
|
9807
9807
|
string: { unit: "\u0905\u0915\u094D\u0937\u0930", verb: "\u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B" },
|
|
@@ -9913,7 +9913,7 @@ function ne_default() {
|
|
|
9913
9913
|
};
|
|
9914
9914
|
}
|
|
9915
9915
|
|
|
9916
|
-
//
|
|
9916
|
+
// node_modules/zod/v4/locales/nl.js
|
|
9917
9917
|
var error37 = () => {
|
|
9918
9918
|
const Sizable = {
|
|
9919
9919
|
string: { unit: "tekens", verb: "heeft" },
|
|
@@ -10029,7 +10029,7 @@ function nl_default() {
|
|
|
10029
10029
|
};
|
|
10030
10030
|
}
|
|
10031
10031
|
|
|
10032
|
-
//
|
|
10032
|
+
// node_modules/zod/v4/locales/nn.js
|
|
10033
10033
|
var error38 = () => {
|
|
10034
10034
|
const Sizable = {
|
|
10035
10035
|
string: { unit: "teikn", verb: "\xE5 ha" },
|
|
@@ -10143,7 +10143,7 @@ function nn_default() {
|
|
|
10143
10143
|
};
|
|
10144
10144
|
}
|
|
10145
10145
|
|
|
10146
|
-
//
|
|
10146
|
+
// node_modules/zod/v4/locales/no.js
|
|
10147
10147
|
var error39 = () => {
|
|
10148
10148
|
const Sizable = {
|
|
10149
10149
|
string: { unit: "tegn", verb: "\xE5 ha" },
|
|
@@ -10257,7 +10257,7 @@ function no_default() {
|
|
|
10257
10257
|
};
|
|
10258
10258
|
}
|
|
10259
10259
|
|
|
10260
|
-
//
|
|
10260
|
+
// node_modules/zod/v4/locales/ota.js
|
|
10261
10261
|
var error40 = () => {
|
|
10262
10262
|
const Sizable = {
|
|
10263
10263
|
string: { unit: "harf", verb: "olmal\u0131d\u0131r" },
|
|
@@ -10372,7 +10372,7 @@ function ota_default() {
|
|
|
10372
10372
|
};
|
|
10373
10373
|
}
|
|
10374
10374
|
|
|
10375
|
-
//
|
|
10375
|
+
// node_modules/zod/v4/locales/ps.js
|
|
10376
10376
|
var error41 = () => {
|
|
10377
10377
|
const Sizable = {
|
|
10378
10378
|
string: { unit: "\u062A\u0648\u06A9\u064A", verb: "\u0648\u0644\u0631\u064A" },
|
|
@@ -10492,7 +10492,7 @@ function ps_default() {
|
|
|
10492
10492
|
};
|
|
10493
10493
|
}
|
|
10494
10494
|
|
|
10495
|
-
//
|
|
10495
|
+
// node_modules/zod/v4/locales/pl.js
|
|
10496
10496
|
var error42 = () => {
|
|
10497
10497
|
const Sizable = {
|
|
10498
10498
|
string: { unit: "znak\xF3w", verb: "mie\u0107" },
|
|
@@ -10607,7 +10607,7 @@ function pl_default() {
|
|
|
10607
10607
|
};
|
|
10608
10608
|
}
|
|
10609
10609
|
|
|
10610
|
-
//
|
|
10610
|
+
// node_modules/zod/v4/locales/pt.js
|
|
10611
10611
|
var error43 = () => {
|
|
10612
10612
|
const Sizable = {
|
|
10613
10613
|
string: { unit: "caracteres" },
|
|
@@ -10751,7 +10751,7 @@ function pt_default() {
|
|
|
10751
10751
|
};
|
|
10752
10752
|
}
|
|
10753
10753
|
|
|
10754
|
-
//
|
|
10754
|
+
// node_modules/zod/v4/locales/pt-BR.js
|
|
10755
10755
|
var error44 = () => {
|
|
10756
10756
|
const Sizable = {
|
|
10757
10757
|
string: { unit: "caracteres" },
|
|
@@ -10896,7 +10896,7 @@ function pt_BR_default() {
|
|
|
10896
10896
|
};
|
|
10897
10897
|
}
|
|
10898
10898
|
|
|
10899
|
-
//
|
|
10899
|
+
// node_modules/zod/v4/locales/ro.js
|
|
10900
10900
|
var error45 = () => {
|
|
10901
10901
|
const Sizable = {
|
|
10902
10902
|
string: { unit: "caractere", verb: "s\u0103 aib\u0103" },
|
|
@@ -11019,7 +11019,7 @@ function ro_default() {
|
|
|
11019
11019
|
};
|
|
11020
11020
|
}
|
|
11021
11021
|
|
|
11022
|
-
//
|
|
11022
|
+
// node_modules/zod/v4/locales/ru.js
|
|
11023
11023
|
function getRussianPlural(count2, one, few, many) {
|
|
11024
11024
|
const absCount = Math.abs(count2);
|
|
11025
11025
|
const lastDigit = absCount % 10;
|
|
@@ -11188,7 +11188,7 @@ function ru_default() {
|
|
|
11188
11188
|
};
|
|
11189
11189
|
}
|
|
11190
11190
|
|
|
11191
|
-
//
|
|
11191
|
+
// node_modules/zod/v4/locales/sk.js
|
|
11192
11192
|
var error47 = () => {
|
|
11193
11193
|
const Sizable = {
|
|
11194
11194
|
string: { unit: "znakov", verb: "ma\u0165" },
|
|
@@ -11305,7 +11305,7 @@ function sk_default() {
|
|
|
11305
11305
|
};
|
|
11306
11306
|
}
|
|
11307
11307
|
|
|
11308
|
-
//
|
|
11308
|
+
// node_modules/zod/v4/locales/sl.js
|
|
11309
11309
|
var error48 = () => {
|
|
11310
11310
|
const Sizable = {
|
|
11311
11311
|
string: { unit: "znakov", verb: "imeti" },
|
|
@@ -11420,7 +11420,7 @@ function sl_default() {
|
|
|
11420
11420
|
};
|
|
11421
11421
|
}
|
|
11422
11422
|
|
|
11423
|
-
//
|
|
11423
|
+
// node_modules/zod/v4/locales/sv.js
|
|
11424
11424
|
var error49 = () => {
|
|
11425
11425
|
const Sizable = {
|
|
11426
11426
|
string: { unit: "tecken", verb: "att ha" },
|
|
@@ -11536,7 +11536,7 @@ function sv_default() {
|
|
|
11536
11536
|
};
|
|
11537
11537
|
}
|
|
11538
11538
|
|
|
11539
|
-
//
|
|
11539
|
+
// node_modules/zod/v4/locales/ta.js
|
|
11540
11540
|
var error50 = () => {
|
|
11541
11541
|
const Sizable = {
|
|
11542
11542
|
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" },
|
|
@@ -11652,7 +11652,7 @@ function ta_default() {
|
|
|
11652
11652
|
};
|
|
11653
11653
|
}
|
|
11654
11654
|
|
|
11655
|
-
//
|
|
11655
|
+
// node_modules/zod/v4/locales/tg.js
|
|
11656
11656
|
var error51 = () => {
|
|
11657
11657
|
const Sizable = {
|
|
11658
11658
|
string: { unit: "\u0430\u043B\u043E\u043C\u0430\u0442", verb: "\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434" },
|
|
@@ -11769,7 +11769,7 @@ function tg_default() {
|
|
|
11769
11769
|
};
|
|
11770
11770
|
}
|
|
11771
11771
|
|
|
11772
|
-
//
|
|
11772
|
+
// node_modules/zod/v4/locales/th.js
|
|
11773
11773
|
var error52 = () => {
|
|
11774
11774
|
const Sizable = {
|
|
11775
11775
|
string: { unit: "\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23", verb: "\u0E04\u0E27\u0E23\u0E21\u0E35" },
|
|
@@ -11885,7 +11885,7 @@ function th_default() {
|
|
|
11885
11885
|
};
|
|
11886
11886
|
}
|
|
11887
11887
|
|
|
11888
|
-
//
|
|
11888
|
+
// node_modules/zod/v4/locales/tk.js
|
|
11889
11889
|
var error53 = () => {
|
|
11890
11890
|
const Sizable = {
|
|
11891
11891
|
string: { unit: "simwol", verb: "bolmaly" },
|
|
@@ -11993,7 +11993,7 @@ function tk_default() {
|
|
|
11993
11993
|
};
|
|
11994
11994
|
}
|
|
11995
11995
|
|
|
11996
|
-
//
|
|
11996
|
+
// node_modules/zod/v4/locales/tr.js
|
|
11997
11997
|
var error54 = () => {
|
|
11998
11998
|
const Sizable = {
|
|
11999
11999
|
string: { unit: "karakter", verb: "olmal\u0131" },
|
|
@@ -12104,7 +12104,7 @@ function tr_default() {
|
|
|
12104
12104
|
};
|
|
12105
12105
|
}
|
|
12106
12106
|
|
|
12107
|
-
//
|
|
12107
|
+
// node_modules/zod/v4/locales/uk.js
|
|
12108
12108
|
var error55 = () => {
|
|
12109
12109
|
const Sizable = {
|
|
12110
12110
|
string: { unit: "\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432", verb: "\u043C\u0430\u0442\u0438\u043C\u0435" },
|
|
@@ -12218,12 +12218,12 @@ function uk_default() {
|
|
|
12218
12218
|
};
|
|
12219
12219
|
}
|
|
12220
12220
|
|
|
12221
|
-
//
|
|
12221
|
+
// node_modules/zod/v4/locales/ua.js
|
|
12222
12222
|
function ua_default() {
|
|
12223
12223
|
return uk_default();
|
|
12224
12224
|
}
|
|
12225
12225
|
|
|
12226
|
-
//
|
|
12226
|
+
// node_modules/zod/v4/locales/ur.js
|
|
12227
12227
|
var error56 = () => {
|
|
12228
12228
|
const Sizable = {
|
|
12229
12229
|
string: { unit: "\u062D\u0631\u0648\u0641", verb: "\u06C1\u0648\u0646\u0627" },
|
|
@@ -12339,7 +12339,7 @@ function ur_default() {
|
|
|
12339
12339
|
};
|
|
12340
12340
|
}
|
|
12341
12341
|
|
|
12342
|
-
//
|
|
12342
|
+
// node_modules/zod/v4/locales/uz.js
|
|
12343
12343
|
var error57 = () => {
|
|
12344
12344
|
const Sizable = {
|
|
12345
12345
|
string: { unit: "belgi", verb: "bo\u2018lishi kerak" },
|
|
@@ -12453,7 +12453,7 @@ function uz_default() {
|
|
|
12453
12453
|
};
|
|
12454
12454
|
}
|
|
12455
12455
|
|
|
12456
|
-
//
|
|
12456
|
+
// node_modules/zod/v4/locales/vi.js
|
|
12457
12457
|
var error58 = () => {
|
|
12458
12458
|
const Sizable = {
|
|
12459
12459
|
string: { unit: "k\xFD t\u1EF1", verb: "c\xF3" },
|
|
@@ -12567,7 +12567,7 @@ function vi_default() {
|
|
|
12567
12567
|
};
|
|
12568
12568
|
}
|
|
12569
12569
|
|
|
12570
|
-
//
|
|
12570
|
+
// node_modules/zod/v4/locales/zh-CN.js
|
|
12571
12571
|
var error59 = () => {
|
|
12572
12572
|
const Sizable = {
|
|
12573
12573
|
string: { unit: "\u5B57\u7B26", verb: "\u5305\u542B" },
|
|
@@ -12682,7 +12682,7 @@ function zh_CN_default() {
|
|
|
12682
12682
|
};
|
|
12683
12683
|
}
|
|
12684
12684
|
|
|
12685
|
-
//
|
|
12685
|
+
// node_modules/zod/v4/locales/zh-TW.js
|
|
12686
12686
|
var error60 = () => {
|
|
12687
12687
|
const Sizable = {
|
|
12688
12688
|
string: { unit: "\u5B57\u5143", verb: "\u64C1\u6709" },
|
|
@@ -12795,7 +12795,7 @@ function zh_TW_default() {
|
|
|
12795
12795
|
};
|
|
12796
12796
|
}
|
|
12797
12797
|
|
|
12798
|
-
//
|
|
12798
|
+
// node_modules/zod/v4/locales/yo.js
|
|
12799
12799
|
var error61 = () => {
|
|
12800
12800
|
const Sizable = {
|
|
12801
12801
|
string: { unit: "\xE0mi", verb: "n\xED" },
|
|
@@ -12908,7 +12908,7 @@ function yo_default() {
|
|
|
12908
12908
|
};
|
|
12909
12909
|
}
|
|
12910
12910
|
|
|
12911
|
-
//
|
|
12911
|
+
// node_modules/zod/v4/core/registries.js
|
|
12912
12912
|
var _a2;
|
|
12913
12913
|
var $output = /* @__PURE__ */ Symbol("ZodOutput");
|
|
12914
12914
|
var $input = /* @__PURE__ */ Symbol("ZodInput");
|
|
@@ -12958,7 +12958,7 @@ function registry() {
|
|
|
12958
12958
|
(_a2 = globalThis).__zod_globalRegistry ?? (_a2.__zod_globalRegistry = registry());
|
|
12959
12959
|
var globalRegistry = globalThis.__zod_globalRegistry;
|
|
12960
12960
|
|
|
12961
|
-
//
|
|
12961
|
+
// node_modules/zod/v4/core/compile.js
|
|
12962
12962
|
var INVALID = /* @__PURE__ */ Symbol.for("zod.compile.invalid");
|
|
12963
12963
|
var FALLBACK_FLAG = /* @__PURE__ */ Symbol.for("zod.compile.fallback");
|
|
12964
12964
|
var ZodCompileAsyncError = class extends Error {
|
|
@@ -14568,7 +14568,7 @@ function generateTransformCheck(doc, ctx, schema, accessor) {
|
|
|
14568
14568
|
return accessor;
|
|
14569
14569
|
}
|
|
14570
14570
|
|
|
14571
|
-
//
|
|
14571
|
+
// node_modules/zod/v4/core/api.js
|
|
14572
14572
|
function snapshotChecks(def) {
|
|
14573
14573
|
if (def.checks)
|
|
14574
14574
|
def.checks = [...def.checks];
|
|
@@ -15627,7 +15627,7 @@ function _stringFormat(Class2, format, fnOrRegex, _params = {}) {
|
|
|
15627
15627
|
return inst;
|
|
15628
15628
|
}
|
|
15629
15629
|
|
|
15630
|
-
//
|
|
15630
|
+
// node_modules/zod/v4/core/to-json-schema.js
|
|
15631
15631
|
function assignProps(target, ...sources) {
|
|
15632
15632
|
for (const source of sources) {
|
|
15633
15633
|
for (const key of Reflect.ownKeys(source)) {
|
|
@@ -16157,7 +16157,7 @@ var createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) =
|
|
|
16157
16157
|
return finalize(ctx, schema);
|
|
16158
16158
|
};
|
|
16159
16159
|
|
|
16160
|
-
//
|
|
16160
|
+
// node_modules/zod/v4/core/json-schema-processors.js
|
|
16161
16161
|
var narrowMin = (agg, key, value) => {
|
|
16162
16162
|
if (agg[key] === void 0 || value > agg[key])
|
|
16163
16163
|
agg[key] = value;
|
|
@@ -16905,7 +16905,7 @@ function toJSONSchema(input2, params) {
|
|
|
16905
16905
|
return finalize(ctx, input2);
|
|
16906
16906
|
}
|
|
16907
16907
|
|
|
16908
|
-
//
|
|
16908
|
+
// node_modules/zod/v4/core/json-schema-generator.js
|
|
16909
16909
|
var JSONSchemaGenerator = class {
|
|
16910
16910
|
/** @deprecated Access via ctx instead */
|
|
16911
16911
|
get metadataRegistry() {
|
|
@@ -16983,10 +16983,10 @@ var JSONSchemaGenerator = class {
|
|
|
16983
16983
|
}
|
|
16984
16984
|
};
|
|
16985
16985
|
|
|
16986
|
-
//
|
|
16986
|
+
// node_modules/zod/v4/core/json-schema.js
|
|
16987
16987
|
var json_schema_exports = {};
|
|
16988
16988
|
|
|
16989
|
-
//
|
|
16989
|
+
// node_modules/zod/v4/classic/schemas.js
|
|
16990
16990
|
var schemas_exports2 = {};
|
|
16991
16991
|
__export(schemas_exports2, {
|
|
16992
16992
|
ZodAny: () => ZodAny,
|
|
@@ -17167,7 +17167,7 @@ __export(schemas_exports2, {
|
|
|
17167
17167
|
xor: () => xor
|
|
17168
17168
|
});
|
|
17169
17169
|
|
|
17170
|
-
//
|
|
17170
|
+
// node_modules/zod/v4/classic/checks.js
|
|
17171
17171
|
var checks_exports2 = {};
|
|
17172
17172
|
__export(checks_exports2, {
|
|
17173
17173
|
endsWith: () => _endsWith,
|
|
@@ -17202,7 +17202,7 @@ __export(checks_exports2, {
|
|
|
17202
17202
|
uppercase: () => _uppercase
|
|
17203
17203
|
});
|
|
17204
17204
|
|
|
17205
|
-
//
|
|
17205
|
+
// node_modules/zod/v4/classic/errors.js
|
|
17206
17206
|
var _installedErrorProtos = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);
|
|
17207
17207
|
function _lazyMethod(proto, key, make) {
|
|
17208
17208
|
Object.defineProperty(proto, key, {
|
|
@@ -17248,7 +17248,7 @@ var ZodRealError = /* @__PURE__ */ $constructor("ZodError", initializer2, void 0
|
|
|
17248
17248
|
Parent: Error
|
|
17249
17249
|
});
|
|
17250
17250
|
|
|
17251
|
-
//
|
|
17251
|
+
// node_modules/zod/v4/classic/parse.js
|
|
17252
17252
|
var parse2 = /* @__PURE__ */ _parse(ZodRealError);
|
|
17253
17253
|
var parseAsync2 = /* @__PURE__ */ _parseAsync(ZodRealError);
|
|
17254
17254
|
var safeParse2 = /* @__PURE__ */ _safeParse(ZodRealError);
|
|
@@ -17262,7 +17262,7 @@ var safeDecode2 = /* @__PURE__ */ _safeDecode(ZodRealError);
|
|
|
17262
17262
|
var safeEncodeAsync2 = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
|
|
17263
17263
|
var safeDecodeAsync2 = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
|
|
17264
17264
|
|
|
17265
|
-
//
|
|
17265
|
+
// node_modules/zod/v4/classic/schemas.js
|
|
17266
17266
|
function _ensureDefaultLocale() {
|
|
17267
17267
|
if (!globalConfig.localeError)
|
|
17268
17268
|
config(en_default());
|
|
@@ -18727,7 +18727,7 @@ function preprocess(fn, schema) {
|
|
|
18727
18727
|
});
|
|
18728
18728
|
}
|
|
18729
18729
|
|
|
18730
|
-
//
|
|
18730
|
+
// node_modules/zod/v4/classic/compat.js
|
|
18731
18731
|
var ZodIssueCode = {
|
|
18732
18732
|
invalid_type: "invalid_type",
|
|
18733
18733
|
too_big: "too_big",
|
|
@@ -18753,7 +18753,7 @@ var ZodFirstPartyTypeKind;
|
|
|
18753
18753
|
/* @__PURE__ */ (function(ZodFirstPartyTypeKind2) {
|
|
18754
18754
|
})(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));
|
|
18755
18755
|
|
|
18756
|
-
//
|
|
18756
|
+
// node_modules/zod/v4/classic/iso.js
|
|
18757
18757
|
var iso_exports = {};
|
|
18758
18758
|
__export(iso_exports, {
|
|
18759
18759
|
ZodISODate: () => ZodISODate,
|
|
@@ -18778,7 +18778,7 @@ function duration2(params) {
|
|
|
18778
18778
|
return _isoDuration(ZodISODuration, params);
|
|
18779
18779
|
}
|
|
18780
18780
|
|
|
18781
|
-
//
|
|
18781
|
+
// node_modules/zod/v4/classic/from-json-schema.js
|
|
18782
18782
|
var z = {
|
|
18783
18783
|
...schemas_exports2,
|
|
18784
18784
|
...checks_exports2,
|
|
@@ -19511,7 +19511,7 @@ function fromJSONSchema(schema, params) {
|
|
|
19511
19511
|
return convertSchema(normalized, ctx);
|
|
19512
19512
|
}
|
|
19513
19513
|
|
|
19514
|
-
//
|
|
19514
|
+
// node_modules/zod/v4/core/visit.js
|
|
19515
19515
|
var RESOLVING = /* @__PURE__ */ Symbol("z.visit/resolving");
|
|
19516
19516
|
function visit(schema, fnOrHandlers) {
|
|
19517
19517
|
const fn = typeof fnOrHandlers === "function" ? fnOrHandlers : (node2, rewritten) => {
|
|
@@ -19666,7 +19666,7 @@ function visit(schema, fnOrHandlers) {
|
|
|
19666
19666
|
return run(schema);
|
|
19667
19667
|
}
|
|
19668
19668
|
|
|
19669
|
-
//
|
|
19669
|
+
// node_modules/zod/v4/classic/deep-partial.js
|
|
19670
19670
|
function deepPartial(schema) {
|
|
19671
19671
|
return visit(schema, {
|
|
19672
19672
|
object: (s) => s.partial(),
|
|
@@ -19678,7 +19678,7 @@ function deepPartial(schema) {
|
|
|
19678
19678
|
});
|
|
19679
19679
|
}
|
|
19680
19680
|
|
|
19681
|
-
//
|
|
19681
|
+
// node_modules/zod/v4/classic/in-out.js
|
|
19682
19682
|
function withChecks(side, checks) {
|
|
19683
19683
|
if (!checks?.length)
|
|
19684
19684
|
return side;
|
|
@@ -19708,7 +19708,7 @@ function output(schema) {
|
|
|
19708
19708
|
});
|
|
19709
19709
|
}
|
|
19710
19710
|
|
|
19711
|
-
//
|
|
19711
|
+
// node_modules/zod/v4/classic/coerce.js
|
|
19712
19712
|
var coerce_exports = {};
|
|
19713
19713
|
__export(coerce_exports, {
|
|
19714
19714
|
bigint: () => bigint3,
|
|
@@ -20505,7 +20505,14 @@ function createPosixPlatform(id) {
|
|
|
20505
20505
|
// Why: pnpm uses platform-specific global bin directories that differ
|
|
20506
20506
|
// from npm's ~/.local/bin.
|
|
20507
20507
|
id === "darwin" ? join4(home, "Library", "pnpm") : join4(home, ".local", "share", "pnpm"),
|
|
20508
|
-
join4(home, ".yarn", "bin")
|
|
20508
|
+
join4(home, ".yarn", "bin"),
|
|
20509
|
+
// ChatGPT ships the Codex CLI inside the app bundle. GUI-launched
|
|
20510
|
+
// services do not inherit the app's private PATH entry, so include the
|
|
20511
|
+
// stable bundle bin location when resolving installed CLIs on macOS.
|
|
20512
|
+
...id === "darwin" ? [
|
|
20513
|
+
"/Applications/ChatGPT.app/Contents/Resources/codex-cli/bin",
|
|
20514
|
+
join4(home, "Applications", "ChatGPT.app", "Contents", "Resources", "codex-cli", "bin")
|
|
20515
|
+
] : []
|
|
20509
20516
|
],
|
|
20510
20517
|
fallbackBinDirectories: (home) => ["/opt/homebrew/bin", "/usr/local/bin", join4(home, ".local", "bin")],
|
|
20511
20518
|
normalizeEnvironment: (env) => ({ ...env }),
|
|
@@ -20944,7 +20951,7 @@ function textRows(prefix, text3, maxRows = 40) {
|
|
|
20944
20951
|
|
|
20945
20952
|
// src/acp/acp-launch-specs.ts
|
|
20946
20953
|
import { realpathSync as realpathSync2 } from "node:fs";
|
|
20947
|
-
import { join as
|
|
20954
|
+
import { join as join12 } from "node:path";
|
|
20948
20955
|
|
|
20949
20956
|
// src/providers/cli/codex-catalog.ts
|
|
20950
20957
|
import { spawn as spawn3 } from "node:child_process";
|
|
@@ -21089,38 +21096,41 @@ function codexCatalogArgs() {
|
|
|
21089
21096
|
// src/providers/model-catalog.ts
|
|
21090
21097
|
import { spawn as spawn5 } from "node:child_process";
|
|
21091
21098
|
import { readFile as readFile4 } from "node:fs/promises";
|
|
21092
|
-
import { homedir as
|
|
21093
|
-
import { isAbsolute as isAbsolute2, join as
|
|
21099
|
+
import { homedir as homedir6 } from "node:os";
|
|
21100
|
+
import { isAbsolute as isAbsolute2, join as join9, resolve as resolve3 } from "node:path";
|
|
21094
21101
|
|
|
21095
21102
|
// src/providers/kiro-auth.ts
|
|
21096
21103
|
import { execFile as execFile3 } from "node:child_process";
|
|
21097
|
-
import {
|
|
21104
|
+
import { homedir as homedir5 } from "node:os";
|
|
21105
|
+
import { join as join8 } from "node:path";
|
|
21098
21106
|
import { promisify } from "node:util";
|
|
21099
21107
|
var execFileAsync = promisify(execFile3);
|
|
21100
|
-
|
|
21101
|
-
|
|
21102
|
-
|
|
21103
|
-
|
|
21104
|
-
|
|
21105
|
-
|
|
21108
|
+
var NOT_AUTHENTICATED = "Kiro CLI \u672A\u767B\u5F55\u6216\u65E0\u6CD5\u786E\u8BA4\u767B\u5F55\u72B6\u6001\uFF0C\u8BF7\u5728\u672C\u673A\u767B\u5F55\u540E\u91CD\u8BD5";
|
|
21109
|
+
var knownUnauthenticated = false;
|
|
21110
|
+
async function hasStoredAuthentication(environment) {
|
|
21111
|
+
if (environment.KIRO_API_KEY?.trim()) return true;
|
|
21112
|
+
const database = process.platform === "darwin" ? join8(homedir5(), "Library", "Application Support", "kiro-cli", "data.sqlite3") : process.platform === "win32" ? join8(environment.LOCALAPPDATA || join8(homedir5(), "AppData", "Local"), "Kiro-Cli", "data.sqlite3") : join8(environment.XDG_DATA_HOME || join8(homedir5(), ".local", "share"), "kiro-cli", "data.sqlite3");
|
|
21113
|
+
const sql = "SELECT 1 FROM auth_kv WHERE key IN ('kirocli:odic:token', 'codewhisperer:odic:token', 'kirocli:external-idp:token', 'kirocli:social:token') AND (json_extract(value, '$.expires_at') IS NULL OR julianday(json_extract(value, '$.expires_at')) > julianday('now')) LIMIT 1;";
|
|
21106
21114
|
try {
|
|
21107
|
-
const { stdout } = await execFileAsync(
|
|
21108
|
-
env:
|
|
21109
|
-
|
|
21110
|
-
|
|
21111
|
-
maxBuffer: 64 * 1024,
|
|
21115
|
+
const { stdout } = await execFileAsync("sqlite3", ["-readonly", database, sql], {
|
|
21116
|
+
env: environment,
|
|
21117
|
+
timeout: 3e3,
|
|
21118
|
+
maxBuffer: 1024,
|
|
21112
21119
|
windowsHide: true
|
|
21113
21120
|
});
|
|
21114
|
-
|
|
21115
|
-
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
21116
|
-
const result = value;
|
|
21117
|
-
const account = result.account && typeof result.account === "object" && !Array.isArray(result.account) ? result.account : result;
|
|
21118
|
-
const accountType = account.accountType ?? result.accountType;
|
|
21119
|
-
if (typeof accountType === "string" && accountType.trim() && !/^(?:none|unknown|anonymous|unauthenticated|not[\s_-]*logged[\s_-]*in)$/i.test(accountType.trim())) return;
|
|
21120
|
-
}
|
|
21121
|
+
return stdout.trim() === "1";
|
|
21121
21122
|
} catch {
|
|
21123
|
+
return false;
|
|
21122
21124
|
}
|
|
21123
|
-
|
|
21125
|
+
}
|
|
21126
|
+
async function requireKiroAuthentication(environment, options = {}) {
|
|
21127
|
+
if (knownUnauthenticated && !options.force) throw new Error(NOT_AUTHENTICATED);
|
|
21128
|
+
if (await hasStoredAuthentication(environment ?? process.env)) {
|
|
21129
|
+
knownUnauthenticated = false;
|
|
21130
|
+
return;
|
|
21131
|
+
}
|
|
21132
|
+
knownUnauthenticated = true;
|
|
21133
|
+
throw new Error(NOT_AUTHENTICATED);
|
|
21124
21134
|
}
|
|
21125
21135
|
|
|
21126
21136
|
// src/providers/kiro-models.ts
|
|
@@ -21243,15 +21253,15 @@ function parseClaudeModelCatalog(settings, environment = process.env, fetchedAt
|
|
|
21243
21253
|
if (defaultModel) catalog.default_model = defaultModel;
|
|
21244
21254
|
return catalog;
|
|
21245
21255
|
}
|
|
21246
|
-
var claudeHome = () => process.env.CLAUDE_CONFIG_DIR?.trim() ||
|
|
21247
|
-
var codexHome2 = () => process.env.CODEX_HOME?.trim() ||
|
|
21248
|
-
var geminiHome = () => process.env.GEMINI_CLI_HOME?.trim() ||
|
|
21249
|
-
var grokHome = () => process.env.GROK_HOME?.trim() ||
|
|
21250
|
-
var opencodeHome = () =>
|
|
21251
|
-
var kiroHome = () =>
|
|
21256
|
+
var claudeHome = () => process.env.CLAUDE_CONFIG_DIR?.trim() || join9(homedir6(), ".claude");
|
|
21257
|
+
var codexHome2 = () => process.env.CODEX_HOME?.trim() || join9(homedir6(), ".codex");
|
|
21258
|
+
var geminiHome = () => process.env.GEMINI_CLI_HOME?.trim() || join9(homedir6(), ".gemini");
|
|
21259
|
+
var grokHome = () => process.env.GROK_HOME?.trim() || join9(homedir6(), ".grok");
|
|
21260
|
+
var opencodeHome = () => join9(process.env.XDG_CONFIG_HOME?.trim() || join9(homedir6(), ".config"), "opencode");
|
|
21261
|
+
var kiroHome = () => join9(homedir6(), ".kiro");
|
|
21252
21262
|
async function readClaudeModelCatalog() {
|
|
21253
21263
|
const home = claudeHome();
|
|
21254
|
-
const content = await readFile4(
|
|
21264
|
+
const content = await readFile4(join9(home, "settings.json"), "utf8").catch(() => "");
|
|
21255
21265
|
let settings = {};
|
|
21256
21266
|
if (content) {
|
|
21257
21267
|
try {
|
|
@@ -21313,13 +21323,13 @@ async function readCodexModels(codexHome3, config2) {
|
|
|
21313
21323
|
const configuredModels = parseCodexModels(await readFile4(catalogPath, "utf8").catch(() => ""));
|
|
21314
21324
|
if (configuredModels?.length) return configuredModels;
|
|
21315
21325
|
}
|
|
21316
|
-
const cached3 = parseCodexModels(await readFile4(
|
|
21326
|
+
const cached3 = parseCodexModels(await readFile4(join9(codexHome3, "models_cache.json"), "utf8").catch(() => ""));
|
|
21317
21327
|
if (cached3?.length) return cached3;
|
|
21318
21328
|
return codexModelsFrom(await codexBundledCatalog().catch(() => void 0), { listedOnly: true }) ?? [];
|
|
21319
21329
|
}
|
|
21320
21330
|
async function readCodexModelCatalog() {
|
|
21321
21331
|
const home = codexHome2();
|
|
21322
|
-
const config2 = await readFile4(
|
|
21332
|
+
const config2 = await readFile4(join9(home, "config.toml"), "utf8").catch(() => "");
|
|
21323
21333
|
const models2 = await readCodexModels(home, config2);
|
|
21324
21334
|
const defaultModel = configValue(config2, "model");
|
|
21325
21335
|
const defaultReasoningEffort = configValue(config2, "model_reasoning_effort");
|
|
@@ -21412,7 +21422,7 @@ function withKnownEfforts(base, known) {
|
|
|
21412
21422
|
async function readKiroModelCatalog(options = {}) {
|
|
21413
21423
|
const environment = mergeShellProxyEnvironment(await hydrateShellPath(), providerEnvironment());
|
|
21414
21424
|
const kiro = requireCliSpec("kiro");
|
|
21415
|
-
await requireKiroAuthentication(environment);
|
|
21425
|
+
await requireKiroAuthentication(environment, { force: options.force === true });
|
|
21416
21426
|
const listLaunch = launchCli({ spec: kiro, args: ["chat", "--list-models", "--format", "json"], env: environment });
|
|
21417
21427
|
const output2 = await runModelListCommand(listLaunch.executable, listLaunch.args, "kiro-cli", environment);
|
|
21418
21428
|
let listed;
|
|
@@ -21433,7 +21443,7 @@ async function readKiroModelCatalog(options = {}) {
|
|
|
21433
21443
|
if (current) return known.catalog;
|
|
21434
21444
|
try {
|
|
21435
21445
|
const launch = launchCli({ spec: kiro, args: ["acp", "--trust-tools="], env: environment });
|
|
21436
|
-
const catalog = await readKiroNativeModels(launch,
|
|
21446
|
+
const catalog = await readKiroNativeModels(launch, homedir6(), { catalog: base });
|
|
21437
21447
|
kiroEfforts = { signature, readAt: Date.now(), catalog };
|
|
21438
21448
|
return catalog;
|
|
21439
21449
|
} catch {
|
|
@@ -21442,7 +21452,7 @@ async function readKiroModelCatalog(options = {}) {
|
|
|
21442
21452
|
};
|
|
21443
21453
|
const [payload, content] = await Promise.all([
|
|
21444
21454
|
readEfforts(),
|
|
21445
|
-
readFile4(
|
|
21455
|
+
readFile4(join9(kiroHome(), "settings", "cli.json"), "utf8").catch(() => "{}")
|
|
21446
21456
|
]);
|
|
21447
21457
|
let settings;
|
|
21448
21458
|
try {
|
|
@@ -21499,7 +21509,7 @@ function geminiModelsUrl(baseUrl) {
|
|
|
21499
21509
|
}
|
|
21500
21510
|
async function readGeminiModelCatalog() {
|
|
21501
21511
|
const fileEnvironment = parseEnvFile(
|
|
21502
|
-
await readFile4(
|
|
21512
|
+
await readFile4(join9(geminiHome(), ".env"), "utf8").catch(() => "")
|
|
21503
21513
|
);
|
|
21504
21514
|
const environment = { ...fileEnvironment, ...process.env };
|
|
21505
21515
|
const baseUrl = environment.GOOGLE_GEMINI_BASE_URL?.trim();
|
|
@@ -21544,7 +21554,7 @@ function parseGrokModelCatalog(output2, config2 = "", fetchedAt = (/* @__PURE__
|
|
|
21544
21554
|
return catalog;
|
|
21545
21555
|
}
|
|
21546
21556
|
async function readGrokModelCatalog() {
|
|
21547
|
-
const config2 = await readFile4(
|
|
21557
|
+
const config2 = await readFile4(join9(grokHome(), "config.toml"), "utf8").catch(() => "");
|
|
21548
21558
|
const output2 = await runModelListCommand(cliExecutable("grok"), ["models"], "grok");
|
|
21549
21559
|
const catalog = parseGrokModelCatalog(output2, config2);
|
|
21550
21560
|
if (catalog.models.length === 0) throw new Error("Grok \u672C\u673A\u672A\u8FD4\u56DE\u53EF\u7528\u6A21\u578B");
|
|
@@ -21563,31 +21573,30 @@ function parseOpencodeModelCatalog(output2, config2 = "", fetchedAt = (/* @__PUR
|
|
|
21563
21573
|
return catalog;
|
|
21564
21574
|
}
|
|
21565
21575
|
async function readOpencodeModelCatalog() {
|
|
21566
|
-
const config2 = await readFile4(
|
|
21576
|
+
const config2 = await readFile4(join9(opencodeHome(), "opencode.json"), "utf8").catch(() => "") || await readFile4(join9(opencodeHome(), "opencode.jsonc"), "utf8").catch(() => "");
|
|
21567
21577
|
const output2 = await runModelListCommand(cliExecutable("opencode"), ["models"], "opencode");
|
|
21568
21578
|
const catalog = parseOpencodeModelCatalog(output2, config2);
|
|
21569
21579
|
if (catalog.models.length === 0) throw new Error("OpenCode \u672C\u673A\u672A\u8FD4\u56DE\u53EF\u7528\u6A21\u578B");
|
|
21570
21580
|
return catalog;
|
|
21571
21581
|
}
|
|
21572
21582
|
var TEN_MINUTES = 10 * 60 * 1e3;
|
|
21573
|
-
var TWO_MINUTES = 2 * 60 * 1e3;
|
|
21574
21583
|
var MODEL_SOURCES = {
|
|
21575
|
-
claude: { read: readClaudeModelCatalog, watchFiles: () => [
|
|
21584
|
+
claude: { read: readClaudeModelCatalog, watchFiles: () => [join9(claudeHome(), "settings.json")] },
|
|
21576
21585
|
codex: {
|
|
21577
21586
|
read: readCodexModelCatalog,
|
|
21578
21587
|
watchFiles: () => {
|
|
21579
21588
|
const home = codexHome2();
|
|
21580
|
-
return [
|
|
21589
|
+
return [join9(home, "config.toml"), join9(home, "models_cache.json")];
|
|
21581
21590
|
},
|
|
21582
21591
|
// model_catalog_json may point anywhere; a periodic re-read covers it.
|
|
21583
21592
|
refreshEveryMs: TEN_MINUTES
|
|
21584
21593
|
},
|
|
21585
|
-
gemini: { read: readGeminiModelCatalog, watchFiles: () => [
|
|
21586
|
-
grok: { read: readGrokModelCatalog, watchFiles: () => [
|
|
21587
|
-
kiro: { read: readKiroModelCatalog, watchFiles: () => [
|
|
21594
|
+
gemini: { read: readGeminiModelCatalog, watchFiles: () => [join9(geminiHome(), ".env")], refreshEveryMs: TEN_MINUTES },
|
|
21595
|
+
grok: { read: readGrokModelCatalog, watchFiles: () => [join9(grokHome(), "config.toml")], refreshEveryMs: TEN_MINUTES },
|
|
21596
|
+
kiro: { read: readKiroModelCatalog, watchFiles: () => [join9(kiroHome(), "settings", "cli.json")] },
|
|
21588
21597
|
opencode: {
|
|
21589
21598
|
read: readOpencodeModelCatalog,
|
|
21590
|
-
watchFiles: () => [
|
|
21599
|
+
watchFiles: () => [join9(opencodeHome(), "opencode.json"), join9(opencodeHome(), "opencode.jsonc")],
|
|
21591
21600
|
refreshEveryMs: TEN_MINUTES
|
|
21592
21601
|
}
|
|
21593
21602
|
};
|
|
@@ -21701,11 +21710,11 @@ function classifySpawnError(error62, context) {
|
|
|
21701
21710
|
|
|
21702
21711
|
// src/providers/cli/kiro-session-log.ts
|
|
21703
21712
|
import { open as open2, readdir, readFile as readFile5, stat as stat2 } from "node:fs/promises";
|
|
21704
|
-
import { homedir as
|
|
21705
|
-
import { join as
|
|
21713
|
+
import { homedir as homedir7 } from "node:os";
|
|
21714
|
+
import { join as join10 } from "node:path";
|
|
21706
21715
|
var SHELL_TOOLS = /* @__PURE__ */ new Set(["shell", "execute_bash", "bash"]);
|
|
21707
21716
|
function kiroSessionsDirectory() {
|
|
21708
|
-
return process.env.TOC_OCRA_KIRO_SESSIONS_DIR ||
|
|
21717
|
+
return process.env.TOC_OCRA_KIRO_SESSIONS_DIR || join10(homedir7(), ".kiro", "sessions", "cli");
|
|
21709
21718
|
}
|
|
21710
21719
|
var KiroSessionLog = class {
|
|
21711
21720
|
constructor(options) {
|
|
@@ -21724,7 +21733,7 @@ var KiroSessionLog = class {
|
|
|
21724
21733
|
/** Called before the CLI starts: a resumed log is followed from its current end. */
|
|
21725
21734
|
async begin() {
|
|
21726
21735
|
if (!this.options.sessionId) return;
|
|
21727
|
-
this.path =
|
|
21736
|
+
this.path = join10(this.directory, `${this.options.sessionId}.jsonl`);
|
|
21728
21737
|
this.offset = await stat2(this.path).then((info) => info.size, () => 0);
|
|
21729
21738
|
}
|
|
21730
21739
|
/**
|
|
@@ -21737,11 +21746,11 @@ var KiroSessionLog = class {
|
|
|
21737
21746
|
const found = [];
|
|
21738
21747
|
for (const name of names) {
|
|
21739
21748
|
if (!name.endsWith(".json")) continue;
|
|
21740
|
-
const meta3 = await readFile5(
|
|
21749
|
+
const meta3 = await readFile5(join10(this.directory, name), "utf8").then((text3) => JSON.parse(text3), () => void 0);
|
|
21741
21750
|
const created = meta3?.created_at ? Date.parse(meta3.created_at) : NaN;
|
|
21742
21751
|
if (meta3?.cwd && sameFolder(meta3.cwd, this.options.workdir) && created >= this.options.startedAt - 2e3) found.push(name.slice(0, -5));
|
|
21743
21752
|
}
|
|
21744
|
-
if (found.length === 1) this.path =
|
|
21753
|
+
if (found.length === 1) this.path = join10(this.directory, `${found[0]}.jsonl`);
|
|
21745
21754
|
}
|
|
21746
21755
|
/** Reads entries appended since the last call. */
|
|
21747
21756
|
async refresh() {
|
|
@@ -22112,7 +22121,7 @@ import { spawn as spawn6 } from "node:child_process";
|
|
|
22112
22121
|
import { createHash } from "node:crypto";
|
|
22113
22122
|
import { existsSync as existsSync5, readFileSync as readFileSync5 } from "node:fs";
|
|
22114
22123
|
import { copyFile, mkdir as mkdir4, rename as rename4, rm as rm2, writeFile as writeFile4 } from "node:fs/promises";
|
|
22115
|
-
import { dirname as dirname6, join as
|
|
22124
|
+
import { dirname as dirname6, join as join11, resolve as resolve4 } from "node:path";
|
|
22116
22125
|
import { fileURLToPath } from "node:url";
|
|
22117
22126
|
var AcpRuntimeUnavailable = class extends Error {
|
|
22118
22127
|
constructor(message) {
|
|
@@ -22145,21 +22154,21 @@ function agentPackageVersion() {
|
|
|
22145
22154
|
const directory = agentRoot();
|
|
22146
22155
|
if (!directory) return "0";
|
|
22147
22156
|
try {
|
|
22148
|
-
return JSON.parse(readFileSync5(
|
|
22157
|
+
return JSON.parse(readFileSync5(join11(directory, "package.json"), "utf8")).version ?? "0";
|
|
22149
22158
|
} catch {
|
|
22150
22159
|
return "0";
|
|
22151
22160
|
}
|
|
22152
22161
|
}
|
|
22153
22162
|
function vendoredAdapter(name) {
|
|
22154
22163
|
const directory = agentRoot();
|
|
22155
|
-
const entry = directory ?
|
|
22164
|
+
const entry = directory ? join11(directory, "assets", "acp", name, "index.mjs") : void 0;
|
|
22156
22165
|
return entry && existsSync5(entry) ? entry : void 0;
|
|
22157
22166
|
}
|
|
22158
22167
|
var installs = /* @__PURE__ */ new Map();
|
|
22159
22168
|
function ensureClaudeRuntime(dataDir2) {
|
|
22160
22169
|
const entry = vendoredAdapter("claude");
|
|
22161
22170
|
if (!entry) return Promise.reject(new AcpRuntimeUnavailable("\u8FD9\u4E2A\u7248\u672C\u7684\u8BBE\u5907\u4EE3\u7406\u6CA1\u6709\u9644\u5E26 Claude ACP \u9002\u914D\u5668"));
|
|
22162
|
-
const manifestPath =
|
|
22171
|
+
const manifestPath = join11(dirname6(entry), "runtime.json");
|
|
22163
22172
|
let manifest;
|
|
22164
22173
|
try {
|
|
22165
22174
|
manifest = JSON.parse(readFileSync5(manifestPath, "utf8"));
|
|
@@ -22167,7 +22176,7 @@ function ensureClaudeRuntime(dataDir2) {
|
|
|
22167
22176
|
return Promise.reject(new AcpRuntimeUnavailable("Claude ACP \u9002\u914D\u5668\u7F3A\u5C11 runtime.json"));
|
|
22168
22177
|
}
|
|
22169
22178
|
const hash2 = createHash("sha256").update(readFileSync5(entry)).digest("hex").slice(0, 12);
|
|
22170
|
-
const directory =
|
|
22179
|
+
const directory = join11(dataDir2, "acp-runtimes", `claude-${manifest.adapterVersion}-sdk-${manifest.sdk.version}-${hash2}`);
|
|
22171
22180
|
const existing = installs.get(directory);
|
|
22172
22181
|
if (existing) return existing;
|
|
22173
22182
|
const install = installClaudeRuntime(directory, entry, manifest).catch((error62) => {
|
|
@@ -22178,19 +22187,19 @@ function ensureClaudeRuntime(dataDir2) {
|
|
|
22178
22187
|
return install;
|
|
22179
22188
|
}
|
|
22180
22189
|
async function installClaudeRuntime(directory, entry, manifest) {
|
|
22181
|
-
const sdkPackage =
|
|
22182
|
-
if (existsSync5(sdkPackage) && existsSync5(
|
|
22190
|
+
const sdkPackage = join11(directory, "node_modules", ...manifest.sdk.name.split("/"), "package.json");
|
|
22191
|
+
if (existsSync5(sdkPackage) && existsSync5(join11(directory, "index.mjs"))) return directory;
|
|
22183
22192
|
const temporary = `${directory}.tmp-${process.pid}-${Date.now()}`;
|
|
22184
22193
|
await mkdir4(temporary, { recursive: true, mode: 448 });
|
|
22185
22194
|
try {
|
|
22186
|
-
await writeFile4(
|
|
22195
|
+
await writeFile4(join11(temporary, "package.json"), JSON.stringify({
|
|
22187
22196
|
name: "toc-ocra-claude-acp-runtime",
|
|
22188
22197
|
private: true,
|
|
22189
22198
|
type: "module",
|
|
22190
22199
|
dependencies: { [manifest.sdk.name]: manifest.sdk.version }
|
|
22191
22200
|
}, null, 2));
|
|
22192
22201
|
await runNpm(["install", "--omit=optional", "--no-audit", "--no-fund", "--no-package-lock", "--loglevel=error"], temporary);
|
|
22193
|
-
await copyFile(entry,
|
|
22202
|
+
await copyFile(entry, join11(temporary, "index.mjs"));
|
|
22194
22203
|
await rm2(directory, { recursive: true, force: true });
|
|
22195
22204
|
await rename4(temporary, directory);
|
|
22196
22205
|
} catch (error62) {
|
|
@@ -22305,7 +22314,7 @@ var CLAUDE_LAUNCH_SPEC = {
|
|
|
22305
22314
|
const executable = installedCli(claude);
|
|
22306
22315
|
const runtime = await ensureClaudeRuntime(dataDir2);
|
|
22307
22316
|
return {
|
|
22308
|
-
launch: { executable: process.execPath, args: [
|
|
22317
|
+
launch: { executable: process.execPath, args: [join12(runtime, "index.mjs")], env: { ...providerEnvironment(), CLAUDE_CODE_EXECUTABLE: executable }, cwd: workdir },
|
|
22309
22318
|
fingerprint: `claude:${runtime}:${executable}`
|
|
22310
22319
|
};
|
|
22311
22320
|
},
|
|
@@ -22420,8 +22429,8 @@ var ACP_CHAT_IDS = [...ACP_CHAT.keys()];
|
|
|
22420
22429
|
|
|
22421
22430
|
// src/acp/acp-model-catalog-probe.ts
|
|
22422
22431
|
import { mkdtemp, rm as rm3 } from "node:fs/promises";
|
|
22423
|
-
import { tmpdir
|
|
22424
|
-
import { join as
|
|
22432
|
+
import { tmpdir } from "node:os";
|
|
22433
|
+
import { join as join13 } from "node:path";
|
|
22425
22434
|
|
|
22426
22435
|
// src/acp/acp-options.ts
|
|
22427
22436
|
var text = (value) => typeof value === "string" && value ? value : void 0;
|
|
@@ -23004,9 +23013,9 @@ async function readSessionModels(row, clientVersion = "1") {
|
|
|
23004
23013
|
const discovery = row.modelDiscovery;
|
|
23005
23014
|
if (discovery.kind !== "session") throw new Error(`${row.agent} does not list its models in a session`);
|
|
23006
23015
|
const cli = requireCliSpec(row.agent);
|
|
23007
|
-
const folder = await mkdtemp(
|
|
23016
|
+
const folder = await mkdtemp(join13(tmpdir(), `toc-ocra-acp-models-${row.agent}-`));
|
|
23008
23017
|
try {
|
|
23009
|
-
const folderArgs = discovery.sessionFolderArgs?.(
|
|
23018
|
+
const folderArgs = discovery.sessionFolderArgs?.(join13(folder, "sessions")) ?? [];
|
|
23010
23019
|
const args = [...row.args({ access: "read-only", model: "", reasoningEffort: "" }), ...folderArgs];
|
|
23011
23020
|
const launch = launchCli({ spec: cli, args, env: { ...providerEnvironment(), ...row.env } });
|
|
23012
23021
|
const connection = await AcpConnection.open({ executable: launch.executable, args: launch.args, env: launch.env, cwd: folder }, {
|
|
@@ -23636,13 +23645,13 @@ function isWriterConflict(message) {
|
|
|
23636
23645
|
|
|
23637
23646
|
// src/providers/cli/claude.ts
|
|
23638
23647
|
import { readdirSync as readdirSync2, readFileSync as readFileSync6 } from "node:fs";
|
|
23639
|
-
import { homedir as
|
|
23640
|
-
import { join as
|
|
23648
|
+
import { homedir as homedir8 } from "node:os";
|
|
23649
|
+
import { join as join14 } from "node:path";
|
|
23641
23650
|
var CLAUDE = requireCliSpec("claude");
|
|
23642
23651
|
function claudeProjectRoots() {
|
|
23643
23652
|
const configured = process.env.CLAUDE_CONFIG_DIR;
|
|
23644
|
-
const dirs = configured ? configured.split(process.platform === "win32" ? ";" : ":").map((entry) => entry.trim()).filter(Boolean) : [
|
|
23645
|
-
return dirs.map((dir) =>
|
|
23653
|
+
const dirs = configured ? configured.split(process.platform === "win32" ? ";" : ":").map((entry) => entry.trim()).filter(Boolean) : [join14(homedir8(), ".claude")];
|
|
23654
|
+
return dirs.map((dir) => join14(dir, "projects"));
|
|
23646
23655
|
}
|
|
23647
23656
|
function claudeTranscriptExists(sessionId) {
|
|
23648
23657
|
return claudeTranscriptPath(sessionId) !== void 0;
|
|
@@ -23658,7 +23667,7 @@ function claudeTranscriptPath(sessionId) {
|
|
|
23658
23667
|
}
|
|
23659
23668
|
for (const project of projects) {
|
|
23660
23669
|
try {
|
|
23661
|
-
if (readdirSync2(
|
|
23670
|
+
if (readdirSync2(join14(root2, project)).includes(file2)) return join14(root2, project, file2);
|
|
23662
23671
|
} catch {
|
|
23663
23672
|
}
|
|
23664
23673
|
}
|
|
@@ -23702,7 +23711,7 @@ var claudeProvider = {
|
|
|
23702
23711
|
settings.disableAllHooks = true;
|
|
23703
23712
|
args.push("--restricted", "--permission-mode", "plan", "--tools", "Read,Glob,Grep", "--strict-mcp-config", "--mcp-config", '{"mcpServers":{}}', "--disallowedTools", "mcp__*");
|
|
23704
23713
|
try {
|
|
23705
|
-
const userSettings = JSON.parse(readFileSync6(
|
|
23714
|
+
const userSettings = JSON.parse(readFileSync6(join14(homedir8(), ".claude", "settings.json"), "utf8"));
|
|
23706
23715
|
for (const [key, value] of Object.entries(userSettings.env ?? {})) {
|
|
23707
23716
|
if (/^ANTHROPIC_[A-Z0-9_]+$/.test(key) && typeof value === "string" && env[key] === void 0) env[key] = value;
|
|
23708
23717
|
}
|
|
@@ -24611,7 +24620,7 @@ async function readCodexQuotaWindows() {
|
|
|
24611
24620
|
|
|
24612
24621
|
// src/providers/kiro-quota.ts
|
|
24613
24622
|
import { execFile as execFile5 } from "node:child_process";
|
|
24614
|
-
import { tmpdir as
|
|
24623
|
+
import { tmpdir as tmpdir2 } from "node:os";
|
|
24615
24624
|
import { promisify as promisify3, stripVTControlCharacters } from "node:util";
|
|
24616
24625
|
var execFileAsync3 = promisify3(execFile5);
|
|
24617
24626
|
var amount = (value) => Number(value.replace(/,/g, ""));
|
|
@@ -24673,7 +24682,7 @@ async function readKiroQuotaWindows() {
|
|
|
24673
24682
|
const launch = launchCli({ spec: requireCliSpec("kiro"), args: ["chat", "--no-interactive", "/usage"] });
|
|
24674
24683
|
await requireKiroAuthentication(launch.env);
|
|
24675
24684
|
try {
|
|
24676
|
-
const { stdout, stderr } = await execFileAsync3(launch.executable, launch.args, { env: launch.env, cwd:
|
|
24685
|
+
const { stdout, stderr } = await execFileAsync3(launch.executable, launch.args, { env: launch.env, cwd: tmpdir2(), timeout: 3e4, maxBuffer: 1024 * 1024, windowsHide: true });
|
|
24677
24686
|
return parseKiroQuota(`${stdout}
|
|
24678
24687
|
${stderr}`);
|
|
24679
24688
|
} catch (error62) {
|
|
@@ -24870,7 +24879,7 @@ var cliDetection = new CliDetectionService();
|
|
|
24870
24879
|
|
|
24871
24880
|
// src/runtime/agent-runtime.ts
|
|
24872
24881
|
import { randomUUID as randomUUID4 } from "node:crypto";
|
|
24873
|
-
import { join as
|
|
24882
|
+
import { join as join21 } from "node:path";
|
|
24874
24883
|
|
|
24875
24884
|
// src/exec/script-runner.ts
|
|
24876
24885
|
import { spawn as spawn10 } from "node:child_process";
|
|
@@ -25159,15 +25168,15 @@ async function readCLIQuotaReport(agentType) {
|
|
|
25159
25168
|
|
|
25160
25169
|
// src/providers/tb-switch-control.ts
|
|
25161
25170
|
import { readFile as readFile6 } from "node:fs/promises";
|
|
25162
|
-
import { homedir as
|
|
25163
|
-
import { join as
|
|
25171
|
+
import { homedir as homedir9 } from "node:os";
|
|
25172
|
+
import { join as join15 } from "node:path";
|
|
25164
25173
|
function dataDir() {
|
|
25165
|
-
return process.env.TB_SWITCH_HOME?.trim() ||
|
|
25174
|
+
return process.env.TB_SWITCH_HOME?.trim() || join15(homedir9(), ".tb-switch");
|
|
25166
25175
|
}
|
|
25167
25176
|
async function readLocalService() {
|
|
25168
25177
|
let discovery;
|
|
25169
25178
|
try {
|
|
25170
|
-
discovery = JSON.parse(await readFile6(
|
|
25179
|
+
discovery = JSON.parse(await readFile6(join15(dataDir(), "api.json"), "utf8"));
|
|
25171
25180
|
} catch {
|
|
25172
25181
|
throw new Error("\u8FD9\u53F0\u8BBE\u5907\u4E0A\u7684 TB Switch \u670D\u52A1\u672A\u8FD0\u884C\uFF0C\u8BF7\u6253\u5F00\u684C\u9762\u7AEF\u63D2\u4EF6\u540E\u91CD\u8BD5\u3002");
|
|
25173
25182
|
}
|
|
@@ -25183,7 +25192,7 @@ async function readLocalService() {
|
|
|
25183
25192
|
}
|
|
25184
25193
|
let token = process.env.TB_SWITCH_API_TOKEN?.trim() ?? "";
|
|
25185
25194
|
try {
|
|
25186
|
-
token = (await readFile6(
|
|
25195
|
+
token = (await readFile6(join15(dataDir(), "api-token"), "utf8")).trim();
|
|
25187
25196
|
} catch {
|
|
25188
25197
|
}
|
|
25189
25198
|
if (!token) throw new Error("\u65E0\u6CD5\u8BFB\u53D6 TB Switch \u672C\u673A\u670D\u52A1\u51ED\u636E\uFF0C\u8BF7\u91CD\u542F\u684C\u9762\u7AEF\u63D2\u4EF6\u540E\u91CD\u8BD5\u3002");
|
|
@@ -25328,7 +25337,7 @@ function commandOf(pid) {
|
|
|
25328
25337
|
// src/runs/run-supervisor.ts
|
|
25329
25338
|
import { spawn as spawn12 } from "node:child_process";
|
|
25330
25339
|
import { mkdir as mkdir8, realpath as realpath2, stat as stat6, writeFile as writeFile8 } from "node:fs/promises";
|
|
25331
|
-
import { basename as basename3, isAbsolute as isAbsolute4, join as
|
|
25340
|
+
import { basename as basename3, isAbsolute as isAbsolute4, join as join19, relative as relative2, resolve as resolve5 } from "node:path";
|
|
25332
25341
|
import { createInterface as createInterface5 } from "node:readline";
|
|
25333
25342
|
|
|
25334
25343
|
// src/session/terminal-tail-buffer.ts
|
|
@@ -25690,19 +25699,19 @@ async function forkCodexThread(options) {
|
|
|
25690
25699
|
|
|
25691
25700
|
// src/runs/run-recorder.ts
|
|
25692
25701
|
import { appendFileSync as appendFileSync2, mkdirSync as mkdirSync3 } from "node:fs";
|
|
25693
|
-
import { homedir as
|
|
25694
|
-
import { join as
|
|
25702
|
+
import { homedir as homedir10 } from "node:os";
|
|
25703
|
+
import { join as join16 } from "node:path";
|
|
25695
25704
|
var RunRecorder = class _RunRecorder {
|
|
25696
25705
|
constructor(path) {
|
|
25697
25706
|
this.path = path;
|
|
25698
25707
|
}
|
|
25699
25708
|
path;
|
|
25700
|
-
home =
|
|
25709
|
+
home = homedir10();
|
|
25701
25710
|
static fromEnvironment(runId, meta3) {
|
|
25702
25711
|
const directory = process.env.TOC_OCRA_RECORD_DIR?.trim();
|
|
25703
25712
|
if (!directory) return void 0;
|
|
25704
25713
|
mkdirSync3(directory, { recursive: true });
|
|
25705
|
-
const recorder = new _RunRecorder(
|
|
25714
|
+
const recorder = new _RunRecorder(join16(directory, `${String(meta3.agent ?? "cli")}-${runId}.jsonl`));
|
|
25706
25715
|
recorder.write({ meta: meta3 });
|
|
25707
25716
|
return recorder;
|
|
25708
25717
|
}
|
|
@@ -25718,7 +25727,7 @@ var RunRecorder = class _RunRecorder {
|
|
|
25718
25727
|
|
|
25719
25728
|
// src/runs/run-transcript.ts
|
|
25720
25729
|
import { chmod as chmod4, mkdir as mkdir6, readdir as readdir2, readFile as readFile8, rename as rename6, stat as stat4, unlink, writeFile as writeFile6 } from "node:fs/promises";
|
|
25721
|
-
import { join as
|
|
25730
|
+
import { join as join17 } from "node:path";
|
|
25722
25731
|
var MAX_TRANSCRIPT_ITEMS = 5e3;
|
|
25723
25732
|
var MAX_TRANSCRIPT_TEXT = 2e5;
|
|
25724
25733
|
var MAX_TRANSCRIPT_LINES = 2e4;
|
|
@@ -25983,7 +25992,7 @@ function transcriptFileName(runId) {
|
|
|
25983
25992
|
var TranscriptStore = class {
|
|
25984
25993
|
constructor(dataDir2, logger, env = process.env) {
|
|
25985
25994
|
this.logger = logger;
|
|
25986
|
-
this.directory = dataDir2 ?
|
|
25995
|
+
this.directory = dataDir2 ? join17(dataDir2, "transcripts") : "";
|
|
25987
25996
|
this.enabled = Boolean(dataDir2) && transcriptsOnDisk(env);
|
|
25988
25997
|
}
|
|
25989
25998
|
logger;
|
|
@@ -26038,7 +26047,7 @@ var TranscriptStore = class {
|
|
|
26038
26047
|
await this.writes.get(runId);
|
|
26039
26048
|
let text3;
|
|
26040
26049
|
try {
|
|
26041
|
-
text3 = await readFile8(
|
|
26050
|
+
text3 = await readFile8(join17(this.directory, name), "utf8");
|
|
26042
26051
|
} catch (error62) {
|
|
26043
26052
|
if (errorCode(error62) !== "ENOENT") this.logger.warn("run-transcript-read-failed", { runId, error: errorMessage(error62) });
|
|
26044
26053
|
return void 0;
|
|
@@ -26103,7 +26112,7 @@ var TranscriptStore = class {
|
|
|
26103
26112
|
transcript.dirty = false;
|
|
26104
26113
|
const body = JSON.stringify(transcript.toFile());
|
|
26105
26114
|
await this.ensureDirectory();
|
|
26106
|
-
const file2 =
|
|
26115
|
+
const file2 = join17(this.directory, name);
|
|
26107
26116
|
const temporary = `${file2}.${process.pid}.tmp`;
|
|
26108
26117
|
await writeFile6(temporary, body, { mode: 384 });
|
|
26109
26118
|
await rename6(temporary, file2);
|
|
@@ -26140,7 +26149,7 @@ var TranscriptStore = class {
|
|
|
26140
26149
|
const now = Date.now();
|
|
26141
26150
|
const files = [];
|
|
26142
26151
|
for (const name of names) {
|
|
26143
|
-
const path =
|
|
26152
|
+
const path = join17(this.directory, name);
|
|
26144
26153
|
if (name.endsWith(".tmp")) {
|
|
26145
26154
|
const info2 = await stat4(path).catch(() => void 0);
|
|
26146
26155
|
if (info2?.isFile() && now - info2.mtimeMs > STALE_TEMPORARY_MS) await unlink(path).catch(() => void 0);
|
|
@@ -26190,7 +26199,7 @@ function errorMessage(error62) {
|
|
|
26190
26199
|
import { createHash as createHash3, randomUUID as randomUUID2 } from "node:crypto";
|
|
26191
26200
|
import { constants as constants2 } from "node:fs";
|
|
26192
26201
|
import { lstat, mkdir as mkdir7, open as open3, realpath, rename as rename7, rm as rm4, writeFile as writeFile7 } from "node:fs/promises";
|
|
26193
|
-
import { basename as basename2, isAbsolute as isAbsolute3, join as
|
|
26202
|
+
import { basename as basename2, isAbsolute as isAbsolute3, join as join18, relative } from "node:path";
|
|
26194
26203
|
function within(root2, path) {
|
|
26195
26204
|
const segment = relative(root2, path);
|
|
26196
26205
|
return segment === "" || !segment.startsWith("..") && !isAbsolute3(segment);
|
|
@@ -26198,7 +26207,7 @@ function within(root2, path) {
|
|
|
26198
26207
|
async function attachmentDirectory(workdir, messageId) {
|
|
26199
26208
|
let directory = workdir;
|
|
26200
26209
|
for (const segment of [".echo", "attachments", `message-${encodeURIComponent(messageId).slice(0, 180)}`]) {
|
|
26201
|
-
directory =
|
|
26210
|
+
directory = join18(directory, segment);
|
|
26202
26211
|
await mkdir7(directory, { mode: 448 }).catch((error62) => {
|
|
26203
26212
|
if (error62.code !== "EEXIST") throw error62;
|
|
26204
26213
|
});
|
|
@@ -26206,7 +26215,7 @@ async function attachmentDirectory(workdir, messageId) {
|
|
|
26206
26215
|
if (metadata.isSymbolicLink() || !metadata.isDirectory() || !within(workdir, await realpath(directory))) {
|
|
26207
26216
|
throw new Error("\u9644\u4EF6\u76EE\u5F55\u5FC5\u987B\u4F4D\u4E8E CLI \u5DE5\u4F5C\u76EE\u5F55\u5185\uFF0C\u4E14\u4E0D\u80FD\u662F\u7B26\u53F7\u94FE\u63A5");
|
|
26208
26217
|
}
|
|
26209
|
-
if (segment === ".echo") await writeFile7(
|
|
26218
|
+
if (segment === ".echo") await writeFile7(join18(directory, ".gitignore"), "*\n", { flag: "wx", mode: 384 }).catch((error62) => {
|
|
26210
26219
|
if (error62.code !== "EEXIST") throw error62;
|
|
26211
26220
|
});
|
|
26212
26221
|
}
|
|
@@ -26243,9 +26252,9 @@ async function prepareTaskAttachments(payload, workdir, download, signal2) {
|
|
|
26243
26252
|
const characters = Array.from(basename2(file2.name.replace(/\\/g, "/")).replace(/[^\p{L}\p{N}._-]/gu, "_").replace(/\.+$/u, ""));
|
|
26244
26253
|
while (Buffer.byteLength(characters.join("")) > 160) characters.shift();
|
|
26245
26254
|
const name = characters.join("") || "attachment";
|
|
26246
|
-
const path =
|
|
26255
|
+
const path = join18(directory, `${file2.file_id}-${name}`);
|
|
26247
26256
|
if (!await matches(path, file2.size, file2.sha256, signal2)) {
|
|
26248
|
-
const temporary =
|
|
26257
|
+
const temporary = join18(directory, `.download-${file2.file_id}-${randomUUID2()}.part`);
|
|
26249
26258
|
try {
|
|
26250
26259
|
await download(payload.run_id, file2.file_id, temporary, file2.size, file2.sha256, signal2);
|
|
26251
26260
|
signal2.throwIfAborted();
|
|
@@ -28126,12 +28135,12 @@ ${PLAN_MODE_PREFIX}` : payload.prompt;
|
|
|
28126
28135
|
async prepareChatAttachments(payload) {
|
|
28127
28136
|
if (!payload.attachments?.length) return [];
|
|
28128
28137
|
if (!this.reporter.chatMedia) throw new Error("\u9644\u4EF6\u8F6C\u53D1\u672A\u914D\u7F6E");
|
|
28129
|
-
const directory =
|
|
28138
|
+
const directory = join19(this.config.dataDir, "chat-media", encodeURIComponent(payload.chat_session_id ?? payload.run_id));
|
|
28130
28139
|
await mkdir8(directory, { recursive: true, mode: 448 });
|
|
28131
28140
|
const files = [];
|
|
28132
28141
|
for (const attachment of payload.attachments) {
|
|
28133
28142
|
const name = basename3(attachment.name).replace(/[^\p{L}\p{N}._-]/gu, "_").slice(-120) || "attachment";
|
|
28134
|
-
const path =
|
|
28143
|
+
const path = join19(directory, `${encodeURIComponent(attachment.media_id)}-${name}`);
|
|
28135
28144
|
const existing = await stat6(path).catch(() => void 0);
|
|
28136
28145
|
if (!existing?.isFile()) {
|
|
28137
28146
|
const data = await this.reporter.chatMedia(payload.run_id, attachment.media_id);
|
|
@@ -28286,6 +28295,12 @@ ${PLAN_MODE_PREFIX}` : payload.prompt;
|
|
|
28286
28295
|
} catch {
|
|
28287
28296
|
throw new Error(`\u5DE5\u4F5C\u76EE\u5F55\u4E0D\u5B58\u5728\uFF1A${input2}`);
|
|
28288
28297
|
}
|
|
28298
|
+
const lexicalCandidate = resolve5(isAbsolute4(input2) ? input2 : resolve5(input2));
|
|
28299
|
+
for (const root2 of this.config.allowedRoots) {
|
|
28300
|
+
const lexicalRoot = resolve5(root2);
|
|
28301
|
+
const lexicalSegment = relative2(lexicalRoot, lexicalCandidate);
|
|
28302
|
+
if (lexicalSegment === "" || !lexicalSegment.startsWith("..") && !isAbsolute4(lexicalSegment)) return candidate;
|
|
28303
|
+
}
|
|
28289
28304
|
for (const root2 of this.config.allowedRoots) {
|
|
28290
28305
|
const allowed = await realpath2(root2).catch(() => resolve5(root2));
|
|
28291
28306
|
const segment = relative2(allowed, candidate);
|
|
@@ -28439,11 +28454,11 @@ var GatewayClient = class {
|
|
|
28439
28454
|
|
|
28440
28455
|
// src/workspace/directory-browser.ts
|
|
28441
28456
|
import { readdir as readdir3, realpath as realpath3, stat as stat7 } from "node:fs/promises";
|
|
28442
|
-
import { homedir as
|
|
28457
|
+
import { homedir as homedir11 } from "node:os";
|
|
28443
28458
|
import { dirname as dirname8, parse as parse3, resolve as resolve6 } from "node:path";
|
|
28444
28459
|
var MAX_ENTRIES = 1e3;
|
|
28445
28460
|
async function listDirectory(requested, allowedRoots) {
|
|
28446
|
-
const raw = requested.trim().replace(/^~(?=$|[\\/])/,
|
|
28461
|
+
const raw = requested.trim().replace(/^~(?=$|[\\/])/, homedir11()) || homedir11();
|
|
28447
28462
|
const directory = await realpath3(resolve6(raw)).catch(() => {
|
|
28448
28463
|
throw new Error(`\u76EE\u5F55\u4E0D\u5B58\u5728\uFF1A${requested}`);
|
|
28449
28464
|
});
|
|
@@ -28461,8 +28476,8 @@ async function listDirectory(requested, allowedRoots) {
|
|
|
28461
28476
|
else if (entry.isFile()) files.push(item);
|
|
28462
28477
|
}
|
|
28463
28478
|
const parent = dirname8(directory);
|
|
28464
|
-
const places = [{ label: "\u4E3B\u76EE\u5F55", path:
|
|
28465
|
-
for (const root2 of allowedRoots) if (root2 !==
|
|
28479
|
+
const places = [{ label: "\u4E3B\u76EE\u5F55", path: homedir11() }];
|
|
28480
|
+
for (const root2 of allowedRoots) if (root2 !== homedir11()) places.push({ label: "\u5141\u8BB8\u7684\u76EE\u5F55", path: root2 });
|
|
28466
28481
|
places.push({ label: "\u6839\u76EE\u5F55", path: process.platform === "win32" ? parse3(directory).root : "/" });
|
|
28467
28482
|
return {
|
|
28468
28483
|
path: directory,
|
|
@@ -28477,8 +28492,8 @@ async function listDirectory(requested, allowedRoots) {
|
|
|
28477
28492
|
// src/workspace/workspace-manager.ts
|
|
28478
28493
|
import { spawn as spawn13 } from "node:child_process";
|
|
28479
28494
|
import { chmod as chmod5, mkdir as mkdir9, mkdtemp as mkdtemp2, opendir, realpath as realpath4, rm as rm5, stat as stat8, writeFile as writeFile9 } from "node:fs/promises";
|
|
28480
|
-
import { homedir as
|
|
28481
|
-
import { isAbsolute as isAbsolute5, join as
|
|
28495
|
+
import { homedir as homedir12, tmpdir as tmpdir3 } from "node:os";
|
|
28496
|
+
import { isAbsolute as isAbsolute5, join as join20, relative as relative3, resolve as resolve7 } from "node:path";
|
|
28482
28497
|
var MAX_NODES = 2e3;
|
|
28483
28498
|
var MAX_DIRECTORY_ENTRIES = 12e3;
|
|
28484
28499
|
var IGNORED_DIRECTORIES = /* @__PURE__ */ new Set([
|
|
@@ -28526,7 +28541,7 @@ var WorkspaceManager = class {
|
|
|
28526
28541
|
};
|
|
28527
28542
|
}
|
|
28528
28543
|
validateRootPath(value) {
|
|
28529
|
-
const raw = value.trim().replace(/^~(?=$|[\\/])/,
|
|
28544
|
+
const raw = value.trim().replace(/^~(?=$|[\\/])/, homedir12());
|
|
28530
28545
|
const root2 = resolve7(raw);
|
|
28531
28546
|
if (!isAbsolute5(raw)) throw new Error("\u6839\u76EE\u5F55\u5FC5\u987B\u662F\u7EDD\u5BF9\u8DEF\u5F84");
|
|
28532
28547
|
if (relative3(root2, resolve7(root2, "..")) === "") throw new Error("\u4E0D\u80FD\u628A\u6587\u4EF6\u7CFB\u7EDF\u6839\u76EE\u5F55\u4F5C\u4E3A\u76EE\u5F55\u6839");
|
|
@@ -28853,12 +28868,12 @@ var WorkspaceManager = class {
|
|
|
28853
28868
|
}
|
|
28854
28869
|
async createGitAuthEnvironment(auth) {
|
|
28855
28870
|
if (!auth) return void 0;
|
|
28856
|
-
const directory = await mkdtemp2(
|
|
28871
|
+
const directory = await mkdtemp2(join20(tmpdir3(), "toc-ocra-git-auth-"));
|
|
28857
28872
|
const isWindows = process.platform === "win32";
|
|
28858
|
-
const scriptPath =
|
|
28873
|
+
const scriptPath = join20(directory, isWindows ? "askpass.cmd" : "askpass.sh");
|
|
28859
28874
|
let script;
|
|
28860
28875
|
if (isWindows) {
|
|
28861
|
-
const helperPath =
|
|
28876
|
+
const helperPath = join20(directory, "askpass.cjs");
|
|
28862
28877
|
await writeFile9(
|
|
28863
28878
|
helperPath,
|
|
28864
28879
|
'const prompt = process.argv.slice(2).join(" ");\nprocess.stdout.write(/username/i.test(prompt) ? process.env.ECHO_GIT_USERNAME ?? "" : process.env.ECHO_GIT_PASSWORD ?? "");\n',
|
|
@@ -29069,7 +29084,7 @@ var AgentRuntime = class {
|
|
|
29069
29084
|
}
|
|
29070
29085
|
};
|
|
29071
29086
|
this.workspaces = new WorkspaceManager(config2, this.logger);
|
|
29072
|
-
this.orphans = new OrphanRegistry(
|
|
29087
|
+
this.orphans = new OrphanRegistry(join21(config2.dataDir, "active-runs.json"));
|
|
29073
29088
|
this.runs = new RunSupervisor(config2, this.logger, reporter, this.orphans);
|
|
29074
29089
|
}
|
|
29075
29090
|
config;
|
|
@@ -29840,7 +29855,7 @@ function preferSystemNode() {
|
|
|
29840
29855
|
const names = process.platform === "win32" ? ["node.exe"] : ["node"];
|
|
29841
29856
|
for (const directory of (process.env.PATH ?? "").split(delimiter5)) {
|
|
29842
29857
|
for (const name of names) {
|
|
29843
|
-
const candidate = directory &&
|
|
29858
|
+
const candidate = directory && join22(directory, name);
|
|
29844
29859
|
if (candidate && existsSync7(candidate)) {
|
|
29845
29860
|
process.env.TOC_OCRA_NODE_PATH = candidate;
|
|
29846
29861
|
return;
|