ccdeck 3.82.0 → 3.82.2

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.
@@ -1 +1 @@
1
- import"./app-BK08kq7X.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const e of document.querySelectorAll('link[rel="modulepreload"]'))i(e);new MutationObserver(e=>{for(const r of e)if(r.type==="childList")for(const o of r.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function s(e){const r={};return e.integrity&&(r.integrity=e.integrity),e.referrerPolicy&&(r.referrerPolicy=e.referrerPolicy),e.crossOrigin==="use-credentials"?r.credentials="include":e.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function i(e){if(e.ep)return;e.ep=!0;const r=s(e);fetch(e.href,r)}})();
1
+ import"./app-BP4tkqfl.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const e of document.querySelectorAll('link[rel="modulepreload"]'))i(e);new MutationObserver(e=>{for(const r of e)if(r.type==="childList")for(const o of r.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function s(e){const r={};return e.integrity&&(r.integrity=e.integrity),e.referrerPolicy&&(r.referrerPolicy=e.referrerPolicy),e.crossOrigin==="use-credentials"?r.credentials="include":e.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function i(e){if(e.ep)return;e.ep=!0;const r=s(e);fetch(e.href,r)}})();
@@ -77,9 +77,9 @@
77
77
  document.documentElement.setAttribute("data-density", density === "tightest" || density === "tighter" || density === "compact" || density === "comfortable" ? density : "default");
78
78
  })();
79
79
  </script>
80
- <script type="module" crossorigin src="/assets/index-B3icWRJZ.js"></script>
81
- <link rel="modulepreload" crossorigin href="/assets/app-BK08kq7X.js">
82
- <link rel="stylesheet" crossorigin href="/assets/app-BIrh5Q0W.css">
80
+ <script type="module" crossorigin src="/assets/index-BR00GbtO.js"></script>
81
+ <link rel="modulepreload" crossorigin href="/assets/app-BP4tkqfl.js">
82
+ <link rel="stylesheet" crossorigin href="/assets/app-CbXmr9rC.css">
83
83
  </head>
84
84
  <body>
85
85
  <div id="root"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccdeck",
3
- "version": "3.82.0",
3
+ "version": "3.82.2",
4
4
  "description": "Local dashboard for Claude Code and Codex CLI sessions: which Claude Code session needs input, every tool call and Claude Code subagent live, token cost and quota, several Claude accounts. Run npx ccdeck.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -84,6 +84,8 @@
84
84
  "without one."
85
85
  ],
86
86
  "//summaries": {
87
+ "3.82.2": "Arrow keys show the selected row on ccdeck tui's Network tab",
88
+ "3.82.1":"Clearer network shortcuts, accurate account capacity and Codex recovery fixes",
87
89
  "3.82.0": "Steadier Codex switching, and uninstall cleans up Codex's terminal selection",
88
90
  "3.81.4": "Codex account switching works with Windows sandbox logins",
89
91
  "3.81.3": "More reliable Codex switching and quieter account rows",
@@ -141,6 +143,31 @@
141
143
  "3.53.1",
142
144
  "3.53.3"
143
145
  ],
146
+ "3.82.2": [
147
+ {
148
+ "title": "⌨️ Arrow keys show where you are on ccdeck tui's Network tab",
149
+ "body": "In ccdeck tui, ↑ and ↓ on the Network tab now highlight the row you are on and scroll the list to it."
150
+ }
151
+ ],
152
+ "3.82.1": [
153
+ {
154
+ "title": "Local network controls, easier to find",
155
+ "body": "Open this deck’s network settings or the network graph directly from the Local network row.",
156
+ "priority": "highlight"
157
+ },
158
+ {
159
+ "title": "More accurate account capacity",
160
+ "body": "Accounts at their weekly limit no longer inflate the average remaining five-hour capacity.",
161
+ "priority": "highlight",
162
+ "icon": "accounts"
163
+ },
164
+ {
165
+ "title": "Codex account recovery fixes",
166
+ "body": "Codex account control can recover after temporary startup timeouts and checks account changes again when reconnecting.",
167
+ "priority": "highlight",
168
+ "icon": "accounts"
169
+ }
170
+ ],
144
171
  "3.82.0": [
145
172
  {
146
173
  "title": "🔄 Codex switching recovers instead of staying stuck",
@@ -146,20 +146,30 @@ export function createCodexLiveAccountController(input = {}) {
146
146
  return;
147
147
  }
148
148
  try {
149
+ if (!await lease?.valid()) throw liveError('native_control_lost');
150
+ if (owner !== rpc || !owned || closed || ownershipPaused || epoch !== ownershipEpoch) return;
149
151
  const next = await credentialFor(credential.profileId, { refresh: true });
150
152
  if (closed || owner !== rpc || !owned || ownershipPaused || epoch !== ownershipEpoch) return;
151
153
  if (next.accountId !== previous) throw liveError('profile_changed');
152
154
  const actual = await owner.request('account/read', { refreshToken: false });
153
155
  if (closed || owner !== rpc || ownershipPaused || epoch !== ownershipEpoch) return;
154
156
  if (!sameAccount(actual, next)) { await externalChange(); return; }
157
+ // A profile can be removed after its credential read has finished.
158
+ // Do not keep renewing a login whose row/home is no longer available.
159
+ const latest = await selection();
160
+ if (!latest.profiles?.some(p => p.id === credential.profileId && p.available !== false)) throw liveError('profile_unavailable');
161
+ if (!await lease?.valid()) throw liveError('native_control_lost');
162
+ if (closed || owner !== rpc || !owned || ownershipPaused || epoch !== ownershipEpoch) return;
155
163
  // ExternalAuthBridge::refresh returns the auth directly; it does not
156
164
  // emit account/updated. Do not leave a notification-suppression window.
157
165
  credential = next; lastRefresh = Date.now();
158
166
  owner.send({ id: message.id, result: { accessToken: next.accessToken, chatgptAccountId: next.accountId, chatgptPlanType: next.planType } });
159
- } catch {
167
+ } catch (error) {
168
+ if (closed || owner !== rpc || !owned || ownershipPaused || epoch !== ownershipEpoch) return;
160
169
  // Never return paths, token values or provider error text on the wire.
161
170
  try { owner.send({ id: message.id, error: { code: -32000, message: 'Selected Codex login could not be renewed.' } }); } catch { /* connection ended */ }
162
- update({ state: 'failed', reason: 'credential_refresh_failed' });
171
+ if (['native_control_lost', 'profile_unavailable'].includes(error?.code)) await externalChange(error.code);
172
+ else update({ state: 'failed', reason: 'credential_refresh_failed' });
163
173
  }
164
174
  });
165
175
  }
@@ -261,6 +271,10 @@ export function createCodexLiveAccountController(input = {}) {
261
271
  throw liveError('auto_switch_disabled');
262
272
  }
263
273
  };
274
+ const assertProfileAvailable = async () => {
275
+ const latest = await selection();
276
+ if (!latest.profiles?.some(p => p.id === intent.id && p.available !== false)) throw liveError('profile_unavailable');
277
+ };
264
278
  const authCurrent = () => !closed && !ownershipPaused && epoch === ownershipEpoch;
265
279
  const owner = () => authCurrent() && currentIntent()?.revision === intent.revision && currentIntent()?.id === intent.id;
266
280
  const verifyOwnership = async () => {
@@ -286,6 +300,7 @@ export function createCodexLiveAccountController(input = {}) {
286
300
  if (!s.profiles?.some(p => p.id === intent.id && p.available !== false)) throw liveError('profile_unavailable');
287
301
  await ensureRpc(s.originalHome);
288
302
  const next = await loginCredential(intent.id, refresh);
303
+ await assertProfileAvailable();
289
304
  await assertAutoEnabled();
290
305
  if (!owner()) throw liveError('account_changed_outside_deck');
291
306
  if (!await lease.valid()) throw liveError('native_control_lost');
@@ -293,6 +308,7 @@ export function createCodexLiveAccountController(input = {}) {
293
308
  resumeIdentity = before;
294
309
  handoff = await prepareCodexLiveHandoff(rpc, { isCurrent: owner,
295
310
  beforeInterrupt: async entry => {
311
+ await assertProfileAvailable();
296
312
  await assertAutoEnabled();
297
313
  if (!owner()) throw liveError('account_changed_outside_deck');
298
314
  await record(entry, 'interrupt_sent');
@@ -324,6 +340,7 @@ export function createCodexLiveAccountController(input = {}) {
324
340
  const current = await rpc.request('account/read', { refreshToken: false });
325
341
  if (!owner() || !sameNativeAccount(current, before)) throw liveError('account_changed_outside_deck');
326
342
  if (!await lease.valid()) throw liveError('native_control_lost');
343
+ await assertProfileAvailable();
327
344
  await assertAutoEnabled();
328
345
  if (!owner()) throw liveError('account_changed_outside_deck');
329
346
  // Authentication crosses only this owner-validated local socket. Codex
@@ -422,10 +439,13 @@ export function createCodexLiveAccountController(input = {}) {
422
439
  });
423
440
  return pendingSwitch;
424
441
  }
425
- async function restorePrevious(saved, intent, actual) {
426
- restorePending = null;
442
+ async function restorePrevious(saved, intent) {
427
443
  const epoch = ownershipEpoch;
428
444
  const previous = await loginCredential(saved.profileId);
445
+ const actual = await rpc.request('account/read', { refreshToken: false });
446
+ if (!await lease?.valid()) throw liveError('native_control_lost');
447
+ if (closed) return;
448
+ restorePending = null;
429
449
  if (ownershipPaused || epoch !== ownershipEpoch) { await externalChange(); return; }
430
450
  if (endpointKey(endpoint) === saved.endpoint && sameAccount(actual, previous, true)) {
431
451
  credential = previous; appliedIntent = { id: saved.profileId, revision: saved.revision }; owned = true;
@@ -454,7 +474,7 @@ export function createCodexLiveAccountController(input = {}) {
454
474
  if (closed || restorePending !== saved) return;
455
475
  desired = intent;
456
476
  await ensureRpc(s.originalHome);
457
- const actual = await rpc.request('account/read', { refreshToken: false });
477
+ let actual = await rpc.request('account/read', { refreshToken: false });
458
478
  if (!accountIds(actual).length) {
459
479
  restorePending = null; await externalChange('native_identity_unattested'); return;
460
480
  }
@@ -462,14 +482,19 @@ export function createCodexLiveAccountController(input = {}) {
462
482
  try { next = await loginCredential(intent.id); }
463
483
  catch (error) {
464
484
  if (intent.revision <= saved.revision) throw error;
465
- await restorePrevious(saved, intent, actual); return;
485
+ await restorePrevious(saved, intent); return;
466
486
  }
487
+ // Credential preparation can outlive both the native account and our
488
+ // control lease. Reattest after it, rather than adopting the old read.
489
+ actual = await rpc.request('account/read', { refreshToken: false });
490
+ if (!await lease?.valid()) throw liveError('native_control_lost');
467
491
  if (closed || restorePending !== saved) return;
468
492
  if (ownershipPaused || epoch !== ownershipEpoch) { restorePending = null; await externalChange(); return; }
493
+ if (!accountIds(actual).length) { restorePending = null; await externalChange('native_identity_unattested'); return; }
469
494
  if (intent.revision > saved.revision && !sameAccount(actual, next, true)) {
470
495
  // The newer request has no persisted acknowledgement. It may have
471
496
  // timed out after sending: reconcile it, never replay it on restart.
472
- await restorePrevious(saved, intent, actual); return;
497
+ await restorePrevious(saved, intent); return;
473
498
  }
474
499
  if (intent.revision === saved.revision && endpointKey(endpoint) === saved.endpoint && !sameAccount(actual, next, true)) {
475
500
  restorePending = null; await externalChange(); return;
@@ -488,7 +513,8 @@ export function createCodexLiveAccountController(input = {}) {
488
513
  } catch (error) {
489
514
  if (!owned) await disconnect();
490
515
  const reason = publicReason(error);
491
- const retry = ['native_not_running', 'cli_unavailable', 'native_unavailable', 'native_connection_failed', 'native_disconnected', 'native_control_busy'].includes(reason);
516
+ const retry = ['native_not_running', 'cli_unavailable', 'native_unavailable', 'native_connection_failed', 'native_disconnected', 'native_control_busy',
517
+ 'native_request_timeout', 'native_initial_account_unconfirmed'].includes(reason);
492
518
  update({ state: retry ? 'unavailable' : 'failed', reason });
493
519
  if (!retry) restorePending = null;
494
520
  restoreRetryAt = Date.now() + (options.restoreRetryMs ?? 5000);
@@ -146,7 +146,9 @@ export function lanLines(state, width, look) {
146
146
  return tail && gap >= 2 ? `${left}${" ".repeat(gap)}${tail}` : left;
147
147
  };
148
148
  for (const item of items) {
149
- if (item === sel) selected = lines.length;
149
+ // By id: lanSelected built its own list, so its row is never this one's
150
+ // object, and `===` left the selection undrawn and the list unscrolled.
151
+ if (sel && item.id === sel.id) selected = lines.length;
150
152
  if (item.kind === "switch") {
151
153
  const st = lanSectionState(s, now);
152
154
  const tail = item.on ? (st.text ? `${tone[TONE_OF[st.tone]] ?? ""}${oneLine(st.text)}${tone.reset}` : "")