@cortexkit/aft-pi 0.26.1 → 0.26.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +26 -21
  2. package/package.json +7 -7
package/dist/index.js CHANGED
@@ -32049,15 +32049,6 @@ import { homedir as homedir3 } from "node:os";
32049
32049
  var DEFAULT_IDLE_TIMEOUT_MS = Infinity;
32050
32050
  var DEFAULT_MAX_POOL_SIZE = 8;
32051
32051
  var CLEANUP_INTERVAL_MS = 60 * 1000;
32052
-
32053
- class HomeProjectRootError extends Error {
32054
- projectRoot;
32055
- constructor(projectRoot) {
32056
- super(`aft refuses to spawn a bridge with project_root=${projectRoot} (user home directory). ` + `Open OpenCode/Pi from a project subdirectory instead, or set the session's ` + `directory to a real project root.`);
32057
- this.projectRoot = projectRoot;
32058
- this.name = "HomeProjectRootError";
32059
- }
32060
- }
32061
32052
  function canonicalHomeDir() {
32062
32053
  try {
32063
32054
  const home = homedir3();
@@ -32120,9 +32111,6 @@ class BridgePool {
32120
32111
  }
32121
32112
  getBridge(projectRoot) {
32122
32113
  const key = normalizeKey(projectRoot);
32123
- if (isHomeDirectoryRoot(key)) {
32124
- throw new HomeProjectRootError(key);
32125
- }
32126
32114
  const existing = this.bridges.get(key);
32127
32115
  if (existing) {
32128
32116
  existing.lastUsed = Date.now();
@@ -32280,6 +32268,21 @@ function copyToVersionedCache(npmBinaryPath, knownVersion) {
32280
32268
  function normalizeBareVersion(version) {
32281
32269
  return version.startsWith("v") ? version.slice(1) : version;
32282
32270
  }
32271
+ function homeDirFromEnv(env) {
32272
+ return (process.platform === "win32" ? env.USERPROFILE || env.HOME : env.HOME) || homedir4();
32273
+ }
32274
+ function cacheDirFromEnv(env) {
32275
+ if (process.platform === "win32") {
32276
+ const base2 = env.LOCALAPPDATA || env.APPDATA || join4(homeDirFromEnv(env), "AppData", "Local");
32277
+ return join4(base2, "aft", "bin");
32278
+ }
32279
+ const base = env.XDG_CACHE_HOME || join4(homeDirFromEnv(env), ".cache");
32280
+ return join4(base, "aft", "bin");
32281
+ }
32282
+ function cachedBinaryPathFromEnv(version, env, ext) {
32283
+ const binaryPath = join4(cacheDirFromEnv(env), version, `aft${ext}`);
32284
+ return existsSync3(binaryPath) ? binaryPath : null;
32285
+ }
32283
32286
  function isExpectedCachedBinary(binaryPath, expectedVersion) {
32284
32287
  const expected = normalizeBareVersion(expectedVersion);
32285
32288
  const actual = readBinaryVersion(binaryPath);
@@ -32301,6 +32304,7 @@ function platformKey(platform = process.platform, arch = process.arch) {
32301
32304
  }
32302
32305
  function findBinarySync(expectedVersion) {
32303
32306
  const ext = process.platform === "win32" ? ".exe" : "";
32307
+ const env = { ...process.env };
32304
32308
  const pluginVersion = expectedVersion ?? (() => {
32305
32309
  try {
32306
32310
  const req = createRequire2(import.meta.url);
@@ -32311,7 +32315,7 @@ function findBinarySync(expectedVersion) {
32311
32315
  })();
32312
32316
  if (pluginVersion) {
32313
32317
  const tag = pluginVersion.startsWith("v") ? pluginVersion : `v${pluginVersion}`;
32314
- const versionCached = getCachedBinaryPath(tag);
32318
+ const versionCached = cachedBinaryPathFromEnv(tag, env, ext);
32315
32319
  if (versionCached && isExpectedCachedBinary(versionCached, pluginVersion))
32316
32320
  return versionCached;
32317
32321
  }
@@ -32336,12 +32340,13 @@ function findBinarySync(expectedVersion) {
32336
32340
  const whichCmd = process.platform === "win32" ? "where aft" : "which aft";
32337
32341
  const result = execSync(whichCmd, {
32338
32342
  encoding: "utf-8",
32343
+ env,
32339
32344
  stdio: ["pipe", "pipe", "pipe"]
32340
32345
  }).trim();
32341
32346
  if (result)
32342
32347
  return result;
32343
32348
  } catch {}
32344
- const cargoPath = join4(homedir4(), ".cargo", "bin", `aft${ext}`);
32349
+ const cargoPath = join4(homeDirFromEnv(env), ".cargo", "bin", `aft${ext}`);
32345
32350
  if (existsSync3(cargoPath))
32346
32351
  return cargoPath;
32347
32352
  return null;
@@ -33294,7 +33299,7 @@ import {
33294
33299
  // package.json
33295
33300
  var package_default = {
33296
33301
  name: "@cortexkit/aft-pi",
33297
- version: "0.26.1",
33302
+ version: "0.26.3",
33298
33303
  type: "module",
33299
33304
  description: "Pi coding agent extension for Agent File Tools (AFT) — tree-sitter and LSP-powered code analysis",
33300
33305
  main: "dist/index.js",
@@ -33316,18 +33321,18 @@ var package_default = {
33316
33321
  prepublishOnly: "bun run build"
33317
33322
  },
33318
33323
  dependencies: {
33319
- "@cortexkit/aft-bridge": "0.26.1",
33324
+ "@cortexkit/aft-bridge": "0.26.3",
33320
33325
  typebox: "^1.1.24",
33321
33326
  "comment-json": "^5.0.0",
33322
33327
  diff: "^8.0.4",
33323
33328
  zod: "^4.1.8"
33324
33329
  },
33325
33330
  optionalDependencies: {
33326
- "@cortexkit/aft-darwin-arm64": "0.26.1",
33327
- "@cortexkit/aft-darwin-x64": "0.26.1",
33328
- "@cortexkit/aft-linux-arm64": "0.26.1",
33329
- "@cortexkit/aft-linux-x64": "0.26.1",
33330
- "@cortexkit/aft-win32-x64": "0.26.1"
33331
+ "@cortexkit/aft-darwin-arm64": "0.26.3",
33332
+ "@cortexkit/aft-darwin-x64": "0.26.3",
33333
+ "@cortexkit/aft-linux-arm64": "0.26.3",
33334
+ "@cortexkit/aft-linux-x64": "0.26.3",
33335
+ "@cortexkit/aft-win32-x64": "0.26.3"
33331
33336
  },
33332
33337
  devDependencies: {
33333
33338
  "@earendil-works/pi-coding-agent": "*",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cortexkit/aft-pi",
3
- "version": "0.26.1",
3
+ "version": "0.26.3",
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",
@@ -22,18 +22,18 @@
22
22
  "prepublishOnly": "bun run build"
23
23
  },
24
24
  "dependencies": {
25
- "@cortexkit/aft-bridge": "0.26.1",
25
+ "@cortexkit/aft-bridge": "0.26.3",
26
26
  "typebox": "^1.1.24",
27
27
  "comment-json": "^5.0.0",
28
28
  "diff": "^8.0.4",
29
29
  "zod": "^4.1.8"
30
30
  },
31
31
  "optionalDependencies": {
32
- "@cortexkit/aft-darwin-arm64": "0.26.1",
33
- "@cortexkit/aft-darwin-x64": "0.26.1",
34
- "@cortexkit/aft-linux-arm64": "0.26.1",
35
- "@cortexkit/aft-linux-x64": "0.26.1",
36
- "@cortexkit/aft-win32-x64": "0.26.1"
32
+ "@cortexkit/aft-darwin-arm64": "0.26.3",
33
+ "@cortexkit/aft-darwin-x64": "0.26.3",
34
+ "@cortexkit/aft-linux-arm64": "0.26.3",
35
+ "@cortexkit/aft-linux-x64": "0.26.3",
36
+ "@cortexkit/aft-win32-x64": "0.26.3"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@earendil-works/pi-coding-agent": "*",