@cortexkit/aft-opencode 0.50.0 → 0.50.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +160 -48
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -9492,7 +9492,8 @@ function formatDroppedKeyWarnings(dropped) {
|
|
|
9492
9492
|
// ../aft-bridge/dist/downloader.js
|
|
9493
9493
|
import { spawnSync } from "node:child_process";
|
|
9494
9494
|
import { createHash as createHash2, randomUUID } from "node:crypto";
|
|
9495
|
-
import { chmodSync, closeSync, copyFileSync, createWriteStream, existsSync as existsSync2, mkdirSync, openSync, readFileSync as readFileSync3, renameSync, rmSync, statSync as statSync2, unlinkSync, writeSync } from "node:fs";
|
|
9495
|
+
import { chmodSync, closeSync, copyFileSync, createWriteStream, existsSync as existsSync2, mkdirSync, openSync, readdirSync, readFileSync as readFileSync3, renameSync, rmSync, statSync as statSync2, unlinkSync, writeSync } from "node:fs";
|
|
9496
|
+
import { hostname } from "node:os";
|
|
9496
9497
|
import { join as join4 } from "node:path";
|
|
9497
9498
|
import { Readable } from "node:stream";
|
|
9498
9499
|
import { pipeline } from "node:stream/promises";
|
|
@@ -9517,8 +9518,8 @@ var REPO = "cortexkit/aft";
|
|
|
9517
9518
|
var DOWNLOAD_TIMEOUT_MS = 300000;
|
|
9518
9519
|
var LATEST_TAG_TIMEOUT_MS = 30000;
|
|
9519
9520
|
var MAX_DOWNLOAD_BYTES = 200 * 1024 * 1024;
|
|
9520
|
-
var DOWNLOAD_LOCK_TIMEOUT_MS = 120000;
|
|
9521
9521
|
var DOWNLOAD_LOCK_STALE_MS = 10 * 60000;
|
|
9522
|
+
var DOWNLOAD_LOCK_TIMEOUT_MS = DOWNLOAD_LOCK_STALE_MS + 30000;
|
|
9522
9523
|
function readBinaryVersion(binaryPath) {
|
|
9523
9524
|
try {
|
|
9524
9525
|
const result = spawnSync(binaryPath, ["--version"], {
|
|
@@ -9586,11 +9587,37 @@ async function downloadBinary(version) {
|
|
|
9586
9587
|
let binaryTimeout = null;
|
|
9587
9588
|
let checksumTimeout = null;
|
|
9588
9589
|
const tmpPath = `${binaryPath}.${process.pid}.${Date.now()}.${Math.random().toString(16).slice(2)}.tmp`;
|
|
9590
|
+
const cleanUpPartialDownload = () => {
|
|
9591
|
+
try {
|
|
9592
|
+
if (existsSync2(tmpPath))
|
|
9593
|
+
unlinkSync(tmpPath);
|
|
9594
|
+
} catch {}
|
|
9595
|
+
};
|
|
9596
|
+
let interrupted = false;
|
|
9597
|
+
const cleanUpInterruptedDownload = () => {
|
|
9598
|
+
if (interrupted)
|
|
9599
|
+
return;
|
|
9600
|
+
interrupted = true;
|
|
9601
|
+
binaryController?.abort();
|
|
9602
|
+
checksumController?.abort();
|
|
9603
|
+
cleanUpPartialDownload();
|
|
9604
|
+
releaseLock?.();
|
|
9605
|
+
releaseLock = null;
|
|
9606
|
+
};
|
|
9607
|
+
const handleSigint = () => {
|
|
9608
|
+
cleanUpInterruptedDownload();
|
|
9609
|
+
process.off("SIGINT", handleSigint);
|
|
9610
|
+
process.kill(process.pid, "SIGINT");
|
|
9611
|
+
};
|
|
9612
|
+
const handleExit = () => cleanUpInterruptedDownload();
|
|
9613
|
+
process.once("SIGINT", handleSigint);
|
|
9614
|
+
process.once("exit", handleExit);
|
|
9589
9615
|
try {
|
|
9590
9616
|
if (!existsSync2(versionedCacheDir)) {
|
|
9591
9617
|
mkdirSync(versionedCacheDir, { recursive: true });
|
|
9592
9618
|
}
|
|
9593
9619
|
releaseLock = await acquireDownloadLock(lockPath);
|
|
9620
|
+
sweepStaleDownloadTemps(versionedCacheDir, binaryName);
|
|
9594
9621
|
if (existsSync2(binaryPath) && isExpectedCachedBinary(binaryPath, tag)) {
|
|
9595
9622
|
return binaryPath;
|
|
9596
9623
|
}
|
|
@@ -9666,13 +9693,11 @@ async function downloadBinary(version) {
|
|
|
9666
9693
|
} catch (err) {
|
|
9667
9694
|
const msg = err instanceof Error ? err.message : String(err);
|
|
9668
9695
|
error(`Failed to download AFT binary: ${msg}`);
|
|
9669
|
-
|
|
9670
|
-
try {
|
|
9671
|
-
unlinkSync(tmpPath);
|
|
9672
|
-
} catch {}
|
|
9673
|
-
}
|
|
9696
|
+
cleanUpPartialDownload();
|
|
9674
9697
|
return null;
|
|
9675
9698
|
} finally {
|
|
9699
|
+
process.off("SIGINT", handleSigint);
|
|
9700
|
+
process.off("exit", handleExit);
|
|
9676
9701
|
if (binaryTimeout) {
|
|
9677
9702
|
binaryController?.abort();
|
|
9678
9703
|
clearTimeout(binaryTimeout);
|
|
@@ -9698,17 +9723,85 @@ async function ensureBinary(version) {
|
|
|
9698
9723
|
log("No cached binary found, downloading latest...");
|
|
9699
9724
|
return downloadBinary();
|
|
9700
9725
|
}
|
|
9701
|
-
|
|
9726
|
+
function createDownloadLockOwner() {
|
|
9727
|
+
return JSON.stringify({
|
|
9728
|
+
pid: process.pid,
|
|
9729
|
+
hostname: hostname(),
|
|
9730
|
+
createdAt: Date.now(),
|
|
9731
|
+
token: randomUUID()
|
|
9732
|
+
});
|
|
9733
|
+
}
|
|
9734
|
+
function parseDownloadLockOwner(raw) {
|
|
9735
|
+
try {
|
|
9736
|
+
const parsed = JSON.parse(raw);
|
|
9737
|
+
if (typeof parsed === "object" && parsed !== null) {
|
|
9738
|
+
const { pid, hostname: ownerHostname } = parsed;
|
|
9739
|
+
return {
|
|
9740
|
+
pid: typeof pid === "number" && Number.isSafeInteger(pid) && pid > 0 ? pid : null,
|
|
9741
|
+
hostname: typeof ownerHostname === "string" && ownerHostname ? ownerHostname : null
|
|
9742
|
+
};
|
|
9743
|
+
}
|
|
9744
|
+
} catch {}
|
|
9745
|
+
const legacyPid = Number(raw.split(":", 1)[0]);
|
|
9746
|
+
return {
|
|
9747
|
+
pid: Number.isSafeInteger(legacyPid) && legacyPid > 0 ? legacyPid : null,
|
|
9748
|
+
hostname: null
|
|
9749
|
+
};
|
|
9750
|
+
}
|
|
9751
|
+
function isProcessAlive(pid) {
|
|
9752
|
+
try {
|
|
9753
|
+
process.kill(pid, 0);
|
|
9754
|
+
return true;
|
|
9755
|
+
} catch (err) {
|
|
9756
|
+
return err.code !== "ESRCH";
|
|
9757
|
+
}
|
|
9758
|
+
}
|
|
9759
|
+
function isReclaimableDownloadLock(owner, ageMs, staleMs) {
|
|
9760
|
+
if (Math.abs(ageMs) > staleMs)
|
|
9761
|
+
return true;
|
|
9762
|
+
return (owner.hostname === null || owner.hostname === hostname()) && owner.pid !== null && !isProcessAlive(owner.pid);
|
|
9763
|
+
}
|
|
9764
|
+
function reclaimDownloadLock(lockPath, expectedOwner) {
|
|
9765
|
+
try {
|
|
9766
|
+
if (readFileSync3(lockPath, "utf-8") !== expectedOwner)
|
|
9767
|
+
return false;
|
|
9768
|
+
rmSync(lockPath, { force: true });
|
|
9769
|
+
return true;
|
|
9770
|
+
} catch (err) {
|
|
9771
|
+
if (err.code === "ENOENT")
|
|
9772
|
+
return true;
|
|
9773
|
+
throw err;
|
|
9774
|
+
}
|
|
9775
|
+
}
|
|
9776
|
+
function sweepStaleDownloadTemps(versionedCacheDir, binaryName) {
|
|
9777
|
+
const tempPrefix = `${binaryName}.`;
|
|
9778
|
+
try {
|
|
9779
|
+
for (const entry of readdirSync(versionedCacheDir, { withFileTypes: true })) {
|
|
9780
|
+
if (!entry.isFile() || !entry.name.startsWith(tempPrefix) || !entry.name.endsWith(".tmp")) {
|
|
9781
|
+
continue;
|
|
9782
|
+
}
|
|
9783
|
+
const tempPath = join4(versionedCacheDir, entry.name);
|
|
9784
|
+
const ageMs = Date.now() - statSync2(tempPath).mtimeMs;
|
|
9785
|
+
if (Math.abs(ageMs) > DOWNLOAD_LOCK_STALE_MS)
|
|
9786
|
+
unlinkSync(tempPath);
|
|
9787
|
+
}
|
|
9788
|
+
} catch {}
|
|
9789
|
+
}
|
|
9790
|
+
async function acquireDownloadLock(lockPath, timing = {}) {
|
|
9791
|
+
const timeoutMs = timing.timeoutMs ?? DOWNLOAD_LOCK_TIMEOUT_MS;
|
|
9792
|
+
const staleMs = timing.staleMs ?? DOWNLOAD_LOCK_STALE_MS;
|
|
9793
|
+
const pollIntervalMs = timing.pollIntervalMs ?? 100;
|
|
9702
9794
|
const startedAt = Date.now();
|
|
9703
9795
|
while (true) {
|
|
9704
9796
|
try {
|
|
9705
|
-
const owner =
|
|
9797
|
+
const owner = createDownloadLockOwner();
|
|
9706
9798
|
const fd = openSync(lockPath, "wx");
|
|
9707
|
-
|
|
9799
|
+
try {
|
|
9800
|
+
writeSync(fd, owner);
|
|
9801
|
+
} finally {
|
|
9802
|
+
closeSync(fd);
|
|
9803
|
+
}
|
|
9708
9804
|
return () => {
|
|
9709
|
-
try {
|
|
9710
|
-
closeSync(fd);
|
|
9711
|
-
} catch {}
|
|
9712
9805
|
try {
|
|
9713
9806
|
if (readFileSync3(lockPath, "utf-8") === owner) {
|
|
9714
9807
|
rmSync(lockPath, { force: true });
|
|
@@ -9719,19 +9812,24 @@ async function acquireDownloadLock(lockPath) {
|
|
|
9719
9812
|
const code = err.code;
|
|
9720
9813
|
if (code !== "EEXIST")
|
|
9721
9814
|
throw err;
|
|
9815
|
+
let existingOwner;
|
|
9816
|
+
let ageMs;
|
|
9722
9817
|
try {
|
|
9723
|
-
|
|
9724
|
-
|
|
9725
|
-
|
|
9818
|
+
existingOwner = readFileSync3(lockPath, "utf-8");
|
|
9819
|
+
ageMs = Date.now() - statSync2(lockPath).mtimeMs;
|
|
9820
|
+
} catch (readErr) {
|
|
9821
|
+
if (readErr.code === "ENOENT")
|
|
9726
9822
|
continue;
|
|
9727
|
-
|
|
9728
|
-
} catch {
|
|
9729
|
-
continue;
|
|
9823
|
+
throw readErr;
|
|
9730
9824
|
}
|
|
9731
|
-
if (
|
|
9825
|
+
if (isReclaimableDownloadLock(parseDownloadLockOwner(existingOwner), ageMs, staleMs)) {
|
|
9826
|
+
if (reclaimDownloadLock(lockPath, existingOwner))
|
|
9827
|
+
continue;
|
|
9828
|
+
}
|
|
9829
|
+
if (Date.now() - startedAt > timeoutMs) {
|
|
9732
9830
|
throw new Error(`Timed out waiting for download lock: ${lockPath}`);
|
|
9733
9831
|
}
|
|
9734
|
-
await new Promise((resolve3) => setTimeout(resolve3,
|
|
9832
|
+
await new Promise((resolve3) => setTimeout(resolve3, pollIntervalMs));
|
|
9735
9833
|
}
|
|
9736
9834
|
}
|
|
9737
9835
|
}
|
|
@@ -14611,7 +14709,7 @@ async function ensureStorageMigrated(opts) {
|
|
|
14611
14709
|
throw new Error(`AFT storage migration failed (${detail}). ` + `Harness: ${opts.harness}. Legacy: ${legacyRoot}. Target: ${newRoot}. ` + `See log: ${logPath}. ` + `Plugin load aborted to prevent legacy/new state divergence.` + (stderrTail ? ` Stderr tail: ${stderrTail}` : "") + (stdoutTail ? ` Stdout tail: ${stdoutTail}` : ""));
|
|
14612
14710
|
}
|
|
14613
14711
|
// ../aft-bridge/dist/npm-resolver.js
|
|
14614
|
-
import { readdirSync, statSync as statSync5 } from "node:fs";
|
|
14712
|
+
import { readdirSync as readdirSync2, statSync as statSync5 } from "node:fs";
|
|
14615
14713
|
import { homedir as homedir8 } from "node:os";
|
|
14616
14714
|
import { delimiter, dirname as dirname4, isAbsolute as isAbsolute3, join as join9 } from "node:path";
|
|
14617
14715
|
function defaultDeps() {
|
|
@@ -14651,7 +14749,7 @@ function npmAdjacentToNode(deps) {
|
|
|
14651
14749
|
function highestVersionedNodeBin(installsDir, name) {
|
|
14652
14750
|
let entries;
|
|
14653
14751
|
try {
|
|
14654
|
-
entries =
|
|
14752
|
+
entries = readdirSync2(installsDir);
|
|
14655
14753
|
} catch {
|
|
14656
14754
|
return null;
|
|
14657
14755
|
}
|
|
@@ -14730,7 +14828,7 @@ function isNpmAvailable(deps = defaultDeps()) {
|
|
|
14730
14828
|
// ../aft-bridge/dist/onnx-runtime.js
|
|
14731
14829
|
import { execFileSync } from "node:child_process";
|
|
14732
14830
|
import { createHash as createHash4 } from "node:crypto";
|
|
14733
|
-
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
|
|
14831
|
+
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";
|
|
14734
14832
|
import { basename as basename2, dirname as dirname5, isAbsolute as isAbsolute4, join as join10, relative as relative2, resolve as resolve6, win32 } from "node:path";
|
|
14735
14833
|
import { Readable as Readable2 } from "node:stream";
|
|
14736
14834
|
import { pipeline as pipeline2 } from "node:stream/promises";
|
|
@@ -14847,7 +14945,7 @@ async function ensureOnnxRuntime(storageDir) {
|
|
|
14847
14945
|
}
|
|
14848
14946
|
function cleanupAbandonedStagingDirs(onnxBaseDir) {
|
|
14849
14947
|
try {
|
|
14850
|
-
const entries =
|
|
14948
|
+
const entries = readdirSync3(onnxBaseDir);
|
|
14851
14949
|
for (const entry of entries) {
|
|
14852
14950
|
if (!entry.startsWith(`${ORT_VERSION}.tmp.`))
|
|
14853
14951
|
continue;
|
|
@@ -14858,7 +14956,7 @@ function cleanupAbandonedStagingDirs(onnxBaseDir) {
|
|
|
14858
14956
|
let abandoned = false;
|
|
14859
14957
|
if (Number.isFinite(pid) && pid > 0) {
|
|
14860
14958
|
if (process.platform === "win32") {
|
|
14861
|
-
const ownerAlive =
|
|
14959
|
+
const ownerAlive = isProcessAlive2(pid);
|
|
14862
14960
|
if (!ownerAlive) {
|
|
14863
14961
|
abandoned = true;
|
|
14864
14962
|
} else {
|
|
@@ -14870,7 +14968,7 @@ function cleanupAbandonedStagingDirs(onnxBaseDir) {
|
|
|
14870
14968
|
}
|
|
14871
14969
|
}
|
|
14872
14970
|
} else {
|
|
14873
|
-
abandoned = !
|
|
14971
|
+
abandoned = !isProcessAlive2(pid);
|
|
14874
14972
|
}
|
|
14875
14973
|
} else {
|
|
14876
14974
|
abandoned = true;
|
|
@@ -14921,7 +15019,7 @@ function isPathInsideRoot(root, candidate) {
|
|
|
14921
15019
|
}
|
|
14922
15020
|
function detectOnnxVersion(libDir, libName) {
|
|
14923
15021
|
try {
|
|
14924
|
-
const entries =
|
|
15022
|
+
const entries = readdirSync3(libDir);
|
|
14925
15023
|
const barePrefix = libName.replace(/\.(so|dylib|dll)$/, "");
|
|
14926
15024
|
const expectedPrefix = process.platform === "win32" ? barePrefix.toLowerCase() : barePrefix;
|
|
14927
15025
|
for (const entry of entries) {
|
|
@@ -14984,7 +15082,7 @@ function isWindowsSystem32Directory(dir) {
|
|
|
14984
15082
|
}
|
|
14985
15083
|
function directoryContainsLibrary(dir, libName) {
|
|
14986
15084
|
try {
|
|
14987
|
-
const entries =
|
|
15085
|
+
const entries = readdirSync3(dir);
|
|
14988
15086
|
if (process.platform === "win32") {
|
|
14989
15087
|
const expected = libName.toLowerCase();
|
|
14990
15088
|
return entries.some((entry) => entry.toLowerCase() === expected);
|
|
@@ -15022,7 +15120,7 @@ function findSystemOnnxRuntime(libName) {
|
|
|
15022
15120
|
if (!existsSync7(nugetPackageDir))
|
|
15023
15121
|
return nugetPaths;
|
|
15024
15122
|
try {
|
|
15025
|
-
for (const entry of
|
|
15123
|
+
for (const entry of readdirSync3(nugetPackageDir, { withFileTypes: true })) {
|
|
15026
15124
|
if (!entry.isDirectory())
|
|
15027
15125
|
continue;
|
|
15028
15126
|
if (entry.name === "__globalPackagesFolder" || entry.name.startsWith("."))
|
|
@@ -15117,7 +15215,7 @@ function validateExtractedTree(stagingRoot) {
|
|
|
15117
15215
|
const realRoot = realpathSync2(stagingRoot);
|
|
15118
15216
|
let totalBytes = 0;
|
|
15119
15217
|
const walk = (dir) => {
|
|
15120
|
-
const entries =
|
|
15218
|
+
const entries = readdirSync3(dir);
|
|
15121
15219
|
for (const entry of entries) {
|
|
15122
15220
|
const fullPath = join10(dir, entry);
|
|
15123
15221
|
const lst = lstatSync(fullPath);
|
|
@@ -15175,7 +15273,7 @@ async function downloadOnnxRuntime(info, targetDir) {
|
|
|
15175
15273
|
throw new Error(`Expected directory not found: ${extractedDir}`);
|
|
15176
15274
|
}
|
|
15177
15275
|
mkdirSync5(targetDir, { recursive: true });
|
|
15178
|
-
const libFiles =
|
|
15276
|
+
const libFiles = readdirSync3(extractedDir).filter((f) => f.startsWith("libonnxruntime") || f.startsWith("onnxruntime"));
|
|
15179
15277
|
const realFiles = [];
|
|
15180
15278
|
const symlinks = [];
|
|
15181
15279
|
for (const libFile of libFiles) {
|
|
@@ -15353,7 +15451,7 @@ ${new Date().toISOString()}
|
|
|
15353
15451
|
}
|
|
15354
15452
|
const age = Date.now() - lockMtimeMs;
|
|
15355
15453
|
const ageWithinFresh = Math.abs(age) < STALE_LOCK_MS;
|
|
15356
|
-
const ownerAlive = owningPid !== null &&
|
|
15454
|
+
const ownerAlive = owningPid !== null && isProcessAlive2(owningPid);
|
|
15357
15455
|
if (ownerAlive && ageWithinFresh) {
|
|
15358
15456
|
return false;
|
|
15359
15457
|
}
|
|
@@ -15417,7 +15515,7 @@ function isWindowsProcessAlive(pid) {
|
|
|
15417
15515
|
return false;
|
|
15418
15516
|
}
|
|
15419
15517
|
}
|
|
15420
|
-
function
|
|
15518
|
+
function isProcessAlive2(pid) {
|
|
15421
15519
|
if (process.platform === "win32")
|
|
15422
15520
|
return isWindowsProcessAlive(pid);
|
|
15423
15521
|
try {
|
|
@@ -15792,6 +15890,19 @@ function parseEditArray(value) {
|
|
|
15792
15890
|
}
|
|
15793
15891
|
return value;
|
|
15794
15892
|
}
|
|
15893
|
+
function stripLineRangeSentinels(item) {
|
|
15894
|
+
const hasRangeField = ["startLine", "endLine", "content"].some((key) => hasOwn(item, key));
|
|
15895
|
+
if (!hasRangeField)
|
|
15896
|
+
return;
|
|
15897
|
+
if (item.oldString === "")
|
|
15898
|
+
delete item.oldString;
|
|
15899
|
+
if (item.newString === "")
|
|
15900
|
+
delete item.newString;
|
|
15901
|
+
if (item.replaceAll === false)
|
|
15902
|
+
delete item.replaceAll;
|
|
15903
|
+
if (item.occurrence === 1)
|
|
15904
|
+
delete item.occurrence;
|
|
15905
|
+
}
|
|
15795
15906
|
function normalizeEditItem(value, index) {
|
|
15796
15907
|
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
15797
15908
|
throw new InvalidRequestError(`edit: edits[${index}] must be an object`);
|
|
@@ -15800,6 +15911,7 @@ function normalizeEditItem(value, index) {
|
|
|
15800
15911
|
const item = copyOwnProperties(source);
|
|
15801
15912
|
normalizeItemAlias(item, "oldString", "oldText");
|
|
15802
15913
|
normalizeItemAlias(item, "newString", "newText");
|
|
15914
|
+
stripLineRangeSentinels(item);
|
|
15803
15915
|
const hasFindField = ["oldString", "newString", "replaceAll", "occurrence"].some((key) => hasOwn(item, key));
|
|
15804
15916
|
const hasRangeField = ["startLine", "endLine", "content"].some((key) => hasOwn(item, key));
|
|
15805
15917
|
if (hasFindField && hasRangeField) {
|
|
@@ -17878,7 +17990,7 @@ __export(exports_external, {
|
|
|
17878
17990
|
instanceof: () => _instanceof,
|
|
17879
17991
|
includes: () => _includes,
|
|
17880
17992
|
httpUrl: () => httpUrl,
|
|
17881
|
-
hostname: () =>
|
|
17993
|
+
hostname: () => hostname3,
|
|
17882
17994
|
hex: () => hex2,
|
|
17883
17995
|
hash: () => hash,
|
|
17884
17996
|
guid: () => guid2,
|
|
@@ -19329,7 +19441,7 @@ __export(exports_regexes, {
|
|
|
19329
19441
|
idnEmail: () => idnEmail,
|
|
19330
19442
|
httpProtocol: () => httpProtocol,
|
|
19331
19443
|
html5Email: () => html5Email,
|
|
19332
|
-
hostname: () =>
|
|
19444
|
+
hostname: () => hostname2,
|
|
19333
19445
|
hex: () => hex,
|
|
19334
19446
|
guid: () => guid,
|
|
19335
19447
|
extendedDuration: () => extendedDuration,
|
|
@@ -19387,7 +19499,7 @@ var cidrv4 = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]
|
|
|
19387
19499
|
var cidrv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;
|
|
19388
19500
|
var base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;
|
|
19389
19501
|
var base64url = /^[A-Za-z0-9_-]*$/;
|
|
19390
|
-
var
|
|
19502
|
+
var hostname2 = /^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/;
|
|
19391
19503
|
var domain = /^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/;
|
|
19392
19504
|
var httpProtocol = /^https?$/;
|
|
19393
19505
|
var e164 = /^\+[1-9]\d{6,14}$/;
|
|
@@ -30011,7 +30123,7 @@ __export(exports_schemas2, {
|
|
|
30011
30123
|
int: () => int,
|
|
30012
30124
|
instanceof: () => _instanceof,
|
|
30013
30125
|
httpUrl: () => httpUrl,
|
|
30014
|
-
hostname: () =>
|
|
30126
|
+
hostname: () => hostname3,
|
|
30015
30127
|
hex: () => hex2,
|
|
30016
30128
|
hash: () => hash,
|
|
30017
30129
|
guid: () => guid2,
|
|
@@ -30663,7 +30775,7 @@ var ZodCustomStringFormat = /* @__PURE__ */ $constructor("ZodCustomStringFormat"
|
|
|
30663
30775
|
function stringFormat(format, fnOrRegex, _params = {}) {
|
|
30664
30776
|
return _stringFormat(ZodCustomStringFormat, format, fnOrRegex, _params);
|
|
30665
30777
|
}
|
|
30666
|
-
function
|
|
30778
|
+
function hostname3(_params) {
|
|
30667
30779
|
return _stringFormat(ZodCustomStringFormat, "hostname", exports_regexes.hostname, _params);
|
|
30668
30780
|
}
|
|
30669
30781
|
function hex2(_params) {
|
|
@@ -34151,7 +34263,7 @@ ${new Date().toISOString()}
|
|
|
34151
34263
|
const age = Date.now() - lockMtimeMs;
|
|
34152
34264
|
const ageWithinFresh = Math.abs(age) < STALE_LOCK_MS2;
|
|
34153
34265
|
const skipLiveness = process.platform === "win32";
|
|
34154
|
-
const ownerAlive = !skipLiveness && owningPid !== null &&
|
|
34266
|
+
const ownerAlive = !skipLiveness && owningPid !== null && isProcessAlive3(owningPid);
|
|
34155
34267
|
if (skipLiveness ? ageWithinFresh : ownerAlive && ageWithinFresh) {
|
|
34156
34268
|
return false;
|
|
34157
34269
|
}
|
|
@@ -34161,7 +34273,7 @@ ${new Date().toISOString()}
|
|
|
34161
34273
|
} catch {}
|
|
34162
34274
|
return tryClaim();
|
|
34163
34275
|
}
|
|
34164
|
-
function
|
|
34276
|
+
function isProcessAlive3(pid) {
|
|
34165
34277
|
try {
|
|
34166
34278
|
process.kill(pid, 0);
|
|
34167
34279
|
return true;
|
|
@@ -34395,7 +34507,7 @@ var NPM_LSP_TABLE = [
|
|
|
34395
34507
|
];
|
|
34396
34508
|
|
|
34397
34509
|
// src/lsp-project-relevance.ts
|
|
34398
|
-
import { existsSync as existsSync15, readdirSync as
|
|
34510
|
+
import { existsSync as existsSync15, readdirSync as readdirSync4, readFileSync as readFileSync13 } from "node:fs";
|
|
34399
34511
|
import { join as join17 } from "node:path";
|
|
34400
34512
|
var MAX_WALK_DIRS = 200;
|
|
34401
34513
|
var MAX_WALK_DEPTH = 4;
|
|
@@ -34460,7 +34572,7 @@ function relevantExtensionsInProject(projectRoot, extToServer) {
|
|
|
34460
34572
|
visitedDirs += 1;
|
|
34461
34573
|
let entries;
|
|
34462
34574
|
try {
|
|
34463
|
-
entries =
|
|
34575
|
+
entries = readdirSync4(current.dir, { withFileTypes: true });
|
|
34464
34576
|
} catch {
|
|
34465
34577
|
continue;
|
|
34466
34578
|
}
|
|
@@ -34881,7 +34993,7 @@ import {
|
|
|
34881
34993
|
existsSync as existsSync17,
|
|
34882
34994
|
lstatSync as lstatSync2,
|
|
34883
34995
|
mkdirSync as mkdirSync9,
|
|
34884
|
-
readdirSync as
|
|
34996
|
+
readdirSync as readdirSync5,
|
|
34885
34997
|
readFileSync as readFileSync15,
|
|
34886
34998
|
readlinkSync as readlinkSync2,
|
|
34887
34999
|
realpathSync as realpathSync3,
|
|
@@ -35284,7 +35396,7 @@ function validateExtraction(stagingRoot) {
|
|
|
35284
35396
|
const walk = (dir) => {
|
|
35285
35397
|
let entries;
|
|
35286
35398
|
try {
|
|
35287
|
-
entries =
|
|
35399
|
+
entries = readdirSync5(dir);
|
|
35288
35400
|
} catch (err) {
|
|
35289
35401
|
throw new Error(`failed to read staging dir ${dir}: ${err}`);
|
|
35290
35402
|
}
|
|
@@ -35897,7 +36009,7 @@ import { randomBytes as randomBytes3, timingSafeEqual as timingSafeEqual2 } from
|
|
|
35897
36009
|
import {
|
|
35898
36010
|
existsSync as existsSync18,
|
|
35899
36011
|
mkdirSync as mkdirSync10,
|
|
35900
|
-
readdirSync as
|
|
36012
|
+
readdirSync as readdirSync6,
|
|
35901
36013
|
readFileSync as readFileSync16,
|
|
35902
36014
|
renameSync as renameSync9,
|
|
35903
36015
|
unlinkSync as unlinkSync8,
|
|
@@ -36067,7 +36179,7 @@ class AftRpcServer {
|
|
|
36067
36179
|
sweepDeadPortFiles() {
|
|
36068
36180
|
let entries;
|
|
36069
36181
|
try {
|
|
36070
|
-
entries =
|
|
36182
|
+
entries = readdirSync6(this.portsDir);
|
|
36071
36183
|
} catch {
|
|
36072
36184
|
return;
|
|
36073
36185
|
}
|
|
@@ -39828,7 +39940,7 @@ var PLUGIN_VERSION = (() => {
|
|
|
39828
39940
|
return "0.0.0";
|
|
39829
39941
|
}
|
|
39830
39942
|
})();
|
|
39831
|
-
var ANNOUNCEMENT_VERSION = "0.50.
|
|
39943
|
+
var ANNOUNCEMENT_VERSION = "0.50.1";
|
|
39832
39944
|
var ANNOUNCEMENT_FEATURES = [
|
|
39833
39945
|
"Callgraph stays consistent under load: edits arriving mid-rebuild can no longer be silently lost from navigation results.",
|
|
39834
39946
|
"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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cortexkit/aft-opencode",
|
|
3
|
-
"version": "0.50.
|
|
3
|
+
"version": "0.50.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "OpenCode plugin for Agent File Tools (AFT) — tree-sitter and lsp powered code analysis",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@clack/prompts": "^1.6.0",
|
|
37
|
-
"@cortexkit/aft-bridge": "0.50.
|
|
37
|
+
"@cortexkit/aft-bridge": "0.50.1",
|
|
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.50.
|
|
47
|
-
"@cortexkit/aft-darwin-x64": "0.50.
|
|
48
|
-
"@cortexkit/aft-linux-arm64": "0.50.
|
|
49
|
-
"@cortexkit/aft-linux-x64": "0.50.
|
|
50
|
-
"@cortexkit/aft-win32-arm64": "0.50.
|
|
51
|
-
"@cortexkit/aft-win32-x64": "0.50.
|
|
46
|
+
"@cortexkit/aft-darwin-arm64": "0.50.1",
|
|
47
|
+
"@cortexkit/aft-darwin-x64": "0.50.1",
|
|
48
|
+
"@cortexkit/aft-linux-arm64": "0.50.1",
|
|
49
|
+
"@cortexkit/aft-linux-x64": "0.50.1",
|
|
50
|
+
"@cortexkit/aft-win32-arm64": "0.50.1",
|
|
51
|
+
"@cortexkit/aft-win32-x64": "0.50.1"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@opencode-ai/plugin": "^1.17.11",
|