@cortexkit/aft-opencode 0.19.1 → 0.19.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.d.ts.map +1 -1
- package/dist/index.js +102 -44
- package/dist/tui.js +7 -7
- package/package.json +7 -7
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AA+JlD;;;;;;;;;;;;;;;;;;GAkBG;AACH,QAAA,MAAM,MAAM,EAAE,MAytBb,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -7805,7 +7805,7 @@ var require_src2 = __commonJS((exports, module) => {
|
|
|
7805
7805
|
// src/index.ts
|
|
7806
7806
|
import { existsSync as existsSync13, mkdirSync as mkdirSync10, readFileSync as readFileSync9, writeFileSync as writeFileSync10 } from "fs";
|
|
7807
7807
|
import { createRequire as createRequire2 } from "module";
|
|
7808
|
-
import { homedir as
|
|
7808
|
+
import { homedir as homedir11 } from "os";
|
|
7809
7809
|
import { join as join18 } from "path";
|
|
7810
7810
|
|
|
7811
7811
|
// ../aft-bridge/dist/active-logger.js
|
|
@@ -7837,9 +7837,15 @@ function error(message, meta) {
|
|
|
7837
7837
|
console.error(`[aft-bridge] ERROR: ${message}`);
|
|
7838
7838
|
}
|
|
7839
7839
|
}
|
|
7840
|
+
function sessionLog(sessionId, message) {
|
|
7841
|
+
log(message, sessionId ? { sessionId } : undefined);
|
|
7842
|
+
}
|
|
7840
7843
|
function sessionWarn(sessionId, message) {
|
|
7841
7844
|
warn(message, sessionId ? { sessionId } : undefined);
|
|
7842
7845
|
}
|
|
7846
|
+
function sessionError(sessionId, message) {
|
|
7847
|
+
error(message, sessionId ? { sessionId } : undefined);
|
|
7848
|
+
}
|
|
7843
7849
|
// ../aft-bridge/dist/bridge.js
|
|
7844
7850
|
import { spawn } from "child_process";
|
|
7845
7851
|
import { homedir } from "os";
|
|
@@ -7967,8 +7973,8 @@ class BinaryBridge {
|
|
|
7967
7973
|
if (Object.hasOwn(params, "id")) {
|
|
7968
7974
|
throw new Error("params cannot contain reserved key 'id'");
|
|
7969
7975
|
}
|
|
7970
|
-
this.ensureSpawned();
|
|
7971
7976
|
const requestSessionId = typeof params.session_id === "string" && params.session_id.length > 0 ? params.session_id : undefined;
|
|
7977
|
+
this.ensureSpawned(requestSessionId);
|
|
7972
7978
|
if (requestSessionId && options?.configureWarningClient !== undefined) {
|
|
7973
7979
|
this.configureWarningClients.set(requestSessionId, options.configureWarningClient);
|
|
7974
7980
|
}
|
|
@@ -8031,7 +8037,7 @@ class BinaryBridge {
|
|
|
8031
8037
|
}
|
|
8032
8038
|
reject(new Error(`${this.errorPrefix} Request "${command}" (id=${id}) timed out after ${effectiveTimeoutMs}ms`));
|
|
8033
8039
|
if (!keepBridgeOnTimeout) {
|
|
8034
|
-
this.handleTimeout();
|
|
8040
|
+
this.handleTimeout(requestSessionId);
|
|
8035
8041
|
}
|
|
8036
8042
|
}, effectiveTimeoutMs);
|
|
8037
8043
|
this.pending.set(id, { resolve, reject, timer, onProgress: options?.onProgress });
|
|
@@ -8126,13 +8132,17 @@ class BinaryBridge {
|
|
|
8126
8132
|
warn(`Version check failed: ${err.message}`);
|
|
8127
8133
|
}
|
|
8128
8134
|
}
|
|
8129
|
-
ensureSpawned() {
|
|
8135
|
+
ensureSpawned(triggeringSessionId) {
|
|
8130
8136
|
if (this.isAlive())
|
|
8131
8137
|
return;
|
|
8132
|
-
this.spawnProcess();
|
|
8138
|
+
this.spawnProcess(triggeringSessionId);
|
|
8133
8139
|
}
|
|
8134
|
-
spawnProcess() {
|
|
8135
|
-
|
|
8140
|
+
spawnProcess(triggeringSessionId) {
|
|
8141
|
+
if (triggeringSessionId) {
|
|
8142
|
+
sessionLog(triggeringSessionId, `Spawning binary: ${this.binaryPath} (cwd: ${this.cwd})`);
|
|
8143
|
+
} else {
|
|
8144
|
+
log(`Spawning binary: ${this.binaryPath} (cwd: ${this.cwd})`);
|
|
8145
|
+
}
|
|
8136
8146
|
const semantic = this.configOverrides.semantic;
|
|
8137
8147
|
const semanticBackend = (() => {
|
|
8138
8148
|
if (semantic && typeof semantic === "object" && !Array.isArray(semantic)) {
|
|
@@ -8280,7 +8290,7 @@ class BinaryBridge {
|
|
|
8280
8290
|
}
|
|
8281
8291
|
}
|
|
8282
8292
|
}
|
|
8283
|
-
handleTimeout() {
|
|
8293
|
+
handleTimeout(triggeringSessionId) {
|
|
8284
8294
|
if (this.process) {
|
|
8285
8295
|
this.process.kill("SIGKILL");
|
|
8286
8296
|
this.process = null;
|
|
@@ -8289,10 +8299,17 @@ class BinaryBridge {
|
|
|
8289
8299
|
this.configured = false;
|
|
8290
8300
|
const tail = this.formatStderrTail();
|
|
8291
8301
|
this.stderrTail = [];
|
|
8302
|
+
const killedMsg = tail ? `Bridge killed after timeout.${tail}` : `Bridge killed after timeout (see ${getLogFilePath()})`;
|
|
8292
8303
|
if (tail) {
|
|
8293
|
-
|
|
8304
|
+
if (triggeringSessionId) {
|
|
8305
|
+
sessionError(triggeringSessionId, killedMsg);
|
|
8306
|
+
} else {
|
|
8307
|
+
error(killedMsg);
|
|
8308
|
+
}
|
|
8309
|
+
} else if (triggeringSessionId) {
|
|
8310
|
+
sessionWarn(triggeringSessionId, killedMsg);
|
|
8294
8311
|
} else {
|
|
8295
|
-
warn(
|
|
8312
|
+
warn(killedMsg);
|
|
8296
8313
|
}
|
|
8297
8314
|
}
|
|
8298
8315
|
handleCrash(cause) {
|
|
@@ -8357,7 +8374,7 @@ import { join as join2 } from "path";
|
|
|
8357
8374
|
var PLATFORM_ARCH_MAP = {
|
|
8358
8375
|
darwin: { arm64: "darwin-arm64", x64: "darwin-x64" },
|
|
8359
8376
|
linux: { arm64: "linux-arm64", x64: "linux-x64" },
|
|
8360
|
-
win32: { x64: "win32-x64" }
|
|
8377
|
+
win32: { arm64: "win32-x64", x64: "win32-x64" }
|
|
8361
8378
|
};
|
|
8362
8379
|
var PLATFORM_ASSET_MAP = {
|
|
8363
8380
|
"darwin-arm64": "aft-darwin-arm64",
|
|
@@ -8388,10 +8405,11 @@ function getCachedBinaryPath(version) {
|
|
|
8388
8405
|
return existsSync(binaryPath) ? binaryPath : null;
|
|
8389
8406
|
}
|
|
8390
8407
|
async function downloadBinary(version) {
|
|
8391
|
-
const
|
|
8392
|
-
const
|
|
8393
|
-
|
|
8394
|
-
|
|
8408
|
+
const archMap = PLATFORM_ARCH_MAP[process.platform] ?? {};
|
|
8409
|
+
const platformKey = archMap[process.arch];
|
|
8410
|
+
const assetName = platformKey ? PLATFORM_ASSET_MAP[platformKey] : undefined;
|
|
8411
|
+
if (!platformKey || !assetName) {
|
|
8412
|
+
error(`Unsupported platform: ${process.platform}-${process.arch}`);
|
|
8395
8413
|
return null;
|
|
8396
8414
|
}
|
|
8397
8415
|
const tag = version ?? await fetchLatestTag();
|
|
@@ -8548,7 +8566,10 @@ function getPlatformInfo() {
|
|
|
8548
8566
|
const platformMap = ORT_PLATFORM_MAP[process.platform];
|
|
8549
8567
|
if (!platformMap)
|
|
8550
8568
|
return null;
|
|
8551
|
-
|
|
8569
|
+
const archMap = PLATFORM_ARCH_MAP[process.platform] ?? {};
|
|
8570
|
+
const platformKey = archMap[process.arch];
|
|
8571
|
+
const ortArch = platformKey ? platformKey.split("-")[1] : process.arch;
|
|
8572
|
+
return platformMap[ortArch] || null;
|
|
8552
8573
|
}
|
|
8553
8574
|
function isOrtAutoDownloadSupported() {
|
|
8554
8575
|
return getPlatformInfo() !== null;
|
|
@@ -8973,10 +8994,40 @@ function isProcessAlive(pid) {
|
|
|
8973
8994
|
}
|
|
8974
8995
|
// ../aft-bridge/dist/pool.js
|
|
8975
8996
|
import { realpathSync as realpathSync2 } from "fs";
|
|
8997
|
+
import { homedir as homedir3 } from "os";
|
|
8976
8998
|
var DEFAULT_IDLE_TIMEOUT_MS = Infinity;
|
|
8977
8999
|
var DEFAULT_MAX_POOL_SIZE = 8;
|
|
8978
9000
|
var CLEANUP_INTERVAL_MS = 60 * 1000;
|
|
8979
9001
|
|
|
9002
|
+
class HomeProjectRootError extends Error {
|
|
9003
|
+
projectRoot;
|
|
9004
|
+
constructor(projectRoot) {
|
|
9005
|
+
super(`aft refuses to spawn a bridge with project_root=${projectRoot} (user home directory). ` + `Open OpenCode/Pi from a project subdirectory instead, or set the session's ` + `directory to a real project root.`);
|
|
9006
|
+
this.projectRoot = projectRoot;
|
|
9007
|
+
this.name = "HomeProjectRootError";
|
|
9008
|
+
}
|
|
9009
|
+
}
|
|
9010
|
+
function canonicalHomeDir() {
|
|
9011
|
+
try {
|
|
9012
|
+
const home = homedir3();
|
|
9013
|
+
if (!home)
|
|
9014
|
+
return null;
|
|
9015
|
+
try {
|
|
9016
|
+
return realpathSync2(home);
|
|
9017
|
+
} catch {
|
|
9018
|
+
return home.replace(/[/\\]+$/, "");
|
|
9019
|
+
}
|
|
9020
|
+
} catch {
|
|
9021
|
+
return null;
|
|
9022
|
+
}
|
|
9023
|
+
}
|
|
9024
|
+
function isHomeDirectoryRoot(normalizedKey) {
|
|
9025
|
+
const home = canonicalHomeDir();
|
|
9026
|
+
if (!home)
|
|
9027
|
+
return false;
|
|
9028
|
+
return normalizedKey === home;
|
|
9029
|
+
}
|
|
9030
|
+
|
|
8980
9031
|
class BridgePool {
|
|
8981
9032
|
bridges = new Map;
|
|
8982
9033
|
binaryPath;
|
|
@@ -9013,6 +9064,9 @@ class BridgePool {
|
|
|
9013
9064
|
}
|
|
9014
9065
|
getBridge(projectRoot) {
|
|
9015
9066
|
const key = normalizeKey(projectRoot);
|
|
9067
|
+
if (isHomeDirectoryRoot(key)) {
|
|
9068
|
+
throw new HomeProjectRootError(key);
|
|
9069
|
+
}
|
|
9016
9070
|
const existing = this.bridges.get(key);
|
|
9017
9071
|
if (existing) {
|
|
9018
9072
|
existing.lastUsed = Date.now();
|
|
@@ -9091,7 +9145,7 @@ function normalizeKey(projectRoot) {
|
|
|
9091
9145
|
import { execSync, spawnSync } from "child_process";
|
|
9092
9146
|
import { chmodSync as chmodSync3, copyFileSync as copyFileSync2, existsSync as existsSync3, mkdirSync as mkdirSync3, renameSync } from "fs";
|
|
9093
9147
|
import { createRequire } from "module";
|
|
9094
|
-
import { homedir as
|
|
9148
|
+
import { homedir as homedir4 } from "os";
|
|
9095
9149
|
import { join as join4 } from "path";
|
|
9096
9150
|
function copyToVersionedCache(npmBinaryPath) {
|
|
9097
9151
|
try {
|
|
@@ -9171,7 +9225,7 @@ function findBinarySync(expectedVersion) {
|
|
|
9171
9225
|
if (result)
|
|
9172
9226
|
return result;
|
|
9173
9227
|
} catch {}
|
|
9174
|
-
const cargoPath = join4(
|
|
9228
|
+
const cargoPath = join4(homedir4(), ".cargo", "bin", `aft${ext}`);
|
|
9175
9229
|
if (existsSync3(cargoPath))
|
|
9176
9230
|
return cargoPath;
|
|
9177
9231
|
return null;
|
|
@@ -9641,24 +9695,24 @@ function warn2(message, data) {
|
|
|
9641
9695
|
function error2(message, data) {
|
|
9642
9696
|
write("ERROR", message, data);
|
|
9643
9697
|
}
|
|
9644
|
-
function
|
|
9698
|
+
function sessionLog2(sessionId, message, data) {
|
|
9645
9699
|
write("INFO", message, data, sessionId);
|
|
9646
9700
|
}
|
|
9647
9701
|
function sessionWarn2(sessionId, message, data) {
|
|
9648
9702
|
write("WARN", message, data, sessionId);
|
|
9649
9703
|
}
|
|
9650
|
-
function
|
|
9704
|
+
function sessionError2(sessionId, message, data) {
|
|
9651
9705
|
write("ERROR", message, data, sessionId);
|
|
9652
9706
|
}
|
|
9653
9707
|
var bridgeLogger = {
|
|
9654
9708
|
log(message, meta) {
|
|
9655
|
-
|
|
9709
|
+
sessionLog2(meta?.sessionId, message);
|
|
9656
9710
|
},
|
|
9657
9711
|
warn(message, meta) {
|
|
9658
9712
|
sessionWarn2(meta?.sessionId, message);
|
|
9659
9713
|
},
|
|
9660
9714
|
error(message, meta) {
|
|
9661
|
-
|
|
9715
|
+
sessionError2(meta?.sessionId, message);
|
|
9662
9716
|
},
|
|
9663
9717
|
getLogFilePath: () => logFile
|
|
9664
9718
|
};
|
|
@@ -10047,7 +10101,7 @@ function formatDuration(completion) {
|
|
|
10047
10101
|
// src/config.ts
|
|
10048
10102
|
var import_comment_json = __toESM(require_src2(), 1);
|
|
10049
10103
|
import { existsSync as existsSync5, readFileSync as readFileSync3, renameSync as renameSync2, unlinkSync as unlinkSync4, writeFileSync as writeFileSync3 } from "fs";
|
|
10050
|
-
import { homedir as
|
|
10104
|
+
import { homedir as homedir5 } from "os";
|
|
10051
10105
|
import { join as join7 } from "path";
|
|
10052
10106
|
|
|
10053
10107
|
// ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/classic/external.js
|
|
@@ -24017,7 +24071,7 @@ function getOpenCodeConfigDir() {
|
|
|
24017
24071
|
if (envDir) {
|
|
24018
24072
|
return envDir;
|
|
24019
24073
|
}
|
|
24020
|
-
const xdgConfig = process.env.XDG_CONFIG_HOME || join7(
|
|
24074
|
+
const xdgConfig = process.env.XDG_CONFIG_HOME || join7(homedir5(), ".config");
|
|
24021
24075
|
return join7(xdgConfig, "opencode");
|
|
24022
24076
|
}
|
|
24023
24077
|
function loadAftConfig(projectDirectory) {
|
|
@@ -24060,27 +24114,27 @@ import { basename, dirname as dirname3, join as join10 } from "path";
|
|
|
24060
24114
|
// src/hooks/auto-update-checker/checker.ts
|
|
24061
24115
|
var import_comment_json2 = __toESM(require_src2(), 1);
|
|
24062
24116
|
import { existsSync as existsSync6, readFileSync as readFileSync4, statSync as statSync2, writeFileSync as writeFileSync4 } from "fs";
|
|
24063
|
-
import { homedir as
|
|
24117
|
+
import { homedir as homedir7 } from "os";
|
|
24064
24118
|
import { dirname as dirname2, isAbsolute, join as join9, resolve as resolve2 } from "path";
|
|
24065
24119
|
import { fileURLToPath } from "url";
|
|
24066
24120
|
|
|
24067
24121
|
// src/hooks/auto-update-checker/constants.ts
|
|
24068
|
-
import { homedir as
|
|
24122
|
+
import { homedir as homedir6, platform } from "os";
|
|
24069
24123
|
import { join as join8 } from "path";
|
|
24070
24124
|
var PACKAGE_NAME = "@cortexkit/aft-opencode";
|
|
24071
24125
|
var NPM_REGISTRY_URL = "https://registry.npmjs.org";
|
|
24072
24126
|
var NPM_FETCH_TIMEOUT = 1e4;
|
|
24073
24127
|
function getOpenCodeCacheRoot() {
|
|
24074
24128
|
if (platform() === "win32") {
|
|
24075
|
-
return join8(process.env.LOCALAPPDATA ??
|
|
24129
|
+
return join8(process.env.LOCALAPPDATA ?? homedir6(), "opencode");
|
|
24076
24130
|
}
|
|
24077
|
-
return join8(
|
|
24131
|
+
return join8(homedir6(), ".cache", "opencode");
|
|
24078
24132
|
}
|
|
24079
24133
|
function getOpenCodeConfigRoot() {
|
|
24080
24134
|
if (platform() === "win32") {
|
|
24081
|
-
return join8(process.env.APPDATA ?? join8(
|
|
24135
|
+
return join8(process.env.APPDATA ?? join8(homedir6(), "AppData", "Roaming"), "opencode");
|
|
24082
24136
|
}
|
|
24083
|
-
return join8(process.env.XDG_CONFIG_HOME ?? join8(
|
|
24137
|
+
return join8(process.env.XDG_CONFIG_HOME ?? join8(homedir6(), ".config"), "opencode");
|
|
24084
24138
|
}
|
|
24085
24139
|
var CACHE_DIR = join8(getOpenCodeCacheRoot(), "packages");
|
|
24086
24140
|
var USER_OPENCODE_CONFIG = join8(getOpenCodeConfigRoot(), "opencode.json");
|
|
@@ -24259,7 +24313,7 @@ function getCachedVersion(spec) {
|
|
|
24259
24313
|
getCurrentRuntimePackageJsonPath(),
|
|
24260
24314
|
spec ? getSpecCachePackageJsonPath(spec) : null,
|
|
24261
24315
|
getSpecCachePackageJsonPath(`${PACKAGE_NAME}@latest`),
|
|
24262
|
-
join9(
|
|
24316
|
+
join9(homedir7(), ".cache", "opencode", "node_modules", PACKAGE_NAME, "package.json")
|
|
24263
24317
|
].filter(isString);
|
|
24264
24318
|
for (const packageJsonPath of candidates) {
|
|
24265
24319
|
try {
|
|
@@ -24580,7 +24634,7 @@ import {
|
|
|
24580
24634
|
unlinkSync as unlinkSync5,
|
|
24581
24635
|
writeFileSync as writeFileSync6
|
|
24582
24636
|
} from "fs";
|
|
24583
|
-
import { homedir as
|
|
24637
|
+
import { homedir as homedir8 } from "os";
|
|
24584
24638
|
import { join as join11 } from "path";
|
|
24585
24639
|
function aftCacheBase() {
|
|
24586
24640
|
const override = process.env.AFT_CACHE_DIR;
|
|
@@ -24588,10 +24642,10 @@ function aftCacheBase() {
|
|
|
24588
24642
|
return override;
|
|
24589
24643
|
if (process.platform === "win32") {
|
|
24590
24644
|
const localAppData = process.env.LOCALAPPDATA || process.env.APPDATA;
|
|
24591
|
-
const base2 = localAppData || join11(
|
|
24645
|
+
const base2 = localAppData || join11(homedir8(), "AppData", "Local");
|
|
24592
24646
|
return join11(base2, "aft");
|
|
24593
24647
|
}
|
|
24594
|
-
const base = process.env.XDG_CACHE_HOME || join11(
|
|
24648
|
+
const base = process.env.XDG_CACHE_HOME || join11(homedir8(), ".cache");
|
|
24595
24649
|
return join11(base, "aft");
|
|
24596
24650
|
}
|
|
24597
24651
|
function lspCacheRoot() {
|
|
@@ -26046,7 +26100,7 @@ function normalizeToolMap(tools) {
|
|
|
26046
26100
|
|
|
26047
26101
|
// src/notifications.ts
|
|
26048
26102
|
import { existsSync as existsSync10, mkdirSync as mkdirSync7, readFileSync as readFileSync7, writeFileSync as writeFileSync7 } from "fs";
|
|
26049
|
-
import { homedir as
|
|
26103
|
+
import { homedir as homedir9, platform as platform2 } from "os";
|
|
26050
26104
|
import { join as join14 } from "path";
|
|
26051
26105
|
function isTuiMode() {
|
|
26052
26106
|
return process.env.OPENCODE_CLIENT === "cli";
|
|
@@ -26069,7 +26123,7 @@ var STATUS_MARKER = `${AFT_MARKER} \u2705`;
|
|
|
26069
26123
|
var WARNED_TOOLS_FILE = "warned_tools.json";
|
|
26070
26124
|
function getDesktopStatePath() {
|
|
26071
26125
|
const os2 = platform2();
|
|
26072
|
-
const home =
|
|
26126
|
+
const home = homedir9();
|
|
26073
26127
|
if (os2 === "darwin") {
|
|
26074
26128
|
return join14(home, "Library", "Application Support", "ai.opencode.desktop", "opencode.global.dat");
|
|
26075
26129
|
}
|
|
@@ -26152,7 +26206,7 @@ async function sendIgnoredMessage(client, sessionId, text) {
|
|
|
26152
26206
|
return true;
|
|
26153
26207
|
}
|
|
26154
26208
|
} catch (err) {
|
|
26155
|
-
|
|
26209
|
+
sessionLog2(sessionId, `[aft-plugin] notification send failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
26156
26210
|
}
|
|
26157
26211
|
return false;
|
|
26158
26212
|
}
|
|
@@ -26178,7 +26232,7 @@ async function sendWarning(opts, message) {
|
|
|
26178
26232
|
if (!sessionId)
|
|
26179
26233
|
return;
|
|
26180
26234
|
const text = `${WARNING_MARKER} ${message}`;
|
|
26181
|
-
|
|
26235
|
+
sessionLog2(sessionId, `[aft-plugin] sending warning to session ${sessionId}`);
|
|
26182
26236
|
await sendIgnoredMessage(opts.client, sessionId, text);
|
|
26183
26237
|
}
|
|
26184
26238
|
async function sendFeatureAnnouncement(opts, version2, features, storageDir) {
|
|
@@ -26201,7 +26255,7 @@ async function sendFeatureAnnouncement(opts, version2, features, storageDir) {
|
|
|
26201
26255
|
return;
|
|
26202
26256
|
const text = [`${FEATURE_MARKER} v${version2}:`, ...features.map((f) => ` \u2022 ${f}`)].join(`
|
|
26203
26257
|
`);
|
|
26204
|
-
|
|
26258
|
+
sessionLog2(sessionId, `[aft-plugin] sending feature announcement for v${version2}`);
|
|
26205
26259
|
await sendIgnoredMessage(opts.client, sessionId, text);
|
|
26206
26260
|
}
|
|
26207
26261
|
if (storageDir) {
|
|
@@ -26319,7 +26373,7 @@ async function cleanupWarnings(opts) {
|
|
|
26319
26373
|
}
|
|
26320
26374
|
if (warningIds.length === 0)
|
|
26321
26375
|
return;
|
|
26322
|
-
|
|
26376
|
+
sessionLog2(sessionId, `[aft-plugin] cleaning up ${warningIds.length} stale warning(s)`);
|
|
26323
26377
|
for (const id of warningIds) {
|
|
26324
26378
|
await deleteMessage(effectiveServerUrl, sessionId, id);
|
|
26325
26379
|
}
|
|
@@ -26676,7 +26730,7 @@ import { existsSync as existsSync11, mkdirSync as mkdirSync9, readFileSync as re
|
|
|
26676
26730
|
import { dirname as dirname6, join as join17 } from "path";
|
|
26677
26731
|
|
|
26678
26732
|
// src/shared/opencode-config-dir.ts
|
|
26679
|
-
import { homedir as
|
|
26733
|
+
import { homedir as homedir10 } from "os";
|
|
26680
26734
|
import { join as join16, resolve as resolve4 } from "path";
|
|
26681
26735
|
function getCliConfigDir() {
|
|
26682
26736
|
const envConfigDir = process.env.OPENCODE_CONFIG_DIR?.trim();
|
|
@@ -26684,9 +26738,9 @@ function getCliConfigDir() {
|
|
|
26684
26738
|
return resolve4(envConfigDir);
|
|
26685
26739
|
}
|
|
26686
26740
|
if (process.platform === "win32") {
|
|
26687
|
-
return join16(
|
|
26741
|
+
return join16(homedir10(), ".config", "opencode");
|
|
26688
26742
|
}
|
|
26689
|
-
return join16(process.env.XDG_CONFIG_HOME || join16(
|
|
26743
|
+
return join16(process.env.XDG_CONFIG_HOME || join16(homedir10(), ".config"), "opencode");
|
|
26690
26744
|
}
|
|
26691
26745
|
function getOpenCodeConfigDir2(_options) {
|
|
26692
26746
|
return getCliConfigDir();
|
|
@@ -29741,7 +29795,7 @@ var plugin = async (input) => {
|
|
|
29741
29795
|
if (aftConfig.max_callgraph_files !== undefined)
|
|
29742
29796
|
configOverrides.max_callgraph_files = aftConfig.max_callgraph_files;
|
|
29743
29797
|
const isFastembedSemanticBackend = (aftConfig.semantic?.backend ?? "fastembed") === "fastembed";
|
|
29744
|
-
const dataHome = process.env.XDG_DATA_HOME || join18(
|
|
29798
|
+
const dataHome = process.env.XDG_DATA_HOME || join18(homedir11(), ".local", "share");
|
|
29745
29799
|
configOverrides.storage_dir = join18(dataHome, "opencode", "storage", "plugin", "aft");
|
|
29746
29800
|
let onnxRuntimePromise = null;
|
|
29747
29801
|
if (aftConfig.semantic_search && isFastembedSemanticBackend) {
|
|
@@ -29885,6 +29939,10 @@ ${lines}
|
|
|
29885
29939
|
}
|
|
29886
29940
|
(async () => {
|
|
29887
29941
|
try {
|
|
29942
|
+
if (isHomeDirectoryRoot(input.directory)) {
|
|
29943
|
+
log2(`Eager configure skipped: input.directory=${input.directory} is the user home directory. ` + `The first real tool call from a session will warm the correct project bridge.`);
|
|
29944
|
+
return;
|
|
29945
|
+
}
|
|
29888
29946
|
if (onnxRuntimePromise) {
|
|
29889
29947
|
await Promise.race([
|
|
29890
29948
|
onnxRuntimePromise,
|
package/dist/tui.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// package.json
|
|
3
3
|
var package_default = {
|
|
4
4
|
name: "@cortexkit/aft-opencode",
|
|
5
|
-
version: "0.19.
|
|
5
|
+
version: "0.19.3",
|
|
6
6
|
type: "module",
|
|
7
7
|
description: "OpenCode plugin for Agent File Tools (AFT) \u2014 tree-sitter and lsp powered code analysis",
|
|
8
8
|
main: "dist/index.js",
|
|
@@ -30,7 +30,7 @@ var package_default = {
|
|
|
30
30
|
},
|
|
31
31
|
dependencies: {
|
|
32
32
|
"@clack/prompts": "^1.2.0",
|
|
33
|
-
"@cortexkit/aft-bridge": "0.19.
|
|
33
|
+
"@cortexkit/aft-bridge": "0.19.3",
|
|
34
34
|
"@opencode-ai/plugin": "^1.2.26",
|
|
35
35
|
"@opencode-ai/sdk": "^1.2.26",
|
|
36
36
|
"comment-json": "^4.6.2",
|
|
@@ -38,11 +38,11 @@ var package_default = {
|
|
|
38
38
|
zod: "^4.1.8"
|
|
39
39
|
},
|
|
40
40
|
optionalDependencies: {
|
|
41
|
-
"@cortexkit/aft-darwin-arm64": "0.19.
|
|
42
|
-
"@cortexkit/aft-darwin-x64": "0.19.
|
|
43
|
-
"@cortexkit/aft-linux-arm64": "0.19.
|
|
44
|
-
"@cortexkit/aft-linux-x64": "0.19.
|
|
45
|
-
"@cortexkit/aft-win32-x64": "0.19.
|
|
41
|
+
"@cortexkit/aft-darwin-arm64": "0.19.3",
|
|
42
|
+
"@cortexkit/aft-darwin-x64": "0.19.3",
|
|
43
|
+
"@cortexkit/aft-linux-arm64": "0.19.3",
|
|
44
|
+
"@cortexkit/aft-linux-x64": "0.19.3",
|
|
45
|
+
"@cortexkit/aft-win32-x64": "0.19.3"
|
|
46
46
|
},
|
|
47
47
|
devDependencies: {
|
|
48
48
|
"@types/node": "^22.0.0",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cortexkit/aft-opencode",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.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",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@clack/prompts": "^1.2.0",
|
|
31
|
-
"@cortexkit/aft-bridge": "0.19.
|
|
31
|
+
"@cortexkit/aft-bridge": "0.19.3",
|
|
32
32
|
"@opencode-ai/plugin": "^1.2.26",
|
|
33
33
|
"@opencode-ai/sdk": "^1.2.26",
|
|
34
34
|
"comment-json": "^4.6.2",
|
|
@@ -36,11 +36,11 @@
|
|
|
36
36
|
"zod": "^4.1.8"
|
|
37
37
|
},
|
|
38
38
|
"optionalDependencies": {
|
|
39
|
-
"@cortexkit/aft-darwin-arm64": "0.19.
|
|
40
|
-
"@cortexkit/aft-darwin-x64": "0.19.
|
|
41
|
-
"@cortexkit/aft-linux-arm64": "0.19.
|
|
42
|
-
"@cortexkit/aft-linux-x64": "0.19.
|
|
43
|
-
"@cortexkit/aft-win32-x64": "0.19.
|
|
39
|
+
"@cortexkit/aft-darwin-arm64": "0.19.3",
|
|
40
|
+
"@cortexkit/aft-darwin-x64": "0.19.3",
|
|
41
|
+
"@cortexkit/aft-linux-arm64": "0.19.3",
|
|
42
|
+
"@cortexkit/aft-linux-x64": "0.19.3",
|
|
43
|
+
"@cortexkit/aft-win32-x64": "0.19.3"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@types/node": "^22.0.0",
|