toc-ocra 0.3.8 → 0.3.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -1
- package/dist/cli/cli.mjs +386 -332
- package/dist/plugin/renderer.js.map +1 -1
- package/dist/service/agent.mjs +262 -208
- package/dist/src/acp/acp-launch-specs.d.ts +1 -1
- package/dist/src/acp/acp-launch-specs.js +77 -0
- package/dist/src/acp/acp-launch-specs.js.map +1 -1
- package/dist/src/acp/acp-model-catalog-probe.js +1 -1
- package/dist/src/acp/acp-model-catalog-probe.js.map +1 -1
- package/dist/src/providers/acp/acp-agents.d.ts +14 -0
- package/dist/src/providers/acp/acp-agents.js +55 -0
- package/dist/src/providers/acp/acp-agents.js.map +1 -0
- package/dist/src/providers/cli-specs.js +11 -0
- package/dist/src/providers/cli-specs.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,
|
|
@@ -20718,6 +20718,17 @@ var SOURCES = [
|
|
|
20718
20718
|
{ id: "opencode", label: "OpenCode", command: "opencode", versionArguments: ["--version"], installHint: "npm i -g opencode-ai" },
|
|
20719
20719
|
{ id: "kiro", label: "Kiro CLI", aliases: ["kiro-cli"], command: "kiro-cli", commandAliases: ["kiro"], versionArguments: ["--version"], promptStdin: "omit", restrictedPermission: true },
|
|
20720
20720
|
{ id: "omp", label: "OMP", command: "omp", versionArguments: ["--version"] },
|
|
20721
|
+
// Chinese coding CLIs that serve ACP themselves (acp/acp-launch-specs.ts). Only
|
|
20722
|
+
// the main command is detected: launches use it, never an alias.
|
|
20723
|
+
{ id: "qwen", label: "Qwen Code", aliases: ["qwen-code"], command: "qwen", versionArguments: ["--version"], installHint: "npm i -g @qwen-code/qwen-code" },
|
|
20724
|
+
{ id: "kimi", label: "Kimi Code", aliases: ["kimi-code"], command: "kimi", versionArguments: ["--version"] },
|
|
20725
|
+
{ id: "qoder", label: "Qoder CLI", command: "qodercli", versionArguments: ["--version"] },
|
|
20726
|
+
{ id: "qoder-cn", label: "Qoder CN CLI", aliases: ["qodercn"], command: "qoderclicn", versionArguments: ["--version"], installHint: "npm i -g @qodercn-ai/qoderclicn" },
|
|
20727
|
+
{ id: "codebuddy", label: "CodeBuddy Code", aliases: ["codebuddy-code"], command: "codebuddy", versionArguments: ["--version"], installHint: "npm i -g @tencent-ai/codebuddy-code" },
|
|
20728
|
+
// TRAE CN's own name: `trae-cli` is also installed by the unrelated bytedance/trae-agent.
|
|
20729
|
+
{ id: "trae", label: "TRAE CLI", command: "traecli", versionArguments: ["--version"] },
|
|
20730
|
+
{ id: "mimo", label: "MiMo Code", aliases: ["mimo-code"], command: "mimo", versionArguments: ["--version"] },
|
|
20731
|
+
{ id: "dsh", label: "DeepSeek Harness", aliases: ["deepseek", "deepseek-harness"], command: "dsh", versionArguments: ["--version"] },
|
|
20721
20732
|
{ id: "cursor", label: "Cursor Agent", command: "cursor-agent", commandAliases: ["cursor"] },
|
|
20722
20733
|
{ id: "copilot", label: "GitHub Copilot CLI", command: "copilot" },
|
|
20723
20734
|
{ id: "aider", label: "Aider", command: "aider" },
|
|
@@ -20944,7 +20955,7 @@ function textRows(prefix, text3, maxRows = 40) {
|
|
|
20944
20955
|
|
|
20945
20956
|
// src/acp/acp-launch-specs.ts
|
|
20946
20957
|
import { realpathSync as realpathSync2 } from "node:fs";
|
|
20947
|
-
import { join as
|
|
20958
|
+
import { join as join12 } from "node:path";
|
|
20948
20959
|
|
|
20949
20960
|
// src/providers/cli/codex-catalog.ts
|
|
20950
20961
|
import { spawn as spawn3 } from "node:child_process";
|
|
@@ -21089,38 +21100,41 @@ function codexCatalogArgs() {
|
|
|
21089
21100
|
// src/providers/model-catalog.ts
|
|
21090
21101
|
import { spawn as spawn5 } from "node:child_process";
|
|
21091
21102
|
import { readFile as readFile4 } from "node:fs/promises";
|
|
21092
|
-
import { homedir as
|
|
21093
|
-
import { isAbsolute as isAbsolute2, join as
|
|
21103
|
+
import { homedir as homedir6 } from "node:os";
|
|
21104
|
+
import { isAbsolute as isAbsolute2, join as join9, resolve as resolve3 } from "node:path";
|
|
21094
21105
|
|
|
21095
21106
|
// src/providers/kiro-auth.ts
|
|
21096
21107
|
import { execFile as execFile3 } from "node:child_process";
|
|
21097
|
-
import {
|
|
21108
|
+
import { homedir as homedir5 } from "node:os";
|
|
21109
|
+
import { join as join8 } from "node:path";
|
|
21098
21110
|
import { promisify } from "node:util";
|
|
21099
21111
|
var execFileAsync = promisify(execFile3);
|
|
21100
|
-
|
|
21101
|
-
|
|
21102
|
-
|
|
21103
|
-
|
|
21104
|
-
|
|
21105
|
-
|
|
21112
|
+
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";
|
|
21113
|
+
var knownUnauthenticated = false;
|
|
21114
|
+
async function hasStoredAuthentication(environment) {
|
|
21115
|
+
if (environment.KIRO_API_KEY?.trim()) return true;
|
|
21116
|
+
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");
|
|
21117
|
+
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
21118
|
try {
|
|
21107
|
-
const { stdout } = await execFileAsync(
|
|
21108
|
-
env:
|
|
21109
|
-
|
|
21110
|
-
|
|
21111
|
-
maxBuffer: 64 * 1024,
|
|
21119
|
+
const { stdout } = await execFileAsync("sqlite3", ["-readonly", database, sql], {
|
|
21120
|
+
env: environment,
|
|
21121
|
+
timeout: 3e3,
|
|
21122
|
+
maxBuffer: 1024,
|
|
21112
21123
|
windowsHide: true
|
|
21113
21124
|
});
|
|
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
|
-
}
|
|
21125
|
+
return stdout.trim() === "1";
|
|
21121
21126
|
} catch {
|
|
21127
|
+
return false;
|
|
21128
|
+
}
|
|
21129
|
+
}
|
|
21130
|
+
async function requireKiroAuthentication(environment, options = {}) {
|
|
21131
|
+
if (knownUnauthenticated && !options.force) throw new Error(NOT_AUTHENTICATED);
|
|
21132
|
+
if (await hasStoredAuthentication(environment ?? process.env)) {
|
|
21133
|
+
knownUnauthenticated = false;
|
|
21134
|
+
return;
|
|
21122
21135
|
}
|
|
21123
|
-
|
|
21136
|
+
knownUnauthenticated = true;
|
|
21137
|
+
throw new Error(NOT_AUTHENTICATED);
|
|
21124
21138
|
}
|
|
21125
21139
|
|
|
21126
21140
|
// src/providers/kiro-models.ts
|
|
@@ -21243,15 +21257,15 @@ function parseClaudeModelCatalog(settings, environment = process.env, fetchedAt
|
|
|
21243
21257
|
if (defaultModel) catalog.default_model = defaultModel;
|
|
21244
21258
|
return catalog;
|
|
21245
21259
|
}
|
|
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 = () =>
|
|
21260
|
+
var claudeHome = () => process.env.CLAUDE_CONFIG_DIR?.trim() || join9(homedir6(), ".claude");
|
|
21261
|
+
var codexHome2 = () => process.env.CODEX_HOME?.trim() || join9(homedir6(), ".codex");
|
|
21262
|
+
var geminiHome = () => process.env.GEMINI_CLI_HOME?.trim() || join9(homedir6(), ".gemini");
|
|
21263
|
+
var grokHome = () => process.env.GROK_HOME?.trim() || join9(homedir6(), ".grok");
|
|
21264
|
+
var opencodeHome = () => join9(process.env.XDG_CONFIG_HOME?.trim() || join9(homedir6(), ".config"), "opencode");
|
|
21265
|
+
var kiroHome = () => join9(homedir6(), ".kiro");
|
|
21252
21266
|
async function readClaudeModelCatalog() {
|
|
21253
21267
|
const home = claudeHome();
|
|
21254
|
-
const content = await readFile4(
|
|
21268
|
+
const content = await readFile4(join9(home, "settings.json"), "utf8").catch(() => "");
|
|
21255
21269
|
let settings = {};
|
|
21256
21270
|
if (content) {
|
|
21257
21271
|
try {
|
|
@@ -21313,13 +21327,13 @@ async function readCodexModels(codexHome3, config2) {
|
|
|
21313
21327
|
const configuredModels = parseCodexModels(await readFile4(catalogPath, "utf8").catch(() => ""));
|
|
21314
21328
|
if (configuredModels?.length) return configuredModels;
|
|
21315
21329
|
}
|
|
21316
|
-
const cached3 = parseCodexModels(await readFile4(
|
|
21330
|
+
const cached3 = parseCodexModels(await readFile4(join9(codexHome3, "models_cache.json"), "utf8").catch(() => ""));
|
|
21317
21331
|
if (cached3?.length) return cached3;
|
|
21318
21332
|
return codexModelsFrom(await codexBundledCatalog().catch(() => void 0), { listedOnly: true }) ?? [];
|
|
21319
21333
|
}
|
|
21320
21334
|
async function readCodexModelCatalog() {
|
|
21321
21335
|
const home = codexHome2();
|
|
21322
|
-
const config2 = await readFile4(
|
|
21336
|
+
const config2 = await readFile4(join9(home, "config.toml"), "utf8").catch(() => "");
|
|
21323
21337
|
const models2 = await readCodexModels(home, config2);
|
|
21324
21338
|
const defaultModel = configValue(config2, "model");
|
|
21325
21339
|
const defaultReasoningEffort = configValue(config2, "model_reasoning_effort");
|
|
@@ -21412,7 +21426,7 @@ function withKnownEfforts(base, known) {
|
|
|
21412
21426
|
async function readKiroModelCatalog(options = {}) {
|
|
21413
21427
|
const environment = mergeShellProxyEnvironment(await hydrateShellPath(), providerEnvironment());
|
|
21414
21428
|
const kiro = requireCliSpec("kiro");
|
|
21415
|
-
await requireKiroAuthentication(environment);
|
|
21429
|
+
await requireKiroAuthentication(environment, { force: options.force === true });
|
|
21416
21430
|
const listLaunch = launchCli({ spec: kiro, args: ["chat", "--list-models", "--format", "json"], env: environment });
|
|
21417
21431
|
const output2 = await runModelListCommand(listLaunch.executable, listLaunch.args, "kiro-cli", environment);
|
|
21418
21432
|
let listed;
|
|
@@ -21433,7 +21447,7 @@ async function readKiroModelCatalog(options = {}) {
|
|
|
21433
21447
|
if (current) return known.catalog;
|
|
21434
21448
|
try {
|
|
21435
21449
|
const launch = launchCli({ spec: kiro, args: ["acp", "--trust-tools="], env: environment });
|
|
21436
|
-
const catalog = await readKiroNativeModels(launch,
|
|
21450
|
+
const catalog = await readKiroNativeModels(launch, homedir6(), { catalog: base });
|
|
21437
21451
|
kiroEfforts = { signature, readAt: Date.now(), catalog };
|
|
21438
21452
|
return catalog;
|
|
21439
21453
|
} catch {
|
|
@@ -21442,7 +21456,7 @@ async function readKiroModelCatalog(options = {}) {
|
|
|
21442
21456
|
};
|
|
21443
21457
|
const [payload, content] = await Promise.all([
|
|
21444
21458
|
readEfforts(),
|
|
21445
|
-
readFile4(
|
|
21459
|
+
readFile4(join9(kiroHome(), "settings", "cli.json"), "utf8").catch(() => "{}")
|
|
21446
21460
|
]);
|
|
21447
21461
|
let settings;
|
|
21448
21462
|
try {
|
|
@@ -21499,7 +21513,7 @@ function geminiModelsUrl(baseUrl) {
|
|
|
21499
21513
|
}
|
|
21500
21514
|
async function readGeminiModelCatalog() {
|
|
21501
21515
|
const fileEnvironment = parseEnvFile(
|
|
21502
|
-
await readFile4(
|
|
21516
|
+
await readFile4(join9(geminiHome(), ".env"), "utf8").catch(() => "")
|
|
21503
21517
|
);
|
|
21504
21518
|
const environment = { ...fileEnvironment, ...process.env };
|
|
21505
21519
|
const baseUrl = environment.GOOGLE_GEMINI_BASE_URL?.trim();
|
|
@@ -21544,7 +21558,7 @@ function parseGrokModelCatalog(output2, config2 = "", fetchedAt = (/* @__PURE__
|
|
|
21544
21558
|
return catalog;
|
|
21545
21559
|
}
|
|
21546
21560
|
async function readGrokModelCatalog() {
|
|
21547
|
-
const config2 = await readFile4(
|
|
21561
|
+
const config2 = await readFile4(join9(grokHome(), "config.toml"), "utf8").catch(() => "");
|
|
21548
21562
|
const output2 = await runModelListCommand(cliExecutable("grok"), ["models"], "grok");
|
|
21549
21563
|
const catalog = parseGrokModelCatalog(output2, config2);
|
|
21550
21564
|
if (catalog.models.length === 0) throw new Error("Grok \u672C\u673A\u672A\u8FD4\u56DE\u53EF\u7528\u6A21\u578B");
|
|
@@ -21563,35 +21577,38 @@ function parseOpencodeModelCatalog(output2, config2 = "", fetchedAt = (/* @__PUR
|
|
|
21563
21577
|
return catalog;
|
|
21564
21578
|
}
|
|
21565
21579
|
async function readOpencodeModelCatalog() {
|
|
21566
|
-
const config2 = await readFile4(
|
|
21580
|
+
const config2 = await readFile4(join9(opencodeHome(), "opencode.json"), "utf8").catch(() => "") || await readFile4(join9(opencodeHome(), "opencode.jsonc"), "utf8").catch(() => "");
|
|
21567
21581
|
const output2 = await runModelListCommand(cliExecutable("opencode"), ["models"], "opencode");
|
|
21568
21582
|
const catalog = parseOpencodeModelCatalog(output2, config2);
|
|
21569
21583
|
if (catalog.models.length === 0) throw new Error("OpenCode \u672C\u673A\u672A\u8FD4\u56DE\u53EF\u7528\u6A21\u578B");
|
|
21570
21584
|
return catalog;
|
|
21571
21585
|
}
|
|
21572
21586
|
var TEN_MINUTES = 10 * 60 * 1e3;
|
|
21573
|
-
var TWO_MINUTES = 2 * 60 * 1e3;
|
|
21574
21587
|
var MODEL_SOURCES = {
|
|
21575
|
-
claude: { read: readClaudeModelCatalog, watchFiles: () => [
|
|
21588
|
+
claude: { read: readClaudeModelCatalog, watchFiles: () => [join9(claudeHome(), "settings.json")] },
|
|
21576
21589
|
codex: {
|
|
21577
21590
|
read: readCodexModelCatalog,
|
|
21578
21591
|
watchFiles: () => {
|
|
21579
21592
|
const home = codexHome2();
|
|
21580
|
-
return [
|
|
21593
|
+
return [join9(home, "config.toml"), join9(home, "models_cache.json")];
|
|
21581
21594
|
},
|
|
21582
21595
|
// model_catalog_json may point anywhere; a periodic re-read covers it.
|
|
21583
21596
|
refreshEveryMs: TEN_MINUTES
|
|
21584
21597
|
},
|
|
21585
|
-
gemini: { read: readGeminiModelCatalog, watchFiles: () => [
|
|
21586
|
-
grok: { read: readGrokModelCatalog, watchFiles: () => [
|
|
21587
|
-
kiro: { read: readKiroModelCatalog, watchFiles: () => [
|
|
21598
|
+
gemini: { read: readGeminiModelCatalog, watchFiles: () => [join9(geminiHome(), ".env")], refreshEveryMs: TEN_MINUTES },
|
|
21599
|
+
grok: { read: readGrokModelCatalog, watchFiles: () => [join9(grokHome(), "config.toml")], refreshEveryMs: TEN_MINUTES },
|
|
21600
|
+
kiro: { read: readKiroModelCatalog, watchFiles: () => [join9(kiroHome(), "settings", "cli.json")] },
|
|
21588
21601
|
opencode: {
|
|
21589
21602
|
read: readOpencodeModelCatalog,
|
|
21590
|
-
watchFiles: () => [
|
|
21603
|
+
watchFiles: () => [join9(opencodeHome(), "opencode.json"), join9(opencodeHome(), "opencode.jsonc")],
|
|
21591
21604
|
refreshEveryMs: TEN_MINUTES
|
|
21592
21605
|
}
|
|
21593
21606
|
};
|
|
21594
21607
|
|
|
21608
|
+
// src/acp/acp-dialects/acp-dialect.ts
|
|
21609
|
+
var GENERIC_ACP_DIALECT = {};
|
|
21610
|
+
var record2 = (value) => value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
21611
|
+
|
|
21595
21612
|
// src/acp/acp-dialects/gemini-dialect.ts
|
|
21596
21613
|
var GEMINI_FAILURE_RULES = [
|
|
21597
21614
|
{ kind: "sessionMissing", pattern: /session[^\n]{0,60}(?:not found|does not exist)|no session found|invalid session/i },
|
|
@@ -21599,9 +21616,6 @@ var GEMINI_FAILURE_RULES = [
|
|
|
21599
21616
|
];
|
|
21600
21617
|
var GEMINI_ACP_DIALECT = { failureRules: GEMINI_FAILURE_RULES };
|
|
21601
21618
|
|
|
21602
|
-
// src/acp/acp-dialects/acp-dialect.ts
|
|
21603
|
-
var record2 = (value) => value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
21604
|
-
|
|
21605
21619
|
// src/acp/acp-dialects/grok-dialect.ts
|
|
21606
21620
|
function modelEfforts(model) {
|
|
21607
21621
|
const meta3 = record2(model._meta);
|
|
@@ -21701,11 +21715,11 @@ function classifySpawnError(error62, context) {
|
|
|
21701
21715
|
|
|
21702
21716
|
// src/providers/cli/kiro-session-log.ts
|
|
21703
21717
|
import { open as open2, readdir, readFile as readFile5, stat as stat2 } from "node:fs/promises";
|
|
21704
|
-
import { homedir as
|
|
21705
|
-
import { join as
|
|
21718
|
+
import { homedir as homedir7 } from "node:os";
|
|
21719
|
+
import { join as join10 } from "node:path";
|
|
21706
21720
|
var SHELL_TOOLS = /* @__PURE__ */ new Set(["shell", "execute_bash", "bash"]);
|
|
21707
21721
|
function kiroSessionsDirectory() {
|
|
21708
|
-
return process.env.TOC_OCRA_KIRO_SESSIONS_DIR ||
|
|
21722
|
+
return process.env.TOC_OCRA_KIRO_SESSIONS_DIR || join10(homedir7(), ".kiro", "sessions", "cli");
|
|
21709
21723
|
}
|
|
21710
21724
|
var KiroSessionLog = class {
|
|
21711
21725
|
constructor(options) {
|
|
@@ -21724,7 +21738,7 @@ var KiroSessionLog = class {
|
|
|
21724
21738
|
/** Called before the CLI starts: a resumed log is followed from its current end. */
|
|
21725
21739
|
async begin() {
|
|
21726
21740
|
if (!this.options.sessionId) return;
|
|
21727
|
-
this.path =
|
|
21741
|
+
this.path = join10(this.directory, `${this.options.sessionId}.jsonl`);
|
|
21728
21742
|
this.offset = await stat2(this.path).then((info) => info.size, () => 0);
|
|
21729
21743
|
}
|
|
21730
21744
|
/**
|
|
@@ -21737,11 +21751,11 @@ var KiroSessionLog = class {
|
|
|
21737
21751
|
const found = [];
|
|
21738
21752
|
for (const name of names) {
|
|
21739
21753
|
if (!name.endsWith(".json")) continue;
|
|
21740
|
-
const meta3 = await readFile5(
|
|
21754
|
+
const meta3 = await readFile5(join10(this.directory, name), "utf8").then((text3) => JSON.parse(text3), () => void 0);
|
|
21741
21755
|
const created = meta3?.created_at ? Date.parse(meta3.created_at) : NaN;
|
|
21742
21756
|
if (meta3?.cwd && sameFolder(meta3.cwd, this.options.workdir) && created >= this.options.startedAt - 2e3) found.push(name.slice(0, -5));
|
|
21743
21757
|
}
|
|
21744
|
-
if (found.length === 1) this.path =
|
|
21758
|
+
if (found.length === 1) this.path = join10(this.directory, `${found[0]}.jsonl`);
|
|
21745
21759
|
}
|
|
21746
21760
|
/** Reads entries appended since the last call. */
|
|
21747
21761
|
async refresh() {
|
|
@@ -22112,7 +22126,7 @@ import { spawn as spawn6 } from "node:child_process";
|
|
|
22112
22126
|
import { createHash } from "node:crypto";
|
|
22113
22127
|
import { existsSync as existsSync5, readFileSync as readFileSync5 } from "node:fs";
|
|
22114
22128
|
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
|
|
22129
|
+
import { dirname as dirname6, join as join11, resolve as resolve4 } from "node:path";
|
|
22116
22130
|
import { fileURLToPath } from "node:url";
|
|
22117
22131
|
var AcpRuntimeUnavailable = class extends Error {
|
|
22118
22132
|
constructor(message) {
|
|
@@ -22145,21 +22159,21 @@ function agentPackageVersion() {
|
|
|
22145
22159
|
const directory = agentRoot();
|
|
22146
22160
|
if (!directory) return "0";
|
|
22147
22161
|
try {
|
|
22148
|
-
return JSON.parse(readFileSync5(
|
|
22162
|
+
return JSON.parse(readFileSync5(join11(directory, "package.json"), "utf8")).version ?? "0";
|
|
22149
22163
|
} catch {
|
|
22150
22164
|
return "0";
|
|
22151
22165
|
}
|
|
22152
22166
|
}
|
|
22153
22167
|
function vendoredAdapter(name) {
|
|
22154
22168
|
const directory = agentRoot();
|
|
22155
|
-
const entry = directory ?
|
|
22169
|
+
const entry = directory ? join11(directory, "assets", "acp", name, "index.mjs") : void 0;
|
|
22156
22170
|
return entry && existsSync5(entry) ? entry : void 0;
|
|
22157
22171
|
}
|
|
22158
22172
|
var installs = /* @__PURE__ */ new Map();
|
|
22159
22173
|
function ensureClaudeRuntime(dataDir2) {
|
|
22160
22174
|
const entry = vendoredAdapter("claude");
|
|
22161
22175
|
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 =
|
|
22176
|
+
const manifestPath = join11(dirname6(entry), "runtime.json");
|
|
22163
22177
|
let manifest;
|
|
22164
22178
|
try {
|
|
22165
22179
|
manifest = JSON.parse(readFileSync5(manifestPath, "utf8"));
|
|
@@ -22167,7 +22181,7 @@ function ensureClaudeRuntime(dataDir2) {
|
|
|
22167
22181
|
return Promise.reject(new AcpRuntimeUnavailable("Claude ACP \u9002\u914D\u5668\u7F3A\u5C11 runtime.json"));
|
|
22168
22182
|
}
|
|
22169
22183
|
const hash2 = createHash("sha256").update(readFileSync5(entry)).digest("hex").slice(0, 12);
|
|
22170
|
-
const directory =
|
|
22184
|
+
const directory = join11(dataDir2, "acp-runtimes", `claude-${manifest.adapterVersion}-sdk-${manifest.sdk.version}-${hash2}`);
|
|
22171
22185
|
const existing = installs.get(directory);
|
|
22172
22186
|
if (existing) return existing;
|
|
22173
22187
|
const install = installClaudeRuntime(directory, entry, manifest).catch((error62) => {
|
|
@@ -22178,19 +22192,19 @@ function ensureClaudeRuntime(dataDir2) {
|
|
|
22178
22192
|
return install;
|
|
22179
22193
|
}
|
|
22180
22194
|
async function installClaudeRuntime(directory, entry, manifest) {
|
|
22181
|
-
const sdkPackage =
|
|
22182
|
-
if (existsSync5(sdkPackage) && existsSync5(
|
|
22195
|
+
const sdkPackage = join11(directory, "node_modules", ...manifest.sdk.name.split("/"), "package.json");
|
|
22196
|
+
if (existsSync5(sdkPackage) && existsSync5(join11(directory, "index.mjs"))) return directory;
|
|
22183
22197
|
const temporary = `${directory}.tmp-${process.pid}-${Date.now()}`;
|
|
22184
22198
|
await mkdir4(temporary, { recursive: true, mode: 448 });
|
|
22185
22199
|
try {
|
|
22186
|
-
await writeFile4(
|
|
22200
|
+
await writeFile4(join11(temporary, "package.json"), JSON.stringify({
|
|
22187
22201
|
name: "toc-ocra-claude-acp-runtime",
|
|
22188
22202
|
private: true,
|
|
22189
22203
|
type: "module",
|
|
22190
22204
|
dependencies: { [manifest.sdk.name]: manifest.sdk.version }
|
|
22191
22205
|
}, null, 2));
|
|
22192
22206
|
await runNpm(["install", "--omit=optional", "--no-audit", "--no-fund", "--no-package-lock", "--loglevel=error"], temporary);
|
|
22193
|
-
await copyFile(entry,
|
|
22207
|
+
await copyFile(entry, join11(temporary, "index.mjs"));
|
|
22194
22208
|
await rm2(directory, { recursive: true, force: true });
|
|
22195
22209
|
await rename4(temporary, directory);
|
|
22196
22210
|
} catch (error62) {
|
|
@@ -22282,6 +22296,32 @@ var OMP_LAUNCH_SPEC = {
|
|
|
22282
22296
|
// Its CLI listing includes disabled models, and it cannot delete sessions: list in a disposable session folder.
|
|
22283
22297
|
modelDiscovery: { kind: "session", sessionFolderArgs: (folder) => ["--session-dir", folder] }
|
|
22284
22298
|
};
|
|
22299
|
+
function plainAcpRow(agent, args, rest = {}) {
|
|
22300
|
+
return { agent, headless: "acp", args: () => [...args], dialect: GENERIC_ACP_DIALECT, modelDiscovery: { kind: "session" }, ...rest };
|
|
22301
|
+
}
|
|
22302
|
+
var QWEN_LAUNCH_SPEC = {
|
|
22303
|
+
agent: "qwen",
|
|
22304
|
+
headless: "acp",
|
|
22305
|
+
args: ({ access }) => ["--acp", "--approval-mode", access === "bypassPermissions" ? "yolo" : "default"],
|
|
22306
|
+
dialect: GEMINI_ACP_DIALECT,
|
|
22307
|
+
modelDiscovery: { kind: "session" }
|
|
22308
|
+
};
|
|
22309
|
+
var KIMI_LAUNCH_SPEC = plainAcpRow("kimi", ["acp"], {
|
|
22310
|
+
dialect: { failureRules: [{ kind: "notSignedIn", pattern: /LLM not set|send "?\/login/i }] }
|
|
22311
|
+
});
|
|
22312
|
+
var QODER_LAUNCH_SPEC = plainAcpRow("qoder", ["--acp"]);
|
|
22313
|
+
var QODER_CN_LAUNCH_SPEC = plainAcpRow("qoder-cn", ["--acp"]);
|
|
22314
|
+
var CODEBUDDY_LAUNCH_SPEC = plainAcpRow("codebuddy", ["--acp"]);
|
|
22315
|
+
var TRAE_LAUNCH_SPEC = plainAcpRow("trae", ["acp", "serve"]);
|
|
22316
|
+
var MIMO_LAUNCH_SPEC = plainAcpRow("mimo", ["acp"], {
|
|
22317
|
+
env: { MIMOCODE_CLIENT: "acp", MIMOCODE_ENABLE_QUESTION_TOOL: "false" },
|
|
22318
|
+
dialect: OPENCODE_ACP_DIALECT
|
|
22319
|
+
});
|
|
22320
|
+
var DSH_LAUNCH_SPEC = plainAcpRow("dsh", ["--profile", "acp"], {
|
|
22321
|
+
// Sessions open without a key; the first prompt then fails naming DEEPSEEK_API_KEY.
|
|
22322
|
+
dialect: { failureRules: [{ kind: "notSignedIn", pattern: /no API key for provider route/i }] },
|
|
22323
|
+
modelDiscovery: { kind: "unavailable", reason: "DeepSeek Harness \u7684 ACP \u4E0D\u80FD\u5220\u9664\u4F1A\u8BDD\uFF0C\u4E0D\u8BFB\u53D6\u6A21\u578B\u5217\u8868" }
|
|
22324
|
+
});
|
|
22285
22325
|
function installedCli(spec) {
|
|
22286
22326
|
const override = process.env[spec.overrideEnv]?.trim();
|
|
22287
22327
|
const found = override || findCliCommand(cliCommand(spec), { pathEnv: providerEnvironment().PATH ?? null });
|
|
@@ -22305,7 +22345,7 @@ var CLAUDE_LAUNCH_SPEC = {
|
|
|
22305
22345
|
const executable = installedCli(claude);
|
|
22306
22346
|
const runtime = await ensureClaudeRuntime(dataDir2);
|
|
22307
22347
|
return {
|
|
22308
|
-
launch: { executable: process.execPath, args: [
|
|
22348
|
+
launch: { executable: process.execPath, args: [join12(runtime, "index.mjs")], env: { ...providerEnvironment(), CLAUDE_CODE_EXECUTABLE: executable }, cwd: workdir },
|
|
22309
22349
|
fingerprint: `claude:${runtime}:${executable}`
|
|
22310
22350
|
};
|
|
22311
22351
|
},
|
|
@@ -22353,6 +22393,14 @@ var ACP_LAUNCH_SPECS = [
|
|
|
22353
22393
|
GROK_LAUNCH_SPEC,
|
|
22354
22394
|
OPENCODE_LAUNCH_SPEC,
|
|
22355
22395
|
OMP_LAUNCH_SPEC,
|
|
22396
|
+
QWEN_LAUNCH_SPEC,
|
|
22397
|
+
KIMI_LAUNCH_SPEC,
|
|
22398
|
+
QODER_LAUNCH_SPEC,
|
|
22399
|
+
QODER_CN_LAUNCH_SPEC,
|
|
22400
|
+
CODEBUDDY_LAUNCH_SPEC,
|
|
22401
|
+
TRAE_LAUNCH_SPEC,
|
|
22402
|
+
MIMO_LAUNCH_SPEC,
|
|
22403
|
+
DSH_LAUNCH_SPEC,
|
|
22356
22404
|
CLAUDE_LAUNCH_SPEC,
|
|
22357
22405
|
CODEX_LAUNCH_SPEC
|
|
22358
22406
|
];
|
|
@@ -22420,8 +22468,8 @@ var ACP_CHAT_IDS = [...ACP_CHAT.keys()];
|
|
|
22420
22468
|
|
|
22421
22469
|
// src/acp/acp-model-catalog-probe.ts
|
|
22422
22470
|
import { mkdtemp, rm as rm3 } from "node:fs/promises";
|
|
22423
|
-
import { tmpdir
|
|
22424
|
-
import { join as
|
|
22471
|
+
import { tmpdir } from "node:os";
|
|
22472
|
+
import { join as join13 } from "node:path";
|
|
22425
22473
|
|
|
22426
22474
|
// src/acp/acp-options.ts
|
|
22427
22475
|
var text = (value) => typeof value === "string" && value ? value : void 0;
|
|
@@ -23004,9 +23052,9 @@ async function readSessionModels(row, clientVersion = "1") {
|
|
|
23004
23052
|
const discovery = row.modelDiscovery;
|
|
23005
23053
|
if (discovery.kind !== "session") throw new Error(`${row.agent} does not list its models in a session`);
|
|
23006
23054
|
const cli = requireCliSpec(row.agent);
|
|
23007
|
-
const folder = await mkdtemp(
|
|
23055
|
+
const folder = await mkdtemp(join13(tmpdir(), `toc-ocra-acp-models-${row.agent}-`));
|
|
23008
23056
|
try {
|
|
23009
|
-
const folderArgs = discovery.sessionFolderArgs?.(
|
|
23057
|
+
const folderArgs = discovery.sessionFolderArgs?.(join13(folder, "sessions")) ?? [];
|
|
23010
23058
|
const args = [...row.args({ access: "read-only", model: "", reasoningEffort: "" }), ...folderArgs];
|
|
23011
23059
|
const launch = launchCli({ spec: cli, args, env: { ...providerEnvironment(), ...row.env } });
|
|
23012
23060
|
const connection = await AcpConnection.open({ executable: launch.executable, args: launch.args, env: launch.env, cwd: folder }, {
|
|
@@ -23017,7 +23065,7 @@ async function readSessionModels(row, clientVersion = "1") {
|
|
|
23017
23065
|
stderr: () => void 0
|
|
23018
23066
|
}, clientVersion);
|
|
23019
23067
|
try {
|
|
23020
|
-
if (!connection.deleteSession && !folderArgs.length) throw new Error(`${cli.label} \u4E0D\u80FD\u5220\u9664\u4F1A\u8BDD\uFF0C\
|
|
23068
|
+
if (!connection.deleteSession && !folderArgs.length) throw new Error(`${cli.label} \u4E0D\u80FD\u5220\u9664\u4F1A\u8BDD\uFF0C\u4E0D\u8BFB\u53D6\u6A21\u578B\u5217\u8868\uFF0C\u4F7F\u7528 CLI \u81EA\u5DF1\u7684\u9ED8\u8BA4\u6A21\u578B`);
|
|
23021
23069
|
const state = await connection.newSession(folder);
|
|
23022
23070
|
if (connection.deleteSession) await connection.removeSession(state.sessionId).catch(() => void 0);
|
|
23023
23071
|
const listed = sessionModels(state, row.dialect);
|
|
@@ -23636,13 +23684,13 @@ function isWriterConflict(message) {
|
|
|
23636
23684
|
|
|
23637
23685
|
// src/providers/cli/claude.ts
|
|
23638
23686
|
import { readdirSync as readdirSync2, readFileSync as readFileSync6 } from "node:fs";
|
|
23639
|
-
import { homedir as
|
|
23640
|
-
import { join as
|
|
23687
|
+
import { homedir as homedir8 } from "node:os";
|
|
23688
|
+
import { join as join14 } from "node:path";
|
|
23641
23689
|
var CLAUDE = requireCliSpec("claude");
|
|
23642
23690
|
function claudeProjectRoots() {
|
|
23643
23691
|
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) =>
|
|
23692
|
+
const dirs = configured ? configured.split(process.platform === "win32" ? ";" : ":").map((entry) => entry.trim()).filter(Boolean) : [join14(homedir8(), ".claude")];
|
|
23693
|
+
return dirs.map((dir) => join14(dir, "projects"));
|
|
23646
23694
|
}
|
|
23647
23695
|
function claudeTranscriptExists(sessionId) {
|
|
23648
23696
|
return claudeTranscriptPath(sessionId) !== void 0;
|
|
@@ -23658,7 +23706,7 @@ function claudeTranscriptPath(sessionId) {
|
|
|
23658
23706
|
}
|
|
23659
23707
|
for (const project of projects) {
|
|
23660
23708
|
try {
|
|
23661
|
-
if (readdirSync2(
|
|
23709
|
+
if (readdirSync2(join14(root2, project)).includes(file2)) return join14(root2, project, file2);
|
|
23662
23710
|
} catch {
|
|
23663
23711
|
}
|
|
23664
23712
|
}
|
|
@@ -23702,7 +23750,7 @@ var claudeProvider = {
|
|
|
23702
23750
|
settings.disableAllHooks = true;
|
|
23703
23751
|
args.push("--restricted", "--permission-mode", "plan", "--tools", "Read,Glob,Grep", "--strict-mcp-config", "--mcp-config", '{"mcpServers":{}}', "--disallowedTools", "mcp__*");
|
|
23704
23752
|
try {
|
|
23705
|
-
const userSettings = JSON.parse(readFileSync6(
|
|
23753
|
+
const userSettings = JSON.parse(readFileSync6(join14(homedir8(), ".claude", "settings.json"), "utf8"));
|
|
23706
23754
|
for (const [key, value] of Object.entries(userSettings.env ?? {})) {
|
|
23707
23755
|
if (/^ANTHROPIC_[A-Z0-9_]+$/.test(key) && typeof value === "string" && env[key] === void 0) env[key] = value;
|
|
23708
23756
|
}
|
|
@@ -24611,7 +24659,7 @@ async function readCodexQuotaWindows() {
|
|
|
24611
24659
|
|
|
24612
24660
|
// src/providers/kiro-quota.ts
|
|
24613
24661
|
import { execFile as execFile5 } from "node:child_process";
|
|
24614
|
-
import { tmpdir as
|
|
24662
|
+
import { tmpdir as tmpdir2 } from "node:os";
|
|
24615
24663
|
import { promisify as promisify3, stripVTControlCharacters } from "node:util";
|
|
24616
24664
|
var execFileAsync3 = promisify3(execFile5);
|
|
24617
24665
|
var amount = (value) => Number(value.replace(/,/g, ""));
|
|
@@ -24673,7 +24721,7 @@ async function readKiroQuotaWindows() {
|
|
|
24673
24721
|
const launch = launchCli({ spec: requireCliSpec("kiro"), args: ["chat", "--no-interactive", "/usage"] });
|
|
24674
24722
|
await requireKiroAuthentication(launch.env);
|
|
24675
24723
|
try {
|
|
24676
|
-
const { stdout, stderr } = await execFileAsync3(launch.executable, launch.args, { env: launch.env, cwd:
|
|
24724
|
+
const { stdout, stderr } = await execFileAsync3(launch.executable, launch.args, { env: launch.env, cwd: tmpdir2(), timeout: 3e4, maxBuffer: 1024 * 1024, windowsHide: true });
|
|
24677
24725
|
return parseKiroQuota(`${stdout}
|
|
24678
24726
|
${stderr}`);
|
|
24679
24727
|
} catch (error62) {
|
|
@@ -24870,7 +24918,7 @@ var cliDetection = new CliDetectionService();
|
|
|
24870
24918
|
|
|
24871
24919
|
// src/runtime/agent-runtime.ts
|
|
24872
24920
|
import { randomUUID as randomUUID4 } from "node:crypto";
|
|
24873
|
-
import { join as
|
|
24921
|
+
import { join as join21 } from "node:path";
|
|
24874
24922
|
|
|
24875
24923
|
// src/exec/script-runner.ts
|
|
24876
24924
|
import { spawn as spawn10 } from "node:child_process";
|
|
@@ -25159,15 +25207,15 @@ async function readCLIQuotaReport(agentType) {
|
|
|
25159
25207
|
|
|
25160
25208
|
// src/providers/tb-switch-control.ts
|
|
25161
25209
|
import { readFile as readFile6 } from "node:fs/promises";
|
|
25162
|
-
import { homedir as
|
|
25163
|
-
import { join as
|
|
25210
|
+
import { homedir as homedir9 } from "node:os";
|
|
25211
|
+
import { join as join15 } from "node:path";
|
|
25164
25212
|
function dataDir() {
|
|
25165
|
-
return process.env.TB_SWITCH_HOME?.trim() ||
|
|
25213
|
+
return process.env.TB_SWITCH_HOME?.trim() || join15(homedir9(), ".tb-switch");
|
|
25166
25214
|
}
|
|
25167
25215
|
async function readLocalService() {
|
|
25168
25216
|
let discovery;
|
|
25169
25217
|
try {
|
|
25170
|
-
discovery = JSON.parse(await readFile6(
|
|
25218
|
+
discovery = JSON.parse(await readFile6(join15(dataDir(), "api.json"), "utf8"));
|
|
25171
25219
|
} catch {
|
|
25172
25220
|
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
25221
|
}
|
|
@@ -25183,7 +25231,7 @@ async function readLocalService() {
|
|
|
25183
25231
|
}
|
|
25184
25232
|
let token = process.env.TB_SWITCH_API_TOKEN?.trim() ?? "";
|
|
25185
25233
|
try {
|
|
25186
|
-
token = (await readFile6(
|
|
25234
|
+
token = (await readFile6(join15(dataDir(), "api-token"), "utf8")).trim();
|
|
25187
25235
|
} catch {
|
|
25188
25236
|
}
|
|
25189
25237
|
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 +25376,7 @@ function commandOf(pid) {
|
|
|
25328
25376
|
// src/runs/run-supervisor.ts
|
|
25329
25377
|
import { spawn as spawn12 } from "node:child_process";
|
|
25330
25378
|
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
|
|
25379
|
+
import { basename as basename3, isAbsolute as isAbsolute4, join as join19, relative as relative2, resolve as resolve5 } from "node:path";
|
|
25332
25380
|
import { createInterface as createInterface5 } from "node:readline";
|
|
25333
25381
|
|
|
25334
25382
|
// src/session/terminal-tail-buffer.ts
|
|
@@ -25690,19 +25738,19 @@ async function forkCodexThread(options) {
|
|
|
25690
25738
|
|
|
25691
25739
|
// src/runs/run-recorder.ts
|
|
25692
25740
|
import { appendFileSync as appendFileSync2, mkdirSync as mkdirSync3 } from "node:fs";
|
|
25693
|
-
import { homedir as
|
|
25694
|
-
import { join as
|
|
25741
|
+
import { homedir as homedir10 } from "node:os";
|
|
25742
|
+
import { join as join16 } from "node:path";
|
|
25695
25743
|
var RunRecorder = class _RunRecorder {
|
|
25696
25744
|
constructor(path) {
|
|
25697
25745
|
this.path = path;
|
|
25698
25746
|
}
|
|
25699
25747
|
path;
|
|
25700
|
-
home =
|
|
25748
|
+
home = homedir10();
|
|
25701
25749
|
static fromEnvironment(runId, meta3) {
|
|
25702
25750
|
const directory = process.env.TOC_OCRA_RECORD_DIR?.trim();
|
|
25703
25751
|
if (!directory) return void 0;
|
|
25704
25752
|
mkdirSync3(directory, { recursive: true });
|
|
25705
|
-
const recorder = new _RunRecorder(
|
|
25753
|
+
const recorder = new _RunRecorder(join16(directory, `${String(meta3.agent ?? "cli")}-${runId}.jsonl`));
|
|
25706
25754
|
recorder.write({ meta: meta3 });
|
|
25707
25755
|
return recorder;
|
|
25708
25756
|
}
|
|
@@ -25718,7 +25766,7 @@ var RunRecorder = class _RunRecorder {
|
|
|
25718
25766
|
|
|
25719
25767
|
// src/runs/run-transcript.ts
|
|
25720
25768
|
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
|
|
25769
|
+
import { join as join17 } from "node:path";
|
|
25722
25770
|
var MAX_TRANSCRIPT_ITEMS = 5e3;
|
|
25723
25771
|
var MAX_TRANSCRIPT_TEXT = 2e5;
|
|
25724
25772
|
var MAX_TRANSCRIPT_LINES = 2e4;
|
|
@@ -25983,7 +26031,7 @@ function transcriptFileName(runId) {
|
|
|
25983
26031
|
var TranscriptStore = class {
|
|
25984
26032
|
constructor(dataDir2, logger, env = process.env) {
|
|
25985
26033
|
this.logger = logger;
|
|
25986
|
-
this.directory = dataDir2 ?
|
|
26034
|
+
this.directory = dataDir2 ? join17(dataDir2, "transcripts") : "";
|
|
25987
26035
|
this.enabled = Boolean(dataDir2) && transcriptsOnDisk(env);
|
|
25988
26036
|
}
|
|
25989
26037
|
logger;
|
|
@@ -26038,7 +26086,7 @@ var TranscriptStore = class {
|
|
|
26038
26086
|
await this.writes.get(runId);
|
|
26039
26087
|
let text3;
|
|
26040
26088
|
try {
|
|
26041
|
-
text3 = await readFile8(
|
|
26089
|
+
text3 = await readFile8(join17(this.directory, name), "utf8");
|
|
26042
26090
|
} catch (error62) {
|
|
26043
26091
|
if (errorCode(error62) !== "ENOENT") this.logger.warn("run-transcript-read-failed", { runId, error: errorMessage(error62) });
|
|
26044
26092
|
return void 0;
|
|
@@ -26103,7 +26151,7 @@ var TranscriptStore = class {
|
|
|
26103
26151
|
transcript.dirty = false;
|
|
26104
26152
|
const body = JSON.stringify(transcript.toFile());
|
|
26105
26153
|
await this.ensureDirectory();
|
|
26106
|
-
const file2 =
|
|
26154
|
+
const file2 = join17(this.directory, name);
|
|
26107
26155
|
const temporary = `${file2}.${process.pid}.tmp`;
|
|
26108
26156
|
await writeFile6(temporary, body, { mode: 384 });
|
|
26109
26157
|
await rename6(temporary, file2);
|
|
@@ -26140,7 +26188,7 @@ var TranscriptStore = class {
|
|
|
26140
26188
|
const now = Date.now();
|
|
26141
26189
|
const files = [];
|
|
26142
26190
|
for (const name of names) {
|
|
26143
|
-
const path =
|
|
26191
|
+
const path = join17(this.directory, name);
|
|
26144
26192
|
if (name.endsWith(".tmp")) {
|
|
26145
26193
|
const info2 = await stat4(path).catch(() => void 0);
|
|
26146
26194
|
if (info2?.isFile() && now - info2.mtimeMs > STALE_TEMPORARY_MS) await unlink(path).catch(() => void 0);
|
|
@@ -26190,7 +26238,7 @@ function errorMessage(error62) {
|
|
|
26190
26238
|
import { createHash as createHash3, randomUUID as randomUUID2 } from "node:crypto";
|
|
26191
26239
|
import { constants as constants2 } from "node:fs";
|
|
26192
26240
|
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
|
|
26241
|
+
import { basename as basename2, isAbsolute as isAbsolute3, join as join18, relative } from "node:path";
|
|
26194
26242
|
function within(root2, path) {
|
|
26195
26243
|
const segment = relative(root2, path);
|
|
26196
26244
|
return segment === "" || !segment.startsWith("..") && !isAbsolute3(segment);
|
|
@@ -26198,7 +26246,7 @@ function within(root2, path) {
|
|
|
26198
26246
|
async function attachmentDirectory(workdir, messageId) {
|
|
26199
26247
|
let directory = workdir;
|
|
26200
26248
|
for (const segment of [".echo", "attachments", `message-${encodeURIComponent(messageId).slice(0, 180)}`]) {
|
|
26201
|
-
directory =
|
|
26249
|
+
directory = join18(directory, segment);
|
|
26202
26250
|
await mkdir7(directory, { mode: 448 }).catch((error62) => {
|
|
26203
26251
|
if (error62.code !== "EEXIST") throw error62;
|
|
26204
26252
|
});
|
|
@@ -26206,7 +26254,7 @@ async function attachmentDirectory(workdir, messageId) {
|
|
|
26206
26254
|
if (metadata.isSymbolicLink() || !metadata.isDirectory() || !within(workdir, await realpath(directory))) {
|
|
26207
26255
|
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
26256
|
}
|
|
26209
|
-
if (segment === ".echo") await writeFile7(
|
|
26257
|
+
if (segment === ".echo") await writeFile7(join18(directory, ".gitignore"), "*\n", { flag: "wx", mode: 384 }).catch((error62) => {
|
|
26210
26258
|
if (error62.code !== "EEXIST") throw error62;
|
|
26211
26259
|
});
|
|
26212
26260
|
}
|
|
@@ -26243,9 +26291,9 @@ async function prepareTaskAttachments(payload, workdir, download, signal2) {
|
|
|
26243
26291
|
const characters = Array.from(basename2(file2.name.replace(/\\/g, "/")).replace(/[^\p{L}\p{N}._-]/gu, "_").replace(/\.+$/u, ""));
|
|
26244
26292
|
while (Buffer.byteLength(characters.join("")) > 160) characters.shift();
|
|
26245
26293
|
const name = characters.join("") || "attachment";
|
|
26246
|
-
const path =
|
|
26294
|
+
const path = join18(directory, `${file2.file_id}-${name}`);
|
|
26247
26295
|
if (!await matches(path, file2.size, file2.sha256, signal2)) {
|
|
26248
|
-
const temporary =
|
|
26296
|
+
const temporary = join18(directory, `.download-${file2.file_id}-${randomUUID2()}.part`);
|
|
26249
26297
|
try {
|
|
26250
26298
|
await download(payload.run_id, file2.file_id, temporary, file2.size, file2.sha256, signal2);
|
|
26251
26299
|
signal2.throwIfAborted();
|
|
@@ -28126,12 +28174,12 @@ ${PLAN_MODE_PREFIX}` : payload.prompt;
|
|
|
28126
28174
|
async prepareChatAttachments(payload) {
|
|
28127
28175
|
if (!payload.attachments?.length) return [];
|
|
28128
28176
|
if (!this.reporter.chatMedia) throw new Error("\u9644\u4EF6\u8F6C\u53D1\u672A\u914D\u7F6E");
|
|
28129
|
-
const directory =
|
|
28177
|
+
const directory = join19(this.config.dataDir, "chat-media", encodeURIComponent(payload.chat_session_id ?? payload.run_id));
|
|
28130
28178
|
await mkdir8(directory, { recursive: true, mode: 448 });
|
|
28131
28179
|
const files = [];
|
|
28132
28180
|
for (const attachment of payload.attachments) {
|
|
28133
28181
|
const name = basename3(attachment.name).replace(/[^\p{L}\p{N}._-]/gu, "_").slice(-120) || "attachment";
|
|
28134
|
-
const path =
|
|
28182
|
+
const path = join19(directory, `${encodeURIComponent(attachment.media_id)}-${name}`);
|
|
28135
28183
|
const existing = await stat6(path).catch(() => void 0);
|
|
28136
28184
|
if (!existing?.isFile()) {
|
|
28137
28185
|
const data = await this.reporter.chatMedia(payload.run_id, attachment.media_id);
|
|
@@ -28286,6 +28334,12 @@ ${PLAN_MODE_PREFIX}` : payload.prompt;
|
|
|
28286
28334
|
} catch {
|
|
28287
28335
|
throw new Error(`\u5DE5\u4F5C\u76EE\u5F55\u4E0D\u5B58\u5728\uFF1A${input2}`);
|
|
28288
28336
|
}
|
|
28337
|
+
const lexicalCandidate = resolve5(isAbsolute4(input2) ? input2 : resolve5(input2));
|
|
28338
|
+
for (const root2 of this.config.allowedRoots) {
|
|
28339
|
+
const lexicalRoot = resolve5(root2);
|
|
28340
|
+
const lexicalSegment = relative2(lexicalRoot, lexicalCandidate);
|
|
28341
|
+
if (lexicalSegment === "" || !lexicalSegment.startsWith("..") && !isAbsolute4(lexicalSegment)) return candidate;
|
|
28342
|
+
}
|
|
28289
28343
|
for (const root2 of this.config.allowedRoots) {
|
|
28290
28344
|
const allowed = await realpath2(root2).catch(() => resolve5(root2));
|
|
28291
28345
|
const segment = relative2(allowed, candidate);
|
|
@@ -28439,11 +28493,11 @@ var GatewayClient = class {
|
|
|
28439
28493
|
|
|
28440
28494
|
// src/workspace/directory-browser.ts
|
|
28441
28495
|
import { readdir as readdir3, realpath as realpath3, stat as stat7 } from "node:fs/promises";
|
|
28442
|
-
import { homedir as
|
|
28496
|
+
import { homedir as homedir11 } from "node:os";
|
|
28443
28497
|
import { dirname as dirname8, parse as parse3, resolve as resolve6 } from "node:path";
|
|
28444
28498
|
var MAX_ENTRIES = 1e3;
|
|
28445
28499
|
async function listDirectory(requested, allowedRoots) {
|
|
28446
|
-
const raw = requested.trim().replace(/^~(?=$|[\\/])/,
|
|
28500
|
+
const raw = requested.trim().replace(/^~(?=$|[\\/])/, homedir11()) || homedir11();
|
|
28447
28501
|
const directory = await realpath3(resolve6(raw)).catch(() => {
|
|
28448
28502
|
throw new Error(`\u76EE\u5F55\u4E0D\u5B58\u5728\uFF1A${requested}`);
|
|
28449
28503
|
});
|
|
@@ -28461,8 +28515,8 @@ async function listDirectory(requested, allowedRoots) {
|
|
|
28461
28515
|
else if (entry.isFile()) files.push(item);
|
|
28462
28516
|
}
|
|
28463
28517
|
const parent = dirname8(directory);
|
|
28464
|
-
const places = [{ label: "\u4E3B\u76EE\u5F55", path:
|
|
28465
|
-
for (const root2 of allowedRoots) if (root2 !==
|
|
28518
|
+
const places = [{ label: "\u4E3B\u76EE\u5F55", path: homedir11() }];
|
|
28519
|
+
for (const root2 of allowedRoots) if (root2 !== homedir11()) places.push({ label: "\u5141\u8BB8\u7684\u76EE\u5F55", path: root2 });
|
|
28466
28520
|
places.push({ label: "\u6839\u76EE\u5F55", path: process.platform === "win32" ? parse3(directory).root : "/" });
|
|
28467
28521
|
return {
|
|
28468
28522
|
path: directory,
|
|
@@ -28477,8 +28531,8 @@ async function listDirectory(requested, allowedRoots) {
|
|
|
28477
28531
|
// src/workspace/workspace-manager.ts
|
|
28478
28532
|
import { spawn as spawn13 } from "node:child_process";
|
|
28479
28533
|
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
|
|
28534
|
+
import { homedir as homedir12, tmpdir as tmpdir3 } from "node:os";
|
|
28535
|
+
import { isAbsolute as isAbsolute5, join as join20, relative as relative3, resolve as resolve7 } from "node:path";
|
|
28482
28536
|
var MAX_NODES = 2e3;
|
|
28483
28537
|
var MAX_DIRECTORY_ENTRIES = 12e3;
|
|
28484
28538
|
var IGNORED_DIRECTORIES = /* @__PURE__ */ new Set([
|
|
@@ -28526,7 +28580,7 @@ var WorkspaceManager = class {
|
|
|
28526
28580
|
};
|
|
28527
28581
|
}
|
|
28528
28582
|
validateRootPath(value) {
|
|
28529
|
-
const raw = value.trim().replace(/^~(?=$|[\\/])/,
|
|
28583
|
+
const raw = value.trim().replace(/^~(?=$|[\\/])/, homedir12());
|
|
28530
28584
|
const root2 = resolve7(raw);
|
|
28531
28585
|
if (!isAbsolute5(raw)) throw new Error("\u6839\u76EE\u5F55\u5FC5\u987B\u662F\u7EDD\u5BF9\u8DEF\u5F84");
|
|
28532
28586
|
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 +28907,12 @@ var WorkspaceManager = class {
|
|
|
28853
28907
|
}
|
|
28854
28908
|
async createGitAuthEnvironment(auth) {
|
|
28855
28909
|
if (!auth) return void 0;
|
|
28856
|
-
const directory = await mkdtemp2(
|
|
28910
|
+
const directory = await mkdtemp2(join20(tmpdir3(), "toc-ocra-git-auth-"));
|
|
28857
28911
|
const isWindows = process.platform === "win32";
|
|
28858
|
-
const scriptPath =
|
|
28912
|
+
const scriptPath = join20(directory, isWindows ? "askpass.cmd" : "askpass.sh");
|
|
28859
28913
|
let script;
|
|
28860
28914
|
if (isWindows) {
|
|
28861
|
-
const helperPath =
|
|
28915
|
+
const helperPath = join20(directory, "askpass.cjs");
|
|
28862
28916
|
await writeFile9(
|
|
28863
28917
|
helperPath,
|
|
28864
28918
|
'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 +29123,7 @@ var AgentRuntime = class {
|
|
|
29069
29123
|
}
|
|
29070
29124
|
};
|
|
29071
29125
|
this.workspaces = new WorkspaceManager(config2, this.logger);
|
|
29072
|
-
this.orphans = new OrphanRegistry(
|
|
29126
|
+
this.orphans = new OrphanRegistry(join21(config2.dataDir, "active-runs.json"));
|
|
29073
29127
|
this.runs = new RunSupervisor(config2, this.logger, reporter, this.orphans);
|
|
29074
29128
|
}
|
|
29075
29129
|
config;
|
|
@@ -29840,7 +29894,7 @@ function preferSystemNode() {
|
|
|
29840
29894
|
const names = process.platform === "win32" ? ["node.exe"] : ["node"];
|
|
29841
29895
|
for (const directory of (process.env.PATH ?? "").split(delimiter5)) {
|
|
29842
29896
|
for (const name of names) {
|
|
29843
|
-
const candidate = directory &&
|
|
29897
|
+
const candidate = directory && join22(directory, name);
|
|
29844
29898
|
if (candidate && existsSync7(candidate)) {
|
|
29845
29899
|
process.env.TOC_OCRA_NODE_PATH = candidate;
|
|
29846
29900
|
return;
|