@cortexkit/aft-opencode 0.47.0 → 0.47.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/hooks/auto-update-checker/index.d.ts +17 -0
- package/dist/hooks/auto-update-checker/index.d.ts.map +1 -1
- package/dist/index.js +199 -62
- package/dist/shared/status.d.ts +5 -0
- package/dist/shared/status.d.ts.map +1 -1
- package/dist/tools/_shared.d.ts +4 -3
- package/dist/tools/_shared.d.ts.map +1 -1
- package/dist/tools/bash_watch.d.ts +1 -0
- package/dist/tools/bash_watch.d.ts.map +1 -1
- package/dist/tools/permissions.d.ts.map +1 -1
- package/package.json +8 -8
- package/src/shared/status.ts +11 -0
|
@@ -4,6 +4,9 @@ type OpenCodeEvent = {
|
|
|
4
4
|
type: string;
|
|
5
5
|
properties?: unknown;
|
|
6
6
|
};
|
|
7
|
+
type CheckSlotLock = {
|
|
8
|
+
release: () => void;
|
|
9
|
+
};
|
|
7
10
|
/**
|
|
8
11
|
* Auto-update checker.
|
|
9
12
|
*
|
|
@@ -35,6 +38,20 @@ type OpenCodeEvent = {
|
|
|
35
38
|
export declare function createAutoUpdateCheckerHook(ctx: PluginInput, options?: AutoUpdateCheckerOptions): (_input: {
|
|
36
39
|
event: OpenCodeEvent;
|
|
37
40
|
}) => Promise<void>;
|
|
41
|
+
/**
|
|
42
|
+
* Try to claim the next check slot via the on-disk timestamp file plus an
|
|
43
|
+
* atomic lockfile. The returned lock must be released after the check (and any
|
|
44
|
+
* install) completes.
|
|
45
|
+
*
|
|
46
|
+
* The timestamp preserves the cross-process dedup window. The lock closes the
|
|
47
|
+
* TOCTOU gap around that timestamp and, more importantly, stays held through
|
|
48
|
+
* preparePackageUpdate() + runNpmInstallSafe() so one updater cannot roll back
|
|
49
|
+
* another updater's successful install from a separate process.
|
|
50
|
+
*/
|
|
51
|
+
declare function claimCheckSlot(storageDir: string | null, intervalMs: number): CheckSlotLock | null;
|
|
38
52
|
export declare function getAutoUpdateInstallDir(): string;
|
|
53
|
+
export declare const __test__: {
|
|
54
|
+
claimCheckSlot: typeof claimCheckSlot;
|
|
55
|
+
};
|
|
39
56
|
export type { AutoUpdateCheckerOptions } from "./types.js";
|
|
40
57
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/auto-update-checker/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/auto-update-checker/index.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAYvD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAE3D,KAAK,aAAa,GAAG;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAQF,KAAK,aAAa,GAAG;IACnB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAsBF;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,2BAA2B,CACzC,GAAG,EAAE,WAAW,EAChB,OAAO,GAAE,wBAA6B,YAed;IAAE,KAAK,EAAE,aAAa,CAAA;CAAE,mBAyCjD;AA0BD;;;;;;;;;GASG;AACH,iBAAS,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,EAAE,UAAU,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CAkE3F;AA+ND,wBAAgB,uBAAuB,IAAI,MAAM,CAEhD;AAcD,eAAO,MAAM,QAAQ;;CAAqB,CAAC;AAE3C,YAAY,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -9903,6 +9903,49 @@ function markAnnouncementSeen(storageRoot, harness, currentVersion) {
|
|
|
9903
9903
|
writeFileSync(versionFile, currentVersion);
|
|
9904
9904
|
} catch {}
|
|
9905
9905
|
}
|
|
9906
|
+
function decodeFileUrl(target) {
|
|
9907
|
+
if (!target.startsWith("file:"))
|
|
9908
|
+
return target;
|
|
9909
|
+
const rest = target.slice("file:".length);
|
|
9910
|
+
let pathPart;
|
|
9911
|
+
if (rest.startsWith("//")) {
|
|
9912
|
+
const after = rest.slice(2);
|
|
9913
|
+
const slash = after.indexOf("/");
|
|
9914
|
+
const authority = slash === -1 ? after : after.slice(0, slash);
|
|
9915
|
+
const p = slash === -1 ? "" : after.slice(slash);
|
|
9916
|
+
if (authority === "" || authority === "localhost")
|
|
9917
|
+
pathPart = p;
|
|
9918
|
+
else if (process.platform === "win32")
|
|
9919
|
+
pathPart = `//${authority}${p}`;
|
|
9920
|
+
else
|
|
9921
|
+
return target;
|
|
9922
|
+
} else if (rest.startsWith("/")) {
|
|
9923
|
+
pathPart = rest;
|
|
9924
|
+
} else {
|
|
9925
|
+
return target;
|
|
9926
|
+
}
|
|
9927
|
+
const bytes = [];
|
|
9928
|
+
for (let i = 0;i < pathPart.length; ) {
|
|
9929
|
+
if (pathPart[i] === "%" && i + 2 < pathPart.length) {
|
|
9930
|
+
const hex = pathPart.slice(i + 1, i + 3);
|
|
9931
|
+
if (/^[0-9a-fA-F]{2}$/.test(hex)) {
|
|
9932
|
+
bytes.push(Number.parseInt(hex, 16));
|
|
9933
|
+
i += 3;
|
|
9934
|
+
continue;
|
|
9935
|
+
}
|
|
9936
|
+
}
|
|
9937
|
+
const cp = pathPart.codePointAt(i);
|
|
9938
|
+
const ch = String.fromCodePoint(cp);
|
|
9939
|
+
for (const b of Buffer.from(ch, "utf8"))
|
|
9940
|
+
bytes.push(b);
|
|
9941
|
+
i += ch.length;
|
|
9942
|
+
}
|
|
9943
|
+
const decoded = Buffer.from(bytes).toString("utf8");
|
|
9944
|
+
if (process.platform === "win32" && /^\/[A-Za-z]:/.test(decoded)) {
|
|
9945
|
+
return decoded.slice(1);
|
|
9946
|
+
}
|
|
9947
|
+
return decoded;
|
|
9948
|
+
}
|
|
9906
9949
|
|
|
9907
9950
|
// ../aft-bridge/dist/resolver.js
|
|
9908
9951
|
import { execSync } from "node:child_process";
|
|
@@ -15631,7 +15674,7 @@ function expandTilde2(input) {
|
|
|
15631
15674
|
return input;
|
|
15632
15675
|
}
|
|
15633
15676
|
function resolvePathFromProjectRoot(projectRoot, target) {
|
|
15634
|
-
const expanded = expandTilde2(target);
|
|
15677
|
+
const expanded = expandTilde2(decodeFileUrl(target));
|
|
15635
15678
|
return path2.isAbsolute(expanded) ? expanded : path2.resolve(projectRoot, expanded);
|
|
15636
15679
|
}
|
|
15637
15680
|
async function resolvePathArg(ctx, runtime, target) {
|
|
@@ -31201,6 +31244,7 @@ import {
|
|
|
31201
31244
|
readFileSync as readFileSync11,
|
|
31202
31245
|
renameSync as renameSync6,
|
|
31203
31246
|
rmSync as rmSync5,
|
|
31247
|
+
statSync as statSync6,
|
|
31204
31248
|
writeFileSync as writeFileSync7
|
|
31205
31249
|
} from "node:fs";
|
|
31206
31250
|
import { dirname as dirname8 } from "node:path";
|
|
@@ -31690,6 +31734,7 @@ ${stderrTail}` : "";
|
|
|
31690
31734
|
|
|
31691
31735
|
// src/hooks/auto-update-checker/index.ts
|
|
31692
31736
|
var DEFAULT_CHECK_INTERVAL_MS = 60 * 60 * 1000;
|
|
31737
|
+
var CHECK_LOCK_STALE_MS = 60 * 60 * 1000;
|
|
31693
31738
|
var DEFAULT_INIT_DELAY_MS = 5000;
|
|
31694
31739
|
var TIMESTAMP_FILENAME = "last-update-check.json";
|
|
31695
31740
|
function createAutoUpdateCheckerHook(ctx, options = {}) {
|
|
@@ -31752,22 +31797,37 @@ function claimCheckSlot(storageDir, intervalMs) {
|
|
|
31752
31797
|
return null;
|
|
31753
31798
|
mkdirSync6(dirname8(file2), { recursive: true });
|
|
31754
31799
|
const lockPath = `${file2}.lock`;
|
|
31755
|
-
|
|
31800
|
+
const owner = { pid: process.pid, startedMs: Date.now() };
|
|
31801
|
+
let lockFd = null;
|
|
31756
31802
|
try {
|
|
31757
31803
|
lockFd = openSync5(lockPath, "wx");
|
|
31758
|
-
writeFileSync7(lockFd, JSON.stringify(
|
|
31804
|
+
writeFileSync7(lockFd, JSON.stringify(owner));
|
|
31805
|
+
closeSync5(lockFd);
|
|
31806
|
+
lockFd = null;
|
|
31759
31807
|
} catch (err) {
|
|
31760
|
-
if (
|
|
31761
|
-
|
|
31808
|
+
if (lockFd !== null) {
|
|
31809
|
+
try {
|
|
31810
|
+
closeSync5(lockFd);
|
|
31811
|
+
} catch {}
|
|
31812
|
+
}
|
|
31813
|
+
if (err.code !== "EEXIST")
|
|
31814
|
+
throw err;
|
|
31815
|
+
if (!isOrphanedCheckLock(lockPath))
|
|
31816
|
+
return null;
|
|
31817
|
+
const replacementPath = `${lockPath}.tmp.${process.pid}`;
|
|
31818
|
+
writeFileSync7(replacementPath, JSON.stringify(owner), { encoding: "utf-8", mode: 384 });
|
|
31819
|
+
try {
|
|
31820
|
+
renameSync6(replacementPath, lockPath);
|
|
31821
|
+
} catch (replaceError) {
|
|
31822
|
+
rmSync5(replacementPath, { force: true });
|
|
31823
|
+
throw replaceError;
|
|
31762
31824
|
}
|
|
31763
|
-
return null;
|
|
31764
31825
|
}
|
|
31765
31826
|
const lock = {
|
|
31766
31827
|
release: () => {
|
|
31767
|
-
|
|
31768
|
-
|
|
31769
|
-
}
|
|
31770
|
-
rmSync5(lockPath, { force: true });
|
|
31828
|
+
if (checkLockIsOwnedBy(lockPath, owner)) {
|
|
31829
|
+
rmSync5(lockPath, { force: true });
|
|
31830
|
+
}
|
|
31771
31831
|
}
|
|
31772
31832
|
};
|
|
31773
31833
|
try {
|
|
@@ -31786,6 +31846,44 @@ function claimCheckSlot(storageDir, intervalMs) {
|
|
|
31786
31846
|
return null;
|
|
31787
31847
|
}
|
|
31788
31848
|
}
|
|
31849
|
+
function isOrphanedCheckLock(lockPath) {
|
|
31850
|
+
const state = readCheckLockState(lockPath);
|
|
31851
|
+
const ageMs = Date.now() - state.startedMs;
|
|
31852
|
+
if (ageMs >= CHECK_LOCK_STALE_MS)
|
|
31853
|
+
return true;
|
|
31854
|
+
if (state.pid === null)
|
|
31855
|
+
return false;
|
|
31856
|
+
try {
|
|
31857
|
+
process.kill(state.pid, 0);
|
|
31858
|
+
return false;
|
|
31859
|
+
} catch (err) {
|
|
31860
|
+
const code = err.code;
|
|
31861
|
+
if (code === "ESRCH")
|
|
31862
|
+
return true;
|
|
31863
|
+
if (code === "EPERM")
|
|
31864
|
+
return false;
|
|
31865
|
+
throw err;
|
|
31866
|
+
}
|
|
31867
|
+
}
|
|
31868
|
+
function readCheckLockState(lockPath) {
|
|
31869
|
+
const fallbackStartedMs = statSync6(lockPath).mtimeMs;
|
|
31870
|
+
try {
|
|
31871
|
+
const parsed = JSON.parse(readFileSync11(lockPath, "utf-8"));
|
|
31872
|
+
const pid = Number.isSafeInteger(parsed.pid) && (parsed.pid ?? 0) > 0 ? parsed.pid ?? null : null;
|
|
31873
|
+
const startedMs = typeof parsed.startedMs === "number" && Number.isFinite(parsed.startedMs) ? parsed.startedMs : fallbackStartedMs;
|
|
31874
|
+
return { pid, startedMs };
|
|
31875
|
+
} catch {
|
|
31876
|
+
return { pid: null, startedMs: fallbackStartedMs };
|
|
31877
|
+
}
|
|
31878
|
+
}
|
|
31879
|
+
function checkLockIsOwnedBy(lockPath, owner) {
|
|
31880
|
+
try {
|
|
31881
|
+
const parsed = JSON.parse(readFileSync11(lockPath, "utf-8"));
|
|
31882
|
+
return parsed.pid === owner.pid && parsed.startedMs === owner.startedMs;
|
|
31883
|
+
} catch {
|
|
31884
|
+
return false;
|
|
31885
|
+
}
|
|
31886
|
+
}
|
|
31789
31887
|
function hasRecentCheckTimestamp(file2, intervalMs) {
|
|
31790
31888
|
if (!existsSync12(file2))
|
|
31791
31889
|
return false;
|
|
@@ -31902,7 +32000,7 @@ import {
|
|
|
31902
32000
|
readFileSync as readFileSync14,
|
|
31903
32001
|
renameSync as renameSync7,
|
|
31904
32002
|
rmSync as rmSync6,
|
|
31905
|
-
statSync as
|
|
32003
|
+
statSync as statSync8,
|
|
31906
32004
|
writeFileSync as writeFileSync9
|
|
31907
32005
|
} from "node:fs";
|
|
31908
32006
|
import { join as join17 } from "node:path";
|
|
@@ -31913,7 +32011,7 @@ import {
|
|
|
31913
32011
|
mkdirSync as mkdirSync7,
|
|
31914
32012
|
openSync as openSync6,
|
|
31915
32013
|
readFileSync as readFileSync12,
|
|
31916
|
-
statSync as
|
|
32014
|
+
statSync as statSync7,
|
|
31917
32015
|
unlinkSync as unlinkSync6,
|
|
31918
32016
|
writeFileSync as writeFileSync8
|
|
31919
32017
|
} from "node:fs";
|
|
@@ -31946,7 +32044,7 @@ function lspBinDir(npmPackage) {
|
|
|
31946
32044
|
function isInstalled(npmPackage, binary) {
|
|
31947
32045
|
for (const candidate of lspBinaryCandidates(binary)) {
|
|
31948
32046
|
try {
|
|
31949
|
-
if (
|
|
32047
|
+
if (statSync7(join15(lspBinDir(npmPackage), candidate)).isFile())
|
|
31950
32048
|
return true;
|
|
31951
32049
|
} catch {}
|
|
31952
32050
|
}
|
|
@@ -31974,7 +32072,7 @@ function writeInstalledMetaIn(installDir, version2, sha256) {
|
|
|
31974
32072
|
function readInstalledMetaIn(installDir) {
|
|
31975
32073
|
const path3 = join15(installDir, INSTALLED_META_FILE);
|
|
31976
32074
|
try {
|
|
31977
|
-
if (!
|
|
32075
|
+
if (!statSync7(path3).isFile())
|
|
31978
32076
|
return null;
|
|
31979
32077
|
const raw = readFileSync12(path3, "utf8");
|
|
31980
32078
|
const parsed = JSON.parse(raw);
|
|
@@ -32031,7 +32129,7 @@ ${new Date().toISOString()}
|
|
|
32031
32129
|
const parsed = Number.parseInt(firstLine, 10);
|
|
32032
32130
|
if (Number.isFinite(parsed) && parsed > 0)
|
|
32033
32131
|
owningPid = parsed;
|
|
32034
|
-
lockMtimeMs =
|
|
32132
|
+
lockMtimeMs = statSync7(lock).mtimeMs;
|
|
32035
32133
|
} catch {
|
|
32036
32134
|
return tryClaim();
|
|
32037
32135
|
}
|
|
@@ -32636,7 +32734,7 @@ function hashInstalledBinary(spec) {
|
|
|
32636
32734
|
let pathToHash = null;
|
|
32637
32735
|
for (const p of candidates) {
|
|
32638
32736
|
try {
|
|
32639
|
-
if (
|
|
32737
|
+
if (statSync8(p).isFile()) {
|
|
32640
32738
|
pathToHash = p;
|
|
32641
32739
|
break;
|
|
32642
32740
|
}
|
|
@@ -32662,7 +32760,7 @@ function installedBinaryPath(spec) {
|
|
|
32662
32760
|
] : [lspBinaryPath(spec.npm, spec.binary)];
|
|
32663
32761
|
for (const candidate of candidates) {
|
|
32664
32762
|
try {
|
|
32665
|
-
if (
|
|
32763
|
+
if (statSync8(candidate).isFile())
|
|
32666
32764
|
return candidate;
|
|
32667
32765
|
} catch {}
|
|
32668
32766
|
}
|
|
@@ -32774,7 +32872,7 @@ import {
|
|
|
32774
32872
|
realpathSync as realpathSync3,
|
|
32775
32873
|
renameSync as renameSync8,
|
|
32776
32874
|
rmSync as rmSync7,
|
|
32777
|
-
statSync as
|
|
32875
|
+
statSync as statSync9,
|
|
32778
32876
|
unlinkSync as unlinkSync7,
|
|
32779
32877
|
writeFileSync as writeFileSync10
|
|
32780
32878
|
} from "node:fs";
|
|
@@ -32887,7 +32985,7 @@ function ghBinaryPath(spec, platform3) {
|
|
|
32887
32985
|
function isGithubInstalled(spec, platform3) {
|
|
32888
32986
|
for (const candidate of ghBinaryCandidates(spec, platform3)) {
|
|
32889
32987
|
try {
|
|
32890
|
-
if (
|
|
32988
|
+
if (statSync9(join18(ghBinDir(spec), candidate)).isFile())
|
|
32891
32989
|
return true;
|
|
32892
32990
|
} catch {}
|
|
32893
32991
|
}
|
|
@@ -32901,7 +32999,7 @@ function ghBinaryCandidates(spec, platform3) {
|
|
|
32901
32999
|
function readGithubInstalledMetaIn(installDir) {
|
|
32902
33000
|
try {
|
|
32903
33001
|
const path3 = join18(installDir, INSTALLED_META_FILE2);
|
|
32904
|
-
if (!
|
|
33002
|
+
if (!statSync9(path3).isFile())
|
|
32905
33003
|
return null;
|
|
32906
33004
|
const parsed = JSON.parse(readFileSync15(path3, "utf8"));
|
|
32907
33005
|
if (typeof parsed.version !== "string" || parsed.version.length === 0)
|
|
@@ -33279,7 +33377,7 @@ function validateCachedGithubInstall(spec, platform3) {
|
|
|
33279
33377
|
const meta3 = readGithubInstalledMetaIn(packageDir);
|
|
33280
33378
|
const binaryPath = ghBinaryCandidates(spec, platform3).map((candidate) => join18(ghBinDir(spec), candidate)).find((candidate) => {
|
|
33281
33379
|
try {
|
|
33282
|
-
return
|
|
33380
|
+
return statSync9(candidate).isFile();
|
|
33283
33381
|
} catch {
|
|
33284
33382
|
return false;
|
|
33285
33383
|
}
|
|
@@ -34226,6 +34324,7 @@ function coerceAftStatus(response) {
|
|
|
34226
34324
|
};
|
|
34227
34325
|
const disk = asRecord(response.disk);
|
|
34228
34326
|
const symbolCache = asRecord(response.symbol_cache);
|
|
34327
|
+
const runtime = asRecord(response.runtime);
|
|
34229
34328
|
const session = asRecord(response.session);
|
|
34230
34329
|
return {
|
|
34231
34330
|
version: readString(response.version, "unknown"),
|
|
@@ -34265,6 +34364,11 @@ function coerceAftStatus(response) {
|
|
|
34265
34364
|
semantic_disk_bytes: readNumber(disk.semantic_disk_bytes)
|
|
34266
34365
|
},
|
|
34267
34366
|
lsp_servers: readNumber(response.lsp_servers),
|
|
34367
|
+
runtime: {
|
|
34368
|
+
live_watchers: readNumber(runtime.live_watchers),
|
|
34369
|
+
live_actor_roots: readNumber(runtime.live_actor_roots),
|
|
34370
|
+
open_routes: readNumber(runtime.open_routes)
|
|
34371
|
+
},
|
|
34268
34372
|
symbol_cache: {
|
|
34269
34373
|
local_entries: readNumber(symbolCache.local_entries),
|
|
34270
34374
|
warm_entries: readNumber(symbolCache.warm_entries)
|
|
@@ -34558,6 +34662,15 @@ function isSystemTempPath(target) {
|
|
|
34558
34662
|
const normalizedTarget = normalizePath(target);
|
|
34559
34663
|
return systemTempRoots().some((root) => containsPath(normalizePath(root), normalizedTarget));
|
|
34560
34664
|
}
|
|
34665
|
+
function isBashTaskArtifactPath(target) {
|
|
34666
|
+
const storageRoot = normalizePath(resolveAftStorageRoot());
|
|
34667
|
+
const normalizedTarget = normalizePath(target);
|
|
34668
|
+
if (!containsPath(storageRoot, normalizedTarget))
|
|
34669
|
+
return false;
|
|
34670
|
+
const relative5 = normalizedTarget.slice(storageRoot.length).replace(/^[/\\]+/, "");
|
|
34671
|
+
const segments = relative5.split(/[/\\]+/);
|
|
34672
|
+
return segments.length === 4 && segments[1] === "bash-tasks";
|
|
34673
|
+
}
|
|
34561
34674
|
function windowsPath(p) {
|
|
34562
34675
|
if (process.platform !== "win32")
|
|
34563
34676
|
return p;
|
|
@@ -34620,6 +34733,9 @@ async function assertExternalDirectoryPermission(ctx, context, target, options)
|
|
|
34620
34733
|
}
|
|
34621
34734
|
if (isSystemTempPath(absoluteTarget))
|
|
34622
34735
|
return;
|
|
34736
|
+
if (options?.serverValidatedRead === true && isBashTaskArtifactPath(absoluteTarget)) {
|
|
34737
|
+
return;
|
|
34738
|
+
}
|
|
34623
34739
|
if (typeof context.ask !== "function")
|
|
34624
34740
|
return UNSUPPORTED_ASK_HOST;
|
|
34625
34741
|
const kind = options?.kind ?? "file";
|
|
@@ -35399,8 +35515,9 @@ function formatWatchResultText(taskId, data, waited) {
|
|
|
35399
35515
|
let text = `Task ${taskId}: ${status}${exit}${dur}`;
|
|
35400
35516
|
if (waited) {
|
|
35401
35517
|
if (waited.reason === "matched") {
|
|
35518
|
+
const stream = waited.match_stream ? ` in ${waited.match_stream}` : "";
|
|
35402
35519
|
text += `
|
|
35403
|
-
Waited ${waited.elapsed_ms}ms; matched ${JSON.stringify(waited.match ?? "")} at offset ${waited.match_offset ?? 0}.`;
|
|
35520
|
+
Waited ${waited.elapsed_ms}ms; matched ${JSON.stringify(waited.match ?? "")}${stream} at offset ${waited.match_offset ?? 0}.`;
|
|
35404
35521
|
} else if (waited.reason === "timeout") {
|
|
35405
35522
|
text += `
|
|
35406
35523
|
Waited ${waited.elapsed_ms}ms; timeout reached without match.`;
|
|
@@ -35430,9 +35547,11 @@ async function bashStatusSnapshot2(ctx, runtime, taskId, outputMode, options) {
|
|
|
35430
35547
|
async function waitForBashStatus(ctx, runtime, taskId, outputMode, waitFor, effectiveWaitMs) {
|
|
35431
35548
|
const startedAt = Date.now();
|
|
35432
35549
|
const deadline = startedAt + effectiveWaitMs;
|
|
35433
|
-
let spillCursor = { output: 0, stderr: 0
|
|
35434
|
-
|
|
35435
|
-
|
|
35550
|
+
let spillCursor = { output: 0, stderr: 0 };
|
|
35551
|
+
const scanState = {
|
|
35552
|
+
output: { text: "", baseOffset: 0 },
|
|
35553
|
+
stderr: { text: "", baseOffset: 0 }
|
|
35554
|
+
};
|
|
35436
35555
|
const bridgeOptions = {};
|
|
35437
35556
|
if (waitFor?.kind === "regex") {
|
|
35438
35557
|
await validateWaitRegex(ctx, runtime, waitFor);
|
|
@@ -35470,32 +35589,37 @@ async function waitForBashStatus(ctx, runtime, taskId, outputMode, waitFor, effe
|
|
|
35470
35589
|
const scan = await readNewTaskOutput(data, spillCursor);
|
|
35471
35590
|
if (scan) {
|
|
35472
35591
|
spillCursor = scan.nextCursor;
|
|
35473
|
-
|
|
35474
|
-
|
|
35475
|
-
|
|
35476
|
-
|
|
35477
|
-
|
|
35478
|
-
|
|
35479
|
-
|
|
35480
|
-
|
|
35481
|
-
|
|
35482
|
-
|
|
35483
|
-
|
|
35484
|
-
|
|
35485
|
-
|
|
35486
|
-
|
|
35487
|
-
|
|
35488
|
-
|
|
35489
|
-
|
|
35490
|
-
|
|
35491
|
-
|
|
35492
|
-
|
|
35493
|
-
|
|
35494
|
-
|
|
35495
|
-
|
|
35496
|
-
|
|
35497
|
-
|
|
35498
|
-
|
|
35592
|
+
for (const chunk of scan.chunks) {
|
|
35593
|
+
const state = scanState[chunk.stream];
|
|
35594
|
+
if (state.text.length === 0)
|
|
35595
|
+
state.baseOffset = chunk.baseOffset;
|
|
35596
|
+
state.text += chunk.text;
|
|
35597
|
+
if (waitFor.kind === "regex") {
|
|
35598
|
+
const trimmed = trimWaitScanBuffer(state.text, state.baseOffset, waitFor);
|
|
35599
|
+
state.text = trimmed.text;
|
|
35600
|
+
state.baseOffset = trimmed.baseOffset;
|
|
35601
|
+
}
|
|
35602
|
+
const match = await findWaitMatch(ctx, runtime, state.text, waitFor);
|
|
35603
|
+
if (match) {
|
|
35604
|
+
if (terminal) {
|
|
35605
|
+
sawTerminal = true;
|
|
35606
|
+
consumeBgCompletion(runtime.sessionID, taskId);
|
|
35607
|
+
await markBgCompletionDelivered({ ctx, directory: projectRootFor(runtime), sessionID: runtime.sessionID }, taskId);
|
|
35608
|
+
}
|
|
35609
|
+
const matchStream = data.mode === "pty" ? undefined : chunk.stream === "output" ? "stdout" : "stderr";
|
|
35610
|
+
return withWaited(data, {
|
|
35611
|
+
reason: "matched",
|
|
35612
|
+
elapsed_ms: Date.now() - startedAt,
|
|
35613
|
+
match: match.text,
|
|
35614
|
+
match_offset: state.baseOffset + match.byteOffset,
|
|
35615
|
+
match_stream: matchStream
|
|
35616
|
+
});
|
|
35617
|
+
}
|
|
35618
|
+
if (waitFor.kind === "substring") {
|
|
35619
|
+
const trimmed = trimWaitScanBuffer(state.text, state.baseOffset, waitFor);
|
|
35620
|
+
state.text = trimmed.text;
|
|
35621
|
+
state.baseOffset = trimmed.baseOffset;
|
|
35622
|
+
}
|
|
35499
35623
|
}
|
|
35500
35624
|
}
|
|
35501
35625
|
}
|
|
@@ -35528,13 +35652,26 @@ async function readNewTaskOutput(data, cursor) {
|
|
|
35528
35652
|
const bytesRead = stdoutBytes.length + stderrBytes.length;
|
|
35529
35653
|
if (bytesRead === 0)
|
|
35530
35654
|
return;
|
|
35655
|
+
const chunks = [];
|
|
35656
|
+
if (stdoutBytes.length > 0) {
|
|
35657
|
+
chunks.push({
|
|
35658
|
+
stream: "output",
|
|
35659
|
+
text: stdoutBytes.toString("utf8"),
|
|
35660
|
+
baseOffset: cursor.output
|
|
35661
|
+
});
|
|
35662
|
+
}
|
|
35663
|
+
if (stderrBytes.length > 0) {
|
|
35664
|
+
chunks.push({
|
|
35665
|
+
stream: "stderr",
|
|
35666
|
+
text: stderrBytes.toString("utf8"),
|
|
35667
|
+
baseOffset: cursor.stderr
|
|
35668
|
+
});
|
|
35669
|
+
}
|
|
35531
35670
|
return {
|
|
35532
|
-
|
|
35533
|
-
baseOffset: cursor.combined,
|
|
35671
|
+
chunks,
|
|
35534
35672
|
nextCursor: {
|
|
35535
35673
|
output: cursor.output + stdoutBytes.length,
|
|
35536
|
-
stderr: cursor.stderr + stderrBytes.length
|
|
35537
|
-
combined: cursor.combined + bytesRead
|
|
35674
|
+
stderr: cursor.stderr + stderrBytes.length
|
|
35538
35675
|
}
|
|
35539
35676
|
};
|
|
35540
35677
|
}
|
|
@@ -37565,14 +37702,14 @@ var PLUGIN_VERSION = (() => {
|
|
|
37565
37702
|
return "0.0.0";
|
|
37566
37703
|
}
|
|
37567
37704
|
})();
|
|
37568
|
-
var ANNOUNCEMENT_VERSION = "0.47.
|
|
37705
|
+
var ANNOUNCEMENT_VERSION = "0.47.2";
|
|
37569
37706
|
var ANNOUNCEMENT_FEATURES = [
|
|
37570
|
-
"
|
|
37571
|
-
"
|
|
37572
|
-
"
|
|
37573
|
-
"
|
|
37574
|
-
"
|
|
37575
|
-
"
|
|
37707
|
+
"Fixed: apply_patch wrote mixed line endings when editing CRLF (Windows) files; the file's dominant line ending is now preserved.",
|
|
37708
|
+
"Fixed: inlining a function argument like twice(1 + 2) could change operator precedence; non-atomic arguments are now parenthesized.",
|
|
37709
|
+
"Fixed: removing one name from a Python import with an aliased sibling (from m import a, b as c) could delete the whole line.",
|
|
37710
|
+
"Fixed: bash_watch could report a match that spanned the stdout/stderr seam; streams are now scanned independently.",
|
|
37711
|
+
"GitHub and GitLab file links (…/blob/…) now read raw file content in aft_outline/aft_zoom, and documentation heading lookups tolerate numeric prefixes, link labels, emoji, and anchor slugs.",
|
|
37712
|
+
"bash now finds tools on a PATH exported from your shell rc (e.g. zsh .zshrc), and several warm hot paths got faster."
|
|
37576
37713
|
];
|
|
37577
37714
|
var ANNOUNCEMENT_FOOTER = "Join us on Discord: https://discord.gg/DSa65w8wuf";
|
|
37578
37715
|
var plugin = async (input) => initializePluginForDirectory(input);
|
package/dist/shared/status.d.ts
CHANGED
|
@@ -72,6 +72,11 @@ export interface AftStatusSnapshot {
|
|
|
72
72
|
semantic_disk_bytes: number;
|
|
73
73
|
};
|
|
74
74
|
lsp_servers: number;
|
|
75
|
+
runtime: {
|
|
76
|
+
live_watchers: number;
|
|
77
|
+
live_actor_roots: number;
|
|
78
|
+
open_routes: number;
|
|
79
|
+
};
|
|
75
80
|
symbol_cache: {
|
|
76
81
|
local_entries: number;
|
|
77
82
|
warm_entries: number;
|
|
@@ -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,iBAAiB;IAChC,OAAO,EAAE,0BAA0B,CAAC;IACpC,OAAO,EAAE,0BAA0B,CAAC;CACrC;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,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AAC,MAAM,EAAE,iBAAiB,GAAG,MAAM,CA4FtE"}
|
package/dist/tools/_shared.d.ts
CHANGED
|
@@ -88,9 +88,10 @@ export declare function resolveProjectRoot(ctx: PluginContext, runtime: ToolRunt
|
|
|
88
88
|
* accept `~/...` the same way the search tools already do.
|
|
89
89
|
*/
|
|
90
90
|
export declare function expandTilde(input: string): string;
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
*
|
|
91
|
+
export { decodeFileUrl } from "@cortexkit/aft-bridge";
|
|
92
|
+
/** Resolve a user path exactly as a bridge request will: file: URLs decode
|
|
93
|
+
* to local paths, `~` expands to home, absolute paths are preserved;
|
|
94
|
+
* relative paths are rooted at the session/project root. */
|
|
94
95
|
export declare function resolvePathFromProjectRoot(projectRoot: string, target: string): string;
|
|
95
96
|
export declare function resolvePathArg(ctx: PluginContext, runtime: ToolRuntime, target: string): Promise<string>;
|
|
96
97
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_shared.d.ts","sourceRoot":"","sources":["../../src/tools/_shared.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAKH,OAAO,KAAK,EACV,mBAAmB,EACnB,oBAAoB,EACpB,eAAe,EACf,cAAc,EACf,MAAM,uBAAuB,CAAC;AAM/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,eAAO,MAAM,WAAW,GAAI,KAAK,MAAM,EAAE,KAAK,MAAM,KAAG,GACR,CAAC;AAOhD,eAAO,MAAM,yBAAyB,QAAS,CAAC;AAIhD,OAAO,EACL,iBAAiB,EACjB,wBAAwB,EACxB,YAAY,EACZ,+BAA+B,EAC/B,iBAAiB,GAClB,MAAM,uBAAuB,CAAC;AAE/B;;;;;;GAMG;AACH,MAAM,WAAW,WAAW;IAC1B,wEAAwE;IACxE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oDAAoD;IACpD,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AO,CAAC,EAAE,oBAAoB,GAC7B,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAMlC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bash_watch.d.ts","sourceRoot":"","sources":["../../src/tools/bash_watch.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAavE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AASjD,MAAM,MAAM,eAAe,GACvB;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACpC;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AACtC,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,EAAE,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,cAAc,GAAG,aAAa,CAAC;IAC1E,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"bash_watch.d.ts","sourceRoot":"","sources":["../../src/tools/bash_watch.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAavE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AASjD,MAAM,MAAM,eAAe,GACvB;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACpC;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AACtC,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,EAAE,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,cAAc,GAAG,aAAa,CAAC;IAC1E,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;CACpC,CAAC;AAUF,KAAK,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IAAE,MAAM,CAAC,EAAE,gBAAgB,CAAA;CAAE,CAAC;AAMlF,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,aAAa,GAAG,cAAc,CA0GtE;AAiHD,wBAAsB,iBAAiB,CACrC,GAAG,EAAE,aAAa,EAClB,OAAO,EAAE,WAAW,EACpB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,OAAO,EAAE,eAAe,GAAG,SAAS,EACpC,eAAe,EAAE,MAAM,GACtB,OAAO,CAAC,kBAAkB,CAAC,CAoH7B;AA2DD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,eAAe,GAAG,SAAS,CAI5E;AAkGD,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,eAAe,GACvB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAEtC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../../src/tools/permissions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../../src/tools/permissions.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAwDjD;;;;;;;;;;;GAWG;AACH,wBAAsB,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,I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AKG;AACH,wBAAsB,iCAAiC,CACrD,GAAG,EAAE,aAAa,EAClB,OAAO,EAAE,WAAW,EACpB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAsE7B;AAkCD;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE,MAAM,EACf,QAAQ,GAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAO,GACjD,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAE7B;AAED;;;;;;GAMG;AACH,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE,MAAM,EACf,QAAQ,GAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAO,GACjD,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAE7B;AAED;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE,MAAM,EACf,QAAQ,GAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAO,GAC/B,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAkB7B;AAED,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAOhE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cortexkit/aft-opencode",
|
|
3
|
-
"version": "0.47.
|
|
3
|
+
"version": "0.47.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.47.
|
|
37
|
+
"@cortexkit/aft-bridge": "0.47.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.47.
|
|
47
|
-
"@cortexkit/aft-darwin-x64": "0.47.
|
|
48
|
-
"@cortexkit/aft-linux-arm64": "0.47.
|
|
49
|
-
"@cortexkit/aft-linux-x64": "0.47.
|
|
50
|
-
"@cortexkit/aft-win32-arm64": "0.47.
|
|
51
|
-
"@cortexkit/aft-win32-x64": "0.47.
|
|
46
|
+
"@cortexkit/aft-darwin-arm64": "0.47.2",
|
|
47
|
+
"@cortexkit/aft-darwin-x64": "0.47.2",
|
|
48
|
+
"@cortexkit/aft-linux-arm64": "0.47.2",
|
|
49
|
+
"@cortexkit/aft-linux-x64": "0.47.2",
|
|
50
|
+
"@cortexkit/aft-win32-arm64": "0.47.2",
|
|
51
|
+
"@cortexkit/aft-win32-x64": "0.47.2"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@opencode-ai/plugin": "^1.17.11",
|
package/src/shared/status.ts
CHANGED
|
@@ -75,6 +75,11 @@ export interface AftStatusSnapshot {
|
|
|
75
75
|
semantic_disk_bytes: number;
|
|
76
76
|
};
|
|
77
77
|
lsp_servers: number;
|
|
78
|
+
runtime: {
|
|
79
|
+
live_watchers: number;
|
|
80
|
+
live_actor_roots: number;
|
|
81
|
+
open_routes: number;
|
|
82
|
+
};
|
|
78
83
|
symbol_cache: {
|
|
79
84
|
local_entries: number;
|
|
80
85
|
warm_entries: number;
|
|
@@ -212,6 +217,7 @@ export function coerceAftStatus(response: Record<string, unknown>): AftStatusSna
|
|
|
212
217
|
};
|
|
213
218
|
const disk = asRecord(response.disk);
|
|
214
219
|
const symbolCache = asRecord(response.symbol_cache);
|
|
220
|
+
const runtime = asRecord(response.runtime);
|
|
215
221
|
const session = asRecord(response.session);
|
|
216
222
|
|
|
217
223
|
return {
|
|
@@ -256,6 +262,11 @@ export function coerceAftStatus(response: Record<string, unknown>): AftStatusSna
|
|
|
256
262
|
semantic_disk_bytes: readNumber(disk.semantic_disk_bytes),
|
|
257
263
|
},
|
|
258
264
|
lsp_servers: readNumber(response.lsp_servers),
|
|
265
|
+
runtime: {
|
|
266
|
+
live_watchers: readNumber(runtime.live_watchers),
|
|
267
|
+
live_actor_roots: readNumber(runtime.live_actor_roots),
|
|
268
|
+
open_routes: readNumber(runtime.open_routes),
|
|
269
|
+
},
|
|
259
270
|
symbol_cache: {
|
|
260
271
|
local_entries: readNumber(symbolCache.local_entries),
|
|
261
272
|
warm_entries: readNumber(symbolCache.warm_entries),
|