@inerrata-corporation/errata 2.0.6-dev.2562 → 2.0.6-dev.2564
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 +54 -2
- package/package.json +1 -1
package/errata.mjs
CHANGED
|
@@ -29234,6 +29234,9 @@ function workspaceEntryForPath(absPath) {
|
|
|
29234
29234
|
}
|
|
29235
29235
|
return best;
|
|
29236
29236
|
}
|
|
29237
|
+
function liveWorkspaceEntry(entry) {
|
|
29238
|
+
return read().workspaces[entry.id] ?? entry;
|
|
29239
|
+
}
|
|
29237
29240
|
function boundWorkspaceEntries() {
|
|
29238
29241
|
return Object.values(read().workspaces).filter((e) => e.installationProfile);
|
|
29239
29242
|
}
|
|
@@ -78332,7 +78335,7 @@ function createWatchBreaker(deps) {
|
|
|
78332
78335
|
}
|
|
78333
78336
|
|
|
78334
78337
|
// src/engine.ts
|
|
78335
|
-
var DAEMON_VERSION = true ? "2.0.6-dev.
|
|
78338
|
+
var DAEMON_VERSION = true ? "2.0.6-dev.2564" : "2.0.0-alpha.0";
|
|
78336
78339
|
var IGNORED_PATH = /[\\/](?:\.git|node_modules|\.errata|\.claude|\.codex|\.cursor|\.turbo|\.next|dist|coverage|test-results|playwright-report|__pycache__)(?:[\\/]|$)/;
|
|
78337
78340
|
var IGNORED_NOISE = /castalia\.db|eventlog\.sqlite|turn-cursors/;
|
|
78338
78341
|
var GIT_OP_MUTE_MS = 4e3;
|
|
@@ -81713,6 +81716,41 @@ var ConsolidateWorker = class {
|
|
|
81713
81716
|
// src/multi.ts
|
|
81714
81717
|
init_paths();
|
|
81715
81718
|
|
|
81719
|
+
// src/cloud-target.ts
|
|
81720
|
+
init_cloud_endpoint_policy();
|
|
81721
|
+
function describeCloudTarget(cfg, opts, env2, configPath) {
|
|
81722
|
+
const pinnedBy = [];
|
|
81723
|
+
if (opts.cloudUrl) pinnedBy.push("--cloud-url");
|
|
81724
|
+
if (opts.apiKey) pinnedBy.push("--api-key");
|
|
81725
|
+
if (env2["ERRATA_CLOUD_URL"]) pinnedBy.push("ERRATA_CLOUD_URL");
|
|
81726
|
+
if (env2["ERRATA_CONFIG_PATH"]) pinnedBy.push("ERRATA_CONFIG_PATH");
|
|
81727
|
+
return {
|
|
81728
|
+
url: normalizeCloudUrl(opts.cloudUrl ?? cfg.cloudUrl),
|
|
81729
|
+
profile: opts.apiKey ? null : cfg.activeInstallationProfile ?? null,
|
|
81730
|
+
credential: opts.apiKey ? "process-key" : cfg.accessToken ? "oauth" : cfg.apiKey ? "key" : "none",
|
|
81731
|
+
configPath,
|
|
81732
|
+
pinnedBy
|
|
81733
|
+
};
|
|
81734
|
+
}
|
|
81735
|
+
function cloudTargetDrift(daemon, shell2) {
|
|
81736
|
+
const out2 = [];
|
|
81737
|
+
if (daemon.url !== shell2.url) {
|
|
81738
|
+
out2.push(`the running daemon talks to ${daemon.url} \u2014 this shell resolves ${shell2.url}`);
|
|
81739
|
+
}
|
|
81740
|
+
if (daemon.profile !== shell2.profile) {
|
|
81741
|
+
out2.push(`daemon profile ${daemon.profile ?? "(none)"} \u2260 this shell's ${shell2.profile ?? "(none)"}`);
|
|
81742
|
+
}
|
|
81743
|
+
if (daemon.configPath !== shell2.configPath) {
|
|
81744
|
+
out2.push(`daemon reads ${daemon.configPath} \u2014 this shell reads ${shell2.configPath}`);
|
|
81745
|
+
}
|
|
81746
|
+
if (out2.length > 0) {
|
|
81747
|
+
out2.push(
|
|
81748
|
+
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)`
|
|
81749
|
+
);
|
|
81750
|
+
}
|
|
81751
|
+
return out2;
|
|
81752
|
+
}
|
|
81753
|
+
|
|
81716
81754
|
// src/lock.ts
|
|
81717
81755
|
import { existsSync as existsSync29, readFileSync as readFileSync28 } from "node:fs";
|
|
81718
81756
|
function daemonLockPayload(lock) {
|
|
@@ -85182,11 +85220,19 @@ async function startMultiDaemon(opts = {}) {
|
|
|
85182
85220
|
return hit?.count ?? -1;
|
|
85183
85221
|
};
|
|
85184
85222
|
let lastHook = null;
|
|
85223
|
+
const cloudTarget = () => {
|
|
85224
|
+
try {
|
|
85225
|
+
return describeCloudTarget(loadConfig(), { cloudUrl: opts.cloudUrl, apiKey: opts.apiKey }, process.env, globalConfigPath());
|
|
85226
|
+
} catch {
|
|
85227
|
+
return null;
|
|
85228
|
+
}
|
|
85229
|
+
};
|
|
85185
85230
|
app.get(
|
|
85186
85231
|
"/health",
|
|
85187
85232
|
(c) => c.json({
|
|
85188
85233
|
ok: true,
|
|
85189
85234
|
daemonVersion: DAEMON_VERSION,
|
|
85235
|
+
cloud: cloudTarget(),
|
|
85190
85236
|
lastHook,
|
|
85191
85237
|
// What the daemon is DOING, not just what it holds. Without these a
|
|
85192
85238
|
// pegged daemon is only diagnosable by attaching a CPU profiler to the
|
|
@@ -85937,7 +85983,7 @@ async function startMultiDaemon(opts = {}) {
|
|
|
85937
85983
|
}
|
|
85938
85984
|
};
|
|
85939
85985
|
for (const r of records) {
|
|
85940
|
-
const recordIdentity = identityFor(r.entry);
|
|
85986
|
+
const recordIdentity = identityFor(liveWorkspaceEntry(r.entry));
|
|
85941
85987
|
if (recordIdentity.invalid) {
|
|
85942
85988
|
noteIdentityBlock(r.id, r.entry.name, recordIdentity);
|
|
85943
85989
|
errors.push(`[${r.entry.name}] identity: ${recordIdentity.reason}`);
|
|
@@ -87621,6 +87667,7 @@ async function cmdStatus() {
|
|
|
87621
87667
|
const note = foreignDaemonNote(running, pathResolve2(process.argv[1]));
|
|
87622
87668
|
if (note) for (const l of note) console.log(` \u26A0 ${l}`);
|
|
87623
87669
|
}
|
|
87670
|
+
let daemonCloud = null;
|
|
87624
87671
|
if (running?.webUiUrl) {
|
|
87625
87672
|
try {
|
|
87626
87673
|
const res = await fetch(`${running.webUiUrl}/health`, {
|
|
@@ -87628,6 +87675,7 @@ async function cmdStatus() {
|
|
|
87628
87675
|
});
|
|
87629
87676
|
if (res.ok) {
|
|
87630
87677
|
const h = await res.json();
|
|
87678
|
+
daemonCloud = h.cloud ?? null;
|
|
87631
87679
|
if (h.pass) {
|
|
87632
87680
|
const held = h.pass.runningMs !== null && h.pass.current !== "idle" ? ` (${(h.pass.runningMs / 1e3).toFixed(1)}s)` : "";
|
|
87633
87681
|
const alsoCount = Math.max(0, (h.pass.active?.length ?? 0) - 1);
|
|
@@ -87663,6 +87711,10 @@ async function cmdStatus() {
|
|
|
87663
87711
|
);
|
|
87664
87712
|
console.log(` cloud:`);
|
|
87665
87713
|
console.log(` url: ${cfg.cloudUrl}`);
|
|
87714
|
+
if (daemonCloud) {
|
|
87715
|
+
const shellCloud = describeCloudTarget(cfg, {}, process.env, globalConfigPath());
|
|
87716
|
+
for (const line of cloudTargetDrift(daemonCloud, shellCloud)) console.log(` \u26A0 ${line}`);
|
|
87717
|
+
}
|
|
87666
87718
|
console.log(` profile: ${cfg.activeInstallationProfile ?? "(unbound legacy credential)"}`);
|
|
87667
87719
|
if (!hasCloudCredential(cfg)) {
|
|
87668
87720
|
console.log(` logged in: no`);
|