@cortexkit/opencode-anthropic-auth 2.4.2 → 2.4.4

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.
@@ -73,9 +73,6 @@ const PLUGIN_VERSION: string = (() => {
73
73
  return ''
74
74
  })()
75
75
 
76
- // biome-ignore lint/suspicious/noExplicitAny: opentui border prop not typed in plugin tui surface
77
- const SINGLE_BORDER = { type: 'single' } as any
78
-
79
76
  export type SidebarColor = RGBA | string
80
77
 
81
78
  /** The flat theme tokens the sidebar draws with; OpenCode 1's `theme.current` has them all. */
@@ -255,7 +252,9 @@ function CollapsedAccountRow(props: {
255
252
  let row: BoxRenderable | undefined
256
253
  const summary = () => getCollapsedQuotaSummary(props.account.quota, props.now)
257
254
  const value = () => summary().text ?? '—'
258
- const labelWidth = () => Math.max(0, width() - Bun.stringWidth(value()) - 1)
255
+ // Keep the quota and its two-cell status suffix intact; only the label shrinks.
256
+ const labelWidth = () =>
257
+ Math.max(0, width() - 1 - Bun.stringWidth(value()) - 2)
259
258
  const dim = () =>
260
259
  !props.account.active || props.account.quotaDated || summary().stale
261
260
  const attributes = () => (dim() ? TextAttributes.DIM : TextAttributes.BOLD)
@@ -295,6 +294,21 @@ function CollapsedAccountRow(props: {
295
294
  >
296
295
  {value()}
297
296
  </text>
297
+ <text
298
+ width={2}
299
+ flexShrink={0}
300
+ fg={toneColor(
301
+ props.theme,
302
+ props.account.blocked
303
+ ? 'warn'
304
+ : props.account.active
305
+ ? 'ok'
306
+ : 'muted',
307
+ )}
308
+ attributes={attributes()}
309
+ >
310
+ {props.account.blocked ? ' ⊘' : ' ●'}
311
+ </text>
298
312
  </box>
299
313
  )
300
314
  }
@@ -795,17 +809,8 @@ export function ClaudeSidebar(props: {
795
809
  }
796
810
 
797
811
  return (
798
- <box
799
- width='100%'
800
- flexDirection='column'
801
- border={SINGLE_BORDER}
802
- borderColor={theme().borderActive}
803
- paddingTop={1}
804
- paddingBottom={1}
805
- paddingLeft={1}
806
- paddingRight={1}
807
- >
808
- {/* Header: ▼/▶ CLAUDE badge (click to collapse) + version, or LIMITED badge */}
812
+ <box width='100%' flexDirection='column'>
813
+ {/* The collapse control stays on the left; the version stays on the right. */}
809
814
  {/* biome-ignore lint/a11y/noStaticElementInteractions: opentui renders to a terminal, not the DOM — ARIA roles do not apply */}
810
815
  <box
811
816
  width='100%'
@@ -821,23 +826,8 @@ export function ClaudeSidebar(props: {
821
826
  <b>{headerLabel()}</b>
822
827
  </text>
823
828
  </box>
824
- <Show
825
- when={degraded()}
826
- fallback={
827
- <Show when={prefs().header.showVersion && PLUGIN_VERSION !== ''}>
828
- <text fg={theme().textMuted}>{`v${PLUGIN_VERSION}`}</text>
829
- </Show>
830
- }
831
- >
832
- <box
833
- paddingLeft={1}
834
- paddingRight={1}
835
- backgroundColor={theme().warning}
836
- >
837
- <text fg={theme().background}>
838
- <b>{'LIMITED'}</b>
839
- </text>
840
- </box>
829
+ <Show when={prefs().header.showVersion && PLUGIN_VERSION !== ''}>
830
+ <text fg={theme().textMuted}>{`v${PLUGIN_VERSION}`}</text>
841
831
  </Show>
842
832
  </box>
843
833
 
@@ -244,7 +244,7 @@ function normalizeQuotaWindow(value: unknown): QuotaWindow | undefined {
244
244
  return {
245
245
  usedPercent,
246
246
  remainingPercent,
247
- resetsAt: typeof value.resetsAt === 'string' ? value.resetsAt : undefined,
247
+ ...(typeof value.resetsAt === 'string' && { resetsAt: value.resetsAt }),
248
248
  ...(isFiniteNumber(value.checkedAt) && { checkedAt: value.checkedAt }),
249
249
  }
250
250
  }
@@ -464,7 +464,7 @@ export function normalizeSidebarState(raw: unknown): SidebarState {
464
464
  typeof raw.fastMode === 'boolean'
465
465
  ? raw.fastMode
466
466
  : DEFAULT_SIDEBAR_STATE.fastMode,
467
- cacheKeep,
467
+ ...(cacheKeep && { cacheKeep }),
468
468
  ...(prime && { prime }),
469
469
  ...(fableRecoveries.length > 0 && { fableRecoveries }),
470
470
  lastUpdated: isFiniteNumber(raw.lastUpdated) ? raw.lastUpdated : 0,
@@ -1149,6 +1149,7 @@ export function getCollapsedAccounts(
1149
1149
  quota: state.main?.quota ?? null,
1150
1150
  quotaDated: state.main?.quotaDated,
1151
1151
  active: activeId === 'main',
1152
+ blocked: state.main?.enabled === false || Boolean(state.main?.stateLine),
1152
1153
  },
1153
1154
  ...(showFallbacks
1154
1155
  ? (state.fallbacks ?? [])
@@ -1163,6 +1164,14 @@ export function getCollapsedAccounts(
1163
1164
  quota: account.quota,
1164
1165
  quotaDated: account.quotaDated,
1165
1166
  active: activeId === account.id,
1167
+ blocked:
1168
+ !account.enabled ||
1169
+ Boolean(account.stateLine) ||
1170
+ account.needsReauth ||
1171
+ account.vaultReauth === true ||
1172
+ (account.custodyState != null &&
1173
+ account.custodyState !== 'off' &&
1174
+ account.custodyState !== 'on-vault-served'),
1166
1175
  }))
1167
1176
  : []),
1168
1177
  ]