@botcord/daemon 0.2.15 → 0.2.16

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/dist/index.js CHANGED
@@ -329,8 +329,9 @@ async function runDeviceCodeFlow(opts) {
329
329
  * plane (legacy P0 behavior — caller may still log a warning).
330
330
  *
331
331
  * Decision tree (plan §4.4 + §6.4):
332
- * 1. Have existing creds and no `--relogin` → return existing record.
333
- * 2. `--install-token` redeem the one-time dashboard ticket.
332
+ * 1. Have existing creds, no `--relogin`, no `--install-token` → return existing record.
333
+ * 2. `--install-token` (overrides existing creds they may be stale or
334
+ * belong to a different account) → redeem the one-time dashboard ticket.
334
335
  * 3. `--relogin` → device-code login.
335
336
  * 4. No creds + TTY → device-code login.
336
337
  * 5. No creds + no TTY → exit 1 with the §6.4 hint.
@@ -341,7 +342,7 @@ async function ensureUserAuthForStart(args) {
341
342
  const installToken = typeof args.flags["install-token"] === "string" ? args.flags["install-token"] : undefined;
342
343
  const relogin = args.flags.relogin === true;
343
344
  const existing = safeLoadUserAuth();
344
- if (!relogin && existing) {
345
+ if (!relogin && !installToken && existing) {
345
346
  // A previously-set auth-expired flag is stale by definition once the
346
347
  // operator runs `start` again — if creds genuinely don't work, the
347
348
  // control channel will re-write the flag on the next 4401/4403.
@@ -355,9 +356,6 @@ async function ensureUserAuthForStart(args) {
355
356
  if (labelFlag && existing.label !== labelFlag) {
356
357
  console.error(`note: --label "${labelFlag}" ignored (already logged in as "${existing.label ?? "<unset>"}"); pass --relogin to change it`);
357
358
  }
358
- if (installToken) {
359
- console.error("note: --install-token ignored because daemon is already logged in");
360
- }
361
359
  return existing;
362
360
  }
363
361
  // Need a fresh login. Resolve hubUrl: explicit --hub > existing record > DEFAULT_HUB.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@botcord/daemon",
3
- "version": "0.2.15",
3
+ "version": "0.2.16",
4
4
  "description": "BotCord local daemon — bridges Hub inbox push to local Claude Code / Codex / Gemini CLIs",
5
5
  "type": "module",
6
6
  "bin": {
package/src/index.ts CHANGED
@@ -417,8 +417,9 @@ async function runDeviceCodeFlow(opts: {
417
417
  * plane (legacy P0 behavior — caller may still log a warning).
418
418
  *
419
419
  * Decision tree (plan §4.4 + §6.4):
420
- * 1. Have existing creds and no `--relogin` → return existing record.
421
- * 2. `--install-token` redeem the one-time dashboard ticket.
420
+ * 1. Have existing creds, no `--relogin`, no `--install-token` → return existing record.
421
+ * 2. `--install-token` (overrides existing creds they may be stale or
422
+ * belong to a different account) → redeem the one-time dashboard ticket.
422
423
  * 3. `--relogin` → device-code login.
423
424
  * 4. No creds + TTY → device-code login.
424
425
  * 5. No creds + no TTY → exit 1 with the §6.4 hint.
@@ -432,7 +433,7 @@ async function ensureUserAuthForStart(args: ParsedArgs): Promise<UserAuthRecord
432
433
 
433
434
  const existing = safeLoadUserAuth();
434
435
 
435
- if (!relogin && existing) {
436
+ if (!relogin && !installToken && existing) {
436
437
  // A previously-set auth-expired flag is stale by definition once the
437
438
  // operator runs `start` again — if creds genuinely don't work, the
438
439
  // control channel will re-write the flag on the next 4401/4403.
@@ -448,9 +449,6 @@ async function ensureUserAuthForStart(args: ParsedArgs): Promise<UserAuthRecord
448
449
  `note: --label "${labelFlag}" ignored (already logged in as "${existing.label ?? "<unset>"}"); pass --relogin to change it`,
449
450
  );
450
451
  }
451
- if (installToken) {
452
- console.error("note: --install-token ignored because daemon is already logged in");
453
- }
454
452
  return existing;
455
453
  }
456
454