@inerrata-corporation/errata 2.0.0-dev.57 → 2.0.0-dev.58
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 +21 -5
- package/package.json +1 -1
package/errata.mjs
CHANGED
|
@@ -21517,13 +21517,21 @@ function loadConfig() {
|
|
|
21517
21517
|
const raw2 = readFileSync3(p, "utf8").replace(/^\uFEFF/, "");
|
|
21518
21518
|
const parsed = JSON.parse(raw2);
|
|
21519
21519
|
const base = defaultConfig();
|
|
21520
|
-
|
|
21520
|
+
const envCloudUrl = process.env["ERRATA_CLOUD_URL"];
|
|
21521
|
+
const migrateLegacyDefault = parsed.cloudUrl === LEGACY_CLOUD_URL;
|
|
21522
|
+
const resolved = {
|
|
21521
21523
|
...base,
|
|
21522
21524
|
...parsed,
|
|
21525
|
+
// An explicit environment override always wins, including when a persisted
|
|
21526
|
+
// config already exists. Existing installs on the retired official Render
|
|
21527
|
+
// default migrate to the endpoint baked into their installed dist-tag.
|
|
21528
|
+
cloudUrl: envCloudUrl ?? (migrateLegacyDefault ? DEFAULT_CLOUD_URL : parsed.cloudUrl ?? base.cloudUrl),
|
|
21523
21529
|
// Deep-merge consent so an old/partial config keeps the opt-in defaults
|
|
21524
21530
|
// for any channel it doesn't mention.
|
|
21525
21531
|
consent: { ...base.consent, ...parsed.consent ?? {} }
|
|
21526
21532
|
};
|
|
21533
|
+
if (migrateLegacyDefault && !envCloudUrl) saveConfig(resolved);
|
|
21534
|
+
return resolved;
|
|
21527
21535
|
}
|
|
21528
21536
|
function saveConfig(cfg) {
|
|
21529
21537
|
ensureDir(globalDir());
|
|
@@ -21551,12 +21559,13 @@ function clearActiveAgent(cfg = loadConfig()) {
|
|
|
21551
21559
|
saveConfig(next);
|
|
21552
21560
|
return next;
|
|
21553
21561
|
}
|
|
21554
|
-
var DEFAULT_CLOUD_URL;
|
|
21562
|
+
var LEGACY_CLOUD_URL, DEFAULT_CLOUD_URL;
|
|
21555
21563
|
var init_config = __esm({
|
|
21556
21564
|
"src/config.ts"() {
|
|
21557
21565
|
"use strict";
|
|
21558
21566
|
init_paths();
|
|
21559
|
-
|
|
21567
|
+
LEGACY_CLOUD_URL = "https://inerrata-gateway.onrender.com";
|
|
21568
|
+
DEFAULT_CLOUD_URL = true ? "https://dev.inerrata.dev" : DEV_CLOUD_URL;
|
|
21560
21569
|
}
|
|
21561
21570
|
});
|
|
21562
21571
|
|
|
@@ -21576,10 +21585,13 @@ function isLocalCloudUrl(url2) {
|
|
|
21576
21585
|
return false;
|
|
21577
21586
|
}
|
|
21578
21587
|
}
|
|
21588
|
+
function isMachinePlaneGatewayHost(host) {
|
|
21589
|
+
return host === "inerrata.dev" || host === "dev.inerrata.dev";
|
|
21590
|
+
}
|
|
21579
21591
|
function looksLikeGatewayCloudUrl(url2) {
|
|
21580
21592
|
try {
|
|
21581
21593
|
const host = new URL(url2).hostname.toLowerCase();
|
|
21582
|
-
return host.includes("gateway") || host.startsWith("gw.") || host.includes("-gw.");
|
|
21594
|
+
return host.includes("gateway") || host.startsWith("gw.") || host.includes("-gw.") || isMachinePlaneGatewayHost(host);
|
|
21583
21595
|
} catch {
|
|
21584
21596
|
return false;
|
|
21585
21597
|
}
|
|
@@ -42843,7 +42855,7 @@ function startLoopLagMonitor(thresholdMs = 1e3) {
|
|
|
42843
42855
|
}
|
|
42844
42856
|
|
|
42845
42857
|
// src/engine.ts
|
|
42846
|
-
var DAEMON_VERSION = true ? "2.0.0-dev.
|
|
42858
|
+
var DAEMON_VERSION = true ? "2.0.0-dev.58" : "2.0.0-alpha.0";
|
|
42847
42859
|
var IGNORED_PATH = /[\\/](?:\.git|node_modules|\.errata|\.claude|\.codex|\.cursor|\.turbo|\.next|dist|coverage|test-results|playwright-report|__pycache__)(?:[\\/]|$)/;
|
|
42848
42860
|
var IGNORED_NOISE = /castalia\.db|eventlog\.sqlite|turn-cursors/;
|
|
42849
42861
|
var GIT_OP_MUTE_MS = 4e3;
|
|
@@ -46056,6 +46068,10 @@ var cmd = argv[0] ?? "help";
|
|
|
46056
46068
|
var rest = argv.slice(1);
|
|
46057
46069
|
var NIGHTLY_INTERVAL_MS = 10 * 6e4;
|
|
46058
46070
|
async function main() {
|
|
46071
|
+
if (cmd === "--version" || cmd === "-V" || cmd === "version") {
|
|
46072
|
+
console.log(DAEMON_VERSION);
|
|
46073
|
+
return;
|
|
46074
|
+
}
|
|
46059
46075
|
if (cmd !== "help" && cmd !== "--help" && cmd !== "-h" && (rest.includes("--help") || rest.includes("-h"))) {
|
|
46060
46076
|
return printHelp();
|
|
46061
46077
|
}
|