@inerrata-corporation/errata 2.0.17-dev.3562 → 2.0.17-dev.3564
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 +60 -9
- package/package.json +1 -1
package/errata.mjs
CHANGED
|
@@ -33036,6 +33036,7 @@ var init_consent = __esm({
|
|
|
33036
33036
|
});
|
|
33037
33037
|
|
|
33038
33038
|
// src/git-remote.ts
|
|
33039
|
+
import { spawnSync } from "node:child_process";
|
|
33039
33040
|
import { existsSync as existsSync10, readFileSync as readFileSync8, statSync } from "node:fs";
|
|
33040
33041
|
import { isAbsolute as isAbsolute2, join as join8, resolve as resolve2 } from "node:path";
|
|
33041
33042
|
function resolveGitDir(root) {
|
|
@@ -33083,12 +33084,41 @@ function detectRepoLocator(root, remote) {
|
|
|
33083
33084
|
const remotes = readRemotes(root);
|
|
33084
33085
|
if (remotes.length === 0) return null;
|
|
33085
33086
|
const pick2 = remote ? remotes.find((r) => r.name === remote) ?? null : remotes.find((r) => r.name === "origin") ?? (remotes.length === 1 ? remotes[0] : null);
|
|
33086
|
-
return pick2 ? normalizeRepoLocator(pick2.url) : null;
|
|
33087
|
+
return pick2 ? normalizeRepoLocator(resolveSshHostAlias(pick2.url)) : null;
|
|
33087
33088
|
}
|
|
33089
|
+
function sshConfigHostname(alias) {
|
|
33090
|
+
if (resolvedAliases.has(alias)) return resolvedAliases.get(alias);
|
|
33091
|
+
let host = null;
|
|
33092
|
+
try {
|
|
33093
|
+
const out2 = spawnSync("ssh", ["-G", alias], { encoding: "utf8", timeout: 3e3, windowsHide: true });
|
|
33094
|
+
if (out2.status === 0) host = /^hostname\s+(\S+)\s*$/im.exec(out2.stdout)?.[1]?.toLowerCase() ?? null;
|
|
33095
|
+
} catch {
|
|
33096
|
+
host = null;
|
|
33097
|
+
}
|
|
33098
|
+
resolvedAliases.set(alias, host);
|
|
33099
|
+
return host;
|
|
33100
|
+
}
|
|
33101
|
+
function resolveSshHostAlias(remoteUrl, resolveHost = sshConfigHostname) {
|
|
33102
|
+
const raw2 = remoteUrl.trim();
|
|
33103
|
+
const m = SSH_URL_REMOTE.exec(raw2) ?? (/^[a-z][a-z0-9+.-]*:\/\//i.test(raw2) ? null : SSH_SCP_REMOTE.exec(raw2));
|
|
33104
|
+
if (!m) return raw2;
|
|
33105
|
+
const prefix = m[1];
|
|
33106
|
+
const alias = m[2];
|
|
33107
|
+
const rest2 = m[3];
|
|
33108
|
+
if (alias.length === 1 || CANONICAL_FORGE_HOSTS.has(alias.toLowerCase())) return raw2;
|
|
33109
|
+
const real = resolveHost(alias);
|
|
33110
|
+
if (!real || real === alias.toLowerCase()) return raw2;
|
|
33111
|
+
return SSH_URL_REMOTE.test(raw2) ? `${prefix}${real}${rest2}` : `${prefix}${real}:${rest2}`;
|
|
33112
|
+
}
|
|
33113
|
+
var CANONICAL_FORGE_HOSTS, SSH_SCP_REMOTE, SSH_URL_REMOTE, resolvedAliases;
|
|
33088
33114
|
var init_git_remote = __esm({
|
|
33089
33115
|
"src/git-remote.ts"() {
|
|
33090
33116
|
"use strict";
|
|
33091
33117
|
init_src();
|
|
33118
|
+
CANONICAL_FORGE_HOSTS = /* @__PURE__ */ new Set(["github.com", "gitlab.com", "bitbucket.org", "codeberg.org"]);
|
|
33119
|
+
SSH_SCP_REMOTE = /^((?:[^@/]+@)?)([^:/@]+):(?!\/\/)(.+)$/;
|
|
33120
|
+
SSH_URL_REMOTE = /^(ssh:\/\/(?:[^@/]+@)?)([^:/@]+)((?::\d+)?\/.*)$/i;
|
|
33121
|
+
resolvedAliases = /* @__PURE__ */ new Map();
|
|
33092
33122
|
}
|
|
33093
33123
|
});
|
|
33094
33124
|
|
|
@@ -82634,7 +82664,7 @@ function createWatchBreaker(deps) {
|
|
|
82634
82664
|
}
|
|
82635
82665
|
|
|
82636
82666
|
// src/engine.ts
|
|
82637
|
-
var DAEMON_VERSION = true ? "2.0.17-dev.
|
|
82667
|
+
var DAEMON_VERSION = true ? "2.0.17-dev.3564" : "2.0.0-alpha.0";
|
|
82638
82668
|
var IGNORED_PATH = /[\\/](?:\.git|node_modules|\.errata|\.claude|\.codex|\.cursor|\.turbo|\.next|dist|coverage|test-results|playwright-report|__pycache__)(?:[\\/]|$)/;
|
|
82639
82669
|
var IGNORED_NOISE = /castalia\.db|eventlog\.sqlite|turn-cursors/;
|
|
82640
82670
|
var GIT_OP_MUTE_MS = 4e3;
|
|
@@ -91838,7 +91868,7 @@ function shouldUseOAuthLogin(flags2, env2 = process.env) {
|
|
|
91838
91868
|
}
|
|
91839
91869
|
|
|
91840
91870
|
// src/doctor.ts
|
|
91841
|
-
import { spawnSync } from "node:child_process";
|
|
91871
|
+
import { spawnSync as spawnSync2 } from "node:child_process";
|
|
91842
91872
|
|
|
91843
91873
|
// src/codex-runtime.ts
|
|
91844
91874
|
import { readdirSync as readdirSync12, statSync as statSync9 } from "node:fs";
|
|
@@ -91873,7 +91903,7 @@ function resolveCodexExecutable(options = {}) {
|
|
|
91873
91903
|
// src/doctor.ts
|
|
91874
91904
|
function installedHarnessVersion(bin) {
|
|
91875
91905
|
try {
|
|
91876
|
-
const r =
|
|
91906
|
+
const r = spawnSync2(bin === "codex" ? resolveCodexExecutable() : bin, ["--version"], { encoding: "utf8", timeout: 3e3, windowsHide: true });
|
|
91877
91907
|
if (r.status !== 0 && !r.stdout) return null;
|
|
91878
91908
|
const m = /(\d+\.\d+\.\d+)/.exec(`${r.stdout ?? ""}${r.stderr ?? ""}`);
|
|
91879
91909
|
return m ? m[1] : null;
|
|
@@ -92991,8 +93021,9 @@ async function cmdInit() {
|
|
|
92991
93021
|
console.log("");
|
|
92992
93022
|
console.log("Privacy: your code, file contents, and raw error text never leave");
|
|
92993
93023
|
console.log("this machine \u2014 only scrubbed, canonical lessons can (consent-gated).");
|
|
92994
|
-
console.log("Cloud sync + telemetry are OFF
|
|
92995
|
-
console.log(" errata
|
|
93024
|
+
console.log("Cloud sync + telemetry are OFF until you choose otherwise:");
|
|
93025
|
+
console.log(" errata link # per repo: pick its project + what it shares, in the Console");
|
|
93026
|
+
console.log(" errata consent sync on # machine default for repos you haven't linked");
|
|
92996
93027
|
console.log(" errata consent telemetry on # counts-only product metrics");
|
|
92997
93028
|
console.log("To CONTRIBUTE to the shared graph you must ALSO attest this daemon:");
|
|
92998
93029
|
console.log(" errata login # console sign-in (OAuth) \u2014 grants graph-write");
|
|
@@ -93014,7 +93045,7 @@ async function cmdInit() {
|
|
|
93014
93045
|
return;
|
|
93015
93046
|
}
|
|
93016
93047
|
console.log("");
|
|
93017
|
-
console.log("connecting your cloud account
|
|
93048
|
+
console.log("connecting your cloud account...");
|
|
93018
93049
|
await cmdLoginOAuth(cfgNow);
|
|
93019
93050
|
cfgNow = loadConfig();
|
|
93020
93051
|
if (!hasCloudCredential(cfgNow)) {
|
|
@@ -93023,14 +93054,32 @@ async function cmdInit() {
|
|
|
93023
93054
|
return;
|
|
93024
93055
|
}
|
|
93025
93056
|
}
|
|
93057
|
+
let profileNow = loadProfile(ROOT);
|
|
93058
|
+
if (process.stdout.isTTY && !rest.includes("--no-link") && !rest.includes("--no-login") && profileNow && !profileNow.projectId) {
|
|
93059
|
+
refreshRepoLocator(ROOT, profileNow);
|
|
93060
|
+
if (profileNow.repoLocator) {
|
|
93061
|
+
console.log("");
|
|
93062
|
+
console.log(`linking ${profileNow.repoLocator} to its project (choose org, team and privacy in the Console)...`);
|
|
93063
|
+
await cmdLink(rest.includes("--no-browser") ? ["--no-browser"] : []);
|
|
93064
|
+
if (process.exitCode === 1) {
|
|
93065
|
+
console.log(" (init itself succeeded \u2014 retry the link any time with `errata link`)");
|
|
93066
|
+
process.exitCode = 0;
|
|
93067
|
+
}
|
|
93068
|
+
profileNow = loadProfile(ROOT);
|
|
93069
|
+
}
|
|
93070
|
+
}
|
|
93026
93071
|
console.log("");
|
|
93027
93072
|
console.log("Next:");
|
|
93028
93073
|
console.log(" errata start # observe this repo");
|
|
93029
93074
|
if (!hasCloudCredential(cfgNow)) {
|
|
93030
93075
|
console.log(" errata login # connect a cloud account (or: --token <key>)");
|
|
93031
93076
|
}
|
|
93032
|
-
if (!
|
|
93033
|
-
|
|
93077
|
+
if (!profileNow?.projectId) {
|
|
93078
|
+
if (profileNow?.repoLocator) {
|
|
93079
|
+
console.log(" errata link # link this repo to its project (sets its privacy choices)");
|
|
93080
|
+
} else {
|
|
93081
|
+
console.log(" git remote add origin <url> # then: errata link (a project is found by its remote)");
|
|
93082
|
+
}
|
|
93034
93083
|
}
|
|
93035
93084
|
console.log(" errata status # verify the whole chain");
|
|
93036
93085
|
}
|
|
@@ -93794,6 +93843,8 @@ async function cmdLink(args2) {
|
|
|
93794
93843
|
}
|
|
93795
93844
|
profile.repoRemote = remote;
|
|
93796
93845
|
profile.repoLocator = loc;
|
|
93846
|
+
} else {
|
|
93847
|
+
refreshRepoLocator(ROOT, profile);
|
|
93797
93848
|
}
|
|
93798
93849
|
if (!wantsLocal) {
|
|
93799
93850
|
if (!profile.repoLocator) {
|