@inerrata-corporation/errata 2.0.17-dev.3492 → 2.0.17-dev.3497
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 +35 -4
- package/package.json +1 -1
package/errata.mjs
CHANGED
|
@@ -82246,7 +82246,7 @@ function createWatchBreaker(deps) {
|
|
|
82246
82246
|
}
|
|
82247
82247
|
|
|
82248
82248
|
// src/engine.ts
|
|
82249
|
-
var DAEMON_VERSION = true ? "2.0.17-dev.
|
|
82249
|
+
var DAEMON_VERSION = true ? "2.0.17-dev.3497" : "2.0.0-alpha.0";
|
|
82250
82250
|
var IGNORED_PATH = /[\\/](?:\.git|node_modules|\.errata|\.claude|\.codex|\.cursor|\.turbo|\.next|dist|coverage|test-results|playwright-report|__pycache__)(?:[\\/]|$)/;
|
|
82251
82251
|
var IGNORED_NOISE = /castalia\.db|eventlog\.sqlite|turn-cursors/;
|
|
82252
82252
|
var GIT_OP_MUTE_MS = 4e3;
|
|
@@ -91449,6 +91449,27 @@ function buildCodexHooksToml(port, options) {
|
|
|
91449
91449
|
);
|
|
91450
91450
|
return CODEX_HOOKS_BEGIN + "\n" + handlers.join("\n") + CODEX_HOOKS_END + "\n";
|
|
91451
91451
|
}
|
|
91452
|
+
function installedHookPort(settingsText) {
|
|
91453
|
+
let settings;
|
|
91454
|
+
try {
|
|
91455
|
+
settings = JSON.parse(settingsText);
|
|
91456
|
+
} catch {
|
|
91457
|
+
return null;
|
|
91458
|
+
}
|
|
91459
|
+
const hooks = settings?.hooks;
|
|
91460
|
+
if (!hooks || typeof hooks !== "object") return null;
|
|
91461
|
+
for (const groups of Object.values(hooks)) {
|
|
91462
|
+
for (const group of Array.isArray(groups) ? groups : []) {
|
|
91463
|
+
for (const h of group?.hooks ?? []) {
|
|
91464
|
+
if (typeof h?.command !== "string" || !h.command.includes("errata-managed")) continue;
|
|
91465
|
+
const m = /http:\/\/127\.0\.0\.1:(\d+)\//.exec(h.command);
|
|
91466
|
+
const port = m ? Number(m[1]) : NaN;
|
|
91467
|
+
if (Number.isInteger(port) && port > 0 && port < 65536) return port;
|
|
91468
|
+
}
|
|
91469
|
+
}
|
|
91470
|
+
}
|
|
91471
|
+
return null;
|
|
91472
|
+
}
|
|
91452
91473
|
|
|
91453
91474
|
// src/codex-hook-relay.ts
|
|
91454
91475
|
var CODEX_RELAY_SOURCE = String.raw`// errata-managed: regenerated by errata install-hooks codex
|
|
@@ -91891,6 +91912,10 @@ function removeProjectStatusLine(settings) {
|
|
|
91891
91912
|
}
|
|
91892
91913
|
return removed;
|
|
91893
91914
|
}
|
|
91915
|
+
function isSameInstall(value, relay) {
|
|
91916
|
+
const command = value["command"].replace(/\\/g, "/").toLowerCase();
|
|
91917
|
+
return command.includes(relay.replace(/\\/g, "/").toLowerCase());
|
|
91918
|
+
}
|
|
91894
91919
|
function userClaudeSettingsPath() {
|
|
91895
91920
|
const base = process.env["CLAUDE_CONFIG_DIR"] ?? join46(homedir8(), ".claude");
|
|
91896
91921
|
return join46(base, "settings.json");
|
|
@@ -91910,10 +91935,11 @@ function ensureUserStatusLine(opts) {
|
|
|
91910
91935
|
return "unreadable";
|
|
91911
91936
|
}
|
|
91912
91937
|
}
|
|
91913
|
-
const ownMain = settings["statusLine"] !== void 0 && !isErrataStatusLine(settings["statusLine"]);
|
|
91914
|
-
const ownRows = settings["subagentStatusLine"] !== void 0 && !isErrataStatusLine(settings["subagentStatusLine"]);
|
|
91915
|
-
if (ownMain && ownRows) return "kept-own";
|
|
91916
91938
|
const relay = join46(opts.relayDir, STATUSLINE_RELAY_FILE);
|
|
91939
|
+
const keep = (value) => value !== void 0 && (!isErrataStatusLine(value) || !isSameInstall(value, relay));
|
|
91940
|
+
const ownMain = keep(settings["statusLine"]);
|
|
91941
|
+
const ownRows = keep(settings["subagentStatusLine"]);
|
|
91942
|
+
if (ownMain && ownRows) return "kept-own";
|
|
91917
91943
|
mkdirSync10(opts.relayDir, { recursive: true });
|
|
91918
91944
|
if (!existsSync37(relay) || readFileSync40(relay, "utf8") !== STATUSLINE_RELAY_SOURCE) {
|
|
91919
91945
|
writeFileSync28(relay, STATUSLINE_RELAY_SOURCE, "utf8");
|
|
@@ -92329,6 +92355,11 @@ function resolveHookPort(explicit) {
|
|
|
92329
92355
|
}
|
|
92330
92356
|
}
|
|
92331
92357
|
}
|
|
92358
|
+
const settingsPath = join47(ROOT, ".claude", "settings.json");
|
|
92359
|
+
try {
|
|
92360
|
+
if (existsSync38(settingsPath)) return installedHookPort(readFileSync41(settingsPath, "utf8")) ?? 7891;
|
|
92361
|
+
} catch {
|
|
92362
|
+
}
|
|
92332
92363
|
return 7891;
|
|
92333
92364
|
}
|
|
92334
92365
|
async function cmdInit() {
|