@inerrata-corporation/errata 2.0.18-dev.3596 → 2.0.18-dev.3597

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.
Files changed (2) hide show
  1. package/errata.mjs +44 -13
  2. package/package.json +1 -1
package/errata.mjs CHANGED
@@ -82685,7 +82685,7 @@ function createWatchBreaker(deps) {
82685
82685
  }
82686
82686
 
82687
82687
  // src/engine.ts
82688
- var DAEMON_VERSION = true ? "2.0.18-dev.3596" : "2.0.0-alpha.0";
82688
+ var DAEMON_VERSION = true ? "2.0.18-dev.3597" : "2.0.0-alpha.0";
82689
82689
  var IGNORED_PATH = /[\\/](?:\.git|node_modules|\.errata|\.claude|\.codex|\.cursor|\.turbo|\.next|dist|coverage|test-results|playwright-report|__pycache__)(?:[\\/]|$)/;
82690
82690
  var IGNORED_NOISE = /castalia\.db|eventlog\.sqlite|turn-cursors/;
82691
82691
  var GIT_OP_MUTE_MS = 4e3;
@@ -85531,6 +85531,17 @@ function workspaceCloud(cfg, entry, env2 = process.env) {
85531
85531
  profileName: name2
85532
85532
  };
85533
85533
  }
85534
+ function reportedIdentity(cfg, entry, env2 = process.env) {
85535
+ try {
85536
+ const ws = workspaceCloud(cfg, entry, env2);
85537
+ const machineDefault = cfg.activeInstallationProfile;
85538
+ const note = entry && ws.profileName !== machineDefault ? `this workspace pushes as profile "${ws.profileName ?? "top-level credential"}" (${ws.identity.reason}); machine default is "${machineDefault ?? "top-level credential"}"` : null;
85539
+ return { ok: true, config: ws.config, client: ws.client, profileName: ws.profileName, note };
85540
+ } catch (err2) {
85541
+ if (err2 instanceof IdentityBlockedError) return { ok: false, reason: err2.message };
85542
+ throw err2;
85543
+ }
85544
+ }
85534
85545
  function configWithDeviceLogin(cfg, input) {
85535
85546
  const name2 = input.profileName.trim();
85536
85547
  if (!name2 || name2.length > 80) throw new Error("profile name must be 1\u201380 characters");
@@ -92916,6 +92927,10 @@ async function main() {
92916
92927
  return cmdLogout();
92917
92928
  case "link":
92918
92929
  return cmdLink(rest);
92930
+ // Moving a workspace to another org/team IS the console link flow (the
92931
+ // page offers every org and team the person is in); `switch` names it.
92932
+ case "switch":
92933
+ return cmdLink(rest.filter((a) => a !== "--local"));
92919
92934
  case "unlink":
92920
92935
  return cmdUnlink();
92921
92936
  case "use":
@@ -93074,6 +93089,10 @@ Commands:
93074
93089
  --remote <name> derive the locator from a non-origin remote;
93075
93090
  --name <name> mint a locator-less project; no flags = re-resolve now
93076
93091
  --skip-hooks leave existing harness configuration unchanged
93092
+ switch Move THIS workspace to another of your orgs or teams (e.g. a
93093
+ company org \u2192 your personal org). Opens the Console to pick;
93094
+ only this workspace changes \u2014 your machine default and other
93095
+ workspaces stay put. Check with \`errata whoami\` from inside it.
93077
93096
  unlink Detach from the cloud project + disable ambient re-linking
93078
93097
  use [<handle>] Set the sticky session active agent the daemon acts as.
93079
93098
  No arg lists the agents you can act as + the current one;
@@ -93479,15 +93498,20 @@ async function cmdStatus() {
93479
93498
  const shellCloud = describeCloudTarget(cfg, {}, process.env, globalConfigPath());
93480
93499
  for (const line of cloudTargetDrift(daemonCloud, shellCloud)) console.log(` \u26A0 ${line}`);
93481
93500
  }
93482
- console.log(` profile: ${cfg.activeInstallationProfile ?? "(unbound legacy credential)"}`);
93483
- if (!hasCloudCredential(cfg)) {
93501
+ const shown = reportedIdentity(cfg, workspaceEntryForPath(ROOT));
93502
+ const ecfg = shown.ok ? shown.config : cfg;
93503
+ console.log(` profile: ${ecfg.activeInstallationProfile ?? "(unbound legacy credential)"}`);
93504
+ if (!shown.ok) console.log(` \u26A0 ${shown.reason} \u2014 this workspace's capture holds locally until fixed`);
93505
+ else if (shown.note) console.log(` \u21B3 ${shown.note}`);
93506
+ const who = shown.ok && shown.note ? "" : ` (${ecfg.email})`;
93507
+ if (!hasCloudCredential(ecfg)) {
93484
93508
  console.log(` logged in: no`);
93485
- } else if (cfg.accessToken) {
93486
- console.log(` logged in: yes (${cfg.email}) \u2014 attested daemon, can contribute`);
93509
+ } else if (ecfg.accessToken) {
93510
+ console.log(` logged in: yes${who} \u2014 attested daemon, can contribute`);
93487
93511
  } else {
93488
- console.log(` logged in: yes (${cfg.email}) \u2014 key capability enforced by Console installation/scopes`);
93512
+ console.log(` logged in: yes${who} \u2014 key capability enforced by Console installation/scopes`);
93489
93513
  }
93490
- const active3 = getActiveAgent(cfg);
93514
+ const active3 = getActiveAgent(ecfg);
93491
93515
  console.log(
93492
93516
  ` active agent: ${active3 ? `${active3.handle} (acting-as; \`errata use --none\` to clear)` : "default identity"}`
93493
93517
  );
@@ -93499,7 +93523,7 @@ async function cmdStatus() {
93499
93523
  console.log(` policy: blocked - ${decision.reason}`);
93500
93524
  if (decision.guidance) console.log(` ${decision.guidance}`);
93501
93525
  }
93502
- if (hasCloudCredential(cfg)) {
93526
+ if (hasCloudCredential(ecfg)) {
93503
93527
  if (!decision.allowed) {
93504
93528
  console.log(
93505
93529
  ` reachable: ${inspection.reachable ? `yes (${inspection.probe})` : `no (${inspection.error ?? "unreachable"})`}`
@@ -93508,7 +93532,7 @@ async function cmdStatus() {
93508
93532
  return;
93509
93533
  }
93510
93534
  try {
93511
- const c = authedCloudClient(cfg);
93535
+ const c = shown.ok ? shown.client : authedCloudClient(cfg);
93512
93536
  const me = await c.me();
93513
93537
  console.log(` reachable: yes \xB7 authenticated as ${me.handle} (${me.tier})`);
93514
93538
  } catch (err2) {
@@ -93603,19 +93627,26 @@ async function cmdWhoami(args2) {
93603
93627
  if (identity.invalid) process.exitCode = 1;
93604
93628
  return;
93605
93629
  }
93606
- if (!hasCloudCredential(cfg)) {
93630
+ const shown = reportedIdentity(cfg, workspaceEntryForPath(ROOT));
93631
+ if (!shown.ok) {
93632
+ console.error(`${shown.reason} \u2014 this workspace's capture holds locally (see \`errata whoami --workspace\`)`);
93633
+ process.exitCode = 1;
93634
+ return;
93635
+ }
93636
+ if (!hasCloudCredential(shown.config)) {
93607
93637
  console.error("not logged in \u2014 run `errata login` or select an installation profile");
93608
93638
  process.exitCode = 1;
93609
93639
  return;
93610
93640
  }
93611
93641
  try {
93612
- const active3 = getActiveAgent(cfg);
93613
- const response = await resolveWhoami(authedCloudClient(cfg), active3?.handle ?? null);
93642
+ const active3 = getActiveAgent(shown.config);
93643
+ const response = await resolveWhoami(shown.client, active3?.handle ?? null);
93614
93644
  if (args2.includes("--json")) {
93615
93645
  console.log(JSON.stringify(response, null, 2));
93616
93646
  return;
93617
93647
  }
93618
- for (const line of formatWhoami(response, cfg.activeInstallationProfile)) console.log(line);
93648
+ if (shown.note) console.log(`(${shown.note})`);
93649
+ for (const line of formatWhoami(response, shown.profileName ?? null)) console.log(line);
93619
93650
  } catch (err2) {
93620
93651
  console.error(`could not resolve context: ${err2 instanceof Error ? err2.message : err2}`);
93621
93652
  process.exitCode = 1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inerrata-corporation/errata",
3
- "version": "2.0.18-dev.3596",
3
+ "version": "2.0.18-dev.3597",
4
4
  "description": "errata - local-first observation engine for AI coding agents",
5
5
  "type": "module",
6
6
  "bin": {