@cortexkit/aft-opencode 0.52.1 → 0.53.0
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 +20 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/index.js +142 -88
- package/dist/shared/status.d.ts +1 -0
- package/dist/shared/status.d.ts.map +1 -1
- package/dist/shared/storage-paths.d.ts +1 -1
- package/dist/shared/storage-paths.d.ts.map +1 -1
- package/package.json +8 -8
- package/src/shared/status.ts +24 -2
- package/src/shared/storage-paths.ts +1 -22
- package/src/tui/index.tsx +6 -0
- package/src/tui/sidebar.tsx +2 -3
- package/src/tui-compiled/index.tsx +12 -0
- package/src/tui-compiled/sidebar.tsx +2 -3
package/dist/config.d.ts
CHANGED
|
@@ -60,6 +60,22 @@ export declare const AftConfigSchema: z.ZodPreprocess<z.ZodObject<{
|
|
|
60
60
|
disabled_tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
61
61
|
restrict_to_project_root: z.ZodOptional<z.ZodBoolean>;
|
|
62
62
|
search_index: z.ZodOptional<z.ZodBoolean>;
|
|
63
|
+
index: z.ZodOptional<z.ZodObject<{
|
|
64
|
+
roots: z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
65
|
+
path: z.ZodString;
|
|
66
|
+
indexes: z.ZodArray<z.ZodEnum<{
|
|
67
|
+
search: "search";
|
|
68
|
+
semantic: "semantic";
|
|
69
|
+
callgraph: "callgraph";
|
|
70
|
+
}>>;
|
|
71
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
72
|
+
path: string;
|
|
73
|
+
indexes: ("search" | "semantic" | "callgraph")[];
|
|
74
|
+
}, {
|
|
75
|
+
path: string;
|
|
76
|
+
indexes: ("search" | "semantic" | "callgraph")[];
|
|
77
|
+
}>>>>;
|
|
78
|
+
}, z.core.$strip>>;
|
|
63
79
|
semantic_search: z.ZodOptional<z.ZodBoolean>;
|
|
64
80
|
callgraph_store: z.ZodOptional<z.ZodBoolean>;
|
|
65
81
|
callgraph_chunk_size: z.ZodOptional<z.ZodNumber>;
|
|
@@ -154,6 +170,10 @@ export declare const AftConfigSchema: z.ZodPreprocess<z.ZodObject<{
|
|
|
154
170
|
}, z.core.$strip>>;
|
|
155
171
|
gh_shim: z.ZodOptional<z.ZodObject<{
|
|
156
172
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
173
|
+
binary_path: z.ZodOptional<z.ZodString>;
|
|
174
|
+
}, z.core.$strip>>;
|
|
175
|
+
git: z.ZodOptional<z.ZodObject<{
|
|
176
|
+
co_author: z.ZodOptional<z.ZodString>;
|
|
157
177
|
}, z.core.$strip>>;
|
|
158
178
|
}, z.core.$strict>>;
|
|
159
179
|
export type AftConfig = z.infer<typeof AftConfigSchema>;
|
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":"AAGA,OAAO,EACL,KAAK,4BAA4B,EACjC,KAAK,UAAU,EAQhB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAiCxB,oGAAoG;AACpG,eAAO,MAAM,6BAA6B;;;;EAAmC,CAAC;AAC9E,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AA6PtF,eAAO,MAAM,sCAAsC,SAAU,CAAC;AAC9D,eAAO,MAAM,kCAAkC,QAAS,CAAC;AACzD,eAAO,MAAM,kCAAkC,SAAU,CAAC;AAsD1D,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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7869
|
function isTerminalStatus(status) {
|
|
7870
|
-
return status === "completed" || status === "failed" || status === "killed" || status === "timed_out";
|
|
7870
|
+
return status === "completed" || status === "failed" || status === "killed" || status === "timed_out" || status === "fate_unknown";
|
|
7871
7871
|
}
|
|
7872
7872
|
function sleep(ms) {
|
|
7873
7873
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
@@ -8410,6 +8410,7 @@ var TERMINAL_BASH_STATUSES = new Set([
|
|
|
8410
8410
|
"failed",
|
|
8411
8411
|
"killed",
|
|
8412
8412
|
"timed_out",
|
|
8413
|
+
"fate_unknown",
|
|
8413
8414
|
"cancelled",
|
|
8414
8415
|
"timeout"
|
|
8415
8416
|
]);
|
|
@@ -10006,34 +10007,54 @@ async function fetchLatestTag() {
|
|
|
10006
10007
|
}
|
|
10007
10008
|
// ../aft-bridge/dist/durable-log.js
|
|
10008
10009
|
import { appendFile, mkdir, rename, rm, stat } from "node:fs/promises";
|
|
10010
|
+
import { dirname } from "node:path";
|
|
10011
|
+
|
|
10012
|
+
// ../aft-bridge/dist/storage-paths.js
|
|
10009
10013
|
import { homedir as homedir4 } from "node:os";
|
|
10010
|
-
import {
|
|
10011
|
-
var DEFAULT_LOG_BYTES = 32 * 1024 * 1024;
|
|
10012
|
-
var DEFAULT_LOG_GENERATIONS = 1;
|
|
10014
|
+
import { join as join5, resolve as resolve3 } from "node:path";
|
|
10013
10015
|
function homeDir2() {
|
|
10014
10016
|
if (process.platform === "win32")
|
|
10015
10017
|
return process.env.USERPROFILE || process.env.HOME || homedir4();
|
|
10016
10018
|
return process.env.HOME || homedir4();
|
|
10017
10019
|
}
|
|
10018
10020
|
function dataHome() {
|
|
10019
|
-
|
|
10020
|
-
|
|
10021
|
+
const xdg = process.env.XDG_DATA_HOME;
|
|
10022
|
+
if (xdg)
|
|
10023
|
+
return xdg;
|
|
10021
10024
|
if (process.platform === "win32") {
|
|
10022
10025
|
return process.env.LOCALAPPDATA || process.env.APPDATA || join5(homeDir2(), "AppData", "Local");
|
|
10023
10026
|
}
|
|
10024
10027
|
return join5(homeDir2(), ".local", "share");
|
|
10025
10028
|
}
|
|
10029
|
+
function resolveStoragePath(raw) {
|
|
10030
|
+
let expanded = raw;
|
|
10031
|
+
if (raw === "~") {
|
|
10032
|
+
expanded = homeDir2();
|
|
10033
|
+
} else if (raw.startsWith("~/") || raw.startsWith("~\\")) {
|
|
10034
|
+
expanded = join5(homeDir2(), raw.slice(2));
|
|
10035
|
+
}
|
|
10036
|
+
return resolve3(expanded);
|
|
10037
|
+
}
|
|
10038
|
+
function resolveCortexKitStorageRoot() {
|
|
10039
|
+
const override = process.env.AFT_STORAGE_DIR;
|
|
10040
|
+
if (override)
|
|
10041
|
+
return resolveStoragePath(override);
|
|
10042
|
+
return resolveStoragePath(join5(dataHome(), "cortexkit", "aft"));
|
|
10043
|
+
}
|
|
10026
10044
|
function resolveAftStorageRoot(configuredRoot) {
|
|
10045
|
+
if (process.env.AFT_STORAGE_DIR)
|
|
10046
|
+
return resolveCortexKitStorageRoot();
|
|
10027
10047
|
if (configuredRoot)
|
|
10028
10048
|
return configuredRoot;
|
|
10029
|
-
|
|
10030
|
-
return join5(process.env.AFT_CACHE_DIR, "aft");
|
|
10031
|
-
return join5(dataHome(), "cortexkit", "aft");
|
|
10049
|
+
return resolveCortexKitStorageRoot();
|
|
10032
10050
|
}
|
|
10033
10051
|
function resolveAftLogPath(filename, configuredRoot) {
|
|
10034
10052
|
return join5(resolveAftStorageRoot(configuredRoot), "logs", filename);
|
|
10035
10053
|
}
|
|
10036
10054
|
|
|
10055
|
+
// ../aft-bridge/dist/durable-log.js
|
|
10056
|
+
var DEFAULT_LOG_BYTES = 32 * 1024 * 1024;
|
|
10057
|
+
var DEFAULT_LOG_GENERATIONS = 1;
|
|
10037
10058
|
class RotatingLogSink {
|
|
10038
10059
|
path;
|
|
10039
10060
|
maxBytes;
|
|
@@ -10359,7 +10380,7 @@ class SubcSocket {
|
|
|
10359
10380
|
return this.sock.localPort ?? null;
|
|
10360
10381
|
}
|
|
10361
10382
|
static connect(host, port, deadlineMs) {
|
|
10362
|
-
return new Promise((
|
|
10383
|
+
return new Promise((resolve4, reject) => {
|
|
10363
10384
|
const sock = net.connect({ host, port });
|
|
10364
10385
|
sock.setNoDelay(true);
|
|
10365
10386
|
const timer = setTimeout(() => {
|
|
@@ -10368,7 +10389,7 @@ class SubcSocket {
|
|
|
10368
10389
|
}, Math.max(0, deadlineMs - Date.now()));
|
|
10369
10390
|
sock.once("connect", () => {
|
|
10370
10391
|
clearTimeout(timer);
|
|
10371
|
-
|
|
10392
|
+
resolve4(new SubcSocket(sock));
|
|
10372
10393
|
});
|
|
10373
10394
|
sock.once("error", (err) => {
|
|
10374
10395
|
clearTimeout(timer);
|
|
@@ -10400,7 +10421,7 @@ class SubcSocket {
|
|
|
10400
10421
|
}
|
|
10401
10422
|
if (n === 0)
|
|
10402
10423
|
return Promise.resolve(new Uint8Array(0));
|
|
10403
|
-
return new Promise((
|
|
10424
|
+
return new Promise((resolve4, reject) => {
|
|
10404
10425
|
let timer = null;
|
|
10405
10426
|
if (Number.isFinite(deadlineMs)) {
|
|
10406
10427
|
const remaining = deadlineMs - Date.now();
|
|
@@ -10413,7 +10434,7 @@ class SubcSocket {
|
|
|
10413
10434
|
reject(new SocketTimeoutError(`timed out waiting for ${n} bytes`));
|
|
10414
10435
|
}, remaining);
|
|
10415
10436
|
}
|
|
10416
|
-
this.waiter = { need: n, resolve:
|
|
10437
|
+
this.waiter = { need: n, resolve: resolve4, reject, timer };
|
|
10417
10438
|
this.tryServe();
|
|
10418
10439
|
});
|
|
10419
10440
|
}
|
|
@@ -10449,7 +10470,7 @@ class SubcSocket {
|
|
|
10449
10470
|
let queued = false;
|
|
10450
10471
|
let settled = false;
|
|
10451
10472
|
let timer = null;
|
|
10452
|
-
const completed = new Promise((
|
|
10473
|
+
const completed = new Promise((resolve4, reject) => {
|
|
10453
10474
|
const settle = (run) => {
|
|
10454
10475
|
if (settled)
|
|
10455
10476
|
return;
|
|
@@ -10473,7 +10494,7 @@ class SubcSocket {
|
|
|
10473
10494
|
if (err) {
|
|
10474
10495
|
reject(new SocketWriteQueuedError("subc socket reported a write error after bytes were handed to the socket", err instanceof Error ? err : new Error(String(err))));
|
|
10475
10496
|
} else {
|
|
10476
|
-
|
|
10497
|
+
resolve4();
|
|
10477
10498
|
}
|
|
10478
10499
|
});
|
|
10479
10500
|
});
|
|
@@ -10896,15 +10917,15 @@ class SubcClient {
|
|
|
10896
10917
|
const key = pendingKey(handle, corr);
|
|
10897
10918
|
let subscriptionPending = null;
|
|
10898
10919
|
let resolveClosed = null;
|
|
10899
|
-
const closed = new Promise((
|
|
10920
|
+
const closed = new Promise((resolve4, reject) => {
|
|
10900
10921
|
if (this.closedErr) {
|
|
10901
10922
|
reject(this.closedErr);
|
|
10902
10923
|
return;
|
|
10903
10924
|
}
|
|
10904
|
-
resolveClosed =
|
|
10925
|
+
resolveClosed = resolve4;
|
|
10905
10926
|
subscriptionPending = {
|
|
10906
10927
|
handle,
|
|
10907
|
-
resolve: () =>
|
|
10928
|
+
resolve: () => resolve4(),
|
|
10908
10929
|
reject,
|
|
10909
10930
|
onProgress: onEvent,
|
|
10910
10931
|
timer: null,
|
|
@@ -10993,11 +11014,11 @@ class SubcClient {
|
|
|
10993
11014
|
const waiters = [];
|
|
10994
11015
|
for (const pending of this.pending.values()) {
|
|
10995
11016
|
if (pending.handle === handle && !pending.subscription) {
|
|
10996
|
-
waiters.push(new Promise((
|
|
11017
|
+
waiters.push(new Promise((resolve4) => {
|
|
10997
11018
|
const previous = pending.onSettle;
|
|
10998
11019
|
pending.onSettle = () => {
|
|
10999
11020
|
previous?.();
|
|
11000
|
-
|
|
11021
|
+
resolve4();
|
|
11001
11022
|
};
|
|
11002
11023
|
}));
|
|
11003
11024
|
}
|
|
@@ -11053,11 +11074,11 @@ class SubcClient {
|
|
|
11053
11074
|
const channel = handle?.channel ?? 0;
|
|
11054
11075
|
const epoch = handle?.epoch ?? 0;
|
|
11055
11076
|
const frame = buildFrame(FrameType.Request, buildFlags(false, priority, false, admission), channel, epoch, corr, body);
|
|
11056
|
-
return new Promise((
|
|
11077
|
+
return new Promise((resolve4, reject) => {
|
|
11057
11078
|
const ms = timeoutMs ?? DEFAULT_REQUEST_TIMEOUT_MS;
|
|
11058
11079
|
const pending = {
|
|
11059
11080
|
handle,
|
|
11060
|
-
resolve:
|
|
11081
|
+
resolve: resolve4,
|
|
11061
11082
|
reject,
|
|
11062
11083
|
onProgress,
|
|
11063
11084
|
timer: null,
|
|
@@ -11131,11 +11152,11 @@ class SubcClient {
|
|
|
11131
11152
|
}
|
|
11132
11153
|
return this.outcomeUnknownCallError("connection dropped before the managed call returned a response", error2);
|
|
11133
11154
|
};
|
|
11134
|
-
return new Promise((
|
|
11155
|
+
return new Promise((resolve4, reject) => {
|
|
11135
11156
|
const ms = timeoutMs ?? DEFAULT_REQUEST_TIMEOUT_MS;
|
|
11136
11157
|
const pending = {
|
|
11137
11158
|
handle,
|
|
11138
|
-
resolve:
|
|
11159
|
+
resolve: resolve4,
|
|
11139
11160
|
reject,
|
|
11140
11161
|
onProgress,
|
|
11141
11162
|
timer: null,
|
|
@@ -11584,7 +11605,7 @@ function normalizeConnectOptions(opts) {
|
|
|
11584
11605
|
identity: opts.identity,
|
|
11585
11606
|
targetKind: opts.targetKind ?? DEFAULT_MANAGED_TARGET_KIND,
|
|
11586
11607
|
reconnectBackoff: opts.reconnectBackoff ?? DEFAULT_RECONNECT_BACKOFF,
|
|
11587
|
-
sleep: opts.sleep ?? ((ms) => new Promise((
|
|
11608
|
+
sleep: opts.sleep ?? ((ms) => new Promise((resolve4) => setTimeout(resolve4, ms))),
|
|
11588
11609
|
timeoutArbitrationGraceMs: opts.timeoutArbitrationGraceMs ?? TIMEOUT_ARBITRATION_GRACE_MS,
|
|
11589
11610
|
livenessProbeWindowMs: opts.livenessProbeWindowMs ?? LIVENESS_PROBE_WINDOW_MS,
|
|
11590
11611
|
onControlPush: opts.onControlPush
|
|
@@ -12044,14 +12065,14 @@ function getLifecycleRegistry() {
|
|
|
12044
12065
|
// ../aft-bridge/dist/project-identity.js
|
|
12045
12066
|
import { createHash as createHash3 } from "node:crypto";
|
|
12046
12067
|
import { realpathSync } from "node:fs";
|
|
12047
|
-
import { resolve as
|
|
12068
|
+
import { resolve as resolve4 } from "node:path";
|
|
12048
12069
|
function canonicalizeProjectRoot(dir) {
|
|
12049
12070
|
const trimmed = dir.replace(/[/\\]+$/, "");
|
|
12050
12071
|
let canonical;
|
|
12051
12072
|
try {
|
|
12052
12073
|
canonical = realpathSync(trimmed);
|
|
12053
12074
|
} catch {
|
|
12054
|
-
canonical =
|
|
12075
|
+
canonical = resolve4(trimmed);
|
|
12055
12076
|
}
|
|
12056
12077
|
return normalizeWindowsRoot(canonical);
|
|
12057
12078
|
}
|
|
@@ -12550,8 +12571,8 @@ class SubcTransportPool {
|
|
|
12550
12571
|
this.connectFn = options.connect ?? ((opts) => SubcClient.connect(opts));
|
|
12551
12572
|
this.onBgEventsNudge = options.onBgEventsNudge;
|
|
12552
12573
|
this.onBgEventsNudgeRef = options.onBgEventsNudgeRef;
|
|
12553
|
-
this.bgBackoffSleep = options.bgBackoffSleep ?? ((ms) => new Promise((
|
|
12554
|
-
this.routeRetrySleep = options.routeRetrySleep ?? ((ms) => new Promise((
|
|
12574
|
+
this.bgBackoffSleep = options.bgBackoffSleep ?? ((ms) => new Promise((resolve5) => setTimeout(resolve5, ms)));
|
|
12575
|
+
this.routeRetrySleep = options.routeRetrySleep ?? ((ms) => new Promise((resolve5) => setTimeout(resolve5, ms)));
|
|
12555
12576
|
this.bgDispatchProbeIntervalMs = options.bgDispatchProbeIntervalMs ?? BG_DISPATCH_PROBE_INTERVAL_MS;
|
|
12556
12577
|
const lifecycle = options.lifecycle;
|
|
12557
12578
|
const demandCheck = options.lifecycleDemandCheck ?? options.demandCheck ?? lifecycle?.demandCheck;
|
|
@@ -13460,12 +13481,12 @@ function stripJsoncSymbols(value) {
|
|
|
13460
13481
|
import { spawnSync as spawnSync2 } from "node:child_process";
|
|
13461
13482
|
import { closeSync as closeSync3, existsSync as existsSync6, mkdirSync as mkdirSync4, openSync as openSync3, readFileSync as readFileSync5, renameSync as renameSync4, rmSync as rmSync2, statSync as statSync4, unlinkSync as unlinkSync3, writeFileSync as writeFileSync2 } from "node:fs";
|
|
13462
13483
|
import { homedir as homedir7, tmpdir } from "node:os";
|
|
13463
|
-
import { basename, dirname as dirname3, join as join8, resolve as
|
|
13484
|
+
import { basename, dirname as dirname3, join as join8, resolve as resolve6 } from "node:path";
|
|
13464
13485
|
|
|
13465
13486
|
// ../aft-bridge/dist/paths.js
|
|
13466
13487
|
import { existsSync as existsSync4, mkdirSync as mkdirSync2, readFileSync as readFileSync4, renameSync as renameSync2, writeFileSync } from "node:fs";
|
|
13467
13488
|
import { homedir as homedir5 } from "node:os";
|
|
13468
|
-
import { dirname as dirname2, isAbsolute as isAbsolute2, join as join6, resolve as
|
|
13489
|
+
import { dirname as dirname2, isAbsolute as isAbsolute2, join as join6, resolve as resolve5 } from "node:path";
|
|
13469
13490
|
function homeDir3() {
|
|
13470
13491
|
if (process.platform === "win32")
|
|
13471
13492
|
return process.env.USERPROFILE || process.env.HOME || homedir5();
|
|
@@ -13480,7 +13501,7 @@ function configHome() {
|
|
|
13480
13501
|
function legacyOpenCodeConfigDir() {
|
|
13481
13502
|
const envDir = process.env.OPENCODE_CONFIG_DIR?.trim();
|
|
13482
13503
|
if (envDir)
|
|
13483
|
-
return
|
|
13504
|
+
return resolve5(envDir);
|
|
13484
13505
|
return join6(configHome(), "opencode");
|
|
13485
13506
|
}
|
|
13486
13507
|
function legacyPiAgentDir() {
|
|
@@ -13845,9 +13866,6 @@ function resolveLegacyStorageRoot(harness) {
|
|
|
13845
13866
|
return join8(homeDir4(), ".pi", "agent", "aft");
|
|
13846
13867
|
return join8(dataHome2(), "opencode", "storage", "plugin", "aft");
|
|
13847
13868
|
}
|
|
13848
|
-
function resolveCortexKitStorageRoot() {
|
|
13849
|
-
return join8(dataHome2(), "cortexkit", "aft");
|
|
13850
|
-
}
|
|
13851
13869
|
function stripJsoncForParse(input) {
|
|
13852
13870
|
let out = "";
|
|
13853
13871
|
let inString = false;
|
|
@@ -14117,8 +14135,8 @@ function visibleConfigMigrationWarning(scope, targetPath, paths, reason) {
|
|
|
14117
14135
|
}
|
|
14118
14136
|
function migrateAftConfigFile(opts) {
|
|
14119
14137
|
const warnings = [];
|
|
14120
|
-
const resolvedTarget =
|
|
14121
|
-
const existingSources = opts.legacySources.filter((source) => existsSync6(source.path) &&
|
|
14138
|
+
const resolvedTarget = resolve6(opts.targetPath);
|
|
14139
|
+
const existingSources = opts.legacySources.filter((source) => existsSync6(source.path) && resolve6(source.path) !== resolvedTarget);
|
|
14122
14140
|
const info = opts.logger?.info ?? opts.logger?.log;
|
|
14123
14141
|
if (existingSources.length === 0) {
|
|
14124
14142
|
return { migrated: false, conflict: false, targetPath: opts.targetPath, warnings };
|
|
@@ -14367,7 +14385,7 @@ function isNpmAvailable(deps = defaultDeps()) {
|
|
|
14367
14385
|
import { execFileSync } from "node:child_process";
|
|
14368
14386
|
import { createHash as createHash4 } from "node:crypto";
|
|
14369
14387
|
import { chmodSync as chmodSync3, closeSync as closeSync4, copyFileSync as copyFileSync3, createWriteStream as createWriteStream2, existsSync as existsSync7, lstatSync, mkdirSync as mkdirSync5, openSync as openSync4, readdirSync as readdirSync3, readFileSync as readFileSync6, readlinkSync, realpathSync as realpathSync2, rmSync as rmSync3, statSync as statSync6, symlinkSync, unlinkSync as unlinkSync4, writeFileSync as writeFileSync3 } from "node:fs";
|
|
14370
|
-
import { basename as basename2, dirname as dirname5, isAbsolute as isAbsolute4, join as join10, relative as relative2, resolve as
|
|
14388
|
+
import { basename as basename2, dirname as dirname5, isAbsolute as isAbsolute4, join as join10, relative as relative2, resolve as resolve7, win32 } from "node:path";
|
|
14371
14389
|
import { Readable as Readable2 } from "node:stream";
|
|
14372
14390
|
import { pipeline as pipeline2 } from "node:stream/promises";
|
|
14373
14391
|
var ORT_VERSION = "1.24.4";
|
|
@@ -14675,7 +14693,7 @@ function findSystemOnnxRuntime(libName) {
|
|
|
14675
14693
|
const normalizeCase = process.platform === "win32" || process.platform === "darwin";
|
|
14676
14694
|
const seen = new Set;
|
|
14677
14695
|
const uniquePaths = searchPaths.filter((p) => {
|
|
14678
|
-
let key =
|
|
14696
|
+
let key = resolve7(p).replace(/[/\\]+$/, "");
|
|
14679
14697
|
if (normalizeCase)
|
|
14680
14698
|
key = key.toLowerCase();
|
|
14681
14699
|
if (seen.has(key))
|
|
@@ -14759,7 +14777,7 @@ function validateExtractedTree(stagingRoot) {
|
|
|
14759
14777
|
const lst = lstatSync(fullPath);
|
|
14760
14778
|
if (lst.isSymbolicLink()) {
|
|
14761
14779
|
const linkTarget = readlinkSync(fullPath);
|
|
14762
|
-
const resolvedTarget =
|
|
14780
|
+
const resolvedTarget = resolve7(dirname5(fullPath), linkTarget);
|
|
14763
14781
|
const rel2 = relative2(realRoot, resolvedTarget);
|
|
14764
14782
|
if (rel2.startsWith("..") || isAbsolute4(rel2) || win32.isAbsolute(rel2)) {
|
|
14765
14783
|
throw new Error(`extracted symlink ${fullPath} points outside staging root: ${linkTarget}`);
|
|
@@ -14877,7 +14895,7 @@ function copyOnnxLibraries(info, extractedDir, targetDir, realFiles, symlinks, c
|
|
|
14877
14895
|
unlinkSync4(dst);
|
|
14878
14896
|
} catch {}
|
|
14879
14897
|
const dstForContainment = join10(targetRoot, link.name);
|
|
14880
|
-
const resolvedTarget =
|
|
14898
|
+
const resolvedTarget = resolve7(dirname5(dstForContainment), link.target);
|
|
14881
14899
|
if (!isPathInsideRoot(targetRoot, resolvedTarget)) {
|
|
14882
14900
|
const message = `ONNX Runtime symlink ${link.name} points outside install dir: ${link.target}`;
|
|
14883
14901
|
if (requiredLibs.has(link.name)) {
|
|
@@ -15926,7 +15944,7 @@ class RevivableTransportPool {
|
|
|
15926
15944
|
const delay = Math.max(0, this.revivalRetryNotBefore - Date.now());
|
|
15927
15945
|
if (delay > 0) {
|
|
15928
15946
|
let scheduled;
|
|
15929
|
-
scheduled = new Promise((
|
|
15947
|
+
scheduled = new Promise((resolve8) => setTimeout(resolve8, delay)).then(() => {
|
|
15930
15948
|
if (this.revival === scheduled)
|
|
15931
15949
|
this.revival = null;
|
|
15932
15950
|
return this.ensureActivePool();
|
|
@@ -17439,7 +17457,8 @@ async function signalBashWaitDetachForProject(pool, projectRoot, sessionID) {
|
|
|
17439
17457
|
|
|
17440
17458
|
// src/config.ts
|
|
17441
17459
|
import { existsSync as existsSync10, readFileSync as readFileSync7, renameSync as renameSync5, unlinkSync as unlinkSync5, writeFileSync as writeFileSync4 } from "node:fs";
|
|
17442
|
-
import {
|
|
17460
|
+
import { homedir as homedir11 } from "node:os";
|
|
17461
|
+
import { isAbsolute as isAbsolute7, parse as parsePath, resolve as resolvePath } from "node:path";
|
|
17443
17462
|
var import_comment_json = __toESM(require_src2(), 1);
|
|
17444
17463
|
|
|
17445
17464
|
// ../../node_modules/.bun/zod@4.4.3/node_modules/zod/v4/classic/external.js
|
|
@@ -31744,6 +31763,32 @@ var CheckerEnum = exports_external.enum([
|
|
|
31744
31763
|
]);
|
|
31745
31764
|
var ConfigureWarningsDeliveryEnum = exports_external.enum(["toast", "log", "chat"]);
|
|
31746
31765
|
var SemanticBackendEnum = exports_external.enum(["fastembed", "openai_compatible", "ollama"]);
|
|
31766
|
+
var IndexKindSchema = exports_external.enum(["search", "semantic", "callgraph"]);
|
|
31767
|
+
function isSupportedAbsoluteIndexPath(path3) {
|
|
31768
|
+
if (path3 === "~" || path3.startsWith("~/") || path3.startsWith("~\\")) {
|
|
31769
|
+
return isAbsolute7(homedir11());
|
|
31770
|
+
}
|
|
31771
|
+
return isAbsolute7(path3);
|
|
31772
|
+
}
|
|
31773
|
+
var IndexRootSchema = exports_external.object({
|
|
31774
|
+
path: exports_external.string().refine(isSupportedAbsoluteIndexPath, {
|
|
31775
|
+
message: "index.roots path must be absolute after ~ expansion"
|
|
31776
|
+
}),
|
|
31777
|
+
indexes: exports_external.array(IndexKindSchema).min(1, "index.roots indexes must be non-empty")
|
|
31778
|
+
}).superRefine(({ indexes }, context) => {
|
|
31779
|
+
if (new Set(indexes).size !== indexes.length) {
|
|
31780
|
+
context.addIssue({
|
|
31781
|
+
code: "custom",
|
|
31782
|
+
message: "index.roots indexes must not contain duplicates"
|
|
31783
|
+
});
|
|
31784
|
+
}
|
|
31785
|
+
}).transform(({ path: path3, indexes }) => ({
|
|
31786
|
+
path: path3,
|
|
31787
|
+
indexes: ["search", "semantic", "callgraph"].filter((kind) => indexes.includes(kind) || kind === "search" && indexes.includes("semantic"))
|
|
31788
|
+
}));
|
|
31789
|
+
var IndexConfigSchema = exports_external.object({
|
|
31790
|
+
roots: exports_external.array(IndexRootSchema).optional()
|
|
31791
|
+
});
|
|
31747
31792
|
var SemanticConfigSchema = exports_external.object({
|
|
31748
31793
|
backend: SemanticBackendEnum.optional(),
|
|
31749
31794
|
model: exports_external.string().trim().min(1).optional(),
|
|
@@ -31810,7 +31855,12 @@ var SubcConfigSchema = exports_external.object({
|
|
|
31810
31855
|
client_reaper: exports_external.boolean().optional()
|
|
31811
31856
|
});
|
|
31812
31857
|
var GhShimConfigSchema = exports_external.object({
|
|
31813
|
-
enabled: exports_external.boolean().optional()
|
|
31858
|
+
enabled: exports_external.boolean().optional(),
|
|
31859
|
+
binary_path: exports_external.string().trim().refine(isAbsolute7, "gh_shim.binary_path must be absolute").optional()
|
|
31860
|
+
});
|
|
31861
|
+
var GitCoAuthorSchema = exports_external.string().trim().refine((value) => value === "off" || value === "auto" || /^[^<>\r\n]+\s+<[^<>\s@]+@[^<>\s@]+>$/.test(value), "git.co_author must be 'off', 'auto', or an explicit 'Name <email>' identity");
|
|
31862
|
+
var GitConfigSchema = exports_external.object({
|
|
31863
|
+
co_author: GitCoAuthorSchema.optional()
|
|
31814
31864
|
});
|
|
31815
31865
|
var DEFAULT_INSPECT_DIAGNOSTICS_TIMEOUT_MS = 120000;
|
|
31816
31866
|
var MIN_INSPECT_DIAGNOSTICS_TIMEOUT_MS = 1e4;
|
|
@@ -31852,6 +31902,7 @@ var AftConfigSchema = exports_external.preprocess((value) => stripHarnessSpecifi
|
|
|
31852
31902
|
disabled_tools: exports_external.array(exports_external.string()).optional(),
|
|
31853
31903
|
restrict_to_project_root: exports_external.boolean().optional(),
|
|
31854
31904
|
search_index: exports_external.boolean().optional(),
|
|
31905
|
+
index: IndexConfigSchema.optional(),
|
|
31855
31906
|
semantic_search: exports_external.boolean().optional(),
|
|
31856
31907
|
callgraph_store: exports_external.boolean().optional(),
|
|
31857
31908
|
callgraph_chunk_size: exports_external.number().optional(),
|
|
@@ -31867,7 +31918,8 @@ var AftConfigSchema = exports_external.preprocess((value) => stripHarnessSpecifi
|
|
|
31867
31918
|
auto_update: exports_external.boolean().optional(),
|
|
31868
31919
|
bridge: BridgeConfigSchema.optional(),
|
|
31869
31920
|
subc: SubcConfigSchema.optional(),
|
|
31870
|
-
gh_shim: GhShimConfigSchema.optional()
|
|
31921
|
+
gh_shim: GhShimConfigSchema.optional(),
|
|
31922
|
+
git: GitConfigSchema.optional()
|
|
31871
31923
|
}).strict());
|
|
31872
31924
|
function resolveInspectDiagnosticsTimeoutMs(config2) {
|
|
31873
31925
|
return clampInspectDiagnosticsTimeoutMs(config2.inspect?.diagnostics_timeout_ms ?? DEFAULT_INSPECT_DIAGNOSTICS_TIMEOUT_MS);
|
|
@@ -32290,6 +32342,7 @@ var PROJECT_SAFE_TOP_LEVEL_FIELDS = new Set([
|
|
|
32290
32342
|
"callgraph_chunk_size",
|
|
32291
32343
|
"inspect",
|
|
32292
32344
|
"worktree",
|
|
32345
|
+
"git",
|
|
32293
32346
|
"experimental",
|
|
32294
32347
|
"bash"
|
|
32295
32348
|
]);
|
|
@@ -32314,6 +32367,8 @@ function getStrippedTopLevelKeys(override) {
|
|
|
32314
32367
|
stripped.push("bridge");
|
|
32315
32368
|
if (override.backup !== undefined)
|
|
32316
32369
|
stripped.push("backup");
|
|
32370
|
+
if (override.index?.roots !== undefined)
|
|
32371
|
+
stripped.push("index.roots");
|
|
32317
32372
|
if (override.sandbox?.enabled === false)
|
|
32318
32373
|
stripped.push("sandbox.enabled");
|
|
32319
32374
|
if (override.sandbox?.write_allow !== undefined)
|
|
@@ -32442,7 +32497,7 @@ function loadAftConfig(projectDirectory) {
|
|
|
32442
32497
|
|
|
32443
32498
|
// src/notifications.ts
|
|
32444
32499
|
import { existsSync as existsSync11, readFileSync as readFileSync8 } from "node:fs";
|
|
32445
|
-
import { homedir as
|
|
32500
|
+
import { homedir as homedir12, platform } from "node:os";
|
|
32446
32501
|
import { join as join12 } from "node:path";
|
|
32447
32502
|
function isTuiMode() {
|
|
32448
32503
|
return process.env.OPENCODE_CLIENT === "cli";
|
|
@@ -32463,7 +32518,7 @@ var FEATURE_MARKER = `${AFT_MARKER} New in`;
|
|
|
32463
32518
|
var WARNING_MARKER = `${AFT_MARKER} ⚠️`;
|
|
32464
32519
|
function getDesktopStatePath() {
|
|
32465
32520
|
const os3 = platform();
|
|
32466
|
-
const home =
|
|
32521
|
+
const home = homedir12();
|
|
32467
32522
|
if (os3 === "darwin") {
|
|
32468
32523
|
return join12(home, "Library", "Application Support", "ai.opencode.desktop", "opencode.global.dat");
|
|
32469
32524
|
}
|
|
@@ -33000,27 +33055,27 @@ var import_comment_json3 = __toESM(require_src2(), 1);
|
|
|
33000
33055
|
// src/hooks/auto-update-checker/checker.ts
|
|
33001
33056
|
var import_comment_json2 = __toESM(require_src2(), 1);
|
|
33002
33057
|
import { existsSync as existsSync12, readFileSync as readFileSync9, statSync as statSync7, writeFileSync as writeFileSync5 } from "node:fs";
|
|
33003
|
-
import { homedir as
|
|
33004
|
-
import { dirname as dirname6, isAbsolute as
|
|
33058
|
+
import { homedir as homedir14 } from "node:os";
|
|
33059
|
+
import { dirname as dirname6, isAbsolute as isAbsolute8, join as join14, resolve as resolve9 } from "node:path";
|
|
33005
33060
|
import { fileURLToPath } from "node:url";
|
|
33006
33061
|
|
|
33007
33062
|
// src/hooks/auto-update-checker/constants.ts
|
|
33008
|
-
import { homedir as
|
|
33063
|
+
import { homedir as homedir13, platform as platform2 } from "node:os";
|
|
33009
33064
|
import { join as join13 } from "node:path";
|
|
33010
33065
|
var PACKAGE_NAME = "@cortexkit/aft-opencode";
|
|
33011
33066
|
var NPM_REGISTRY_URL = "https://registry.npmjs.org";
|
|
33012
33067
|
var NPM_FETCH_TIMEOUT = 1e4;
|
|
33013
33068
|
function getOpenCodeCacheRoot() {
|
|
33014
33069
|
if (platform2() === "win32") {
|
|
33015
|
-
return join13(process.env.LOCALAPPDATA ??
|
|
33070
|
+
return join13(process.env.LOCALAPPDATA ?? homedir13(), "opencode");
|
|
33016
33071
|
}
|
|
33017
|
-
return join13(
|
|
33072
|
+
return join13(homedir13(), ".cache", "opencode");
|
|
33018
33073
|
}
|
|
33019
33074
|
function getOpenCodeConfigRoot() {
|
|
33020
33075
|
if (platform2() === "win32") {
|
|
33021
|
-
return join13(process.env.APPDATA ?? join13(
|
|
33076
|
+
return join13(process.env.APPDATA ?? join13(homedir13(), "AppData", "Roaming"), "opencode");
|
|
33022
33077
|
}
|
|
33023
|
-
return join13(process.env.XDG_CONFIG_HOME ?? join13(
|
|
33078
|
+
return join13(process.env.XDG_CONFIG_HOME ?? join13(homedir13(), ".config"), "opencode");
|
|
33024
33079
|
}
|
|
33025
33080
|
var CACHE_DIR = join13(getOpenCodeCacheRoot(), "packages");
|
|
33026
33081
|
var USER_OPENCODE_CONFIG = join13(getOpenCodeConfigRoot(), "opencode.json");
|
|
@@ -33096,9 +33151,9 @@ function resolvePathPluginSpec(spec, configPath) {
|
|
|
33096
33151
|
return spec.replace(/^file:\/\//, "");
|
|
33097
33152
|
}
|
|
33098
33153
|
}
|
|
33099
|
-
if (
|
|
33154
|
+
if (isAbsolute8(spec) || /^[A-Za-z]:[\\/]/.test(spec))
|
|
33100
33155
|
return spec;
|
|
33101
|
-
return
|
|
33156
|
+
return resolve9(dirname6(configPath), spec);
|
|
33102
33157
|
}
|
|
33103
33158
|
function getLocalDevPath(directory) {
|
|
33104
33159
|
for (const configPath of getConfigPaths(directory)) {
|
|
@@ -33110,7 +33165,7 @@ function getLocalDevPath(directory) {
|
|
|
33110
33165
|
for (const entry of plugins) {
|
|
33111
33166
|
if (entry === PACKAGE_NAME || entry.startsWith(`${PACKAGE_NAME}@`))
|
|
33112
33167
|
continue;
|
|
33113
|
-
if (entry.startsWith("file://") || entry.startsWith(".") ||
|
|
33168
|
+
if (entry.startsWith("file://") || entry.startsWith(".") || isAbsolute8(entry)) {
|
|
33114
33169
|
const localPath = resolvePathPluginSpec(entry, configPath);
|
|
33115
33170
|
const pkgPath = findPackageJsonUp(localPath);
|
|
33116
33171
|
if (!pkgPath)
|
|
@@ -33199,7 +33254,7 @@ function getCachedVersion(spec) {
|
|
|
33199
33254
|
getCurrentRuntimePackageJsonPath(),
|
|
33200
33255
|
spec ? getSpecCachePackageJsonPath(spec) : null,
|
|
33201
33256
|
getSpecCachePackageJsonPath(`${PACKAGE_NAME}@latest`),
|
|
33202
|
-
join14(
|
|
33257
|
+
join14(homedir14(), ".cache", "opencode", "node_modules", PACKAGE_NAME, "package.json")
|
|
33203
33258
|
].filter(isString);
|
|
33204
33259
|
for (const packageJsonPath of candidates) {
|
|
33205
33260
|
try {
|
|
@@ -34317,18 +34372,18 @@ function ensureInstallAnchor(cwd) {
|
|
|
34317
34372
|
}
|
|
34318
34373
|
}
|
|
34319
34374
|
function runInstall(spec, version2, cwd, signal) {
|
|
34320
|
-
return new Promise((
|
|
34375
|
+
return new Promise((resolve10) => {
|
|
34321
34376
|
const target = `${spec.npm}@${version2}`;
|
|
34322
34377
|
log2(`[lsp] installing ${target} to ${cwd}`);
|
|
34323
34378
|
if (signal?.aborted) {
|
|
34324
34379
|
warn2(`[lsp] install ${target} aborted before spawn`);
|
|
34325
|
-
|
|
34380
|
+
resolve10(false);
|
|
34326
34381
|
return;
|
|
34327
34382
|
}
|
|
34328
34383
|
const npm = resolveNpm();
|
|
34329
34384
|
if (!npm) {
|
|
34330
34385
|
warn2(`[lsp] npm not found on PATH or known locations; cannot install ${target}`);
|
|
34331
|
-
|
|
34386
|
+
resolve10(false);
|
|
34332
34387
|
return;
|
|
34333
34388
|
}
|
|
34334
34389
|
ensureInstallAnchor(cwd);
|
|
@@ -34351,7 +34406,7 @@ function runInstall(spec, version2, cwd, signal) {
|
|
|
34351
34406
|
return;
|
|
34352
34407
|
settled = true;
|
|
34353
34408
|
cleanup();
|
|
34354
|
-
|
|
34409
|
+
resolve10(ok);
|
|
34355
34410
|
};
|
|
34356
34411
|
const onAbort = () => {
|
|
34357
34412
|
warn2(`[lsp] install ${target} aborted during shutdown`);
|
|
@@ -34452,7 +34507,7 @@ function cachedPackageDir(npmPackage) {
|
|
|
34452
34507
|
return lspBinDir(npmPackage).replace(/[\\/]node_modules[\\/]\.bin[\\/]?$/, "");
|
|
34453
34508
|
}
|
|
34454
34509
|
function hashInstalledBinary(spec) {
|
|
34455
|
-
return new Promise((
|
|
34510
|
+
return new Promise((resolve10, reject) => {
|
|
34456
34511
|
const candidates = process.platform === "win32" ? [
|
|
34457
34512
|
lspBinaryPath(spec.npm, spec.binary),
|
|
34458
34513
|
lspBinaryPath(spec.npm, `${spec.binary}.cmd`),
|
|
@@ -34476,7 +34531,7 @@ function hashInstalledBinary(spec) {
|
|
|
34476
34531
|
const stream = createReadStream(pathToHash);
|
|
34477
34532
|
stream.on("error", reject);
|
|
34478
34533
|
stream.on("data", (chunk) => hash2.update(chunk));
|
|
34479
|
-
stream.on("end", () =>
|
|
34534
|
+
stream.on("end", () => resolve10(hash2.digest("hex")));
|
|
34480
34535
|
});
|
|
34481
34536
|
}
|
|
34482
34537
|
function installedBinaryPath(spec) {
|
|
@@ -34604,7 +34659,7 @@ import {
|
|
|
34604
34659
|
unlinkSync as unlinkSync7,
|
|
34605
34660
|
writeFileSync as writeFileSync10
|
|
34606
34661
|
} from "node:fs";
|
|
34607
|
-
import { dirname as dirname9, join as join19, relative as relative3, resolve as
|
|
34662
|
+
import { dirname as dirname9, join as join19, relative as relative3, resolve as resolve10 } from "node:path";
|
|
34608
34663
|
import { Readable as Readable3 } from "node:stream";
|
|
34609
34664
|
import { pipeline as pipeline3 } from "node:stream/promises";
|
|
34610
34665
|
|
|
@@ -34761,12 +34816,12 @@ function writeGithubInstalledMetaIn(installDir, version2, binarySha256, archiveS
|
|
|
34761
34816
|
var MAX_DOWNLOAD_BYTES3 = 256 * 1024 * 1024;
|
|
34762
34817
|
var MAX_EXTRACT_BYTES2 = 1024 * 1024 * 1024;
|
|
34763
34818
|
function sha256OfFile(path3) {
|
|
34764
|
-
return new Promise((
|
|
34819
|
+
return new Promise((resolve11, reject) => {
|
|
34765
34820
|
const hash2 = createHash7("sha256");
|
|
34766
34821
|
const stream = createReadStream2(path3);
|
|
34767
34822
|
stream.on("error", reject);
|
|
34768
34823
|
stream.on("data", (chunk) => hash2.update(chunk));
|
|
34769
|
-
stream.on("end", () =>
|
|
34824
|
+
stream.on("end", () => resolve11(hash2.digest("hex")));
|
|
34770
34825
|
});
|
|
34771
34826
|
}
|
|
34772
34827
|
function sha256OfFileSync2(path3) {
|
|
@@ -35023,7 +35078,7 @@ function validateExtraction(stagingRoot) {
|
|
|
35023
35078
|
throw new Error(`failed to realpath ${full}: ${err}`);
|
|
35024
35079
|
}
|
|
35025
35080
|
const rel = relative3(realStagingRoot, realFull);
|
|
35026
|
-
if (rel.startsWith("..") ||
|
|
35081
|
+
if (rel.startsWith("..") || resolve10(realStagingRoot, rel) !== realFull) {
|
|
35027
35082
|
throw new Error(`archive entry escapes staging root: ${full} → ${realFull} (zip-slip defense)`);
|
|
35028
35083
|
}
|
|
35029
35084
|
if (lst.isDirectory()) {
|
|
@@ -35734,7 +35789,7 @@ class AftRpcServer {
|
|
|
35734
35789
|
return this.port;
|
|
35735
35790
|
}
|
|
35736
35791
|
async startNode() {
|
|
35737
|
-
return new Promise((
|
|
35792
|
+
return new Promise((resolve11, reject) => {
|
|
35738
35793
|
const server = createServer((req, res) => this.dispatch(req, res));
|
|
35739
35794
|
server.on("error", (err) => {
|
|
35740
35795
|
warn2(`RPC server error: ${err.message}`);
|
|
@@ -35749,7 +35804,7 @@ class AftRpcServer {
|
|
|
35749
35804
|
this.port = addr.port;
|
|
35750
35805
|
this.nodeServer = server;
|
|
35751
35806
|
this.afterServerStarted();
|
|
35752
|
-
|
|
35807
|
+
resolve11(this.port);
|
|
35753
35808
|
});
|
|
35754
35809
|
server.unref();
|
|
35755
35810
|
});
|
|
@@ -36123,7 +36178,8 @@ function coerceAftStatus(response) {
|
|
|
36123
36178
|
validate_on_edit: readString(features.validate_on_edit, "off"),
|
|
36124
36179
|
restrict_to_project_root: readBoolean(features.restrict_to_project_root),
|
|
36125
36180
|
search_index: readBoolean(features.search_index ?? features.experimental_search_index),
|
|
36126
|
-
semantic_search: readBoolean(features.semantic_search ?? features.experimental_semantic_search)
|
|
36181
|
+
semantic_search: readBoolean(features.semantic_search ?? features.experimental_semantic_search),
|
|
36182
|
+
callgraph_store: readBoolean(features.callgraph_store)
|
|
36127
36183
|
},
|
|
36128
36184
|
search_index: {
|
|
36129
36185
|
status: readString(searchIndex.status, "unknown"),
|
|
@@ -36170,6 +36226,15 @@ function coerceAftStatus(response) {
|
|
|
36170
36226
|
message: readString(response.message, "")
|
|
36171
36227
|
};
|
|
36172
36228
|
}
|
|
36229
|
+
function appendDegradedStatus(lines, status, markdown) {
|
|
36230
|
+
if (!status.degraded || status.degraded_reasons.length === 0)
|
|
36231
|
+
return;
|
|
36232
|
+
lines.push("", markdown ? "### Degraded mode" : "Degraded mode");
|
|
36233
|
+
for (const reason of status.degraded_reasons) {
|
|
36234
|
+
const detail = reason === "home_root" ? "project root is your home directory; heavy indexes are disabled" : reason;
|
|
36235
|
+
lines.push(`- ${detail}`);
|
|
36236
|
+
}
|
|
36237
|
+
}
|
|
36173
36238
|
function formatStatusMarkdown(status) {
|
|
36174
36239
|
const lines = [
|
|
36175
36240
|
"## AFT Status",
|
|
@@ -36177,21 +36242,10 @@ function formatStatusMarkdown(status) {
|
|
|
36177
36242
|
`- **Version:** \`${status.version}\``,
|
|
36178
36243
|
`- **Project root:** \`${status.project_root ?? "(not configured)"}\``,
|
|
36179
36244
|
`- **Canonical root:** \`${status.canonical_root ?? "(not configured)"}\``,
|
|
36180
|
-
`- **Cache role:** \`${formatCacheRoleLabel(status.cache_role)}
|
|
36181
|
-
"",
|
|
36182
|
-
"### Enabled features",
|
|
36183
|
-
`- \`format_on_edit\`: ${formatFlag(status.features.format_on_edit)}`,
|
|
36184
|
-
`- \`search_index\`: ${formatFlag(status.features.search_index)}`,
|
|
36185
|
-
`- \`semantic_search\`: ${formatFlag(status.features.semantic_search)}`,
|
|
36186
|
-
"",
|
|
36187
|
-
"### Search index",
|
|
36188
|
-
`- **Status:** \`${status.search_index.status}\``,
|
|
36189
|
-
`- **Files:** ${formatCount(status.search_index.files)}`,
|
|
36190
|
-
`- **Trigrams:** ${formatCount(status.search_index.trigrams)}`,
|
|
36191
|
-
"",
|
|
36192
|
-
"### Semantic index",
|
|
36193
|
-
`- **Status:** \`${formatSemanticIndexStatus(status.semantic_index.status, status.semantic_index.stage)}\``
|
|
36245
|
+
`- **Cache role:** \`${formatCacheRoleLabel(status.cache_role)}\``
|
|
36194
36246
|
];
|
|
36247
|
+
appendDegradedStatus(lines, status, true);
|
|
36248
|
+
lines.push("", "### Enabled features", `- \`format_on_edit\`: ${formatFlag(status.features.format_on_edit)}`, `- \`search_index\`: ${formatFlag(status.features.search_index)}`, `- \`semantic_search\`: ${formatFlag(status.features.semantic_search)}`, `- \`callgraph_store\`: ${formatFlag(status.features.callgraph_store)}`, "", "### Search index", `- **Status:** \`${status.search_index.status}\``, `- **Files:** ${formatCount(status.search_index.files)}`, `- **Trigrams:** ${formatCount(status.search_index.trigrams)}`, "", "### Semantic index", `- **Status:** \`${formatSemanticIndexStatus(status.semantic_index.status, status.semantic_index.stage)}\``);
|
|
36195
36249
|
const refreshing = formatSemanticRefreshing(status.semantic_index.refreshing_count);
|
|
36196
36250
|
if (refreshing) {
|
|
36197
36251
|
lines.push(`- **Refresh:** ${refreshing}`);
|
|
@@ -36301,8 +36355,8 @@ function installProcessHandlers() {
|
|
|
36301
36355
|
}
|
|
36302
36356
|
signalShutdownStarted = true;
|
|
36303
36357
|
process.exitCode = SIGNAL_EXIT_CODES[sig];
|
|
36304
|
-
const timeout = new Promise((
|
|
36305
|
-
setTimeout(
|
|
36358
|
+
const timeout = new Promise((resolve11) => {
|
|
36359
|
+
setTimeout(resolve11, SIGNAL_CLEANUP_TIMEOUT_MS);
|
|
36306
36360
|
});
|
|
36307
36361
|
Promise.race([runCleanups(sig), timeout]).finally(() => {
|
|
36308
36362
|
process.exit(SIGNAL_EXIT_CODES[sig]);
|
|
@@ -39709,7 +39763,7 @@ var PLUGIN_VERSION = (() => {
|
|
|
39709
39763
|
return "0.0.0";
|
|
39710
39764
|
}
|
|
39711
39765
|
})();
|
|
39712
|
-
var ANNOUNCEMENT_VERSION = "0.
|
|
39766
|
+
var ANNOUNCEMENT_VERSION = "0.53.0";
|
|
39713
39767
|
var ANNOUNCEMENT_FEATURES = [
|
|
39714
39768
|
"Callgraph stays consistent under load: edits arriving mid-rebuild can no longer be silently lost from navigation results.",
|
|
39715
39769
|
"aft_zoom handles real-world .jsonc: files with comment banners above the opening brace now resolve, and not-found errors point at the segment that actually failed (thanks @iceteaSA).",
|
package/dist/shared/status.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/shared/status.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,0BAA0B;IACzC,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,MAAM,CAAC;IACxB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,iB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
{"version":3,"file":"storage-paths.d.ts","sourceRoot":"","sources":["../../src/shared/storage-paths.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"storage-paths.d.ts","sourceRoot":"","sources":["../../src/shared/storage-paths.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cortexkit/aft-opencode",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.53.0",
|
|
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",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@clack/prompts": "^1.6.0",
|
|
37
|
-
"@cortexkit/aft-bridge": "0.
|
|
37
|
+
"@cortexkit/aft-bridge": "0.53.0",
|
|
38
38
|
"@opentui/core": "0.4.3",
|
|
39
39
|
"@opentui/solid": "0.4.3",
|
|
40
40
|
"comment-json": "^4.6.2",
|
|
@@ -43,12 +43,12 @@
|
|
|
43
43
|
"zod": "^4.4.3"
|
|
44
44
|
},
|
|
45
45
|
"optionalDependencies": {
|
|
46
|
-
"@cortexkit/aft-darwin-arm64": "0.
|
|
47
|
-
"@cortexkit/aft-darwin-x64": "0.
|
|
48
|
-
"@cortexkit/aft-linux-arm64": "0.
|
|
49
|
-
"@cortexkit/aft-linux-x64": "0.
|
|
50
|
-
"@cortexkit/aft-win32-arm64": "0.
|
|
51
|
-
"@cortexkit/aft-win32-x64": "0.
|
|
46
|
+
"@cortexkit/aft-darwin-arm64": "0.53.0",
|
|
47
|
+
"@cortexkit/aft-darwin-x64": "0.53.0",
|
|
48
|
+
"@cortexkit/aft-linux-arm64": "0.53.0",
|
|
49
|
+
"@cortexkit/aft-linux-x64": "0.53.0",
|
|
50
|
+
"@cortexkit/aft-win32-arm64": "0.53.0",
|
|
51
|
+
"@cortexkit/aft-win32-x64": "0.53.0"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@opencode-ai/plugin": "^1.17.11",
|
package/src/shared/status.ts
CHANGED
|
@@ -47,6 +47,7 @@ export interface AftStatusSnapshot {
|
|
|
47
47
|
restrict_to_project_root: boolean;
|
|
48
48
|
search_index: boolean;
|
|
49
49
|
semantic_search: boolean;
|
|
50
|
+
callgraph_store: boolean;
|
|
50
51
|
};
|
|
51
52
|
search_index: {
|
|
52
53
|
status: string;
|
|
@@ -262,6 +263,7 @@ export function coerceAftStatus(response: Record<string, unknown>): AftStatusSna
|
|
|
262
263
|
semantic_search: readBoolean(
|
|
263
264
|
features.semantic_search ?? features.experimental_semantic_search,
|
|
264
265
|
),
|
|
266
|
+
callgraph_store: readBoolean(features.callgraph_store),
|
|
265
267
|
},
|
|
266
268
|
search_index: {
|
|
267
269
|
status: readString(searchIndex.status, "unknown"),
|
|
@@ -322,11 +324,15 @@ export function formatStatusDialogMessage(status: AftStatusSnapshot): string {
|
|
|
322
324
|
`Project root: ${status.project_root ?? "(not configured)"}`,
|
|
323
325
|
`Canonical root: ${status.canonical_root ?? "(not configured)"}`,
|
|
324
326
|
`Cache role: ${formatCacheRoleLabel(status.cache_role)}`,
|
|
327
|
+
];
|
|
328
|
+
appendDegradedStatus(lines, status, false);
|
|
329
|
+
lines.push(
|
|
325
330
|
"",
|
|
326
331
|
"Enabled features",
|
|
327
332
|
`- format_on_edit: ${formatFlag(status.features.format_on_edit)}`,
|
|
328
333
|
`- search_index: ${formatFlag(status.features.search_index)}`,
|
|
329
334
|
`- semantic_search: ${formatFlag(status.features.semantic_search)}`,
|
|
335
|
+
`- callgraph_store: ${formatFlag(status.features.callgraph_store)}`,
|
|
330
336
|
"",
|
|
331
337
|
"Search index",
|
|
332
338
|
`- status: ${status.search_index.status}`,
|
|
@@ -335,7 +341,7 @@ export function formatStatusDialogMessage(status: AftStatusSnapshot): string {
|
|
|
335
341
|
"",
|
|
336
342
|
"Semantic index",
|
|
337
343
|
`- status: ${formatSemanticIndexStatus(status.semantic_index.status, status.semantic_index.stage)}`,
|
|
338
|
-
|
|
344
|
+
);
|
|
339
345
|
const refreshing = formatSemanticRefreshing(status.semantic_index.refreshing_count);
|
|
340
346
|
if (refreshing) {
|
|
341
347
|
lines.push(`- ${refreshing}`);
|
|
@@ -409,6 +415,18 @@ export function formatStatusDialogMessage(status: AftStatusSnapshot): string {
|
|
|
409
415
|
return lines.join("\n");
|
|
410
416
|
}
|
|
411
417
|
|
|
418
|
+
function appendDegradedStatus(lines: string[], status: AftStatusSnapshot, markdown: boolean): void {
|
|
419
|
+
if (!status.degraded || status.degraded_reasons.length === 0) return;
|
|
420
|
+
lines.push("", markdown ? "### Degraded mode" : "Degraded mode");
|
|
421
|
+
for (const reason of status.degraded_reasons) {
|
|
422
|
+
const detail =
|
|
423
|
+
reason === "home_root"
|
|
424
|
+
? "project root is your home directory; heavy indexes are disabled"
|
|
425
|
+
: reason;
|
|
426
|
+
lines.push(`- ${detail}`);
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
|
|
412
430
|
export function formatStatusMarkdown(status: AftStatusSnapshot): string {
|
|
413
431
|
const lines = [
|
|
414
432
|
"## AFT Status",
|
|
@@ -417,11 +435,15 @@ export function formatStatusMarkdown(status: AftStatusSnapshot): string {
|
|
|
417
435
|
`- **Project root:** \`${status.project_root ?? "(not configured)"}\``,
|
|
418
436
|
`- **Canonical root:** \`${status.canonical_root ?? "(not configured)"}\``,
|
|
419
437
|
`- **Cache role:** \`${formatCacheRoleLabel(status.cache_role)}\``,
|
|
438
|
+
];
|
|
439
|
+
appendDegradedStatus(lines, status, true);
|
|
440
|
+
lines.push(
|
|
420
441
|
"",
|
|
421
442
|
"### Enabled features",
|
|
422
443
|
`- \`format_on_edit\`: ${formatFlag(status.features.format_on_edit)}`,
|
|
423
444
|
`- \`search_index\`: ${formatFlag(status.features.search_index)}`,
|
|
424
445
|
`- \`semantic_search\`: ${formatFlag(status.features.semantic_search)}`,
|
|
446
|
+
`- \`callgraph_store\`: ${formatFlag(status.features.callgraph_store)}`,
|
|
425
447
|
"",
|
|
426
448
|
"### Search index",
|
|
427
449
|
`- **Status:** \`${status.search_index.status}\``,
|
|
@@ -430,7 +452,7 @@ export function formatStatusMarkdown(status: AftStatusSnapshot): string {
|
|
|
430
452
|
"",
|
|
431
453
|
"### Semantic index",
|
|
432
454
|
`- **Status:** \`${formatSemanticIndexStatus(status.semantic_index.status, status.semantic_index.stage)}\``,
|
|
433
|
-
|
|
455
|
+
);
|
|
434
456
|
const refreshing = formatSemanticRefreshing(status.semantic_index.refreshing_count);
|
|
435
457
|
if (refreshing) {
|
|
436
458
|
lines.push(`- **Refresh:** ${refreshing}`);
|
|
@@ -1,22 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { join } from "node:path";
|
|
3
|
-
|
|
4
|
-
function homeDir(): string {
|
|
5
|
-
if (process.platform === "win32") return process.env.USERPROFILE || process.env.HOME || homedir();
|
|
6
|
-
return process.env.HOME || homedir();
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
function dataHome(): string {
|
|
10
|
-
// Keep this in sync with the bridge package's storage migration helper,
|
|
11
|
-
// but do not import that package from TUI code: its public barrel also
|
|
12
|
-
// exports URL-fetch helpers unsuitable for Bun's TUI runtime.
|
|
13
|
-
if (process.env.XDG_DATA_HOME) return process.env.XDG_DATA_HOME;
|
|
14
|
-
if (process.platform === "win32") {
|
|
15
|
-
return process.env.LOCALAPPDATA || process.env.APPDATA || join(homeDir(), "AppData", "Local");
|
|
16
|
-
}
|
|
17
|
-
return join(homeDir(), ".local", "share");
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export function resolveCortexKitStorageRoot(): string {
|
|
21
|
-
return join(dataHome(), "cortexkit", "aft");
|
|
22
|
-
}
|
|
1
|
+
export { resolveCortexKitStorageRoot } from "@cortexkit/aft-bridge";
|
package/src/tui/index.tsx
CHANGED
|
@@ -363,6 +363,12 @@ const StatusDialog = (props: StatusDialogProps) => {
|
|
|
363
363
|
value={status()!.features.semantic_search ? "on" : "off"}
|
|
364
364
|
tone={status()!.features.semantic_search ? "ok" : "muted"}
|
|
365
365
|
/>
|
|
366
|
+
<R
|
|
367
|
+
theme={t()}
|
|
368
|
+
label="callgraph_store"
|
|
369
|
+
value={status()!.features.callgraph_store ? "on" : "off"}
|
|
370
|
+
tone={status()!.features.callgraph_store ? "ok" : "muted"}
|
|
371
|
+
/>
|
|
366
372
|
</box>
|
|
367
373
|
|
|
368
374
|
{/* Right column */}
|
package/src/tui/sidebar.tsx
CHANGED
|
@@ -244,9 +244,8 @@ export function collapsedHealthLights(statusBar: StatusBar | undefined): HealthL
|
|
|
244
244
|
return { diagnostics, code, todos };
|
|
245
245
|
}
|
|
246
246
|
|
|
247
|
-
//
|
|
248
|
-
//
|
|
249
|
-
// also exports URL-fetch helpers unsuitable for Bun's TUI runtime.
|
|
247
|
+
// Keep the TUI on the bridge's shared resolver so its root matches the
|
|
248
|
+
// configure payload used by the plugin and binary.
|
|
250
249
|
export function resolveTuiStorageDir(): string {
|
|
251
250
|
return resolveCortexKitStorageRoot();
|
|
252
251
|
}
|
|
@@ -441,6 +441,18 @@ const StatusDialog = props => {
|
|
|
441
441
|
return status().features.semantic_search ? "ok" : "muted";
|
|
442
442
|
}
|
|
443
443
|
}), null);
|
|
444
|
+
_$insert(_el$18, _$createComponent(R, {
|
|
445
|
+
get theme() {
|
|
446
|
+
return t();
|
|
447
|
+
},
|
|
448
|
+
label: "callgraph_store",
|
|
449
|
+
get value() {
|
|
450
|
+
return status().features.callgraph_store ? "on" : "off";
|
|
451
|
+
},
|
|
452
|
+
get tone() {
|
|
453
|
+
return status().features.callgraph_store ? "ok" : "muted";
|
|
454
|
+
}
|
|
455
|
+
}), null);
|
|
444
456
|
_$insertNode(_el$30, _el$31);
|
|
445
457
|
_$insertNode(_el$30, _el$34);
|
|
446
458
|
_$setProp(_el$30, "flexDirection", "column");
|
|
@@ -247,9 +247,8 @@ export function collapsedHealthLights(statusBar) {
|
|
|
247
247
|
};
|
|
248
248
|
}
|
|
249
249
|
|
|
250
|
-
//
|
|
251
|
-
//
|
|
252
|
-
// also exports URL-fetch helpers unsuitable for Bun's TUI runtime.
|
|
250
|
+
// Keep the TUI on the bridge's shared resolver so its root matches the
|
|
251
|
+
// configure payload used by the plugin and binary.
|
|
253
252
|
export function resolveTuiStorageDir() {
|
|
254
253
|
return resolveCortexKitStorageRoot();
|
|
255
254
|
}
|