@cortexkit/aft-pi 0.31.0 → 0.31.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.
- package/dist/index.js +43 -14
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -13035,7 +13035,7 @@ async function ensureStorageMigrated(opts) {
|
|
|
13035
13035
|
import { execFileSync } from "node:child_process";
|
|
13036
13036
|
import { createHash as createHash2 } from "node:crypto";
|
|
13037
13037
|
import { chmodSync as chmodSync3, closeSync as closeSync2, copyFileSync as copyFileSync2, createWriteStream as createWriteStream2, existsSync as existsSync5, lstatSync, mkdirSync as mkdirSync5, openSync as openSync2, readdirSync, readFileSync as readFileSync3, readlinkSync, realpathSync, rmSync as rmSync2, statSync as statSync2, symlinkSync, unlinkSync as unlinkSync2, writeFileSync as writeFileSync2 } from "node:fs";
|
|
13038
|
-
import { basename, dirname as dirname3, join as join6, relative, resolve } from "node:path";
|
|
13038
|
+
import { basename, dirname as dirname3, isAbsolute, join as join6, relative, resolve, win32 } from "node:path";
|
|
13039
13039
|
import { Readable as Readable2 } from "node:stream";
|
|
13040
13040
|
import { pipeline as pipeline2 } from "node:stream/promises";
|
|
13041
13041
|
var ORT_VERSION = "1.24.4";
|
|
@@ -13238,6 +13238,29 @@ function isOnnxVersionCompatible(version) {
|
|
|
13238
13238
|
return false;
|
|
13239
13239
|
return minor >= REQUIRED_ORT_MIN_MINOR;
|
|
13240
13240
|
}
|
|
13241
|
+
function pathEnvValue() {
|
|
13242
|
+
return process.env.PATH ?? process.env.Path ?? process.env.path ?? "";
|
|
13243
|
+
}
|
|
13244
|
+
function pathEntriesForPlatform() {
|
|
13245
|
+
const delimiter = process.platform === "win32" ? ";" : ":";
|
|
13246
|
+
return pathEnvValue().split(delimiter).map((entry) => entry.trim().replace(/^"|"$/g, "")).filter((entry) => {
|
|
13247
|
+
if (!entry || entry === "." || entry.includes("\x00"))
|
|
13248
|
+
return false;
|
|
13249
|
+
return isAbsolute(entry) || win32.isAbsolute(entry);
|
|
13250
|
+
});
|
|
13251
|
+
}
|
|
13252
|
+
function directoryContainsLibrary(dir, libName) {
|
|
13253
|
+
try {
|
|
13254
|
+
const entries = readdirSync(dir);
|
|
13255
|
+
if (process.platform === "win32") {
|
|
13256
|
+
const expected = libName.toLowerCase();
|
|
13257
|
+
return entries.some((entry) => entry.toLowerCase() === expected);
|
|
13258
|
+
}
|
|
13259
|
+
return entries.includes(libName);
|
|
13260
|
+
} catch {
|
|
13261
|
+
return false;
|
|
13262
|
+
}
|
|
13263
|
+
}
|
|
13241
13264
|
function findSystemOnnxRuntime(libName) {
|
|
13242
13265
|
if (!libName)
|
|
13243
13266
|
return null;
|
|
@@ -13246,9 +13269,15 @@ function findSystemOnnxRuntime(libName) {
|
|
|
13246
13269
|
searchPaths.push("/opt/homebrew/lib", "/usr/local/lib");
|
|
13247
13270
|
} else if (process.platform === "linux") {
|
|
13248
13271
|
searchPaths.push("/usr/lib", "/usr/lib/x86_64-linux-gnu", "/usr/lib/aarch64-linux-gnu", "/usr/local/lib");
|
|
13272
|
+
} else if (process.platform === "win32") {
|
|
13273
|
+
searchPaths.push(...pathEntriesForPlatform());
|
|
13249
13274
|
}
|
|
13275
|
+
const seen = new Set;
|
|
13250
13276
|
for (const dir of searchPaths) {
|
|
13251
|
-
if (
|
|
13277
|
+
if (seen.has(dir))
|
|
13278
|
+
continue;
|
|
13279
|
+
seen.add(dir);
|
|
13280
|
+
if (!directoryContainsLibrary(dir, libName))
|
|
13252
13281
|
continue;
|
|
13253
13282
|
const version = detectOnnxVersion(dir, libName);
|
|
13254
13283
|
if (version && !isOnnxVersionCompatible(version)) {
|
|
@@ -14505,7 +14534,7 @@ import {
|
|
|
14505
14534
|
// package.json
|
|
14506
14535
|
var package_default = {
|
|
14507
14536
|
name: "@cortexkit/aft-pi",
|
|
14508
|
-
version: "0.31.
|
|
14537
|
+
version: "0.31.1",
|
|
14509
14538
|
type: "module",
|
|
14510
14539
|
description: "Pi coding agent extension for Agent File Tools (AFT) — tree-sitter and LSP-powered code analysis",
|
|
14511
14540
|
main: "dist/index.js",
|
|
@@ -14527,7 +14556,7 @@ var package_default = {
|
|
|
14527
14556
|
prepublishOnly: "bun run build"
|
|
14528
14557
|
},
|
|
14529
14558
|
dependencies: {
|
|
14530
|
-
"@cortexkit/aft-bridge": "0.31.
|
|
14559
|
+
"@cortexkit/aft-bridge": "0.31.1",
|
|
14531
14560
|
"@xterm/headless": "^5.5.0",
|
|
14532
14561
|
"comment-json": "^5.0.0",
|
|
14533
14562
|
diff: "^8.0.4",
|
|
@@ -14535,12 +14564,12 @@ var package_default = {
|
|
|
14535
14564
|
zod: "^4.1.8"
|
|
14536
14565
|
},
|
|
14537
14566
|
optionalDependencies: {
|
|
14538
|
-
"@cortexkit/aft-darwin-arm64": "0.31.
|
|
14539
|
-
"@cortexkit/aft-darwin-x64": "0.31.
|
|
14540
|
-
"@cortexkit/aft-linux-arm64": "0.31.
|
|
14541
|
-
"@cortexkit/aft-linux-x64": "0.31.
|
|
14542
|
-
"@cortexkit/aft-win32-arm64": "0.31.
|
|
14543
|
-
"@cortexkit/aft-win32-x64": "0.31.
|
|
14567
|
+
"@cortexkit/aft-darwin-arm64": "0.31.1",
|
|
14568
|
+
"@cortexkit/aft-darwin-x64": "0.31.1",
|
|
14569
|
+
"@cortexkit/aft-linux-arm64": "0.31.1",
|
|
14570
|
+
"@cortexkit/aft-linux-x64": "0.31.1",
|
|
14571
|
+
"@cortexkit/aft-win32-arm64": "0.31.1",
|
|
14572
|
+
"@cortexkit/aft-win32-x64": "0.31.1"
|
|
14544
14573
|
},
|
|
14545
14574
|
devDependencies: {
|
|
14546
14575
|
"@earendil-works/pi-coding-agent": "*",
|
|
@@ -32370,7 +32399,7 @@ function registerFsTools(pi, ctx, surface) {
|
|
|
32370
32399
|
// src/tools/hoisted.ts
|
|
32371
32400
|
import { stat } from "node:fs/promises";
|
|
32372
32401
|
import { homedir as homedir9 } from "node:os";
|
|
32373
|
-
import { isAbsolute, relative as relative3, resolve as resolve3, sep } from "node:path";
|
|
32402
|
+
import { isAbsolute as isAbsolute2, relative as relative3, resolve as resolve3, sep } from "node:path";
|
|
32374
32403
|
import {
|
|
32375
32404
|
renderDiff as renderDiff2
|
|
32376
32405
|
} from "@earendil-works/pi-coding-agent";
|
|
@@ -32482,7 +32511,7 @@ function formatDiffForPi(oldContent, newContent, contextLines = DEFAULT_CONTEXT_
|
|
|
32482
32511
|
// src/tools/hoisted.ts
|
|
32483
32512
|
function containsPath(parent, child) {
|
|
32484
32513
|
const rel = relative3(parent, child);
|
|
32485
|
-
return rel === "" || !rel.startsWith("..") && !
|
|
32514
|
+
return rel === "" || !rel.startsWith("..") && !isAbsolute2(rel);
|
|
32486
32515
|
}
|
|
32487
32516
|
function expandTilde(path2) {
|
|
32488
32517
|
if (!path2 || !path2.startsWith("~"))
|
|
@@ -32505,7 +32534,7 @@ async function assertExternalDirectoryPermission(extCtx, target, action = "modif
|
|
|
32505
32534
|
if (!target)
|
|
32506
32535
|
return;
|
|
32507
32536
|
const expanded = expandTilde(target);
|
|
32508
|
-
const absoluteTarget =
|
|
32537
|
+
const absoluteTarget = isAbsolute2(expanded) ? expanded : resolve3(extCtx.cwd, expanded);
|
|
32509
32538
|
if (containsPath(extCtx.cwd, absoluteTarget))
|
|
32510
32539
|
return;
|
|
32511
32540
|
if (options.restrictToProjectRoot === false)
|
|
@@ -32873,7 +32902,7 @@ function shortenPath2(path2) {
|
|
|
32873
32902
|
}
|
|
32874
32903
|
async function resolvePathArg(cwd, path2) {
|
|
32875
32904
|
const expanded = expandTilde(path2);
|
|
32876
|
-
const abs =
|
|
32905
|
+
const abs = isAbsolute2(expanded) ? expanded : resolve3(cwd, expanded);
|
|
32877
32906
|
try {
|
|
32878
32907
|
await stat(abs);
|
|
32879
32908
|
return abs;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cortexkit/aft-pi",
|
|
3
|
-
"version": "0.31.
|
|
3
|
+
"version": "0.31.1",
|
|
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,7 +22,7 @@
|
|
|
22
22
|
"prepublishOnly": "bun run build"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@cortexkit/aft-bridge": "0.31.
|
|
25
|
+
"@cortexkit/aft-bridge": "0.31.1",
|
|
26
26
|
"@xterm/headless": "^5.5.0",
|
|
27
27
|
"comment-json": "^5.0.0",
|
|
28
28
|
"diff": "^8.0.4",
|
|
@@ -30,12 +30,12 @@
|
|
|
30
30
|
"zod": "^4.1.8"
|
|
31
31
|
},
|
|
32
32
|
"optionalDependencies": {
|
|
33
|
-
"@cortexkit/aft-darwin-arm64": "0.31.
|
|
34
|
-
"@cortexkit/aft-darwin-x64": "0.31.
|
|
35
|
-
"@cortexkit/aft-linux-arm64": "0.31.
|
|
36
|
-
"@cortexkit/aft-linux-x64": "0.31.
|
|
37
|
-
"@cortexkit/aft-win32-arm64": "0.31.
|
|
38
|
-
"@cortexkit/aft-win32-x64": "0.31.
|
|
33
|
+
"@cortexkit/aft-darwin-arm64": "0.31.1",
|
|
34
|
+
"@cortexkit/aft-darwin-x64": "0.31.1",
|
|
35
|
+
"@cortexkit/aft-linux-arm64": "0.31.1",
|
|
36
|
+
"@cortexkit/aft-linux-x64": "0.31.1",
|
|
37
|
+
"@cortexkit/aft-win32-arm64": "0.31.1",
|
|
38
|
+
"@cortexkit/aft-win32-x64": "0.31.1"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@earendil-works/pi-coding-agent": "*",
|