@cortexkit/opencode-anthropic-auth 2.0.3 → 2.1.1

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 (38) hide show
  1. package/README.md +1 -1
  2. package/dist/cli-failure.d.ts +32 -2
  3. package/dist/cli.js +46 -52
  4. package/dist/fable-fallback.d.ts +6 -2
  5. package/dist/{index-kd89hcr3.js → index-0kxy8k2c.js} +1 -1
  6. package/dist/index-1nwcnxp8.js +42 -0
  7. package/dist/index-53nnxq39.js +2 -0
  8. package/dist/{index-2arfb1y3.js → index-6chd6jnr.js} +1 -1
  9. package/dist/{index-5hyennzm.js → index-ah5s0bew.js} +1 -1
  10. package/dist/{index-jmjevtm1.js → index-b1dvkp15.js} +1 -1
  11. package/dist/{index-rftced5v.js → index-f2ne65w4.js} +1 -1
  12. package/dist/{index-rqync0pc.js → index-hazrk5c3.js} +1 -1
  13. package/dist/{index-1jkyhgyr.js → index-jexctf5w.js} +1 -1
  14. package/dist/index.js +1 -1
  15. package/dist/request-class.d.ts +10 -0
  16. package/dist/rpc/port-file.js +1 -1
  17. package/dist/rpc/protocol.js +1 -1
  18. package/dist/rpc/rpc-client.js +1 -1
  19. package/dist/rpc/rpc-dir.js +1 -1
  20. package/dist/setup/native-activation.d.ts +7 -2
  21. package/dist/setup/native-enrollment.d.ts +6 -0
  22. package/dist/setup/native-login.d.ts +12 -1
  23. package/dist/sidebar-state.js +1 -1
  24. package/dist/transform.d.ts +2 -8
  25. package/dist/tui-preferences.js +1 -1
  26. package/dist/v2/adapter.d.ts +6 -1
  27. package/dist/v2/server.js +4 -4
  28. package/dist/v2/tui.js +1 -1
  29. package/package.json +10 -6
  30. package/src/sidebar-state.ts +10 -71
  31. package/src/tui-compiled/sidebar-state.ts +10 -71
  32. package/src/tui-compiled/tui.tsx +119 -89
  33. package/src/tui.tsx +58 -18
  34. package/dist/index-fncp6r0j.js +0 -3
  35. package/dist/index-mdpyfkv3.js +0 -464
  36. package/dist/index-nfcp0m1t.js +0 -42
  37. package/dist/index-qttfa42y.js +0 -2
  38. package/dist/index-vjehtqnb.js +0 -1
@@ -128,9 +128,10 @@ import { tmpdir } from 'node:os'
128
128
  import { dirname, join } from 'node:path'
129
129
  import type { PrimeUsageCounters } from '@cortexkit/anthropic-auth-core'
130
130
  import {
131
+ formatQuota,
132
+ isQuotaStale,
131
133
  logger,
132
134
  quotaDisplayProjection,
133
- quotaWindowParts,
134
135
  } from '@cortexkit/anthropic-auth-core'
135
136
 
136
137
  const STATE_FILE_ENV = 'OPENCODE_ANTHROPIC_AUTH_SIDEBAR_STATE_FILE'
@@ -655,7 +656,9 @@ async function writeSidebarStateAtomic(
655
656
  return 'lock-lost-before-rename'
656
657
  }
657
658
  await rename(tempFile, stateFile)
658
- await testHooks?.afterRename?.(stateFile)
659
+ // Look the hooks up again: a test may start listening while this write is
660
+ // in flight, after reading the old file, and must still hear this rename.
661
+ await sidebarStateWriteHooksFor(stateFile)?.afterRename?.(stateFile)
659
662
  if (!(await ownsLock())) return 'lock-lost-after-rename'
660
663
  return 'written'
661
664
  } catch (error) {
@@ -945,71 +948,6 @@ export function formatQuotaRowLabel(name: string, width = 10): string {
945
948
  return label + ' '.repeat(Math.max(0, width - Bun.stringWidth(label)))
946
949
  }
947
950
 
948
- // common-auth 0.18.0 has no narrow form, so keep its one-line quota wording here.
949
- // Once supported, replace this body with formatQuota(quotaDisplayProjection(quota, now),
950
- // { now, form: 'narrow' }) from common-auth.
951
- function formatNarrowQuota(quota: AccountQuota, now: number): string {
952
- const parts = quotaWindowParts(quotaDisplayProjection(quota, now), { now })
953
- const percent = (remaining: number | undefined) =>
954
- remaining === undefined ? '—' : `${Math.round(remaining)}%`
955
- const values = ['5h', '7d'].map((name) => {
956
- const part = parts.windows.find(
957
- (part) => part.name === name && part.kind === 'window',
958
- )
959
- return `${name} ${percent(part?.remainingPercent)}`
960
- })
961
- const scoped = quota.scoped ?? []
962
- const names = [...new Set(scoped.map((window) => window.modelName))]
963
- const lengths = names.map(() => 2)
964
- while (true) {
965
- const aliases = names.map((name, index) =>
966
- [...name].slice(0, lengths[index]).join(''),
967
- )
968
- let extended = false
969
- for (const [index, alias] of aliases.entries()) {
970
- const length = lengths[index] ?? 2
971
- if (
972
- aliases.some(
973
- (other, otherIndex) => otherIndex !== index && other === alias,
974
- ) &&
975
- length < [...(names[index] ?? '')].length
976
- ) {
977
- lengths[index] = length + 1
978
- extended = true
979
- }
980
- }
981
- if (!extended) break
982
- }
983
- const tightest = scoped.reduce<ScopedQuotaWindow | undefined>(
984
- (lowest, window) =>
985
- !lowest || window.remainingPercent < lowest.remainingPercent
986
- ? window
987
- : lowest,
988
- undefined,
989
- )
990
- const budget = parts.windows.find((part) => part.kind === 'budget')
991
- const budgetRemaining = quota.extraUsage?.exhausted
992
- ? 0
993
- : budget?.remainingPercent
994
- // Monetary ratios can land a few floating-point bits below an equal model reading.
995
- const budgetTighter =
996
- budget &&
997
- (!tightest ||
998
- (budgetRemaining !== undefined &&
999
- tightest.remainingPercent - budgetRemaining > 1e-9))
1000
- if (budgetTighter) {
1001
- values.push(`cr ${percent(budgetRemaining)}`)
1002
- } else if (tightest) {
1003
- const index = names.indexOf(tightest.modelName)
1004
- const name = [...tightest.modelName].slice(0, lengths[index]).join('')
1005
- const part = parts.windows.find(
1006
- (part) => part.kind === 'window' && part.name === tightest.title,
1007
- )
1008
- values.push(`${name} ${percent(part?.remainingPercent)}`)
1009
- }
1010
- return `${values.join(' · ')} left`
1011
- }
1012
-
1013
951
  export function getCollapsedQuotaSummary(
1014
952
  quota: AccountQuota | null,
1015
953
  now = Date.now(),
@@ -1040,14 +978,15 @@ export function getCollapsedQuotaSummary(
1040
978
  }
1041
979
  }
1042
980
 
981
+ const projection = quotaDisplayProjection(quota, now)
1043
982
  return {
1044
983
  fiveHourUsedPercent,
1045
984
  sevenDayUsedPercent,
1046
985
  scopedUsedPercents,
1047
- text: formatNarrowQuota(quota, now),
1048
- stale:
1049
- quotaWindowParts(quotaDisplayProjection(quota, now), { now }).age !==
1050
- undefined,
986
+ // The narrow form leaves out the reading's age to stay on one line, so
987
+ // a stale reading is dimmed instead of labelled.
988
+ text: formatQuota(projection, { now, form: 'narrow' }),
989
+ stale: isQuotaStale(projection, { now }),
1051
990
  }
1052
991
  }
1053
992
 
@@ -128,9 +128,10 @@ import { tmpdir } from 'node:os'
128
128
  import { dirname, join } from 'node:path'
129
129
  import type { PrimeUsageCounters } from '@cortexkit/anthropic-auth-core'
130
130
  import {
131
+ formatQuota,
132
+ isQuotaStale,
131
133
  logger,
132
134
  quotaDisplayProjection,
133
- quotaWindowParts,
134
135
  } from '@cortexkit/anthropic-auth-core'
135
136
 
136
137
  const STATE_FILE_ENV = 'OPENCODE_ANTHROPIC_AUTH_SIDEBAR_STATE_FILE'
@@ -655,7 +656,9 @@ async function writeSidebarStateAtomic(
655
656
  return 'lock-lost-before-rename'
656
657
  }
657
658
  await rename(tempFile, stateFile)
658
- await testHooks?.afterRename?.(stateFile)
659
+ // Look the hooks up again: a test may start listening while this write is
660
+ // in flight, after reading the old file, and must still hear this rename.
661
+ await sidebarStateWriteHooksFor(stateFile)?.afterRename?.(stateFile)
659
662
  if (!(await ownsLock())) return 'lock-lost-after-rename'
660
663
  return 'written'
661
664
  } catch (error) {
@@ -945,71 +948,6 @@ export function formatQuotaRowLabel(name: string, width = 10): string {
945
948
  return label + ' '.repeat(Math.max(0, width - Bun.stringWidth(label)))
946
949
  }
947
950
 
948
- // common-auth 0.18.0 has no narrow form, so keep its one-line quota wording here.
949
- // Once supported, replace this body with formatQuota(quotaDisplayProjection(quota, now),
950
- // { now, form: 'narrow' }) from common-auth.
951
- function formatNarrowQuota(quota: AccountQuota, now: number): string {
952
- const parts = quotaWindowParts(quotaDisplayProjection(quota, now), { now })
953
- const percent = (remaining: number | undefined) =>
954
- remaining === undefined ? '—' : `${Math.round(remaining)}%`
955
- const values = ['5h', '7d'].map((name) => {
956
- const part = parts.windows.find(
957
- (part) => part.name === name && part.kind === 'window',
958
- )
959
- return `${name} ${percent(part?.remainingPercent)}`
960
- })
961
- const scoped = quota.scoped ?? []
962
- const names = [...new Set(scoped.map((window) => window.modelName))]
963
- const lengths = names.map(() => 2)
964
- while (true) {
965
- const aliases = names.map((name, index) =>
966
- [...name].slice(0, lengths[index]).join(''),
967
- )
968
- let extended = false
969
- for (const [index, alias] of aliases.entries()) {
970
- const length = lengths[index] ?? 2
971
- if (
972
- aliases.some(
973
- (other, otherIndex) => otherIndex !== index && other === alias,
974
- ) &&
975
- length < [...(names[index] ?? '')].length
976
- ) {
977
- lengths[index] = length + 1
978
- extended = true
979
- }
980
- }
981
- if (!extended) break
982
- }
983
- const tightest = scoped.reduce<ScopedQuotaWindow | undefined>(
984
- (lowest, window) =>
985
- !lowest || window.remainingPercent < lowest.remainingPercent
986
- ? window
987
- : lowest,
988
- undefined,
989
- )
990
- const budget = parts.windows.find((part) => part.kind === 'budget')
991
- const budgetRemaining = quota.extraUsage?.exhausted
992
- ? 0
993
- : budget?.remainingPercent
994
- // Monetary ratios can land a few floating-point bits below an equal model reading.
995
- const budgetTighter =
996
- budget &&
997
- (!tightest ||
998
- (budgetRemaining !== undefined &&
999
- tightest.remainingPercent - budgetRemaining > 1e-9))
1000
- if (budgetTighter) {
1001
- values.push(`cr ${percent(budgetRemaining)}`)
1002
- } else if (tightest) {
1003
- const index = names.indexOf(tightest.modelName)
1004
- const name = [...tightest.modelName].slice(0, lengths[index]).join('')
1005
- const part = parts.windows.find(
1006
- (part) => part.kind === 'window' && part.name === tightest.title,
1007
- )
1008
- values.push(`${name} ${percent(part?.remainingPercent)}`)
1009
- }
1010
- return `${values.join(' · ')} left`
1011
- }
1012
-
1013
951
  export function getCollapsedQuotaSummary(
1014
952
  quota: AccountQuota | null,
1015
953
  now = Date.now(),
@@ -1040,14 +978,15 @@ export function getCollapsedQuotaSummary(
1040
978
  }
1041
979
  }
1042
980
 
981
+ const projection = quotaDisplayProjection(quota, now)
1043
982
  return {
1044
983
  fiveHourUsedPercent,
1045
984
  sevenDayUsedPercent,
1046
985
  scopedUsedPercents,
1047
- text: formatNarrowQuota(quota, now),
1048
- stale:
1049
- quotaWindowParts(quotaDisplayProjection(quota, now), { now }).age !==
1050
- undefined,
986
+ // The narrow form leaves out the reading's age to stay on one line, so
987
+ // a stale reading is dimmed instead of labelled.
988
+ text: formatQuota(projection, { now, form: 'narrow' }),
989
+ stale: isQuotaStale(projection, { now }),
1051
990
  }
1052
991
  }
1053
992
 
@@ -12,9 +12,9 @@ import { createElement as _$createElement } from "opentui:runtime-module:%40open
12
12
  import { readFileSync } from "node:fs";
13
13
  import { dirname, join } from "node:path";
14
14
  import { fileURLToPath } from "node:url";
15
- import { quotaDisplayProjection, quotaWindowParts } from "@cortexkit/anthropic-auth-core";
15
+ import { formatCreditAmounts, quotaDisplayProjection, quotaWindowParts } from "@cortexkit/anthropic-auth-core";
16
16
  import { TextAttributes } from "opentui:runtime-module:%40opentui%2Fcore";
17
- import { createEffect, createSignal, For, onCleanup, Show } from "opentui:runtime-module:solid-js";
17
+ import { createEffect, createSignal, For, Index, onCleanup, Show } from "opentui:runtime-module:solid-js";
18
18
  import { createRpcClient } from "./rpc/rpc-client.js";
19
19
  import { getRpcDir } from "./rpc/rpc-dir.js";
20
20
  import { computeQuotaPacing, DEFAULT_SIDEBAR_STATE, FIVE_HOUR_MS, formatPrimeAccountValue, formatQuotaRowLabel, getCollapsedAccounts, getCollapsedQuotaSummary, getFableRecoverySummary, getSidebarState, resolveActiveAccount, SEVEN_DAY_MS } from "./sidebar-state.js";
@@ -395,6 +395,20 @@ function QuotaRow(props) {
395
395
  });
396
396
  }
397
397
 
398
+ // The shared credit figure followed by the spent and limit amounts:
399
+ // `credits 75% left · $25.00/$100.00`. When that line is wider than the
400
+ // measured width, the amounts drop their cents (`$1,250/$5,000`) instead of
401
+ // wrapping onto a second line.
402
+ function creditLine(figure, extraUsage, width) {
403
+ const amounts = formatCreditAmounts(extraUsage);
404
+ if (!amounts) return figure;
405
+ const line = `${figure} · ${amounts}`;
406
+ if (width === undefined || Bun.stringWidth(line) <= width) return line;
407
+ return `${figure} · ${formatCreditAmounts(extraUsage, {
408
+ wholeUnits: true
409
+ })}`;
410
+ }
411
+
398
412
  // Account block: header row (name + status word) then per-window quota rows.
399
413
  // Pacing is computed here — per window, against the wall clock at render time
400
414
  // (re-evaluated on every state poll) — and disabled by passing false.
@@ -523,12 +537,26 @@ function AccountBlock(props) {
523
537
  get when() {
524
538
  return partFor('credits');
525
539
  },
526
- children: budget => (() => {
527
- var _el$38 = _$createElement("text");
528
- _$insert(_el$38, () => budget().figure);
529
- _$effect(_$p => _$setProp(_el$38, "fg", toneColor(props.theme, props.quota?.extraUsage?.severity === 'critical' ? 'err' : props.quota?.extraUsage?.severity === 'warning' || props.quota?.extraUsage?.exhausted ? 'warn' : 'muted'), _$p));
530
- return _el$38;
531
- })()
540
+ children: budget => {
541
+ // The line box's laid-out width, read when it mounts and on each
542
+ // resize. It is undefined (amounts keep their cents) until layout.
543
+ const [width, setWidth] = createSignal();
544
+ let line;
545
+ return (() => {
546
+ var _el$38 = _$createElement("box"),
547
+ _el$39 = _$createElement("text");
548
+ _$insertNode(_el$38, _el$39);
549
+ _$use(element => {
550
+ line = element;
551
+ setWidth(element.width || undefined);
552
+ }, _el$38);
553
+ _$setProp(_el$38, "width", '100%');
554
+ _$setProp(_el$38, "onSizeChange", () => setWidth(line?.width || undefined));
555
+ _$insert(_el$39, () => creditLine(budget().figure, props.quota?.extraUsage, width()));
556
+ _$effect(_$p => _$setProp(_el$39, "fg", toneColor(props.theme, props.quota?.extraUsage?.severity === 'critical' ? 'err' : props.quota?.extraUsage?.severity === 'warning' || props.quota?.extraUsage?.exhausted ? 'warn' : 'muted'), _$p));
557
+ return _el$38;
558
+ })();
559
+ }
532
560
  }), _$createComponent(Show, {
533
561
  get when() {
534
562
  return parts().age;
@@ -592,26 +620,26 @@ function QuotaDialogContent(props) {
592
620
  const theme = () => props.api.theme.current;
593
621
  const enabledFallbacks = () => (state().fallbacks ?? []).filter(f => f.enabled || f.custodyState && f.custodyState !== 'off');
594
622
  return (() => {
595
- var _el$39 = _$createElement("box"),
596
- _el$40 = _$createElement("box"),
623
+ var _el$40 = _$createElement("box"),
597
624
  _el$41 = _$createElement("box"),
598
- _el$42 = _$createElement("text"),
599
- _el$43 = _$createElement("b");
600
- _$insertNode(_el$39, _el$40);
601
- _$setProp(_el$39, "flexDirection", 'column');
602
- _$setProp(_el$39, "padding", 2);
603
- _$setProp(_el$39, "width", '100%');
604
- _$setProp(_el$39, "alignItems", 'center');
625
+ _el$42 = _$createElement("box"),
626
+ _el$43 = _$createElement("text"),
627
+ _el$44 = _$createElement("b");
605
628
  _$insertNode(_el$40, _el$41);
606
629
  _$setProp(_el$40, "flexDirection", 'column');
607
- _$setProp(_el$40, "width", 58);
630
+ _$setProp(_el$40, "padding", 2);
631
+ _$setProp(_el$40, "width", '100%');
632
+ _$setProp(_el$40, "alignItems", 'center');
608
633
  _$insertNode(_el$41, _el$42);
609
- _$setProp(_el$41, "width", '100%');
610
- _$setProp(_el$41, "justifyContent", 'center');
611
- _$setProp(_el$41, "marginBottom", 1);
634
+ _$setProp(_el$41, "flexDirection", 'column');
635
+ _$setProp(_el$41, "width", 58);
612
636
  _$insertNode(_el$42, _el$43);
613
- _$insertNode(_el$43, _$createTextNode(`Quota`));
614
- _$insert(_el$40, _$createComponent(AccountBlock, {
637
+ _$setProp(_el$42, "width", '100%');
638
+ _$setProp(_el$42, "justifyContent", 'center');
639
+ _$setProp(_el$42, "marginBottom", 1);
640
+ _$insertNode(_el$43, _el$44);
641
+ _$insertNode(_el$44, _$createTextNode(`Quota`));
642
+ _$insert(_el$41, _$createComponent(AccountBlock, {
615
643
  get theme() {
616
644
  return theme();
617
645
  },
@@ -638,7 +666,7 @@ function QuotaDialogContent(props) {
638
666
  return state().main?.quotaDated;
639
667
  }
640
668
  }), null);
641
- _$insert(_el$40, _$createComponent(Show, {
669
+ _$insert(_el$41, _$createComponent(Show, {
642
670
  get when() {
643
671
  return prefs().sections.fallbackAccounts;
644
672
  },
@@ -686,8 +714,8 @@ function QuotaDialogContent(props) {
686
714
  });
687
715
  }
688
716
  }), null);
689
- _$effect(_$p => _$setProp(_el$42, "fg", theme().text, _$p));
690
- return _el$39;
717
+ _$effect(_$p => _$setProp(_el$43, "fg", theme().text, _$p));
718
+ return _el$40;
691
719
  })();
692
720
  }
693
721
 
@@ -824,33 +852,33 @@ function QuotaSidebar(props) {
824
852
  return `${r.transport} \u00b7 ${r.enabled ? 'on' : 'off'}`;
825
853
  };
826
854
  return (() => {
827
- var _el$45 = _$createElement("box"),
828
- _el$46 = _$createElement("box"),
855
+ var _el$46 = _$createElement("box"),
829
856
  _el$47 = _$createElement("box"),
830
- _el$48 = _$createElement("text"),
831
- _el$49 = _$createElement("b");
832
- _$insertNode(_el$45, _el$46);
833
- _$setProp(_el$45, "width", '100%');
834
- _$setProp(_el$45, "flexDirection", 'column');
835
- _$setProp(_el$45, "border", SINGLE_BORDER);
836
- _$setProp(_el$45, "paddingTop", 1);
837
- _$setProp(_el$45, "paddingBottom", 1);
838
- _$setProp(_el$45, "paddingLeft", 1);
839
- _$setProp(_el$45, "paddingRight", 1);
857
+ _el$48 = _$createElement("box"),
858
+ _el$49 = _$createElement("text"),
859
+ _el$50 = _$createElement("b");
840
860
  _$insertNode(_el$46, _el$47);
841
861
  _$setProp(_el$46, "width", '100%');
842
- _$setProp(_el$46, "flexDirection", 'row');
843
- _$setProp(_el$46, "justifyContent", 'space-between');
844
- _$setProp(_el$46, "alignItems", 'center');
845
- _$setProp(_el$46, "onMouseDown", () => {
862
+ _$setProp(_el$46, "flexDirection", 'column');
863
+ _$setProp(_el$46, "border", SINGLE_BORDER);
864
+ _$setProp(_el$46, "paddingTop", 1);
865
+ _$setProp(_el$46, "paddingBottom", 1);
866
+ _$setProp(_el$46, "paddingLeft", 1);
867
+ _$setProp(_el$46, "paddingRight", 1);
868
+ _$insertNode(_el$47, _el$48);
869
+ _$setProp(_el$47, "width", '100%');
870
+ _$setProp(_el$47, "flexDirection", 'row');
871
+ _$setProp(_el$47, "justifyContent", 'space-between');
872
+ _$setProp(_el$47, "alignItems", 'center');
873
+ _$setProp(_el$47, "onMouseDown", () => {
846
874
  if (hasData()) props.controller.toggleCollapsed();
847
875
  });
848
- _$insertNode(_el$47, _el$48);
849
- _$setProp(_el$47, "paddingLeft", 1);
850
- _$setProp(_el$47, "paddingRight", 1);
851
876
  _$insertNode(_el$48, _el$49);
852
- _$insert(_el$49, headerLabel);
853
- _$insert(_el$46, _$createComponent(Show, {
877
+ _$setProp(_el$48, "paddingLeft", 1);
878
+ _$setProp(_el$48, "paddingRight", 1);
879
+ _$insertNode(_el$49, _el$50);
880
+ _$insert(_el$50, headerLabel);
881
+ _$insert(_el$47, _$createComponent(Show, {
854
882
  get when() {
855
883
  return degraded();
856
884
  },
@@ -860,41 +888,41 @@ function QuotaSidebar(props) {
860
888
  return prefs().header.showVersion && PLUGIN_VERSION !== '';
861
889
  },
862
890
  get children() {
863
- var _el$57 = _$createElement("text");
864
- _$insert(_el$57, `v${PLUGIN_VERSION}`);
865
- _$effect(_$p => _$setProp(_el$57, "fg", theme().textMuted, _$p));
866
- return _el$57;
891
+ var _el$58 = _$createElement("text");
892
+ _$insert(_el$58, `v${PLUGIN_VERSION}`);
893
+ _$effect(_$p => _$setProp(_el$58, "fg", theme().textMuted, _$p));
894
+ return _el$58;
867
895
  }
868
896
  });
869
897
  },
870
898
  get children() {
871
- var _el$50 = _$createElement("box"),
872
- _el$51 = _$createElement("text"),
873
- _el$52 = _$createElement("b");
874
- _$insertNode(_el$50, _el$51);
875
- _$setProp(_el$50, "paddingLeft", 1);
876
- _$setProp(_el$50, "paddingRight", 1);
899
+ var _el$51 = _$createElement("box"),
900
+ _el$52 = _$createElement("text"),
901
+ _el$53 = _$createElement("b");
877
902
  _$insertNode(_el$51, _el$52);
878
- _$insertNode(_el$52, _$createTextNode(`LIMITED`));
903
+ _$setProp(_el$51, "paddingLeft", 1);
904
+ _$setProp(_el$51, "paddingRight", 1);
905
+ _$insertNode(_el$52, _el$53);
906
+ _$insertNode(_el$53, _$createTextNode(`LIMITED`));
879
907
  _$effect(_p$ => {
880
908
  var _v$18 = theme().warning,
881
909
  _v$19 = theme().background;
882
- _v$18 !== _p$.e && (_p$.e = _$setProp(_el$50, "backgroundColor", _v$18, _p$.e));
883
- _v$19 !== _p$.t && (_p$.t = _$setProp(_el$51, "fg", _v$19, _p$.t));
910
+ _v$18 !== _p$.e && (_p$.e = _$setProp(_el$51, "backgroundColor", _v$18, _p$.e));
911
+ _v$19 !== _p$.t && (_p$.t = _$setProp(_el$52, "fg", _v$19, _p$.t));
884
912
  return _p$;
885
913
  }, {
886
914
  e: undefined,
887
915
  t: undefined
888
916
  });
889
- return _el$50;
917
+ return _el$51;
890
918
  }
891
919
  }), null);
892
- _$insert(_el$45, _$createComponent(Show, {
920
+ _$insert(_el$46, _$createComponent(Show, {
893
921
  get when() {
894
922
  return _$memo(() => !!collapsed())() && hasData();
895
923
  },
896
924
  get children() {
897
- return [_$createComponent(For, {
925
+ return [_$createComponent(Index, {
898
926
  get each() {
899
927
  return getCollapsedAccounts(state(), prefs().sections.fallbackAccounts);
900
928
  },
@@ -902,7 +930,9 @@ function QuotaSidebar(props) {
902
930
  get theme() {
903
931
  return theme();
904
932
  },
905
- account: account,
933
+ get account() {
934
+ return account();
935
+ },
906
936
  get tone() {
907
937
  return activeQuotaTone();
908
938
  }
@@ -918,12 +948,12 @@ function QuotaSidebar(props) {
918
948
  },
919
949
  label: "Mode",
920
950
  get children() {
921
- var _el$54 = _$createElement("text"),
922
- _el$55 = _$createElement("b");
923
- _$insertNode(_el$54, _el$55);
924
- _$insertNode(_el$55, _$createTextNode(`fast`));
925
- _$effect(_$p => _$setProp(_el$54, "fg", toneColor(theme(), 'accent'), _$p));
926
- return _el$54;
951
+ var _el$55 = _$createElement("text"),
952
+ _el$56 = _$createElement("b");
953
+ _$insertNode(_el$55, _el$56);
954
+ _$insertNode(_el$56, _$createTextNode(`fast`));
955
+ _$effect(_$p => _$setProp(_el$55, "fg", toneColor(theme(), 'accent'), _$p));
956
+ return _el$55;
927
957
  }
928
958
  });
929
959
  }
@@ -937,18 +967,18 @@ function QuotaSidebar(props) {
937
967
  },
938
968
  label: "Recovery",
939
969
  get children() {
940
- var _el$58 = _$createElement("text"),
941
- _el$59 = _$createElement("b");
942
- _$insertNode(_el$58, _el$59);
943
- _$insert(_el$59, summary);
944
- _$effect(_$p => _$setProp(_el$58, "fg", toneColor(theme(), fableRecoveryTone()), _$p));
945
- return _el$58;
970
+ var _el$59 = _$createElement("text"),
971
+ _el$60 = _$createElement("b");
972
+ _$insertNode(_el$59, _el$60);
973
+ _$insert(_el$60, summary);
974
+ _$effect(_$p => _$setProp(_el$59, "fg", toneColor(theme(), fableRecoveryTone()), _$p));
975
+ return _el$59;
946
976
  }
947
977
  })
948
978
  })];
949
979
  }
950
980
  }), null);
951
- _$insert(_el$45, _$createComponent(Show, {
981
+ _$insert(_el$46, _$createComponent(Show, {
952
982
  get when() {
953
983
  return !collapsed() || !hasData();
954
984
  },
@@ -959,14 +989,14 @@ function QuotaSidebar(props) {
959
989
  },
960
990
  get fallback() {
961
991
  return (() => {
962
- var _el$60 = _$createElement("box"),
963
- _el$61 = _$createElement("text");
964
- _$insertNode(_el$60, _el$61);
965
- _$setProp(_el$60, "marginTop", 1);
966
- _$setProp(_el$60, "width", '100%');
967
- _$insertNode(_el$61, _$createTextNode(`Waiting for quota…`));
968
- _$effect(_$p => _$setProp(_el$61, "fg", theme().textMuted, _$p));
969
- return _el$60;
992
+ var _el$61 = _$createElement("box"),
993
+ _el$62 = _$createElement("text");
994
+ _$insertNode(_el$61, _el$62);
995
+ _$setProp(_el$61, "marginTop", 1);
996
+ _$setProp(_el$61, "width", '100%');
997
+ _$insertNode(_el$62, _$createTextNode(`Waiting for quota…`));
998
+ _$effect(_$p => _$setProp(_el$62, "fg", theme().textMuted, _$p));
999
+ return _el$61;
970
1000
  })();
971
1001
  },
972
1002
  get children() {
@@ -1245,16 +1275,16 @@ function QuotaSidebar(props) {
1245
1275
  var _v$20 = theme().borderActive,
1246
1276
  _v$21 = theme().accent,
1247
1277
  _v$22 = theme().background;
1248
- _v$20 !== _p$.e && (_p$.e = _$setProp(_el$45, "borderColor", _v$20, _p$.e));
1249
- _v$21 !== _p$.t && (_p$.t = _$setProp(_el$47, "backgroundColor", _v$21, _p$.t));
1250
- _v$22 !== _p$.a && (_p$.a = _$setProp(_el$48, "fg", _v$22, _p$.a));
1278
+ _v$20 !== _p$.e && (_p$.e = _$setProp(_el$46, "borderColor", _v$20, _p$.e));
1279
+ _v$21 !== _p$.t && (_p$.t = _$setProp(_el$48, "backgroundColor", _v$21, _p$.t));
1280
+ _v$22 !== _p$.a && (_p$.a = _$setProp(_el$49, "fg", _v$22, _p$.a));
1251
1281
  return _p$;
1252
1282
  }, {
1253
1283
  e: undefined,
1254
1284
  t: undefined,
1255
1285
  a: undefined
1256
1286
  });
1257
- return _el$45;
1287
+ return _el$46;
1258
1288
  })();
1259
1289
  }
1260
1290
  const tui = async api => {