@cortexkit/aft 0.35.1 → 0.35.3
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/commands/doctor.d.ts +1 -1
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/index.js +330 -151
- package/package.json +2 -2
|
@@ -61,7 +61,7 @@ export interface BinaryCacheClearResult {
|
|
|
61
61
|
}
|
|
62
62
|
export declare function clearOldBinaries(): BinaryCacheClearResult;
|
|
63
63
|
export interface DoctorFixPlanItem {
|
|
64
|
-
kind: "plugin" | "binary" | "onnx" | "storage" | "schema";
|
|
64
|
+
kind: "plugin" | "plugin-update" | "binary" | "onnx" | "storage" | "schema";
|
|
65
65
|
message: string;
|
|
66
66
|
}
|
|
67
67
|
export declare function buildDoctorFixPlan(adapters: HarnessAdapter[], report: DiagnosticReport): DoctorFixPlanItem[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAG3D,OAAO,EAEL,KAAK,gBAAgB,EAKtB,MAAM,uBAAuB,CAAC;AAe/B,OAAO,EAAE,KAAK,WAAW,EAAkB,MAAM,qBAAqB,CAAC;AAOvE,MAAM,MAAM,iBAAiB,GAAG,cAAc,GAAG,WAAW,GAAG,cAAc,CAAC;AAE9E,eAAO,MAAM,2BAA2B,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,iBAAiB,CAAA;CAAE,EAapF,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,iBAAiB,EAAqB,CAAC;AAEhF,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,OAAO,CAAC;IACf,GAAG,EAAE,OAAO,CAAC;IACb,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,EAAE,OAAO,CAAC;IACf,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB;AAED,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE;QACZ,OAAO,EAAE,MAAM,CAAC;QAChB,UAAU,EAAE,MAAM,CAAC;QACnB,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,QAAQ,CAAC,EAAE;QACT,OAAO,EAAE,MAAM,CAAC;QAChB,UAAU,EAAE,MAAM,CAAC;QACnB,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,WAAW,CAAC,EAAE;QACZ,OAAO,EAAE,MAAM,CAAC;QAChB,UAAU,EAAE,MAAM,CAAC;QACnB,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;CACH;AAED,MAAM,WAAW,iBAAiB;IAChC,cAAc,CAAC,EAAE,MAAM,WAAW,CAAC;IACnC,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED,wBAAsB,SAAS,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,CAkHvE;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAOnE;AA4BD,wBAAsB,iBAAiB,CACrC,QAAQ,EAAE,cAAc,EAAE,EAC1B,OAAO,EAAE,SAAS,iBAAiB,EAAE,EACrC,OAAO,GAAE,iBAAsB,GAC9B,OAAO,CAAC,iBAAiB,CAAC,CAgD5B;AAED;;;;;;;;;;GAUG;AACH,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC1C,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED,wBAAgB,gBAAgB,IAAI,sBAAsB,CAsDzD;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,QAAQ,GAAG,eAAe,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,GAAG,QAAQ,CAAC;IAC5E,OAAO,EAAE,MAAM,CAAC;CACjB;AA0ID,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,cAAc,EAAE,EAC1B,MAAM,EAAE,gBAAgB,GACvB,iBAAiB,EAAE,CAsErB;AAED,wBAAgB,+BAA+B,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAIvE;AAED,wBAAgB,gCAAgC,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,CAK9F;AAwKD,wBAAgB,yBAAyB,CAAC,CAAC,EAAE,gBAAgB,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC,GAAG,MAAM,CAK1F;AAsGD,wBAAsB,gBAAgB,CAAC,QAAQ,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAIhF;AA4DD,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAG7D"}
|
package/dist/index.js
CHANGED
|
@@ -523,7 +523,6 @@ var init_bridge = __esm(() => {
|
|
|
523
523
|
if (!snapshot || typeof snapshot !== "object" || Array.isArray(snapshot))
|
|
524
524
|
return;
|
|
525
525
|
this.cachedStatus = snapshot;
|
|
526
|
-
this.logVia("Received status_changed push frame; cached AFT status snapshot");
|
|
527
526
|
for (const listener of this.statusListeners) {
|
|
528
527
|
this.deliverStatusSnapshot(listener, this.cachedStatus);
|
|
529
528
|
}
|
|
@@ -975,6 +974,122 @@ var init_migration = __esm(() => {
|
|
|
975
974
|
DEFAULT_TIMEOUT_MS = 30 * 60 * 1000;
|
|
976
975
|
});
|
|
977
976
|
|
|
977
|
+
// ../aft-bridge/dist/npm-resolver.js
|
|
978
|
+
import { readdirSync, statSync } from "node:fs";
|
|
979
|
+
import { homedir as homedir2 } from "node:os";
|
|
980
|
+
import { delimiter, dirname, isAbsolute, join as join2 } from "node:path";
|
|
981
|
+
function defaultDeps() {
|
|
982
|
+
return {
|
|
983
|
+
platform: process.platform,
|
|
984
|
+
env: process.env,
|
|
985
|
+
home: homedir2(),
|
|
986
|
+
execPath: process.execPath
|
|
987
|
+
};
|
|
988
|
+
}
|
|
989
|
+
function npmBinaryName(platform) {
|
|
990
|
+
return platform === "win32" ? "npm.cmd" : "npm";
|
|
991
|
+
}
|
|
992
|
+
function isFile(p) {
|
|
993
|
+
try {
|
|
994
|
+
return statSync(p).isFile();
|
|
995
|
+
} catch {
|
|
996
|
+
return false;
|
|
997
|
+
}
|
|
998
|
+
}
|
|
999
|
+
function npmFromPath(deps) {
|
|
1000
|
+
const name = npmBinaryName(deps.platform);
|
|
1001
|
+
const raw = deps.env.PATH ?? deps.env.Path ?? "";
|
|
1002
|
+
for (const entry of raw.split(delimiter)) {
|
|
1003
|
+
const dir = entry.trim().replace(/^"|"$/g, "");
|
|
1004
|
+
if (!dir || !isAbsolute(dir))
|
|
1005
|
+
continue;
|
|
1006
|
+
if (isFile(join2(dir, name)))
|
|
1007
|
+
return dir;
|
|
1008
|
+
}
|
|
1009
|
+
return null;
|
|
1010
|
+
}
|
|
1011
|
+
function npmAdjacentToNode(deps) {
|
|
1012
|
+
const dir = dirname(deps.execPath);
|
|
1013
|
+
return isFile(join2(dir, npmBinaryName(deps.platform))) ? dir : null;
|
|
1014
|
+
}
|
|
1015
|
+
function highestVersionedNodeBin(installsDir, name) {
|
|
1016
|
+
let entries;
|
|
1017
|
+
try {
|
|
1018
|
+
entries = readdirSync(installsDir);
|
|
1019
|
+
} catch {
|
|
1020
|
+
return null;
|
|
1021
|
+
}
|
|
1022
|
+
const candidates = entries.filter((v) => isFile(join2(installsDir, v, "bin", name))).sort((a, b) => compareVersionsDesc(a, b));
|
|
1023
|
+
return candidates.length > 0 ? join2(installsDir, candidates[0], "bin") : null;
|
|
1024
|
+
}
|
|
1025
|
+
function compareVersionsDesc(a, b) {
|
|
1026
|
+
const pa = a.replace(/^v/, "").split(".").map((n) => Number.parseInt(n, 10));
|
|
1027
|
+
const pb = b.replace(/^v/, "").split(".").map((n) => Number.parseInt(n, 10));
|
|
1028
|
+
for (let i = 0;i < Math.max(pa.length, pb.length); i++) {
|
|
1029
|
+
const na = Number.isFinite(pa[i]) ? pa[i] : -1;
|
|
1030
|
+
const nb = Number.isFinite(pb[i]) ? pb[i] : -1;
|
|
1031
|
+
if (na !== nb)
|
|
1032
|
+
return nb - na;
|
|
1033
|
+
}
|
|
1034
|
+
return b.localeCompare(a);
|
|
1035
|
+
}
|
|
1036
|
+
function wellKnownNpmDirs(deps) {
|
|
1037
|
+
const { platform, env, home } = deps;
|
|
1038
|
+
const name = npmBinaryName(platform);
|
|
1039
|
+
const dirs = [];
|
|
1040
|
+
const push = (dir) => {
|
|
1041
|
+
if (dir && !dirs.includes(dir))
|
|
1042
|
+
dirs.push(dir);
|
|
1043
|
+
};
|
|
1044
|
+
if (platform === "win32") {
|
|
1045
|
+
const programFiles = env.ProgramFiles || "C:\\Program Files";
|
|
1046
|
+
const appData = env.APPDATA;
|
|
1047
|
+
const localAppData = env.LOCALAPPDATA;
|
|
1048
|
+
push(join2(programFiles, "nodejs"));
|
|
1049
|
+
if (appData)
|
|
1050
|
+
push(join2(appData, "npm"));
|
|
1051
|
+
if (localAppData)
|
|
1052
|
+
push(join2(localAppData, "Volta", "bin"));
|
|
1053
|
+
if (env.NVM_SYMLINK)
|
|
1054
|
+
push(env.NVM_SYMLINK);
|
|
1055
|
+
} else {
|
|
1056
|
+
if (env.NVM_BIN)
|
|
1057
|
+
push(env.NVM_BIN);
|
|
1058
|
+
push(highestVersionedNodeBin(join2(home, ".nvm", "versions", "node"), name));
|
|
1059
|
+
push(highestVersionedNodeBin(join2(home, ".local", "share", "mise", "installs", "node"), name));
|
|
1060
|
+
push(highestVersionedNodeBin(join2(home, ".asdf", "installs", "nodejs"), name));
|
|
1061
|
+
push(join2(home, ".volta", "bin"));
|
|
1062
|
+
push(join2(home, ".asdf", "shims"));
|
|
1063
|
+
const systemDirs = deps.systemNpmDirs ?? (platform === "darwin" ? ["/opt/homebrew/bin", "/usr/local/bin"] : ["/usr/local/bin", "/usr/bin", join2(home, ".local", "bin")]);
|
|
1064
|
+
for (const dir of systemDirs)
|
|
1065
|
+
push(dir);
|
|
1066
|
+
}
|
|
1067
|
+
return dirs;
|
|
1068
|
+
}
|
|
1069
|
+
function resolveNpm(deps = defaultDeps()) {
|
|
1070
|
+
const name = npmBinaryName(deps.platform);
|
|
1071
|
+
const onPath = npmFromPath(deps);
|
|
1072
|
+
if (onPath)
|
|
1073
|
+
return { command: join2(onPath, name), binDir: onPath };
|
|
1074
|
+
const adjacent = npmAdjacentToNode(deps);
|
|
1075
|
+
if (adjacent)
|
|
1076
|
+
return { command: join2(adjacent, name), binDir: adjacent };
|
|
1077
|
+
for (const dir of wellKnownNpmDirs(deps)) {
|
|
1078
|
+
const candidate = join2(dir, name);
|
|
1079
|
+
if (isFile(candidate))
|
|
1080
|
+
return { command: candidate, binDir: dir };
|
|
1081
|
+
}
|
|
1082
|
+
return null;
|
|
1083
|
+
}
|
|
1084
|
+
function npmSpawnEnv(resolved, baseEnv = process.env) {
|
|
1085
|
+
if (!resolved.binDir)
|
|
1086
|
+
return { ...baseEnv };
|
|
1087
|
+
const existing = baseEnv.PATH ?? baseEnv.Path ?? "";
|
|
1088
|
+
const next = existing ? `${resolved.binDir}${delimiter}${existing}` : resolved.binDir;
|
|
1089
|
+
return { ...baseEnv, PATH: next };
|
|
1090
|
+
}
|
|
1091
|
+
var init_npm_resolver = () => {};
|
|
1092
|
+
|
|
978
1093
|
// ../aft-bridge/dist/onnx-runtime.js
|
|
979
1094
|
var ORT_VERSION = "1.24.4", MAX_DOWNLOAD_BYTES2, MAX_EXTRACT_BYTES, STALE_LOCK_MS, ORT_PLATFORM_MAP;
|
|
980
1095
|
var init_onnx_runtime = __esm(() => {
|
|
@@ -1206,6 +1321,7 @@ var init_dist = __esm(() => {
|
|
|
1206
1321
|
init_bridge();
|
|
1207
1322
|
init_downloader();
|
|
1208
1323
|
init_migration();
|
|
1324
|
+
init_npm_resolver();
|
|
1209
1325
|
init_onnx_runtime();
|
|
1210
1326
|
init_paths();
|
|
1211
1327
|
init_platform();
|
|
@@ -1214,65 +1330,65 @@ var init_dist = __esm(() => {
|
|
|
1214
1330
|
});
|
|
1215
1331
|
|
|
1216
1332
|
// src/lib/paths.ts
|
|
1217
|
-
import { homedir as
|
|
1218
|
-
import { join as
|
|
1333
|
+
import { homedir as homedir3, tmpdir } from "node:os";
|
|
1334
|
+
import { join as join3 } from "node:path";
|
|
1219
1335
|
function getAftBinaryCacheDir() {
|
|
1220
1336
|
if (process.env.AFT_CACHE_DIR) {
|
|
1221
|
-
return
|
|
1337
|
+
return join3(process.env.AFT_CACHE_DIR, "bin");
|
|
1222
1338
|
}
|
|
1223
1339
|
if (process.platform === "win32") {
|
|
1224
1340
|
const localAppData = process.env.LOCALAPPDATA || process.env.APPDATA;
|
|
1225
|
-
const base2 = localAppData ||
|
|
1226
|
-
return
|
|
1341
|
+
const base2 = localAppData || join3(homedir3(), "AppData", "Local");
|
|
1342
|
+
return join3(base2, "aft", "bin");
|
|
1227
1343
|
}
|
|
1228
|
-
const base = process.env.XDG_CACHE_HOME ||
|
|
1229
|
-
return
|
|
1344
|
+
const base = process.env.XDG_CACHE_HOME || join3(homedir3(), ".cache");
|
|
1345
|
+
return join3(base, "aft", "bin");
|
|
1230
1346
|
}
|
|
1231
1347
|
function getAftBinaryName() {
|
|
1232
1348
|
return process.platform === "win32" ? "aft.exe" : "aft";
|
|
1233
1349
|
}
|
|
1234
1350
|
function getAftLspPackagesDir() {
|
|
1235
1351
|
if (process.env.AFT_CACHE_DIR) {
|
|
1236
|
-
return
|
|
1352
|
+
return join3(process.env.AFT_CACHE_DIR, "lsp-packages");
|
|
1237
1353
|
}
|
|
1238
1354
|
if (process.platform === "win32") {
|
|
1239
1355
|
const localAppData = process.env.LOCALAPPDATA || process.env.APPDATA;
|
|
1240
|
-
const base2 = localAppData ||
|
|
1241
|
-
return
|
|
1356
|
+
const base2 = localAppData || join3(homedir3(), "AppData", "Local");
|
|
1357
|
+
return join3(base2, "aft", "lsp-packages");
|
|
1242
1358
|
}
|
|
1243
|
-
const base = process.env.XDG_CACHE_HOME ||
|
|
1244
|
-
return
|
|
1359
|
+
const base = process.env.XDG_CACHE_HOME || join3(homedir3(), ".cache");
|
|
1360
|
+
return join3(base, "aft", "lsp-packages");
|
|
1245
1361
|
}
|
|
1246
1362
|
function getAftLspBinariesDir() {
|
|
1247
1363
|
if (process.env.AFT_CACHE_DIR) {
|
|
1248
|
-
return
|
|
1364
|
+
return join3(process.env.AFT_CACHE_DIR, "lsp-binaries");
|
|
1249
1365
|
}
|
|
1250
1366
|
if (process.platform === "win32") {
|
|
1251
1367
|
const localAppData = process.env.LOCALAPPDATA || process.env.APPDATA;
|
|
1252
|
-
const base2 = localAppData ||
|
|
1253
|
-
return
|
|
1368
|
+
const base2 = localAppData || join3(homedir3(), "AppData", "Local");
|
|
1369
|
+
return join3(base2, "aft", "lsp-binaries");
|
|
1254
1370
|
}
|
|
1255
|
-
const base = process.env.XDG_CACHE_HOME ||
|
|
1256
|
-
return
|
|
1371
|
+
const base = process.env.XDG_CACHE_HOME || join3(homedir3(), ".cache");
|
|
1372
|
+
return join3(base, "aft", "lsp-binaries");
|
|
1257
1373
|
}
|
|
1258
1374
|
function homeDir() {
|
|
1259
1375
|
if (process.platform === "win32")
|
|
1260
|
-
return process.env.USERPROFILE || process.env.HOME ||
|
|
1261
|
-
return process.env.HOME ||
|
|
1376
|
+
return process.env.USERPROFILE || process.env.HOME || homedir3();
|
|
1377
|
+
return process.env.HOME || homedir3();
|
|
1262
1378
|
}
|
|
1263
1379
|
function dataHome() {
|
|
1264
1380
|
if (process.env.XDG_DATA_HOME)
|
|
1265
1381
|
return process.env.XDG_DATA_HOME;
|
|
1266
1382
|
if (process.platform === "win32") {
|
|
1267
|
-
return process.env.LOCALAPPDATA || process.env.APPDATA ||
|
|
1383
|
+
return process.env.LOCALAPPDATA || process.env.APPDATA || join3(homeDir(), "AppData", "Local");
|
|
1268
1384
|
}
|
|
1269
|
-
return
|
|
1385
|
+
return join3(homeDir(), ".local", "share");
|
|
1270
1386
|
}
|
|
1271
1387
|
function getCortexKitStorageRoot() {
|
|
1272
|
-
return
|
|
1388
|
+
return join3(dataHome(), "cortexkit", "aft");
|
|
1273
1389
|
}
|
|
1274
1390
|
function getTmpLogPath(filename) {
|
|
1275
|
-
return
|
|
1391
|
+
return join3(tmpdir(), filename);
|
|
1276
1392
|
}
|
|
1277
1393
|
var init_paths2 = () => {};
|
|
1278
1394
|
|
|
@@ -1280,8 +1396,8 @@ var init_paths2 = () => {};
|
|
|
1280
1396
|
import { execSync, spawnSync } from "node:child_process";
|
|
1281
1397
|
import { existsSync as existsSync2 } from "node:fs";
|
|
1282
1398
|
import { createRequire } from "node:module";
|
|
1283
|
-
import { homedir as
|
|
1284
|
-
import { join as
|
|
1399
|
+
import { homedir as homedir4 } from "node:os";
|
|
1400
|
+
import { join as join4 } from "node:path";
|
|
1285
1401
|
async function loadPluginVersion() {
|
|
1286
1402
|
try {
|
|
1287
1403
|
const bridgePackageName = "@cortexkit/aft-bridge";
|
|
@@ -1404,7 +1520,7 @@ function aftBinaryCandidates(preferredVersion) {
|
|
|
1404
1520
|
const candidates = [];
|
|
1405
1521
|
if (preferredVersion) {
|
|
1406
1522
|
const tag = preferredVersion.startsWith("v") ? preferredVersion : `v${preferredVersion}`;
|
|
1407
|
-
pushCandidate(candidates,
|
|
1523
|
+
pushCandidate(candidates, join4(getAftBinaryCacheDir(), tag, getAftBinaryName()));
|
|
1408
1524
|
}
|
|
1409
1525
|
const key = platformKey2();
|
|
1410
1526
|
if (key) {
|
|
@@ -1427,7 +1543,7 @@ function aftBinaryCandidates(preferredVersion) {
|
|
|
1427
1543
|
}
|
|
1428
1544
|
}
|
|
1429
1545
|
} catch {}
|
|
1430
|
-
pushCandidate(candidates,
|
|
1546
|
+
pushCandidate(candidates, join4(homedir4(), ".cargo", "bin", getAftBinaryName()));
|
|
1431
1547
|
return candidates;
|
|
1432
1548
|
}
|
|
1433
1549
|
function findAftBinary(preferredVersion) {
|
|
@@ -1442,13 +1558,13 @@ var init_binary_probe = __esm(async () => {
|
|
|
1442
1558
|
});
|
|
1443
1559
|
|
|
1444
1560
|
// src/lib/fs-util.ts
|
|
1445
|
-
import { existsSync as existsSync3, readdirSync, statSync } from "node:fs";
|
|
1446
|
-
import { join as
|
|
1561
|
+
import { existsSync as existsSync3, readdirSync as readdirSync2, statSync as statSync2 } from "node:fs";
|
|
1562
|
+
import { join as join5 } from "node:path";
|
|
1447
1563
|
function dirSize(path) {
|
|
1448
1564
|
if (!existsSync3(path)) {
|
|
1449
1565
|
return 0;
|
|
1450
1566
|
}
|
|
1451
|
-
const stat =
|
|
1567
|
+
const stat = statSync2(path);
|
|
1452
1568
|
if (stat.isFile()) {
|
|
1453
1569
|
return stat.size;
|
|
1454
1570
|
}
|
|
@@ -1456,8 +1572,8 @@ function dirSize(path) {
|
|
|
1456
1572
|
return 0;
|
|
1457
1573
|
}
|
|
1458
1574
|
let total = 0;
|
|
1459
|
-
for (const entry of
|
|
1460
|
-
total += dirSize(
|
|
1575
|
+
for (const entry of readdirSync2(path)) {
|
|
1576
|
+
total += dirSize(join5(path, entry));
|
|
1461
1577
|
}
|
|
1462
1578
|
return total;
|
|
1463
1579
|
}
|
|
@@ -9065,9 +9181,9 @@ var require_stringify = __commonJS((exports, module) => {
|
|
|
9065
9181
|
if (line_breaks_before === null) {
|
|
9066
9182
|
line_breaks_before = inline ? 0 : 1;
|
|
9067
9183
|
}
|
|
9068
|
-
const
|
|
9184
|
+
const delimiter2 = line_breaks_before > 0 ? repeat_line_breaks(line_breaks_before, deeper_gap) : inline ? SPACE : i === 0 ? EMPTY : LF + deeper_gap;
|
|
9069
9185
|
const is_line_comment = type === "LineComment";
|
|
9070
|
-
str +=
|
|
9186
|
+
str += delimiter2 + comment_stringify(value, is_line_comment);
|
|
9071
9187
|
last_comment = comment;
|
|
9072
9188
|
});
|
|
9073
9189
|
const default_line_breaks_after = display_block || last_comment.type === "LineComment" ? 1 : 0;
|
|
@@ -9080,10 +9196,10 @@ var require_stringify = __commonJS((exports, module) => {
|
|
|
9080
9196
|
replacer = null;
|
|
9081
9197
|
indent = EMPTY;
|
|
9082
9198
|
};
|
|
9083
|
-
var
|
|
9199
|
+
var join6 = (one, two, gap) => one ? two ? one + two.trim() + LF + gap : one.trimRight() + repeat_line_breaks(Math.max(1, count_trailing_line_breaks(one, gap)), gap) : two ? two.trimRight() + repeat_line_breaks(Math.max(1, count_trailing_line_breaks(two, gap)), gap) : EMPTY;
|
|
9084
9200
|
var join_content = (inside, value, gap) => {
|
|
9085
9201
|
const comment = process_comments(value, PREFIX_BEFORE, gap + indent, true);
|
|
9086
|
-
return
|
|
9202
|
+
return join6(comment, inside, gap);
|
|
9087
9203
|
};
|
|
9088
9204
|
var stringify_string = (holder, key, value) => {
|
|
9089
9205
|
const raw = get_raw_string_literal(holder, key);
|
|
@@ -9105,13 +9221,13 @@ var require_stringify = __commonJS((exports, module) => {
|
|
|
9105
9221
|
if (i !== 0) {
|
|
9106
9222
|
inside += COMMA;
|
|
9107
9223
|
}
|
|
9108
|
-
const before =
|
|
9224
|
+
const before = join6(after_comma, process_comments(value, BEFORE(i), deeper_gap), deeper_gap);
|
|
9109
9225
|
inside += before || LF + deeper_gap;
|
|
9110
9226
|
inside += stringify(i, value, deeper_gap) || STR_NULL;
|
|
9111
9227
|
inside += process_comments(value, AFTER_VALUE(i), deeper_gap);
|
|
9112
9228
|
after_comma = process_comments(value, AFTER(i), deeper_gap);
|
|
9113
9229
|
}
|
|
9114
|
-
inside +=
|
|
9230
|
+
inside += join6(after_comma, process_comments(value, PREFIX_AFTER, deeper_gap), deeper_gap);
|
|
9115
9231
|
return BRACKET_OPEN + join_content(inside, value, gap) + BRACKET_CLOSE;
|
|
9116
9232
|
};
|
|
9117
9233
|
var object_stringify = (value, gap) => {
|
|
@@ -9132,13 +9248,13 @@ var require_stringify = __commonJS((exports, module) => {
|
|
|
9132
9248
|
inside += COMMA;
|
|
9133
9249
|
}
|
|
9134
9250
|
first = false;
|
|
9135
|
-
const before =
|
|
9251
|
+
const before = join6(after_comma, process_comments(value, BEFORE(key), deeper_gap), deeper_gap);
|
|
9136
9252
|
inside += before || LF + deeper_gap;
|
|
9137
9253
|
inside += quote(key) + process_comments(value, AFTER_PROP(key), deeper_gap) + COLON + process_comments(value, AFTER_COLON(key), deeper_gap) + SPACE + sv + process_comments(value, AFTER_VALUE(key), deeper_gap);
|
|
9138
9254
|
after_comma = process_comments(value, AFTER(key), deeper_gap);
|
|
9139
9255
|
};
|
|
9140
9256
|
keys.forEach(iteratee);
|
|
9141
|
-
inside +=
|
|
9257
|
+
inside += join6(after_comma, process_comments(value, PREFIX_AFTER, deeper_gap), deeper_gap);
|
|
9142
9258
|
return CURLY_BRACKET_OPEN + join_content(inside, value, gap) + CURLY_BRACKET_CLOSE;
|
|
9143
9259
|
};
|
|
9144
9260
|
function stringify(key, holder, gap) {
|
|
@@ -9232,7 +9348,7 @@ var require_src2 = __commonJS((exports, module) => {
|
|
|
9232
9348
|
|
|
9233
9349
|
// src/lib/jsonc.ts
|
|
9234
9350
|
import { existsSync as existsSync4, mkdirSync as mkdirSync2, readFileSync, writeFileSync } from "node:fs";
|
|
9235
|
-
import { dirname } from "node:path";
|
|
9351
|
+
import { dirname as dirname2 } from "node:path";
|
|
9236
9352
|
function detectJsoncFile(configDir, baseName) {
|
|
9237
9353
|
const jsoncPath = `${configDir}/${baseName}.jsonc`;
|
|
9238
9354
|
const jsonPath = `${configDir}/${baseName}.json`;
|
|
@@ -9260,7 +9376,7 @@ function readJsoncFile(path) {
|
|
|
9260
9376
|
}
|
|
9261
9377
|
}
|
|
9262
9378
|
function writeJsoncFile(path, value, format = "json") {
|
|
9263
|
-
mkdirSync2(
|
|
9379
|
+
mkdirSync2(dirname2(path), { recursive: true });
|
|
9264
9380
|
const serialized = format === "jsonc" ? import_comment_json.stringify(value, null, 2) : JSON.stringify(value, null, 2);
|
|
9265
9381
|
writeFileSync(path, `${serialized}
|
|
9266
9382
|
`);
|
|
@@ -9319,26 +9435,26 @@ var init_self_version = () => {};
|
|
|
9319
9435
|
|
|
9320
9436
|
// src/adapters/opencode.ts
|
|
9321
9437
|
import { execSync as execSync2 } from "node:child_process";
|
|
9322
|
-
import { existsSync as existsSync5, readFileSync as readFileSync2, rmSync, statSync as
|
|
9323
|
-
import { homedir as
|
|
9324
|
-
import { dirname as
|
|
9438
|
+
import { existsSync as existsSync5, readFileSync as readFileSync2, rmSync, statSync as statSync3 } from "node:fs";
|
|
9439
|
+
import { homedir as homedir5 } from "node:os";
|
|
9440
|
+
import { dirname as dirname3, join as join6, parse, resolve } from "node:path";
|
|
9325
9441
|
import { fileURLToPath } from "node:url";
|
|
9326
9442
|
function getOpenCodeConfigDir() {
|
|
9327
9443
|
const envDir = process.env.OPENCODE_CONFIG_DIR?.trim();
|
|
9328
9444
|
if (envDir)
|
|
9329
9445
|
return resolve(envDir);
|
|
9330
|
-
const xdg = process.env.XDG_CONFIG_HOME ||
|
|
9331
|
-
return
|
|
9446
|
+
const xdg = process.env.XDG_CONFIG_HOME || join6(homedir5(), ".config");
|
|
9447
|
+
return join6(xdg, "opencode");
|
|
9332
9448
|
}
|
|
9333
9449
|
function getOpenCodeCacheDir() {
|
|
9334
9450
|
const xdg = process.env.XDG_CACHE_HOME;
|
|
9335
9451
|
if (xdg)
|
|
9336
|
-
return
|
|
9452
|
+
return join6(xdg, "opencode");
|
|
9337
9453
|
if (process.platform === "win32") {
|
|
9338
|
-
const localAppData = process.env.LOCALAPPDATA ??
|
|
9339
|
-
return
|
|
9454
|
+
const localAppData = process.env.LOCALAPPDATA ?? join6(homedir5(), "AppData", "Local");
|
|
9455
|
+
return join6(localAppData, "opencode");
|
|
9340
9456
|
}
|
|
9341
|
-
return
|
|
9457
|
+
return join6(homedir5(), ".cache", "opencode");
|
|
9342
9458
|
}
|
|
9343
9459
|
function hasOpenCodeCli() {
|
|
9344
9460
|
try {
|
|
@@ -9351,12 +9467,12 @@ function hasOpenCodeCli() {
|
|
|
9351
9467
|
function openCodeDesktopAppExists() {
|
|
9352
9468
|
const candidates = [];
|
|
9353
9469
|
if (process.platform === "darwin") {
|
|
9354
|
-
candidates.push("/Applications/OpenCode.app", "/Applications/OpenCode Beta.app",
|
|
9470
|
+
candidates.push("/Applications/OpenCode.app", "/Applications/OpenCode Beta.app", join6(homedir5(), "Applications", "OpenCode.app"), join6(homedir5(), "Applications", "OpenCode Beta.app"));
|
|
9355
9471
|
} else if (process.platform === "win32") {
|
|
9356
|
-
const localAppData = process.env.LOCALAPPDATA ??
|
|
9357
|
-
candidates.push(
|
|
9472
|
+
const localAppData = process.env.LOCALAPPDATA ?? join6(homedir5(), "AppData", "Local");
|
|
9473
|
+
candidates.push(join6(localAppData, "Programs", "opencode"), join6(localAppData, "opencode"));
|
|
9358
9474
|
} else {
|
|
9359
|
-
candidates.push("/opt/OpenCode", "/usr/lib/opencode",
|
|
9475
|
+
candidates.push("/opt/OpenCode", "/usr/lib/opencode", join6(homedir5(), ".local", "share", "applications", "opencode.desktop"));
|
|
9360
9476
|
}
|
|
9361
9477
|
return candidates.some((p) => {
|
|
9362
9478
|
try {
|
|
@@ -9385,15 +9501,15 @@ function pathPointsToOurPlugin(entry) {
|
|
|
9385
9501
|
try {
|
|
9386
9502
|
if (!existsSync5(fsPath))
|
|
9387
9503
|
return false;
|
|
9388
|
-
let searchDir =
|
|
9504
|
+
let searchDir = statSync3(fsPath).isDirectory() ? fsPath : dirname3(fsPath);
|
|
9389
9505
|
let pkgJsonPath = null;
|
|
9390
9506
|
while (true) {
|
|
9391
|
-
const candidate =
|
|
9507
|
+
const candidate = join6(searchDir, "package.json");
|
|
9392
9508
|
if (existsSync5(candidate)) {
|
|
9393
9509
|
pkgJsonPath = candidate;
|
|
9394
9510
|
break;
|
|
9395
9511
|
}
|
|
9396
|
-
const parent =
|
|
9512
|
+
const parent = dirname3(searchDir);
|
|
9397
9513
|
if (parent === searchDir || searchDir === parse(searchDir).root)
|
|
9398
9514
|
break;
|
|
9399
9515
|
searchDir = parent;
|
|
@@ -9501,10 +9617,10 @@ class OpenCodeAdapter {
|
|
|
9501
9617
|
};
|
|
9502
9618
|
}
|
|
9503
9619
|
getPluginCacheInfo() {
|
|
9504
|
-
const path =
|
|
9620
|
+
const path = join6(getOpenCodeCacheDir(), "packages", PLUGIN_ENTRY);
|
|
9505
9621
|
let cached;
|
|
9506
9622
|
try {
|
|
9507
|
-
const installedPkgPath =
|
|
9623
|
+
const installedPkgPath = join6(path, "node_modules", "@cortexkit", "aft-opencode", "package.json");
|
|
9508
9624
|
if (existsSync5(installedPkgPath)) {
|
|
9509
9625
|
const pkg = JSON.parse(readFileSync2(installedPkgPath, "utf-8"));
|
|
9510
9626
|
cached = typeof pkg.version === "string" ? pkg.version : undefined;
|
|
@@ -9565,11 +9681,11 @@ class OpenCodeAdapter {
|
|
|
9565
9681
|
describeStorageSubtrees() {
|
|
9566
9682
|
const storage = this.getStorageDir();
|
|
9567
9683
|
return {
|
|
9568
|
-
index: dirSize(
|
|
9569
|
-
semantic: dirSize(
|
|
9570
|
-
backups: dirSize(
|
|
9571
|
-
url_cache: dirSize(
|
|
9572
|
-
onnxruntime: dirSize(
|
|
9684
|
+
index: dirSize(join6(storage, "index")),
|
|
9685
|
+
semantic: dirSize(join6(storage, "semantic")),
|
|
9686
|
+
backups: dirSize(join6(storage, "backups")),
|
|
9687
|
+
url_cache: dirSize(join6(storage, "url_cache")),
|
|
9688
|
+
onnxruntime: dirSize(join6(storage, "onnxruntime"))
|
|
9573
9689
|
};
|
|
9574
9690
|
}
|
|
9575
9691
|
}
|
|
@@ -9585,15 +9701,15 @@ var init_opencode = __esm(() => {
|
|
|
9585
9701
|
// src/adapters/pi.ts
|
|
9586
9702
|
import { execSync as execSync3, spawnSync as spawnSync2 } from "node:child_process";
|
|
9587
9703
|
import { existsSync as existsSync6, readFileSync as readFileSync3 } from "node:fs";
|
|
9588
|
-
import { homedir as
|
|
9589
|
-
import { join as
|
|
9704
|
+
import { homedir as homedir6 } from "node:os";
|
|
9705
|
+
import { join as join7 } from "node:path";
|
|
9590
9706
|
function getPiAgentDir() {
|
|
9591
9707
|
const envHome = process.platform === "win32" ? process.env.USERPROFILE : process.env.HOME;
|
|
9592
|
-
const home = envHome && envHome.length > 0 ? envHome :
|
|
9593
|
-
return
|
|
9708
|
+
const home = envHome && envHome.length > 0 ? envHome : homedir6();
|
|
9709
|
+
return join7(home, ".pi", "agent");
|
|
9594
9710
|
}
|
|
9595
9711
|
function readPiExtensionIndex() {
|
|
9596
|
-
const settingsPath =
|
|
9712
|
+
const settingsPath = join7(getPiAgentDir(), "settings.json");
|
|
9597
9713
|
if (existsSync6(settingsPath)) {
|
|
9598
9714
|
try {
|
|
9599
9715
|
const raw = readFileSync3(settingsPath, "utf-8");
|
|
@@ -9607,10 +9723,10 @@ function readPiExtensionIndex() {
|
|
|
9607
9723
|
} catch {}
|
|
9608
9724
|
}
|
|
9609
9725
|
const candidates = [
|
|
9610
|
-
|
|
9611
|
-
|
|
9612
|
-
|
|
9613
|
-
|
|
9726
|
+
join7(getPiAgentDir(), "extensions.json"),
|
|
9727
|
+
join7(getPiAgentDir(), "extensions.jsonc"),
|
|
9728
|
+
join7(getPiAgentDir(), "config.json"),
|
|
9729
|
+
join7(getPiAgentDir(), "config.jsonc")
|
|
9614
9730
|
];
|
|
9615
9731
|
for (const path of candidates) {
|
|
9616
9732
|
if (!existsSync6(path))
|
|
@@ -9646,14 +9762,14 @@ function piEntryMatchesAft(entry) {
|
|
|
9646
9762
|
} else if (entry.startsWith("/")) {
|
|
9647
9763
|
resolved = entry;
|
|
9648
9764
|
} else if (entry.length > 0) {
|
|
9649
|
-
resolved =
|
|
9765
|
+
resolved = join7(getPiAgentDir(), entry);
|
|
9650
9766
|
}
|
|
9651
9767
|
if (!resolved)
|
|
9652
9768
|
return false;
|
|
9653
9769
|
try {
|
|
9654
9770
|
if (!existsSync6(resolved))
|
|
9655
9771
|
return false;
|
|
9656
|
-
const pkgPath =
|
|
9772
|
+
const pkgPath = join7(resolved, "package.json");
|
|
9657
9773
|
if (!existsSync6(pkgPath))
|
|
9658
9774
|
return false;
|
|
9659
9775
|
const pkg = JSON.parse(readFileSync3(pkgPath, "utf-8"));
|
|
@@ -9704,7 +9820,7 @@ class PiAdapter {
|
|
|
9704
9820
|
const aft = detectJsoncFile(configDir, "aft");
|
|
9705
9821
|
return {
|
|
9706
9822
|
configDir,
|
|
9707
|
-
harnessConfig: index.path ??
|
|
9823
|
+
harnessConfig: index.path ?? join7(configDir, "extensions.json"),
|
|
9708
9824
|
harnessConfigFormat: index.path ? "json" : "none",
|
|
9709
9825
|
aftConfig: aft.path,
|
|
9710
9826
|
aftConfigFormat: aft.format
|
|
@@ -9749,8 +9865,8 @@ class PiAdapter {
|
|
|
9749
9865
|
}
|
|
9750
9866
|
getPluginCacheInfo() {
|
|
9751
9867
|
const candidates = [
|
|
9752
|
-
|
|
9753
|
-
|
|
9868
|
+
join7(getPiAgentDir(), "node_modules", "@cortexkit", "aft-pi", "package.json"),
|
|
9869
|
+
join7(getPiAgentDir(), "extensions", "node_modules", "@cortexkit", "aft-pi", "package.json")
|
|
9754
9870
|
];
|
|
9755
9871
|
for (const candidate of candidates) {
|
|
9756
9872
|
if (!existsSync6(candidate))
|
|
@@ -9767,7 +9883,7 @@ class PiAdapter {
|
|
|
9767
9883
|
} catch {}
|
|
9768
9884
|
}
|
|
9769
9885
|
return {
|
|
9770
|
-
path:
|
|
9886
|
+
path: join7(getPiAgentDir(), "extensions"),
|
|
9771
9887
|
exists: false
|
|
9772
9888
|
};
|
|
9773
9889
|
}
|
|
@@ -9789,11 +9905,11 @@ class PiAdapter {
|
|
|
9789
9905
|
describeStorageSubtrees() {
|
|
9790
9906
|
const storage = this.getStorageDir();
|
|
9791
9907
|
return {
|
|
9792
|
-
index: dirSize(
|
|
9793
|
-
semantic: dirSize(
|
|
9794
|
-
backups: dirSize(
|
|
9795
|
-
url_cache: dirSize(
|
|
9796
|
-
onnxruntime: dirSize(
|
|
9908
|
+
index: dirSize(join7(storage, "index")),
|
|
9909
|
+
semantic: dirSize(join7(storage, "semantic")),
|
|
9910
|
+
backups: dirSize(join7(storage, "backups")),
|
|
9911
|
+
url_cache: dirSize(join7(storage, "url_cache")),
|
|
9912
|
+
onnxruntime: dirSize(join7(storage, "onnxruntime"))
|
|
9797
9913
|
};
|
|
9798
9914
|
}
|
|
9799
9915
|
}
|
|
@@ -11522,23 +11638,23 @@ __export(exports_lsp, {
|
|
|
11522
11638
|
printLspDoctorHelp: () => printLspDoctorHelp,
|
|
11523
11639
|
findProjectRootForFile: () => findProjectRootForFile
|
|
11524
11640
|
});
|
|
11525
|
-
import { existsSync as existsSync7, readdirSync as
|
|
11526
|
-
import { dirname as
|
|
11641
|
+
import { existsSync as existsSync7, readdirSync as readdirSync3, statSync as statSync4 } from "node:fs";
|
|
11642
|
+
import { dirname as dirname4, join as join8, resolve as resolve2 } from "node:path";
|
|
11527
11643
|
function findProjectRootForFile(filePath, fallbackCwd = process.cwd()) {
|
|
11528
11644
|
const resolvedFile = resolve2(fallbackCwd, filePath);
|
|
11529
|
-
let dir =
|
|
11645
|
+
let dir = dirname4(resolvedFile);
|
|
11530
11646
|
try {
|
|
11531
|
-
if (existsSync7(resolvedFile) &&
|
|
11647
|
+
if (existsSync7(resolvedFile) && statSync4(resolvedFile).isDirectory()) {
|
|
11532
11648
|
dir = resolvedFile;
|
|
11533
11649
|
}
|
|
11534
11650
|
} catch {
|
|
11535
|
-
dir =
|
|
11651
|
+
dir = dirname4(resolvedFile);
|
|
11536
11652
|
}
|
|
11537
11653
|
while (true) {
|
|
11538
|
-
if (PROJECT_ROOT_MARKERS.some((marker) => existsSync7(
|
|
11654
|
+
if (PROJECT_ROOT_MARKERS.some((marker) => existsSync7(join8(dir, marker)))) {
|
|
11539
11655
|
return dir;
|
|
11540
11656
|
}
|
|
11541
|
-
const parent =
|
|
11657
|
+
const parent = dirname4(dir);
|
|
11542
11658
|
if (parent === dir)
|
|
11543
11659
|
return resolve2(fallbackCwd);
|
|
11544
11660
|
dir = parent;
|
|
@@ -11673,8 +11789,8 @@ function buildConfigureParams(adapter, projectRoot) {
|
|
|
11673
11789
|
}
|
|
11674
11790
|
function readProjectConfig(kind, projectRoot) {
|
|
11675
11791
|
const dir = kind === "pi" ? ".pi" : ".opencode";
|
|
11676
|
-
const jsonc =
|
|
11677
|
-
const json =
|
|
11792
|
+
const jsonc = join8(projectRoot, dir, "aft.jsonc");
|
|
11793
|
+
const json = join8(projectRoot, dir, "aft.json");
|
|
11678
11794
|
if (existsSync7(jsonc))
|
|
11679
11795
|
return readJsoncFile(jsonc).value ?? {};
|
|
11680
11796
|
if (existsSync7(json))
|
|
@@ -11740,10 +11856,10 @@ function resolveCustomServers(servers) {
|
|
|
11740
11856
|
function inferLspPathsExtra(_lsp) {
|
|
11741
11857
|
const paths = new Set;
|
|
11742
11858
|
for (const entry of childDirs(getAftLspPackagesDir())) {
|
|
11743
|
-
paths.add(
|
|
11859
|
+
paths.add(join8(entry, "node_modules", ".bin"));
|
|
11744
11860
|
}
|
|
11745
11861
|
for (const entry of childDirs(getAftLspBinariesDir())) {
|
|
11746
|
-
paths.add(
|
|
11862
|
+
paths.add(join8(entry, "bin"));
|
|
11747
11863
|
}
|
|
11748
11864
|
return [...paths];
|
|
11749
11865
|
}
|
|
@@ -11751,9 +11867,9 @@ function childDirs(path) {
|
|
|
11751
11867
|
if (!existsSync7(path))
|
|
11752
11868
|
return [];
|
|
11753
11869
|
try {
|
|
11754
|
-
return
|
|
11870
|
+
return readdirSync3(path).map((entry) => join8(path, entry)).filter((entry) => {
|
|
11755
11871
|
try {
|
|
11756
|
-
return
|
|
11872
|
+
return statSync4(entry).isDirectory();
|
|
11757
11873
|
} catch {
|
|
11758
11874
|
return false;
|
|
11759
11875
|
}
|
|
@@ -11832,7 +11948,7 @@ __export(exports_doctor_filters, {
|
|
|
11832
11948
|
printDoctorFiltersHelp: () => printDoctorFiltersHelp
|
|
11833
11949
|
});
|
|
11834
11950
|
import { existsSync as existsSync8 } from "node:fs";
|
|
11835
|
-
import { homedir as
|
|
11951
|
+
import { homedir as homedir7 } from "node:os";
|
|
11836
11952
|
import { relative, resolve as resolve3 } from "node:path";
|
|
11837
11953
|
function printDoctorFiltersHelp() {
|
|
11838
11954
|
console.log("Usage: aft doctor filters [--show <name>] [trust|untrust]");
|
|
@@ -12050,7 +12166,7 @@ function truncate(value) {
|
|
|
12050
12166
|
return value.length <= 80 ? value : `${value.slice(0, 77)}…`;
|
|
12051
12167
|
}
|
|
12052
12168
|
function formatHome(path) {
|
|
12053
|
-
const home =
|
|
12169
|
+
const home = homedir7();
|
|
12054
12170
|
return path.startsWith(home) ? `~${path.slice(home.length)}` : path;
|
|
12055
12171
|
}
|
|
12056
12172
|
function formatProjectPath(path, projectRoot) {
|
|
@@ -12073,8 +12189,8 @@ var init_doctor_filters = __esm(async () => {
|
|
|
12073
12189
|
});
|
|
12074
12190
|
|
|
12075
12191
|
// src/lib/binary-cache.ts
|
|
12076
|
-
import { existsSync as existsSync9, readdirSync as
|
|
12077
|
-
import { join as
|
|
12192
|
+
import { existsSync as existsSync9, readdirSync as readdirSync4, statSync as statSync5 } from "node:fs";
|
|
12193
|
+
import { join as join9 } from "node:path";
|
|
12078
12194
|
function getBinaryCacheInfo(activeVersion) {
|
|
12079
12195
|
const path = getAftBinaryCacheDir();
|
|
12080
12196
|
if (!existsSync9(path)) {
|
|
@@ -12085,9 +12201,9 @@ function getBinaryCacheInfo(activeVersion) {
|
|
|
12085
12201
|
path
|
|
12086
12202
|
};
|
|
12087
12203
|
}
|
|
12088
|
-
const versions =
|
|
12204
|
+
const versions = readdirSync4(path).filter((entry) => {
|
|
12089
12205
|
try {
|
|
12090
|
-
return
|
|
12206
|
+
return statSync5(join9(path, entry)).isDirectory();
|
|
12091
12207
|
} catch {
|
|
12092
12208
|
return false;
|
|
12093
12209
|
}
|
|
@@ -12107,8 +12223,8 @@ var init_binary_cache = __esm(() => {
|
|
|
12107
12223
|
});
|
|
12108
12224
|
|
|
12109
12225
|
// src/lib/lsp-cache.ts
|
|
12110
|
-
import { existsSync as existsSync10, readdirSync as
|
|
12111
|
-
import { join as
|
|
12226
|
+
import { existsSync as existsSync10, readdirSync as readdirSync5, rmSync as rmSync2, statSync as statSync6 } from "node:fs";
|
|
12227
|
+
import { join as join10 } from "node:path";
|
|
12112
12228
|
function inspectDir(path) {
|
|
12113
12229
|
if (!existsSync10(path)) {
|
|
12114
12230
|
return { entries: [], totalSize: 0 };
|
|
@@ -12117,14 +12233,14 @@ function inspectDir(path) {
|
|
|
12117
12233
|
let totalSize = 0;
|
|
12118
12234
|
let names;
|
|
12119
12235
|
try {
|
|
12120
|
-
names =
|
|
12236
|
+
names = readdirSync5(path);
|
|
12121
12237
|
} catch {
|
|
12122
12238
|
return { entries: [], totalSize: 0 };
|
|
12123
12239
|
}
|
|
12124
12240
|
for (const name of names) {
|
|
12125
|
-
const full =
|
|
12241
|
+
const full = join10(path, name);
|
|
12126
12242
|
try {
|
|
12127
|
-
if (!
|
|
12243
|
+
if (!statSync6(full).isDirectory())
|
|
12128
12244
|
continue;
|
|
12129
12245
|
const size = dirSize(full);
|
|
12130
12246
|
entries.push({
|
|
@@ -12180,8 +12296,8 @@ var init_lsp_cache = __esm(() => {
|
|
|
12180
12296
|
});
|
|
12181
12297
|
|
|
12182
12298
|
// src/lib/onnx.ts
|
|
12183
|
-
import { existsSync as existsSync11, readdirSync as
|
|
12184
|
-
import { basename, isAbsolute, join as
|
|
12299
|
+
import { existsSync as existsSync11, readdirSync as readdirSync6, readlinkSync, realpathSync as realpathSync2, statSync as statSync7 } from "node:fs";
|
|
12300
|
+
import { basename, isAbsolute as isAbsolute2, join as join11, resolve as resolve4, win32 } from "node:path";
|
|
12185
12301
|
function getOnnxLibraryName() {
|
|
12186
12302
|
if (process.platform === "darwin")
|
|
12187
12303
|
return "libonnxruntime.dylib";
|
|
@@ -12214,16 +12330,16 @@ function pathEnvValue() {
|
|
|
12214
12330
|
return process.env.PATH ?? process.env.Path ?? process.env.path ?? "";
|
|
12215
12331
|
}
|
|
12216
12332
|
function pathEntriesForPlatform() {
|
|
12217
|
-
const
|
|
12218
|
-
return pathEnvValue().split(
|
|
12333
|
+
const delimiter2 = process.platform === "win32" ? ";" : ":";
|
|
12334
|
+
return pathEnvValue().split(delimiter2).map((entry) => entry.trim().replace(/^"|"$/g, "")).filter((entry) => {
|
|
12219
12335
|
if (!entry || entry === "." || entry.includes("\x00"))
|
|
12220
12336
|
return false;
|
|
12221
|
-
return
|
|
12337
|
+
return isAbsolute2(entry) || win32.isAbsolute(entry);
|
|
12222
12338
|
});
|
|
12223
12339
|
}
|
|
12224
12340
|
function directoryContainsLibrary(dir, libName) {
|
|
12225
12341
|
try {
|
|
12226
|
-
const entries =
|
|
12342
|
+
const entries = readdirSync6(dir);
|
|
12227
12343
|
if (process.platform === "win32") {
|
|
12228
12344
|
const expected = libName.toLowerCase();
|
|
12229
12345
|
return entries.some((entry) => entry.toLowerCase() === expected);
|
|
@@ -12244,21 +12360,21 @@ function findSystemOnnxRuntime() {
|
|
|
12244
12360
|
searchPaths.push(...pathEntriesForPlatform());
|
|
12245
12361
|
const programFiles = process.env.ProgramFiles ?? "C:\\Program Files";
|
|
12246
12362
|
const programFilesX86 = process.env["ProgramFiles(x86)"] ?? "C:\\Program Files (x86)";
|
|
12247
|
-
searchPaths.push(
|
|
12363
|
+
searchPaths.push(join11(programFiles, "onnxruntime", "lib"), join11(programFiles, "Microsoft ONNX Runtime", "lib"), join11(programFiles, "Microsoft Machine Learning", "lib"), join11(programFilesX86, "onnxruntime", "lib"), ...(() => {
|
|
12248
12364
|
const nugetPaths = [];
|
|
12249
12365
|
const userProfile = process.env.USERPROFILE ?? "";
|
|
12250
12366
|
if (!userProfile)
|
|
12251
12367
|
return nugetPaths;
|
|
12252
|
-
const nugetPackageDir =
|
|
12368
|
+
const nugetPackageDir = join11(userProfile, ".nuget", "packages", "microsoft.ml.onnxruntime");
|
|
12253
12369
|
if (!existsSync11(nugetPackageDir))
|
|
12254
12370
|
return nugetPaths;
|
|
12255
12371
|
try {
|
|
12256
|
-
for (const entry of
|
|
12372
|
+
for (const entry of readdirSync6(nugetPackageDir, { withFileTypes: true })) {
|
|
12257
12373
|
if (!entry.isDirectory())
|
|
12258
12374
|
continue;
|
|
12259
12375
|
if (entry.name === "__globalPackagesFolder" || entry.name.startsWith("."))
|
|
12260
12376
|
continue;
|
|
12261
|
-
nugetPaths.push(
|
|
12377
|
+
nugetPaths.push(join11(nugetPackageDir, entry.name, "runtimes", "win-x64", "native"), join11(nugetPackageDir, entry.name, "runtimes", "win-arm64", "native"));
|
|
12262
12378
|
}
|
|
12263
12379
|
} catch {}
|
|
12264
12380
|
return nugetPaths;
|
|
@@ -12288,12 +12404,12 @@ function findSystemOnnxRuntime() {
|
|
|
12288
12404
|
return unknownVersionPaths[0] ?? null;
|
|
12289
12405
|
}
|
|
12290
12406
|
function findCachedOnnxRuntime(storageDir) {
|
|
12291
|
-
const ortDir =
|
|
12407
|
+
const ortDir = join11(storageDir, "onnxruntime", ONNX_RUNTIME_VERSION);
|
|
12292
12408
|
const libName = getOnnxLibraryName();
|
|
12293
|
-
if (existsSync11(
|
|
12409
|
+
if (existsSync11(join11(ortDir, libName)))
|
|
12294
12410
|
return ortDir;
|
|
12295
|
-
const libSubdir =
|
|
12296
|
-
if (existsSync11(
|
|
12411
|
+
const libSubdir = join11(ortDir, "lib");
|
|
12412
|
+
if (existsSync11(join11(libSubdir, libName)))
|
|
12297
12413
|
return libSubdir;
|
|
12298
12414
|
return null;
|
|
12299
12415
|
}
|
|
@@ -12318,7 +12434,7 @@ function detectOrtVersion(libDir) {
|
|
|
12318
12434
|
return null;
|
|
12319
12435
|
const libName = getOnnxLibraryName();
|
|
12320
12436
|
try {
|
|
12321
|
-
const entries =
|
|
12437
|
+
const entries = readdirSync6(libDir);
|
|
12322
12438
|
const barePrefix = libName.replace(/\.(so|dylib|dll)$/, "");
|
|
12323
12439
|
const expectedPrefix = process.platform === "win32" ? barePrefix.toLowerCase() : barePrefix;
|
|
12324
12440
|
for (const entry of entries) {
|
|
@@ -12329,7 +12445,7 @@ function detectOrtVersion(libDir) {
|
|
|
12329
12445
|
if (version)
|
|
12330
12446
|
return version;
|
|
12331
12447
|
}
|
|
12332
|
-
const base =
|
|
12448
|
+
const base = join11(libDir, libName);
|
|
12333
12449
|
if (existsSync11(base)) {
|
|
12334
12450
|
try {
|
|
12335
12451
|
const real = realpathSync2(base);
|
|
@@ -12362,7 +12478,7 @@ var init_onnx = () => {};
|
|
|
12362
12478
|
|
|
12363
12479
|
// src/lib/sanitize.ts
|
|
12364
12480
|
import { realpathSync as realpathSync3 } from "node:fs";
|
|
12365
|
-
import { homedir as
|
|
12481
|
+
import { homedir as homedir8, userInfo } from "node:os";
|
|
12366
12482
|
function escapeRegex(value) {
|
|
12367
12483
|
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
12368
12484
|
}
|
|
@@ -12393,7 +12509,7 @@ function redactSecrets(content) {
|
|
|
12393
12509
|
}
|
|
12394
12510
|
function sanitizeContent(content) {
|
|
12395
12511
|
const username = userInfo().username;
|
|
12396
|
-
const home =
|
|
12512
|
+
const home = homedir8();
|
|
12397
12513
|
let sanitized = redactSecrets(content);
|
|
12398
12514
|
const cwd = process.cwd();
|
|
12399
12515
|
for (const candidate of new Set([cwd, safeRealpath(cwd)])) {
|
|
@@ -12445,7 +12561,7 @@ import {
|
|
|
12445
12561
|
existsSync as existsSync12,
|
|
12446
12562
|
openSync as openSync2,
|
|
12447
12563
|
readSync as readSync2,
|
|
12448
|
-
statSync as
|
|
12564
|
+
statSync as statSync8
|
|
12449
12565
|
} from "node:fs";
|
|
12450
12566
|
async function collectDiagnostics(adapters) {
|
|
12451
12567
|
const cliVersion = getSelfVersion();
|
|
@@ -12523,7 +12639,7 @@ async function diagnoseHarness(adapter) {
|
|
|
12523
12639
|
logFile: {
|
|
12524
12640
|
path: logPath,
|
|
12525
12641
|
exists: existsSync12(logPath),
|
|
12526
|
-
sizeKb: existsSync12(logPath) ? Math.round(
|
|
12642
|
+
sizeKb: existsSync12(logPath) ? Math.round(statSync8(logPath).size / 1024) : 0
|
|
12527
12643
|
}
|
|
12528
12644
|
};
|
|
12529
12645
|
}
|
|
@@ -12724,7 +12840,7 @@ function tailLogFile(path, lines) {
|
|
|
12724
12840
|
const chunkSize = 64 * 1024;
|
|
12725
12841
|
let fd = null;
|
|
12726
12842
|
try {
|
|
12727
|
-
const size =
|
|
12843
|
+
const size = statSync8(path).size;
|
|
12728
12844
|
fd = openSync2(path, "r");
|
|
12729
12845
|
const chunks = [];
|
|
12730
12846
|
let position = size;
|
|
@@ -12904,7 +13020,7 @@ var init_issue_body = __esm(() => {
|
|
|
12904
13020
|
|
|
12905
13021
|
// src/lib/onnx-fix.ts
|
|
12906
13022
|
import { existsSync as existsSync13, rmSync as rmSync3 } from "node:fs";
|
|
12907
|
-
import { join as
|
|
13023
|
+
import { join as join12 } from "node:path";
|
|
12908
13024
|
function findOnnxFixCandidates(report) {
|
|
12909
13025
|
const candidates = [];
|
|
12910
13026
|
for (const harness of report.harnesses) {
|
|
@@ -12912,7 +13028,7 @@ function findOnnxFixCandidates(report) {
|
|
|
12912
13028
|
continue;
|
|
12913
13029
|
if (!harness.storageDir.exists)
|
|
12914
13030
|
continue;
|
|
12915
|
-
const storageOnnxDir =
|
|
13031
|
+
const storageOnnxDir = join12(harness.storageDir.path, "onnxruntime");
|
|
12916
13032
|
const systemTooOld = harness.onnxRuntime.systemPath !== null && harness.onnxRuntime.systemCompatible === false;
|
|
12917
13033
|
const cachedTooOld = harness.onnxRuntime.cachedPath !== null && harness.onnxRuntime.cachedCompatible === false;
|
|
12918
13034
|
const hasCompatibleCached = harness.onnxRuntime.cachedCompatible === true;
|
|
@@ -12986,10 +13102,10 @@ var init_onnx_fix = __esm(() => {
|
|
|
12986
13102
|
});
|
|
12987
13103
|
|
|
12988
13104
|
// src/lib/sessions.ts
|
|
12989
|
-
import { existsSync as existsSync14, readdirSync as
|
|
13105
|
+
import { existsSync as existsSync14, readdirSync as readdirSync7, readFileSync as readFileSync4, statSync as statSync9 } from "node:fs";
|
|
12990
13106
|
import { createRequire as createRequire3 } from "node:module";
|
|
12991
|
-
import { homedir as
|
|
12992
|
-
import { basename as basename2, join as
|
|
13107
|
+
import { homedir as homedir9 } from "node:os";
|
|
13108
|
+
import { basename as basename2, join as join13 } from "node:path";
|
|
12993
13109
|
function listRecentSessions(adapter) {
|
|
12994
13110
|
try {
|
|
12995
13111
|
if (adapter.kind === "opencode")
|
|
@@ -13018,7 +13134,7 @@ function mapOpenCodeSessionRows(rows) {
|
|
|
13018
13134
|
}).filter((session) => session !== null).sort((a, b) => b.lastActivity - a.lastActivity).slice(0, MAX_RECENT_SESSIONS);
|
|
13019
13135
|
}
|
|
13020
13136
|
function listRecentOpenCodeSessions() {
|
|
13021
|
-
const dbPath =
|
|
13137
|
+
const dbPath = join13(getXdgDataHome(), "opencode", "opencode.db");
|
|
13022
13138
|
if (!existsSync14(dbPath))
|
|
13023
13139
|
return [];
|
|
13024
13140
|
let db = null;
|
|
@@ -13038,14 +13154,14 @@ function listRecentOpenCodeSessions() {
|
|
|
13038
13154
|
}
|
|
13039
13155
|
function getXdgDataHome() {
|
|
13040
13156
|
const xdgDataHome = process.env.XDG_DATA_HOME;
|
|
13041
|
-
return xdgDataHome && xdgDataHome.length > 0 ? xdgDataHome :
|
|
13157
|
+
return xdgDataHome && xdgDataHome.length > 0 ? xdgDataHome : join13(homedir9(), ".local", "share");
|
|
13042
13158
|
}
|
|
13043
13159
|
function listRecentPiSessions() {
|
|
13044
|
-
return listPiSessionsFromDir(
|
|
13160
|
+
return listPiSessionsFromDir(join13(getHomeDir(), ".pi", "agent", "sessions"));
|
|
13045
13161
|
}
|
|
13046
13162
|
function getHomeDir() {
|
|
13047
13163
|
const envHome = process.platform === "win32" ? process.env.USERPROFILE : process.env.HOME;
|
|
13048
|
-
return envHome && envHome.length > 0 ? envHome :
|
|
13164
|
+
return envHome && envHome.length > 0 ? envHome : homedir9();
|
|
13049
13165
|
}
|
|
13050
13166
|
function listPiSessionsFromDir(sessionsDir) {
|
|
13051
13167
|
try {
|
|
@@ -13053,7 +13169,7 @@ function listPiSessionsFromDir(sessionsDir) {
|
|
|
13053
13169
|
return [];
|
|
13054
13170
|
const files = collectJsonlFiles(sessionsDir).map((filePath) => {
|
|
13055
13171
|
try {
|
|
13056
|
-
const stats =
|
|
13172
|
+
const stats = statSync9(filePath);
|
|
13057
13173
|
return { filePath, mtimeMs: stats.mtimeMs };
|
|
13058
13174
|
} catch {
|
|
13059
13175
|
return null;
|
|
@@ -13082,12 +13198,12 @@ function collectJsonlFiles(root) {
|
|
|
13082
13198
|
continue;
|
|
13083
13199
|
let entries;
|
|
13084
13200
|
try {
|
|
13085
|
-
entries =
|
|
13201
|
+
entries = readdirSync7(dir, { withFileTypes: true });
|
|
13086
13202
|
} catch {
|
|
13087
13203
|
continue;
|
|
13088
13204
|
}
|
|
13089
13205
|
for (const entry of entries) {
|
|
13090
|
-
const path =
|
|
13206
|
+
const path = join13(dir, entry.name);
|
|
13091
13207
|
if (entry.isDirectory()) {
|
|
13092
13208
|
stack.push(path);
|
|
13093
13209
|
} else if (entry.isFile() && entry.name.endsWith(".jsonl")) {
|
|
@@ -13184,6 +13300,7 @@ __export(exports_doctor, {
|
|
|
13184
13300
|
DOCTOR_FORCE_CLEAR_TARGETS: () => DOCTOR_FORCE_CLEAR_TARGETS,
|
|
13185
13301
|
DOCTOR_CLEAR_TARGET_OPTIONS: () => DOCTOR_CLEAR_TARGET_OPTIONS
|
|
13186
13302
|
});
|
|
13303
|
+
import { execFileSync } from "node:child_process";
|
|
13187
13304
|
import {
|
|
13188
13305
|
chmodSync as chmodSync2,
|
|
13189
13306
|
existsSync as existsSync15,
|
|
@@ -13192,11 +13309,11 @@ import {
|
|
|
13192
13309
|
readFileSync as readFileSync5,
|
|
13193
13310
|
realpathSync as realpathSync4,
|
|
13194
13311
|
rmSync as rmSync4,
|
|
13195
|
-
statSync as
|
|
13312
|
+
statSync as statSync10,
|
|
13196
13313
|
writeFileSync as writeFileSync2
|
|
13197
13314
|
} from "node:fs";
|
|
13198
13315
|
import { tmpdir as tmpdir2 } from "node:os";
|
|
13199
|
-
import { join as
|
|
13316
|
+
import { join as join14 } from "node:path";
|
|
13200
13317
|
async function runDoctor(options) {
|
|
13201
13318
|
if (options.issue) {
|
|
13202
13319
|
return runIssueFlow(options.argv);
|
|
@@ -13360,10 +13477,10 @@ function clearOldBinaries() {
|
|
|
13360
13477
|
return result;
|
|
13361
13478
|
}
|
|
13362
13479
|
for (const version of stale) {
|
|
13363
|
-
const dir =
|
|
13480
|
+
const dir = join14(info.path, version);
|
|
13364
13481
|
let bytes = 0;
|
|
13365
13482
|
try {
|
|
13366
|
-
bytes =
|
|
13483
|
+
bytes = statSync10(dir).isDirectory() ? dirSize(dir) : 0;
|
|
13367
13484
|
} catch {
|
|
13368
13485
|
bytes = 0;
|
|
13369
13486
|
}
|
|
@@ -13383,6 +13500,31 @@ function clearOldBinaries() {
|
|
|
13383
13500
|
}
|
|
13384
13501
|
return result;
|
|
13385
13502
|
}
|
|
13503
|
+
function findPluginUpdateTargets(adapters, report) {
|
|
13504
|
+
const adaptersByKind = new Map(adapters.map((a) => [a.kind, a]));
|
|
13505
|
+
const targets = [];
|
|
13506
|
+
for (const harness of report.harnesses) {
|
|
13507
|
+
if (harness.kind !== "opencode")
|
|
13508
|
+
continue;
|
|
13509
|
+
if (!harness.hostInstalled || !harness.pluginRegistered)
|
|
13510
|
+
continue;
|
|
13511
|
+
const cache = harness.pluginCache;
|
|
13512
|
+
if (!cache?.exists || !cache.cached || !cache.latest)
|
|
13513
|
+
continue;
|
|
13514
|
+
if (cache.cached === cache.latest)
|
|
13515
|
+
continue;
|
|
13516
|
+
const adapter = adaptersByKind.get(harness.kind);
|
|
13517
|
+
if (!adapter)
|
|
13518
|
+
continue;
|
|
13519
|
+
targets.push({
|
|
13520
|
+
adapter,
|
|
13521
|
+
installDir: cache.path,
|
|
13522
|
+
cached: cache.cached,
|
|
13523
|
+
latest: cache.latest
|
|
13524
|
+
});
|
|
13525
|
+
}
|
|
13526
|
+
return targets;
|
|
13527
|
+
}
|
|
13386
13528
|
function findSchemaFixTargets(adapters) {
|
|
13387
13529
|
const targets = [];
|
|
13388
13530
|
for (const adapter of adapters) {
|
|
@@ -13402,6 +13544,35 @@ function findSchemaFixTargets(adapters) {
|
|
|
13402
13544
|
}
|
|
13403
13545
|
return targets;
|
|
13404
13546
|
}
|
|
13547
|
+
async function applyPluginUpdates(targets) {
|
|
13548
|
+
let updated = 0;
|
|
13549
|
+
let errors = 0;
|
|
13550
|
+
if (targets.length === 0)
|
|
13551
|
+
return { updated, errors };
|
|
13552
|
+
const npm = resolveNpm();
|
|
13553
|
+
if (!npm) {
|
|
13554
|
+
errors += targets.length;
|
|
13555
|
+
O2.error("Could not find npm on PATH or in known version-manager locations, so the plugin cannot be updated automatically. Install Node/npm, or launch your editor from a shell where npm is available.");
|
|
13556
|
+
return { updated, errors };
|
|
13557
|
+
}
|
|
13558
|
+
for (const target of targets) {
|
|
13559
|
+
try {
|
|
13560
|
+
execFileSync(npm.command, ["install", "--no-audit", "--no-fund", "--no-progress", "--ignore-scripts"], {
|
|
13561
|
+
cwd: target.installDir,
|
|
13562
|
+
env: npmSpawnEnv(npm),
|
|
13563
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
13564
|
+
timeout: 120000
|
|
13565
|
+
});
|
|
13566
|
+
updated += 1;
|
|
13567
|
+
O2.success(`${target.adapter.displayName}: plugin updated ${target.cached} → ${target.latest} (restart ${target.adapter.displayName} to apply)`);
|
|
13568
|
+
} catch (err) {
|
|
13569
|
+
errors += 1;
|
|
13570
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
13571
|
+
O2.error(`${target.adapter.displayName}: plugin update failed: ${message}`);
|
|
13572
|
+
}
|
|
13573
|
+
}
|
|
13574
|
+
return { updated, errors };
|
|
13575
|
+
}
|
|
13405
13576
|
function applySchemaFixes(targets) {
|
|
13406
13577
|
let changed = 0;
|
|
13407
13578
|
let errors = 0;
|
|
@@ -13438,6 +13609,12 @@ function buildDoctorFixPlan(adapters, report) {
|
|
|
13438
13609
|
});
|
|
13439
13610
|
}
|
|
13440
13611
|
}
|
|
13612
|
+
for (const target of findPluginUpdateTargets(adapters, report)) {
|
|
13613
|
+
items.push({
|
|
13614
|
+
kind: "plugin-update",
|
|
13615
|
+
message: `Will update ${target.adapter.displayName} plugin ${target.cached} → ${target.latest} via npm (the plugin's own auto-update could not run, often no npm on PATH)`
|
|
13616
|
+
});
|
|
13617
|
+
}
|
|
13441
13618
|
if (!report.binaryVersion) {
|
|
13442
13619
|
const skews = findPluginCliVersionSkews(report);
|
|
13443
13620
|
items.push({
|
|
@@ -13531,6 +13708,7 @@ async function runFixFlow(argv) {
|
|
|
13531
13708
|
}
|
|
13532
13709
|
}
|
|
13533
13710
|
await fixPluginEntries(adapters);
|
|
13711
|
+
const pluginUpdateSummary = await applyPluginUpdates(findPluginUpdateTargets(adapters, report));
|
|
13534
13712
|
const storageSummary = ensureStorageDirsForRegisteredPlugins(adapters);
|
|
13535
13713
|
const schemaSummary = applySchemaFixes(findSchemaFixTargets(adapters));
|
|
13536
13714
|
let binaryDownloaded = false;
|
|
@@ -13561,7 +13739,7 @@ async function runFixFlow(argv) {
|
|
|
13561
13739
|
}
|
|
13562
13740
|
}
|
|
13563
13741
|
const onnxResult = await runOnnxFix(adapters, report, { yes: true });
|
|
13564
|
-
if (onnxResult === null && !binaryDownloaded && !binaryDownloadSkipped && !binaryDownloadError && storageSummary.created === 0 && storageSummary.errors === 0 && schemaSummary.changed === 0 && schemaSummary.errors === 0) {
|
|
13742
|
+
if (onnxResult === null && !binaryDownloaded && !binaryDownloadSkipped && !binaryDownloadError && storageSummary.created === 0 && storageSummary.errors === 0 && schemaSummary.changed === 0 && schemaSummary.errors === 0 && pluginUpdateSummary.updated === 0 && pluginUpdateSummary.errors === 0) {
|
|
13565
13743
|
O2.info("No auto-fixable issues detected.");
|
|
13566
13744
|
wt("If you're still seeing 'Semantic Index: failed' in the TUI sidebar, run `aft doctor` (without --fix) for a full diagnostic dump.", "Tip");
|
|
13567
13745
|
const afterReport2 = await collectDiagnostics(adapters);
|
|
@@ -13569,7 +13747,7 @@ async function runFixFlow(argv) {
|
|
|
13569
13747
|
gt(stillHasProblems2 ? "Done — some issues remain." : "Done.");
|
|
13570
13748
|
return stillHasProblems2 ? 1 : 0;
|
|
13571
13749
|
}
|
|
13572
|
-
const hadErrors = (onnxResult?.errors.length ?? 0) > 0 || binaryDownloadError !== null || storageSummary.errors > 0 || schemaSummary.errors > 0;
|
|
13750
|
+
const hadErrors = (onnxResult?.errors.length ?? 0) > 0 || binaryDownloadError !== null || storageSummary.errors > 0 || schemaSummary.errors > 0 || pluginUpdateSummary.errors > 0;
|
|
13573
13751
|
const afterReport = await collectDiagnostics(adapters);
|
|
13574
13752
|
const stillHasProblems = hasDoctorProblems(afterReport);
|
|
13575
13753
|
gt(hadErrors ? "Done — some fixes failed." : stillHasProblems ? "Done — some issues remain." : "Done.");
|
|
@@ -13727,11 +13905,11 @@ function deriveIssueTitleFromBody(body) {
|
|
|
13727
13905
|
function writeIssueReviewFile(body) {
|
|
13728
13906
|
let reviewDir = null;
|
|
13729
13907
|
try {
|
|
13730
|
-
reviewDir = mkdtempSync(
|
|
13908
|
+
reviewDir = mkdtempSync(join14(tmpdir2(), "aft-issue-"));
|
|
13731
13909
|
if (process.platform !== "win32") {
|
|
13732
13910
|
chmodSync2(reviewDir, 448);
|
|
13733
13911
|
}
|
|
13734
|
-
const outPath =
|
|
13912
|
+
const outPath = join14(reviewDir, "issue.md");
|
|
13735
13913
|
writeFileSync2(outPath, `${body}
|
|
13736
13914
|
`, { encoding: "utf8", mode: 384, flag: "wx" });
|
|
13737
13915
|
return { path: outPath, realPath: realpathSync4(outPath) };
|
|
@@ -13889,6 +14067,7 @@ https://github.com/cortexkit/aft/issues/new and paste the contents of ${outPath}
|
|
|
13889
14067
|
}
|
|
13890
14068
|
var DOCTOR_CLEAR_TARGET_OPTIONS, DOCTOR_FORCE_CLEAR_TARGETS;
|
|
13891
14069
|
var init_doctor = __esm(async () => {
|
|
14070
|
+
init_dist();
|
|
13892
14071
|
init_binary_cache();
|
|
13893
14072
|
init_fs_util();
|
|
13894
14073
|
init_github();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cortexkit/aft",
|
|
3
|
-
"version": "0.35.
|
|
3
|
+
"version": "0.35.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Unified CLI for Agent File Tools (AFT) — setup, doctor, and diagnostics across supported agent harnesses (OpenCode, Pi)",
|
|
6
6
|
"license": "MIT",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@clack/prompts": "^1.2.0",
|
|
27
|
-
"@cortexkit/aft-bridge": "0.35.
|
|
27
|
+
"@cortexkit/aft-bridge": "0.35.3",
|
|
28
28
|
"comment-json": "^4.6.2"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|