@cortexkit/aft-opencode 0.11.1 → 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/cli/doctor.d.ts.map +1 -1
- package/dist/cli/logs.d.ts +10 -1
- package/dist/cli/logs.d.ts.map +1 -1
- package/dist/cli.js +93 -41
- package/dist/index.js +50 -23
- package/dist/onnx-runtime.d.ts.map +1 -1
- package/package.json +6 -6
package/dist/cli/doctor.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/cli/doctor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/cli/doctor.ts"],"names":[],"mappings":"AA4QA,wBAAsB,SAAS,CAC7B,OAAO,GAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CAAO,GACjD,OAAO,CAAC,MAAM,CAAC,CAsIjB"}
|
package/dist/cli/logs.d.ts
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import type { DiagnosticReport } from "./diagnostics.js";
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Strip personally identifiable path segments from arbitrary text.
|
|
4
|
+
* Used on both log contents and the full doctor --issue body so diagnostic
|
|
5
|
+
* reports never leak usernames or home directory paths.
|
|
6
|
+
*/
|
|
7
|
+
export declare function sanitizeContent(content: string): string;
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated Use sanitizeContent. Kept as an alias for backward compatibility.
|
|
10
|
+
*/
|
|
11
|
+
export declare const sanitizeLogContent: typeof sanitizeContent;
|
|
3
12
|
export declare function bundleIssueReport(report: DiagnosticReport, description: string, _title: string): Promise<{
|
|
4
13
|
path: string;
|
|
5
14
|
bodyMarkdown: string;
|
package/dist/cli/logs.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logs.d.ts","sourceRoot":"","sources":["../../src/cli/logs.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAOzD,wBAAgB,
|
|
1
|
+
{"version":3,"file":"logs.d.ts","sourceRoot":"","sources":["../../src/cli/logs.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAOzD;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAgBvD;AAED;;GAEG;AACH,eAAO,MAAM,kBAAkB,wBAAkB,CAAC;AAelD,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,gBAAgB,EACxB,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,CAAC,CA0CjD"}
|
package/dist/cli.js
CHANGED
|
@@ -7849,8 +7849,8 @@ var require_src3 = __commonJS((exports, module) => {
|
|
|
7849
7849
|
// src/cli/doctor.ts
|
|
7850
7850
|
var import_comment_json3 = __toESM(require_src2(), 1);
|
|
7851
7851
|
import { execSync as execSync3, spawnSync } from "node:child_process";
|
|
7852
|
-
import { existsSync as
|
|
7853
|
-
import { dirname as dirname2 } from "node:path";
|
|
7852
|
+
import { existsSync as existsSync5, mkdirSync as mkdirSync2, readdirSync as readdirSync3, readFileSync as readFileSync5, writeFileSync as writeFileSync3 } from "node:fs";
|
|
7853
|
+
import path2, { dirname as dirname2 } from "node:path";
|
|
7854
7854
|
|
|
7855
7855
|
// src/shared/tui-config.ts
|
|
7856
7856
|
var import_comment_json = __toESM(require_src2(), 1);
|
|
@@ -8521,16 +8521,17 @@ import { join as join8 } from "node:path";
|
|
|
8521
8521
|
function escapeRegex2(value) {
|
|
8522
8522
|
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
8523
8523
|
}
|
|
8524
|
-
function
|
|
8524
|
+
function sanitizeContent(content) {
|
|
8525
8525
|
const username = userInfo2().username;
|
|
8526
8526
|
const home = homedir6();
|
|
8527
8527
|
let sanitized = content;
|
|
8528
8528
|
if (home) {
|
|
8529
8529
|
sanitized = sanitized.replace(new RegExp(escapeRegex2(home), "g"), "~");
|
|
8530
8530
|
}
|
|
8531
|
-
sanitized = sanitized.replace(/\/Users\/[
|
|
8532
|
-
sanitized = sanitized.replace(/\/home\/[
|
|
8533
|
-
sanitized = sanitized.replace(/C:\\\\Users\\\\[^\\\\]
|
|
8531
|
+
sanitized = sanitized.replace(/\/Users\/[^/\s"']+/g, "/Users/<USER>");
|
|
8532
|
+
sanitized = sanitized.replace(/\/home\/[^/\s"']+/g, "/home/<USER>");
|
|
8533
|
+
sanitized = sanitized.replace(/C:\\\\Users\\\\[^\\\\"'\s]+/g, "C:\\\\Users\\\\<USER>");
|
|
8534
|
+
sanitized = sanitized.replace(/C:\\Users\\[^\\"'\s]+/g, "C:\\Users\\<USER>");
|
|
8534
8535
|
if (username) {
|
|
8535
8536
|
sanitized = sanitized.replace(new RegExp(escapeRegex2(username), "g"), "<USER>");
|
|
8536
8537
|
}
|
|
@@ -8550,10 +8551,10 @@ function formatTimestamp(date) {
|
|
|
8550
8551
|
}
|
|
8551
8552
|
async function bundleIssueReport(report, description, _title) {
|
|
8552
8553
|
const logLines = report.logFile.exists ? readFileSync4(report.logFile.path, "utf-8").split(/\r?\n/) : [];
|
|
8553
|
-
const recentLog =
|
|
8554
|
-
`)
|
|
8554
|
+
const recentLog = logLines.slice(-200).join(`
|
|
8555
|
+
`).trim();
|
|
8555
8556
|
const configBody = JSON.stringify(report.aftConfig.flags, null, 2);
|
|
8556
|
-
const
|
|
8557
|
+
const rawBody = [
|
|
8557
8558
|
"## Description",
|
|
8558
8559
|
description,
|
|
8559
8560
|
"",
|
|
@@ -8565,7 +8566,7 @@ async function bundleIssueReport(report, description, _title) {
|
|
|
8565
8566
|
`- OpenCode: ${report.opencodeVersion ?? "not installed"}`,
|
|
8566
8567
|
"",
|
|
8567
8568
|
"## Configuration",
|
|
8568
|
-
`Enabled flags from \`${report.configPaths.aftConfig
|
|
8569
|
+
`Enabled flags from \`${report.configPaths.aftConfig}\`:`,
|
|
8569
8570
|
"```jsonc",
|
|
8570
8571
|
configBody,
|
|
8571
8572
|
"```",
|
|
@@ -8573,12 +8574,15 @@ async function bundleIssueReport(report, description, _title) {
|
|
|
8573
8574
|
"## Diagnostics",
|
|
8574
8575
|
renderDiagnosticsMarkdown(report),
|
|
8575
8576
|
"",
|
|
8576
|
-
"## Log (last 200 lines
|
|
8577
|
+
"## Log (last 200 lines)",
|
|
8577
8578
|
"```",
|
|
8578
8579
|
recentLog || "<no log output>",
|
|
8579
|
-
"```"
|
|
8580
|
+
"```",
|
|
8581
|
+
"",
|
|
8582
|
+
"_Username and home paths have been stripped from this report._"
|
|
8580
8583
|
].join(`
|
|
8581
8584
|
`);
|
|
8585
|
+
const bodyMarkdown = sanitizeContent(rawBody);
|
|
8582
8586
|
const path2 = join8(process.cwd(), `aft-issue-${formatTimestamp(new Date)}.md`);
|
|
8583
8587
|
writeFileSync2(path2, `${bodyMarkdown}
|
|
8584
8588
|
`);
|
|
@@ -9754,15 +9758,15 @@ async function text(message, options = {}) {
|
|
|
9754
9758
|
// src/cli/doctor.ts
|
|
9755
9759
|
var PLUGIN_NAME4 = "@cortexkit/aft-opencode";
|
|
9756
9760
|
var PLUGIN_ENTRY2 = `${PLUGIN_NAME4}@latest`;
|
|
9757
|
-
function ensureDir(
|
|
9758
|
-
mkdirSync2(dirname2(
|
|
9761
|
+
function ensureDir(path3) {
|
|
9762
|
+
mkdirSync2(dirname2(path3), { recursive: true });
|
|
9759
9763
|
}
|
|
9760
|
-
function parseConfig(
|
|
9761
|
-
if (!
|
|
9764
|
+
function parseConfig(path3) {
|
|
9765
|
+
if (!existsSync5(path3)) {
|
|
9762
9766
|
return null;
|
|
9763
9767
|
}
|
|
9764
9768
|
try {
|
|
9765
|
-
return import_comment_json3.parse(readFileSync5(
|
|
9769
|
+
return import_comment_json3.parse(readFileSync5(path3, "utf-8")) ?? {};
|
|
9766
9770
|
} catch {
|
|
9767
9771
|
return null;
|
|
9768
9772
|
}
|
|
@@ -9836,12 +9840,67 @@ function summarizeFlags(flags) {
|
|
|
9836
9840
|
const entries = Object.entries(flags).filter(([, value]) => value !== undefined).map(([key, value]) => `${key}=${JSON.stringify(value)}`);
|
|
9837
9841
|
return entries.length > 0 ? entries.join(", ") : "using defaults";
|
|
9838
9842
|
}
|
|
9843
|
+
var REQUIRED_ORT_MAJOR = 1;
|
|
9844
|
+
var REQUIRED_ORT_MIN_MINOR = 20;
|
|
9845
|
+
function detectOrtVersion(libDir) {
|
|
9846
|
+
try {
|
|
9847
|
+
const entries = readdirSync3(libDir);
|
|
9848
|
+
for (const entry of entries) {
|
|
9849
|
+
if (!entry.startsWith("libonnxruntime"))
|
|
9850
|
+
continue;
|
|
9851
|
+
const match = entry.match(/(\d+\.\d+\.\d+)/);
|
|
9852
|
+
if (match)
|
|
9853
|
+
return match[1];
|
|
9854
|
+
}
|
|
9855
|
+
} catch {}
|
|
9856
|
+
return null;
|
|
9857
|
+
}
|
|
9858
|
+
function checkOrtVersion(report) {
|
|
9859
|
+
let issues = 0;
|
|
9860
|
+
if (report.onnxRuntime.cachedPath) {
|
|
9861
|
+
const cachedDir = path2.dirname(report.onnxRuntime.cachedPath);
|
|
9862
|
+
const version = detectOrtVersion(cachedDir);
|
|
9863
|
+
if (version) {
|
|
9864
|
+
O2.success(`ONNX Runtime v${version} (auto-downloaded) at ${report.onnxRuntime.cachedPath}`);
|
|
9865
|
+
return 0;
|
|
9866
|
+
}
|
|
9867
|
+
}
|
|
9868
|
+
const systemPaths = process.platform === "darwin" ? ["/opt/homebrew/lib", "/usr/local/lib"] : ["/usr/local/lib", "/usr/lib", "/usr/lib/x86_64-linux-gnu", "/usr/lib/aarch64-linux-gnu"];
|
|
9869
|
+
for (const dir of systemPaths) {
|
|
9870
|
+
const version = detectOrtVersion(dir);
|
|
9871
|
+
if (version) {
|
|
9872
|
+
const parts = version.split(".").map(Number);
|
|
9873
|
+
const [major, minor] = [parts[0], parts[1]];
|
|
9874
|
+
if (major === REQUIRED_ORT_MAJOR && minor >= REQUIRED_ORT_MIN_MINOR) {
|
|
9875
|
+
O2.success(`ONNX Runtime v${version} (compatible) at ${dir}`);
|
|
9876
|
+
return 0;
|
|
9877
|
+
}
|
|
9878
|
+
O2.error(`ONNX Runtime v${version} found at ${dir} — INCOMPATIBLE (need v1.${REQUIRED_ORT_MIN_MINOR}+)`);
|
|
9879
|
+
O2.info("This version mismatch causes AFT to crash when semantic search initializes.");
|
|
9880
|
+
O2.info("Solutions:");
|
|
9881
|
+
if (process.platform === "linux") {
|
|
9882
|
+
O2.info(` 1. Remove old version: sudo rm ${dir}/libonnxruntime* && sudo ldconfig`);
|
|
9883
|
+
O2.info(" Then restart OpenCode — AFT auto-downloads the correct version.");
|
|
9884
|
+
} else {
|
|
9885
|
+
O2.info(` 1. Remove old version: sudo rm ${dir}/libonnxruntime*`);
|
|
9886
|
+
O2.info(" Then restart OpenCode — AFT auto-downloads the correct version.");
|
|
9887
|
+
}
|
|
9888
|
+
O2.info(" 2. Or install v1.24: https://github.com/microsoft/onnxruntime/releases/tag/v1.24.0");
|
|
9889
|
+
issues++;
|
|
9890
|
+
return issues;
|
|
9891
|
+
}
|
|
9892
|
+
}
|
|
9893
|
+
if (report.onnxRuntime.required && !report.onnxRuntime.cachedPath) {
|
|
9894
|
+
O2.warn("ONNX Runtime not found — AFT will attempt auto-download on startup");
|
|
9895
|
+
}
|
|
9896
|
+
return issues;
|
|
9897
|
+
}
|
|
9839
9898
|
function warnAboutLinuxLdconfig(systemPath) {
|
|
9840
9899
|
if (process.platform !== "linux") {
|
|
9841
9900
|
return false;
|
|
9842
9901
|
}
|
|
9843
9902
|
const libPath = "/usr/local/lib/libonnxruntime.so";
|
|
9844
|
-
if (!
|
|
9903
|
+
if (!existsSync5(libPath)) {
|
|
9845
9904
|
return false;
|
|
9846
9905
|
}
|
|
9847
9906
|
try {
|
|
@@ -9985,14 +10044,7 @@ async function runDoctor(options = {}) {
|
|
|
9985
10044
|
O2.info("Run `rm -rf ~/.cache/aft/bin/<version>` to clean them up");
|
|
9986
10045
|
}
|
|
9987
10046
|
if (report.onnxRuntime.required) {
|
|
9988
|
-
|
|
9989
|
-
O2.success(`ONNX Runtime cached at ${report.onnxRuntime.cachedPath}`);
|
|
9990
|
-
} else if (report.onnxRuntime.systemPath) {
|
|
9991
|
-
O2.success(`ONNX Runtime found at ${report.onnxRuntime.systemPath}`);
|
|
9992
|
-
} else {
|
|
9993
|
-
O2.warn(`ONNX Runtime missing - install hint: ${report.onnxRuntime.installHint}`);
|
|
9994
|
-
issues++;
|
|
9995
|
-
}
|
|
10047
|
+
issues += checkOrtVersion(report);
|
|
9996
10048
|
if (warnAboutLinuxLdconfig(report.onnxRuntime.systemPath)) {
|
|
9997
10049
|
issues++;
|
|
9998
10050
|
}
|
|
@@ -10017,39 +10069,39 @@ async function runDoctor(options = {}) {
|
|
|
10017
10069
|
|
|
10018
10070
|
// src/cli/setup.ts
|
|
10019
10071
|
var import_comment_json4 = __toESM(require_src2(), 1);
|
|
10020
|
-
import { existsSync as
|
|
10072
|
+
import { existsSync as existsSync6, mkdirSync as mkdirSync3, readFileSync as readFileSync6, writeFileSync as writeFileSync4 } from "node:fs";
|
|
10021
10073
|
import { dirname as dirname3 } from "node:path";
|
|
10022
10074
|
var PLUGIN_NAME5 = "@cortexkit/aft-opencode";
|
|
10023
10075
|
var PLUGIN_ENTRY3 = `${PLUGIN_NAME5}@latest`;
|
|
10024
|
-
function ensureDir2(
|
|
10025
|
-
mkdirSync3(dirname3(
|
|
10076
|
+
function ensureDir2(path3) {
|
|
10077
|
+
mkdirSync3(dirname3(path3), { recursive: true });
|
|
10026
10078
|
}
|
|
10027
|
-
function readJsonc(
|
|
10028
|
-
if (!
|
|
10079
|
+
function readJsonc(path3) {
|
|
10080
|
+
if (!existsSync6(path3)) {
|
|
10029
10081
|
return null;
|
|
10030
10082
|
}
|
|
10031
|
-
return import_comment_json4.parse(readFileSync6(
|
|
10083
|
+
return import_comment_json4.parse(readFileSync6(path3, "utf-8")) ?? {};
|
|
10032
10084
|
}
|
|
10033
|
-
function writeJsonc(
|
|
10034
|
-
ensureDir2(
|
|
10035
|
-
writeFileSync4(
|
|
10085
|
+
function writeJsonc(path3, config) {
|
|
10086
|
+
ensureDir2(path3);
|
|
10087
|
+
writeFileSync4(path3, `${import_comment_json4.stringify(config, null, 2)}
|
|
10036
10088
|
`);
|
|
10037
10089
|
}
|
|
10038
|
-
function ensurePluginInOpenCodeConfig(
|
|
10090
|
+
function ensurePluginInOpenCodeConfig(path3, format) {
|
|
10039
10091
|
if (format === "none") {
|
|
10040
|
-
writeJsonc(
|
|
10092
|
+
writeJsonc(path3, { plugin: [PLUGIN_ENTRY3] });
|
|
10041
10093
|
return;
|
|
10042
10094
|
}
|
|
10043
|
-
const existing = readJsonc(
|
|
10095
|
+
const existing = readJsonc(path3);
|
|
10044
10096
|
if (!existing) {
|
|
10045
|
-
throw new Error(`Could not parse ${
|
|
10097
|
+
throw new Error(`Could not parse ${path3}`);
|
|
10046
10098
|
}
|
|
10047
10099
|
const plugins = Array.isArray(existing.plugin) ? existing.plugin.filter((entry) => typeof entry === "string") : [];
|
|
10048
10100
|
if (!plugins.some((entry) => entry === PLUGIN_NAME5 || entry.startsWith(`${PLUGIN_NAME5}@`))) {
|
|
10049
10101
|
plugins.push(PLUGIN_ENTRY3);
|
|
10050
10102
|
}
|
|
10051
10103
|
existing.plugin = plugins;
|
|
10052
|
-
writeJsonc(
|
|
10104
|
+
writeJsonc(path3, existing);
|
|
10053
10105
|
}
|
|
10054
10106
|
async function runSetup() {
|
|
10055
10107
|
mt("AFT Setup");
|
|
@@ -10073,7 +10125,7 @@ async function runSetup() {
|
|
|
10073
10125
|
return 1;
|
|
10074
10126
|
}
|
|
10075
10127
|
const tuiAdded = ensureTuiPluginEntry();
|
|
10076
|
-
if (tuiAdded ||
|
|
10128
|
+
if (tuiAdded || existsSync6(paths.tuiConfig)) {
|
|
10077
10129
|
O2.success("TUI plugin entry configured");
|
|
10078
10130
|
} else {
|
|
10079
10131
|
O2.warn("Could not verify the TUI plugin entry");
|
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",
|