@cortexkit/opencode-antigravity-auth 3.0.13 → 3.0.15

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 (202) hide show
  1. package/dist/cli.js +1865 -571
  2. package/dist/cli.js.map +4 -4
  3. package/dist/cli.meta.json +294 -55
  4. package/dist/index.js +2377 -784
  5. package/dist/index.js.map +4 -4
  6. package/dist/index.meta.json +332 -78
  7. package/dist/server.js +3977 -2327
  8. package/dist/server.js.map +4 -4
  9. package/dist/server.meta.json +1 -1
  10. package/dist/src/__fixtures__/runtime-layout-process.d.ts +2 -0
  11. package/dist/src/__fixtures__/runtime-layout-process.d.ts.map +1 -0
  12. package/dist/src/__fixtures__/runtime-layout-process.js +88 -0
  13. package/dist/src/__fixtures__/runtime-layout-process.js.map +1 -0
  14. package/dist/src/cli.d.ts +17 -6
  15. package/dist/src/cli.d.ts.map +1 -1
  16. package/dist/src/cli.js +26 -9
  17. package/dist/src/cli.js.map +1 -1
  18. package/dist/src/common-auth-embedded/claustrum/enrollment.d.ts +9 -0
  19. package/dist/src/common-auth-embedded/claustrum/enrollment.js +15 -8
  20. package/dist/src/common-auth-embedded/claustrum/hub.js +86 -42
  21. package/dist/src/common-auth-embedded/fs/refresh-file-lock.js +16 -3
  22. package/dist/src/common-auth-embedded/setup/command.js +4 -49
  23. package/dist/src/common-auth-embedded/setup/flags.d.ts +50 -0
  24. package/dist/src/common-auth-embedded/setup/flags.js +123 -0
  25. package/dist/src/common-auth-embedded/setup/index.d.ts +1 -0
  26. package/dist/src/common-auth-embedded/setup/index.js +1 -0
  27. package/dist/src/common-auth-embedded/setup/types.d.ts +7 -1
  28. package/dist/src/common-auth-embedded/source-output.json +47 -31
  29. package/dist/src/ga/server/auth.d.ts.map +1 -1
  30. package/dist/src/ga/server/auth.js +7 -2
  31. package/dist/src/ga/server/auth.js.map +1 -1
  32. package/dist/src/ga/server/index.d.ts.map +1 -1
  33. package/dist/src/ga/server/index.js +18 -4
  34. package/dist/src/ga/server/index.js.map +1 -1
  35. package/dist/src/ga/tui/host-ga.d.ts +55 -2
  36. package/dist/src/ga/tui/host-ga.d.ts.map +1 -1
  37. package/dist/src/ga/tui/host-ga.js +73 -43
  38. package/dist/src/ga/tui/host-ga.js.map +1 -1
  39. package/dist/src/plugin/__fixtures__/controlled-timeouts.d.ts +7 -0
  40. package/dist/src/plugin/__fixtures__/controlled-timeouts.d.ts.map +1 -0
  41. package/dist/src/plugin/__fixtures__/controlled-timeouts.js +41 -0
  42. package/dist/src/plugin/__fixtures__/controlled-timeouts.js.map +1 -0
  43. package/dist/src/plugin/__fixtures__/release-model-ids.d.ts +2 -0
  44. package/dist/src/plugin/__fixtures__/release-model-ids.d.ts.map +1 -0
  45. package/dist/src/plugin/__fixtures__/release-model-ids.js +11 -0
  46. package/dist/src/plugin/__fixtures__/release-model-ids.js.map +1 -0
  47. package/dist/src/plugin/__fixtures__/verified-store.d.ts +3 -0
  48. package/dist/src/plugin/__fixtures__/verified-store.d.ts.map +1 -0
  49. package/dist/src/plugin/__fixtures__/verified-store.js +50 -0
  50. package/dist/src/plugin/__fixtures__/verified-store.js.map +1 -0
  51. package/dist/src/plugin/auth-loader.d.ts +7 -1
  52. package/dist/src/plugin/auth-loader.d.ts.map +1 -1
  53. package/dist/src/plugin/auth-loader.js +4 -4
  54. package/dist/src/plugin/auth-loader.js.map +1 -1
  55. package/dist/src/plugin/cache/signature-cache.d.ts +7 -1
  56. package/dist/src/plugin/cache/signature-cache.d.ts.map +1 -1
  57. package/dist/src/plugin/cache/signature-cache.js +10 -13
  58. package/dist/src/plugin/cache/signature-cache.js.map +1 -1
  59. package/dist/src/plugin/config/loader.d.ts +2 -1
  60. package/dist/src/plugin/config/loader.d.ts.map +1 -1
  61. package/dist/src/plugin/config/loader.js +4 -2
  62. package/dist/src/plugin/config/loader.js.map +1 -1
  63. package/dist/src/plugin/config/schema.js +1 -1
  64. package/dist/src/plugin/debug.d.ts.map +1 -1
  65. package/dist/src/plugin/debug.js +18 -19
  66. package/dist/src/plugin/debug.js.map +1 -1
  67. package/dist/src/plugin/errors.js +1 -1
  68. package/dist/src/plugin/errors.js.map +1 -1
  69. package/dist/src/plugin/ga-location-services.d.ts +1 -1
  70. package/dist/src/plugin/ga-location-services.d.ts.map +1 -1
  71. package/dist/src/plugin/ga-location-services.js +99 -32
  72. package/dist/src/plugin/ga-location-services.js.map +1 -1
  73. package/dist/src/plugin/ga-shared-vault-custody.d.ts +19 -5
  74. package/dist/src/plugin/ga-shared-vault-custody.d.ts.map +1 -1
  75. package/dist/src/plugin/ga-shared-vault-custody.js +12 -4
  76. package/dist/src/plugin/ga-shared-vault-custody.js.map +1 -1
  77. package/dist/src/plugin/index.d.ts.map +1 -1
  78. package/dist/src/plugin/index.js +31 -9
  79. package/dist/src/plugin/index.js.map +1 -1
  80. package/dist/src/plugin/shared/source-sidebar.d.ts +6 -0
  81. package/dist/src/plugin/shared/source-sidebar.d.ts.map +1 -1
  82. package/dist/src/plugin/shared/source-sidebar.js +1 -1
  83. package/dist/src/plugin/shared/source-sidebar.js.map +1 -1
  84. package/dist/src/plugin/shared/vault-request-credentials.d.ts +33 -13
  85. package/dist/src/plugin/shared/vault-request-credentials.d.ts.map +1 -1
  86. package/dist/src/plugin/shared/vault-request-credentials.js +97 -44
  87. package/dist/src/plugin/shared/vault-request-credentials.js.map +1 -1
  88. package/dist/src/plugin/storage.d.ts +5 -2
  89. package/dist/src/plugin/storage.d.ts.map +1 -1
  90. package/dist/src/plugin/storage.js +5 -4
  91. package/dist/src/plugin/storage.js.map +1 -1
  92. package/dist/src/plugin/vault-custody.d.ts +29 -8
  93. package/dist/src/plugin/vault-custody.d.ts.map +1 -1
  94. package/dist/src/plugin/vault-custody.js +61 -10
  95. package/dist/src/plugin/vault-custody.js.map +1 -1
  96. package/dist/src/process-heartbeat.d.ts +22 -2
  97. package/dist/src/process-heartbeat.d.ts.map +1 -1
  98. package/dist/src/process-heartbeat.js +47 -10
  99. package/dist/src/process-heartbeat.js.map +1 -1
  100. package/dist/src/rpc/rpc-server.d.ts +8 -0
  101. package/dist/src/rpc/rpc-server.d.ts.map +1 -1
  102. package/dist/src/rpc/rpc-server.js +26 -1
  103. package/dist/src/rpc/rpc-server.js.map +1 -1
  104. package/dist/src/runtime-layout.d.ts +100 -0
  105. package/dist/src/runtime-layout.d.ts.map +1 -0
  106. package/dist/src/runtime-layout.js +1242 -0
  107. package/dist/src/runtime-layout.js.map +1 -0
  108. package/dist/src/runtime-paths.d.ts +132 -0
  109. package/dist/src/runtime-paths.d.ts.map +1 -0
  110. package/dist/src/runtime-paths.js +214 -0
  111. package/dist/src/runtime-paths.js.map +1 -0
  112. package/dist/src/setup.d.ts.map +1 -1
  113. package/dist/src/setup.js +30 -7
  114. package/dist/src/setup.js.map +1 -1
  115. package/dist/src/tui/quota-layout.d.ts +1 -1
  116. package/dist/src/tui/quota-layout.js +1 -1
  117. package/dist/src/tui/sidebar-frame.d.ts +109 -0
  118. package/dist/src/tui/sidebar-frame.d.ts.map +1 -0
  119. package/dist/src/tui/sidebar-frame.js +244 -0
  120. package/dist/src/tui/sidebar-frame.js.map +1 -0
  121. package/dist/src/tui.d.ts.map +1 -1
  122. package/dist/src/tui.js +11 -251
  123. package/dist/src/tui.js.map +1 -1
  124. package/dist/src/vault-folder.d.ts +38 -0
  125. package/dist/src/vault-folder.d.ts.map +1 -0
  126. package/dist/src/vault-folder.js +91 -0
  127. package/dist/src/vault-folder.js.map +1 -0
  128. package/dist/src/version-fence.d.ts +54 -0
  129. package/dist/src/version-fence.d.ts.map +1 -0
  130. package/dist/src/version-fence.js +254 -0
  131. package/dist/src/version-fence.js.map +1 -0
  132. package/dist/tui-build-map.json +121 -93
  133. package/dist/tui-ga-build-map.json +23 -9
  134. package/dist/types/src/cli.d.ts +17 -6
  135. package/dist/types/src/cli.d.ts.map +1 -1
  136. package/dist/types/src/common-auth-embedded/claustrum/enrollment.d.ts +9 -0
  137. package/dist/types/src/common-auth-embedded/setup/flags.d.ts +50 -0
  138. package/dist/types/src/common-auth-embedded/setup/index.d.ts +1 -0
  139. package/dist/types/src/common-auth-embedded/setup/types.d.ts +7 -1
  140. package/dist/types/src/ga/server/auth.d.ts.map +1 -1
  141. package/dist/types/src/ga/server/index.d.ts.map +1 -1
  142. package/dist/types/src/plugin/auth-loader.d.ts +7 -1
  143. package/dist/types/src/plugin/auth-loader.d.ts.map +1 -1
  144. package/dist/types/src/plugin/cache/signature-cache.d.ts +7 -1
  145. package/dist/types/src/plugin/cache/signature-cache.d.ts.map +1 -1
  146. package/dist/types/src/plugin/config/loader.d.ts +2 -1
  147. package/dist/types/src/plugin/config/loader.d.ts.map +1 -1
  148. package/dist/types/src/plugin/debug.d.ts.map +1 -1
  149. package/dist/types/src/plugin/ga-location-services.d.ts +1 -1
  150. package/dist/types/src/plugin/ga-location-services.d.ts.map +1 -1
  151. package/dist/types/src/plugin/ga-shared-vault-custody.d.ts +19 -5
  152. package/dist/types/src/plugin/ga-shared-vault-custody.d.ts.map +1 -1
  153. package/dist/types/src/plugin/index.d.ts.map +1 -1
  154. package/dist/types/src/plugin/shared/source-sidebar.d.ts +6 -0
  155. package/dist/types/src/plugin/shared/source-sidebar.d.ts.map +1 -1
  156. package/dist/types/src/plugin/shared/vault-request-credentials.d.ts +33 -13
  157. package/dist/types/src/plugin/shared/vault-request-credentials.d.ts.map +1 -1
  158. package/dist/types/src/plugin/storage.d.ts +5 -2
  159. package/dist/types/src/plugin/storage.d.ts.map +1 -1
  160. package/dist/types/src/plugin/vault-custody.d.ts +29 -8
  161. package/dist/types/src/plugin/vault-custody.d.ts.map +1 -1
  162. package/dist/types/src/process-heartbeat.d.ts +22 -2
  163. package/dist/types/src/process-heartbeat.d.ts.map +1 -1
  164. package/dist/types/src/rpc/rpc-server.d.ts +8 -0
  165. package/dist/types/src/rpc/rpc-server.d.ts.map +1 -1
  166. package/dist/types/src/runtime-layout.d.ts +100 -0
  167. package/dist/types/src/runtime-layout.d.ts.map +1 -0
  168. package/dist/types/src/runtime-paths.d.ts +132 -0
  169. package/dist/types/src/runtime-paths.d.ts.map +1 -0
  170. package/dist/types/src/setup.d.ts.map +1 -1
  171. package/dist/types/src/vault-folder.d.ts +38 -0
  172. package/dist/types/src/vault-folder.d.ts.map +1 -0
  173. package/dist/types/src/version-fence.d.ts +54 -0
  174. package/dist/types/src/version-fence.d.ts.map +1 -0
  175. package/package.json +2 -2
  176. package/src/common-auth-embedded/claustrum/enrollment.d.ts +9 -0
  177. package/src/common-auth-embedded/claustrum/enrollment.js +15 -8
  178. package/src/common-auth-embedded/claustrum/hub.js +86 -42
  179. package/src/common-auth-embedded/fs/refresh-file-lock.js +16 -3
  180. package/src/common-auth-embedded/setup/command.js +4 -49
  181. package/src/common-auth-embedded/setup/flags.d.ts +50 -0
  182. package/src/common-auth-embedded/setup/flags.js +123 -0
  183. package/src/common-auth-embedded/setup/index.d.ts +1 -0
  184. package/src/common-auth-embedded/setup/index.js +1 -0
  185. package/src/common-auth-embedded/setup/types.d.ts +7 -1
  186. package/src/common-auth-embedded/source-output.json +47 -31
  187. package/src/tui/entry.mjs +19 -1
  188. package/src/tui-compiled/sidebar-projection.js +119 -0
  189. package/src/tui-compiled/tui/quota-layout.js +1 -1
  190. package/src/tui-compiled/tui/sidebar-frame.js +657 -0
  191. package/src/tui-compiled/tui.js +25 -606
  192. package/src/tui-ga-compiled/host-ga.js +116 -124
  193. package/src/tui-ga-compiled/shared/ced204104a639c9c-sidebar-frame.js +657 -0
  194. package/src/tui-ga-compiled/shared/dd4c9e1a907f8ef0-quota-layout.js +1 -1
  195. package/src/tui-ga-raw/host-ga.tsx +157 -95
  196. package/src/tui-ga-raw/shared/ced204104a639c9c-sidebar-frame.tsx +603 -0
  197. package/src/tui-ga-raw/shared/dd4c9e1a907f8ef0-quota-layout.tsx +1 -1
  198. package/src/tui-raw/sidebar-projection.js +119 -0
  199. package/src/tui-raw/tui/quota-layout.tsx +1 -1
  200. package/src/tui-raw/tui/sidebar-frame.tsx +603 -0
  201. package/src/tui-raw/tui.tsx +25 -523
  202. package/src/tui.tsx +25 -523
@@ -1,11 +1,5 @@
1
1
  import { memo as _$memo } from "opentui:runtime-module:%40opentui%2Fsolid";
2
- import { insert as _$insert } from "opentui:runtime-module:%40opentui%2Fsolid";
3
2
  import { createComponent as _$createComponent } from "opentui:runtime-module:%40opentui%2Fsolid";
4
- import { createTextNode as _$createTextNode } from "opentui:runtime-module:%40opentui%2Fsolid";
5
- import { insertNode as _$insertNode } from "opentui:runtime-module:%40opentui%2Fsolid";
6
- import { use as _$use } from "opentui:runtime-module:%40opentui%2Fsolid";
7
- import { setProp as _$setProp } from "opentui:runtime-module:%40opentui%2Fsolid";
8
- import { createElement as _$createElement } from "opentui:runtime-module:%40opentui%2Fsolid";
9
3
  /** @jsxImportSource @opentui/solid */
10
4
 
11
5
  /**
@@ -49,12 +43,11 @@ import { createElement as _$createElement } from "opentui:runtime-module:%40open
49
43
  * server code, and nothing writes to the terminal or forces a theme.
50
44
  */
51
45
 
52
- import { createSignal, For, Show } from "opentui:runtime-module:solid-js";
46
+ import { createSignal } from "opentui:runtime-module:solid-js";
53
47
  import { projectAccount, projectSidebar } from "./shared/8ae1927e5910ea81-sidebar-projection.js";
54
48
  import { MenuRefusedError, openAntigravityMenu } from "./shared/0e19a88ff3535906-command-dialogs.js";
55
49
  import { ANTIGRAVITY_MENU_COMMAND, ANTIGRAVITY_MENU_TITLE } from "./shared/07365a7d2ccade4c-host-api.js";
56
- import { ASSUMED_CONTENT_WIDTH, DEFAULT_QUOTA_APPEARANCE, QuotaAccountBlock } from "./shared/dd4c9e1a907f8ef0-quota-layout.js";
57
- import { fitRouteParts } from "./shared/6ca47cd4ec33fe72-route-layout.js";
50
+ import { DEFAULT_FRAME_SETTINGS, SidebarFrame } from "./shared/ced204104a639c9c-sidebar-frame.js";
58
51
  export const GA_TUI_ID = 'cortexkit.antigravity-auth';
59
52
  export const GA_RPC_ID = 'antigravity-auth';
60
53
  export const GA_RPC_VERSION = 1;
@@ -67,6 +60,11 @@ const MAX_PULLS_PER_TICK = 4;
67
60
 
68
61
  // ── Host surface (structural subset of the GA TUI context) ─────────────────
69
62
 
63
+ /**
64
+ * The host's durable plugin storage, as far as the sidebar uses it: one
65
+ * JSON store and the function that changes it.
66
+ */
67
+
70
68
  /** The parts of the GA TUI `Context` this adapter uses. */
71
69
 
72
70
  // ── Wire shapes ─────────────────────────────────────────────────────────────
@@ -1024,121 +1022,103 @@ export async function pollGaOnce(options) {
1024
1022
 
1025
1023
  // ── Sidebar ─────────────────────────────────────────────────────────────────
1026
1024
 
1027
- // The GA context carries no theme, so the quota layout keeps the host's
1028
- // default text color everywhere.
1029
- const HOST_COLORS = {
1030
- text: () => undefined,
1031
- muted: () => undefined,
1032
- tone: () => undefined
1033
- };
1025
+ /**
1026
+ * The OpenCode 2 host theme tokens the sidebar reads (the host's resolved
1027
+ * theme, as far as this sidebar uses it). Any of them may be missing.
1028
+ */
1029
+
1030
+ /**
1031
+ * Maps the OpenCode 2 semantic theme tokens onto the frame's OpenCode 1
1032
+ * names. A missing token falls back to a sibling token; with none at all
1033
+ * the color stays `undefined`, so the host's default color shows and no
1034
+ * color is ever fixed here.
1035
+ */
1036
+ export function sidebarThemeFromHost(theme) {
1037
+ const text = theme?.text?.base ?? theme?.text?.muted ?? theme?.text?.action?.primary?.base;
1038
+ const accent = theme?.text?.action?.primary?.base ?? text;
1039
+ const feedback = theme?.text?.feedback;
1040
+ return {
1041
+ text,
1042
+ textMuted: theme?.text?.muted ?? text,
1043
+ accent,
1044
+ background: theme?.background?.base ?? theme?.background?.raised?.base,
1045
+ borderActive: theme?.border?.base ?? accent,
1046
+ success: feedback?.success?.base ?? feedback?.success?.muted,
1047
+ warning: feedback?.warning?.base ?? feedback?.warning?.muted,
1048
+ error: feedback?.error?.base ?? feedback?.error?.muted
1049
+ };
1050
+ }
1034
1051
  function GaSidebar(props) {
1035
- // The route line belongs to one session; show it only in that session's
1052
+ // The route belongs to one session; show it only in that session's
1036
1053
  // sidebar, never another session's.
1037
1054
  const route = () => {
1038
1055
  const view = props.view();
1039
1056
  if (view === undefined || view.scope.kind !== 'session') return null;
1040
- return view.scope.sessionID === props.sessionID ? view.projected.route : null;
1041
- };
1042
- const routeLine = () => {
1043
- const value = route();
1044
- if (value === null) return null;
1045
- return `Route ${fitRouteParts('Route', value.split(' · '), contentWidth())}`;
1057
+ if (view.scope.sessionID !== props.sessionID || view.route === null) return null;
1058
+ return {
1059
+ ...(view.route.strategy ? {
1060
+ strategy: view.route.strategy
1061
+ } : {}),
1062
+ family: view.route.modelFamily,
1063
+ style: view.route.headerStyle
1064
+ };
1046
1065
  };
1047
- // The quota rows are sized to the sidebar's width so none of them wraps.
1048
- // Layout reports the width during a render pass, so the signal is updated
1049
- // afterwards rather than rebuilding rows mid-pass.
1050
- const [contentWidth, setContentWidth] = createSignal(ASSUMED_CONTENT_WIDTH);
1051
- let titleRow;
1052
- const measureContentWidth = () => {
1053
- const width = titleRow?.width;
1054
- if (typeof width !== 'number' || width <= 0) return;
1055
- queueMicrotask(() => {
1056
- if (width !== contentWidth()) setContentWidth(width);
1066
+ return _$createComponent(SidebarFrame, {
1067
+ theme: () => sidebarThemeFromHost(props.theme()),
1068
+ settings: () => DEFAULT_FRAME_SETTINGS,
1069
+ get version() {
1070
+ return props.version;
1071
+ },
1072
+ get collapsed() {
1073
+ return props.collapsed;
1074
+ },
1075
+ get onToggleCollapsed() {
1076
+ return props.toggleCollapsed;
1077
+ },
1078
+ accounts: () => props.view()?.accounts ?? [],
1079
+ route: route,
1080
+ quotaBackoffUntil: () => props.view()?.quotaBackoffUntil ?? undefined,
1081
+ lastError: () => undefined,
1082
+ now: () => props.view()?.readAt ?? 0
1083
+ });
1084
+ }
1085
+
1086
+ /** Where the collapse choice is kept in the host's plugin storage. */
1087
+ export const GA_SIDEBAR_STORE_KEY = 'antigravity-auth.sidebar';
1088
+
1089
+ /**
1090
+ * The collapse state: the host's durable plugin storage when it has one, so
1091
+ * the choice survives a reload; for this TUI session otherwise.
1092
+ */
1093
+ function createGaCollapse(storage, logger) {
1094
+ const saved = storage?.store(GA_SIDEBAR_STORE_KEY, {
1095
+ initial: {
1096
+ collapsed: false
1097
+ }
1098
+ });
1099
+ // A click updates the sidebar at once: the local choice wins while its
1100
+ // save is pending, and once storage holds it the stored value decides
1101
+ // again. Without storage the local choice lasts for the session.
1102
+ const [chosen, setChosen] = createSignal(undefined);
1103
+ const collapsed = () => chosen() ?? saved?.[0].collapsed === true;
1104
+ const toggle = () => {
1105
+ const next = !collapsed();
1106
+ setChosen(next);
1107
+ if (!saved) return;
1108
+ saved[1](draft => {
1109
+ draft.collapsed = next;
1110
+ }).then(() => {
1111
+ if (chosen() === next && saved[0].collapsed === next) setChosen(undefined);
1112
+ }, error => {
1113
+ logger?.warn('sidebar-collapse-not-saved', {
1114
+ error: error instanceof Error ? error.name : typeof error
1115
+ });
1057
1116
  });
1058
1117
  };
1059
- return (() => {
1060
- var _el$ = _$createElement("box"),
1061
- _el$2 = _$createElement("box"),
1062
- _el$3 = _$createElement("text"),
1063
- _el$4 = _$createElement("b");
1064
- _$insertNode(_el$, _el$2);
1065
- _$setProp(_el$, "flexDirection", 'column');
1066
- _$setProp(_el$, "width", '100%');
1067
- _$insertNode(_el$2, _el$3);
1068
- _$use(element => {
1069
- titleRow = element;
1070
- }, _el$2);
1071
- _$setProp(_el$2, "onSizeChange", measureContentWidth);
1072
- _$setProp(_el$2, "width", '100%');
1073
- _$setProp(_el$2, "flexDirection", 'row');
1074
- _$insertNode(_el$3, _el$4);
1075
- _$insertNode(_el$4, _$createTextNode(`Antigravity`));
1076
- _$insert(_el$, _$createComponent(Show, {
1077
- get when() {
1078
- return props.view();
1079
- },
1080
- get fallback() {
1081
- return (() => {
1082
- var _el$6 = _$createElement("text");
1083
- _$insertNode(_el$6, _$createTextNode(`connecting…`));
1084
- return _el$6;
1085
- })();
1086
- },
1087
- children: view => [_$createComponent(For, {
1088
- get each() {
1089
- return view().projected.accounts;
1090
- },
1091
- children: (account, index) => _$createComponent(Show, {
1092
- get when() {
1093
- return view().accounts[index()];
1094
- },
1095
- children: source => _$createComponent(QuotaAccountBlock, {
1096
- palette: HOST_COLORS,
1097
- appearance: DEFAULT_QUOTA_APPEARANCE,
1098
- get account() {
1099
- return source();
1100
- },
1101
- get status() {
1102
- return account.status;
1103
- },
1104
- get statusTone() {
1105
- return account.statusTone;
1106
- },
1107
- now: () => view().readAt,
1108
- width: contentWidth,
1109
- get marginTop() {
1110
- return index() === 0 ? 0 : 1;
1111
- },
1112
- get children() {
1113
- var _el$8 = _$createElement("text");
1114
- _$insert(_el$8, () => ` ${account.health}`);
1115
- return _el$8;
1116
- }
1117
- })
1118
- })
1119
- }), _$createComponent(Show, {
1120
- get when() {
1121
- return routeLine();
1122
- },
1123
- children: line => (() => {
1124
- var _el$9 = _$createElement("text");
1125
- _$setProp(_el$9, "wrapMode", 'none');
1126
- _$insert(_el$9, line);
1127
- return _el$9;
1128
- })()
1129
- }), _$createComponent(For, {
1130
- get each() {
1131
- return view().projected.notices;
1132
- },
1133
- children: notice => (() => {
1134
- var _el$0 = _$createElement("text");
1135
- _$insert(_el$0, notice);
1136
- return _el$0;
1137
- })()
1138
- })]
1139
- }), null);
1140
- return _el$;
1141
- })();
1118
+ return {
1119
+ collapsed,
1120
+ toggle
1121
+ };
1142
1122
  }
1143
1123
 
1144
1124
  // ── Plugin setup ────────────────────────────────────────────────────────────
@@ -1167,12 +1147,23 @@ export function setupGaTui(context, options = {}) {
1167
1147
  const active = () => !client.disposed();
1168
1148
  const ui = createGaMenuUi(context, active);
1169
1149
  const [view, setView] = createSignal(undefined);
1150
+ const collapse = createGaCollapse(context.storage, logger);
1170
1151
  const releaseSlot = context.ui.slot({
1171
1152
  append: 'sidebar.content',
1172
1153
  render: input => _$createComponent(GaSidebar, {
1173
1154
  view: view,
1174
1155
  get sessionID() {
1175
1156
  return input.sessionID;
1157
+ },
1158
+ theme: () => context.theme,
1159
+ get version() {
1160
+ return options.version ?? '';
1161
+ },
1162
+ get collapsed() {
1163
+ return collapse.collapsed;
1164
+ },
1165
+ get toggleCollapsed() {
1166
+ return collapse.toggle;
1176
1167
  }
1177
1168
  })
1178
1169
  });
@@ -1185,12 +1176,8 @@ export function setupGaTui(context, options = {}) {
1185
1176
  setView({
1186
1177
  scope: snapshot.scope,
1187
1178
  accounts: snapshot.accounts,
1188
- projected: projectSidebar({
1189
- accounts: snapshot.accounts,
1190
- route: snapshot.route,
1191
- status: snapshot.status,
1192
- now: readAt
1193
- }),
1179
+ route: snapshot.route,
1180
+ quotaBackoffUntil: snapshot.status.quotaBackoffUntil,
1194
1181
  readAt
1195
1182
  });
1196
1183
  };
@@ -1299,10 +1286,15 @@ export function setupGaTui(context, options = {}) {
1299
1286
  * The GA TUI plugin definition (`{ id, setup }`, the 2.0.22 TUI plugin
1300
1287
  * shape). Importing this module starts nothing; `setup` binds to the
1301
1288
  * context's location and returns the cleanup that stops everything it
1302
- * started.
1289
+ * started. The host calls `setup(context)`; the package's `./tui` entry
1290
+ * passes the plugin version as the second argument. This module's graph
1291
+ * may use no Node built-in (the build refuses one), so it cannot read
1292
+ * `package.json` itself.
1303
1293
  */
1304
1294
  const gaTuiPlugin = {
1305
1295
  id: GA_TUI_ID,
1306
- setup: context => setupGaTui(context)
1296
+ setup: (context, options = {}) => setupGaTui(context, options.version ? {
1297
+ version: options.version
1298
+ } : {})
1307
1299
  };
1308
1300
  export default gaTuiPlugin;