@cortexkit/aft 0.50.0 → 0.50.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +163 -50
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -2076,7 +2076,8 @@ var init_platform = __esm(() => {
2076
2076
  // ../aft-bridge/dist/downloader.js
2077
2077
  import { spawnSync } from "node:child_process";
2078
2078
  import { createHash as createHash2, randomUUID } from "node:crypto";
2079
- import { chmodSync, closeSync, copyFileSync, createWriteStream, existsSync as existsSync2, mkdirSync, openSync, readFileSync as readFileSync3, renameSync, rmSync, statSync as statSync2, unlinkSync, writeSync } from "node:fs";
2079
+ import { chmodSync, closeSync, copyFileSync, createWriteStream, existsSync as existsSync2, mkdirSync, openSync, readdirSync, readFileSync as readFileSync3, renameSync, rmSync, statSync as statSync2, unlinkSync, writeSync } from "node:fs";
2080
+ import { hostname } from "node:os";
2080
2081
  import { join as join4 } from "node:path";
2081
2082
  import { Readable } from "node:stream";
2082
2083
  import { pipeline } from "node:stream/promises";
@@ -2147,11 +2148,37 @@ async function downloadBinary(version) {
2147
2148
  let binaryTimeout = null;
2148
2149
  let checksumTimeout = null;
2149
2150
  const tmpPath = `${binaryPath}.${process.pid}.${Date.now()}.${Math.random().toString(16).slice(2)}.tmp`;
2151
+ const cleanUpPartialDownload = () => {
2152
+ try {
2153
+ if (existsSync2(tmpPath))
2154
+ unlinkSync(tmpPath);
2155
+ } catch {}
2156
+ };
2157
+ let interrupted = false;
2158
+ const cleanUpInterruptedDownload = () => {
2159
+ if (interrupted)
2160
+ return;
2161
+ interrupted = true;
2162
+ binaryController?.abort();
2163
+ checksumController?.abort();
2164
+ cleanUpPartialDownload();
2165
+ releaseLock?.();
2166
+ releaseLock = null;
2167
+ };
2168
+ const handleSigint = () => {
2169
+ cleanUpInterruptedDownload();
2170
+ process.off("SIGINT", handleSigint);
2171
+ process.kill(process.pid, "SIGINT");
2172
+ };
2173
+ const handleExit = () => cleanUpInterruptedDownload();
2174
+ process.once("SIGINT", handleSigint);
2175
+ process.once("exit", handleExit);
2150
2176
  try {
2151
2177
  if (!existsSync2(versionedCacheDir)) {
2152
2178
  mkdirSync(versionedCacheDir, { recursive: true });
2153
2179
  }
2154
2180
  releaseLock = await acquireDownloadLock(lockPath);
2181
+ sweepStaleDownloadTemps(versionedCacheDir, binaryName);
2155
2182
  if (existsSync2(binaryPath) && isExpectedCachedBinary(binaryPath, tag)) {
2156
2183
  return binaryPath;
2157
2184
  }
@@ -2227,13 +2254,11 @@ async function downloadBinary(version) {
2227
2254
  } catch (err) {
2228
2255
  const msg = err instanceof Error ? err.message : String(err);
2229
2256
  error(`Failed to download AFT binary: ${msg}`);
2230
- if (existsSync2(tmpPath)) {
2231
- try {
2232
- unlinkSync(tmpPath);
2233
- } catch {}
2234
- }
2257
+ cleanUpPartialDownload();
2235
2258
  return null;
2236
2259
  } finally {
2260
+ process.off("SIGINT", handleSigint);
2261
+ process.off("exit", handleExit);
2237
2262
  if (binaryTimeout) {
2238
2263
  binaryController?.abort();
2239
2264
  clearTimeout(binaryTimeout);
@@ -2259,17 +2284,85 @@ async function ensureBinary(version) {
2259
2284
  log("No cached binary found, downloading latest...");
2260
2285
  return downloadBinary();
2261
2286
  }
2262
- async function acquireDownloadLock(lockPath) {
2287
+ function createDownloadLockOwner() {
2288
+ return JSON.stringify({
2289
+ pid: process.pid,
2290
+ hostname: hostname(),
2291
+ createdAt: Date.now(),
2292
+ token: randomUUID()
2293
+ });
2294
+ }
2295
+ function parseDownloadLockOwner(raw) {
2296
+ try {
2297
+ const parsed = JSON.parse(raw);
2298
+ if (typeof parsed === "object" && parsed !== null) {
2299
+ const { pid, hostname: ownerHostname } = parsed;
2300
+ return {
2301
+ pid: typeof pid === "number" && Number.isSafeInteger(pid) && pid > 0 ? pid : null,
2302
+ hostname: typeof ownerHostname === "string" && ownerHostname ? ownerHostname : null
2303
+ };
2304
+ }
2305
+ } catch {}
2306
+ const legacyPid = Number(raw.split(":", 1)[0]);
2307
+ return {
2308
+ pid: Number.isSafeInteger(legacyPid) && legacyPid > 0 ? legacyPid : null,
2309
+ hostname: null
2310
+ };
2311
+ }
2312
+ function isProcessAlive(pid) {
2313
+ try {
2314
+ process.kill(pid, 0);
2315
+ return true;
2316
+ } catch (err) {
2317
+ return err.code !== "ESRCH";
2318
+ }
2319
+ }
2320
+ function isReclaimableDownloadLock(owner, ageMs, staleMs) {
2321
+ if (Math.abs(ageMs) > staleMs)
2322
+ return true;
2323
+ return (owner.hostname === null || owner.hostname === hostname()) && owner.pid !== null && !isProcessAlive(owner.pid);
2324
+ }
2325
+ function reclaimDownloadLock(lockPath, expectedOwner) {
2326
+ try {
2327
+ if (readFileSync3(lockPath, "utf-8") !== expectedOwner)
2328
+ return false;
2329
+ rmSync(lockPath, { force: true });
2330
+ return true;
2331
+ } catch (err) {
2332
+ if (err.code === "ENOENT")
2333
+ return true;
2334
+ throw err;
2335
+ }
2336
+ }
2337
+ function sweepStaleDownloadTemps(versionedCacheDir, binaryName) {
2338
+ const tempPrefix = `${binaryName}.`;
2339
+ try {
2340
+ for (const entry of readdirSync(versionedCacheDir, { withFileTypes: true })) {
2341
+ if (!entry.isFile() || !entry.name.startsWith(tempPrefix) || !entry.name.endsWith(".tmp")) {
2342
+ continue;
2343
+ }
2344
+ const tempPath = join4(versionedCacheDir, entry.name);
2345
+ const ageMs = Date.now() - statSync2(tempPath).mtimeMs;
2346
+ if (Math.abs(ageMs) > DOWNLOAD_LOCK_STALE_MS)
2347
+ unlinkSync(tempPath);
2348
+ }
2349
+ } catch {}
2350
+ }
2351
+ async function acquireDownloadLock(lockPath, timing = {}) {
2352
+ const timeoutMs = timing.timeoutMs ?? DOWNLOAD_LOCK_TIMEOUT_MS;
2353
+ const staleMs = timing.staleMs ?? DOWNLOAD_LOCK_STALE_MS;
2354
+ const pollIntervalMs = timing.pollIntervalMs ?? 100;
2263
2355
  const startedAt = Date.now();
2264
2356
  while (true) {
2265
2357
  try {
2266
- const owner = `${process.pid}:${Date.now()}:${randomUUID()}`;
2358
+ const owner = createDownloadLockOwner();
2267
2359
  const fd = openSync(lockPath, "wx");
2268
- writeSync(fd, owner);
2360
+ try {
2361
+ writeSync(fd, owner);
2362
+ } finally {
2363
+ closeSync(fd);
2364
+ }
2269
2365
  return () => {
2270
- try {
2271
- closeSync(fd);
2272
- } catch {}
2273
2366
  try {
2274
2367
  if (readFileSync3(lockPath, "utf-8") === owner) {
2275
2368
  rmSync(lockPath, { force: true });
@@ -2280,19 +2373,24 @@ async function acquireDownloadLock(lockPath) {
2280
2373
  const code = err.code;
2281
2374
  if (code !== "EEXIST")
2282
2375
  throw err;
2376
+ let existingOwner;
2377
+ let ageMs;
2283
2378
  try {
2284
- const ageMs = Date.now() - statSync2(lockPath).mtimeMs;
2285
- if (ageMs > DOWNLOAD_LOCK_STALE_MS) {
2286
- rmSync(lockPath, { force: true });
2379
+ existingOwner = readFileSync3(lockPath, "utf-8");
2380
+ ageMs = Date.now() - statSync2(lockPath).mtimeMs;
2381
+ } catch (readErr) {
2382
+ if (readErr.code === "ENOENT")
2383
+ continue;
2384
+ throw readErr;
2385
+ }
2386
+ if (isReclaimableDownloadLock(parseDownloadLockOwner(existingOwner), ageMs, staleMs)) {
2387
+ if (reclaimDownloadLock(lockPath, existingOwner))
2287
2388
  continue;
2288
- }
2289
- } catch {
2290
- continue;
2291
2389
  }
2292
- if (Date.now() - startedAt > DOWNLOAD_LOCK_TIMEOUT_MS) {
2390
+ if (Date.now() - startedAt > timeoutMs) {
2293
2391
  throw new Error(`Timed out waiting for download lock: ${lockPath}`);
2294
2392
  }
2295
- await new Promise((resolve3) => setTimeout(resolve3, 100));
2393
+ await new Promise((resolve3) => setTimeout(resolve3, pollIntervalMs));
2296
2394
  }
2297
2395
  }
2298
2396
  }
@@ -2327,7 +2425,7 @@ async function fetchLatestTag() {
2327
2425
  clearTimeout(timeout);
2328
2426
  }
2329
2427
  }
2330
- var REPO = "cortexkit/aft", DOWNLOAD_TIMEOUT_MS = 300000, LATEST_TAG_TIMEOUT_MS = 30000, MAX_DOWNLOAD_BYTES, DOWNLOAD_LOCK_TIMEOUT_MS = 120000, DOWNLOAD_LOCK_STALE_MS;
2428
+ var REPO = "cortexkit/aft", DOWNLOAD_TIMEOUT_MS = 300000, LATEST_TAG_TIMEOUT_MS = 30000, MAX_DOWNLOAD_BYTES, DOWNLOAD_LOCK_STALE_MS, DOWNLOAD_LOCK_TIMEOUT_MS;
2331
2429
  var init_downloader = __esm(() => {
2332
2430
  init_active_logger();
2333
2431
  init_cache_paths();
@@ -2335,6 +2433,7 @@ var init_downloader = __esm(() => {
2335
2433
  init_cache_paths();
2336
2434
  MAX_DOWNLOAD_BYTES = 200 * 1024 * 1024;
2337
2435
  DOWNLOAD_LOCK_STALE_MS = 10 * 60000;
2436
+ DOWNLOAD_LOCK_TIMEOUT_MS = DOWNLOAD_LOCK_STALE_MS + 30000;
2338
2437
  });
2339
2438
 
2340
2439
  // ../aft-bridge/dist/durable-log.js
@@ -7291,7 +7390,7 @@ var init_migration = __esm(() => {
7291
7390
 
7292
7391
  // ../aft-bridge/dist/npm-resolver.js
7293
7392
  import { execFileSync } from "node:child_process";
7294
- import { readdirSync, statSync as statSync5 } from "node:fs";
7393
+ import { readdirSync as readdirSync2, statSync as statSync5 } from "node:fs";
7295
7394
  import { homedir as homedir9 } from "node:os";
7296
7395
  import { delimiter, dirname as dirname4, isAbsolute as isAbsolute3, join as join9 } from "node:path";
7297
7396
  function defaultDeps() {
@@ -7331,7 +7430,7 @@ function npmAdjacentToNode(deps) {
7331
7430
  function highestVersionedNodeBin(installsDir, name) {
7332
7431
  let entries;
7333
7432
  try {
7334
- entries = readdirSync(installsDir);
7433
+ entries = readdirSync2(installsDir);
7335
7434
  } catch {
7336
7435
  return null;
7337
7436
  }
@@ -7426,7 +7525,7 @@ var init_npm_resolver = () => {};
7426
7525
  // ../aft-bridge/dist/onnx-runtime.js
7427
7526
  import { execFileSync as execFileSync2 } from "node:child_process";
7428
7527
  import { createHash as createHash4 } from "node:crypto";
7429
- import { chmodSync as chmodSync3, closeSync as closeSync4, copyFileSync as copyFileSync3, createWriteStream as createWriteStream2, existsSync as existsSync7, lstatSync, mkdirSync as mkdirSync5, openSync as openSync4, readdirSync as readdirSync2, readFileSync as readFileSync6, readlinkSync, realpathSync as realpathSync2, rmSync as rmSync3, statSync as statSync6, symlinkSync, unlinkSync as unlinkSync4, writeFileSync as writeFileSync3 } from "node:fs";
7528
+ import { chmodSync as chmodSync3, closeSync as closeSync4, copyFileSync as copyFileSync3, createWriteStream as createWriteStream2, existsSync as existsSync7, lstatSync, mkdirSync as mkdirSync5, openSync as openSync4, readdirSync as readdirSync3, readFileSync as readFileSync6, readlinkSync, realpathSync as realpathSync2, rmSync as rmSync3, statSync as statSync6, symlinkSync, unlinkSync as unlinkSync4, writeFileSync as writeFileSync3 } from "node:fs";
7430
7529
  import { basename as basename2, dirname as dirname5, isAbsolute as isAbsolute4, join as join10, relative as relative2, resolve as resolve6, win32 } from "node:path";
7431
7530
  import { Readable as Readable2 } from "node:stream";
7432
7531
  import { pipeline as pipeline2 } from "node:stream/promises";
@@ -7503,7 +7602,7 @@ async function ensureOnnxRuntime(storageDir) {
7503
7602
  }
7504
7603
  function cleanupAbandonedStagingDirs(onnxBaseDir) {
7505
7604
  try {
7506
- const entries = readdirSync2(onnxBaseDir);
7605
+ const entries = readdirSync3(onnxBaseDir);
7507
7606
  for (const entry of entries) {
7508
7607
  if (!entry.startsWith(`${ORT_VERSION}.tmp.`))
7509
7608
  continue;
@@ -7514,7 +7613,7 @@ function cleanupAbandonedStagingDirs(onnxBaseDir) {
7514
7613
  let abandoned = false;
7515
7614
  if (Number.isFinite(pid) && pid > 0) {
7516
7615
  if (process.platform === "win32") {
7517
- const ownerAlive = isProcessAlive(pid);
7616
+ const ownerAlive = isProcessAlive2(pid);
7518
7617
  if (!ownerAlive) {
7519
7618
  abandoned = true;
7520
7619
  } else {
@@ -7526,7 +7625,7 @@ function cleanupAbandonedStagingDirs(onnxBaseDir) {
7526
7625
  }
7527
7626
  }
7528
7627
  } else {
7529
- abandoned = !isProcessAlive(pid);
7628
+ abandoned = !isProcessAlive2(pid);
7530
7629
  }
7531
7630
  } else {
7532
7631
  abandoned = true;
@@ -7578,7 +7677,7 @@ function isPathInsideRoot(root, candidate) {
7578
7677
  }
7579
7678
  function detectOnnxVersion(libDir, libName) {
7580
7679
  try {
7581
- const entries = readdirSync2(libDir);
7680
+ const entries = readdirSync3(libDir);
7582
7681
  const barePrefix = libName.replace(/\.(so|dylib|dll)$/, "");
7583
7682
  const expectedPrefix = process.platform === "win32" ? barePrefix.toLowerCase() : barePrefix;
7584
7683
  for (const entry of entries) {
@@ -7641,7 +7740,7 @@ function isWindowsSystem32Directory(dir) {
7641
7740
  }
7642
7741
  function directoryContainsLibrary(dir, libName) {
7643
7742
  try {
7644
- const entries = readdirSync2(dir);
7743
+ const entries = readdirSync3(dir);
7645
7744
  if (process.platform === "win32") {
7646
7745
  const expected = libName.toLowerCase();
7647
7746
  return entries.some((entry) => entry.toLowerCase() === expected);
@@ -7679,7 +7778,7 @@ function findSystemOnnxRuntime(libName) {
7679
7778
  if (!existsSync7(nugetPackageDir))
7680
7779
  return nugetPaths;
7681
7780
  try {
7682
- for (const entry of readdirSync2(nugetPackageDir, { withFileTypes: true })) {
7781
+ for (const entry of readdirSync3(nugetPackageDir, { withFileTypes: true })) {
7683
7782
  if (!entry.isDirectory())
7684
7783
  continue;
7685
7784
  if (entry.name === "__globalPackagesFolder" || entry.name.startsWith("."))
@@ -7774,7 +7873,7 @@ function validateExtractedTree(stagingRoot) {
7774
7873
  const realRoot = realpathSync2(stagingRoot);
7775
7874
  let totalBytes = 0;
7776
7875
  const walk = (dir) => {
7777
- const entries = readdirSync2(dir);
7876
+ const entries = readdirSync3(dir);
7778
7877
  for (const entry of entries) {
7779
7878
  const fullPath = join10(dir, entry);
7780
7879
  const lst = lstatSync(fullPath);
@@ -7832,7 +7931,7 @@ async function downloadOnnxRuntime(info, targetDir) {
7832
7931
  throw new Error(`Expected directory not found: ${extractedDir}`);
7833
7932
  }
7834
7933
  mkdirSync5(targetDir, { recursive: true });
7835
- const libFiles = readdirSync2(extractedDir).filter((f) => f.startsWith("libonnxruntime") || f.startsWith("onnxruntime"));
7934
+ const libFiles = readdirSync3(extractedDir).filter((f) => f.startsWith("libonnxruntime") || f.startsWith("onnxruntime"));
7836
7935
  const realFiles = [];
7837
7936
  const symlinks = [];
7838
7937
  for (const libFile of libFiles) {
@@ -8010,7 +8109,7 @@ ${new Date().toISOString()}
8010
8109
  }
8011
8110
  const age = Date.now() - lockMtimeMs;
8012
8111
  const ageWithinFresh = Math.abs(age) < STALE_LOCK_MS;
8013
- const ownerAlive = owningPid !== null && isProcessAlive(owningPid);
8112
+ const ownerAlive = owningPid !== null && isProcessAlive2(owningPid);
8014
8113
  if (ownerAlive && ageWithinFresh) {
8015
8114
  return false;
8016
8115
  }
@@ -8074,7 +8173,7 @@ function isWindowsProcessAlive(pid) {
8074
8173
  return false;
8075
8174
  }
8076
8175
  }
8077
- function isProcessAlive(pid) {
8176
+ function isProcessAlive2(pid) {
8078
8177
  if (process.platform === "win32")
8079
8178
  return isWindowsProcessAlive(pid);
8080
8179
  try {
@@ -8486,6 +8585,19 @@ function parseEditArray(value) {
8486
8585
  }
8487
8586
  return value;
8488
8587
  }
8588
+ function stripLineRangeSentinels(item) {
8589
+ const hasRangeField = ["startLine", "endLine", "content"].some((key) => hasOwn(item, key));
8590
+ if (!hasRangeField)
8591
+ return;
8592
+ if (item.oldString === "")
8593
+ delete item.oldString;
8594
+ if (item.newString === "")
8595
+ delete item.newString;
8596
+ if (item.replaceAll === false)
8597
+ delete item.replaceAll;
8598
+ if (item.occurrence === 1)
8599
+ delete item.occurrence;
8600
+ }
8489
8601
  function normalizeEditItem(value, index) {
8490
8602
  if (!value || typeof value !== "object" || Array.isArray(value)) {
8491
8603
  throw new InvalidRequestError(`edit: edits[${index}] must be an object`);
@@ -8494,6 +8606,7 @@ function normalizeEditItem(value, index) {
8494
8606
  const item = copyOwnProperties(source);
8495
8607
  normalizeItemAlias(item, "oldString", "oldText");
8496
8608
  normalizeItemAlias(item, "newString", "newText");
8609
+ stripLineRangeSentinels(item);
8497
8610
  const hasFindField = ["oldString", "newString", "replaceAll", "occurrence"].some((key) => hasOwn(item, key));
8498
8611
  const hasRangeField = ["startLine", "endLine", "content"].some((key) => hasOwn(item, key));
8499
8612
  if (hasFindField && hasRangeField) {
@@ -9764,7 +9877,7 @@ var init_binary_probe = __esm(async () => {
9764
9877
  });
9765
9878
 
9766
9879
  // src/lib/fs-util.ts
9767
- import { existsSync as existsSync10, readdirSync as readdirSync3, statSync as statSync7 } from "node:fs";
9880
+ import { existsSync as existsSync10, readdirSync as readdirSync4, statSync as statSync7 } from "node:fs";
9768
9881
  import { join as join14 } from "node:path";
9769
9882
  function dirSize(path2) {
9770
9883
  if (!existsSync10(path2)) {
@@ -9778,7 +9891,7 @@ function dirSize(path2) {
9778
9891
  return 0;
9779
9892
  }
9780
9893
  let total = 0;
9781
- for (const entry of readdirSync3(path2)) {
9894
+ for (const entry of readdirSync4(path2)) {
9782
9895
  total += dirSize(join14(path2, entry));
9783
9896
  }
9784
9897
  return total;
@@ -20205,7 +20318,7 @@ __export(exports_lsp, {
20205
20318
  printLspDoctorHelp: () => printLspDoctorHelp,
20206
20319
  findProjectRootForFile: () => findProjectRootForFile
20207
20320
  });
20208
- import { existsSync as existsSync14, readdirSync as readdirSync4, statSync as statSync9 } from "node:fs";
20321
+ import { existsSync as existsSync14, readdirSync as readdirSync5, statSync as statSync9 } from "node:fs";
20209
20322
  import { createRequire as createRequire4 } from "node:module";
20210
20323
  import { dirname as dirname8, join as join17, resolve as resolve8 } from "node:path";
20211
20324
  function findProjectRootForFile(filePath, fallbackCwd = process.cwd()) {
@@ -20377,7 +20490,7 @@ function childDirs(path2) {
20377
20490
  if (!existsSync14(path2))
20378
20491
  return [];
20379
20492
  try {
20380
- return readdirSync4(path2).map((entry) => join17(path2, entry)).filter((entry) => {
20493
+ return readdirSync5(path2).map((entry) => join17(path2, entry)).filter((entry) => {
20381
20494
  try {
20382
20495
  return statSync9(entry).isDirectory();
20383
20496
  } catch {
@@ -20708,7 +20821,7 @@ var init_doctor_filters = __esm(async () => {
20708
20821
  });
20709
20822
 
20710
20823
  // src/lib/binary-cache.ts
20711
- import { existsSync as existsSync16, readdirSync as readdirSync5, statSync as statSync10 } from "node:fs";
20824
+ import { existsSync as existsSync16, readdirSync as readdirSync6, statSync as statSync10 } from "node:fs";
20712
20825
  import { join as join18 } from "node:path";
20713
20826
  function getBinaryCacheInfo(activeVersion) {
20714
20827
  const path2 = getAftBinaryCacheDir();
@@ -20720,7 +20833,7 @@ function getBinaryCacheInfo(activeVersion) {
20720
20833
  path: path2
20721
20834
  };
20722
20835
  }
20723
- const versions = readdirSync5(path2).filter((entry) => {
20836
+ const versions = readdirSync6(path2).filter((entry) => {
20724
20837
  try {
20725
20838
  return statSync10(join18(path2, entry)).isDirectory();
20726
20839
  } catch {
@@ -20962,7 +21075,7 @@ var init_bridge_tool_failures = __esm(() => {
20962
21075
  });
20963
21076
 
20964
21077
  // src/lib/legacy-storage.ts
20965
- import { existsSync as existsSync18, readdirSync as readdirSync6, statSync as statSync12 } from "node:fs";
21078
+ import { existsSync as existsSync18, readdirSync as readdirSync7, statSync as statSync12 } from "node:fs";
20966
21079
  import { join as join19 } from "node:path";
20967
21080
  function summarizeLegacyPartitionDuplication(storageRoot) {
20968
21081
  if (!existsSync18(storageRoot)) {
@@ -21060,7 +21173,7 @@ function looksLikePartitionKey(value) {
21060
21173
  }
21061
21174
  function safeReadDir(path2) {
21062
21175
  try {
21063
- return readdirSync6(path2).sort((left, right) => left.localeCompare(right));
21176
+ return readdirSync7(path2).sort((left, right) => left.localeCompare(right));
21064
21177
  } catch {
21065
21178
  return [];
21066
21179
  }
@@ -21086,7 +21199,7 @@ var init_legacy_storage = __esm(() => {
21086
21199
  });
21087
21200
 
21088
21201
  // src/lib/lsp-cache.ts
21089
- import { existsSync as existsSync19, readdirSync as readdirSync7, rmSync as rmSync5, statSync as statSync13 } from "node:fs";
21202
+ import { existsSync as existsSync19, readdirSync as readdirSync8, rmSync as rmSync5, statSync as statSync13 } from "node:fs";
21090
21203
  import { join as join20 } from "node:path";
21091
21204
  function inspectDir(path2) {
21092
21205
  if (!existsSync19(path2)) {
@@ -21096,7 +21209,7 @@ function inspectDir(path2) {
21096
21209
  let totalSize = 0;
21097
21210
  let names;
21098
21211
  try {
21099
- names = readdirSync7(path2);
21212
+ names = readdirSync8(path2);
21100
21213
  } catch {
21101
21214
  return { entries: [], totalSize: 0 };
21102
21215
  }
@@ -21159,7 +21272,7 @@ var init_lsp_cache = __esm(() => {
21159
21272
  });
21160
21273
 
21161
21274
  // src/lib/onnx.ts
21162
- import { existsSync as existsSync20, readdirSync as readdirSync8, readlinkSync as readlinkSync2, realpathSync as realpathSync4 } from "node:fs";
21275
+ import { existsSync as existsSync20, readdirSync as readdirSync9, readlinkSync as readlinkSync2, realpathSync as realpathSync4 } from "node:fs";
21163
21276
  import { basename as basename3, isAbsolute as isAbsolute6, join as join21, resolve as resolve10, win32 as win322 } from "node:path";
21164
21277
  function getOnnxLibraryName() {
21165
21278
  if (process.platform === "darwin")
@@ -21213,7 +21326,7 @@ function isWindowsSystem32Directory2(dir) {
21213
21326
  }
21214
21327
  function directoryContainsLibrary2(dir, libName) {
21215
21328
  try {
21216
- const entries = readdirSync8(dir);
21329
+ const entries = readdirSync9(dir);
21217
21330
  if (process.platform === "win32") {
21218
21331
  const expected = libName.toLowerCase();
21219
21332
  return entries.some((entry) => entry.toLowerCase() === expected);
@@ -21261,7 +21374,7 @@ function findSystemOnnxRuntime2() {
21261
21374
  if (!existsSync20(nugetPackageDir))
21262
21375
  return nugetPaths;
21263
21376
  try {
21264
- for (const entry of readdirSync8(nugetPackageDir, { withFileTypes: true })) {
21377
+ for (const entry of readdirSync9(nugetPackageDir, { withFileTypes: true })) {
21265
21378
  if (!entry.isDirectory())
21266
21379
  continue;
21267
21380
  if (entry.name === "__globalPackagesFolder" || entry.name.startsWith("."))
@@ -21328,7 +21441,7 @@ function detectOrtVersion(libDir) {
21328
21441
  return null;
21329
21442
  const libName = getOnnxLibraryName();
21330
21443
  try {
21331
- const entries = readdirSync8(libDir);
21444
+ const entries = readdirSync9(libDir);
21332
21445
  const barePrefix = libName.replace(/\.(so|dylib|dll)$/, "");
21333
21446
  const expectedPrefix = process.platform === "win32" ? barePrefix.toLowerCase() : barePrefix;
21334
21447
  for (const entry of entries) {
@@ -21960,7 +22073,7 @@ var init_onnx_fix = __esm(() => {
21960
22073
  });
21961
22074
 
21962
22075
  // src/lib/sessions.ts
21963
- import { existsSync as existsSync23, readdirSync as readdirSync9, readFileSync as readFileSync10, statSync as statSync15 } from "node:fs";
22076
+ import { existsSync as existsSync23, readdirSync as readdirSync10, readFileSync as readFileSync10, statSync as statSync15 } from "node:fs";
21964
22077
  import { createRequire as createRequire5 } from "node:module";
21965
22078
  import { homedir as homedir18 } from "node:os";
21966
22079
  import { basename as basename4, join as join23 } from "node:path";
@@ -22056,7 +22169,7 @@ function collectJsonlFiles(root) {
22056
22169
  continue;
22057
22170
  let entries;
22058
22171
  try {
22059
- entries = readdirSync9(dir, { withFileTypes: true });
22172
+ entries = readdirSync10(dir, { withFileTypes: true });
22060
22173
  } catch {
22061
22174
  continue;
22062
22175
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cortexkit/aft",
3
- "version": "0.50.0",
3
+ "version": "0.50.1",
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.6.0",
27
- "@cortexkit/aft-bridge": "0.50.0",
27
+ "@cortexkit/aft-bridge": "0.50.1",
28
28
  "comment-json": "^4.6.2"
29
29
  },
30
30
  "devDependencies": {