@inerrata-corporation/errata 2.0.2-dev.1203 → 2.0.2-dev.1205
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 -1
- package/package.json +1 -1
package/errata.mjs
CHANGED
|
@@ -57065,7 +57065,7 @@ function createWatchBreaker(deps) {
|
|
|
57065
57065
|
}
|
|
57066
57066
|
|
|
57067
57067
|
// src/engine.ts
|
|
57068
|
-
var DAEMON_VERSION = true ? "2.0.2-dev.
|
|
57068
|
+
var DAEMON_VERSION = true ? "2.0.2-dev.1205" : "2.0.0-alpha.0";
|
|
57069
57069
|
var IGNORED_PATH = /[\\/](?:\.git|node_modules|\.errata|\.claude|\.codex|\.cursor|\.turbo|\.next|dist|coverage|test-results|playwright-report|__pycache__)(?:[\\/]|$)/;
|
|
57070
57070
|
var IGNORED_NOISE = /castalia\.db|eventlog\.sqlite|turn-cursors/;
|
|
57071
57071
|
var GIT_OP_MUTE_MS = 4e3;
|
|
@@ -60650,6 +60650,26 @@ function createHealthSentinel(deps = {}) {
|
|
|
60650
60650
|
};
|
|
60651
60651
|
}
|
|
60652
60652
|
|
|
60653
|
+
// src/codex-wake.ts
|
|
60654
|
+
var CODEX_WAKE_LOOKBACK_MS = 10 * 6e4;
|
|
60655
|
+
var CODEX_WAKE_BOOT_LOOKBACK_MS = 24 * 60 * 6e4;
|
|
60656
|
+
function codexWakeCandidates(input) {
|
|
60657
|
+
if (input.disabled) return [];
|
|
60658
|
+
const find = input.find ?? ((cwd, since) => codexRolloutsForCwd(cwd, { sinceMs: since, limit: 1 }).length);
|
|
60659
|
+
const out2 = [];
|
|
60660
|
+
for (const entry of input.entries) {
|
|
60661
|
+
if (input.liveRoots.has(input.normPath(entry.path))) continue;
|
|
60662
|
+
let n = 0;
|
|
60663
|
+
try {
|
|
60664
|
+
n = find(entry.path, input.sinceMs);
|
|
60665
|
+
} catch {
|
|
60666
|
+
continue;
|
|
60667
|
+
}
|
|
60668
|
+
if (n > 0) out2.push({ name: entry.name, path: entry.path });
|
|
60669
|
+
}
|
|
60670
|
+
return out2;
|
|
60671
|
+
}
|
|
60672
|
+
|
|
60653
60673
|
// src/multi.ts
|
|
60654
60674
|
var projectSymbolSalts = /* @__PURE__ */ new Map();
|
|
60655
60675
|
async function resolveProjectSymbolSalt(client, projectId) {
|
|
@@ -61190,6 +61210,33 @@ async function startMultiDaemon(opts = {}) {
|
|
|
61190
61210
|
};
|
|
61191
61211
|
const idleSweep = setInterval(sweepIdleWorkspaces, WORKSPACE_SWEEP_INTERVAL_MS);
|
|
61192
61212
|
idleSweep.unref?.();
|
|
61213
|
+
let codexWakeFirstPass = true;
|
|
61214
|
+
const sweepCodexWake = () => {
|
|
61215
|
+
const lookback = codexWakeFirstPass ? CODEX_WAKE_BOOT_LOOKBACK_MS : CODEX_WAKE_LOOKBACK_MS;
|
|
61216
|
+
codexWakeFirstPass = false;
|
|
61217
|
+
let entries2;
|
|
61218
|
+
try {
|
|
61219
|
+
entries2 = listWorkspaceEntries();
|
|
61220
|
+
} catch {
|
|
61221
|
+
return;
|
|
61222
|
+
}
|
|
61223
|
+
const candidates = codexWakeCandidates({
|
|
61224
|
+
entries: entries2,
|
|
61225
|
+
liveRoots: new Set(records.map((r) => normPath(r.root))),
|
|
61226
|
+
normPath,
|
|
61227
|
+
sinceMs: Date.now() - lookback,
|
|
61228
|
+
disabled: process.env["ERRATA_CODEX_WAKE_DISABLE"] === "1"
|
|
61229
|
+
});
|
|
61230
|
+
for (const c of candidates) {
|
|
61231
|
+
if (attachWorkspace(c.path).attached) {
|
|
61232
|
+
console.log(`[errata] woke workspace ${c.name} \u2014 recent Codex rollout (headless capture)`);
|
|
61233
|
+
}
|
|
61234
|
+
}
|
|
61235
|
+
};
|
|
61236
|
+
const codexWake = setInterval(sweepCodexWake, WORKSPACE_SWEEP_INTERVAL_MS);
|
|
61237
|
+
codexWake.unref?.();
|
|
61238
|
+
const codexWakeBoot = setTimeout(sweepCodexWake, 5e3);
|
|
61239
|
+
codexWakeBoot.unref?.();
|
|
61193
61240
|
const reindexAll = async (rOpts) => {
|
|
61194
61241
|
const out2 = /* @__PURE__ */ new Map();
|
|
61195
61242
|
const toIndex = records.filter((r) => rOpts?.force || r.engine.store.nodeCount() === 0);
|
|
@@ -61903,6 +61950,8 @@ async function startMultiDaemon(opts = {}) {
|
|
|
61903
61950
|
},
|
|
61904
61951
|
async stop() {
|
|
61905
61952
|
clearInterval(idleSweep);
|
|
61953
|
+
clearInterval(codexWake);
|
|
61954
|
+
clearTimeout(codexWakeBoot);
|
|
61906
61955
|
try {
|
|
61907
61956
|
const cur = readFileSync27(lockPath, "utf8");
|
|
61908
61957
|
if (JSON.parse(cur).pid === process.pid) unlinkSync3(lockPath);
|