@cortexkit/aft 0.18.1 → 0.18.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/adapters/opencode.d.ts.map +1 -1
- package/dist/index.js +53 -16
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"opencode.d.ts","sourceRoot":"","sources":["../../src/adapters/opencode.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"opencode.d.ts","sourceRoot":"","sources":["../../src/adapters/opencode.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EACV,cAAc,EACd,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EAClB,MAAM,YAAY,CAAC;AAoFpB,qBAAa,eAAgB,YAAW,cAAc;IACpD,QAAQ,CAAC,IAAI,EAAG,UAAU,CAAU;IACpC,QAAQ,CAAC,WAAW,cAAc;IAClC,QAAQ,CAAC,iBAAiB,6BAAe;IACzC,QAAQ,CAAC,sBAAsB,oCAAgB;IAE/C,WAAW,IAAI,OAAO;IAStB,cAAc,IAAI,MAAM,GAAG,IAAI;IAQ/B,iBAAiB,IAAI,kBAAkB;IAgBvC,cAAc,IAAI,OAAO;IAOnB,iBAAiB,IAAI,OAAO,CAAC,iBAAiB,CAAC;IAgDrD,kBAAkB,IAAI,eAAe;IA0BrC,aAAa,IAAI,MAAM;IAKvB,UAAU,IAAI,MAAM;IAIpB,cAAc,IAAI,MAAM;IAIlB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC;QAC9C,MAAM,EAAE,SAAS,GAAG,YAAY,GAAG,WAAW,GAAG,gBAAgB,GAAG,OAAO,CAAC;QAC5E,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IAgCF,qEAAqE;IACrE,mBAAmB,IAAI,MAAM;IAI7B,mEAAmE;IACnE,uBAAuB,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;CAUlD"}
|
package/dist/index.js
CHANGED
|
@@ -7939,9 +7939,10 @@ var init_self_version = () => {};
|
|
|
7939
7939
|
|
|
7940
7940
|
// src/adapters/opencode.ts
|
|
7941
7941
|
import { execSync } from "node:child_process";
|
|
7942
|
-
import { existsSync as existsSync3, readFileSync as readFileSync2, rmSync } from "node:fs";
|
|
7942
|
+
import { existsSync as existsSync3, readFileSync as readFileSync2, rmSync, statSync as statSync2 } from "node:fs";
|
|
7943
7943
|
import { homedir as homedir2 } from "node:os";
|
|
7944
|
-
import { join as join3, resolve } from "node:path";
|
|
7944
|
+
import { dirname as dirname2, join as join3, parse, resolve } from "node:path";
|
|
7945
|
+
import { fileURLToPath } from "node:url";
|
|
7945
7946
|
function getOpenCodeConfigDir() {
|
|
7946
7947
|
const envDir = process.env.OPENCODE_CONFIG_DIR?.trim();
|
|
7947
7948
|
if (envDir)
|
|
@@ -7959,16 +7960,52 @@ function getOpenCodeCacheDir() {
|
|
|
7959
7960
|
}
|
|
7960
7961
|
return join3(homedir2(), ".cache", "opencode");
|
|
7961
7962
|
}
|
|
7963
|
+
function pathFromEntry(entry) {
|
|
7964
|
+
if (entry.startsWith("file://")) {
|
|
7965
|
+
try {
|
|
7966
|
+
return fileURLToPath(entry);
|
|
7967
|
+
} catch {
|
|
7968
|
+
return null;
|
|
7969
|
+
}
|
|
7970
|
+
}
|
|
7971
|
+
if (entry.startsWith("/") || /^[A-Za-z]:[/\\]/.test(entry))
|
|
7972
|
+
return entry;
|
|
7973
|
+
return null;
|
|
7974
|
+
}
|
|
7975
|
+
function pathPointsToOurPlugin(entry) {
|
|
7976
|
+
const fsPath = pathFromEntry(entry);
|
|
7977
|
+
if (!fsPath)
|
|
7978
|
+
return false;
|
|
7979
|
+
try {
|
|
7980
|
+
if (!existsSync3(fsPath))
|
|
7981
|
+
return false;
|
|
7982
|
+
let searchDir = statSync2(fsPath).isDirectory() ? fsPath : dirname2(fsPath);
|
|
7983
|
+
let pkgJsonPath = null;
|
|
7984
|
+
while (true) {
|
|
7985
|
+
const candidate = join3(searchDir, "package.json");
|
|
7986
|
+
if (existsSync3(candidate)) {
|
|
7987
|
+
pkgJsonPath = candidate;
|
|
7988
|
+
break;
|
|
7989
|
+
}
|
|
7990
|
+
const parent = dirname2(searchDir);
|
|
7991
|
+
if (parent === searchDir || searchDir === parse(searchDir).root)
|
|
7992
|
+
break;
|
|
7993
|
+
searchDir = parent;
|
|
7994
|
+
}
|
|
7995
|
+
if (!pkgJsonPath)
|
|
7996
|
+
return false;
|
|
7997
|
+
const parsed = JSON.parse(readFileSync2(pkgJsonPath, "utf-8"));
|
|
7998
|
+
return parsed.name === PLUGIN_NAME;
|
|
7999
|
+
} catch {
|
|
8000
|
+
return false;
|
|
8001
|
+
}
|
|
8002
|
+
}
|
|
7962
8003
|
function matchesPluginEntry(entry) {
|
|
7963
8004
|
if (entry === PLUGIN_NAME)
|
|
7964
8005
|
return true;
|
|
7965
8006
|
if (entry.startsWith(`${PLUGIN_NAME}@`))
|
|
7966
8007
|
return true;
|
|
7967
|
-
|
|
7968
|
-
return true;
|
|
7969
|
-
if (entry.includes("/aft-opencode"))
|
|
7970
|
-
return true;
|
|
7971
|
-
return false;
|
|
8008
|
+
return pathPointsToOurPlugin(entry);
|
|
7972
8009
|
}
|
|
7973
8010
|
|
|
7974
8011
|
class OpenCodeAdapter {
|
|
@@ -9934,7 +9971,7 @@ __export(exports_lsp, {
|
|
|
9934
9971
|
renderLspInspection: () => renderLspInspection,
|
|
9935
9972
|
printLspDoctorHelp: () => printLspDoctorHelp
|
|
9936
9973
|
});
|
|
9937
|
-
import { existsSync as existsSync6, readdirSync as readdirSync2, statSync as
|
|
9974
|
+
import { existsSync as existsSync6, readdirSync as readdirSync2, statSync as statSync3 } from "node:fs";
|
|
9938
9975
|
import { join as join6, resolve as resolve2 } from "node:path";
|
|
9939
9976
|
function printLspDoctorHelp() {
|
|
9940
9977
|
console.log("Usage: aft doctor lsp <file> [--harness opencode|pi]");
|
|
@@ -10145,7 +10182,7 @@ function childDirs(path) {
|
|
|
10145
10182
|
try {
|
|
10146
10183
|
return readdirSync2(path).map((entry) => join6(path, entry)).filter((entry) => {
|
|
10147
10184
|
try {
|
|
10148
|
-
return
|
|
10185
|
+
return statSync3(entry).isDirectory();
|
|
10149
10186
|
} catch {
|
|
10150
10187
|
return false;
|
|
10151
10188
|
}
|
|
@@ -10199,7 +10236,7 @@ var init_lsp = __esm(() => {
|
|
|
10199
10236
|
});
|
|
10200
10237
|
|
|
10201
10238
|
// src/lib/binary-cache.ts
|
|
10202
|
-
import { existsSync as existsSync7, readdirSync as readdirSync3, statSync as
|
|
10239
|
+
import { existsSync as existsSync7, readdirSync as readdirSync3, statSync as statSync4 } from "node:fs";
|
|
10203
10240
|
import { join as join7 } from "node:path";
|
|
10204
10241
|
function getBinaryCacheInfo(activeVersion) {
|
|
10205
10242
|
const path = getAftBinaryCacheDir();
|
|
@@ -10213,7 +10250,7 @@ function getBinaryCacheInfo(activeVersion) {
|
|
|
10213
10250
|
}
|
|
10214
10251
|
const versions = readdirSync3(path).filter((entry) => {
|
|
10215
10252
|
try {
|
|
10216
|
-
return
|
|
10253
|
+
return statSync4(join7(path, entry)).isDirectory();
|
|
10217
10254
|
} catch {
|
|
10218
10255
|
return false;
|
|
10219
10256
|
}
|
|
@@ -10233,7 +10270,7 @@ var init_binary_cache = __esm(() => {
|
|
|
10233
10270
|
});
|
|
10234
10271
|
|
|
10235
10272
|
// src/lib/lsp-cache.ts
|
|
10236
|
-
import { existsSync as existsSync8, readdirSync as readdirSync4, rmSync as rmSync2, statSync as
|
|
10273
|
+
import { existsSync as existsSync8, readdirSync as readdirSync4, rmSync as rmSync2, statSync as statSync5 } from "node:fs";
|
|
10237
10274
|
import { join as join8 } from "node:path";
|
|
10238
10275
|
function inspectDir(path) {
|
|
10239
10276
|
if (!existsSync8(path)) {
|
|
@@ -10250,7 +10287,7 @@ function inspectDir(path) {
|
|
|
10250
10287
|
for (const name of names) {
|
|
10251
10288
|
const full = join8(path, name);
|
|
10252
10289
|
try {
|
|
10253
|
-
if (!
|
|
10290
|
+
if (!statSync5(full).isDirectory())
|
|
10254
10291
|
continue;
|
|
10255
10292
|
const size = dirSize(full);
|
|
10256
10293
|
entries.push({
|
|
@@ -10306,7 +10343,7 @@ var init_lsp_cache = __esm(() => {
|
|
|
10306
10343
|
});
|
|
10307
10344
|
|
|
10308
10345
|
// src/lib/onnx.ts
|
|
10309
|
-
import { existsSync as existsSync9, readdirSync as readdirSync5, readlinkSync, realpathSync, statSync as
|
|
10346
|
+
import { existsSync as existsSync9, readdirSync as readdirSync5, readlinkSync, realpathSync, statSync as statSync6 } from "node:fs";
|
|
10310
10347
|
import { join as join9 } from "node:path";
|
|
10311
10348
|
function getOnnxLibraryName() {
|
|
10312
10349
|
if (process.platform === "darwin")
|
|
@@ -10428,7 +10465,7 @@ function sanitizeValue(value) {
|
|
|
10428
10465
|
var init_sanitize = () => {};
|
|
10429
10466
|
|
|
10430
10467
|
// src/lib/diagnostics.ts
|
|
10431
|
-
import { existsSync as existsSync10, readFileSync as readFileSync4, statSync as
|
|
10468
|
+
import { existsSync as existsSync10, readFileSync as readFileSync4, statSync as statSync7 } from "node:fs";
|
|
10432
10469
|
async function collectDiagnostics(adapters) {
|
|
10433
10470
|
const cliVersion = getSelfVersion();
|
|
10434
10471
|
const binaryVersion = probeBinaryVersion(cliVersion);
|
|
@@ -10493,7 +10530,7 @@ async function diagnoseHarness(adapter) {
|
|
|
10493
10530
|
logFile: {
|
|
10494
10531
|
path: logPath,
|
|
10495
10532
|
exists: existsSync10(logPath),
|
|
10496
|
-
sizeKb: existsSync10(logPath) ? Math.round(
|
|
10533
|
+
sizeKb: existsSync10(logPath) ? Math.round(statSync7(logPath).size / 1024) : 0
|
|
10497
10534
|
}
|
|
10498
10535
|
};
|
|
10499
10536
|
}
|
package/package.json
CHANGED