@cortexkit/aft-pi 0.56.2 → 0.57.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -15768,12 +15768,36 @@ function npmSpawnEnv(resolved, baseEnv = process.env, platform = process.platfor
|
|
|
15768
15768
|
return withPathPrepended(baseEnv, resolved.binDir, platform);
|
|
15769
15769
|
}
|
|
15770
15770
|
// ../aft-bridge/dist/onnx-runtime.js
|
|
15771
|
-
import { execFileSync } from "node:child_process";
|
|
15771
|
+
import { execFileSync as execFileSync2 } from "node:child_process";
|
|
15772
15772
|
import { createHash as createHash3 } from "node:crypto";
|
|
15773
|
-
import { chmodSync as chmodSync3, closeSync as closeSync4, copyFileSync as copyFileSync3, createWriteStream as createWriteStream2, existsSync as
|
|
15774
|
-
import { basename as basename2, dirname as dirname5, isAbsolute as isAbsolute5, join as
|
|
15773
|
+
import { chmodSync as chmodSync3, closeSync as closeSync4, copyFileSync as copyFileSync3, createWriteStream as createWriteStream2, existsSync as existsSync10, lstatSync, mkdirSync as mkdirSync5, openSync as openSync4, readdirSync as readdirSync3, readFileSync as readFileSync6, readlinkSync, realpathSync as realpathSync2, renameSync as renameSync5, rmSync as rmSync3, statSync as statSync6, symlinkSync, unlinkSync as unlinkSync4, writeFileSync as writeFileSync3 } from "node:fs";
|
|
15774
|
+
import { basename as basename2, dirname as dirname5, isAbsolute as isAbsolute5, join as join13, relative as relative2, resolve as resolve7, win32 } from "node:path";
|
|
15775
15775
|
import { Readable as Readable2 } from "node:stream";
|
|
15776
15776
|
import { pipeline as pipeline2 } from "node:stream/promises";
|
|
15777
|
+
|
|
15778
|
+
// ../aft-bridge/dist/tar-executable.js
|
|
15779
|
+
import { execFileSync } from "node:child_process";
|
|
15780
|
+
import { existsSync as existsSync9 } from "node:fs";
|
|
15781
|
+
import { join as join12 } from "node:path";
|
|
15782
|
+
function windowsTarExecutable(options = {}) {
|
|
15783
|
+
const platform = options.platform ?? process.platform;
|
|
15784
|
+
if (platform !== "win32")
|
|
15785
|
+
return "tar";
|
|
15786
|
+
const env = options.env ?? process.env;
|
|
15787
|
+
const systemTar = join12(env.SystemRoot ?? "C:\\Windows", "System32", "tar.exe");
|
|
15788
|
+
return (options.exists ?? existsSync9)(systemTar) ? systemTar : "tar";
|
|
15789
|
+
}
|
|
15790
|
+
function execTarExtractionSync(args, timeout) {
|
|
15791
|
+
const executable = windowsTarExecutable();
|
|
15792
|
+
try {
|
|
15793
|
+
execFileSync(executable, args, { stdio: "pipe", timeout });
|
|
15794
|
+
} catch (cause) {
|
|
15795
|
+
const detail = cause instanceof Error ? cause.message : String(cause);
|
|
15796
|
+
throw new Error(`tar extraction failed using ${executable}: ${detail}`, { cause });
|
|
15797
|
+
}
|
|
15798
|
+
}
|
|
15799
|
+
|
|
15800
|
+
// ../aft-bridge/dist/onnx-runtime.js
|
|
15777
15801
|
var ORT_VERSION = "1.24.4";
|
|
15778
15802
|
var ORT_REPO = "microsoft/onnxruntime";
|
|
15779
15803
|
var MAX_DOWNLOAD_BYTES2 = 256 * 1024 * 1024;
|
|
@@ -15834,11 +15858,11 @@ function getManualInstallHint() {
|
|
|
15834
15858
|
}
|
|
15835
15859
|
async function ensureOnnxRuntime(storageDir) {
|
|
15836
15860
|
const info = getPlatformInfo();
|
|
15837
|
-
const ortVersionDir =
|
|
15861
|
+
const ortVersionDir = join13(storageDir, "onnxruntime", ORT_VERSION);
|
|
15838
15862
|
const libName = info?.libName ?? "libonnxruntime.dylib";
|
|
15839
15863
|
const resolvedOrtDir = resolveCachedOnnxRuntimeDir(ortVersionDir, libName);
|
|
15840
|
-
const libPath =
|
|
15841
|
-
if (
|
|
15864
|
+
const libPath = join13(resolvedOrtDir, libName);
|
|
15865
|
+
if (existsSync10(libPath)) {
|
|
15842
15866
|
const meta = readOnnxInstalledMeta(ortVersionDir);
|
|
15843
15867
|
if (meta?.sha256) {
|
|
15844
15868
|
try {
|
|
@@ -15867,9 +15891,9 @@ async function ensureOnnxRuntime(storageDir) {
|
|
|
15867
15891
|
warn(`ONNX Runtime auto-download not available for ${process.platform}/${process.arch}. Install manually: ${getManualInstallHint()}`);
|
|
15868
15892
|
return null;
|
|
15869
15893
|
}
|
|
15870
|
-
const onnxBaseDir =
|
|
15894
|
+
const onnxBaseDir = join13(storageDir, "onnxruntime");
|
|
15871
15895
|
mkdirSync5(onnxBaseDir, { recursive: true });
|
|
15872
|
-
const lockPath =
|
|
15896
|
+
const lockPath = join13(onnxBaseDir, ONNX_LOCK_FILE);
|
|
15873
15897
|
cleanupAbandonedStagingDirs(onnxBaseDir);
|
|
15874
15898
|
if (!acquireLock(lockPath)) {
|
|
15875
15899
|
warn(`ONNX Runtime install already in progress in another process (lock: ${lockPath}). Skipping.`);
|
|
@@ -15888,7 +15912,7 @@ function cleanupAbandonedStagingDirs(onnxBaseDir) {
|
|
|
15888
15912
|
for (const entry of entries) {
|
|
15889
15913
|
if (!entry.startsWith(`${ORT_VERSION}.tmp.`))
|
|
15890
15914
|
continue;
|
|
15891
|
-
const stagingDir =
|
|
15915
|
+
const stagingDir = join13(onnxBaseDir, entry);
|
|
15892
15916
|
const parts = entry.split(".");
|
|
15893
15917
|
const pidStr = parts[parts.length - 2];
|
|
15894
15918
|
const pid = pidStr ? Number.parseInt(pidStr, 10) : NaN;
|
|
@@ -15925,7 +15949,7 @@ function cleanupAbandonedStagingDirs(onnxBaseDir) {
|
|
|
15925
15949
|
}
|
|
15926
15950
|
function cleanupIncompleteTargetIfUnowned(ortDir) {
|
|
15927
15951
|
try {
|
|
15928
|
-
if (
|
|
15952
|
+
if (existsSync10(ortDir) && !existsSync10(join13(ortDir, ONNX_INSTALLED_META_FILE))) {
|
|
15929
15953
|
log(`[onnx] removing half-populated install dir ${ortDir} (no meta file)`);
|
|
15930
15954
|
rmSync3(ortDir, { recursive: true, force: true });
|
|
15931
15955
|
}
|
|
@@ -15969,8 +15993,8 @@ function detectOnnxVersion(libDir, libName) {
|
|
|
15969
15993
|
if (version)
|
|
15970
15994
|
return version;
|
|
15971
15995
|
}
|
|
15972
|
-
const base =
|
|
15973
|
-
if (
|
|
15996
|
+
const base = join13(libDir, libName);
|
|
15997
|
+
if (existsSync10(base)) {
|
|
15974
15998
|
try {
|
|
15975
15999
|
const real = realpathSync2(base);
|
|
15976
16000
|
const version = parseOnnxVersionFromPath(real) ?? parseOnnxVersionFromDirectoryPath(real);
|
|
@@ -16036,10 +16060,10 @@ function directoryContainsLibrary(dir, libName) {
|
|
|
16036
16060
|
}
|
|
16037
16061
|
}
|
|
16038
16062
|
function resolveCachedOnnxRuntimeDir(ortVersionDir, libName) {
|
|
16039
|
-
if (
|
|
16063
|
+
if (existsSync10(join13(ortVersionDir, libName)))
|
|
16040
16064
|
return ortVersionDir;
|
|
16041
|
-
const libSubdir =
|
|
16042
|
-
if (
|
|
16065
|
+
const libSubdir = join13(ortVersionDir, "lib");
|
|
16066
|
+
if (existsSync10(join13(libSubdir, libName)))
|
|
16043
16067
|
return libSubdir;
|
|
16044
16068
|
return ortVersionDir;
|
|
16045
16069
|
}
|
|
@@ -16054,13 +16078,13 @@ function findSystemOnnxRuntime(libName) {
|
|
|
16054
16078
|
} else if (process.platform === "win32") {
|
|
16055
16079
|
const programFiles = process.env.ProgramFiles ?? "C:\\Program Files";
|
|
16056
16080
|
const programFilesX86 = process.env["ProgramFiles(x86)"] ?? "C:\\Program Files (x86)";
|
|
16057
|
-
searchPaths.push(
|
|
16081
|
+
searchPaths.push(join13(programFiles, "onnxruntime", "lib"), join13(programFiles, "Microsoft ONNX Runtime", "lib"), join13(programFiles, "Microsoft Machine Learning", "lib"), join13(programFilesX86, "onnxruntime", "lib"), ...(() => {
|
|
16058
16082
|
const nugetPaths = [];
|
|
16059
16083
|
const userProfile = process.env.USERPROFILE ?? "";
|
|
16060
16084
|
if (!userProfile)
|
|
16061
16085
|
return nugetPaths;
|
|
16062
|
-
const nugetPackageDir =
|
|
16063
|
-
if (!
|
|
16086
|
+
const nugetPackageDir = join13(userProfile, ".nuget", "packages", "microsoft.ml.onnxruntime");
|
|
16087
|
+
if (!existsSync10(nugetPackageDir))
|
|
16064
16088
|
return nugetPaths;
|
|
16065
16089
|
try {
|
|
16066
16090
|
for (const entry of readdirSync3(nugetPackageDir, { withFileTypes: true })) {
|
|
@@ -16068,7 +16092,7 @@ function findSystemOnnxRuntime(libName) {
|
|
|
16068
16092
|
continue;
|
|
16069
16093
|
if (entry.name === "__globalPackagesFolder" || entry.name.startsWith("."))
|
|
16070
16094
|
continue;
|
|
16071
|
-
nugetPaths.push(
|
|
16095
|
+
nugetPaths.push(join13(nugetPackageDir, entry.name, "runtimes", "win-x64", "native"), join13(nugetPackageDir, entry.name, "runtimes", "win-arm64", "native"));
|
|
16072
16096
|
}
|
|
16073
16097
|
} catch (err) {
|
|
16074
16098
|
warn(`Failed to scan NuGet ONNX Runtime cache ${nugetPackageDir}: ${err instanceof Error ? err.message : String(err)}`);
|
|
@@ -16090,11 +16114,11 @@ function findSystemOnnxRuntime(libName) {
|
|
|
16090
16114
|
});
|
|
16091
16115
|
const unknownVersionPaths = [];
|
|
16092
16116
|
for (const dir of uniquePaths) {
|
|
16093
|
-
const libPath =
|
|
16117
|
+
const libPath = join13(dir, libName);
|
|
16094
16118
|
if (process.platform === "win32") {
|
|
16095
16119
|
if (!directoryContainsLibrary(dir, libName))
|
|
16096
16120
|
continue;
|
|
16097
|
-
} else if (!
|
|
16121
|
+
} else if (!existsSync10(libPath)) {
|
|
16098
16122
|
continue;
|
|
16099
16123
|
}
|
|
16100
16124
|
const version = detectOnnxVersion(dir, libName);
|
|
@@ -16160,7 +16184,7 @@ function validateExtractedTree(stagingRoot) {
|
|
|
16160
16184
|
const walk = (dir) => {
|
|
16161
16185
|
const entries = readdirSync3(dir);
|
|
16162
16186
|
for (const entry of entries) {
|
|
16163
|
-
const fullPath =
|
|
16187
|
+
const fullPath = join13(dir, entry);
|
|
16164
16188
|
const lst = lstatSync(fullPath);
|
|
16165
16189
|
if (lst.isSymbolicLink()) {
|
|
16166
16190
|
const linkTarget = readlinkSync(fullPath);
|
|
@@ -16193,34 +16217,32 @@ async function downloadOnnxRuntime(info, targetDir) {
|
|
|
16193
16217
|
const url = `https://github.com/${ORT_REPO}/releases/download/v${ORT_VERSION}/${info.assetName}.${info.archiveType === "tgz" ? "tgz" : "zip"}`;
|
|
16194
16218
|
log(`Downloading ONNX Runtime v${ORT_VERSION} for ${process.platform}/${process.arch}...`);
|
|
16195
16219
|
const tmpDir = `${targetDir}.tmp.${process.pid}.${Date.now().toString(36)}`;
|
|
16220
|
+
const extractionRoot = join13(tmpDir, "extract");
|
|
16221
|
+
const stagedInstallDir = join13(tmpDir, "install");
|
|
16196
16222
|
try {
|
|
16197
|
-
mkdirSync5(
|
|
16198
|
-
const archivePath =
|
|
16223
|
+
mkdirSync5(extractionRoot, { recursive: true });
|
|
16224
|
+
const archivePath = join13(tmpDir, `onnxruntime.${info.archiveType}`);
|
|
16199
16225
|
await downloadFileWithCap(url, archivePath);
|
|
16200
16226
|
const archiveSha256 = sha256File(archivePath);
|
|
16201
16227
|
log(`ONNX Runtime archive sha256=${archiveSha256}`);
|
|
16202
16228
|
if (info.archiveType === "tgz") {
|
|
16203
|
-
|
|
16204
|
-
stdio: "pipe",
|
|
16205
|
-
timeout: 120000
|
|
16206
|
-
});
|
|
16229
|
+
execTarExtractionSync(["xzf", archivePath, "-C", extractionRoot], 120000);
|
|
16207
16230
|
} else {
|
|
16208
|
-
await extractZipArchive(archivePath,
|
|
16231
|
+
await extractZipArchive(archivePath, extractionRoot);
|
|
16209
16232
|
}
|
|
16210
16233
|
try {
|
|
16211
16234
|
unlinkSync4(archivePath);
|
|
16212
16235
|
} catch {}
|
|
16213
|
-
validateExtractedTree(
|
|
16214
|
-
const extractedDir =
|
|
16215
|
-
if (!
|
|
16236
|
+
validateExtractedTree(extractionRoot);
|
|
16237
|
+
const extractedDir = join13(extractionRoot, info.assetName, "lib");
|
|
16238
|
+
if (!existsSync10(extractedDir)) {
|
|
16216
16239
|
throw new Error(`Expected directory not found: ${extractedDir}`);
|
|
16217
16240
|
}
|
|
16218
|
-
mkdirSync5(targetDir, { recursive: true });
|
|
16219
16241
|
const libFiles = readdirSync3(extractedDir).filter((f) => f.startsWith("libonnxruntime") || f.startsWith("onnxruntime"));
|
|
16220
16242
|
const realFiles = [];
|
|
16221
16243
|
const symlinks = [];
|
|
16222
16244
|
for (const libFile of libFiles) {
|
|
16223
|
-
const src =
|
|
16245
|
+
const src = join13(extractedDir, libFile);
|
|
16224
16246
|
try {
|
|
16225
16247
|
const stat = lstatSync(src);
|
|
16226
16248
|
log(`ORT extract: ${libFile} — isSymlink=${stat.isSymbolicLink()}, isFile=${stat.isFile()}, size=${stat.size}`);
|
|
@@ -16234,15 +16256,11 @@ async function downloadOnnxRuntime(info, targetDir) {
|
|
|
16234
16256
|
realFiles.push(libFile);
|
|
16235
16257
|
}
|
|
16236
16258
|
}
|
|
16237
|
-
copyOnnxLibraries(info, extractedDir,
|
|
16238
|
-
const libPath =
|
|
16239
|
-
|
|
16240
|
-
|
|
16241
|
-
|
|
16242
|
-
} catch (err) {
|
|
16243
|
-
warn(`Could not hash newly-installed ONNX library at ${libPath}: ${err}`);
|
|
16244
|
-
}
|
|
16245
|
-
writeOnnxInstalledMeta(targetDir, ORT_VERSION, libHash, archiveSha256);
|
|
16259
|
+
copyOnnxLibraries(info, extractedDir, stagedInstallDir, realFiles, symlinks);
|
|
16260
|
+
const libPath = join13(stagedInstallDir, info.libName);
|
|
16261
|
+
const libHash = sha256File(libPath);
|
|
16262
|
+
writeOnnxInstalledMeta(stagedInstallDir, ORT_VERSION, libHash, archiveSha256);
|
|
16263
|
+
publishOnnxRuntime(stagedInstallDir, targetDir);
|
|
16246
16264
|
rmSync3(tmpDir, { recursive: true, force: true });
|
|
16247
16265
|
log(`ONNX Runtime v${ORT_VERSION} installed to ${targetDir}`);
|
|
16248
16266
|
return targetDir;
|
|
@@ -16251,17 +16269,39 @@ async function downloadOnnxRuntime(info, targetDir) {
|
|
|
16251
16269
|
try {
|
|
16252
16270
|
rmSync3(tmpDir, { recursive: true, force: true });
|
|
16253
16271
|
} catch {}
|
|
16254
|
-
try {
|
|
16255
|
-
rmSync3(targetDir, { recursive: true, force: true });
|
|
16256
|
-
} catch {}
|
|
16257
16272
|
return null;
|
|
16258
16273
|
}
|
|
16259
16274
|
}
|
|
16275
|
+
function publishOnnxRuntime(stagedInstallDir, targetDir) {
|
|
16276
|
+
const backupDir = `${targetDir}.backup.${process.pid}.${Date.now().toString(36)}`;
|
|
16277
|
+
const hadTarget = existsSync10(targetDir);
|
|
16278
|
+
if (hadTarget)
|
|
16279
|
+
renameSync5(targetDir, backupDir);
|
|
16280
|
+
try {
|
|
16281
|
+
renameSync5(stagedInstallDir, targetDir);
|
|
16282
|
+
} catch (installError) {
|
|
16283
|
+
if (hadTarget) {
|
|
16284
|
+
try {
|
|
16285
|
+
renameSync5(backupDir, targetDir);
|
|
16286
|
+
} catch (restoreError) {
|
|
16287
|
+
throw new Error(`ONNX Runtime replacement failed and the previous runtime could not be restored from ${backupDir}: ${restoreError}`, { cause: installError });
|
|
16288
|
+
}
|
|
16289
|
+
}
|
|
16290
|
+
throw installError;
|
|
16291
|
+
}
|
|
16292
|
+
if (hadTarget) {
|
|
16293
|
+
try {
|
|
16294
|
+
rmSync3(backupDir, { recursive: true, force: true });
|
|
16295
|
+
} catch (err) {
|
|
16296
|
+
warn(`Could not remove replaced ONNX Runtime backup at ${backupDir}: ${err}`);
|
|
16297
|
+
}
|
|
16298
|
+
}
|
|
16299
|
+
}
|
|
16260
16300
|
function copyOnnxLibraries(info, extractedDir, targetDir, realFiles, symlinks, copyFile = copyFileSync3) {
|
|
16261
16301
|
const requiredLibs = new Set([info.libName]);
|
|
16262
16302
|
for (const libFile of realFiles) {
|
|
16263
|
-
const src =
|
|
16264
|
-
const dst =
|
|
16303
|
+
const src = join13(extractedDir, libFile);
|
|
16304
|
+
const dst = join13(targetDir, libFile);
|
|
16265
16305
|
try {
|
|
16266
16306
|
copyFile(src, dst);
|
|
16267
16307
|
if (process.platform !== "win32") {
|
|
@@ -16277,11 +16317,11 @@ function copyOnnxLibraries(info, extractedDir, targetDir, realFiles, symlinks, c
|
|
|
16277
16317
|
}
|
|
16278
16318
|
const targetRoot = realpathSync2(targetDir);
|
|
16279
16319
|
for (const link of symlinks) {
|
|
16280
|
-
const dst =
|
|
16320
|
+
const dst = join13(targetDir, link.name);
|
|
16281
16321
|
try {
|
|
16282
16322
|
unlinkSync4(dst);
|
|
16283
16323
|
} catch {}
|
|
16284
|
-
const dstForContainment =
|
|
16324
|
+
const dstForContainment = join13(targetRoot, link.name);
|
|
16285
16325
|
const resolvedTarget = resolve7(dirname5(dstForContainment), link.target);
|
|
16286
16326
|
if (!isPathInsideRoot(targetRoot, resolvedTarget)) {
|
|
16287
16327
|
const message = `ONNX Runtime symlink ${link.name} points outside install dir: ${link.target}`;
|
|
@@ -16302,21 +16342,18 @@ function copyOnnxLibraries(info, extractedDir, targetDir, realFiles, symlinks, c
|
|
|
16302
16342
|
log(`ORT extract: failed to symlink optional ${link.name}: ${symlinkErr}`);
|
|
16303
16343
|
}
|
|
16304
16344
|
}
|
|
16305
|
-
const requiredPath =
|
|
16306
|
-
if (!
|
|
16345
|
+
const requiredPath = join13(targetDir, info.libName);
|
|
16346
|
+
if (!existsSync10(requiredPath)) {
|
|
16307
16347
|
rmSync3(targetDir, { recursive: true, force: true });
|
|
16308
16348
|
throw new Error(`Required ONNX Runtime library missing after install: ${requiredPath}`);
|
|
16309
16349
|
}
|
|
16310
16350
|
}
|
|
16311
16351
|
async function extractZipArchive(archivePath, destinationDir) {
|
|
16312
16352
|
if (process.platform === "win32") {
|
|
16313
|
-
|
|
16314
|
-
stdio: "pipe",
|
|
16315
|
-
timeout: 120000
|
|
16316
|
-
});
|
|
16353
|
+
execTarExtractionSync(["-xf", archivePath, "-C", destinationDir], 120000);
|
|
16317
16354
|
return;
|
|
16318
16355
|
}
|
|
16319
|
-
|
|
16356
|
+
execFileSync2("unzip", ["-q", archivePath, "-d", destinationDir], {
|
|
16320
16357
|
stdio: "pipe",
|
|
16321
16358
|
timeout: 120000
|
|
16322
16359
|
});
|
|
@@ -16329,13 +16366,13 @@ function writeOnnxInstalledMeta(installDir, version, sha256, archiveSha256) {
|
|
|
16329
16366
|
...sha256 ? { sha256 } : {},
|
|
16330
16367
|
archiveSha256
|
|
16331
16368
|
};
|
|
16332
|
-
writeFileSync3(
|
|
16369
|
+
writeFileSync3(join13(installDir, ONNX_INSTALLED_META_FILE), JSON.stringify(meta), "utf8");
|
|
16333
16370
|
} catch (err) {
|
|
16334
16371
|
log(`[onnx] failed to write installed-meta in ${installDir}: ${err}`);
|
|
16335
16372
|
}
|
|
16336
16373
|
}
|
|
16337
16374
|
function readOnnxInstalledMeta(installDir) {
|
|
16338
|
-
const path =
|
|
16375
|
+
const path = join13(installDir, ONNX_INSTALLED_META_FILE);
|
|
16339
16376
|
try {
|
|
16340
16377
|
if (!statSync6(path).isFile())
|
|
16341
16378
|
return null;
|
|
@@ -16447,7 +16484,7 @@ function isWindowsProcessAlive(pid) {
|
|
|
16447
16484
|
if (!Number.isInteger(pid) || pid <= 0)
|
|
16448
16485
|
return false;
|
|
16449
16486
|
try {
|
|
16450
|
-
const output =
|
|
16487
|
+
const output = execFileSync2("tasklist.exe", ["/FI", `PID eq ${pid}`, "/FO", "CSV", "/NH"], {
|
|
16451
16488
|
encoding: "utf8",
|
|
16452
16489
|
timeout: 2000,
|
|
16453
16490
|
windowsHide: true
|
|
@@ -16668,10 +16705,8 @@ function prepareCanonicalEditArguments(toolName, rawArguments) {
|
|
|
16668
16705
|
if (unknownRootKeys.length > 0) {
|
|
16669
16706
|
throw new InvalidRequestError(formatUnknownKeys(unknownRootKeys));
|
|
16670
16707
|
}
|
|
16708
|
+
validateSymbolModePair(record);
|
|
16671
16709
|
const modes = editModesPresent(record);
|
|
16672
|
-
if (hasOrphanedSymbolContent(record)) {
|
|
16673
|
-
throw new InvalidRequestError("edit: 'content' requires a non-empty string 'symbol' when symbol mode is selected");
|
|
16674
|
-
}
|
|
16675
16710
|
if (modes.length > 1) {
|
|
16676
16711
|
throw new InvalidRequestError(`edit: conflicting modes: ${modes.join(", ")}. ${OMIT_OPTIONAL_FIELDS_STEERING}`);
|
|
16677
16712
|
}
|
|
@@ -16691,7 +16726,7 @@ function prepareCanonicalEditArguments(toolName, rawArguments) {
|
|
|
16691
16726
|
throw new InvalidRequestError("edit: 'symbol' must be a string when symbol mode is selected");
|
|
16692
16727
|
}
|
|
16693
16728
|
if (!hasOwn(record, "content") || typeof record.content !== "string") {
|
|
16694
|
-
throw new InvalidRequestError("edit: symbol mode
|
|
16729
|
+
throw new InvalidRequestError("edit: incomplete symbol mode: property 'content' must be a string. " + "Retry with `symbol` + `content`, or use `edits[]`.");
|
|
16695
16730
|
}
|
|
16696
16731
|
} else {
|
|
16697
16732
|
const item = {};
|
|
@@ -16744,6 +16779,29 @@ function validateEditPath(record) {
|
|
|
16744
16779
|
function formatUnknownKeys(keys) {
|
|
16745
16780
|
return `Unrecognized keys: ${keys.map((key) => `"${key}"`).join(", ")}`;
|
|
16746
16781
|
}
|
|
16782
|
+
function validateSymbolModePair(record) {
|
|
16783
|
+
const completeShapes = "Retry with `symbol` + `content`, or use `edits[]`.";
|
|
16784
|
+
const hasSymbol = isNonEmptyString(record.symbol);
|
|
16785
|
+
const hasContent = isNonEmptyString(record.content);
|
|
16786
|
+
if (hasSymbol) {
|
|
16787
|
+
if (!hasOwn(record, "content")) {
|
|
16788
|
+
throw new InvalidRequestError(`edit: incomplete symbol mode: missing property 'content'. ${completeShapes}`);
|
|
16789
|
+
}
|
|
16790
|
+
if (record.content === null) {
|
|
16791
|
+
throw new InvalidRequestError(`edit: incomplete symbol mode: property 'content' is null. ${completeShapes}`);
|
|
16792
|
+
}
|
|
16793
|
+
return;
|
|
16794
|
+
}
|
|
16795
|
+
if (!hasContent)
|
|
16796
|
+
return;
|
|
16797
|
+
if (!hasOwn(record, "symbol")) {
|
|
16798
|
+
throw new InvalidRequestError(`edit: incomplete symbol mode: missing property 'symbol'. ${completeShapes}`);
|
|
16799
|
+
}
|
|
16800
|
+
if (record.symbol === null) {
|
|
16801
|
+
throw new InvalidRequestError(`edit: incomplete symbol mode: property 'symbol' is null. ${completeShapes}`);
|
|
16802
|
+
}
|
|
16803
|
+
throw new InvalidRequestError(`edit: incomplete symbol mode: property 'symbol' must be a non-empty string. ${completeShapes}`);
|
|
16804
|
+
}
|
|
16747
16805
|
function editModesPresent(record) {
|
|
16748
16806
|
const hasAppendContent = isNonEmptyString(record.appendContent);
|
|
16749
16807
|
if (!hasAppendContent)
|
|
@@ -16829,9 +16887,6 @@ function normalizeEditArraySentinels(record) {
|
|
|
16829
16887
|
return true;
|
|
16830
16888
|
}
|
|
16831
16889
|
}
|
|
16832
|
-
function hasOrphanedSymbolContent(record) {
|
|
16833
|
-
return isNonEmptyString(record.content) && !isNonEmptyString(record.symbol);
|
|
16834
|
-
}
|
|
16835
16890
|
function parseEditArray(value) {
|
|
16836
16891
|
if (typeof value === "string") {
|
|
16837
16892
|
let parsed;
|
|
@@ -17014,6 +17069,48 @@ function copyOwnProperties(source) {
|
|
|
17014
17069
|
copy[key] = source[key];
|
|
17015
17070
|
return copy;
|
|
17016
17071
|
}
|
|
17072
|
+
// ../aft-bridge/dist/semantic-status.js
|
|
17073
|
+
var MISSING_ONNX_RUNTIME_MARKER = "ONNX Runtime not found.";
|
|
17074
|
+
var MISSING_ONNX_RUNTIME_LABEL = "unavailable — ONNX Runtime missing (npx @cortexkit/aft doctor --fix)";
|
|
17075
|
+
var REBUILDING_LABEL = "Rebuilding (model changed)";
|
|
17076
|
+
var SEMANTIC_PROGRESS_STATUSES = new Set(["building", "loading"]);
|
|
17077
|
+
var SEMANTIC_READY_STATUSES = new Set(["ready", "empty"]);
|
|
17078
|
+
var SEMANTIC_INACTIVE_STATUSES = new Set(["disabled", "busy"]);
|
|
17079
|
+
var SEMANTIC_FAILURE_LABELS = {
|
|
17080
|
+
backend_unavailable: "backend unavailable",
|
|
17081
|
+
degraded: "degraded",
|
|
17082
|
+
error: "error",
|
|
17083
|
+
failed: "failed",
|
|
17084
|
+
unavailable: "unavailable"
|
|
17085
|
+
};
|
|
17086
|
+
function semanticIndexStatusKind(status) {
|
|
17087
|
+
if (SEMANTIC_READY_STATUSES.has(status))
|
|
17088
|
+
return "ready";
|
|
17089
|
+
if (SEMANTIC_PROGRESS_STATUSES.has(status))
|
|
17090
|
+
return "progress";
|
|
17091
|
+
if (status in SEMANTIC_FAILURE_LABELS)
|
|
17092
|
+
return "failure";
|
|
17093
|
+
if (SEMANTIC_INACTIVE_STATUSES.has(status))
|
|
17094
|
+
return "inactive";
|
|
17095
|
+
return "unrecognized";
|
|
17096
|
+
}
|
|
17097
|
+
function mentionsMissingOnnxRuntime(...values) {
|
|
17098
|
+
return values.some((value) => typeof value === "string" && value.includes(MISSING_ONNX_RUNTIME_MARKER));
|
|
17099
|
+
}
|
|
17100
|
+
function semanticFailureLabel(status, stage, error) {
|
|
17101
|
+
if (mentionsMissingOnnxRuntime(error, stage))
|
|
17102
|
+
return MISSING_ONNX_RUNTIME_LABEL;
|
|
17103
|
+
return SEMANTIC_FAILURE_LABELS[status] ?? null;
|
|
17104
|
+
}
|
|
17105
|
+
function formatSemanticIndexStatus(status, stage, error) {
|
|
17106
|
+
const failure = semanticFailureLabel(status, stage, error);
|
|
17107
|
+
if (failure)
|
|
17108
|
+
return failure;
|
|
17109
|
+
if (semanticIndexStatusKind(status) === "progress" && stage === "fingerprint_change") {
|
|
17110
|
+
return REBUILDING_LABEL;
|
|
17111
|
+
}
|
|
17112
|
+
return status;
|
|
17113
|
+
}
|
|
17017
17114
|
// ../aft-bridge/dist/tool-format.js
|
|
17018
17115
|
function asPlainObject(value) {
|
|
17019
17116
|
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
@@ -18057,7 +18154,7 @@ import {
|
|
|
18057
18154
|
// package.json
|
|
18058
18155
|
var package_default = {
|
|
18059
18156
|
name: "@cortexkit/aft-pi",
|
|
18060
|
-
version: "0.
|
|
18157
|
+
version: "0.57.0",
|
|
18061
18158
|
type: "module",
|
|
18062
18159
|
description: "Pi coding agent extension for Agent File Tools (AFT) — tree-sitter and LSP-powered code analysis",
|
|
18063
18160
|
main: "dist/index.js",
|
|
@@ -18080,19 +18177,19 @@ var package_default = {
|
|
|
18080
18177
|
"test:unit": "bun test src/__tests__ --path-ignore-patterns 'src/__tests__/e2e/**'"
|
|
18081
18178
|
},
|
|
18082
18179
|
dependencies: {
|
|
18083
|
-
"@cortexkit/aft-bridge": "0.
|
|
18180
|
+
"@cortexkit/aft-bridge": "0.57.0",
|
|
18084
18181
|
"comment-json": "^5.0.0",
|
|
18085
18182
|
diff: "^8.0.4",
|
|
18086
18183
|
typebox: "1.1.38",
|
|
18087
18184
|
zod: "^4.4.3"
|
|
18088
18185
|
},
|
|
18089
18186
|
optionalDependencies: {
|
|
18090
|
-
"@cortexkit/aft-darwin-arm64": "0.
|
|
18091
|
-
"@cortexkit/aft-darwin-x64": "0.
|
|
18092
|
-
"@cortexkit/aft-linux-arm64": "0.
|
|
18093
|
-
"@cortexkit/aft-linux-x64": "0.
|
|
18094
|
-
"@cortexkit/aft-win32-arm64": "0.
|
|
18095
|
-
"@cortexkit/aft-win32-x64": "0.
|
|
18187
|
+
"@cortexkit/aft-darwin-arm64": "0.57.0",
|
|
18188
|
+
"@cortexkit/aft-darwin-x64": "0.57.0",
|
|
18189
|
+
"@cortexkit/aft-linux-arm64": "0.57.0",
|
|
18190
|
+
"@cortexkit/aft-linux-x64": "0.57.0",
|
|
18191
|
+
"@cortexkit/aft-win32-arm64": "0.57.0",
|
|
18192
|
+
"@cortexkit/aft-win32-x64": "0.57.0"
|
|
18096
18193
|
},
|
|
18097
18194
|
devDependencies: {
|
|
18098
18195
|
"@earendil-works/pi-coding-agent": "^0.80.2",
|
|
@@ -18193,12 +18290,6 @@ function formatCacheRoleLabel(role) {
|
|
|
18193
18290
|
}
|
|
18194
18291
|
return role;
|
|
18195
18292
|
}
|
|
18196
|
-
function formatSemanticIndexStatus(status, stage) {
|
|
18197
|
-
if ((status === "loading" || status === "building") && stage === "fingerprint_change") {
|
|
18198
|
-
return "Rebuilding (model changed)";
|
|
18199
|
-
}
|
|
18200
|
-
return status;
|
|
18201
|
-
}
|
|
18202
18293
|
function formatSemanticRefreshing(refreshingCount) {
|
|
18203
18294
|
if (!Number.isFinite(refreshingCount) || refreshingCount <= 0)
|
|
18204
18295
|
return null;
|
|
@@ -18299,7 +18390,7 @@ function formatStatusDialogMessage(status) {
|
|
|
18299
18390
|
`Cache role: ${formatCacheRoleLabel(status.cache_role)}`
|
|
18300
18391
|
];
|
|
18301
18392
|
appendDegradedStatus(lines, status, false);
|
|
18302
|
-
lines.push("", "Enabled features", `- format_on_edit: ${formatFlag(status.features.format_on_edit)}`, `- search_index: ${formatFlag(status.features.search_index)}`, `- semantic_search: ${formatFlag(status.features.semantic_search)}`, `- callgraph_store: ${formatFlag(status.features.callgraph_store)}`, "", "Search index", `- status: ${status.search_index.status}`, `- files: ${formatCount(status.search_index.files)}`, `- trigrams: ${formatCount(status.search_index.trigrams)}`, "", "Semantic index", `- status: ${formatSemanticIndexStatus(status.semantic_index.status, status.semantic_index.stage)}`);
|
|
18393
|
+
lines.push("", "Enabled features", `- format_on_edit: ${formatFlag(status.features.format_on_edit)}`, `- search_index: ${formatFlag(status.features.search_index)}`, `- semantic_search: ${formatFlag(status.features.semantic_search)}`, `- callgraph_store: ${formatFlag(status.features.callgraph_store)}`, "", "Search index", `- status: ${status.search_index.status}`, `- files: ${formatCount(status.search_index.files)}`, `- trigrams: ${formatCount(status.search_index.trigrams)}`, "", "Semantic index", `- status: ${formatSemanticIndexStatus(status.semantic_index.status, status.semantic_index.stage, status.semantic_index.error)}`);
|
|
18303
18394
|
const refreshing = formatSemanticRefreshing(status.semantic_index.refreshing_count);
|
|
18304
18395
|
if (refreshing) {
|
|
18305
18396
|
lines.push(`- ${refreshing}`);
|
|
@@ -18360,7 +18451,7 @@ function appendDegradedStatus(lines, status, markdown) {
|
|
|
18360
18451
|
}
|
|
18361
18452
|
|
|
18362
18453
|
// src/tools/_shared.ts
|
|
18363
|
-
import { existsSync as
|
|
18454
|
+
import { existsSync as existsSync11 } from "node:fs";
|
|
18364
18455
|
import { Type } from "typebox";
|
|
18365
18456
|
var optionalInt = (min, max, description = "(integer)") => Type.Optional(Type.Union([Type.Integer({ minimum: min, maximum: max }), Type.String()], {
|
|
18366
18457
|
description
|
|
@@ -18419,7 +18510,7 @@ function prepareToolDefinitionForRegistration(tool, harness = "pi", presentation
|
|
|
18419
18510
|
};
|
|
18420
18511
|
}
|
|
18421
18512
|
function bridgeFor(ctx, cwd) {
|
|
18422
|
-
if (!
|
|
18513
|
+
if (!existsSync11(cwd)) {
|
|
18423
18514
|
throw new Error(`project directory no longer exists: ${cwd} (stale restored session?)`);
|
|
18424
18515
|
}
|
|
18425
18516
|
return ctx.pool.getBridge(cwd);
|
|
@@ -18793,7 +18884,7 @@ function registerStatusCommand(pi, ctx) {
|
|
|
18793
18884
|
}
|
|
18794
18885
|
|
|
18795
18886
|
// src/config.ts
|
|
18796
|
-
import { existsSync as
|
|
18887
|
+
import { existsSync as existsSync12, readFileSync as readFileSync7, renameSync as renameSync6, unlinkSync as unlinkSync5, writeFileSync as writeFileSync4 } from "node:fs";
|
|
18797
18888
|
import { homedir as homedir12 } from "node:os";
|
|
18798
18889
|
import { isAbsolute as isAbsolute6 } from "node:path";
|
|
18799
18890
|
var import_comment_json = __toESM(require_src2(), 1);
|
|
@@ -23921,7 +24012,7 @@ function migrateExperimentalBashBlock(rawConfig, configPath, logger) {
|
|
|
23921
24012
|
return movedKeys;
|
|
23922
24013
|
}
|
|
23923
24014
|
function migrateAftConfigFile2(configPath, logger = { log: log2, warn: warn2 }) {
|
|
23924
|
-
if (!
|
|
24015
|
+
if (!existsSync12(configPath)) {
|
|
23925
24016
|
return { migrated: false, oldKeys: [] };
|
|
23926
24017
|
}
|
|
23927
24018
|
let tmpPath = null;
|
|
@@ -23944,7 +24035,7 @@ function migrateAftConfigFile2(configPath, logger = { log: log2, warn: warn2 })
|
|
|
23944
24035
|
${serialized}` : serialized;
|
|
23945
24036
|
tmpPath = `${configPath}.tmp.${process.pid}`;
|
|
23946
24037
|
writeFileSync4(tmpPath, nextContent, "utf-8");
|
|
23947
|
-
|
|
24038
|
+
renameSync6(tmpPath, configPath);
|
|
23948
24039
|
logger.log(`Migrated config at ${configPath}: removed ${oldKeys.join(", ")}`);
|
|
23949
24040
|
return { migrated: true, oldKeys };
|
|
23950
24041
|
} catch (err) {
|
|
@@ -23980,7 +24071,7 @@ function warnIgnoredHarnessSpecificConfigKeys(config, configPath) {
|
|
|
23980
24071
|
}
|
|
23981
24072
|
function loadConfigFromPath(configPath) {
|
|
23982
24073
|
try {
|
|
23983
|
-
if (!
|
|
24074
|
+
if (!existsSync12(configPath))
|
|
23984
24075
|
return null;
|
|
23985
24076
|
const content = readFileSync7(configPath, "utf-8");
|
|
23986
24077
|
const rawConfig = import_comment_json.parse(content);
|
|
@@ -24337,15 +24428,15 @@ import { spawn as spawn4 } from "node:child_process";
|
|
|
24337
24428
|
import { createHash as createHash4 } from "node:crypto";
|
|
24338
24429
|
import {
|
|
24339
24430
|
createReadStream,
|
|
24340
|
-
existsSync as
|
|
24431
|
+
existsSync as existsSync14,
|
|
24341
24432
|
mkdirSync as mkdirSync7,
|
|
24342
24433
|
readFileSync as readFileSync10,
|
|
24343
|
-
renameSync as
|
|
24434
|
+
renameSync as renameSync8,
|
|
24344
24435
|
rmSync as rmSync5,
|
|
24345
24436
|
statSync as statSync8,
|
|
24346
24437
|
writeFileSync as writeFileSync6
|
|
24347
24438
|
} from "node:fs";
|
|
24348
|
-
import { join as
|
|
24439
|
+
import { join as join16 } from "node:path";
|
|
24349
24440
|
|
|
24350
24441
|
// src/lsp-cache.ts
|
|
24351
24442
|
import { randomUUID as randomUUID2 } from "node:crypto";
|
|
@@ -24354,13 +24445,13 @@ import {
|
|
|
24354
24445
|
mkdirSync as mkdirSync6,
|
|
24355
24446
|
openSync as openSync5,
|
|
24356
24447
|
readFileSync as readFileSync8,
|
|
24357
|
-
renameSync as
|
|
24448
|
+
renameSync as renameSync7,
|
|
24358
24449
|
rmSync as rmSync4,
|
|
24359
24450
|
statSync as statSync7,
|
|
24360
24451
|
unlinkSync as unlinkSync6,
|
|
24361
24452
|
writeFileSync as writeFileSync5
|
|
24362
24453
|
} from "node:fs";
|
|
24363
|
-
import { join as
|
|
24454
|
+
import { join as join14 } from "node:path";
|
|
24364
24455
|
function aftCacheBase() {
|
|
24365
24456
|
return getAftCacheRoot();
|
|
24366
24457
|
}
|
|
@@ -24368,18 +24459,18 @@ function lspCacheRoot() {
|
|
|
24368
24459
|
return getAftLspPackagesDir();
|
|
24369
24460
|
}
|
|
24370
24461
|
function lspPackageDir(npmPackage) {
|
|
24371
|
-
return
|
|
24462
|
+
return join14(lspCacheRoot(), encodeURIComponent(npmPackage));
|
|
24372
24463
|
}
|
|
24373
24464
|
function lspBinaryPath(npmPackage, binary) {
|
|
24374
|
-
return
|
|
24465
|
+
return join14(lspPackageDir(npmPackage), "node_modules", ".bin", binary);
|
|
24375
24466
|
}
|
|
24376
24467
|
function lspBinDir(npmPackage) {
|
|
24377
|
-
return
|
|
24468
|
+
return join14(lspPackageDir(npmPackage), "node_modules", ".bin");
|
|
24378
24469
|
}
|
|
24379
24470
|
function isInstalled(npmPackage, binary) {
|
|
24380
24471
|
for (const candidate of lspBinaryCandidates(binary)) {
|
|
24381
24472
|
try {
|
|
24382
|
-
if (statSync7(
|
|
24473
|
+
if (statSync7(join14(lspBinDir(npmPackage), candidate)).isFile())
|
|
24383
24474
|
return true;
|
|
24384
24475
|
} catch {}
|
|
24385
24476
|
}
|
|
@@ -24399,13 +24490,13 @@ function writeInstalledMetaIn(installDir, version, sha256) {
|
|
|
24399
24490
|
installedAt: new Date().toISOString(),
|
|
24400
24491
|
...sha256 ? { sha256 } : {}
|
|
24401
24492
|
};
|
|
24402
|
-
writeFileSync5(
|
|
24493
|
+
writeFileSync5(join14(installDir, INSTALLED_META_FILE), JSON.stringify(meta), "utf8");
|
|
24403
24494
|
} catch (err) {
|
|
24404
24495
|
log2(`[lsp-cache] failed to write installed-meta in ${installDir}: ${err}`);
|
|
24405
24496
|
}
|
|
24406
24497
|
}
|
|
24407
24498
|
function readInstalledMetaIn(installDir) {
|
|
24408
|
-
const path =
|
|
24499
|
+
const path = join14(installDir, INSTALLED_META_FILE);
|
|
24409
24500
|
try {
|
|
24410
24501
|
if (!statSync7(path).isFile())
|
|
24411
24502
|
return null;
|
|
@@ -24429,7 +24520,7 @@ function readInstalledMeta(packageKey) {
|
|
|
24429
24520
|
return readInstalledMetaIn(lspPackageDir(packageKey));
|
|
24430
24521
|
}
|
|
24431
24522
|
function lockPath(npmPackage) {
|
|
24432
|
-
return
|
|
24523
|
+
return join14(lspPackageDir(npmPackage), ".aft-installing");
|
|
24433
24524
|
}
|
|
24434
24525
|
var STALE_LOCK_MS2 = 30 * 60 * 1000;
|
|
24435
24526
|
function acquireInstallLock(lockKey) {
|
|
@@ -24560,7 +24651,7 @@ var AUTO_INSTALL_STAMP_FILE = "last-lsp-autoinstall.json";
|
|
|
24560
24651
|
var AUTO_INSTALL_WINDOW_MS = 60 * 1000;
|
|
24561
24652
|
var AUTO_INSTALL_LOCK_STALE_MS = 30 * 60 * 1000;
|
|
24562
24653
|
function autoInstallStampPath() {
|
|
24563
|
-
return
|
|
24654
|
+
return join14(aftCacheBase(), AUTO_INSTALL_STAMP_FILE);
|
|
24564
24655
|
}
|
|
24565
24656
|
function hasRecentAutoInstallStamp(path) {
|
|
24566
24657
|
try {
|
|
@@ -24646,7 +24737,7 @@ function claimLspAutoInstallPass() {
|
|
|
24646
24737
|
encoding: "utf8",
|
|
24647
24738
|
mode: 384
|
|
24648
24739
|
});
|
|
24649
|
-
|
|
24740
|
+
renameSync7(tempPath, stampPath);
|
|
24650
24741
|
return { release };
|
|
24651
24742
|
} catch (err) {
|
|
24652
24743
|
if (claimed) {
|
|
@@ -24661,7 +24752,7 @@ function claimLspAutoInstallPass() {
|
|
|
24661
24752
|
}
|
|
24662
24753
|
var VERSION_CHECK_FILE = ".aft-version-check";
|
|
24663
24754
|
function readVersionCheck(npmPackage) {
|
|
24664
|
-
const file =
|
|
24755
|
+
const file = join14(lspPackageDir(npmPackage), VERSION_CHECK_FILE);
|
|
24665
24756
|
try {
|
|
24666
24757
|
const raw = readFileSync8(file, "utf8");
|
|
24667
24758
|
const parsed = JSON.parse(raw);
|
|
@@ -24678,7 +24769,7 @@ function readVersionCheck(npmPackage) {
|
|
|
24678
24769
|
}
|
|
24679
24770
|
function writeVersionCheck(npmPackage, latest) {
|
|
24680
24771
|
mkdirSync6(lspPackageDir(npmPackage), { recursive: true });
|
|
24681
|
-
const file =
|
|
24772
|
+
const file = join14(lspPackageDir(npmPackage), VERSION_CHECK_FILE);
|
|
24682
24773
|
const record = {
|
|
24683
24774
|
last_checked: new Date().toISOString(),
|
|
24684
24775
|
latest_eligible: latest
|
|
@@ -24840,8 +24931,8 @@ var NPM_LSP_TABLE = [
|
|
|
24840
24931
|
];
|
|
24841
24932
|
|
|
24842
24933
|
// src/lsp-project-relevance.ts
|
|
24843
|
-
import { existsSync as
|
|
24844
|
-
import { join as
|
|
24934
|
+
import { existsSync as existsSync13, readdirSync as readdirSync4, readFileSync as readFileSync9 } from "node:fs";
|
|
24935
|
+
import { join as join15 } from "node:path";
|
|
24845
24936
|
var MAX_WALK_DIRS = 200;
|
|
24846
24937
|
var MAX_WALK_DEPTH = 4;
|
|
24847
24938
|
var NOISE_DIRS = new Set([
|
|
@@ -24858,7 +24949,7 @@ function hasRootMarker(projectRoot, rootMarkers) {
|
|
|
24858
24949
|
if (!rootMarkers)
|
|
24859
24950
|
return false;
|
|
24860
24951
|
for (const marker of rootMarkers) {
|
|
24861
|
-
if (
|
|
24952
|
+
if (existsSync13(join15(projectRoot, marker)))
|
|
24862
24953
|
return true;
|
|
24863
24954
|
}
|
|
24864
24955
|
return false;
|
|
@@ -24882,7 +24973,7 @@ function hasPackageJsonDep(projectRoot, depNames) {
|
|
|
24882
24973
|
}
|
|
24883
24974
|
function readPackageJson(projectRoot) {
|
|
24884
24975
|
try {
|
|
24885
|
-
const raw = readFileSync9(
|
|
24976
|
+
const raw = readFileSync9(join15(projectRoot, "package.json"), "utf8");
|
|
24886
24977
|
const parsed = JSON.parse(raw);
|
|
24887
24978
|
if (typeof parsed !== "object" || parsed === null)
|
|
24888
24979
|
return null;
|
|
@@ -24912,7 +25003,7 @@ function relevantExtensionsInProject(projectRoot, extToServer) {
|
|
|
24912
25003
|
for (const entry of entries) {
|
|
24913
25004
|
if (entry.isDirectory()) {
|
|
24914
25005
|
if (current.depth < MAX_WALK_DEPTH && !NOISE_DIRS.has(entry.name.toLowerCase())) {
|
|
24915
|
-
queue.push({ dir:
|
|
25006
|
+
queue.push({ dir: join15(current.dir, entry.name), depth: current.depth + 1 });
|
|
24916
25007
|
}
|
|
24917
25008
|
continue;
|
|
24918
25009
|
}
|
|
@@ -25040,8 +25131,8 @@ async function resolveTargetVersion(spec, config, fetchImpl = fetch) {
|
|
|
25040
25131
|
}
|
|
25041
25132
|
function ensureInstallAnchor(cwd) {
|
|
25042
25133
|
try {
|
|
25043
|
-
const stub =
|
|
25044
|
-
if (!
|
|
25134
|
+
const stub = join16(cwd, "package.json");
|
|
25135
|
+
if (!existsSync14(stub)) {
|
|
25045
25136
|
writeFileSync6(stub, `${JSON.stringify({ name: "aft-lsp-cache", version: "0.0.0", private: true })}
|
|
25046
25137
|
`);
|
|
25047
25138
|
}
|
|
@@ -25267,12 +25358,12 @@ function sha256OfFileSync(path) {
|
|
|
25267
25358
|
}
|
|
25268
25359
|
function quarantineCachedNpmInstall(spec, reason) {
|
|
25269
25360
|
const packageDir = lspPackageDir(spec.npm);
|
|
25270
|
-
const dest =
|
|
25361
|
+
const dest = join16(packageDir, "..", ".quarantine", encodeURIComponent(spec.npm), `${Date.now()}`);
|
|
25271
25362
|
warn2(`[lsp] tofu_mismatch ${spec.npm}: ${reason}; quarantining ${packageDir} -> ${dest}`);
|
|
25272
25363
|
try {
|
|
25273
|
-
mkdirSync7(
|
|
25364
|
+
mkdirSync7(join16(dest, ".."), { recursive: true });
|
|
25274
25365
|
rmSync5(dest, { recursive: true, force: true });
|
|
25275
|
-
|
|
25366
|
+
renameSync8(packageDir, dest);
|
|
25276
25367
|
} catch (err) {
|
|
25277
25368
|
warn2(`[lsp] tofu_mismatch ${spec.npm}: failed to quarantine cache entry: ${err}`);
|
|
25278
25369
|
}
|
|
@@ -25352,26 +25443,26 @@ async function pushLspPathsAfterAutoInstall(pool, projectRoot, cachedBinDirs) {
|
|
|
25352
25443
|
}
|
|
25353
25444
|
|
|
25354
25445
|
// src/lsp-github-install.ts
|
|
25355
|
-
import { execFileSync as
|
|
25446
|
+
import { execFileSync as execFileSync3 } from "node:child_process";
|
|
25356
25447
|
import { createHash as createHash5, randomBytes as randomBytes2 } from "node:crypto";
|
|
25357
25448
|
import {
|
|
25358
25449
|
copyFileSync as copyFileSync4,
|
|
25359
25450
|
createReadStream as createReadStream2,
|
|
25360
25451
|
createWriteStream as createWriteStream3,
|
|
25361
|
-
existsSync as
|
|
25452
|
+
existsSync as existsSync15,
|
|
25362
25453
|
lstatSync as lstatSync2,
|
|
25363
25454
|
mkdirSync as mkdirSync8,
|
|
25364
25455
|
readdirSync as readdirSync5,
|
|
25365
25456
|
readFileSync as readFileSync11,
|
|
25366
25457
|
readlinkSync as readlinkSync2,
|
|
25367
25458
|
realpathSync as realpathSync3,
|
|
25368
|
-
renameSync as
|
|
25459
|
+
renameSync as renameSync9,
|
|
25369
25460
|
rmSync as rmSync6,
|
|
25370
25461
|
statSync as statSync9,
|
|
25371
25462
|
unlinkSync as unlinkSync7,
|
|
25372
25463
|
writeFileSync as writeFileSync7
|
|
25373
25464
|
} from "node:fs";
|
|
25374
|
-
import { dirname as dirname6, join as
|
|
25465
|
+
import { dirname as dirname6, join as join17, relative as relative3, resolve as resolve8 } from "node:path";
|
|
25375
25466
|
import { Readable as Readable3 } from "node:stream";
|
|
25376
25467
|
import { pipeline as pipeline3 } from "node:stream/promises";
|
|
25377
25468
|
|
|
@@ -25464,19 +25555,19 @@ function ghCacheRoot() {
|
|
|
25464
25555
|
return getAftLspBinariesDir();
|
|
25465
25556
|
}
|
|
25466
25557
|
function ghPackageDir(spec) {
|
|
25467
|
-
return
|
|
25558
|
+
return join17(ghCacheRoot(), spec.id);
|
|
25468
25559
|
}
|
|
25469
25560
|
function ghBinDir(spec) {
|
|
25470
|
-
return
|
|
25561
|
+
return join17(ghPackageDir(spec), "bin");
|
|
25471
25562
|
}
|
|
25472
25563
|
function ghExtractDir(spec) {
|
|
25473
|
-
return
|
|
25564
|
+
return join17(ghPackageDir(spec), "extracted");
|
|
25474
25565
|
}
|
|
25475
25566
|
var INSTALLED_META_FILE2 = ".aft-installed";
|
|
25476
25567
|
var INSTALL_FAILED_FILE = ".aft-install-failed.json";
|
|
25477
25568
|
var INSTALL_FAILURE_BACKOFF_MS = 6 * 60 * 60 * 1000;
|
|
25478
25569
|
function installFailureMarkerPath(spec) {
|
|
25479
|
-
return
|
|
25570
|
+
return join17(ghPackageDir(spec), INSTALL_FAILED_FILE);
|
|
25480
25571
|
}
|
|
25481
25572
|
function readInstallFailureMarker(spec) {
|
|
25482
25573
|
try {
|
|
@@ -25497,7 +25588,7 @@ function writeInstallFailureMarker(spec, release, sha256, installError) {
|
|
|
25497
25588
|
mkdirSync8(dirname6(path), { recursive: true });
|
|
25498
25589
|
writeFileSync7(tempPath, `${JSON.stringify({ release, sha256, error: markerError, at: new Date().toISOString() })}
|
|
25499
25590
|
`, { encoding: "utf8", mode: 384 });
|
|
25500
|
-
|
|
25591
|
+
renameSync9(tempPath, path);
|
|
25501
25592
|
} catch (err) {
|
|
25502
25593
|
try {
|
|
25503
25594
|
rmSync6(tempPath, { force: true });
|
|
@@ -25518,12 +25609,12 @@ function isFreshInstallFailure(marker) {
|
|
|
25518
25609
|
}
|
|
25519
25610
|
function ghBinaryPath(spec, platform) {
|
|
25520
25611
|
const ext = platform === "win32" ? ".exe" : "";
|
|
25521
|
-
return
|
|
25612
|
+
return join17(ghBinDir(spec), `${spec.binary}${ext}`);
|
|
25522
25613
|
}
|
|
25523
25614
|
function isGithubInstalled(spec, platform) {
|
|
25524
25615
|
for (const candidate of ghBinaryCandidates(spec, platform)) {
|
|
25525
25616
|
try {
|
|
25526
|
-
if (statSync9(
|
|
25617
|
+
if (statSync9(join17(ghBinDir(spec), candidate)).isFile())
|
|
25527
25618
|
return true;
|
|
25528
25619
|
} catch {}
|
|
25529
25620
|
}
|
|
@@ -25536,7 +25627,7 @@ function ghBinaryCandidates(spec, platform) {
|
|
|
25536
25627
|
}
|
|
25537
25628
|
function readGithubInstalledMetaIn(installDir) {
|
|
25538
25629
|
try {
|
|
25539
|
-
const path =
|
|
25630
|
+
const path = join17(installDir, INSTALLED_META_FILE2);
|
|
25540
25631
|
if (!statSync9(path).isFile())
|
|
25541
25632
|
return null;
|
|
25542
25633
|
const parsed = JSON.parse(readFileSync11(path, "utf8"));
|
|
@@ -25563,7 +25654,7 @@ function writeGithubInstalledMetaIn(installDir, version, binarySha256, archiveSh
|
|
|
25563
25654
|
binarySha256,
|
|
25564
25655
|
...archiveSha256 ? { archiveSha256 } : {}
|
|
25565
25656
|
};
|
|
25566
|
-
writeFileSync7(
|
|
25657
|
+
writeFileSync7(join17(installDir, INSTALLED_META_FILE2), JSON.stringify(meta), "utf8");
|
|
25567
25658
|
} catch (err) {
|
|
25568
25659
|
warn2(`[lsp] failed to write github installed metadata in ${installDir}: ${err}`);
|
|
25569
25660
|
}
|
|
@@ -25812,7 +25903,7 @@ function validateExtraction(stagingRoot) {
|
|
|
25812
25903
|
throw new Error(`failed to read staging dir ${dir}: ${err}`);
|
|
25813
25904
|
}
|
|
25814
25905
|
for (const entry of entries) {
|
|
25815
|
-
const full =
|
|
25906
|
+
const full = join17(dir, entry);
|
|
25816
25907
|
let lst;
|
|
25817
25908
|
try {
|
|
25818
25909
|
lst = lstatSync2(full);
|
|
@@ -25858,7 +25949,7 @@ function assertArchiveEntryPath(entry) {
|
|
|
25858
25949
|
}
|
|
25859
25950
|
function precheckWithTar(archivePath, command) {
|
|
25860
25951
|
let totalBytes = 0;
|
|
25861
|
-
const verbose =
|
|
25952
|
+
const verbose = execFileSync3(command, ["-tvf", archivePath], { encoding: "utf8" });
|
|
25862
25953
|
for (const line of verbose.split(`
|
|
25863
25954
|
`)) {
|
|
25864
25955
|
if (line.startsWith("h")) {
|
|
@@ -25871,7 +25962,7 @@ function precheckWithTar(archivePath, command) {
|
|
|
25871
25962
|
totalBytes += Math.max(...numeric);
|
|
25872
25963
|
}
|
|
25873
25964
|
}
|
|
25874
|
-
const names =
|
|
25965
|
+
const names = execFileSync3(command, ["-tf", archivePath], { encoding: "utf8" });
|
|
25875
25966
|
for (const entry of names.split(`
|
|
25876
25967
|
`)) {
|
|
25877
25968
|
if (entry.length > 0)
|
|
@@ -25882,19 +25973,18 @@ function precheckWithTar(archivePath, command) {
|
|
|
25882
25973
|
function precheckArchiveContents(archivePath, archiveType, zipListingMode = "platform") {
|
|
25883
25974
|
let totalBytes = 0;
|
|
25884
25975
|
if (archiveType === "zip" && zipListingMode === "platform" && process.platform !== "win32") {
|
|
25885
|
-
const out =
|
|
25976
|
+
const out = execFileSync3("unzip", ["-l", archivePath], { encoding: "utf8" });
|
|
25886
25977
|
const match = out.match(/^\s*(\d+)\s+\d+\s+files?\s*$/m);
|
|
25887
25978
|
if (match)
|
|
25888
25979
|
totalBytes = Number.parseInt(match[1] ?? "0", 10);
|
|
25889
|
-
const names =
|
|
25980
|
+
const names = execFileSync3("unzip", ["-Z1", archivePath], { encoding: "utf8" });
|
|
25890
25981
|
for (const entry of names.split(`
|
|
25891
25982
|
`)) {
|
|
25892
25983
|
if (entry.length > 0)
|
|
25893
25984
|
assertArchiveEntryPath(entry);
|
|
25894
25985
|
}
|
|
25895
25986
|
} else {
|
|
25896
|
-
|
|
25897
|
-
totalBytes = precheckWithTar(archivePath, command);
|
|
25987
|
+
totalBytes = precheckWithTar(archivePath, windowsTarExecutable());
|
|
25898
25988
|
}
|
|
25899
25989
|
if (totalBytes > MAX_EXTRACT_BYTES2) {
|
|
25900
25990
|
throw new Error(`archive uncompressed size ${totalBytes} exceeds ${MAX_EXTRACT_BYTES2}`);
|
|
@@ -25914,7 +26004,7 @@ function extractArchiveSafely(archivePath, destDir, archiveType) {
|
|
|
25914
26004
|
try {
|
|
25915
26005
|
rmSync6(destDir, { recursive: true, force: true });
|
|
25916
26006
|
} catch {}
|
|
25917
|
-
|
|
26007
|
+
renameSync9(stagingDir, destDir);
|
|
25918
26008
|
} catch (err) {
|
|
25919
26009
|
try {
|
|
25920
26010
|
rmSync6(stagingDir, { recursive: true, force: true });
|
|
@@ -25924,12 +26014,12 @@ function extractArchiveSafely(archivePath, destDir, archiveType) {
|
|
|
25924
26014
|
}
|
|
25925
26015
|
function quarantineCachedGithubInstall(spec, reason) {
|
|
25926
26016
|
const packageDir = ghPackageDir(spec);
|
|
25927
|
-
const dest =
|
|
26017
|
+
const dest = join17(ghCacheRoot(), ".quarantine", encodeURIComponent(spec.id), `${Date.now()}`);
|
|
25928
26018
|
warn2(`[lsp] tofu_mismatch ${spec.id}: ${reason}; quarantining ${packageDir} -> ${dest}`);
|
|
25929
26019
|
try {
|
|
25930
26020
|
mkdirSync8(dirname6(dest), { recursive: true });
|
|
25931
26021
|
rmSync6(dest, { recursive: true, force: true });
|
|
25932
|
-
|
|
26022
|
+
renameSync9(packageDir, dest);
|
|
25933
26023
|
} catch (err) {
|
|
25934
26024
|
warn2(`[lsp] tofu_mismatch ${spec.id}: failed to quarantine cache entry: ${err}`);
|
|
25935
26025
|
}
|
|
@@ -25937,7 +26027,7 @@ function quarantineCachedGithubInstall(spec, reason) {
|
|
|
25937
26027
|
function validateCachedGithubInstall(spec, platform) {
|
|
25938
26028
|
const packageDir = ghPackageDir(spec);
|
|
25939
26029
|
const meta = readGithubInstalledMetaIn(packageDir);
|
|
25940
|
-
const binaryPath = ghBinaryCandidates(spec, platform).map((candidate) =>
|
|
26030
|
+
const binaryPath = ghBinaryCandidates(spec, platform).map((candidate) => join17(ghBinDir(spec), candidate)).find((candidate) => {
|
|
25941
26031
|
try {
|
|
25942
26032
|
return statSync9(candidate).isFile();
|
|
25943
26033
|
} catch {
|
|
@@ -25973,30 +26063,21 @@ function validateCachedGithubInstall(spec, platform) {
|
|
|
25973
26063
|
function runPlatformExtractor(archivePath, destDir, archiveType) {
|
|
25974
26064
|
if (archiveType === "zip") {
|
|
25975
26065
|
if (process.platform === "win32") {
|
|
25976
|
-
|
|
25977
|
-
stdio: "pipe",
|
|
25978
|
-
timeout: 180000
|
|
25979
|
-
});
|
|
26066
|
+
execTarExtractionSync(["-xf", archivePath, "-C", destDir], 180000);
|
|
25980
26067
|
return;
|
|
25981
26068
|
}
|
|
25982
|
-
|
|
26069
|
+
execFileSync3("unzip", ["-q", "-o", archivePath, "-d", destDir], {
|
|
25983
26070
|
stdio: "pipe",
|
|
25984
26071
|
timeout: 180000
|
|
25985
26072
|
});
|
|
25986
26073
|
return;
|
|
25987
26074
|
}
|
|
25988
26075
|
if (archiveType === "tar.gz") {
|
|
25989
|
-
|
|
25990
|
-
stdio: "pipe",
|
|
25991
|
-
timeout: 180000
|
|
25992
|
-
});
|
|
26076
|
+
execTarExtractionSync(["-xzf", archivePath, "-C", destDir], 180000);
|
|
25993
26077
|
return;
|
|
25994
26078
|
}
|
|
25995
26079
|
if (archiveType === "tar.xz") {
|
|
25996
|
-
|
|
25997
|
-
stdio: "pipe",
|
|
25998
|
-
timeout: 180000
|
|
25999
|
-
});
|
|
26080
|
+
execTarExtractionSync(["-xf", archivePath, "-C", destDir], 180000);
|
|
26000
26081
|
return;
|
|
26001
26082
|
}
|
|
26002
26083
|
throw new Error(`unsupported archive type: ${archiveType}`);
|
|
@@ -26017,7 +26098,7 @@ async function downloadAndInstall(spec, tag, assets, platform, arch, fetchImpl,
|
|
|
26017
26098
|
}
|
|
26018
26099
|
const pkgDir = ghPackageDir(spec);
|
|
26019
26100
|
const extractDir = ghExtractDir(spec);
|
|
26020
|
-
const archivePath =
|
|
26101
|
+
const archivePath = join17(pkgDir, expected.name);
|
|
26021
26102
|
log2(`[lsp] downloading ${spec.id} ${tag} → ${matchingAsset.url}`);
|
|
26022
26103
|
try {
|
|
26023
26104
|
await downloadFile(matchingAsset.url, archivePath, fetchImpl, matchingAsset.size, signal);
|
|
@@ -26059,8 +26140,8 @@ async function downloadAndInstall(spec, tag, assets, platform, arch, fetchImpl,
|
|
|
26059
26140
|
unlinkSync7(archivePath);
|
|
26060
26141
|
} catch {}
|
|
26061
26142
|
}
|
|
26062
|
-
const innerBinaryPath =
|
|
26063
|
-
if (!
|
|
26143
|
+
const innerBinaryPath = join17(extractDir, spec.binaryPathInArchive(platform, arch, version));
|
|
26144
|
+
if (!existsSync15(innerBinaryPath)) {
|
|
26064
26145
|
const message = `extracted binary not found at ${innerBinaryPath}`;
|
|
26065
26146
|
error2(`[lsp] ${spec.id}: ${message}`);
|
|
26066
26147
|
return { ok: false, sha256: archiveSha256, error: message };
|
|
@@ -26165,7 +26246,7 @@ function runGithubAutoInstall(relevantServers, config, fetchImpl = fetch) {
|
|
|
26165
26246
|
if (!host) {
|
|
26166
26247
|
for (const spec of GITHUB_LSP_TABLE) {
|
|
26167
26248
|
try {
|
|
26168
|
-
if (
|
|
26249
|
+
if (existsSync15(ghBinDir(spec))) {
|
|
26169
26250
|
cachedBinDirs.push(ghBinDir(spec));
|
|
26170
26251
|
}
|
|
26171
26252
|
} catch {}
|
|
@@ -27031,9 +27112,11 @@ var EditParams = Type2.Object({
|
|
|
27031
27112
|
path: Type2.String({
|
|
27032
27113
|
description: "Path to the file to edit (absolute or relative to project root)"
|
|
27033
27114
|
}),
|
|
27034
|
-
symbol: Type2.Optional(Type2.String({
|
|
27115
|
+
symbol: Type2.Optional(Type2.String({
|
|
27116
|
+
description: "Named symbol to replace; only meaningful together with `content`. A call carrying one without the other is incomplete."
|
|
27117
|
+
})),
|
|
27035
27118
|
content: Type2.Optional(Type2.String({
|
|
27036
|
-
description: "Replacement content for symbol mode. For whole-file writes, use the `write` tool."
|
|
27119
|
+
description: "Replacement content for symbol mode; only meaningful together with `symbol`. A call carrying one without the other is incomplete. For whole-file writes, use the `write` tool."
|
|
27037
27120
|
})),
|
|
27038
27121
|
appendContent: Type2.Optional(Type2.String({
|
|
27039
27122
|
description: "Append text to the end of the file (creates the file if missing, parent dirs auto-created). When set, other edit modes are ignored."
|
|
@@ -27302,7 +27385,7 @@ PDFs aren't supported on the Pi harness yet.`, response);
|
|
|
27302
27385
|
pi.registerTool(withPathAliasPreparation({
|
|
27303
27386
|
name: editName,
|
|
27304
27387
|
label: editName,
|
|
27305
|
-
description: "Edit part of a file via `appendContent`, batch `edits[]`, or symbol plus `content`. Batch `{ oldString, newString, replaceAll: true }` replaces every match. Provide exactly one mode per call: appendContent, edits[], or symbol plus content (mixing modes is rejected)." + (resolveGithubConfig(ctx.config).write ? ' GitHub conversation comments can be edited with `edit("issue://N/comments/K", edits=[{oldString, newString}])` or the equivalent `pr://` path.' : ""),
|
|
27388
|
+
description: "Edit part of a file via `appendContent`, batch `edits[]`, or symbol plus `content`. `symbol` and `content` are only meaningful together; a call carrying one without the other is incomplete. Batch `{ oldString, newString, replaceAll: true }` replaces every match. Provide exactly one mode per call: appendContent, edits[], or symbol plus content (mixing modes is rejected)." + (resolveGithubConfig(ctx.config).write ? ' GitHub conversation comments can be edited with `edit("issue://N/comments/K", edits=[{oldString, newString}])` or the equivalent `pr://` path.' : ""),
|
|
27306
27389
|
promptSnippet: "Partial file edits via appendContent, edits[], or symbol plus content (exactly one mode per call).",
|
|
27307
27390
|
promptGuidelines: [
|
|
27308
27391
|
`Prefer ${editName} over ${writeName} when changing part of an existing file.`,
|
|
@@ -29077,7 +29160,7 @@ var InspectParams = Type8.Object({
|
|
|
29077
29160
|
description: "Categories to include in detailed drill-down (e.g. 'todos' or ['todos', 'dead_code', 'cycles']). Use 'all' for every active category. Omit for summary-only mode. `sections` changes detail, not the categories verified."
|
|
29078
29161
|
})),
|
|
29079
29162
|
scope: Type8.Optional(Type8.Union([Type8.String(), Type8.Array(Type8.String())], {
|
|
29080
|
-
description: "Restrict returned results to paths under this scope (file or directory
|
|
29163
|
+
description: "Restrict returned results to paths under this scope (one path, or an array of paths — not a space-separated list; file or directory; absolute or relative to project root). `scope=` narrows results and limits Rust LSP startup to owning Cargo workspaces; it does not trigger per-file diagnostic collection. Scoped files no producer has authoritatively analyzed are reported as named gaps (complete: false), never as a clean empty result."
|
|
29081
29164
|
})),
|
|
29082
29165
|
topK: Type8.Optional(Type8.Integer({
|
|
29083
29166
|
minimum: 1,
|
|
@@ -29920,11 +30003,11 @@ var SafetyParams = Type11.Object({
|
|
|
29920
30003
|
description: "Safety operation"
|
|
29921
30004
|
}),
|
|
29922
30005
|
path: Type11.Optional(Type11.String({
|
|
29923
|
-
description: "File path (required for history, optional for undo). Absolute or relative to project root."
|
|
30006
|
+
description: "File path (required for history, optional for undo, optional for restore — restores only that file). Absolute or relative to project root."
|
|
29924
30007
|
})),
|
|
29925
30008
|
name: Type11.Optional(Type11.String({ description: "Checkpoint name (required for checkpoint, restore)" })),
|
|
29926
30009
|
files: Type11.Optional(Type11.Array(Type11.String(), {
|
|
29927
|
-
description: "Specific files for checkpoint (optional
|
|
30010
|
+
description: "Specific files for checkpoint, or to restore from a checkpoint (optional; restore without path/files restores the whole checkpoint; explicit checkpoint files may be untracked or gitignored)"
|
|
29928
30011
|
}))
|
|
29929
30012
|
});
|
|
29930
30013
|
function buildSafetySections(args, payload, theme) {
|
|
@@ -30023,7 +30106,7 @@ function registerSafetyTool(pi, ctx) {
|
|
|
30023
30106
|
pi.registerTool(withPathAliasPreparation({
|
|
30024
30107
|
name: "aft_safety",
|
|
30025
30108
|
label: "safety",
|
|
30026
|
-
description: "File safety and recovery operations. Ops: `undo` (omit path to undo the entire last tool call; pass path to pop latest snapshot for one file — irreversible), `history` (list snapshots for a file), `checkpoint` (save named snapshot), `restore` (restore named checkpoint), `list` (list checkpoints). Per-file undo stack is capped at 20.",
|
|
30109
|
+
description: "File safety and recovery operations. Ops: `undo` (omit path to undo the entire last tool call; pass path to pop latest snapshot for one file — irreversible), `history` (list snapshots for a file), `checkpoint` (save named snapshot), `restore` (restore named checkpoint; optional path/files scopes it), `list` (list checkpoints). Per-file undo stack is capped at 20.",
|
|
30027
30110
|
parameters: SafetyParams,
|
|
30028
30111
|
async execute(_toolCallId, params, _signal, _onUpdate, extCtx) {
|
|
30029
30112
|
if (params.op === "history" && !params.path) {
|
|
@@ -30283,19 +30366,20 @@ function registerSemanticTool(pi, ctx) {
|
|
|
30283
30366
|
}
|
|
30284
30367
|
const bridge = bridgeFor(ctx, extCtx.cwd);
|
|
30285
30368
|
const req = { query: params.query };
|
|
30369
|
+
const includeTests = !isEmptyParam(params.includeTests) ? coerceBoolean(params.includeTests) : undefined;
|
|
30286
30370
|
if (params.topK !== undefined)
|
|
30287
30371
|
req.topK = params.topK;
|
|
30288
30372
|
if (params.offset !== undefined)
|
|
30289
30373
|
req.offset = params.offset;
|
|
30290
|
-
if (
|
|
30291
|
-
req.includeTests =
|
|
30374
|
+
if (includeTests !== undefined)
|
|
30375
|
+
req.includeTests = includeTests;
|
|
30292
30376
|
if (params.path !== undefined)
|
|
30293
30377
|
req.path = params.path;
|
|
30294
30378
|
const response = await callToolCall(bridge, "search", req, extCtx, signal ? { abortSignal: signal } : undefined);
|
|
30295
30379
|
if (response.success === false) {
|
|
30296
30380
|
throw new Error(response.text || response.message || "search failed");
|
|
30297
30381
|
}
|
|
30298
|
-
const text = surfaceSearchText(response, continuity, resolveSessionId(extCtx) ?? "unknown-session", continuityKey(selectedProjectRoot(extCtx.cwd, params.path), params.query,
|
|
30382
|
+
const text = surfaceSearchText(response, continuity, resolveSessionId(extCtx) ?? "unknown-session", continuityKey(selectedProjectRoot(extCtx.cwd, params.path), params.query, includeTests, params.topK));
|
|
30299
30383
|
return textResult(text, text === response.text ? response : { ...response, text });
|
|
30300
30384
|
},
|
|
30301
30385
|
renderCall(args, theme, context) {
|
|
@@ -30634,11 +30718,11 @@ var PLUGIN_VERSION = (() => {
|
|
|
30634
30718
|
return "0.0.0";
|
|
30635
30719
|
}
|
|
30636
30720
|
})();
|
|
30637
|
-
var ANNOUNCEMENT_VERSION = "0.
|
|
30721
|
+
var ANNOUNCEMENT_VERSION = "0.57.0";
|
|
30638
30722
|
var ANNOUNCEMENT_FEATURES = [
|
|
30639
|
-
"
|
|
30640
|
-
"
|
|
30641
|
-
"
|
|
30723
|
+
"OpenCode 2 is supported: tools, permission prompts, the sidebar and cancellation all work on the GA host, and an end-to-end matrix guards them.",
|
|
30724
|
+
"`doctor` configures a machine that has only OpenCode 2 installed, and `--fix` no longer skips unrelated repairs when it cannot decide the generation.",
|
|
30725
|
+
"A code-health scan no longer starts while the same project is still building its call graph, which cost about 90 MB of peak memory on large repositories."
|
|
30642
30726
|
];
|
|
30643
30727
|
var ANNOUNCEMENT_FOOTER = "Join us on Discord: https://discord.gg/DSa65w8wuf";
|
|
30644
30728
|
var pendingEagerWarnings = new Map;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lsp-github-install.d.ts","sourceRoot":"","sources":["../src/lsp-github-install.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;
|
|
1
|
+
{"version":3,"file":"lsp-github-install.d.ts","sourceRoot":"","sources":["../src/lsp-github-install.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AA2CH,OAAO,EACL,KAAK,IAAI,EACT,kBAAkB,EAClB,oBAAoB,EACpB,gBAAgB,EAChB,KAAK,gBAAgB,EACrB,KAAK,QAAQ,E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EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC/C;;;;OAIG;IACH,gBAAgB,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IAChC,0DAA0D;IAC1D,gBAAgB,EAAE,MAAM,MAAM,EAAE,CAAC;CAClC;AAsBD,wBAAsB,2BAA2B,IAAI,OAAO,CAAC,IAAI,CAAC,CAMjE;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAClC,eAAe,EAAE,WAAW,CAAC,MAAM,CAAC,EACpC,MAAM,EAAE,mBAAmB,EAC3B,SAAS,GAAE,OAAO,KAAa,GAC9B,uBAAuB,CAoGzB;AAID;;;;GAIG;AACH,wBAAgB,6BAA6B,CAAC,WAAW,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CAyC9E;AAID,+DAA+D;AAC/D,OAAO,EACL,KAAK,IAAI,EACT,wBAAwB,IAAI,mCAAmC,EAC/D,kBAAkB,EAClB,YAAY,IAAI,uBAAuB,EACvC,oBAAoB,EACpB,gBAAgB,EAChB,KAAK,gBAAgB,EACrB,KAAK,QAAQ,EACb,uBAAuB,IAAI,8BAA8B,GAC1D,CAAC"}
|
package/dist/shared/status.d.ts
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
import { formatSemanticIndexStatus, type SemanticIndexStatusKind, semanticIndexStatusKind } from "@cortexkit/aft-bridge";
|
|
2
|
+
/**
|
|
3
|
+
* The semantic-index status formatter lives in @cortexkit/aft-bridge because
|
|
4
|
+
* both plugin hosts render it and two copies is how the same defect once
|
|
5
|
+
* shipped twice: this file used to hold its own version, which still rendered a
|
|
6
|
+
* dead index as a rebuild long after the other host was fixed. Re-exported here
|
|
7
|
+
* so this module stays the one status import for the rest of the plugin.
|
|
8
|
+
*/
|
|
9
|
+
export { formatSemanticIndexStatus, type SemanticIndexStatusKind, semanticIndexStatusKind };
|
|
1
10
|
export interface StatusCompressionAggregate {
|
|
2
11
|
events: number;
|
|
3
12
|
original_tokens: number;
|
|
@@ -91,7 +100,6 @@ export interface AftStatusSnapshot {
|
|
|
91
100
|
}
|
|
92
101
|
/** Neutral label for cache_role. Worktree/read_only borrow the shared repo index; they are not a failure. */
|
|
93
102
|
export declare function formatCacheRoleLabel(role: string): string;
|
|
94
|
-
export declare function formatSemanticIndexStatus(status: string, stage?: string | null): string;
|
|
95
103
|
export declare function formatSemanticRefreshing(refreshingCount: number): string | null;
|
|
96
104
|
export declare function formatBytes(bytes: number): string;
|
|
97
105
|
export declare function coerceAftStatus(response: Record<string, unknown>): AftStatusSnapshot;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/shared/status.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,0BAA0B;IACzC,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,MAAM,CAAC;IACxB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,0BAA0B,CAAC;IACpC,OAAO,EAAE,0BAA0B,CAAC;CACrC;AAED;;;;GAIG;AACH,MAAM,WAAW,SAAS;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC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ceRoot":"","sources":["../../src/tools/hoisted.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAWH,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,YAAY,EAEjB,KAAK,KAAK,EACX,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,KAAK,SAAS,EAAqB,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAGjF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAajD,OAAO,EAGL,KAAK,uBAAuB,EAC7B,MAAM,qBAAqB,CAAC;AA+C7B,qFAAqF;AACrF,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAE/E;AAqBD;;;;GAIG;AACH,UAAU,iBAAiB;IACzB,IAAI,EAAE,OAAO,CAAC;IACd,aAAa,EAAE,SAAS,GAAG,SAAS,CAAC;IACrC,OAAO,EAAE,OAAO,CAAC;CAClB;AAuFD;;;;;;;;;GASG;AACH,wBAAsB,iCAAiC,CACrD,MAAM,EAAE;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,EACvB,MAAM,EAAE,MAAM,EACd,OAAO,GAAE;IAAE,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAAC,mBAAmB,CAAC,EAAE,OAAO,CAAA;CAAO,GAC/E,OAAO,CAAC,IAAI,CAAC,CA6Bf;
|
|
1
|
+
{"version":3,"file":"hoisted.d.ts","sourceRoot":"","sources":["../../src/tools/hoisted.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAWH,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,YAAY,EAEjB,KAAK,KAAK,EACX,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,KAAK,SAAS,EAAqB,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAGjF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAajD,OAAO,EAGL,KAAK,uBAAuB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M,YAAY;;;;;;EAwCjB,CAAC;AAEF,wCAAwC;AACxC,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,MAAM,CAAC,OAAO,YAAY,CAAC,EACjC,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,GACX,MAAM,EAAE,CA+FV;AAED,wCAAwC;AACxC,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,MAAM,CAAC,OAAO,YAAY,CAAC,EACjC,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,iBAAiB,yCAG3B;AAED,wCAAwC;AACxC,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,eAAe,CAAC,OAAO,CAAC,EAChC,IAAI,EAAE,MAAM,CAAC,OAAO,YAAY,CAAC,EACjC,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,iBAAiB,EAC1B,OAAO,GAAE,uBAA4C,sFAUtD;AAED,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,YAAY,EAAE,GAAG,EAAE,aAAa,GAAG,IAAI,CAuE/E"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cortexkit/aft-pi",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.57.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Pi coding agent extension for Agent File Tools (AFT) — tree-sitter and LSP-powered code analysis",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -23,19 +23,19 @@
|
|
|
23
23
|
"test:unit": "bun test src/__tests__ --path-ignore-patterns 'src/__tests__/e2e/**'"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@cortexkit/aft-bridge": "0.
|
|
26
|
+
"@cortexkit/aft-bridge": "0.57.0",
|
|
27
27
|
"comment-json": "^5.0.0",
|
|
28
28
|
"diff": "^8.0.4",
|
|
29
29
|
"typebox": "1.1.38",
|
|
30
30
|
"zod": "^4.4.3"
|
|
31
31
|
},
|
|
32
32
|
"optionalDependencies": {
|
|
33
|
-
"@cortexkit/aft-darwin-arm64": "0.
|
|
34
|
-
"@cortexkit/aft-darwin-x64": "0.
|
|
35
|
-
"@cortexkit/aft-linux-arm64": "0.
|
|
36
|
-
"@cortexkit/aft-linux-x64": "0.
|
|
37
|
-
"@cortexkit/aft-win32-arm64": "0.
|
|
38
|
-
"@cortexkit/aft-win32-x64": "0.
|
|
33
|
+
"@cortexkit/aft-darwin-arm64": "0.57.0",
|
|
34
|
+
"@cortexkit/aft-darwin-x64": "0.57.0",
|
|
35
|
+
"@cortexkit/aft-linux-arm64": "0.57.0",
|
|
36
|
+
"@cortexkit/aft-linux-x64": "0.57.0",
|
|
37
|
+
"@cortexkit/aft-win32-arm64": "0.57.0",
|
|
38
|
+
"@cortexkit/aft-win32-x64": "0.57.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@earendil-works/pi-coding-agent": "^0.80.2",
|