@inerrata-corporation/errata 2.0.6-dev.2562 → 2.0.6-dev.2563
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
|
@@ -78332,7 +78332,7 @@ function createWatchBreaker(deps) {
|
|
|
78332
78332
|
}
|
|
78333
78333
|
|
|
78334
78334
|
// src/engine.ts
|
|
78335
|
-
var DAEMON_VERSION = true ? "2.0.6-dev.
|
|
78335
|
+
var DAEMON_VERSION = true ? "2.0.6-dev.2563" : "2.0.0-alpha.0";
|
|
78336
78336
|
var IGNORED_PATH = /[\\/](?:\.git|node_modules|\.errata|\.claude|\.codex|\.cursor|\.turbo|\.next|dist|coverage|test-results|playwright-report|__pycache__)(?:[\\/]|$)/;
|
|
78337
78337
|
var IGNORED_NOISE = /castalia\.db|eventlog\.sqlite|turn-cursors/;
|
|
78338
78338
|
var GIT_OP_MUTE_MS = 4e3;
|
|
@@ -81713,6 +81713,41 @@ var ConsolidateWorker = class {
|
|
|
81713
81713
|
// src/multi.ts
|
|
81714
81714
|
init_paths();
|
|
81715
81715
|
|
|
81716
|
+
// src/cloud-target.ts
|
|
81717
|
+
init_cloud_endpoint_policy();
|
|
81718
|
+
function describeCloudTarget(cfg, opts, env2, configPath) {
|
|
81719
|
+
const pinnedBy = [];
|
|
81720
|
+
if (opts.cloudUrl) pinnedBy.push("--cloud-url");
|
|
81721
|
+
if (opts.apiKey) pinnedBy.push("--api-key");
|
|
81722
|
+
if (env2["ERRATA_CLOUD_URL"]) pinnedBy.push("ERRATA_CLOUD_URL");
|
|
81723
|
+
if (env2["ERRATA_CONFIG_PATH"]) pinnedBy.push("ERRATA_CONFIG_PATH");
|
|
81724
|
+
return {
|
|
81725
|
+
url: normalizeCloudUrl(opts.cloudUrl ?? cfg.cloudUrl),
|
|
81726
|
+
profile: opts.apiKey ? null : cfg.activeInstallationProfile ?? null,
|
|
81727
|
+
credential: opts.apiKey ? "process-key" : cfg.accessToken ? "oauth" : cfg.apiKey ? "key" : "none",
|
|
81728
|
+
configPath,
|
|
81729
|
+
pinnedBy
|
|
81730
|
+
};
|
|
81731
|
+
}
|
|
81732
|
+
function cloudTargetDrift(daemon, shell2) {
|
|
81733
|
+
const out2 = [];
|
|
81734
|
+
if (daemon.url !== shell2.url) {
|
|
81735
|
+
out2.push(`the running daemon talks to ${daemon.url} \u2014 this shell resolves ${shell2.url}`);
|
|
81736
|
+
}
|
|
81737
|
+
if (daemon.profile !== shell2.profile) {
|
|
81738
|
+
out2.push(`daemon profile ${daemon.profile ?? "(none)"} \u2260 this shell's ${shell2.profile ?? "(none)"}`);
|
|
81739
|
+
}
|
|
81740
|
+
if (daemon.configPath !== shell2.configPath) {
|
|
81741
|
+
out2.push(`daemon reads ${daemon.configPath} \u2014 this shell reads ${shell2.configPath}`);
|
|
81742
|
+
}
|
|
81743
|
+
if (out2.length > 0) {
|
|
81744
|
+
out2.push(
|
|
81745
|
+
daemon.pinnedBy.length > 0 ? `the daemon is pinned by ${daemon.pinnedBy.join(", ")} \u2014 restart it from a shell without that override (errata stop; errata start)` : `restart the daemon to adopt this shell's config (errata stop; errata start)`
|
|
81746
|
+
);
|
|
81747
|
+
}
|
|
81748
|
+
return out2;
|
|
81749
|
+
}
|
|
81750
|
+
|
|
81716
81751
|
// src/lock.ts
|
|
81717
81752
|
import { existsSync as existsSync29, readFileSync as readFileSync28 } from "node:fs";
|
|
81718
81753
|
function daemonLockPayload(lock) {
|
|
@@ -85182,11 +85217,19 @@ async function startMultiDaemon(opts = {}) {
|
|
|
85182
85217
|
return hit?.count ?? -1;
|
|
85183
85218
|
};
|
|
85184
85219
|
let lastHook = null;
|
|
85220
|
+
const cloudTarget = () => {
|
|
85221
|
+
try {
|
|
85222
|
+
return describeCloudTarget(loadConfig(), { cloudUrl: opts.cloudUrl, apiKey: opts.apiKey }, process.env, globalConfigPath());
|
|
85223
|
+
} catch {
|
|
85224
|
+
return null;
|
|
85225
|
+
}
|
|
85226
|
+
};
|
|
85185
85227
|
app.get(
|
|
85186
85228
|
"/health",
|
|
85187
85229
|
(c) => c.json({
|
|
85188
85230
|
ok: true,
|
|
85189
85231
|
daemonVersion: DAEMON_VERSION,
|
|
85232
|
+
cloud: cloudTarget(),
|
|
85190
85233
|
lastHook,
|
|
85191
85234
|
// What the daemon is DOING, not just what it holds. Without these a
|
|
85192
85235
|
// pegged daemon is only diagnosable by attaching a CPU profiler to the
|
|
@@ -87621,6 +87664,7 @@ async function cmdStatus() {
|
|
|
87621
87664
|
const note = foreignDaemonNote(running, pathResolve2(process.argv[1]));
|
|
87622
87665
|
if (note) for (const l of note) console.log(` \u26A0 ${l}`);
|
|
87623
87666
|
}
|
|
87667
|
+
let daemonCloud = null;
|
|
87624
87668
|
if (running?.webUiUrl) {
|
|
87625
87669
|
try {
|
|
87626
87670
|
const res = await fetch(`${running.webUiUrl}/health`, {
|
|
@@ -87628,6 +87672,7 @@ async function cmdStatus() {
|
|
|
87628
87672
|
});
|
|
87629
87673
|
if (res.ok) {
|
|
87630
87674
|
const h = await res.json();
|
|
87675
|
+
daemonCloud = h.cloud ?? null;
|
|
87631
87676
|
if (h.pass) {
|
|
87632
87677
|
const held = h.pass.runningMs !== null && h.pass.current !== "idle" ? ` (${(h.pass.runningMs / 1e3).toFixed(1)}s)` : "";
|
|
87633
87678
|
const alsoCount = Math.max(0, (h.pass.active?.length ?? 0) - 1);
|
|
@@ -87663,6 +87708,10 @@ async function cmdStatus() {
|
|
|
87663
87708
|
);
|
|
87664
87709
|
console.log(` cloud:`);
|
|
87665
87710
|
console.log(` url: ${cfg.cloudUrl}`);
|
|
87711
|
+
if (daemonCloud) {
|
|
87712
|
+
const shellCloud = describeCloudTarget(cfg, {}, process.env, globalConfigPath());
|
|
87713
|
+
for (const line of cloudTargetDrift(daemonCloud, shellCloud)) console.log(` \u26A0 ${line}`);
|
|
87714
|
+
}
|
|
87666
87715
|
console.log(` profile: ${cfg.activeInstallationProfile ?? "(unbound legacy credential)"}`);
|
|
87667
87716
|
if (!hasCloudCredential(cfg)) {
|
|
87668
87717
|
console.log(` logged in: no`);
|