@inerrata-corporation/errata 2.0.0-dev.33 → 2.0.0-dev.34

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 +28 -14
  2. package/package.json +1 -1
package/errata.mjs CHANGED
@@ -41878,7 +41878,7 @@ function startLoopLagMonitor(thresholdMs = 1e3) {
41878
41878
  }
41879
41879
 
41880
41880
  // src/engine.ts
41881
- var DAEMON_VERSION = true ? "2.0.0-dev.33" : "2.0.0-alpha.0";
41881
+ var DAEMON_VERSION = true ? "2.0.0-dev.34" : "2.0.0-alpha.0";
41882
41882
  var IGNORED_PATH = /[\\/](?:\.git|node_modules|\.errata|\.claude|\.codex|\.cursor|\.turbo|\.next|dist|coverage|test-results|playwright-report|__pycache__)(?:[\\/]|$)/;
41883
41883
  var IGNORED_NOISE = /castalia\.db|eventlog\.sqlite|turn-cursors/;
41884
41884
  var GIT_OP_MUTE_MS = 4e3;
@@ -44673,6 +44673,15 @@ function parseBurstArgs(args2) {
44673
44673
  };
44674
44674
  }
44675
44675
 
44676
+ // src/login-mode.ts
44677
+ var OAUTH_DEFAULT_ENV = "ERRATA_DAEMON_OAUTH_DEFAULT";
44678
+ function isDaemonOAuthDefaultEnabled(env2 = process.env) {
44679
+ return env2[OAUTH_DEFAULT_ENV] === "1";
44680
+ }
44681
+ function shouldUseOAuthLogin(flags2, env2 = process.env) {
44682
+ return Boolean(flags2.oauth || !flags2.device && isDaemonOAuthDefaultEnabled(env2));
44683
+ }
44684
+
44676
44685
  // src/consolidation-trigger.ts
44677
44686
  var DEFAULT_CONSOLIDATION_POLICY = {
44678
44687
  baseFloorMs: 6e4,
@@ -44849,7 +44858,7 @@ Commands:
44849
44858
  Flags: --port N (default 7891)
44850
44859
  mcp Run the MCP stdio server \u2014 the agent's full errata tool
44851
44860
  surface (navigation, problems, claims, burst, health)
44852
- login Sign in with the cloud (OAuth by default; --device for legacy)
44861
+ login Sign in with the cloud (device-code by default; --oauth for OAuth)
44853
44862
  logout Clear local cloud credentials
44854
44863
  sync now Flush outbox to the cloud once
44855
44864
  privacy Show what is collected/scrubbed + your consent state
@@ -44864,6 +44873,7 @@ Commands:
44864
44873
  Environment:
44865
44874
  ERRATA_CLOUD_URL Cloud base URL (default ${DEFAULT_CLOUD_URL})
44866
44875
  ERRATA_ALLOW_DIRECT_V1_CLOUD=1 Allow non-local legacy v1 cloud testing
44876
+ ${OAUTH_DEFAULT_ENV}=1 Internal dogfood: plain \`errata login\` uses OAuth
44867
44877
  `);
44868
44878
  }
44869
44879
  function resolveHookPort(explicit) {
@@ -45215,20 +45225,24 @@ async function cmdLoginOAuth(cfg) {
45215
45225
  process.exitCode = 1;
45216
45226
  return;
45217
45227
  }
45218
- cfg.accessToken = result.tokens.accessToken;
45219
- cfg.refreshToken = result.tokens.refreshToken ?? null;
45220
- cfg.tokenEndpoint = result.tokenEndpoint;
45221
- cfg.oauthClientId = result.clientId;
45222
- cfg.apiKey = null;
45223
- saveConfig(cfg);
45228
+ const nextCfg = {
45229
+ ...cfg,
45230
+ accessToken: result.tokens.accessToken,
45231
+ refreshToken: result.tokens.refreshToken ?? null,
45232
+ tokenEndpoint: result.tokenEndpoint,
45233
+ oauthClientId: result.clientId,
45234
+ apiKey: null
45235
+ };
45224
45236
  try {
45225
- const me = await authedCloudClient(cfg).me();
45226
- cfg.userId = me.agentId;
45227
- cfg.email = me.handle;
45228
- saveConfig(cfg);
45237
+ const me = await authedCloudClient(nextCfg).me();
45238
+ nextCfg.userId = me.agentId;
45239
+ nextCfg.email = me.handle;
45240
+ saveConfig(nextCfg);
45229
45241
  console.log(`logged in as ${me.handle} (${me.tier}) \u2014 tokens stored at ${globalConfigPath()}`);
45230
45242
  } catch (err2) {
45231
- console.warn(`signed in, but identity check failed: ${err2 instanceof Error ? err2.message : err2}`);
45243
+ console.error(`signed in, but identity check failed: ${err2 instanceof Error ? err2.message : err2}`);
45244
+ console.error(` credentials were not stored; try again or paste a key: errata login --token <key>`);
45245
+ process.exitCode = 1;
45232
45246
  }
45233
45247
  }
45234
45248
  async function cmdLogin() {
@@ -45239,7 +45253,7 @@ async function cmdLogin() {
45239
45253
  await applyToken(cfg, flags2.token);
45240
45254
  return;
45241
45255
  }
45242
- if (flags2.oauth || !flags2.device) {
45256
+ if (shouldUseOAuthLogin(flags2)) {
45243
45257
  await cmdLoginOAuth(cfg);
45244
45258
  return;
45245
45259
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inerrata-corporation/errata",
3
- "version": "2.0.0-dev.33",
3
+ "version": "2.0.0-dev.34",
4
4
  "description": "errata - local-first observation engine for AI coding agents",
5
5
  "type": "module",
6
6
  "bin": {