@cortexkit/aft-pi 0.50.0 → 0.50.2

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 +171 -56
  2. package/package.json +8 -8
package/dist/index.js CHANGED
@@ -8383,11 +8383,12 @@ function parseStatusBarCounts(value) {
8383
8383
  unused_exports: num("unused_exports"),
8384
8384
  duplicates: num("duplicates"),
8385
8385
  todos: num("todos"),
8386
- tier2_stale: record.tier2_stale === true
8386
+ tier2_stale: record.tier2_stale === true,
8387
+ ...typeof record.line === "string" ? { line: record.line } : {}
8387
8388
  };
8388
8389
  }
8389
8390
  function countsEqual(a, b) {
8390
- return a.errors === b.errors && a.warnings === b.warnings && a.dead_code === b.dead_code && a.unused_exports === b.unused_exports && a.duplicates === b.duplicates && a.todos === b.todos && a.tier2_stale === b.tier2_stale;
8391
+ return a.errors === b.errors && a.warnings === b.warnings && a.dead_code === b.dead_code && a.unused_exports === b.unused_exports && a.duplicates === b.duplicates && a.todos === b.todos && a.tier2_stale === b.tier2_stale && a.line === b.line;
8391
8392
  }
8392
8393
  function shouldEmitStatusBar(state, next) {
8393
8394
  const changed = state.last === undefined || !countsEqual(state.last, next);
@@ -8401,6 +8402,8 @@ function shouldEmitStatusBar(state, next) {
8401
8402
  return false;
8402
8403
  }
8403
8404
  function formatStatusBar(counts) {
8405
+ if (counts.line !== undefined)
8406
+ return counts.line;
8404
8407
  const staleMark = counts.tier2_stale ? "~" : "";
8405
8408
  return `[AFT E${counts.errors} W${counts.warnings} | ` + `${staleMark}D${counts.dead_code} U${counts.unused_exports} C${counts.duplicates} | ` + `T${counts.todos}]`;
8406
8409
  }
@@ -9840,7 +9843,8 @@ function formatDroppedKeyWarnings(dropped) {
9840
9843
  // ../aft-bridge/dist/downloader.js
9841
9844
  import { spawnSync } from "node:child_process";
9842
9845
  import { createHash as createHash2, randomUUID } from "node:crypto";
9843
- import { chmodSync, closeSync, copyFileSync, createWriteStream, existsSync as existsSync2, mkdirSync, openSync, readFileSync as readFileSync3, renameSync, rmSync, statSync as statSync2, unlinkSync, writeSync } from "node:fs";
9846
+ import { chmodSync, closeSync, copyFileSync, createWriteStream, existsSync as existsSync2, mkdirSync, openSync, readdirSync, readFileSync as readFileSync3, renameSync, rmSync, statSync as statSync2, unlinkSync, writeSync } from "node:fs";
9847
+ import { hostname } from "node:os";
9844
9848
  import { join as join4 } from "node:path";
9845
9849
  import { Readable } from "node:stream";
9846
9850
  import { pipeline } from "node:stream/promises";
@@ -9865,8 +9869,8 @@ var REPO = "cortexkit/aft";
9865
9869
  var DOWNLOAD_TIMEOUT_MS = 300000;
9866
9870
  var LATEST_TAG_TIMEOUT_MS = 30000;
9867
9871
  var MAX_DOWNLOAD_BYTES = 200 * 1024 * 1024;
9868
- var DOWNLOAD_LOCK_TIMEOUT_MS = 120000;
9869
9872
  var DOWNLOAD_LOCK_STALE_MS = 10 * 60000;
9873
+ var DOWNLOAD_LOCK_TIMEOUT_MS = DOWNLOAD_LOCK_STALE_MS + 30000;
9870
9874
  function readBinaryVersion(binaryPath) {
9871
9875
  try {
9872
9876
  const result = spawnSync(binaryPath, ["--version"], {
@@ -9934,11 +9938,37 @@ async function downloadBinary(version) {
9934
9938
  let binaryTimeout = null;
9935
9939
  let checksumTimeout = null;
9936
9940
  const tmpPath = `${binaryPath}.${process.pid}.${Date.now()}.${Math.random().toString(16).slice(2)}.tmp`;
9941
+ const cleanUpPartialDownload = () => {
9942
+ try {
9943
+ if (existsSync2(tmpPath))
9944
+ unlinkSync(tmpPath);
9945
+ } catch {}
9946
+ };
9947
+ let interrupted = false;
9948
+ const cleanUpInterruptedDownload = () => {
9949
+ if (interrupted)
9950
+ return;
9951
+ interrupted = true;
9952
+ binaryController?.abort();
9953
+ checksumController?.abort();
9954
+ cleanUpPartialDownload();
9955
+ releaseLock?.();
9956
+ releaseLock = null;
9957
+ };
9958
+ const handleSigint = () => {
9959
+ cleanUpInterruptedDownload();
9960
+ process.off("SIGINT", handleSigint);
9961
+ process.kill(process.pid, "SIGINT");
9962
+ };
9963
+ const handleExit = () => cleanUpInterruptedDownload();
9964
+ process.once("SIGINT", handleSigint);
9965
+ process.once("exit", handleExit);
9937
9966
  try {
9938
9967
  if (!existsSync2(versionedCacheDir)) {
9939
9968
  mkdirSync(versionedCacheDir, { recursive: true });
9940
9969
  }
9941
9970
  releaseLock = await acquireDownloadLock(lockPath);
9971
+ sweepStaleDownloadTemps(versionedCacheDir, binaryName);
9942
9972
  if (existsSync2(binaryPath) && isExpectedCachedBinary(binaryPath, tag)) {
9943
9973
  return binaryPath;
9944
9974
  }
@@ -10014,13 +10044,11 @@ async function downloadBinary(version) {
10014
10044
  } catch (err) {
10015
10045
  const msg = err instanceof Error ? err.message : String(err);
10016
10046
  error(`Failed to download AFT binary: ${msg}`);
10017
- if (existsSync2(tmpPath)) {
10018
- try {
10019
- unlinkSync(tmpPath);
10020
- } catch {}
10021
- }
10047
+ cleanUpPartialDownload();
10022
10048
  return null;
10023
10049
  } finally {
10050
+ process.off("SIGINT", handleSigint);
10051
+ process.off("exit", handleExit);
10024
10052
  if (binaryTimeout) {
10025
10053
  binaryController?.abort();
10026
10054
  clearTimeout(binaryTimeout);
@@ -10046,17 +10074,85 @@ async function ensureBinary(version) {
10046
10074
  log("No cached binary found, downloading latest...");
10047
10075
  return downloadBinary();
10048
10076
  }
10049
- async function acquireDownloadLock(lockPath) {
10077
+ function createDownloadLockOwner() {
10078
+ return JSON.stringify({
10079
+ pid: process.pid,
10080
+ hostname: hostname(),
10081
+ createdAt: Date.now(),
10082
+ token: randomUUID()
10083
+ });
10084
+ }
10085
+ function parseDownloadLockOwner(raw) {
10086
+ try {
10087
+ const parsed = JSON.parse(raw);
10088
+ if (typeof parsed === "object" && parsed !== null) {
10089
+ const { pid, hostname: ownerHostname } = parsed;
10090
+ return {
10091
+ pid: typeof pid === "number" && Number.isSafeInteger(pid) && pid > 0 ? pid : null,
10092
+ hostname: typeof ownerHostname === "string" && ownerHostname ? ownerHostname : null
10093
+ };
10094
+ }
10095
+ } catch {}
10096
+ const legacyPid = Number(raw.split(":", 1)[0]);
10097
+ return {
10098
+ pid: Number.isSafeInteger(legacyPid) && legacyPid > 0 ? legacyPid : null,
10099
+ hostname: null
10100
+ };
10101
+ }
10102
+ function isProcessAlive(pid) {
10103
+ try {
10104
+ process.kill(pid, 0);
10105
+ return true;
10106
+ } catch (err) {
10107
+ return err.code !== "ESRCH";
10108
+ }
10109
+ }
10110
+ function isReclaimableDownloadLock(owner, ageMs, staleMs) {
10111
+ if (Math.abs(ageMs) > staleMs)
10112
+ return true;
10113
+ return (owner.hostname === null || owner.hostname === hostname()) && owner.pid !== null && !isProcessAlive(owner.pid);
10114
+ }
10115
+ function reclaimDownloadLock(lockPath, expectedOwner) {
10116
+ try {
10117
+ if (readFileSync3(lockPath, "utf-8") !== expectedOwner)
10118
+ return false;
10119
+ rmSync(lockPath, { force: true });
10120
+ return true;
10121
+ } catch (err) {
10122
+ if (err.code === "ENOENT")
10123
+ return true;
10124
+ throw err;
10125
+ }
10126
+ }
10127
+ function sweepStaleDownloadTemps(versionedCacheDir, binaryName) {
10128
+ const tempPrefix = `${binaryName}.`;
10129
+ try {
10130
+ for (const entry of readdirSync(versionedCacheDir, { withFileTypes: true })) {
10131
+ if (!entry.isFile() || !entry.name.startsWith(tempPrefix) || !entry.name.endsWith(".tmp")) {
10132
+ continue;
10133
+ }
10134
+ const tempPath = join4(versionedCacheDir, entry.name);
10135
+ const ageMs = Date.now() - statSync2(tempPath).mtimeMs;
10136
+ if (Math.abs(ageMs) > DOWNLOAD_LOCK_STALE_MS)
10137
+ unlinkSync(tempPath);
10138
+ }
10139
+ } catch {}
10140
+ }
10141
+ async function acquireDownloadLock(lockPath, timing = {}) {
10142
+ const timeoutMs = timing.timeoutMs ?? DOWNLOAD_LOCK_TIMEOUT_MS;
10143
+ const staleMs = timing.staleMs ?? DOWNLOAD_LOCK_STALE_MS;
10144
+ const pollIntervalMs = timing.pollIntervalMs ?? 100;
10050
10145
  const startedAt = Date.now();
10051
10146
  while (true) {
10052
10147
  try {
10053
- const owner = `${process.pid}:${Date.now()}:${randomUUID()}`;
10148
+ const owner = createDownloadLockOwner();
10054
10149
  const fd = openSync(lockPath, "wx");
10055
- writeSync(fd, owner);
10150
+ try {
10151
+ writeSync(fd, owner);
10152
+ } finally {
10153
+ closeSync(fd);
10154
+ }
10056
10155
  return () => {
10057
- try {
10058
- closeSync(fd);
10059
- } catch {}
10060
10156
  try {
10061
10157
  if (readFileSync3(lockPath, "utf-8") === owner) {
10062
10158
  rmSync(lockPath, { force: true });
@@ -10067,19 +10163,24 @@ async function acquireDownloadLock(lockPath) {
10067
10163
  const code = err.code;
10068
10164
  if (code !== "EEXIST")
10069
10165
  throw err;
10166
+ let existingOwner;
10167
+ let ageMs;
10070
10168
  try {
10071
- const ageMs = Date.now() - statSync2(lockPath).mtimeMs;
10072
- if (ageMs > DOWNLOAD_LOCK_STALE_MS) {
10073
- rmSync(lockPath, { force: true });
10169
+ existingOwner = readFileSync3(lockPath, "utf-8");
10170
+ ageMs = Date.now() - statSync2(lockPath).mtimeMs;
10171
+ } catch (readErr) {
10172
+ if (readErr.code === "ENOENT")
10173
+ continue;
10174
+ throw readErr;
10175
+ }
10176
+ if (isReclaimableDownloadLock(parseDownloadLockOwner(existingOwner), ageMs, staleMs)) {
10177
+ if (reclaimDownloadLock(lockPath, existingOwner))
10074
10178
  continue;
10075
- }
10076
- } catch {
10077
- continue;
10078
10179
  }
10079
- if (Date.now() - startedAt > DOWNLOAD_LOCK_TIMEOUT_MS) {
10180
+ if (Date.now() - startedAt > timeoutMs) {
10080
10181
  throw new Error(`Timed out waiting for download lock: ${lockPath}`);
10081
10182
  }
10082
- await new Promise((resolve3) => setTimeout(resolve3, 100));
10183
+ await new Promise((resolve3) => setTimeout(resolve3, pollIntervalMs));
10083
10184
  }
10084
10185
  }
10085
10186
  }
@@ -15008,7 +15109,7 @@ async function ensureStorageMigrated(opts) {
15008
15109
  throw new Error(`AFT storage migration failed (${detail}). ` + `Harness: ${opts.harness}. Legacy: ${legacyRoot}. Target: ${newRoot}. ` + `See log: ${logPath}. ` + `Plugin load aborted to prevent legacy/new state divergence.` + (stderrTail ? ` Stderr tail: ${stderrTail}` : "") + (stdoutTail ? ` Stdout tail: ${stdoutTail}` : ""));
15009
15110
  }
15010
15111
  // ../aft-bridge/dist/npm-resolver.js
15011
- import { readdirSync, statSync as statSync5 } from "node:fs";
15112
+ import { readdirSync as readdirSync2, statSync as statSync5 } from "node:fs";
15012
15113
  import { homedir as homedir9 } from "node:os";
15013
15114
  import { delimiter, dirname as dirname4, isAbsolute as isAbsolute3, join as join9 } from "node:path";
15014
15115
  function defaultDeps() {
@@ -15048,7 +15149,7 @@ function npmAdjacentToNode(deps) {
15048
15149
  function highestVersionedNodeBin(installsDir, name) {
15049
15150
  let entries;
15050
15151
  try {
15051
- entries = readdirSync(installsDir);
15152
+ entries = readdirSync2(installsDir);
15052
15153
  } catch {
15053
15154
  return null;
15054
15155
  }
@@ -15124,7 +15225,7 @@ function npmSpawnEnv(resolved, baseEnv = process.env) {
15124
15225
  // ../aft-bridge/dist/onnx-runtime.js
15125
15226
  import { execFileSync } from "node:child_process";
15126
15227
  import { createHash as createHash3 } from "node:crypto";
15127
- 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";
15228
+ 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";
15128
15229
  import { basename as basename2, dirname as dirname5, isAbsolute as isAbsolute4, join as join10, relative as relative2, resolve as resolve6, win32 } from "node:path";
15129
15230
  import { Readable as Readable2 } from "node:stream";
15130
15231
  import { pipeline as pipeline2 } from "node:stream/promises";
@@ -15238,7 +15339,7 @@ async function ensureOnnxRuntime(storageDir) {
15238
15339
  }
15239
15340
  function cleanupAbandonedStagingDirs(onnxBaseDir) {
15240
15341
  try {
15241
- const entries = readdirSync2(onnxBaseDir);
15342
+ const entries = readdirSync3(onnxBaseDir);
15242
15343
  for (const entry of entries) {
15243
15344
  if (!entry.startsWith(`${ORT_VERSION}.tmp.`))
15244
15345
  continue;
@@ -15249,7 +15350,7 @@ function cleanupAbandonedStagingDirs(onnxBaseDir) {
15249
15350
  let abandoned = false;
15250
15351
  if (Number.isFinite(pid) && pid > 0) {
15251
15352
  if (process.platform === "win32") {
15252
- const ownerAlive = isProcessAlive(pid);
15353
+ const ownerAlive = isProcessAlive2(pid);
15253
15354
  if (!ownerAlive) {
15254
15355
  abandoned = true;
15255
15356
  } else {
@@ -15261,7 +15362,7 @@ function cleanupAbandonedStagingDirs(onnxBaseDir) {
15261
15362
  }
15262
15363
  }
15263
15364
  } else {
15264
- abandoned = !isProcessAlive(pid);
15365
+ abandoned = !isProcessAlive2(pid);
15265
15366
  }
15266
15367
  } else {
15267
15368
  abandoned = true;
@@ -15312,7 +15413,7 @@ function isPathInsideRoot(root, candidate) {
15312
15413
  }
15313
15414
  function detectOnnxVersion(libDir, libName) {
15314
15415
  try {
15315
- const entries = readdirSync2(libDir);
15416
+ const entries = readdirSync3(libDir);
15316
15417
  const barePrefix = libName.replace(/\.(so|dylib|dll)$/, "");
15317
15418
  const expectedPrefix = process.platform === "win32" ? barePrefix.toLowerCase() : barePrefix;
15318
15419
  for (const entry of entries) {
@@ -15375,7 +15476,7 @@ function isWindowsSystem32Directory(dir) {
15375
15476
  }
15376
15477
  function directoryContainsLibrary(dir, libName) {
15377
15478
  try {
15378
- const entries = readdirSync2(dir);
15479
+ const entries = readdirSync3(dir);
15379
15480
  if (process.platform === "win32") {
15380
15481
  const expected = libName.toLowerCase();
15381
15482
  return entries.some((entry) => entry.toLowerCase() === expected);
@@ -15413,7 +15514,7 @@ function findSystemOnnxRuntime(libName) {
15413
15514
  if (!existsSync7(nugetPackageDir))
15414
15515
  return nugetPaths;
15415
15516
  try {
15416
- for (const entry of readdirSync2(nugetPackageDir, { withFileTypes: true })) {
15517
+ for (const entry of readdirSync3(nugetPackageDir, { withFileTypes: true })) {
15417
15518
  if (!entry.isDirectory())
15418
15519
  continue;
15419
15520
  if (entry.name === "__globalPackagesFolder" || entry.name.startsWith("."))
@@ -15508,7 +15609,7 @@ function validateExtractedTree(stagingRoot) {
15508
15609
  const realRoot = realpathSync2(stagingRoot);
15509
15610
  let totalBytes = 0;
15510
15611
  const walk = (dir) => {
15511
- const entries = readdirSync2(dir);
15612
+ const entries = readdirSync3(dir);
15512
15613
  for (const entry of entries) {
15513
15614
  const fullPath = join10(dir, entry);
15514
15615
  const lst = lstatSync(fullPath);
@@ -15566,7 +15667,7 @@ async function downloadOnnxRuntime(info, targetDir) {
15566
15667
  throw new Error(`Expected directory not found: ${extractedDir}`);
15567
15668
  }
15568
15669
  mkdirSync5(targetDir, { recursive: true });
15569
- const libFiles = readdirSync2(extractedDir).filter((f) => f.startsWith("libonnxruntime") || f.startsWith("onnxruntime"));
15670
+ const libFiles = readdirSync3(extractedDir).filter((f) => f.startsWith("libonnxruntime") || f.startsWith("onnxruntime"));
15570
15671
  const realFiles = [];
15571
15672
  const symlinks = [];
15572
15673
  for (const libFile of libFiles) {
@@ -15744,7 +15845,7 @@ ${new Date().toISOString()}
15744
15845
  }
15745
15846
  const age = Date.now() - lockMtimeMs;
15746
15847
  const ageWithinFresh = Math.abs(age) < STALE_LOCK_MS;
15747
- const ownerAlive = owningPid !== null && isProcessAlive(owningPid);
15848
+ const ownerAlive = owningPid !== null && isProcessAlive2(owningPid);
15748
15849
  if (ownerAlive && ageWithinFresh) {
15749
15850
  return false;
15750
15851
  }
@@ -15808,7 +15909,7 @@ function isWindowsProcessAlive(pid) {
15808
15909
  return false;
15809
15910
  }
15810
15911
  }
15811
- function isProcessAlive(pid) {
15912
+ function isProcessAlive2(pid) {
15812
15913
  if (process.platform === "win32")
15813
15914
  return isWindowsProcessAlive(pid);
15814
15915
  try {
@@ -16183,6 +16284,19 @@ function parseEditArray(value) {
16183
16284
  }
16184
16285
  return value;
16185
16286
  }
16287
+ function stripLineRangeSentinels(item) {
16288
+ const hasRangeField = ["startLine", "endLine", "content"].some((key) => hasOwn(item, key));
16289
+ if (!hasRangeField)
16290
+ return;
16291
+ if (item.oldString === "")
16292
+ delete item.oldString;
16293
+ if (item.newString === "")
16294
+ delete item.newString;
16295
+ if (item.replaceAll === false)
16296
+ delete item.replaceAll;
16297
+ if (item.occurrence === 1)
16298
+ delete item.occurrence;
16299
+ }
16186
16300
  function normalizeEditItem(value, index) {
16187
16301
  if (!value || typeof value !== "object" || Array.isArray(value)) {
16188
16302
  throw new InvalidRequestError(`edit: edits[${index}] must be an object`);
@@ -16191,6 +16305,7 @@ function normalizeEditItem(value, index) {
16191
16305
  const item = copyOwnProperties(source);
16192
16306
  normalizeItemAlias(item, "oldString", "oldText");
16193
16307
  normalizeItemAlias(item, "newString", "newText");
16308
+ stripLineRangeSentinels(item);
16194
16309
  const hasFindField = ["oldString", "newString", "replaceAll", "occurrence"].some((key) => hasOwn(item, key));
16195
16310
  const hasRangeField = ["startLine", "endLine", "content"].some((key) => hasOwn(item, key));
16196
16311
  if (hasFindField && hasRangeField) {
@@ -17766,7 +17881,7 @@ import {
17766
17881
  // package.json
17767
17882
  var package_default = {
17768
17883
  name: "@cortexkit/aft-pi",
17769
- version: "0.50.0",
17884
+ version: "0.50.2",
17770
17885
  type: "module",
17771
17886
  description: "Pi coding agent extension for Agent File Tools (AFT) — tree-sitter and LSP-powered code analysis",
17772
17887
  main: "dist/index.js",
@@ -17789,19 +17904,19 @@ var package_default = {
17789
17904
  "test:unit": "bun test src/__tests__ --path-ignore-patterns 'src/__tests__/e2e/**'"
17790
17905
  },
17791
17906
  dependencies: {
17792
- "@cortexkit/aft-bridge": "0.50.0",
17907
+ "@cortexkit/aft-bridge": "0.50.2",
17793
17908
  "comment-json": "^5.0.0",
17794
17909
  diff: "^8.0.4",
17795
17910
  typebox: "1.1.38",
17796
17911
  zod: "^4.4.3"
17797
17912
  },
17798
17913
  optionalDependencies: {
17799
- "@cortexkit/aft-darwin-arm64": "0.50.0",
17800
- "@cortexkit/aft-darwin-x64": "0.50.0",
17801
- "@cortexkit/aft-linux-arm64": "0.50.0",
17802
- "@cortexkit/aft-linux-x64": "0.50.0",
17803
- "@cortexkit/aft-win32-arm64": "0.50.0",
17804
- "@cortexkit/aft-win32-x64": "0.50.0"
17914
+ "@cortexkit/aft-darwin-arm64": "0.50.2",
17915
+ "@cortexkit/aft-darwin-x64": "0.50.2",
17916
+ "@cortexkit/aft-linux-arm64": "0.50.2",
17917
+ "@cortexkit/aft-linux-x64": "0.50.2",
17918
+ "@cortexkit/aft-win32-arm64": "0.50.2",
17919
+ "@cortexkit/aft-win32-x64": "0.50.2"
17805
17920
  },
17806
17921
  devDependencies: {
17807
17922
  "@earendil-works/pi-coding-agent": "^0.80.2",
@@ -18541,7 +18656,7 @@ __export(exports_external, {
18541
18656
  instanceof: () => _instanceof,
18542
18657
  includes: () => _includes,
18543
18658
  httpUrl: () => httpUrl,
18544
- hostname: () => hostname2,
18659
+ hostname: () => hostname3,
18545
18660
  hex: () => hex2,
18546
18661
  hash: () => hash,
18547
18662
  guid: () => guid2,
@@ -19992,7 +20107,7 @@ __export(exports_regexes, {
19992
20107
  idnEmail: () => idnEmail,
19993
20108
  httpProtocol: () => httpProtocol,
19994
20109
  html5Email: () => html5Email,
19995
- hostname: () => hostname,
20110
+ hostname: () => hostname2,
19996
20111
  hex: () => hex,
19997
20112
  guid: () => guid,
19998
20113
  extendedDuration: () => extendedDuration,
@@ -20050,7 +20165,7 @@ var cidrv4 = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]
20050
20165
  var cidrv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;
20051
20166
  var base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;
20052
20167
  var base64url = /^[A-Za-z0-9_-]*$/;
20053
- var hostname = /^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/;
20168
+ var hostname2 = /^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/;
20054
20169
  var domain = /^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/;
20055
20170
  var httpProtocol = /^https?$/;
20056
20171
  var e164 = /^\+[1-9]\d{6,14}$/;
@@ -30674,7 +30789,7 @@ __export(exports_schemas2, {
30674
30789
  int: () => int,
30675
30790
  instanceof: () => _instanceof,
30676
30791
  httpUrl: () => httpUrl,
30677
- hostname: () => hostname2,
30792
+ hostname: () => hostname3,
30678
30793
  hex: () => hex2,
30679
30794
  hash: () => hash,
30680
30795
  guid: () => guid2,
@@ -31326,7 +31441,7 @@ var ZodCustomStringFormat = /* @__PURE__ */ $constructor("ZodCustomStringFormat"
31326
31441
  function stringFormat(format, fnOrRegex, _params = {}) {
31327
31442
  return _stringFormat(ZodCustomStringFormat, format, fnOrRegex, _params);
31328
31443
  }
31329
- function hostname2(_params) {
31444
+ function hostname3(_params) {
31330
31445
  return _stringFormat(ZodCustomStringFormat, "hostname", exports_regexes.hostname, _params);
31331
31446
  }
31332
31447
  function hex2(_params) {
@@ -33489,7 +33604,7 @@ ${new Date().toISOString()}
33489
33604
  const age = Date.now() - lockMtimeMs;
33490
33605
  const ageWithinFresh = Math.abs(age) < STALE_LOCK_MS2;
33491
33606
  const skipLiveness = process.platform === "win32";
33492
- const ownerAlive = !skipLiveness && owningPid !== null && isProcessAlive2(owningPid);
33607
+ const ownerAlive = !skipLiveness && owningPid !== null && isProcessAlive3(owningPid);
33493
33608
  if (skipLiveness ? ageWithinFresh : ownerAlive && ageWithinFresh) {
33494
33609
  return false;
33495
33610
  }
@@ -33499,7 +33614,7 @@ ${new Date().toISOString()}
33499
33614
  } catch {}
33500
33615
  return tryClaim();
33501
33616
  }
33502
- function isProcessAlive2(pid) {
33617
+ function isProcessAlive3(pid) {
33503
33618
  try {
33504
33619
  process.kill(pid, 0);
33505
33620
  return true;
@@ -33733,7 +33848,7 @@ var NPM_LSP_TABLE = [
33733
33848
  ];
33734
33849
 
33735
33850
  // src/lsp-project-relevance.ts
33736
- import { existsSync as existsSync11, readdirSync as readdirSync3, readFileSync as readFileSync9 } from "node:fs";
33851
+ import { existsSync as existsSync11, readdirSync as readdirSync4, readFileSync as readFileSync9 } from "node:fs";
33737
33852
  import { join as join13 } from "node:path";
33738
33853
  var MAX_WALK_DIRS = 200;
33739
33854
  var MAX_WALK_DEPTH = 4;
@@ -33798,7 +33913,7 @@ function relevantExtensionsInProject(projectRoot, extToServer) {
33798
33913
  visitedDirs += 1;
33799
33914
  let entries;
33800
33915
  try {
33801
- entries = readdirSync3(current.dir, { withFileTypes: true });
33916
+ entries = readdirSync4(current.dir, { withFileTypes: true });
33802
33917
  } catch {
33803
33918
  continue;
33804
33919
  }
@@ -34218,7 +34333,7 @@ import {
34218
34333
  existsSync as existsSync13,
34219
34334
  lstatSync as lstatSync2,
34220
34335
  mkdirSync as mkdirSync8,
34221
- readdirSync as readdirSync4,
34336
+ readdirSync as readdirSync5,
34222
34337
  readFileSync as readFileSync11,
34223
34338
  readlinkSync as readlinkSync2,
34224
34339
  realpathSync as realpathSync3,
@@ -34621,7 +34736,7 @@ function validateExtraction(stagingRoot) {
34621
34736
  const walk = (dir) => {
34622
34737
  let entries;
34623
34738
  try {
34624
- entries = readdirSync4(dir);
34739
+ entries = readdirSync5(dir);
34625
34740
  } catch (err) {
34626
34741
  throw new Error(`failed to read staging dir ${dir}: ${err}`);
34627
34742
  }
@@ -38985,7 +39100,7 @@ var PLUGIN_VERSION = (() => {
38985
39100
  return "0.0.0";
38986
39101
  }
38987
39102
  })();
38988
- var ANNOUNCEMENT_VERSION = "0.50.0";
39103
+ var ANNOUNCEMENT_VERSION = "0.50.2";
38989
39104
  var ANNOUNCEMENT_FEATURES = [
38990
39105
  "Callgraph stays consistent under load: edits arriving mid-rebuild can no longer be silently lost from navigation results.",
38991
39106
  "aft_zoom handles real-world .jsonc: files with comment banners above the opening brace now resolve, and not-found errors point at the segment that actually failed (thanks @iceteaSA).",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cortexkit/aft-pi",
3
- "version": "0.50.0",
3
+ "version": "0.50.2",
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.50.0",
26
+ "@cortexkit/aft-bridge": "0.50.2",
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.50.0",
34
- "@cortexkit/aft-darwin-x64": "0.50.0",
35
- "@cortexkit/aft-linux-arm64": "0.50.0",
36
- "@cortexkit/aft-linux-x64": "0.50.0",
37
- "@cortexkit/aft-win32-arm64": "0.50.0",
38
- "@cortexkit/aft-win32-x64": "0.50.0"
33
+ "@cortexkit/aft-darwin-arm64": "0.50.2",
34
+ "@cortexkit/aft-darwin-x64": "0.50.2",
35
+ "@cortexkit/aft-linux-arm64": "0.50.2",
36
+ "@cortexkit/aft-linux-x64": "0.50.2",
37
+ "@cortexkit/aft-win32-arm64": "0.50.2",
38
+ "@cortexkit/aft-win32-x64": "0.50.2"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@earendil-works/pi-coding-agent": "^0.80.2",