@cortexkit/aft-opencode 0.52.0 → 0.52.2
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 +196 -90
- package/dist/shared/storage-paths.d.ts +1 -1
- package/dist/shared/storage-paths.d.ts.map +1 -1
- package/dist/tools/hoisted.d.ts.map +1 -1
- package/package.json +8 -8
- package/src/shared/storage-paths.ts +1 -22
- package/src/tui/sidebar.tsx +2 -3
- 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":"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"}
|
package/dist/index.js
CHANGED
|
@@ -7867,7 +7867,7 @@ function error(message, meta) {
|
|
|
7867
7867
|
}
|
|
7868
7868
|
// ../aft-bridge/dist/bash-format.js
|
|
7869
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
|
}
|
|
@@ -12087,6 +12108,8 @@ var AFT_MODULE_ID = "aft";
|
|
|
12087
12108
|
var MAX_CONSECUTIVE_TRANSPORT_FAILURES = 3;
|
|
12088
12109
|
var RECONNECT_RETRY_FLOOR_MS = 100;
|
|
12089
12110
|
var RECONNECT_RETRY_CAP_MS = 2000;
|
|
12111
|
+
var ROUTE_OPEN_RELOAD_WAIT_CAP_MS = 15000;
|
|
12112
|
+
var ROUTE_OPEN_RELOAD_WAIT_EXHAUSTED_SUFFIX = " The AFT daemon module did not return within the 15s reload window.";
|
|
12090
12113
|
var BG_STABLE_MS = 5000;
|
|
12091
12114
|
function reconnectBackoffMs(attempt) {
|
|
12092
12115
|
return Math.min(RECONNECT_RETRY_FLOOR_MS * 2 ** Math.min(attempt, 6), RECONNECT_RETRY_CAP_MS);
|
|
@@ -12395,6 +12418,15 @@ function isAbsentRootRouteError(err) {
|
|
|
12395
12418
|
function absentRootError(root) {
|
|
12396
12419
|
return new SubcError(`invalid route project root: project root does not exist: ${root}`, "config_divergence");
|
|
12397
12420
|
}
|
|
12421
|
+
function reloadWindowExhaustedError(error2) {
|
|
12422
|
+
if (error2 instanceof Error) {
|
|
12423
|
+
try {
|
|
12424
|
+
error2.message += ROUTE_OPEN_RELOAD_WAIT_EXHAUSTED_SUFFIX;
|
|
12425
|
+
return error2;
|
|
12426
|
+
} catch {}
|
|
12427
|
+
}
|
|
12428
|
+
return new Error(`${String(error2)}${ROUTE_OPEN_RELOAD_WAIT_EXHAUSTED_SUFFIX}`);
|
|
12429
|
+
}
|
|
12398
12430
|
function safeCloseRoute(client, route) {
|
|
12399
12431
|
try {
|
|
12400
12432
|
client.closeRouteChannel(route).catch(() => {
|
|
@@ -12519,6 +12551,7 @@ class SubcTransportPool {
|
|
|
12519
12551
|
connecting = null;
|
|
12520
12552
|
routeReopenRetryDelayMs = RECONNECT_RETRY_FLOOR_MS;
|
|
12521
12553
|
routeReopenRetry = null;
|
|
12554
|
+
routeReopenRetryMs = null;
|
|
12522
12555
|
sessions = new Map;
|
|
12523
12556
|
rootIndex = new Map;
|
|
12524
12557
|
dormantRoots = new Map;
|
|
@@ -12538,8 +12571,8 @@ class SubcTransportPool {
|
|
|
12538
12571
|
this.connectFn = options.connect ?? ((opts) => SubcClient.connect(opts));
|
|
12539
12572
|
this.onBgEventsNudge = options.onBgEventsNudge;
|
|
12540
12573
|
this.onBgEventsNudgeRef = options.onBgEventsNudgeRef;
|
|
12541
|
-
this.bgBackoffSleep = options.bgBackoffSleep ?? ((ms) => new Promise((
|
|
12542
|
-
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)));
|
|
12543
12576
|
this.bgDispatchProbeIntervalMs = options.bgDispatchProbeIntervalMs ?? BG_DISPATCH_PROBE_INTERVAL_MS;
|
|
12544
12577
|
const lifecycle = options.lifecycle;
|
|
12545
12578
|
const demandCheck = options.lifecycleDemandCheck ?? options.demandCheck ?? lifecycle?.demandCheck;
|
|
@@ -12992,6 +13025,23 @@ class SubcTransportPool {
|
|
|
12992
13025
|
throw error2;
|
|
12993
13026
|
}
|
|
12994
13027
|
};
|
|
13028
|
+
const openRouteAfterReloadWindow = async () => {
|
|
13029
|
+
let reloadWaitedMs = 0;
|
|
13030
|
+
while (true) {
|
|
13031
|
+
try {
|
|
13032
|
+
return await openRoute();
|
|
13033
|
+
} catch (error2) {
|
|
13034
|
+
if (!isRouteOpenReloadWindowError(error2))
|
|
13035
|
+
throw error2;
|
|
13036
|
+
const { delayMs, wait } = this.waitForRouteReopenBackoff();
|
|
13037
|
+
if (reloadWaitedMs + delayMs > ROUTE_OPEN_RELOAD_WAIT_CAP_MS) {
|
|
13038
|
+
throw reloadWindowExhaustedError(error2);
|
|
13039
|
+
}
|
|
13040
|
+
reloadWaitedMs += delayMs;
|
|
13041
|
+
await wait;
|
|
13042
|
+
}
|
|
13043
|
+
}
|
|
13044
|
+
};
|
|
12995
13045
|
const clearRouteEntry = (entry) => {
|
|
12996
13046
|
if (record.routeEntry !== entry)
|
|
12997
13047
|
return;
|
|
@@ -13028,7 +13078,7 @@ class SubcTransportPool {
|
|
|
13028
13078
|
this.ensureBgSubscription(identity, record);
|
|
13029
13079
|
return reply;
|
|
13030
13080
|
};
|
|
13031
|
-
let routeAndEntry = await
|
|
13081
|
+
let routeAndEntry = await openRouteAfterReloadWindow();
|
|
13032
13082
|
try {
|
|
13033
13083
|
return await requestOnRoute(routeAndEntry.route);
|
|
13034
13084
|
} catch (error2) {
|
|
@@ -13036,8 +13086,8 @@ class SubcTransportPool {
|
|
|
13036
13086
|
throw this.annotateReapError(error2, record);
|
|
13037
13087
|
if (isRouteProvenAbsentError(error2) && this.isCurrentSession(key, record) && this.client === client) {
|
|
13038
13088
|
clearRouteEntry(routeAndEntry.entry);
|
|
13039
|
-
await this.waitForRouteReopenBackoff();
|
|
13040
|
-
routeAndEntry = await
|
|
13089
|
+
await this.waitForRouteReopenBackoff().wait;
|
|
13090
|
+
routeAndEntry = await openRouteAfterReloadWindow();
|
|
13041
13091
|
try {
|
|
13042
13092
|
const reply = await requestOnRoute(routeAndEntry.route);
|
|
13043
13093
|
this.resetRouteReopenBackoff();
|
|
@@ -13063,17 +13113,21 @@ class SubcTransportPool {
|
|
|
13063
13113
|
}
|
|
13064
13114
|
waitForRouteReopenBackoff() {
|
|
13065
13115
|
const pending = this.routeReopenRetry;
|
|
13066
|
-
|
|
13067
|
-
|
|
13068
|
-
|
|
13069
|
-
|
|
13116
|
+
const pendingDelay = this.routeReopenRetryMs;
|
|
13117
|
+
if (pending && pendingDelay !== null)
|
|
13118
|
+
return { delayMs: pendingDelay, wait: pending };
|
|
13119
|
+
const delayMs = this.routeReopenRetryDelayMs;
|
|
13120
|
+
this.routeReopenRetryDelayMs = Math.min(delayMs * 2, RECONNECT_RETRY_CAP_MS);
|
|
13070
13121
|
let retry;
|
|
13071
|
-
retry = Promise.resolve().then(() => this.routeRetrySleep(
|
|
13072
|
-
if (this.routeReopenRetry === retry)
|
|
13122
|
+
retry = Promise.resolve().then(() => this.routeRetrySleep(delayMs)).finally(() => {
|
|
13123
|
+
if (this.routeReopenRetry === retry) {
|
|
13073
13124
|
this.routeReopenRetry = null;
|
|
13125
|
+
this.routeReopenRetryMs = null;
|
|
13126
|
+
}
|
|
13074
13127
|
});
|
|
13075
13128
|
this.routeReopenRetry = retry;
|
|
13076
|
-
|
|
13129
|
+
this.routeReopenRetryMs = delayMs;
|
|
13130
|
+
return { delayMs, wait: retry };
|
|
13077
13131
|
}
|
|
13078
13132
|
resetRouteReopenBackoff() {
|
|
13079
13133
|
this.routeReopenRetryDelayMs = RECONNECT_RETRY_FLOOR_MS;
|
|
@@ -13360,6 +13414,12 @@ function isRouteGoodbyeError(error2) {
|
|
|
13360
13414
|
}
|
|
13361
13415
|
return error2.code === "route_closed" && error2.message.includes("route closed by subc");
|
|
13362
13416
|
}
|
|
13417
|
+
function isRouteOpenReloadWindowError(error2) {
|
|
13418
|
+
if (error2 === null || typeof error2 !== "object")
|
|
13419
|
+
return false;
|
|
13420
|
+
const code = error2.code;
|
|
13421
|
+
return code === "module_reloading" || code === "module_warming" || code === "target_unavailable";
|
|
13422
|
+
}
|
|
13363
13423
|
function hasEngineResponse(error2) {
|
|
13364
13424
|
const response = error2.response;
|
|
13365
13425
|
if (response !== null && typeof response === "object")
|
|
@@ -13421,12 +13481,12 @@ function stripJsoncSymbols(value) {
|
|
|
13421
13481
|
import { spawnSync as spawnSync2 } from "node:child_process";
|
|
13422
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";
|
|
13423
13483
|
import { homedir as homedir7, tmpdir } from "node:os";
|
|
13424
|
-
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";
|
|
13425
13485
|
|
|
13426
13486
|
// ../aft-bridge/dist/paths.js
|
|
13427
13487
|
import { existsSync as existsSync4, mkdirSync as mkdirSync2, readFileSync as readFileSync4, renameSync as renameSync2, writeFileSync } from "node:fs";
|
|
13428
13488
|
import { homedir as homedir5 } from "node:os";
|
|
13429
|
-
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";
|
|
13430
13490
|
function homeDir3() {
|
|
13431
13491
|
if (process.platform === "win32")
|
|
13432
13492
|
return process.env.USERPROFILE || process.env.HOME || homedir5();
|
|
@@ -13441,7 +13501,7 @@ function configHome() {
|
|
|
13441
13501
|
function legacyOpenCodeConfigDir() {
|
|
13442
13502
|
const envDir = process.env.OPENCODE_CONFIG_DIR?.trim();
|
|
13443
13503
|
if (envDir)
|
|
13444
|
-
return
|
|
13504
|
+
return resolve5(envDir);
|
|
13445
13505
|
return join6(configHome(), "opencode");
|
|
13446
13506
|
}
|
|
13447
13507
|
function legacyPiAgentDir() {
|
|
@@ -13684,7 +13744,16 @@ function platformKey(platform = process.platform, arch = process.arch) {
|
|
|
13684
13744
|
}
|
|
13685
13745
|
return key;
|
|
13686
13746
|
}
|
|
13747
|
+
function logBinaryResolution(resolution) {
|
|
13748
|
+
log(`Resolved binary from ${resolution.source}: ${resolution.path}`);
|
|
13749
|
+
}
|
|
13687
13750
|
function findBinarySync(expectedVersion) {
|
|
13751
|
+
const resolution = findBinarySyncInner(expectedVersion);
|
|
13752
|
+
if (resolution)
|
|
13753
|
+
logBinaryResolution(resolution);
|
|
13754
|
+
return resolution?.path ?? null;
|
|
13755
|
+
}
|
|
13756
|
+
function findBinarySyncInner(expectedVersion) {
|
|
13688
13757
|
const ext = process.platform === "win32" ? ".exe" : "";
|
|
13689
13758
|
const env = { ...process.env };
|
|
13690
13759
|
const pluginVersion = expectedVersion ?? (() => {
|
|
@@ -13698,8 +13767,9 @@ function findBinarySync(expectedVersion) {
|
|
|
13698
13767
|
if (pluginVersion) {
|
|
13699
13768
|
const tag = pluginVersion.startsWith("v") ? pluginVersion : `v${pluginVersion}`;
|
|
13700
13769
|
const versionCached = cachedBinaryPathFromEnv(tag, env, ext);
|
|
13701
|
-
if (versionCached && isExpectedCachedBinary2(versionCached, pluginVersion))
|
|
13702
|
-
return versionCached;
|
|
13770
|
+
if (versionCached && isExpectedCachedBinary2(versionCached, pluginVersion)) {
|
|
13771
|
+
return { path: versionCached, source: "versioned cache" };
|
|
13772
|
+
}
|
|
13703
13773
|
}
|
|
13704
13774
|
try {
|
|
13705
13775
|
const key = platformKey();
|
|
@@ -13714,7 +13784,7 @@ function findBinarySync(expectedVersion) {
|
|
|
13714
13784
|
warn(`npm platform package binary v${npmVersion} does not match plugin v${pluginVersion}; skipping (continuing to PATH lookup)`);
|
|
13715
13785
|
} else {
|
|
13716
13786
|
const copied = copyToVersionedCache(resolved, npmVersion);
|
|
13717
|
-
return copied ?? resolved;
|
|
13787
|
+
return { path: copied ?? resolved, source: "npm platform package" };
|
|
13718
13788
|
}
|
|
13719
13789
|
}
|
|
13720
13790
|
} catch {}
|
|
@@ -13732,27 +13802,28 @@ function findBinarySync(expectedVersion) {
|
|
|
13732
13802
|
}
|
|
13733
13803
|
const usable = probeBinaryCandidate(candidate, "PATH", expectedVersion);
|
|
13734
13804
|
if (usable)
|
|
13735
|
-
return usable;
|
|
13805
|
+
return { path: usable, source: "PATH" };
|
|
13736
13806
|
}
|
|
13737
13807
|
} catch {}
|
|
13738
13808
|
const cargoPath = join7(homeDirFromEnv(env), ".cargo", "bin", `aft${ext}`);
|
|
13739
13809
|
if (existsSync5(cargoPath)) {
|
|
13740
13810
|
const usable = probeBinaryCandidate(cargoPath, "cargo", expectedVersion);
|
|
13741
13811
|
if (usable)
|
|
13742
|
-
return usable;
|
|
13812
|
+
return { path: usable, source: "cargo" };
|
|
13743
13813
|
}
|
|
13744
13814
|
return null;
|
|
13745
13815
|
}
|
|
13746
13816
|
async function findBinary(expectedVersion) {
|
|
13747
13817
|
const syncResult = findBinarySync(expectedVersion);
|
|
13748
13818
|
if (syncResult) {
|
|
13749
|
-
log(`Resolved binary: ${syncResult}`);
|
|
13750
13819
|
return syncResult;
|
|
13751
13820
|
}
|
|
13752
13821
|
log("Binary not found locally, attempting auto-download...");
|
|
13753
13822
|
const downloaded = await ensureBinaryForResolver(expectedVersion);
|
|
13754
|
-
if (downloaded)
|
|
13823
|
+
if (downloaded) {
|
|
13824
|
+
logBinaryResolution({ path: downloaded, source: "auto-download" });
|
|
13755
13825
|
return downloaded;
|
|
13826
|
+
}
|
|
13756
13827
|
throw new Error([
|
|
13757
13828
|
"Could not find the `aft` binary.",
|
|
13758
13829
|
"",
|
|
@@ -13795,9 +13866,6 @@ function resolveLegacyStorageRoot(harness) {
|
|
|
13795
13866
|
return join8(homeDir4(), ".pi", "agent", "aft");
|
|
13796
13867
|
return join8(dataHome2(), "opencode", "storage", "plugin", "aft");
|
|
13797
13868
|
}
|
|
13798
|
-
function resolveCortexKitStorageRoot() {
|
|
13799
|
-
return join8(dataHome2(), "cortexkit", "aft");
|
|
13800
|
-
}
|
|
13801
13869
|
function stripJsoncForParse(input) {
|
|
13802
13870
|
let out = "";
|
|
13803
13871
|
let inString = false;
|
|
@@ -14067,8 +14135,8 @@ function visibleConfigMigrationWarning(scope, targetPath, paths, reason) {
|
|
|
14067
14135
|
}
|
|
14068
14136
|
function migrateAftConfigFile(opts) {
|
|
14069
14137
|
const warnings = [];
|
|
14070
|
-
const resolvedTarget =
|
|
14071
|
-
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);
|
|
14072
14140
|
const info = opts.logger?.info ?? opts.logger?.log;
|
|
14073
14141
|
if (existingSources.length === 0) {
|
|
14074
14142
|
return { migrated: false, conflict: false, targetPath: opts.targetPath, warnings };
|
|
@@ -14317,7 +14385,7 @@ function isNpmAvailable(deps = defaultDeps()) {
|
|
|
14317
14385
|
import { execFileSync } from "node:child_process";
|
|
14318
14386
|
import { createHash as createHash4 } from "node:crypto";
|
|
14319
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";
|
|
14320
|
-
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";
|
|
14321
14389
|
import { Readable as Readable2 } from "node:stream";
|
|
14322
14390
|
import { pipeline as pipeline2 } from "node:stream/promises";
|
|
14323
14391
|
var ORT_VERSION = "1.24.4";
|
|
@@ -14625,7 +14693,7 @@ function findSystemOnnxRuntime(libName) {
|
|
|
14625
14693
|
const normalizeCase = process.platform === "win32" || process.platform === "darwin";
|
|
14626
14694
|
const seen = new Set;
|
|
14627
14695
|
const uniquePaths = searchPaths.filter((p) => {
|
|
14628
|
-
let key =
|
|
14696
|
+
let key = resolve7(p).replace(/[/\\]+$/, "");
|
|
14629
14697
|
if (normalizeCase)
|
|
14630
14698
|
key = key.toLowerCase();
|
|
14631
14699
|
if (seen.has(key))
|
|
@@ -14709,7 +14777,7 @@ function validateExtractedTree(stagingRoot) {
|
|
|
14709
14777
|
const lst = lstatSync(fullPath);
|
|
14710
14778
|
if (lst.isSymbolicLink()) {
|
|
14711
14779
|
const linkTarget = readlinkSync(fullPath);
|
|
14712
|
-
const resolvedTarget =
|
|
14780
|
+
const resolvedTarget = resolve7(dirname5(fullPath), linkTarget);
|
|
14713
14781
|
const rel2 = relative2(realRoot, resolvedTarget);
|
|
14714
14782
|
if (rel2.startsWith("..") || isAbsolute4(rel2) || win32.isAbsolute(rel2)) {
|
|
14715
14783
|
throw new Error(`extracted symlink ${fullPath} points outside staging root: ${linkTarget}`);
|
|
@@ -14827,7 +14895,7 @@ function copyOnnxLibraries(info, extractedDir, targetDir, realFiles, symlinks, c
|
|
|
14827
14895
|
unlinkSync4(dst);
|
|
14828
14896
|
} catch {}
|
|
14829
14897
|
const dstForContainment = join10(targetRoot, link.name);
|
|
14830
|
-
const resolvedTarget =
|
|
14898
|
+
const resolvedTarget = resolve7(dirname5(dstForContainment), link.target);
|
|
14831
14899
|
if (!isPathInsideRoot(targetRoot, resolvedTarget)) {
|
|
14832
14900
|
const message = `ONNX Runtime symlink ${link.name} points outside install dir: ${link.target}`;
|
|
14833
14901
|
if (requiredLibs.has(link.name)) {
|
|
@@ -15876,7 +15944,7 @@ class RevivableTransportPool {
|
|
|
15876
15944
|
const delay = Math.max(0, this.revivalRetryNotBefore - Date.now());
|
|
15877
15945
|
if (delay > 0) {
|
|
15878
15946
|
let scheduled;
|
|
15879
|
-
scheduled = new Promise((
|
|
15947
|
+
scheduled = new Promise((resolve8) => setTimeout(resolve8, delay)).then(() => {
|
|
15880
15948
|
if (this.revival === scheduled)
|
|
15881
15949
|
this.revival = null;
|
|
15882
15950
|
return this.ensureActivePool();
|
|
@@ -17389,7 +17457,8 @@ async function signalBashWaitDetachForProject(pool, projectRoot, sessionID) {
|
|
|
17389
17457
|
|
|
17390
17458
|
// src/config.ts
|
|
17391
17459
|
import { existsSync as existsSync10, readFileSync as readFileSync7, renameSync as renameSync5, unlinkSync as unlinkSync5, writeFileSync as writeFileSync4 } from "node:fs";
|
|
17392
|
-
import {
|
|
17460
|
+
import { homedir as homedir11 } from "node:os";
|
|
17461
|
+
import { isAbsolute as isAbsolute7, parse as parsePath, resolve as resolvePath } from "node:path";
|
|
17393
17462
|
var import_comment_json = __toESM(require_src2(), 1);
|
|
17394
17463
|
|
|
17395
17464
|
// ../../node_modules/.bun/zod@4.4.3/node_modules/zod/v4/classic/external.js
|
|
@@ -31694,6 +31763,32 @@ var CheckerEnum = exports_external.enum([
|
|
|
31694
31763
|
]);
|
|
31695
31764
|
var ConfigureWarningsDeliveryEnum = exports_external.enum(["toast", "log", "chat"]);
|
|
31696
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
|
+
});
|
|
31697
31792
|
var SemanticConfigSchema = exports_external.object({
|
|
31698
31793
|
backend: SemanticBackendEnum.optional(),
|
|
31699
31794
|
model: exports_external.string().trim().min(1).optional(),
|
|
@@ -31760,7 +31855,12 @@ var SubcConfigSchema = exports_external.object({
|
|
|
31760
31855
|
client_reaper: exports_external.boolean().optional()
|
|
31761
31856
|
});
|
|
31762
31857
|
var GhShimConfigSchema = exports_external.object({
|
|
31763
|
-
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()
|
|
31764
31864
|
});
|
|
31765
31865
|
var DEFAULT_INSPECT_DIAGNOSTICS_TIMEOUT_MS = 120000;
|
|
31766
31866
|
var MIN_INSPECT_DIAGNOSTICS_TIMEOUT_MS = 1e4;
|
|
@@ -31802,6 +31902,7 @@ var AftConfigSchema = exports_external.preprocess((value) => stripHarnessSpecifi
|
|
|
31802
31902
|
disabled_tools: exports_external.array(exports_external.string()).optional(),
|
|
31803
31903
|
restrict_to_project_root: exports_external.boolean().optional(),
|
|
31804
31904
|
search_index: exports_external.boolean().optional(),
|
|
31905
|
+
index: IndexConfigSchema.optional(),
|
|
31805
31906
|
semantic_search: exports_external.boolean().optional(),
|
|
31806
31907
|
callgraph_store: exports_external.boolean().optional(),
|
|
31807
31908
|
callgraph_chunk_size: exports_external.number().optional(),
|
|
@@ -31817,7 +31918,8 @@ var AftConfigSchema = exports_external.preprocess((value) => stripHarnessSpecifi
|
|
|
31817
31918
|
auto_update: exports_external.boolean().optional(),
|
|
31818
31919
|
bridge: BridgeConfigSchema.optional(),
|
|
31819
31920
|
subc: SubcConfigSchema.optional(),
|
|
31820
|
-
gh_shim: GhShimConfigSchema.optional()
|
|
31921
|
+
gh_shim: GhShimConfigSchema.optional(),
|
|
31922
|
+
git: GitConfigSchema.optional()
|
|
31821
31923
|
}).strict());
|
|
31822
31924
|
function resolveInspectDiagnosticsTimeoutMs(config2) {
|
|
31823
31925
|
return clampInspectDiagnosticsTimeoutMs(config2.inspect?.diagnostics_timeout_ms ?? DEFAULT_INSPECT_DIAGNOSTICS_TIMEOUT_MS);
|
|
@@ -32240,6 +32342,7 @@ var PROJECT_SAFE_TOP_LEVEL_FIELDS = new Set([
|
|
|
32240
32342
|
"callgraph_chunk_size",
|
|
32241
32343
|
"inspect",
|
|
32242
32344
|
"worktree",
|
|
32345
|
+
"git",
|
|
32243
32346
|
"experimental",
|
|
32244
32347
|
"bash"
|
|
32245
32348
|
]);
|
|
@@ -32264,6 +32367,8 @@ function getStrippedTopLevelKeys(override) {
|
|
|
32264
32367
|
stripped.push("bridge");
|
|
32265
32368
|
if (override.backup !== undefined)
|
|
32266
32369
|
stripped.push("backup");
|
|
32370
|
+
if (override.index?.roots !== undefined)
|
|
32371
|
+
stripped.push("index.roots");
|
|
32267
32372
|
if (override.sandbox?.enabled === false)
|
|
32268
32373
|
stripped.push("sandbox.enabled");
|
|
32269
32374
|
if (override.sandbox?.write_allow !== undefined)
|
|
@@ -32392,7 +32497,7 @@ function loadAftConfig(projectDirectory) {
|
|
|
32392
32497
|
|
|
32393
32498
|
// src/notifications.ts
|
|
32394
32499
|
import { existsSync as existsSync11, readFileSync as readFileSync8 } from "node:fs";
|
|
32395
|
-
import { homedir as
|
|
32500
|
+
import { homedir as homedir12, platform } from "node:os";
|
|
32396
32501
|
import { join as join12 } from "node:path";
|
|
32397
32502
|
function isTuiMode() {
|
|
32398
32503
|
return process.env.OPENCODE_CLIENT === "cli";
|
|
@@ -32413,7 +32518,7 @@ var FEATURE_MARKER = `${AFT_MARKER} New in`;
|
|
|
32413
32518
|
var WARNING_MARKER = `${AFT_MARKER} ⚠️`;
|
|
32414
32519
|
function getDesktopStatePath() {
|
|
32415
32520
|
const os3 = platform();
|
|
32416
|
-
const home =
|
|
32521
|
+
const home = homedir12();
|
|
32417
32522
|
if (os3 === "darwin") {
|
|
32418
32523
|
return join12(home, "Library", "Application Support", "ai.opencode.desktop", "opencode.global.dat");
|
|
32419
32524
|
}
|
|
@@ -32950,27 +33055,27 @@ var import_comment_json3 = __toESM(require_src2(), 1);
|
|
|
32950
33055
|
// src/hooks/auto-update-checker/checker.ts
|
|
32951
33056
|
var import_comment_json2 = __toESM(require_src2(), 1);
|
|
32952
33057
|
import { existsSync as existsSync12, readFileSync as readFileSync9, statSync as statSync7, writeFileSync as writeFileSync5 } from "node:fs";
|
|
32953
|
-
import { homedir as
|
|
32954
|
-
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";
|
|
32955
33060
|
import { fileURLToPath } from "node:url";
|
|
32956
33061
|
|
|
32957
33062
|
// src/hooks/auto-update-checker/constants.ts
|
|
32958
|
-
import { homedir as
|
|
33063
|
+
import { homedir as homedir13, platform as platform2 } from "node:os";
|
|
32959
33064
|
import { join as join13 } from "node:path";
|
|
32960
33065
|
var PACKAGE_NAME = "@cortexkit/aft-opencode";
|
|
32961
33066
|
var NPM_REGISTRY_URL = "https://registry.npmjs.org";
|
|
32962
33067
|
var NPM_FETCH_TIMEOUT = 1e4;
|
|
32963
33068
|
function getOpenCodeCacheRoot() {
|
|
32964
33069
|
if (platform2() === "win32") {
|
|
32965
|
-
return join13(process.env.LOCALAPPDATA ??
|
|
33070
|
+
return join13(process.env.LOCALAPPDATA ?? homedir13(), "opencode");
|
|
32966
33071
|
}
|
|
32967
|
-
return join13(
|
|
33072
|
+
return join13(homedir13(), ".cache", "opencode");
|
|
32968
33073
|
}
|
|
32969
33074
|
function getOpenCodeConfigRoot() {
|
|
32970
33075
|
if (platform2() === "win32") {
|
|
32971
|
-
return join13(process.env.APPDATA ?? join13(
|
|
33076
|
+
return join13(process.env.APPDATA ?? join13(homedir13(), "AppData", "Roaming"), "opencode");
|
|
32972
33077
|
}
|
|
32973
|
-
return join13(process.env.XDG_CONFIG_HOME ?? join13(
|
|
33078
|
+
return join13(process.env.XDG_CONFIG_HOME ?? join13(homedir13(), ".config"), "opencode");
|
|
32974
33079
|
}
|
|
32975
33080
|
var CACHE_DIR = join13(getOpenCodeCacheRoot(), "packages");
|
|
32976
33081
|
var USER_OPENCODE_CONFIG = join13(getOpenCodeConfigRoot(), "opencode.json");
|
|
@@ -33046,9 +33151,9 @@ function resolvePathPluginSpec(spec, configPath) {
|
|
|
33046
33151
|
return spec.replace(/^file:\/\//, "");
|
|
33047
33152
|
}
|
|
33048
33153
|
}
|
|
33049
|
-
if (
|
|
33154
|
+
if (isAbsolute8(spec) || /^[A-Za-z]:[\\/]/.test(spec))
|
|
33050
33155
|
return spec;
|
|
33051
|
-
return
|
|
33156
|
+
return resolve9(dirname6(configPath), spec);
|
|
33052
33157
|
}
|
|
33053
33158
|
function getLocalDevPath(directory) {
|
|
33054
33159
|
for (const configPath of getConfigPaths(directory)) {
|
|
@@ -33060,7 +33165,7 @@ function getLocalDevPath(directory) {
|
|
|
33060
33165
|
for (const entry of plugins) {
|
|
33061
33166
|
if (entry === PACKAGE_NAME || entry.startsWith(`${PACKAGE_NAME}@`))
|
|
33062
33167
|
continue;
|
|
33063
|
-
if (entry.startsWith("file://") || entry.startsWith(".") ||
|
|
33168
|
+
if (entry.startsWith("file://") || entry.startsWith(".") || isAbsolute8(entry)) {
|
|
33064
33169
|
const localPath = resolvePathPluginSpec(entry, configPath);
|
|
33065
33170
|
const pkgPath = findPackageJsonUp(localPath);
|
|
33066
33171
|
if (!pkgPath)
|
|
@@ -33149,7 +33254,7 @@ function getCachedVersion(spec) {
|
|
|
33149
33254
|
getCurrentRuntimePackageJsonPath(),
|
|
33150
33255
|
spec ? getSpecCachePackageJsonPath(spec) : null,
|
|
33151
33256
|
getSpecCachePackageJsonPath(`${PACKAGE_NAME}@latest`),
|
|
33152
|
-
join14(
|
|
33257
|
+
join14(homedir14(), ".cache", "opencode", "node_modules", PACKAGE_NAME, "package.json")
|
|
33153
33258
|
].filter(isString);
|
|
33154
33259
|
for (const packageJsonPath of candidates) {
|
|
33155
33260
|
try {
|
|
@@ -34267,18 +34372,18 @@ function ensureInstallAnchor(cwd) {
|
|
|
34267
34372
|
}
|
|
34268
34373
|
}
|
|
34269
34374
|
function runInstall(spec, version2, cwd, signal) {
|
|
34270
|
-
return new Promise((
|
|
34375
|
+
return new Promise((resolve10) => {
|
|
34271
34376
|
const target = `${spec.npm}@${version2}`;
|
|
34272
34377
|
log2(`[lsp] installing ${target} to ${cwd}`);
|
|
34273
34378
|
if (signal?.aborted) {
|
|
34274
34379
|
warn2(`[lsp] install ${target} aborted before spawn`);
|
|
34275
|
-
|
|
34380
|
+
resolve10(false);
|
|
34276
34381
|
return;
|
|
34277
34382
|
}
|
|
34278
34383
|
const npm = resolveNpm();
|
|
34279
34384
|
if (!npm) {
|
|
34280
34385
|
warn2(`[lsp] npm not found on PATH or known locations; cannot install ${target}`);
|
|
34281
|
-
|
|
34386
|
+
resolve10(false);
|
|
34282
34387
|
return;
|
|
34283
34388
|
}
|
|
34284
34389
|
ensureInstallAnchor(cwd);
|
|
@@ -34301,7 +34406,7 @@ function runInstall(spec, version2, cwd, signal) {
|
|
|
34301
34406
|
return;
|
|
34302
34407
|
settled = true;
|
|
34303
34408
|
cleanup();
|
|
34304
|
-
|
|
34409
|
+
resolve10(ok);
|
|
34305
34410
|
};
|
|
34306
34411
|
const onAbort = () => {
|
|
34307
34412
|
warn2(`[lsp] install ${target} aborted during shutdown`);
|
|
@@ -34402,7 +34507,7 @@ function cachedPackageDir(npmPackage) {
|
|
|
34402
34507
|
return lspBinDir(npmPackage).replace(/[\\/]node_modules[\\/]\.bin[\\/]?$/, "");
|
|
34403
34508
|
}
|
|
34404
34509
|
function hashInstalledBinary(spec) {
|
|
34405
|
-
return new Promise((
|
|
34510
|
+
return new Promise((resolve10, reject) => {
|
|
34406
34511
|
const candidates = process.platform === "win32" ? [
|
|
34407
34512
|
lspBinaryPath(spec.npm, spec.binary),
|
|
34408
34513
|
lspBinaryPath(spec.npm, `${spec.binary}.cmd`),
|
|
@@ -34426,7 +34531,7 @@ function hashInstalledBinary(spec) {
|
|
|
34426
34531
|
const stream = createReadStream(pathToHash);
|
|
34427
34532
|
stream.on("error", reject);
|
|
34428
34533
|
stream.on("data", (chunk) => hash2.update(chunk));
|
|
34429
|
-
stream.on("end", () =>
|
|
34534
|
+
stream.on("end", () => resolve10(hash2.digest("hex")));
|
|
34430
34535
|
});
|
|
34431
34536
|
}
|
|
34432
34537
|
function installedBinaryPath(spec) {
|
|
@@ -34554,7 +34659,7 @@ import {
|
|
|
34554
34659
|
unlinkSync as unlinkSync7,
|
|
34555
34660
|
writeFileSync as writeFileSync10
|
|
34556
34661
|
} from "node:fs";
|
|
34557
|
-
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";
|
|
34558
34663
|
import { Readable as Readable3 } from "node:stream";
|
|
34559
34664
|
import { pipeline as pipeline3 } from "node:stream/promises";
|
|
34560
34665
|
|
|
@@ -34711,12 +34816,12 @@ function writeGithubInstalledMetaIn(installDir, version2, binarySha256, archiveS
|
|
|
34711
34816
|
var MAX_DOWNLOAD_BYTES3 = 256 * 1024 * 1024;
|
|
34712
34817
|
var MAX_EXTRACT_BYTES2 = 1024 * 1024 * 1024;
|
|
34713
34818
|
function sha256OfFile(path3) {
|
|
34714
|
-
return new Promise((
|
|
34819
|
+
return new Promise((resolve11, reject) => {
|
|
34715
34820
|
const hash2 = createHash7("sha256");
|
|
34716
34821
|
const stream = createReadStream2(path3);
|
|
34717
34822
|
stream.on("error", reject);
|
|
34718
34823
|
stream.on("data", (chunk) => hash2.update(chunk));
|
|
34719
|
-
stream.on("end", () =>
|
|
34824
|
+
stream.on("end", () => resolve11(hash2.digest("hex")));
|
|
34720
34825
|
});
|
|
34721
34826
|
}
|
|
34722
34827
|
function sha256OfFileSync2(path3) {
|
|
@@ -34973,7 +35078,7 @@ function validateExtraction(stagingRoot) {
|
|
|
34973
35078
|
throw new Error(`failed to realpath ${full}: ${err}`);
|
|
34974
35079
|
}
|
|
34975
35080
|
const rel = relative3(realStagingRoot, realFull);
|
|
34976
|
-
if (rel.startsWith("..") ||
|
|
35081
|
+
if (rel.startsWith("..") || resolve10(realStagingRoot, rel) !== realFull) {
|
|
34977
35082
|
throw new Error(`archive entry escapes staging root: ${full} → ${realFull} (zip-slip defense)`);
|
|
34978
35083
|
}
|
|
34979
35084
|
if (lst.isDirectory()) {
|
|
@@ -35684,7 +35789,7 @@ class AftRpcServer {
|
|
|
35684
35789
|
return this.port;
|
|
35685
35790
|
}
|
|
35686
35791
|
async startNode() {
|
|
35687
|
-
return new Promise((
|
|
35792
|
+
return new Promise((resolve11, reject) => {
|
|
35688
35793
|
const server = createServer((req, res) => this.dispatch(req, res));
|
|
35689
35794
|
server.on("error", (err) => {
|
|
35690
35795
|
warn2(`RPC server error: ${err.message}`);
|
|
@@ -35699,7 +35804,7 @@ class AftRpcServer {
|
|
|
35699
35804
|
this.port = addr.port;
|
|
35700
35805
|
this.nodeServer = server;
|
|
35701
35806
|
this.afterServerStarted();
|
|
35702
|
-
|
|
35807
|
+
resolve11(this.port);
|
|
35703
35808
|
});
|
|
35704
35809
|
server.unref();
|
|
35705
35810
|
});
|
|
@@ -36251,8 +36356,8 @@ function installProcessHandlers() {
|
|
|
36251
36356
|
}
|
|
36252
36357
|
signalShutdownStarted = true;
|
|
36253
36358
|
process.exitCode = SIGNAL_EXIT_CODES[sig];
|
|
36254
|
-
const timeout = new Promise((
|
|
36255
|
-
setTimeout(
|
|
36359
|
+
const timeout = new Promise((resolve11) => {
|
|
36360
|
+
setTimeout(resolve11, SIGNAL_CLEANUP_TIMEOUT_MS);
|
|
36256
36361
|
});
|
|
36257
36362
|
Promise.race([runCleanups(sig), timeout]).finally(() => {
|
|
36258
36363
|
process.exit(SIGNAL_EXIT_CODES[sig]);
|
|
@@ -37984,6 +38089,7 @@ var HASHLINE_EDIT_DESCRIPTION = [
|
|
|
37984
38089
|
"",
|
|
37985
38090
|
"Quick reference:",
|
|
37986
38091
|
"- Header: `[path#TAG]`; TAG is exactly four hexadecimal digits from a current tagged read. Read every addressed row and gap boundary; REM and MV require a whole-file tagged read. Re-read after an edit before chaining: an edit-response tag can retain only changed context.",
|
|
38092
|
+
"- Same canonical path: multiple sections compose in patch order against pre-request coordinates.",
|
|
37987
38093
|
"- Addresses: `0` (BOF), `N` (one line), `N.=M` (range; `N..=M`/`N..M` also work), `<N`/`>N` (gap before/after), `N*`/`<N*`/`>N*` (block), and `$`/`$-K` (EOF-relative). A plain `N` PUT replaces; use `<N` or `>N` to insert.",
|
|
37988
38094
|
"- PUT text: `PUT <address>:` followed by one or more `+` body rows (`+` alone is blank). A final patch newline is allowed. PUT without `:` copies `@name` (or the anonymous register) and takes no body; names use `@` plus ASCII letters, digits, `_`, or `-`.",
|
|
37989
38095
|
"- CUT: `CUT <address> [@name]`. REM: bare `REM` only, removing the whole file. MV: `MV <destination>` (one whitespace-free path, optional matching quotes), once and after any line operations. `*** Begin Patch`/`*** End Patch` is an optional envelope."
|
|
@@ -39658,7 +39764,7 @@ var PLUGIN_VERSION = (() => {
|
|
|
39658
39764
|
return "0.0.0";
|
|
39659
39765
|
}
|
|
39660
39766
|
})();
|
|
39661
|
-
var ANNOUNCEMENT_VERSION = "0.52.
|
|
39767
|
+
var ANNOUNCEMENT_VERSION = "0.52.2";
|
|
39662
39768
|
var ANNOUNCEMENT_FEATURES = [
|
|
39663
39769
|
"Callgraph stays consistent under load: edits arriving mid-rebuild can no longer be silently lost from navigation results.",
|
|
39664
39770
|
"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).",
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { resolveCortexKitStorageRoot } from "@cortexkit/aft-bridge";
|
|
2
2
|
//# sourceMappingURL=storage-paths.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hoisted.d.ts","sourceRoot":"","sources":["../../src/tools/hoisted.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,KAAK,EAAe,cAAc,EAAc,MAAM,qBAAqB,CAAC;AAInF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAiDjD,wEAAwE;AACxE,eAAO,MAAM,wBAAwB,GAAI,IAAI,MAAM,EAAE,QAAQ,MAAM,EAAE,OAAO,MAAM,KAAG,MAChD,CAAC;AA+OtC;;GAEG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,aAAa,GAAG,cAAc,CAoIjE;
|
|
1
|
+
{"version":3,"file":"hoisted.d.ts","sourceRoot":"","sources":["../../src/tools/hoisted.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,KAAK,EAAe,cAAc,EAAc,MAAM,qBAAqB,CAAC;AAInF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAiDjD,wEAAwE;AACxE,eAAO,MAAM,wBAAwB,GAAI,IAAI,MAAM,EAAE,QAAQ,MAAM,EAAE,OAAO,MAAM,KAAG,MAChD,CAAC;AA+OtC;;GAEG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,aAAa,GAAG,cAAc,CAoIjE;AAmrBD;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CA0B/E;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CA4BnF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cortexkit/aft-opencode",
|
|
3
|
-
"version": "0.52.
|
|
3
|
+
"version": "0.52.2",
|
|
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.52.
|
|
37
|
+
"@cortexkit/aft-bridge": "0.52.2",
|
|
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.52.
|
|
47
|
-
"@cortexkit/aft-darwin-x64": "0.52.
|
|
48
|
-
"@cortexkit/aft-linux-arm64": "0.52.
|
|
49
|
-
"@cortexkit/aft-linux-x64": "0.52.
|
|
50
|
-
"@cortexkit/aft-win32-arm64": "0.52.
|
|
51
|
-
"@cortexkit/aft-win32-x64": "0.52.
|
|
46
|
+
"@cortexkit/aft-darwin-arm64": "0.52.2",
|
|
47
|
+
"@cortexkit/aft-darwin-x64": "0.52.2",
|
|
48
|
+
"@cortexkit/aft-linux-arm64": "0.52.2",
|
|
49
|
+
"@cortexkit/aft-linux-x64": "0.52.2",
|
|
50
|
+
"@cortexkit/aft-win32-arm64": "0.52.2",
|
|
51
|
+
"@cortexkit/aft-win32-x64": "0.52.2"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@opencode-ai/plugin": "^1.17.11",
|
|
@@ -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/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
|
}
|
|
@@ -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
|
}
|