@cortexkit/aft-opencode 0.35.0 → 0.35.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/config.d.ts.map +1 -1
- package/dist/index.js +65 -15
- package/dist/tui.js +1 -1
- package/package.json +8 -8
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAgCxB,oGAAoG;AACpG,eAAO,MAAM,6BAA6B;;;;EAAmC,CAAC;AAC9E,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AA4CtF,eAAO,MAAM,eAAe;;;;;;;;;iBAE1B,CAAC;AAsHH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAiGjB,CAAC;AAEZ,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAExD,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAE9D,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,2EAA2E;IAC3E,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,uEAAuE;IACvE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,QAAQ,EAAE,OAAO,CAAC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AAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,GAAG,kBAAkB,CA0FvE;AAED,wBAAgB,qCAAqC,CACnD,MAAM,EAAE,SAAS,GAChB,8BAA8B,CAsBhC;AAED,KAAK,MAAM,GAAG;IACZ,GAAG,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACjC,CAAC;AAoMF,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,MAAM,EAClB,MAAM,GAAE,MAAsB,GAC7B;IAAE,QAAQ,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,CAwD1C;AA0ZD;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAiDjE"}
|
package/dist/index.js
CHANGED
|
@@ -12740,6 +12740,20 @@ async function fetchLatestTag() {
|
|
|
12740
12740
|
clearTimeout(timeout);
|
|
12741
12741
|
}
|
|
12742
12742
|
}
|
|
12743
|
+
// ../aft-bridge/dist/jsonc.js
|
|
12744
|
+
function stripJsoncSymbols(value) {
|
|
12745
|
+
if (Array.isArray(value)) {
|
|
12746
|
+
return value.map((item) => stripJsoncSymbols(item));
|
|
12747
|
+
}
|
|
12748
|
+
if (value !== null && typeof value === "object") {
|
|
12749
|
+
const out = {};
|
|
12750
|
+
for (const [key, val] of Object.entries(value)) {
|
|
12751
|
+
out[key] = stripJsoncSymbols(val);
|
|
12752
|
+
}
|
|
12753
|
+
return out;
|
|
12754
|
+
}
|
|
12755
|
+
return value;
|
|
12756
|
+
}
|
|
12743
12757
|
// ../aft-bridge/dist/migration.js
|
|
12744
12758
|
import { spawnSync as spawnSync2 } from "node:child_process";
|
|
12745
12759
|
import { existsSync as existsSync4, mkdirSync as mkdirSync4 } from "node:fs";
|
|
@@ -12798,7 +12812,7 @@ function markAnnouncementSeen(storageRoot, harness, currentVersion) {
|
|
|
12798
12812
|
|
|
12799
12813
|
// ../aft-bridge/dist/resolver.js
|
|
12800
12814
|
import { execSync } from "node:child_process";
|
|
12801
|
-
import { chmodSync as chmodSync2, copyFileSync as copyFileSync2, existsSync as existsSync3, mkdirSync as mkdirSync3, renameSync as renameSync3, unlinkSync as unlinkSync2 } from "node:fs";
|
|
12815
|
+
import { chmodSync as chmodSync2, closeSync as closeSync2, copyFileSync as copyFileSync2, existsSync as existsSync3, mkdirSync as mkdirSync3, openSync as openSync2, readSync, renameSync as renameSync3, unlinkSync as unlinkSync2 } from "node:fs";
|
|
12802
12816
|
import { createRequire as createRequire2 } from "node:module";
|
|
12803
12817
|
import { homedir as homedir3 } from "node:os";
|
|
12804
12818
|
import { join as join4 } from "node:path";
|
|
@@ -12879,6 +12893,37 @@ function probeBinaryCandidate(binaryPath, source, expectedVersion) {
|
|
|
12879
12893
|
function parsePathLookupOutput(output) {
|
|
12880
12894
|
return output.split(/\r?\n/).map((candidate) => candidate.trim()).filter(Boolean);
|
|
12881
12895
|
}
|
|
12896
|
+
function isNativeExecutable(binaryPath) {
|
|
12897
|
+
let fd = null;
|
|
12898
|
+
try {
|
|
12899
|
+
fd = openSync2(binaryPath, "r");
|
|
12900
|
+
const buf = Buffer.alloc(4);
|
|
12901
|
+
const read = readSync(fd, buf, 0, 4, 0);
|
|
12902
|
+
if (read < 2)
|
|
12903
|
+
return false;
|
|
12904
|
+
const b0 = buf[0];
|
|
12905
|
+
const b1 = buf[1];
|
|
12906
|
+
if (b0 === 35 && b1 === 33)
|
|
12907
|
+
return false;
|
|
12908
|
+
const m32 = buf.readUInt32BE(0);
|
|
12909
|
+
const machO = new Set([4277009102, 4277009103, 3472551422, 3489328638, 3405691582]);
|
|
12910
|
+
if (read >= 4 && machO.has(m32))
|
|
12911
|
+
return true;
|
|
12912
|
+
if (read >= 4 && m32 === 2135247942)
|
|
12913
|
+
return true;
|
|
12914
|
+
if (b0 === 77 && b1 === 90)
|
|
12915
|
+
return true;
|
|
12916
|
+
return false;
|
|
12917
|
+
} catch {
|
|
12918
|
+
return false;
|
|
12919
|
+
} finally {
|
|
12920
|
+
if (fd !== null) {
|
|
12921
|
+
try {
|
|
12922
|
+
closeSync2(fd);
|
|
12923
|
+
} catch {}
|
|
12924
|
+
}
|
|
12925
|
+
}
|
|
12926
|
+
}
|
|
12882
12927
|
function platformKey(platform = process.platform, arch = process.arch) {
|
|
12883
12928
|
const archMap = PLATFORM_ARCH_MAP[platform];
|
|
12884
12929
|
if (!archMap) {
|
|
@@ -12932,6 +12977,10 @@ function findBinarySync(expectedVersion) {
|
|
|
12932
12977
|
stdio: ["pipe", "pipe", "pipe"]
|
|
12933
12978
|
}).trim();
|
|
12934
12979
|
for (const candidate of parsePathLookupOutput(result)) {
|
|
12980
|
+
if (!isNativeExecutable(candidate)) {
|
|
12981
|
+
warn(`PATH binary at ${candidate} is not a native executable (script shim?); skipping`);
|
|
12982
|
+
continue;
|
|
12983
|
+
}
|
|
12935
12984
|
const usable = probeBinaryCandidate(candidate, "PATH", expectedVersion);
|
|
12936
12985
|
if (usable)
|
|
12937
12986
|
return usable;
|
|
@@ -13081,7 +13130,7 @@ async function ensureStorageMigrated(opts) {
|
|
|
13081
13130
|
// ../aft-bridge/dist/onnx-runtime.js
|
|
13082
13131
|
import { execFileSync } from "node:child_process";
|
|
13083
13132
|
import { createHash as createHash2 } from "node:crypto";
|
|
13084
|
-
import { chmodSync as chmodSync3, closeSync as
|
|
13133
|
+
import { chmodSync as chmodSync3, closeSync as closeSync3, copyFileSync as copyFileSync3, createWriteStream as createWriteStream2, existsSync as existsSync5, lstatSync, mkdirSync as mkdirSync5, openSync as openSync3, readdirSync, readFileSync as readFileSync3, readlinkSync, realpathSync, rmSync as rmSync2, statSync as statSync2, symlinkSync, unlinkSync as unlinkSync3, writeFileSync as writeFileSync2 } from "node:fs";
|
|
13085
13134
|
import { basename, dirname as dirname3, isAbsolute, join as join6, relative, resolve, win32 } from "node:path";
|
|
13086
13135
|
import { Readable as Readable2 } from "node:stream";
|
|
13087
13136
|
import { pipeline as pipeline2 } from "node:stream/promises";
|
|
@@ -13656,13 +13705,13 @@ function sha256File(path) {
|
|
|
13656
13705
|
function acquireLock(lockPath) {
|
|
13657
13706
|
const tryClaim = () => {
|
|
13658
13707
|
try {
|
|
13659
|
-
const fd =
|
|
13708
|
+
const fd = openSync3(lockPath, "wx");
|
|
13660
13709
|
try {
|
|
13661
13710
|
writeFileSync2(fd, `${process.pid}
|
|
13662
13711
|
${new Date().toISOString()}
|
|
13663
13712
|
`);
|
|
13664
13713
|
} finally {
|
|
13665
|
-
|
|
13714
|
+
closeSync3(fd);
|
|
13666
13715
|
}
|
|
13667
13716
|
return true;
|
|
13668
13717
|
} catch (err) {
|
|
@@ -14982,10 +15031,10 @@ function formatDuration(completion) {
|
|
|
14982
15031
|
}
|
|
14983
15032
|
|
|
14984
15033
|
// src/config.ts
|
|
14985
|
-
var import_comment_json = __toESM(require_src2(), 1);
|
|
14986
15034
|
import { existsSync as existsSync6, readFileSync as readFileSync4, renameSync as renameSync4, unlinkSync as unlinkSync4, writeFileSync as writeFileSync3 } from "node:fs";
|
|
14987
15035
|
import { homedir as homedir5 } from "node:os";
|
|
14988
15036
|
import { join as join8 } from "node:path";
|
|
15037
|
+
var import_comment_json = __toESM(require_src2(), 1);
|
|
14989
15038
|
|
|
14990
15039
|
// ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/classic/external.js
|
|
14991
15040
|
var exports_external = {};
|
|
@@ -28989,14 +29038,15 @@ function loadConfigFromPath(configPath) {
|
|
|
28989
29038
|
const content = readFileSync4(configPath, "utf-8");
|
|
28990
29039
|
const rawConfig = import_comment_json.parse(content);
|
|
28991
29040
|
migrateRawConfig(rawConfig, configPath, { log: log2, warn: warn2 });
|
|
28992
|
-
const
|
|
29041
|
+
const cleanConfig = stripJsoncSymbols(rawConfig);
|
|
29042
|
+
const result = AftConfigSchema.safeParse(cleanConfig);
|
|
28993
29043
|
if (result.success) {
|
|
28994
29044
|
log2(`Config loaded from ${configPath}`);
|
|
28995
29045
|
return result.data;
|
|
28996
29046
|
}
|
|
28997
29047
|
const errorMsg = result.error.issues.map((i) => `${i.path.join(".")}: ${i.message}`).join(", ");
|
|
28998
29048
|
warn2(`Config validation error in ${configPath}: ${errorMsg}`);
|
|
28999
|
-
return parseConfigPartially(
|
|
29049
|
+
return parseConfigPartially(cleanConfig);
|
|
29000
29050
|
} catch (err) {
|
|
29001
29051
|
const errorMsg = err instanceof Error ? err.message : String(err);
|
|
29002
29052
|
error2(`Error loading config from ${configPath}: ${errorMsg}`);
|
|
@@ -29701,10 +29751,10 @@ async function flushConfigureWarningsOnIdle(sessionId) {
|
|
|
29701
29751
|
|
|
29702
29752
|
// src/hooks/auto-update-checker/index.ts
|
|
29703
29753
|
import {
|
|
29704
|
-
closeSync as
|
|
29754
|
+
closeSync as closeSync4,
|
|
29705
29755
|
existsSync as existsSync10,
|
|
29706
29756
|
mkdirSync as mkdirSync6,
|
|
29707
|
-
openSync as
|
|
29757
|
+
openSync as openSync4,
|
|
29708
29758
|
readFileSync as readFileSync8,
|
|
29709
29759
|
renameSync as renameSync5,
|
|
29710
29760
|
rmSync as rmSync4,
|
|
@@ -30255,7 +30305,7 @@ function claimCheckSlot(storageDir, intervalMs) {
|
|
|
30255
30305
|
const lockPath = `${file2}.lock`;
|
|
30256
30306
|
let lockFd;
|
|
30257
30307
|
try {
|
|
30258
|
-
lockFd =
|
|
30308
|
+
lockFd = openSync4(lockPath, "wx");
|
|
30259
30309
|
writeFileSync6(lockFd, JSON.stringify({ pid: process.pid, startedMs: Date.now() }));
|
|
30260
30310
|
} catch (err) {
|
|
30261
30311
|
if (err.code !== "EEXIST") {
|
|
@@ -30266,7 +30316,7 @@ function claimCheckSlot(storageDir, intervalMs) {
|
|
|
30266
30316
|
const lock = {
|
|
30267
30317
|
release: () => {
|
|
30268
30318
|
try {
|
|
30269
|
-
|
|
30319
|
+
closeSync4(lockFd);
|
|
30270
30320
|
} catch {}
|
|
30271
30321
|
rmSync4(lockPath, { force: true });
|
|
30272
30322
|
}
|
|
@@ -30396,9 +30446,9 @@ import { join as join15 } from "node:path";
|
|
|
30396
30446
|
|
|
30397
30447
|
// src/lsp-cache.ts
|
|
30398
30448
|
import {
|
|
30399
|
-
closeSync as
|
|
30449
|
+
closeSync as closeSync5,
|
|
30400
30450
|
mkdirSync as mkdirSync7,
|
|
30401
|
-
openSync as
|
|
30451
|
+
openSync as openSync5,
|
|
30402
30452
|
readFileSync as readFileSync9,
|
|
30403
30453
|
statSync as statSync4,
|
|
30404
30454
|
unlinkSync as unlinkSync5,
|
|
@@ -30491,13 +30541,13 @@ function acquireInstallLock(lockKey) {
|
|
|
30491
30541
|
const lock = lockPath(lockKey);
|
|
30492
30542
|
const tryClaim = () => {
|
|
30493
30543
|
try {
|
|
30494
|
-
const fd =
|
|
30544
|
+
const fd = openSync5(lock, "wx");
|
|
30495
30545
|
try {
|
|
30496
30546
|
writeFileSync7(fd, `${process.pid}
|
|
30497
30547
|
${new Date().toISOString()}
|
|
30498
30548
|
`);
|
|
30499
30549
|
} finally {
|
|
30500
|
-
|
|
30550
|
+
closeSync5(fd);
|
|
30501
30551
|
}
|
|
30502
30552
|
return true;
|
|
30503
30553
|
} catch (err) {
|
package/dist/tui.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// src/tui/index.tsx
|
|
2
2
|
import { createMemo as createMemo2, createSignal as createSignal2, onCleanup as onCleanup2 } from "solid-js";
|
|
3
3
|
// package.json
|
|
4
|
-
var version = "0.35.
|
|
4
|
+
var version = "0.35.1";
|
|
5
5
|
|
|
6
6
|
// src/shared/rpc-client.ts
|
|
7
7
|
import { existsSync, readdirSync, readFileSync, unlinkSync } from "node:fs";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cortexkit/aft-opencode",
|
|
3
|
-
"version": "0.35.
|
|
3
|
+
"version": "0.35.1",
|
|
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",
|
|
@@ -30,19 +30,19 @@
|
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@clack/prompts": "^1.2.0",
|
|
33
|
-
"@cortexkit/aft-bridge": "0.35.
|
|
33
|
+
"@cortexkit/aft-bridge": "0.35.1",
|
|
34
34
|
"@xterm/headless": "^5.5.0",
|
|
35
35
|
"comment-json": "^4.6.2",
|
|
36
36
|
"undici": "^7.25.0",
|
|
37
37
|
"zod": "^4.1.8"
|
|
38
38
|
},
|
|
39
39
|
"optionalDependencies": {
|
|
40
|
-
"@cortexkit/aft-darwin-arm64": "0.35.
|
|
41
|
-
"@cortexkit/aft-darwin-x64": "0.35.
|
|
42
|
-
"@cortexkit/aft-linux-arm64": "0.35.
|
|
43
|
-
"@cortexkit/aft-linux-x64": "0.35.
|
|
44
|
-
"@cortexkit/aft-win32-arm64": "0.35.
|
|
45
|
-
"@cortexkit/aft-win32-x64": "0.35.
|
|
40
|
+
"@cortexkit/aft-darwin-arm64": "0.35.1",
|
|
41
|
+
"@cortexkit/aft-darwin-x64": "0.35.1",
|
|
42
|
+
"@cortexkit/aft-linux-arm64": "0.35.1",
|
|
43
|
+
"@cortexkit/aft-linux-x64": "0.35.1",
|
|
44
|
+
"@cortexkit/aft-win32-arm64": "0.35.1",
|
|
45
|
+
"@cortexkit/aft-win32-x64": "0.35.1"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@opencode-ai/plugin": "^1.15.11",
|