@cortexkit/aft-opencode 0.11.2 → 0.11.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.
- package/dist/index.js +50 -23
- package/dist/onnx-runtime.d.ts.map +1 -1
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -21953,7 +21953,7 @@ async function cleanupWarnings(opts) {
|
|
|
21953
21953
|
}
|
|
21954
21954
|
|
|
21955
21955
|
// src/onnx-runtime.ts
|
|
21956
|
-
import { chmodSync as chmodSync2, existsSync as existsSync4, mkdirSync as mkdirSync3, readdirSync,
|
|
21956
|
+
import { chmodSync as chmodSync2, existsSync as existsSync4, mkdirSync as mkdirSync3, readdirSync, unlinkSync as unlinkSync2 } from "fs";
|
|
21957
21957
|
import { join as join5 } from "path";
|
|
21958
21958
|
var ORT_VERSION = "1.24.4";
|
|
21959
21959
|
var ORT_REPO = "microsoft/onnxruntime";
|
|
@@ -22050,13 +22050,11 @@ async function downloadOnnxRuntime(info, targetDir) {
|
|
|
22050
22050
|
const tmpDir = `${targetDir}.tmp.${process.pid}`;
|
|
22051
22051
|
mkdirSync3(tmpDir, { recursive: true });
|
|
22052
22052
|
const archivePath = join5(tmpDir, `onnxruntime.${info.archiveType}`);
|
|
22053
|
-
const
|
|
22054
|
-
|
|
22055
|
-
|
|
22056
|
-
|
|
22057
|
-
|
|
22058
|
-
const { writeFileSync: writeFileSync2 } = await import("fs");
|
|
22059
|
-
writeFileSync2(archivePath, buffer2);
|
|
22053
|
+
const { execSync: execSyncDl } = await import("child_process");
|
|
22054
|
+
execSyncDl(`curl -fsSL "${url2}" -o "${archivePath}"`, {
|
|
22055
|
+
stdio: "pipe",
|
|
22056
|
+
timeout: 120000
|
|
22057
|
+
});
|
|
22060
22058
|
if (info.archiveType === "tgz") {
|
|
22061
22059
|
const { execSync } = await import("child_process");
|
|
22062
22060
|
execSync(`tar xzf "${archivePath}" -C "${tmpDir}"`, { stdio: "pipe" });
|
|
@@ -22070,14 +22068,43 @@ async function downloadOnnxRuntime(info, targetDir) {
|
|
|
22070
22068
|
}
|
|
22071
22069
|
mkdirSync3(targetDir, { recursive: true });
|
|
22072
22070
|
const libFiles = readdirSync(extractedDir).filter((f) => f.startsWith("libonnxruntime") || f.startsWith("onnxruntime"));
|
|
22071
|
+
const { lstatSync, symlinkSync, readlinkSync, copyFileSync: cpFile } = await import("fs");
|
|
22072
|
+
const realFiles = [];
|
|
22073
|
+
const symlinks = [];
|
|
22073
22074
|
for (const libFile of libFiles) {
|
|
22075
|
+
const src = join5(extractedDir, libFile);
|
|
22076
|
+
try {
|
|
22077
|
+
const stat = lstatSync(src);
|
|
22078
|
+
log(`ORT extract: ${libFile} \u2014 isSymlink=${stat.isSymbolicLink()}, isFile=${stat.isFile()}, size=${stat.size}`);
|
|
22079
|
+
if (stat.isSymbolicLink()) {
|
|
22080
|
+
symlinks.push({ name: libFile, target: readlinkSync(src) });
|
|
22081
|
+
} else {
|
|
22082
|
+
realFiles.push(libFile);
|
|
22083
|
+
}
|
|
22084
|
+
} catch (e) {
|
|
22085
|
+
log(`ORT extract: ${libFile} \u2014 stat failed: ${e}`);
|
|
22086
|
+
realFiles.push(libFile);
|
|
22087
|
+
}
|
|
22088
|
+
}
|
|
22089
|
+
for (const libFile of realFiles) {
|
|
22074
22090
|
const src = join5(extractedDir, libFile);
|
|
22075
22091
|
const dst = join5(targetDir, libFile);
|
|
22076
|
-
|
|
22077
|
-
|
|
22078
|
-
|
|
22092
|
+
try {
|
|
22093
|
+
cpFile(src, dst);
|
|
22094
|
+
if (process.platform !== "win32") {
|
|
22095
|
+
chmodSync2(dst, 493);
|
|
22096
|
+
}
|
|
22097
|
+
} catch (copyErr) {
|
|
22098
|
+
log(`ORT extract: failed to copy ${libFile}: ${copyErr}`);
|
|
22079
22099
|
}
|
|
22080
22100
|
}
|
|
22101
|
+
for (const link of symlinks) {
|
|
22102
|
+
const dst = join5(targetDir, link.name);
|
|
22103
|
+
try {
|
|
22104
|
+
unlinkSync2(dst);
|
|
22105
|
+
} catch {}
|
|
22106
|
+
symlinkSync(link.target, dst);
|
|
22107
|
+
}
|
|
22081
22108
|
const { rmSync } = await import("fs");
|
|
22082
22109
|
rmSync(tmpDir, { recursive: true, force: true });
|
|
22083
22110
|
log(`ONNX Runtime v${ORT_VERSION} installed to ${targetDir}`);
|
|
@@ -22492,8 +22519,8 @@ function copyToVersionedCache(npmBinaryPath) {
|
|
|
22492
22519
|
if (process.platform !== "win32") {
|
|
22493
22520
|
chmodSync3(tmpPath, 493);
|
|
22494
22521
|
}
|
|
22495
|
-
const { renameSync
|
|
22496
|
-
|
|
22522
|
+
const { renameSync } = __require("fs");
|
|
22523
|
+
renameSync(tmpPath, cachedPath);
|
|
22497
22524
|
log(`Copied npm binary to versioned cache: ${cachedPath}`);
|
|
22498
22525
|
return cachedPath;
|
|
22499
22526
|
} catch (err) {
|
|
@@ -22582,7 +22609,7 @@ async function findBinary() {
|
|
|
22582
22609
|
}
|
|
22583
22610
|
|
|
22584
22611
|
// src/shared/rpc-server.ts
|
|
22585
|
-
import { mkdirSync as mkdirSync5, renameSync
|
|
22612
|
+
import { mkdirSync as mkdirSync5, renameSync, unlinkSync as unlinkSync3, writeFileSync as writeFileSync2 } from "fs";
|
|
22586
22613
|
import { createServer } from "http";
|
|
22587
22614
|
import { dirname } from "path";
|
|
22588
22615
|
|
|
@@ -22630,7 +22657,7 @@ class AftRpcServer {
|
|
|
22630
22657
|
mkdirSync5(dir, { recursive: true });
|
|
22631
22658
|
const tmpPath = `${this.portFilePath}.tmp`;
|
|
22632
22659
|
writeFileSync2(tmpPath, String(this.port), "utf-8");
|
|
22633
|
-
|
|
22660
|
+
renameSync(tmpPath, this.portFilePath);
|
|
22634
22661
|
log(`RPC server listening on 127.0.0.1:${this.port}`);
|
|
22635
22662
|
} catch (err) {
|
|
22636
22663
|
warn(`Failed to write RPC port file: ${err}`);
|
|
@@ -22646,7 +22673,7 @@ class AftRpcServer {
|
|
|
22646
22673
|
this.server = null;
|
|
22647
22674
|
}
|
|
22648
22675
|
try {
|
|
22649
|
-
|
|
22676
|
+
unlinkSync3(this.portFilePath);
|
|
22650
22677
|
} catch {}
|
|
22651
22678
|
}
|
|
22652
22679
|
dispatch(req, res) {
|
|
@@ -22899,7 +22926,7 @@ import {
|
|
|
22899
22926
|
mkdirSync as mkdirSync7,
|
|
22900
22927
|
readdirSync as readdirSync2,
|
|
22901
22928
|
readFileSync as readFileSync4,
|
|
22902
|
-
unlinkSync as
|
|
22929
|
+
unlinkSync as unlinkSync4,
|
|
22903
22930
|
writeFileSync as writeFileSync4
|
|
22904
22931
|
} from "fs";
|
|
22905
22932
|
import { join as join11 } from "path";
|
|
@@ -23012,8 +23039,8 @@ async function fetchUrlToTempFile(url2, storageDir) {
|
|
|
23012
23039
|
const contentFile = contentPath(storageDir, hash2, extension);
|
|
23013
23040
|
const tmpContent = `${contentFile}.tmp-${process.pid}`;
|
|
23014
23041
|
writeFileSync4(tmpContent, body);
|
|
23015
|
-
const { renameSync:
|
|
23016
|
-
|
|
23042
|
+
const { renameSync: renameSync2 } = await import("fs");
|
|
23043
|
+
renameSync2(tmpContent, contentFile);
|
|
23017
23044
|
const meta3 = {
|
|
23018
23045
|
url: url2,
|
|
23019
23046
|
contentType,
|
|
@@ -23022,7 +23049,7 @@ async function fetchUrlToTempFile(url2, storageDir) {
|
|
|
23022
23049
|
};
|
|
23023
23050
|
const tmpMeta = `${metaFile}.tmp-${process.pid}`;
|
|
23024
23051
|
writeFileSync4(tmpMeta, JSON.stringify(meta3));
|
|
23025
|
-
|
|
23052
|
+
renameSync2(tmpMeta, metaFile);
|
|
23026
23053
|
log(`URL cached (${total} bytes): ${url2}`);
|
|
23027
23054
|
return contentFile;
|
|
23028
23055
|
}
|
|
@@ -23043,13 +23070,13 @@ function cleanupUrlCache(storageDir) {
|
|
|
23043
23070
|
const hash2 = entry.slice(0, -".meta.json".length);
|
|
23044
23071
|
const content = contentPath(storageDir, hash2, meta3.extension);
|
|
23045
23072
|
if (existsSync7(content))
|
|
23046
|
-
|
|
23047
|
-
|
|
23073
|
+
unlinkSync4(content);
|
|
23074
|
+
unlinkSync4(metaFile);
|
|
23048
23075
|
removed++;
|
|
23049
23076
|
}
|
|
23050
23077
|
} catch {
|
|
23051
23078
|
try {
|
|
23052
|
-
|
|
23079
|
+
unlinkSync4(metaFile);
|
|
23053
23080
|
removed++;
|
|
23054
23081
|
} catch {}
|
|
23055
23082
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"onnx-runtime.d.ts","sourceRoot":"","sources":["../src/onnx-runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AA0DH,4DAA4D;AAC5D,wBAAgB,0BAA0B,IAAI,OAAO,CAEpD;AAED,6EAA6E;AAC7E,wBAAgB,oBAAoB,IAAI,MAAM,CAQ7C;AAED;;;;;;;;GAQG;AACH,wBAAsB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CA4BlF;
|
|
1
|
+
{"version":3,"file":"onnx-runtime.d.ts","sourceRoot":"","sources":["../src/onnx-runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AA0DH,4DAA4D;AAC5D,wBAAgB,0BAA0B,IAAI,OAAO,CAEpD;AAED,6EAA6E;AAC7E,wBAAgB,oBAAoB,IAAI,MAAM,CAQ7C;AAED;;;;;;;;GAQG;AACH,wBAAsB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CA4BlF;AAgJD;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAU3D"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cortexkit/aft-opencode",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "OpenCode plugin for Agent File Tools (AFT) — tree-sitter and lsp powered code analysis",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -35,11 +35,11 @@
|
|
|
35
35
|
"zod": "^4.1.8"
|
|
36
36
|
},
|
|
37
37
|
"optionalDependencies": {
|
|
38
|
-
"@cortexkit/aft-darwin-arm64": "0.11.
|
|
39
|
-
"@cortexkit/aft-darwin-x64": "0.11.
|
|
40
|
-
"@cortexkit/aft-linux-arm64": "0.11.
|
|
41
|
-
"@cortexkit/aft-linux-x64": "0.11.
|
|
42
|
-
"@cortexkit/aft-win32-x64": "0.11.
|
|
38
|
+
"@cortexkit/aft-darwin-arm64": "0.11.3",
|
|
39
|
+
"@cortexkit/aft-darwin-x64": "0.11.3",
|
|
40
|
+
"@cortexkit/aft-linux-arm64": "0.11.3",
|
|
41
|
+
"@cortexkit/aft-linux-x64": "0.11.3",
|
|
42
|
+
"@cortexkit/aft-win32-x64": "0.11.3"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@types/node": "^22.0.0",
|