@inerrata-corporation/errata 2.0.6-dev.2602 → 2.0.6-dev.2608
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/errata.mjs +50 -16
- package/package.json +1 -1
- package/pass-worker.mjs +7 -0
package/errata.mjs
CHANGED
|
@@ -76032,6 +76032,10 @@ var PassWorker = class {
|
|
|
76032
76032
|
reindex(opts) {
|
|
76033
76033
|
return this.call("reindex", opts);
|
|
76034
76034
|
}
|
|
76035
|
+
/** Run a full-scope `runIndexer` on the worker (workspace wake, `errata reindex`). */
|
|
76036
|
+
fullIndex(opts) {
|
|
76037
|
+
return this.call("fullIndex", opts);
|
|
76038
|
+
}
|
|
76035
76039
|
call(kind, payload) {
|
|
76036
76040
|
if (this.stopped) return Promise.reject(new Error("pass worker stopped"));
|
|
76037
76041
|
return withHeavyPassSlot(`${kind}:${this.init.workspaceId}`, async () => {
|
|
@@ -78417,7 +78421,7 @@ function createWatchBreaker(deps) {
|
|
|
78417
78421
|
}
|
|
78418
78422
|
|
|
78419
78423
|
// src/engine.ts
|
|
78420
|
-
var DAEMON_VERSION = true ? "2.0.6-dev.
|
|
78424
|
+
var DAEMON_VERSION = true ? "2.0.6-dev.2608" : "2.0.0-alpha.0";
|
|
78421
78425
|
var IGNORED_PATH = /[\\/](?:\.git|node_modules|\.errata|\.claude|\.codex|\.cursor|\.turbo|\.next|dist|coverage|test-results|playwright-report|__pycache__)(?:[\\/]|$)/;
|
|
78422
78426
|
var IGNORED_NOISE = /castalia\.db|eventlog\.sqlite|turn-cursors/;
|
|
78423
78427
|
var GIT_OP_MUTE_MS = 4e3;
|
|
@@ -79035,6 +79039,33 @@ function createWorkspaceEngine(opts) {
|
|
|
79035
79039
|
intentRemoteInFlight = false;
|
|
79036
79040
|
});
|
|
79037
79041
|
};
|
|
79042
|
+
const runFullIndex = async (clean) => {
|
|
79043
|
+
if (passWorker) {
|
|
79044
|
+
try {
|
|
79045
|
+
return await passWorker.fullIndex({ clean });
|
|
79046
|
+
} catch (err2) {
|
|
79047
|
+
if (isWorkerOom(err2)) {
|
|
79048
|
+
console.warn("[errata] full-reindex worker hit its heap ceiling \u2014 pass skipped");
|
|
79049
|
+
throw new Error("full reindex skipped: pass worker hit its heap ceiling");
|
|
79050
|
+
}
|
|
79051
|
+
console.warn(
|
|
79052
|
+
"[errata] full-reindex worker unavailable, running inline:",
|
|
79053
|
+
err2 instanceof Error ? err2.message : err2
|
|
79054
|
+
);
|
|
79055
|
+
}
|
|
79056
|
+
}
|
|
79057
|
+
const done = markPass(`reindex-inline:${profile.name}`);
|
|
79058
|
+
try {
|
|
79059
|
+
return await runIndexer(store, {
|
|
79060
|
+
workspaceId: profile.id,
|
|
79061
|
+
rootPath: opts.workspaceRoot,
|
|
79062
|
+
providers: defaultProviders(),
|
|
79063
|
+
clean
|
|
79064
|
+
});
|
|
79065
|
+
} finally {
|
|
79066
|
+
done();
|
|
79067
|
+
}
|
|
79068
|
+
};
|
|
79038
79069
|
const runNightly = async () => {
|
|
79039
79070
|
if (passWorker) {
|
|
79040
79071
|
try {
|
|
@@ -80578,12 +80609,7 @@ B: ${b}`,
|
|
|
80578
80609
|
if (!reindexOpts?.quiet) {
|
|
80579
80610
|
notifyEvent("index-started", `Indexing ${profile.name}\u2026`, { key: profile.id });
|
|
80580
80611
|
}
|
|
80581
|
-
const r = await
|
|
80582
|
-
workspaceId: profile.id,
|
|
80583
|
-
rootPath: opts.workspaceRoot,
|
|
80584
|
-
providers: defaultProviders(),
|
|
80585
|
-
clean: reindexOpts?.clean ?? false
|
|
80586
|
-
});
|
|
80612
|
+
const r = await runFullIndex(reindexOpts?.clean ?? false);
|
|
80587
80613
|
const { report: nightly, localSkills } = await runNightly();
|
|
80588
80614
|
let embeddedCodeNodes = 0;
|
|
80589
80615
|
let embedMs = 0;
|
|
@@ -81929,7 +81955,7 @@ function compareVersions(a, b) {
|
|
|
81929
81955
|
}
|
|
81930
81956
|
return 0;
|
|
81931
81957
|
}
|
|
81932
|
-
async function
|
|
81958
|
+
async function lookupPublished(channel, timeoutMs = 4e3) {
|
|
81933
81959
|
const ctrl = new AbortController();
|
|
81934
81960
|
const timer = setTimeout(() => ctrl.abort(), timeoutMs);
|
|
81935
81961
|
try {
|
|
@@ -81937,17 +81963,23 @@ async function latestPublished(channel, timeoutMs = 4e3) {
|
|
|
81937
81963
|
headers: { accept: "application/vnd.npm.install-v1+json" },
|
|
81938
81964
|
signal: ctrl.signal
|
|
81939
81965
|
});
|
|
81940
|
-
if (!res.ok) return
|
|
81966
|
+
if (!res.ok) return { error: `http ${res.status}` };
|
|
81941
81967
|
const body2 = await res.json();
|
|
81942
|
-
|
|
81968
|
+
const version2 = body2["dist-tags"]?.[channel];
|
|
81969
|
+
return version2 ? { version: version2 } : { error: "no-tag" };
|
|
81943
81970
|
} catch {
|
|
81944
|
-
return
|
|
81971
|
+
return { error: ctrl.signal.aborted ? "timeout" : "unreachable" };
|
|
81945
81972
|
} finally {
|
|
81946
81973
|
clearTimeout(timer);
|
|
81947
81974
|
}
|
|
81948
81975
|
}
|
|
81949
|
-
async function checkForUpdate(channel) {
|
|
81950
|
-
|
|
81976
|
+
async function checkForUpdate(channel, opts = {}) {
|
|
81977
|
+
let lookup = { error: "unreachable" };
|
|
81978
|
+
for (let i2 = 0; i2 < Math.max(1, opts.attempts ?? 1); i2++) {
|
|
81979
|
+
lookup = await lookupPublished(channel, opts.timeoutMs ?? 4e3);
|
|
81980
|
+
if ("version" in lookup || lookup.error !== "timeout" && lookup.error !== "unreachable") break;
|
|
81981
|
+
}
|
|
81982
|
+
const latest = "version" in lookup ? lookup.version : null;
|
|
81951
81983
|
const direction = latest === null ? 0 : compareVersions(latest, DAEMON_VERSION);
|
|
81952
81984
|
return {
|
|
81953
81985
|
current: DAEMON_VERSION,
|
|
@@ -81955,7 +81987,8 @@ async function checkForUpdate(channel) {
|
|
|
81955
81987
|
// `compareVersions` returns 0 for unparseable input, so an unrecognizable tag
|
|
81956
81988
|
// is treated as "nothing to do" rather than gambling on a direction.
|
|
81957
81989
|
updateAvailable: latest !== null && direction > 0,
|
|
81958
|
-
downgradeAvailable: latest !== null && direction < 0
|
|
81990
|
+
downgradeAvailable: latest !== null && direction < 0,
|
|
81991
|
+
..."error" in lookup ? { lookupError: lookup.error } : {}
|
|
81959
81992
|
};
|
|
81960
81993
|
}
|
|
81961
81994
|
function pendingFromServerVerdict(latest, channel, current = DAEMON_VERSION) {
|
|
@@ -88023,10 +88056,11 @@ async function cmdUpdate(args2) {
|
|
|
88023
88056
|
saveConfig({ ...cfg, updateChannel: channel });
|
|
88024
88057
|
console.log(`update channel set to '${channel}'`);
|
|
88025
88058
|
}
|
|
88026
|
-
const status = await checkForUpdate(channel);
|
|
88059
|
+
const status = await checkForUpdate(channel, { timeoutMs: 15e3, attempts: 2 });
|
|
88027
88060
|
if (status.latest === null) {
|
|
88061
|
+
const why = status.lookupError;
|
|
88028
88062
|
console.log(
|
|
88029
|
-
`no published build found on channel '${channel}' (
|
|
88063
|
+
why === "no-tag" ? `no published build found on channel '${channel}'. current: ${status.current}` : why === "timeout" ? `the npm registry did not answer within 15s (tried twice), so channel '${channel}' could not be checked; nothing was changed. Retry, or check your network. current: ${status.current}` : `could not reach the npm registry (${why ?? "unreachable"}), so channel '${channel}' could not be checked; nothing was changed. current: ${status.current}`
|
|
88030
88064
|
);
|
|
88031
88065
|
return;
|
|
88032
88066
|
}
|
package/package.json
CHANGED
package/pass-worker.mjs
CHANGED
|
@@ -27544,6 +27544,13 @@ function runPass(msg) {
|
|
|
27544
27544
|
}
|
|
27545
27545
|
case "reindex":
|
|
27546
27546
|
return runReindex(msg.payload);
|
|
27547
|
+
case "fullIndex":
|
|
27548
|
+
return runIndexer(store, {
|
|
27549
|
+
workspaceId: init2.workspaceId,
|
|
27550
|
+
rootPath: init2.workspaceRoot,
|
|
27551
|
+
providers: defaultProviders(),
|
|
27552
|
+
clean: msg.payload?.clean ?? false
|
|
27553
|
+
});
|
|
27547
27554
|
default:
|
|
27548
27555
|
throw new Error(`pass-worker: unknown pass "${msg.kind}"`);
|
|
27549
27556
|
}
|