gloomberb 0.15.2 → 0.15.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.
Files changed (1924) hide show
  1. package/README.md +31 -2
  2. package/README.zh-CN.md +12 -2
  3. package/package.json +20 -21
  4. package/src/api-client/auth.ts +7 -1
  5. package/src/api-client/chat.ts +1 -2
  6. package/src/api-client/collections.ts +1 -13
  7. package/src/api-client/credit-boards.ts +67 -0
  8. package/src/api-client/data.ts +93 -57
  9. package/src/api-client/earnings.ts +80 -0
  10. package/src/api-client/equity-screener.ts +25 -0
  11. package/src/api-client/errors.ts +42 -0
  12. package/src/api-client/feedback.ts +1 -2
  13. package/src/api-client/futures-curve.ts +30 -0
  14. package/src/api-client/index.ts +108 -100
  15. package/src/api-client/ipo.ts +99 -0
  16. package/src/api-client/market-movers.ts +60 -0
  17. package/src/api-client/mna.ts +118 -0
  18. package/src/api-client/normalizers.ts +0 -7
  19. package/src/api-client/notes.ts +20 -34
  20. package/src/api-client/paths.ts +21 -19
  21. package/src/api-client/plan-access.ts +27 -0
  22. package/src/api-client/plan-rules.ts +87 -0
  23. package/src/api-client/request.ts +40 -4
  24. package/src/api-client/research-activity.ts +17 -1
  25. package/src/api-client/revenue-breakdown.ts +36 -0
  26. package/src/api-client/session-cookie.ts +6 -0
  27. package/src/api-client/social-mentions.ts +63 -0
  28. package/src/api-client/teams.ts +1 -26
  29. package/src/api-client/telemetry.ts +180 -0
  30. package/src/api-client/theses.ts +9 -36
  31. package/src/api-client/types.ts +66 -61
  32. package/src/api-client/views.ts +22 -49
  33. package/src/app/app-bootstrap-state.ts +3 -14
  34. package/src/app/pane-runtime/plugin-bindings.ts +21 -1
  35. package/src/app/runtime/broker-import.ts +5 -1
  36. package/src/app/runtime/desktop-menu.ts +23 -12
  37. package/src/app/runtime/layout-warmup.ts +2 -2
  38. package/src/app/runtime/plugin-bindings.ts +27 -7
  39. package/src/app/runtime/startup.ts +55 -1
  40. package/src/app/runtime/ticker-refresh.ts +6 -6
  41. package/src/app/runtime/update.ts +4 -2
  42. package/src/app.tsx +15 -1
  43. package/src/assets/gloomberb-logo-windows.ico +0 -0
  44. package/src/assets/gloomberb-logo-windows.png +0 -0
  45. package/src/assets/gloomberb-logo.svg +1 -73
  46. package/src/assets/gloomberb-mark.ico +0 -0
  47. package/src/assets/gloomberb-mark.svg +1 -0
  48. package/src/brokers/broker-portfolio-sync.ts +75 -6
  49. package/src/brokers/broker-ticker-sync.ts +3 -1
  50. package/src/brokers/cloud-broker-link.ts +26 -0
  51. package/src/brokers/directory.ts +56 -0
  52. package/src/brokers/remote-broker-adapter.ts +4 -1
  53. package/src/brokers/signed-in/adapter.ts +259 -0
  54. package/src/brokers/signed-in/catalog.ts +129 -0
  55. package/src/brokers/signed-in/client.ts +54 -0
  56. package/src/brokers/signed-in/connect.ts +69 -0
  57. package/src/brokers/signed-in/profile.ts +18 -0
  58. package/src/brokers/signed-in/sign-in-dialog.tsx +187 -0
  59. package/src/brokers/signed-in/sign-in.ts +178 -0
  60. package/src/brokers/sync-broker-instance.ts +42 -24
  61. package/src/capabilities/index.ts +42 -6
  62. package/src/cli/commands/broker.ts +49 -0
  63. package/src/cli/commands/market.ts +5 -0
  64. package/src/cli/commands/overview.ts +2 -5
  65. package/src/cli/commands/plugins.ts +112 -428
  66. package/src/cli/commands/system.ts +26 -354
  67. package/src/cli/commands/ticker.ts +11 -34
  68. package/src/cli/desktop-pane-shot-routes.ts +7 -0
  69. package/src/cli/desktop-pane-shot.ts +7 -27
  70. package/src/cli/entry.ts +20 -23
  71. package/src/cli/helpers.ts +5 -19
  72. package/src/cli/index.ts +17 -23
  73. package/src/cli/pane-functions/capabilities.ts +0 -4
  74. package/src/cli/pane-functions/catalog.ts +30 -4
  75. package/src/cli/pane-functions/headless.ts +1 -4
  76. package/src/cli/pane-functions/index.ts +0 -23
  77. package/src/cli/pane-functions/options.ts +8 -5
  78. package/src/cli/pane-functions/screenshot-evidence.ts +106 -0
  79. package/src/cli/pane-functions/screenshot.ts +48 -291
  80. package/src/cli/restore-plugins.ts +10 -2
  81. package/src/components/chart/composite/axis-overlays.tsx +87 -22
  82. package/src/components/chart/composite/composite-chart.tsx +5 -6
  83. package/src/components/chart/composite/downsample.ts +4 -7
  84. package/src/components/chart/composite/format.ts +39 -3
  85. package/src/components/chart/composite/interactions.ts +1 -29
  86. package/src/components/chart/composite/price-axis-labels.tsx +1 -4
  87. package/src/components/chart/composite/rasterizer.ts +1 -19
  88. package/src/components/chart/composite/scene.ts +7 -10
  89. package/src/components/chart/composite/text-renderer.ts +5 -21
  90. package/src/components/chart/composite/time-axis.ts +1 -4
  91. package/src/components/chart/composite/tools.ts +2 -1
  92. package/src/components/chart/core/pointer.ts +1 -4
  93. package/src/components/chart/curve/curve-surface.tsx +180 -48
  94. package/src/components/chart/curve/index.ts +3 -2
  95. package/src/components/chart/curve/model.ts +200 -31
  96. package/src/components/chart/native/chart-rasterizer.ts +1 -0
  97. package/src/components/chart/native/kitty/protocol.ts +1 -1
  98. package/src/components/chart/native/raster/crosshair.ts +1 -2
  99. package/src/components/chart/native/raster/placement.ts +6 -0
  100. package/src/components/chart/native/raster/primitives.ts +5 -9
  101. package/src/components/chart/native/raster/types.ts +0 -7
  102. package/src/components/chart/native/renderer-selection.ts +4 -4
  103. package/src/components/chart/native/surface/manager.ts +7 -12
  104. package/src/components/chart/static/chart-surface.tsx +4 -7
  105. package/src/components/chart/static/index.ts +0 -1
  106. package/src/components/chart/static/trail-chart-surface.tsx +393 -66
  107. package/src/components/chart/surface3d/model.ts +2 -2
  108. package/src/components/chart/surface3d/software.ts +2 -1
  109. package/src/components/chart-table/axis.ts +29 -0
  110. package/src/components/chart-table/header.tsx +264 -0
  111. package/src/components/chart-table/index.ts +14 -0
  112. package/src/components/chart-table/layout.ts +139 -0
  113. package/src/components/chart-table/selection.ts +145 -0
  114. package/src/components/command-bar/action-runtime.ts +1 -2
  115. package/src/components/command-bar/assist/inventory.ts +83 -30
  116. package/src/components/command-bar/assist/model.ts +4 -0
  117. package/src/components/command-bar/assist/runtime.ts +79 -26
  118. package/src/components/command-bar/commands/collection.ts +1 -6
  119. package/src/components/command-bar/commands/direct/index.ts +26 -2
  120. package/src/components/command-bar/commands/direct/runtime.ts +1 -1
  121. package/src/components/command-bar/commands/plugin/actions.ts +2 -1
  122. package/src/components/command-bar/commands/plugin/items.ts +10 -0
  123. package/src/components/command-bar/commands/registry.ts +23 -0
  124. package/src/components/command-bar/helpers.ts +0 -1
  125. package/src/components/command-bar/layout-items/current-layout.ts +11 -9
  126. package/src/components/command-bar/layout-items/types.ts +0 -1
  127. package/src/components/command-bar/layout-items.ts +0 -3
  128. package/src/components/command-bar/list/model.ts +5 -0
  129. package/src/components/command-bar/list/navigation.ts +2 -5
  130. package/src/components/command-bar/list/view.tsx +7 -7
  131. package/src/components/command-bar/pane-actions.ts +3 -8
  132. package/src/components/command-bar/pane-templates/workflow.ts +5 -1
  133. package/src/components/command-bar/panel/index.tsx +5 -5
  134. package/src/components/command-bar/panel/runtime.ts +4 -1
  135. package/src/components/command-bar/picker-activation.ts +14 -4
  136. package/src/components/command-bar/routes/root/command-items.ts +19 -1
  137. package/src/components/command-bar/routes/root/plugin-install.ts +304 -0
  138. package/src/components/command-bar/routes/root/results.ts +10 -1
  139. package/src/components/command-bar/routes/root/runtime.ts +12 -8
  140. package/src/components/command-bar/routes/root/search-report.ts +246 -0
  141. package/src/components/command-bar/routes/root/selection.ts +14 -5
  142. package/src/components/command-bar/routes/root/shortcut-items.ts +2 -0
  143. package/src/components/command-bar/routing/actions.ts +2 -8
  144. package/src/components/command-bar/routing/confirm.ts +6 -1
  145. package/src/components/command-bar/routing/launch-request.ts +7 -0
  146. package/src/components/command-bar/routing/navigation-state.ts +24 -0
  147. package/src/components/command-bar/selection-runtime.ts +110 -65
  148. package/src/components/command-bar/surface/index.tsx +116 -19
  149. package/src/components/command-bar/theme-picker.tsx +11 -10
  150. package/src/components/command-bar/view-model.ts +10 -6
  151. package/src/components/command-bar/workflow/body.tsx +6 -5
  152. package/src/components/command-bar/workflow/broker.ts +113 -76
  153. package/src/components/command-bar/workflow/collection-actions.ts +39 -8
  154. package/src/components/command-bar/workflow/coordinator.ts +19 -10
  155. package/src/components/command-bar/workflow/field-row.tsx +3 -3
  156. package/src/components/command-bar/workflow/fields.ts +14 -5
  157. package/src/components/command-bar/workflow/ops.ts +14 -1
  158. package/src/components/command-bar/workflow/submit.ts +23 -9
  159. package/src/components/command-bar/workflow/types.ts +3 -0
  160. package/src/components/data-table/export.ts +103 -6
  161. package/src/components/data-table/stack-view.tsx +22 -2
  162. package/src/components/data-table/table-pane.ts +45 -0
  163. package/src/components/data-table/view.tsx +24 -10
  164. package/src/components/feed-data-table/stack-view.tsx +47 -130
  165. package/src/components/index.ts +49 -5
  166. package/src/components/layout/header.tsx +5 -12
  167. package/src/components/layout/market-summary.ts +1 -2
  168. package/src/components/layout/missing-pane.tsx +2 -7
  169. package/src/components/layout/pane/header-tabs.tsx +2 -1
  170. package/src/components/layout/pane/header.tsx +2 -6
  171. package/src/components/layout/pane/pane-tabs.tsx +41 -0
  172. package/src/components/layout/pane/status-footer.ts +92 -0
  173. package/src/components/layout/shell/action-menu-overlay.tsx +3 -3
  174. package/src/components/layout/shell/index.tsx +6 -10
  175. package/src/components/layout/shell/menu.ts +1 -5
  176. package/src/components/layout/shell/native/surfaces.ts +3 -4
  177. package/src/components/layout/shell/pane/actions.ts +8 -9
  178. package/src/components/layout/shell/shortcuts.ts +4 -1
  179. package/src/components/layout/shell/window-mode/overlays.tsx +3 -2
  180. package/src/components/layout/status-bar.tsx +34 -47
  181. package/src/components/layout/titlebar-overlay.ts +3 -14
  182. package/src/components/layout/window-edit/status.tsx +3 -9
  183. package/src/components/markdown-text.tsx +306 -2
  184. package/src/components/market-board/index.tsx +60 -16
  185. package/src/components/onboarding/account-step/form-panel.tsx +2 -2
  186. package/src/components/onboarding/account-step/qr-panel.tsx +13 -30
  187. package/src/components/onboarding/account-step/signed-in-panel.tsx +2 -2
  188. package/src/components/onboarding/first-run-workspace.ts +8 -6
  189. package/src/components/onboarding/onboarding-frame.tsx +11 -15
  190. package/src/components/onboarding/onboarding-wizard.tsx +51 -30
  191. package/src/components/onboarding/portfolio-step/broker-fields-panel.tsx +2 -2
  192. package/src/components/onboarding/portfolio-step/broker-setup-panel.tsx +2 -2
  193. package/src/components/onboarding/portfolio-step/broker-sync-panel.tsx +2 -2
  194. package/src/components/onboarding/portfolio-step/choose-panel.tsx +2 -2
  195. package/src/components/onboarding/portfolio-step/positions-panel.tsx +2 -2
  196. package/src/components/onboarding/wizard-broker-sync.ts +122 -51
  197. package/src/components/onboarding/wizard-model.ts +20 -7
  198. package/src/components/onboarding/wizard-positions.ts +1 -1
  199. package/src/components/paged-rows.ts +217 -0
  200. package/src/components/pane-settings-dialog/field-dialogs.tsx +2 -2
  201. package/src/components/pane-settings-dialog.tsx +2 -2
  202. package/src/components/price-sparkline/model.ts +11 -8
  203. package/src/components/price-sparkline/view.tsx +10 -7
  204. package/src/components/sign-in-code-panel.tsx +128 -0
  205. package/src/components/sign-in-gate.tsx +8 -22
  206. package/src/components/speedometer-gauge/index.tsx +2 -2
  207. package/src/components/speedometer-gauge/model.ts +1 -4
  208. package/src/components/table-view-shared.tsx +0 -44
  209. package/src/components/ticker/badge/format.ts +0 -4
  210. package/src/components/ticker/list-table-view.tsx +6 -37
  211. package/src/components/toggle-list.tsx +2 -2
  212. package/src/components/ui/choice-dialog.tsx +4 -8
  213. package/src/components/ui/confirm-dialog.tsx +21 -1
  214. package/src/components/ui/data-table/hooks.ts +46 -0
  215. package/src/components/ui/data-table/opentui/index.tsx +21 -30
  216. package/src/components/ui/data-table/opentui/model.ts +0 -21
  217. package/src/components/ui/data-table/types.ts +20 -0
  218. package/src/components/ui/data-table/visible-range.ts +26 -2
  219. package/src/components/ui/detail-scroll-body.tsx +48 -0
  220. package/src/components/ui/disclosure-marker.tsx +2 -2
  221. package/src/components/ui/display.tsx +8 -4
  222. package/src/components/ui/field-grid.tsx +26 -2
  223. package/src/components/ui/field-ring.ts +125 -0
  224. package/src/components/ui/fields.tsx +65 -3
  225. package/src/components/ui/index.ts +18 -7
  226. package/src/components/ui/multi-select/dialog.tsx +3 -3
  227. package/src/components/ui/page-stack-view.tsx +2 -0
  228. package/src/components/ui/prose.tsx +52 -0
  229. package/src/components/ui/query-bar.tsx +37 -9
  230. package/src/components/ui/reveal-in-scroll-box.ts +34 -0
  231. package/src/components/ui/select-button.tsx +2 -2
  232. package/src/components/ui/split-bar.tsx +69 -0
  233. package/src/components/ui/stat-grid.tsx +38 -14
  234. package/src/components/ui/status.tsx +2 -0
  235. package/src/components/ui/text-prompt-dialog.tsx +128 -0
  236. package/src/core/app-runtime.ts +5 -0
  237. package/src/core/connection-health.ts +2 -4
  238. package/src/core/state/app/layout.ts +13 -0
  239. package/src/core/state/app/types.ts +16 -0
  240. package/src/core/state/session-persistence.ts +8 -14
  241. package/src/data/cached-query.ts +5 -0
  242. package/src/data/config/chart-settings.ts +14 -21
  243. package/src/data/config/layout.ts +0 -8
  244. package/src/data/config/store/migrations.ts +74 -141
  245. package/src/data/config/store/node.ts +29 -3
  246. package/src/data/config/store/normalize.ts +35 -63
  247. package/src/data/config/store/pane-state.ts +47 -0
  248. package/src/data/fred-series.ts +7 -18
  249. package/src/data/json-persistence.ts +1 -4
  250. package/src/data/json-ticker-repository.ts +1 -4
  251. package/src/i18n/es.ts +26 -5
  252. package/src/i18n/ja.ts +26 -5
  253. package/src/i18n/ko.ts +26 -5
  254. package/src/i18n/languages.ts +18 -0
  255. package/src/i18n/zh-cn.ts +26 -5
  256. package/src/i18n/zh-tw.ts +26 -5
  257. package/src/layout-marketplace/cloud.ts +11 -54
  258. package/src/layout-marketplace/gallery.tsx +32 -46
  259. package/src/layout-marketplace/linked-sync.ts +1 -2
  260. package/src/layout-marketplace/payload.ts +16 -19
  261. package/src/market-data/coordinator/chart.ts +5 -4
  262. package/src/market-data/coordinator/events.ts +15 -2
  263. package/src/market-data/coordinator/index.ts +37 -9
  264. package/src/market-data/coordinator/quotes.ts +2 -9
  265. package/src/market-data/history-session.ts +2 -9
  266. package/src/market-data/hooks.tsx +3 -3
  267. package/src/market-data/market/format.ts +26 -0
  268. package/src/market-data/market/freshness.ts +5 -34
  269. package/src/market-data/market/price-basis.ts +1 -1
  270. package/src/market-data/market/status.ts +1 -1
  271. package/src/market-data/query-store.ts +37 -31
  272. package/src/market-data/quotes/day-range.ts +2 -8
  273. package/src/market-data/quotes/freshness.ts +2 -4
  274. package/src/market-data/quotes/screener-live-quotes.ts +162 -0
  275. package/src/market-data/realized-volatility.ts +292 -0
  276. package/src/market-data/selectors.ts +27 -10
  277. package/src/market-data/snapshot-provider.ts +3 -2
  278. package/src/news/aggregator.ts +0 -35
  279. package/src/news/source-label.ts +22 -0
  280. package/src/news/types.ts +1 -0
  281. package/src/pane-settings.ts +0 -8
  282. package/src/plugins/absorbed.ts +33 -0
  283. package/src/plugins/auto-update-node.ts +114 -0
  284. package/src/plugins/auto-update.ts +281 -0
  285. package/src/plugins/builtin/account-management/form-components.tsx +8 -83
  286. package/src/plugins/builtin/account-management/index.tsx +26 -0
  287. package/src/plugins/builtin/account-management/keyboard.ts +50 -98
  288. package/src/plugins/builtin/account-management/model.ts +19 -53
  289. package/src/plugins/builtin/account-management/navigation.ts +6 -21
  290. package/src/plugins/builtin/account-management/pane.tsx +76 -187
  291. package/src/plugins/builtin/account-management/password-dialog.tsx +10 -8
  292. package/src/plugins/builtin/alerts/cli.ts +96 -0
  293. package/src/plugins/builtin/alerts/events-pane.tsx +22 -50
  294. package/src/plugins/builtin/alerts/history-pane.tsx +20 -59
  295. package/src/plugins/builtin/alerts/history.ts +1 -1
  296. package/src/plugins/builtin/alerts/index.tsx +2 -0
  297. package/src/plugins/builtin/alerts/pane.tsx +27 -65
  298. package/src/plugins/builtin/alerts/research-rules.ts +8 -3
  299. package/src/plugins/builtin/analytics/account-returns.ts +109 -0
  300. package/src/plugins/builtin/analytics/broker-performance.ts +4 -2
  301. package/src/plugins/builtin/analytics/display.ts +0 -32
  302. package/src/plugins/builtin/analytics/index.tsx +119 -88
  303. package/src/plugins/builtin/analytics/metrics.ts +0 -26
  304. package/src/plugins/builtin/analytics/pane-model.ts +25 -17
  305. package/src/plugins/builtin/analytics/risk-client.ts +11 -14
  306. package/src/plugins/builtin/analytics/risk-evidence.ts +45 -15
  307. package/src/plugins/builtin/analytics/risk-pane.tsx +134 -139
  308. package/src/plugins/builtin/analytics/sector-model.ts +0 -11
  309. package/src/plugins/builtin/analytics/view.tsx +92 -111
  310. package/src/plugins/builtin/backtest/client.ts +5 -6
  311. package/src/plugins/builtin/backtest/pane.tsx +35 -41
  312. package/src/plugins/builtin/backtest/rules.ts +0 -8
  313. package/src/plugins/builtin/bond-calculator/model.ts +0 -1
  314. package/src/plugins/builtin/bond-calculator/pane.tsx +8 -15
  315. package/src/plugins/builtin/broker-manager/detail.tsx +39 -76
  316. package/src/plugins/builtin/broker-manager/footer.ts +3 -3
  317. package/src/plugins/builtin/broker-manager/index.tsx +24 -4
  318. package/src/plugins/builtin/broker-manager/keyboard.ts +7 -30
  319. package/src/plugins/builtin/broker-manager/model.ts +4 -7
  320. package/src/plugins/builtin/broker-manager/pane-actions.tsx +74 -34
  321. package/src/plugins/builtin/broker-manager/table.ts +3 -12
  322. package/src/plugins/builtin/buildout/cells.tsx +34 -36
  323. package/src/plugins/builtin/buildout/detail/company.tsx +5 -4
  324. package/src/plugins/builtin/buildout/detail/site.tsx +6 -5
  325. package/src/plugins/builtin/buildout/detail/ui.tsx +10 -9
  326. package/src/plugins/builtin/buildout/format.ts +3 -8
  327. package/src/plugins/builtin/buildout/index.tsx +23 -0
  328. package/src/plugins/builtin/buildout/model/types.ts +0 -1
  329. package/src/plugins/builtin/buildout/pane/index.tsx +18 -40
  330. package/src/plugins/builtin/buildout/table-model.ts +1 -1
  331. package/src/plugins/builtin/builtin-plugin-meta.ts +51 -0
  332. package/src/plugins/builtin/cds/client.ts +33 -1
  333. package/src/plugins/builtin/cds/index.tsx +4 -4
  334. package/src/plugins/builtin/cds/model.ts +56 -10
  335. package/src/plugins/builtin/cds/pane.tsx +139 -49
  336. package/src/plugins/builtin/central-bank-rates/client.ts +5 -17
  337. package/src/plugins/builtin/central-bank-rates/headless.ts +1 -1
  338. package/src/plugins/builtin/central-bank-rates/index.tsx +1 -1
  339. package/src/plugins/builtin/central-bank-rates/pane.tsx +15 -20
  340. package/src/plugins/builtin/changelog/index.tsx +23 -105
  341. package/src/plugins/builtin/changelog/model.ts +2 -12
  342. package/src/plugins/builtin/chart-composer/catalog-inventory.ts +3 -2
  343. package/src/plugins/builtin/chart-composer/chart-spec.ts +1 -4
  344. package/src/plugins/builtin/chart-composer/data-catalog-pane.tsx +20 -71
  345. package/src/plugins/builtin/chart-composer/editor/controller.ts +8 -12
  346. package/src/plugins/builtin/chart-composer/editor.tsx +2 -2
  347. package/src/plugins/builtin/chart-composer/follow-binding.ts +6 -1
  348. package/src/plugins/builtin/chart-composer/index.tsx +6 -9
  349. package/src/plugins/builtin/chart-composer/pane.tsx +50 -3
  350. package/src/plugins/builtin/chart-composer/presets.ts +34 -0
  351. package/src/plugins/builtin/chart-composer/quick-add.tsx +17 -23
  352. package/src/plugins/builtin/chart-composer/semantic.ts +1 -0
  353. package/src/plugins/builtin/chart-composer/settings.ts +1 -1
  354. package/src/plugins/builtin/chat/channels.ts +0 -2
  355. package/src/plugins/builtin/chat/content/index.tsx +1 -1
  356. package/src/plugins/builtin/chat/content/layout-metrics.ts +3 -6
  357. package/src/plugins/builtin/chat/controller/fetch.ts +1 -14
  358. package/src/plugins/builtin/chat/controller/state.ts +4 -2
  359. package/src/plugins/builtin/chat/controller/utils.ts +0 -14
  360. package/src/plugins/builtin/chat/index.tsx +105 -0
  361. package/src/plugins/builtin/chat/message/desktop.tsx +22 -94
  362. package/src/plugins/builtin/chat/message/header.tsx +83 -0
  363. package/src/plugins/builtin/chat/message/profile-popover.tsx +1 -1
  364. package/src/plugins/builtin/chat/message/render-state.ts +10 -2
  365. package/src/plugins/builtin/chat/message/terminal.tsx +22 -78
  366. package/src/plugins/builtin/chat/pane.tsx +112 -124
  367. package/src/plugins/builtin/chat/sidebar.tsx +2 -18
  368. package/src/plugins/builtin/chat/status-widget.tsx +0 -3
  369. package/src/plugins/builtin/cloud/askg/executor.ts +14 -39
  370. package/src/plugins/builtin/cloud/askg/json.ts +31 -0
  371. package/src/plugins/builtin/cloud/askg/manifest.ts +1 -1
  372. package/src/plugins/builtin/cloud/askg/pane.tsx +10 -16
  373. package/src/plugins/builtin/cloud/askg/pending-question.ts +5 -27
  374. package/src/plugins/builtin/cloud/askg/protocol.ts +1 -15
  375. package/src/plugins/builtin/cloud/askg/undo.ts +4 -29
  376. package/src/plugins/builtin/cloud/auth-actions.tsx +28 -1
  377. package/src/plugins/builtin/cloud/browser.tsx +1 -7
  378. package/src/plugins/builtin/cloud/device-signin-dialog.tsx +64 -147
  379. package/src/plugins/builtin/cloud/index.tsx +2 -11
  380. package/src/plugins/builtin/cloud/plugin.tsx +13 -151
  381. package/src/plugins/builtin/cloud/team/collections-sync.ts +4 -2
  382. package/src/plugins/builtin/cloud/team/collections.ts +0 -4
  383. package/src/plugins/builtin/cloud/team/model.ts +0 -4
  384. package/src/plugins/builtin/cloud/team/module.tsx +0 -3
  385. package/src/plugins/builtin/cloud/team/pane-model.ts +0 -7
  386. package/src/plugins/builtin/cloud/team/pane-request.ts +5 -22
  387. package/src/plugins/builtin/cloud/team/pane-sections.tsx +1 -1
  388. package/src/plugins/builtin/cloud/team/pane-ui.tsx +15 -24
  389. package/src/plugins/builtin/cloud/team/pane.tsx +21 -58
  390. package/src/plugins/builtin/cloud/thesis/board-pane.tsx +31 -50
  391. package/src/plugins/builtin/cloud/thesis/detail.tsx +1 -1
  392. package/src/plugins/builtin/cloud/thesis/exposure.ts +1 -4
  393. package/src/plugins/builtin/cloud/thesis/flows.ts +8 -7
  394. package/src/plugins/builtin/cloud/thesis/model.ts +0 -7
  395. package/src/plugins/builtin/cloud/thesis/pane-request.ts +5 -22
  396. package/src/plugins/builtin/cloud/thesis/prompts.tsx +13 -125
  397. package/src/plugins/builtin/cloud/thesis/ticker-tab.tsx +1 -1
  398. package/src/plugins/builtin/cloud/upgrade-command.ts +1 -1
  399. package/src/plugins/builtin/cloud/upgrade-dialog.tsx +231 -0
  400. package/src/plugins/builtin/cloud/upgrade-status-widget.tsx +2 -4
  401. package/src/plugins/builtin/cloud/verification-status-widget.tsx +2 -4
  402. package/src/plugins/builtin/cloud-tweets/footer.ts +2 -2
  403. package/src/plugins/builtin/cloud-tweets/index.ts +6 -0
  404. package/src/plugins/builtin/cloud-tweets/keyboard.ts +1 -32
  405. package/src/plugins/builtin/cloud-tweets/model.ts +1 -5
  406. package/src/plugins/builtin/cloud-tweets/pane.tsx +10 -43
  407. package/src/plugins/builtin/cloud-tweets/registration.ts +5 -8
  408. package/src/plugins/builtin/cloud-tweets/search-bar.tsx +5 -20
  409. package/src/plugins/builtin/cloud-tweets/table.tsx +16 -23
  410. package/src/plugins/builtin/composite-plugins.ts +77 -37
  411. package/src/plugins/builtin/congress-trades/detail.tsx +28 -81
  412. package/src/plugins/builtin/congress-trades/footer.ts +1 -1
  413. package/src/plugins/builtin/congress-trades/headless.ts +22 -45
  414. package/src/plugins/builtin/congress-trades/keyboard.ts +9 -78
  415. package/src/plugins/builtin/congress-trades/model.ts +4 -27
  416. package/src/plugins/builtin/congress-trades/pane.tsx +17 -38
  417. package/src/plugins/builtin/congress-trades/table.tsx +29 -34
  418. package/src/plugins/builtin/connections/pane.tsx +5 -12
  419. package/src/plugins/builtin/correlation/colors.ts +17 -7
  420. package/src/plugins/builtin/correlation/index.tsx +4 -6
  421. package/src/plugins/builtin/correlation/relationship/pane.tsx +6 -7
  422. package/src/plugins/builtin/correlation/relationship/view-model.ts +7 -18
  423. package/src/plugins/builtin/cot/client.ts +14 -18
  424. package/src/plugins/builtin/cot/index.tsx +3 -2
  425. package/src/plugins/builtin/cot/model.ts +13 -10
  426. package/src/plugins/builtin/cot/pane.tsx +70 -45
  427. package/src/plugins/builtin/credit-boards/cdx-pane.tsx +140 -0
  428. package/src/plugins/builtin/credit-boards/client.ts +108 -0
  429. package/src/plugins/builtin/credit-boards/headless.ts +73 -0
  430. package/src/plugins/builtin/credit-boards/index.tsx +62 -0
  431. package/src/plugins/builtin/credit-boards/model.ts +221 -0
  432. package/src/plugins/builtin/credit-boards/sovr-pane.tsx +144 -0
  433. package/src/plugins/builtin/credit-conditions/index.tsx +33 -33
  434. package/src/plugins/builtin/crypto-board/client.ts +11 -34
  435. package/src/plugins/builtin/crypto-board/index.tsx +1 -1
  436. package/src/plugins/builtin/crypto-board/model.ts +14 -16
  437. package/src/plugins/builtin/crypto-board/pane.tsx +24 -50
  438. package/src/plugins/builtin/custom-view/index.tsx +1 -1
  439. package/src/plugins/builtin/custom-view/pane.tsx +1 -1
  440. package/src/plugins/builtin/custom-view/view-spec.ts +9 -12
  441. package/src/plugins/builtin/debt-maturities/client.ts +15 -42
  442. package/src/plugins/builtin/debt-maturities/model.ts +96 -31
  443. package/src/plugins/builtin/debt-maturities/pane.tsx +196 -223
  444. package/src/plugins/builtin/debt-maturities/wall-bar.tsx +63 -0
  445. package/src/plugins/builtin/debug/index.tsx +17 -46
  446. package/src/plugins/builtin/dividend-yield/client.ts +13 -33
  447. package/src/plugins/builtin/dividend-yield/model.ts +10 -22
  448. package/src/plugins/builtin/dividend-yield/pane.tsx +97 -143
  449. package/src/plugins/builtin/dividend-yield/trailing-cash.ts +3 -3
  450. package/src/plugins/builtin/dividend-yield/view.ts +2 -2
  451. package/src/plugins/builtin/earnings/board-model.ts +197 -0
  452. package/src/plugins/builtin/earnings/board-table.ts +84 -0
  453. package/src/plugins/builtin/earnings/board.tsx +236 -0
  454. package/src/plugins/builtin/earnings/client.ts +97 -0
  455. package/src/plugins/builtin/earnings/format.ts +62 -0
  456. package/src/plugins/builtin/earnings/headless.ts +134 -138
  457. package/src/plugins/builtin/earnings/history-model.ts +174 -0
  458. package/src/plugins/builtin/earnings/history-table.ts +84 -0
  459. package/src/plugins/builtin/earnings/history.tsx +107 -0
  460. package/src/plugins/builtin/earnings/index.tsx +70 -270
  461. package/src/plugins/builtin/earnings/model.ts +0 -99
  462. package/src/plugins/builtin/earnings-calls/data.ts +0 -5
  463. package/src/plugins/builtin/earnings-calls/format.ts +2 -8
  464. package/src/plugins/builtin/earnings-calls/index.tsx +0 -1
  465. package/src/plugins/builtin/earnings-calls/pane.tsx +16 -63
  466. package/src/plugins/builtin/earnings-calls/transcript-view.tsx +18 -61
  467. package/src/plugins/builtin/econ/calendar-model.ts +34 -1
  468. package/src/plugins/builtin/econ/detail-view.tsx +124 -139
  469. package/src/plugins/builtin/econ/fred-series-map.ts +1 -5
  470. package/src/plugins/builtin/econ/index.tsx +51 -90
  471. package/src/plugins/builtin/econ-statistics/client.ts +5 -4
  472. package/src/plugins/builtin/econ-statistics/defs.ts +1 -1
  473. package/src/plugins/builtin/econ-statistics/detail.tsx +32 -104
  474. package/src/plugins/builtin/econ-statistics/headless.ts +28 -50
  475. package/src/plugins/builtin/econ-statistics/index.tsx +1 -1
  476. package/src/plugins/builtin/econ-statistics/pane.tsx +36 -152
  477. package/src/plugins/builtin/econ-statistics/stats.ts +0 -5
  478. package/src/plugins/builtin/econ-statistics/view.ts +2 -4
  479. package/src/plugins/builtin/equity-screener/client.ts +2 -2
  480. package/src/plugins/builtin/equity-screener/live.ts +7 -9
  481. package/src/plugins/builtin/equity-screener/model.ts +67 -9
  482. package/src/plugins/builtin/equity-screener/pane.tsx +39 -58
  483. package/src/plugins/builtin/equity-screener/results.ts +2 -4
  484. package/src/plugins/builtin/estimate-revisions/client.ts +20 -49
  485. package/src/plugins/builtin/estimate-revisions/pane.tsx +71 -104
  486. package/src/plugins/builtin/executives/data.ts +3 -8
  487. package/src/plugins/builtin/executives/format.ts +3 -17
  488. package/src/plugins/builtin/executives/pane.tsx +33 -186
  489. package/src/plugins/builtin/fear-greed/cache.ts +100 -0
  490. package/src/plugins/builtin/fear-greed/charts.tsx +258 -0
  491. package/src/plugins/builtin/fear-greed/data.ts +376 -0
  492. package/src/plugins/builtin/fear-greed/format.ts +87 -0
  493. package/src/plugins/builtin/fear-greed/headless.ts +85 -0
  494. package/src/plugins/builtin/fear-greed/index.tsx +89 -0
  495. package/src/plugins/builtin/fear-greed/pane.tsx +112 -0
  496. package/src/plugins/builtin/filing-events/feed.ts +4 -14
  497. package/src/plugins/builtin/filing-events/pane.tsx +7 -21
  498. package/src/plugins/builtin/futures/contracts.ts +55 -33
  499. package/src/plugins/builtin/futures/index.tsx +61 -47
  500. package/src/plugins/builtin/futures/model.ts +39 -17
  501. package/src/plugins/builtin/futures/returns.ts +132 -0
  502. package/src/plugins/builtin/futures/table.tsx +72 -63
  503. package/src/plugins/builtin/futures/use-front-returns.ts +119 -0
  504. package/src/plugins/builtin/futures-curve/client.ts +30 -15
  505. package/src/plugins/builtin/futures-curve/headless.ts +10 -4
  506. package/src/plugins/builtin/futures-curve/index.tsx +2 -1
  507. package/src/plugins/builtin/futures-curve/model.ts +133 -18
  508. package/src/plugins/builtin/futures-curve/pane.tsx +141 -45
  509. package/src/plugins/builtin/fx-matrix/index.tsx +9 -17
  510. package/src/plugins/builtin/help/functions-table.tsx +2 -19
  511. package/src/plugins/builtin/help/index.tsx +6 -26
  512. package/src/plugins/builtin/help/shortcut-model.ts +7 -1
  513. package/src/plugins/builtin/holders/headless.ts +2 -2
  514. package/src/plugins/builtin/holders/index.tsx +0 -1
  515. package/src/plugins/builtin/holders/pane.tsx +43 -83
  516. package/src/plugins/builtin/holders/table-model.ts +1 -15
  517. package/src/plugins/builtin/holders/thirteenf-match.ts +4 -3
  518. package/src/plugins/builtin/holders/types.ts +1 -1
  519. package/src/plugins/builtin/insider/index.tsx +0 -1
  520. package/src/plugins/builtin/ipo-calendar/client.ts +93 -0
  521. package/src/plugins/builtin/ipo-calendar/headless.ts +159 -0
  522. package/src/plugins/builtin/ipo-calendar/index.tsx +47 -0
  523. package/src/plugins/builtin/ipo-calendar/model.ts +341 -0
  524. package/src/plugins/builtin/ipo-calendar/pane.tsx +233 -0
  525. package/src/plugins/builtin/iv-history/index.tsx +0 -1
  526. package/src/plugins/builtin/iv-history/pane.tsx +7 -4
  527. package/src/plugins/builtin/iv-history/rank.ts +0 -7
  528. package/src/plugins/builtin/iv-history/screen-pane.tsx +7 -12
  529. package/src/plugins/builtin/jobs/headless.ts +58 -76
  530. package/src/plugins/builtin/jobs/index.tsx +0 -1
  531. package/src/plugins/builtin/jobs/model.ts +7 -15
  532. package/src/plugins/builtin/jobs/pane.tsx +190 -154
  533. package/src/plugins/builtin/jobs/share-bars.tsx +2 -2
  534. package/src/plugins/builtin/kelly-sizer/fields.ts +1 -1
  535. package/src/plugins/builtin/kelly-sizer/model.ts +1 -26
  536. package/src/plugins/builtin/kelly-sizer/pane.tsx +22 -67
  537. package/src/plugins/builtin/kelly-sizer/sections.tsx +1 -1
  538. package/src/plugins/builtin/kelly-sizer/state.ts +2 -2
  539. package/src/plugins/builtin/kelly-sizer/test-support.tsx +18 -27
  540. package/src/plugins/builtin/layout-manager/index.tsx +13 -50
  541. package/src/plugins/builtin/macro-resources.ts +15 -0
  542. package/src/plugins/builtin/market-halts/client.ts +114 -0
  543. package/src/plugins/builtin/market-halts/index.tsx +41 -0
  544. package/src/plugins/builtin/market-halts/model.ts +323 -0
  545. package/src/plugins/builtin/market-halts/pane.tsx +239 -0
  546. package/src/plugins/builtin/market-heatmap/data.ts +305 -0
  547. package/src/plugins/builtin/market-heatmap/index.tsx +447 -0
  548. package/src/plugins/builtin/market-movers/client.ts +30 -3
  549. package/src/plugins/builtin/market-movers/footer.ts +19 -0
  550. package/src/plugins/builtin/market-movers/headless.ts +71 -5
  551. package/src/plugins/builtin/market-movers/index.tsx +135 -101
  552. package/src/plugins/builtin/market-movers/model.ts +11 -17
  553. package/src/plugins/builtin/market-movers/screener.ts +2 -8
  554. package/src/plugins/builtin/market-movers/session-body.tsx +237 -0
  555. package/src/plugins/builtin/market-movers/session-table.ts +96 -0
  556. package/src/plugins/builtin/market-movers/session.ts +233 -0
  557. package/src/plugins/builtin/market-movers/table.ts +15 -15
  558. package/src/plugins/builtin/market-valuation/cache.ts +2 -39
  559. package/src/plugins/builtin/market-valuation/chart-projection.ts +11 -34
  560. package/src/plugins/builtin/market-valuation/client.ts +4 -5
  561. package/src/plugins/builtin/market-valuation/defs.ts +0 -9
  562. package/src/plugins/builtin/market-valuation/detail.tsx +32 -89
  563. package/src/plugins/builtin/market-valuation/headless.ts +31 -51
  564. package/src/plugins/builtin/market-valuation/index.tsx +11 -1
  565. package/src/plugins/builtin/market-valuation/pane.tsx +37 -179
  566. package/src/plugins/builtin/market-valuation/view.ts +6 -7
  567. package/src/plugins/builtin/market-valuation/zone-scale/index.tsx +2 -2
  568. package/src/plugins/builtin/mna/client.ts +143 -0
  569. package/src/plugins/builtin/mna/detail.tsx +297 -0
  570. package/src/plugins/builtin/mna/headless.ts +82 -0
  571. package/src/plugins/builtin/mna/index.tsx +55 -0
  572. package/src/plugins/builtin/mna/model.ts +208 -0
  573. package/src/plugins/builtin/mna/pane.tsx +432 -0
  574. package/src/plugins/builtin/money-markets/client.ts +5 -17
  575. package/src/plugins/builtin/money-markets/model.ts +20 -0
  576. package/src/plugins/builtin/money-markets/pane.tsx +79 -46
  577. package/src/plugins/builtin/news/index.tsx +13 -14
  578. package/src/plugins/builtin/news/wire/categories.ts +35 -12
  579. package/src/plugins/builtin/news/wire/feed-config.ts +4 -13
  580. package/src/plugins/builtin/news/wire/index.tsx +43 -27
  581. package/src/plugins/builtin/news/wire/industry-pane.tsx +110 -105
  582. package/src/plugins/builtin/news/wire/news/detail-view.tsx +8 -25
  583. package/src/plugins/builtin/news/wire/news/footer.ts +2 -2
  584. package/src/plugins/builtin/news/wire/news/preset-pane.tsx +111 -61
  585. package/src/plugins/builtin/news/wire/news/query-presets.ts +66 -1
  586. package/src/plugins/builtin/news/wire/news/table.tsx +19 -62
  587. package/src/plugins/builtin/news/wire/read-state.ts +3 -17
  588. package/src/plugins/builtin/news/wire/rss/cli.ts +47 -0
  589. package/src/plugins/builtin/news/wire/rss/parser.ts +0 -4
  590. package/src/plugins/builtin/news/wire/rss/source.ts +2 -2
  591. package/src/plugins/builtin/notes/cli.ts +95 -0
  592. package/src/plugins/builtin/notes/files.ts +145 -88
  593. package/src/plugins/builtin/notes/index.tsx +4 -2
  594. package/src/plugins/builtin/notes/migration.ts +3 -1
  595. package/src/plugins/builtin/notes/quick-notes-pane.tsx +24 -40
  596. package/src/plugins/builtin/notes/ticker-notes-tab.tsx +4 -1
  597. package/src/plugins/builtin/options/analytics.ts +5 -7
  598. package/src/plugins/builtin/options/calc-seed.ts +2 -1
  599. package/src/plugins/builtin/options/enrichment-client.ts +10 -19
  600. package/src/plugins/builtin/options/enrichment-model.ts +1 -2
  601. package/src/plugins/builtin/options/footer.ts +2 -2
  602. package/src/plugins/builtin/options/index.tsx +1 -1
  603. package/src/plugins/builtin/options/live-quotes.ts +1 -4
  604. package/src/plugins/builtin/options/table.ts +15 -15
  605. package/src/plugins/builtin/options/types.ts +1 -1
  606. package/src/plugins/builtin/options/view.tsx +31 -9
  607. package/src/plugins/builtin/options-calculator/binomial.ts +17 -16
  608. package/src/plugins/builtin/options-calculator/evidence.ts +90 -24
  609. package/src/plugins/builtin/options-calculator/headless.ts +2 -1
  610. package/src/plugins/builtin/options-calculator/model.ts +2 -207
  611. package/src/plugins/builtin/options-calculator/pane.tsx +11 -39
  612. package/src/plugins/builtin/options-calculator/surface.ts +11 -21
  613. package/src/plugins/builtin/options-scenario/client.ts +9 -20
  614. package/src/plugins/builtin/options-scenario/evidence.ts +64 -8
  615. package/src/plugins/builtin/options-scenario/live.ts +2 -2
  616. package/src/plugins/builtin/options-scenario/model.ts +18 -28
  617. package/src/plugins/builtin/options-scenario/pane.tsx +18 -19
  618. package/src/plugins/builtin/plugin-marketplace/activation.ts +70 -0
  619. package/src/plugins/builtin/plugin-marketplace/feed.ts +12 -0
  620. package/src/plugins/builtin/plugin-marketplace/index.tsx +16 -4
  621. package/src/plugins/builtin/plugin-marketplace/model.ts +67 -9
  622. package/src/plugins/builtin/plugin-marketplace/pane.tsx +67 -101
  623. package/src/plugins/builtin/plugin-marketplace/store.ts +19 -1
  624. package/src/plugins/builtin/plugin-module.ts +4 -11
  625. package/src/plugins/builtin/portfolio-list/account-metrics.ts +17 -15
  626. package/src/plugins/builtin/portfolio-list/cli/render.ts +3 -4
  627. package/src/plugins/builtin/portfolio-list/cli/watchlist-command.ts +2 -1
  628. package/src/plugins/builtin/portfolio-list/column-values.ts +23 -34
  629. package/src/plugins/builtin/portfolio-list/index.tsx +1 -1
  630. package/src/plugins/builtin/portfolio-list/pane/index.tsx +19 -38
  631. package/src/plugins/builtin/portfolio-list/position-metrics.ts +0 -8
  632. package/src/plugins/builtin/portfolio-list/summary/index.tsx +20 -16
  633. package/src/plugins/builtin/rate-path/client.ts +7 -16
  634. package/src/plugins/builtin/rate-path/headless.ts +13 -9
  635. package/src/plugins/builtin/rate-path/model.ts +74 -17
  636. package/src/plugins/builtin/rate-path/pane.tsx +128 -63
  637. package/src/plugins/builtin/realized-vol/client.ts +13 -23
  638. package/src/plugins/builtin/realized-vol/evidence.ts +43 -20
  639. package/src/plugins/builtin/realized-vol/pane.tsx +13 -19
  640. package/src/plugins/builtin/relative-rotation/client.ts +9 -35
  641. package/src/plugins/builtin/relative-rotation/pane.tsx +46 -65
  642. package/src/plugins/builtin/research/analyst-model.ts +35 -32
  643. package/src/plugins/builtin/research/analyst-pane.tsx +124 -128
  644. package/src/plugins/builtin/research/corporate-actions-pane.tsx +23 -70
  645. package/src/plugins/builtin/research/equity-diagnostic-pane.tsx +7 -11
  646. package/src/plugins/builtin/research/event-sources.ts +64 -0
  647. package/src/plugins/builtin/research/events-headless.ts +7 -32
  648. package/src/plugins/builtin/research/headless.ts +11 -51
  649. package/src/plugins/builtin/research/index.tsx +0 -3
  650. package/src/plugins/builtin/research/relative-valuation-model.ts +0 -1
  651. package/src/plugins/builtin/research/relative-valuation-pane.tsx +50 -86
  652. package/src/plugins/builtin/research-search/data.ts +0 -4
  653. package/src/plugins/builtin/research-search/document-view.tsx +3 -9
  654. package/src/plugins/builtin/research-search/index.tsx +1 -0
  655. package/src/plugins/builtin/research-search/model.ts +4 -20
  656. package/src/plugins/builtin/research-search/pane.tsx +44 -131
  657. package/src/plugins/builtin/research-search/saved-view.tsx +10 -13
  658. package/src/plugins/builtin/revenue-breakdown/bars.tsx +113 -0
  659. package/src/plugins/builtin/revenue-breakdown/client.ts +114 -0
  660. package/src/plugins/builtin/revenue-breakdown/headless.ts +72 -0
  661. package/src/plugins/builtin/revenue-breakdown/index.tsx +58 -0
  662. package/src/plugins/builtin/revenue-breakdown/model.ts +157 -0
  663. package/src/plugins/builtin/revenue-breakdown/pane.tsx +290 -0
  664. package/src/plugins/builtin/risk-factors/data.ts +3 -8
  665. package/src/plugins/builtin/risk-factors/index.tsx +0 -1
  666. package/src/plugins/builtin/risk-factors/pane.tsx +29 -107
  667. package/src/plugins/builtin/scanner/denied.tsx +4 -16
  668. package/src/plugins/builtin/scanner/feed.ts +2 -2
  669. package/src/plugins/builtin/scanner/flow-pane.tsx +11 -18
  670. package/src/plugins/builtin/scanner/hilo-bars.tsx +31 -16
  671. package/src/plugins/builtin/scanner/hilo-model.ts +33 -0
  672. package/src/plugins/builtin/scanner/hilo-pane.tsx +8 -11
  673. package/src/plugins/builtin/scanner/index.ts +2 -3
  674. package/src/plugins/builtin/sec/filing-display.tsx +2 -6
  675. package/src/plugins/builtin/sec/index.tsx +2 -1
  676. package/src/plugins/builtin/sec/model.ts +8 -4
  677. package/src/plugins/builtin/sectors/index.tsx +19 -40
  678. package/src/plugins/builtin/sectors/move-bar.tsx +2 -2
  679. package/src/plugins/builtin/sectors/sector-model.ts +0 -5
  680. package/src/plugins/builtin/shared/cloud-resource.ts +56 -0
  681. package/src/plugins/builtin/shared/cloud-upgrade.ts +46 -11
  682. package/src/plugins/builtin/shared/filing-year-reader.tsx +123 -0
  683. package/src/plugins/builtin/shared/locked-rows.tsx +56 -0
  684. package/src/plugins/builtin/shared/pane-request.ts +35 -0
  685. package/src/plugins/builtin/shared/research-cloud-session.ts +1 -1
  686. package/src/plugins/builtin/shared/series-detail-chart.tsx +168 -0
  687. package/src/plugins/builtin/shared/series-list-detail.tsx +208 -0
  688. package/src/plugins/builtin/shared/stat-transform.ts +94 -0
  689. package/src/plugins/builtin/shared/ticker-request.ts +0 -6
  690. package/src/plugins/builtin/shared/trend.ts +81 -0
  691. package/src/plugins/builtin/shared/use-quote-board.ts +130 -4
  692. package/src/plugins/builtin/shared/volatility/index.ts +2 -1
  693. package/src/plugins/builtin/shared/volatility/options.ts +3 -3
  694. package/src/plugins/builtin/shared/volatility/pricing.ts +211 -0
  695. package/src/plugins/builtin/short-interest/client.ts +3 -12
  696. package/src/plugins/builtin/short-interest/index.tsx +0 -1
  697. package/src/plugins/builtin/short-interest/model.ts +51 -18
  698. package/src/plugins/builtin/short-interest/pane.tsx +64 -108
  699. package/src/plugins/builtin/short-interest/surface.tsx +9 -9
  700. package/src/plugins/builtin/short-interest/types.ts +0 -2
  701. package/src/plugins/builtin/short-volume/client.ts +8 -17
  702. package/src/plugins/builtin/short-volume/pane.tsx +28 -29
  703. package/src/plugins/builtin/social-mentions/client.ts +85 -0
  704. package/src/plugins/builtin/social-mentions/headless.ts +28 -0
  705. package/src/plugins/builtin/social-mentions/index.tsx +21 -0
  706. package/src/plugins/builtin/social-mentions/model.ts +92 -0
  707. package/src/plugins/builtin/social-mentions/pane.tsx +156 -0
  708. package/src/plugins/builtin/thirteenf/api.ts +13 -23
  709. package/src/plugins/builtin/thirteenf/data.ts +6 -8
  710. package/src/plugins/builtin/thirteenf/format.ts +3 -10
  711. package/src/plugins/builtin/thirteenf/headless.ts +9 -8
  712. package/src/plugins/builtin/thirteenf/index.tsx +0 -1
  713. package/src/plugins/builtin/thirteenf/model.ts +0 -31
  714. package/src/plugins/builtin/thirteenf/overlap-pane.tsx +12 -16
  715. package/src/plugins/builtin/thirteenf/pane.tsx +65 -255
  716. package/src/plugins/builtin/thirteenf/signals-pane.tsx +23 -44
  717. package/src/plugins/builtin/thirteenf/table.ts +58 -73
  718. package/src/plugins/builtin/thirteenf/types.ts +1 -1
  719. package/src/plugins/builtin/ticker-detail/data-panes/historical-prices.tsx +25 -17
  720. package/src/plugins/builtin/ticker-detail/financials/aggregation.ts +3 -7
  721. package/src/plugins/builtin/ticker-detail/financials/model.ts +121 -25
  722. package/src/plugins/builtin/ticker-detail/financials/period-end-history.ts +41 -0
  723. package/src/plugins/builtin/ticker-detail/financials/ratio-table.tsx +175 -0
  724. package/src/plugins/builtin/ticker-detail/financials/ratios.ts +669 -0
  725. package/src/plugins/builtin/ticker-detail/financials/tab.tsx +198 -111
  726. package/src/plugins/builtin/ticker-detail/headless-schema.ts +7 -2
  727. package/src/plugins/builtin/ticker-detail/headless.ts +86 -9
  728. package/src/plugins/builtin/ticker-detail/index.tsx +1 -1
  729. package/src/plugins/builtin/ticker-detail/overview/components.tsx +96 -17
  730. package/src/plugins/builtin/ticker-detail/overview/model.ts +108 -2
  731. package/src/plugins/builtin/ticker-detail/overview/pane.tsx +12 -0
  732. package/src/plugins/builtin/ticker-detail/overview/types.ts +21 -0
  733. package/src/plugins/builtin/ticker-detail/overview-tab.tsx +29 -39
  734. package/src/plugins/builtin/ticker-detail/pane.tsx +60 -21
  735. package/src/plugins/builtin/ticker-detail/quote-monitor/card.tsx +3 -1
  736. package/src/plugins/builtin/ticker-detail/quote-monitor/index.tsx +1 -1
  737. package/src/plugins/builtin/ticker-detail/research-tab-navigation.tsx +14 -0
  738. package/src/plugins/builtin/time-sales/client.ts +5 -5
  739. package/src/plugins/builtin/time-sales/model.ts +52 -0
  740. package/src/plugins/builtin/time-sales/pane.tsx +24 -19
  741. package/src/plugins/builtin/treasury-auctions/index.tsx +0 -1
  742. package/src/plugins/builtin/treasury-auctions/model.ts +3 -10
  743. package/src/plugins/builtin/treasury-auctions/pane.tsx +42 -101
  744. package/src/plugins/builtin/treasury-auctions/types.ts +0 -2
  745. package/src/plugins/builtin/vol-surface/client.ts +8 -22
  746. package/src/plugins/builtin/vol-surface/evidence.ts +45 -17
  747. package/src/plugins/builtin/vol-surface/model.ts +5 -8
  748. package/src/plugins/builtin/vol-surface/pane.tsx +24 -23
  749. package/src/plugins/builtin/vol-surface/raster.ts +1 -9
  750. package/src/plugins/builtin/vol-surface/stored.ts +3 -4
  751. package/src/plugins/builtin/vol-surface/surface.tsx +4 -3
  752. package/src/plugins/builtin/volatility/chart-model.ts +36 -0
  753. package/src/plugins/builtin/volatility/charts.tsx +3 -20
  754. package/src/plugins/builtin/volatility/client.ts +8 -16
  755. package/src/plugins/builtin/volatility/evidence.ts +37 -21
  756. package/src/plugins/builtin/volatility/index.tsx +0 -2
  757. package/src/plugins/builtin/volatility/model.ts +55 -0
  758. package/src/plugins/builtin/volatility/pane.tsx +71 -37
  759. package/src/plugins/builtin/world-indices/client.ts +1 -4
  760. package/src/plugins/builtin/world-indices/footer.ts +3 -26
  761. package/src/plugins/builtin/world-indices/index.tsx +8 -9
  762. package/src/plugins/builtin/world-indices/model.ts +0 -14
  763. package/src/plugins/builtin/world-indices/table.tsx +15 -73
  764. package/src/plugins/builtin/world-venue-map/map.tsx +2 -2
  765. package/src/plugins/builtin/world-venue-map/model.ts +1 -4
  766. package/src/plugins/builtin/world-venue-map/pane.tsx +21 -87
  767. package/src/plugins/builtin/yahoo/index.ts +4 -38
  768. package/src/plugins/builtin/yield-curve/chart.ts +100 -1
  769. package/src/plugins/builtin/yield-curve/headless.ts +2 -0
  770. package/src/plugins/builtin/yield-curve/history.ts +86 -12
  771. package/src/plugins/builtin/yield-curve/index.tsx +102 -27
  772. package/src/plugins/builtin/yield-curve/treasury-data.ts +12 -12
  773. package/src/plugins/bundle.ts +41 -41
  774. package/src/plugins/catalog-backend.ts +4 -1
  775. package/src/plugins/catalog-browser.ts +34 -53
  776. package/src/plugins/catalog-manifest.ts +10 -0
  777. package/src/plugins/catalog-ui.ts +9 -5
  778. package/src/plugins/compat.ts +216 -0
  779. package/src/plugins/current-target.ts +3 -9
  780. package/src/plugins/dependencies.ts +56 -0
  781. package/src/plugins/event-bus.ts +8 -3
  782. package/src/plugins/external-runtime.ts +0 -21
  783. package/src/plugins/host-link.ts +101 -49
  784. package/src/plugins/host-modules.ts +117 -3
  785. package/src/plugins/host-resolver.ts +1 -6
  786. package/src/plugins/installer.ts +570 -0
  787. package/src/plugins/loader.ts +131 -16
  788. package/src/plugins/manager-node.ts +28 -28
  789. package/src/plugins/ownership.ts +11 -12
  790. package/src/plugins/pane-manager/gridlock.ts +25 -8
  791. package/src/plugins/pane-manager.ts +1 -0
  792. package/src/plugins/plugin-export.ts +24 -0
  793. package/src/plugins/registry/contributions.ts +10 -4
  794. package/src/plugins/registry/index.ts +13 -12
  795. package/src/plugins/registry/pane-settings.ts +6 -3
  796. package/src/plugins/registry/shared.ts +0 -4
  797. package/src/plugins/registry/slots.ts +10 -13
  798. package/src/plugins/runtime/context.tsx +12 -34
  799. package/src/plugins/runtime/index.tsx +9 -9
  800. package/src/plugins/seed.ts +3 -7
  801. package/src/plugins/web-bundled.ts +3 -12
  802. package/src/public/__snapshots__/public-api.test.ts.snap +519 -0
  803. package/src/public/broker.ts +14 -9
  804. package/src/public/index.ts +3 -0
  805. package/src/public/market-data.ts +19 -2
  806. package/src/public/quotes.ts +4 -4
  807. package/src/public/react.ts +11 -6
  808. package/src/public/test-support.ts +10 -2
  809. package/src/public/time-series.ts +30 -3
  810. package/src/public/utils.ts +3 -4
  811. package/src/react/assign-ref.ts +10 -0
  812. package/src/react/async-resource.ts +16 -5
  813. package/src/react/auto-refresh.ts +97 -0
  814. package/src/react/plugins/plugin-slot.tsx +4 -1
  815. package/src/react/read-state.ts +104 -0
  816. package/src/react/ticker-source.ts +32 -0
  817. package/src/remote/controller-utils.ts +0 -4
  818. package/src/remote/controller.ts +18 -14
  819. package/src/remote/layout-helpers.ts +4 -9
  820. package/src/remote/resources.ts +34 -0
  821. package/src/remote/revision.ts +2 -15
  822. package/src/remote/schema.ts +1 -0
  823. package/src/renderers/browser/app-services.ts +1 -1
  824. package/src/renderers/browser/bundled-plugins.ts +8 -7
  825. package/src/renderers/browser/cloud-transport.ts +3 -11
  826. package/src/renderers/browser/config-host.ts +13 -8
  827. package/src/renderers/browser/http-proxy-transport.ts +17 -45
  828. package/src/renderers/browser/main.tsx +52 -25
  829. package/src/renderers/cloudflare/http-proxy.ts +14 -54
  830. package/src/renderers/cloudflare/worker.ts +25 -6
  831. package/src/renderers/electrobun/bun/application-menu/click.ts +8 -20
  832. package/src/renderers/electrobun/bun/application-menu/index.ts +3 -4
  833. package/src/renderers/electrobun/bun/context-menu/click.ts +7 -26
  834. package/src/renderers/electrobun/bun/context-menu/normalize.ts +4 -9
  835. package/src/renderers/electrobun/bun/core-capabilities.ts +16 -64
  836. package/src/renderers/electrobun/bun/desktop/detached-windows.ts +6 -35
  837. package/src/renderers/electrobun/bun/desktop/host-requests.ts +0 -9
  838. package/src/renderers/electrobun/bun/desktop/http-fetch.ts +15 -63
  839. package/src/renderers/electrobun/bun/desktop/http-stream.ts +6 -19
  840. package/src/renderers/electrobun/bun/desktop/initialization.ts +9 -0
  841. package/src/renderers/electrobun/bun/desktop/macos-dock-icon.ts +91 -0
  842. package/src/renderers/electrobun/bun/desktop/plugin-state.ts +0 -7
  843. package/src/renderers/electrobun/bun/external-plugins.ts +35 -95
  844. package/src/renderers/electrobun/bun/index.ts +57 -45
  845. package/src/renderers/electrobun/bun/menu-event.ts +17 -0
  846. package/src/renderers/electrobun/bun/window/controls.ts +69 -0
  847. package/src/renderers/electrobun/bun/window/create.ts +84 -0
  848. package/src/renderers/electrobun/bun/window/events.ts +49 -0
  849. package/src/renderers/electrobun/bun/window/windows-custom-chrome.ts +43 -0
  850. package/src/renderers/electrobun/bun/window/windows-icons.ts +55 -0
  851. package/src/renderers/electrobun/bun/window/windows-native.ts +96 -0
  852. package/src/renderers/electrobun/shared/protocol.ts +35 -48
  853. package/src/renderers/electrobun/shared/quote-event-batch.ts +3 -3
  854. package/src/renderers/electrobun/view/app-services.ts +1 -1
  855. package/src/renderers/electrobun/view/backend-rpc.ts +74 -141
  856. package/src/renderers/electrobun/view/broker-remote-client.ts +32 -46
  857. package/src/renderers/electrobun/view/build-assets.ts +61 -49
  858. package/src/renderers/electrobun/view/capability-stream-client.ts +5 -25
  859. package/src/renderers/electrobun/view/capability-subscription.ts +50 -0
  860. package/src/renderers/electrobun/view/cli-pane-shot-entry.tsx +35 -93
  861. package/src/renderers/electrobun/view/context-menu.ts +6 -7
  862. package/src/renderers/electrobun/view/data-table/dom.ts +1 -2
  863. package/src/renderers/electrobun/view/data-table/index.tsx +17 -35
  864. package/src/renderers/electrobun/view/data-table/row.tsx +6 -2
  865. package/src/renderers/electrobun/view/desktop/controls.tsx +1 -1
  866. package/src/renderers/electrobun/view/desktop/popover.tsx +23 -0
  867. package/src/renderers/electrobun/view/desktop/window/bridge.ts +4 -4
  868. package/src/renderers/electrobun/view/dialog-host.tsx +21 -58
  869. package/src/renderers/electrobun/view/dom-host-providers.tsx +64 -0
  870. package/src/renderers/electrobun/view/dom-ui-host.tsx +5 -21
  871. package/src/renderers/electrobun/view/external-plugins.ts +17 -5
  872. package/src/renderers/electrobun/view/fatal-screen.tsx +1 -42
  873. package/src/renderers/electrobun/view/host/ascii-text.ts +6 -29
  874. package/src/renderers/electrobun/view/host/block-glyph-canvas.tsx +1 -1
  875. package/src/renderers/electrobun/view/host/focus-scope.ts +1 -1
  876. package/src/renderers/electrobun/view/host/input.tsx +95 -163
  877. package/src/renderers/electrobun/view/host/mouse.ts +1 -1
  878. package/src/renderers/electrobun/view/host/native.ts +2 -2
  879. package/src/renderers/electrobun/view/host/scroll-box.tsx +1 -1
  880. package/src/renderers/electrobun/view/host/style.ts +1 -1
  881. package/src/renderers/electrobun/view/host/surface-3d.tsx +2 -2
  882. package/src/renderers/electrobun/view/host/tabs.tsx +1 -1
  883. package/src/renderers/electrobun/view/host/text.tsx +1 -1
  884. package/src/renderers/electrobun/view/http-fetch.ts +13 -64
  885. package/src/renderers/electrobun/view/input-host.tsx +20 -35
  886. package/src/renderers/electrobun/view/key-event.ts +7 -5
  887. package/src/renderers/electrobun/view/main.tsx +76 -34
  888. package/src/renderers/electrobun/view/native-renderer.ts +6 -1
  889. package/src/renderers/electrobun/view/native-stubs/backend-rpc.ts +3 -58
  890. package/src/renderers/electrobun/view/remote/asset-data-client.ts +3 -6
  891. package/src/renderers/electrobun/view/remote/backend-quote-subscription.ts +34 -38
  892. package/src/renderers/electrobun/view/remote/connection-health.ts +14 -32
  893. package/src/renderers/electrobun/view/remote/persistence.ts +32 -63
  894. package/src/renderers/electrobun/view/remote/quote-subscription-registry.ts +2 -5
  895. package/src/renderers/electrobun/view/rpc-codec.ts +18 -20
  896. package/src/renderers/electrobun/view/screenshot-watermark.ts +1 -1
  897. package/src/renderers/electrobun/view/test-utils.tsx +4 -11
  898. package/src/renderers/electrobun/view/toast-host.tsx +29 -87
  899. package/src/renderers/electrobun/view/ui-host.tsx +8 -1
  900. package/src/renderers/electrobun/view/update-host.ts +2 -2
  901. package/src/renderers/opentui/chart-surface.tsx +11 -124
  902. package/src/renderers/opentui/dialog-host.tsx +45 -130
  903. package/src/renderers/opentui/host.tsx +3 -2
  904. package/src/renderers/opentui/image/surface.tsx +15 -174
  905. package/src/renderers/opentui/kitty-services.ts +15 -0
  906. package/src/renderers/opentui/native-surface.ts +176 -0
  907. package/src/renderers/opentui/start.tsx +57 -42
  908. package/src/renderers/opentui/test-utils.tsx +4 -20
  909. package/src/renderers/opentui/toast-host.tsx +7 -95
  910. package/src/renderers/opentui/ui-host.tsx +87 -2
  911. package/src/renderers/share/chart.ts +1 -1
  912. package/src/renderers/share/layout-view.tsx +2 -2
  913. package/src/shares/api.ts +0 -5
  914. package/src/shares/payload.ts +13 -16
  915. package/src/sources/gloomberb-cloud/index.ts +14 -15
  916. package/src/sources/gloomberb-cloud/news.ts +8 -4
  917. package/src/sources/gloomberb-cloud/normalizers.ts +49 -76
  918. package/src/sources/history-coverage.ts +25 -84
  919. package/src/sources/history-result.ts +2 -0
  920. package/src/sources/history-retention.ts +9 -11
  921. package/src/sources/provider-router/batches.ts +0 -4
  922. package/src/sources/provider-router/brokers.ts +2 -13
  923. package/src/sources/provider-router/cache.ts +38 -159
  924. package/src/sources/provider-router/cached-routes.ts +26 -1
  925. package/src/sources/provider-router/financial-routes.ts +3 -10
  926. package/src/sources/provider-router/financials.ts +4 -3
  927. package/src/sources/provider-router/history.ts +20 -70
  928. package/src/sources/provider-router/index.ts +8 -2
  929. package/src/sources/provider-router/news.ts +2 -1
  930. package/src/sources/provider-router/primary.ts +0 -8
  931. package/src/sources/provider-router/quote-route.ts +2 -2
  932. package/src/sources/provider-router/realtime-access.ts +10 -29
  933. package/src/sources/provider-router/search.ts +3 -12
  934. package/src/sources/provider-router/test-support.ts +0 -89
  935. package/src/sources/sec-edgar/acceptance-time.ts +11 -0
  936. package/src/sources/sec-edgar/fourth-quarter.ts +179 -0
  937. package/src/sources/sec-edgar.ts +47 -228
  938. package/src/sources/yahoo-finance/financials.ts +35 -13
  939. package/src/sources/yahoo-finance/history.ts +22 -58
  940. package/src/sources/yahoo-finance/http.ts +17 -25
  941. package/src/sources/yahoo-finance/mappers.ts +0 -23
  942. package/src/sources/yahoo-finance/options.ts +36 -44
  943. package/src/sources/yahoo-finance/quote-summary.ts +90 -141
  944. package/src/sources/yahoo-finance/requests.ts +22 -12
  945. package/src/sources/yahoo-finance/snapshots.ts +4 -6
  946. package/src/sources/yahoo-finance/symbols.ts +25 -0
  947. package/src/sources/yahoo-finance/yahoo-chart-interval.ts +1 -1
  948. package/src/sources/yahoo-finance.ts +80 -188
  949. package/src/state/app/bootstrap.ts +5 -5
  950. package/src/state/app/context/index.tsx +10 -13
  951. package/src/state/hooks/live-streaming.ts +60 -0
  952. package/src/state/hooks/quote-streaming.ts +16 -57
  953. package/src/state/hooks/session-snapshot.ts +0 -1
  954. package/src/state/pane-scroll-registry.tsx +9 -0
  955. package/src/sync/controller.ts +3 -1
  956. package/src/sync/core-contributors.ts +69 -37
  957. package/src/sync/profile-analytics.ts +5 -2
  958. package/src/telemetry/crash-reports-dom.ts +74 -0
  959. package/src/telemetry/crash-reports-node.ts +170 -0
  960. package/src/telemetry/crash-reports.ts +353 -0
  961. package/src/telemetry/live-config.ts +19 -0
  962. package/src/telemetry/usage-counts-dom.ts +22 -0
  963. package/src/telemetry/usage-counts.ts +391 -0
  964. package/src/test-support/app-store.ts +21 -0
  965. package/src/test-support/broker.ts +80 -0
  966. package/src/test-support/cli-context.ts +28 -0
  967. package/src/test-support/cloud-api.ts +85 -0
  968. package/src/test-support/console.ts +40 -0
  969. package/src/test-support/data-provider.ts +30 -0
  970. package/src/test-support/headless.ts +32 -0
  971. package/src/test-support/network-guard.ts +35 -0
  972. package/src/test-support/news.ts +21 -0
  973. package/src/test-support/pane.tsx +42 -22
  974. package/src/test-support/quote-store.ts +49 -0
  975. package/src/test-support/renderer-host.ts +10 -0
  976. package/src/test-support/rpc-loopback.ts +22 -0
  977. package/src/test-support/temp-db.ts +19 -0
  978. package/src/test-support/ticker.ts +15 -0
  979. package/src/test-support/time-series.ts +27 -0
  980. package/src/theme/app-icon.ts +127 -0
  981. package/src/theme/color-utils.ts +2 -1
  982. package/src/theme/themes.ts +3 -1
  983. package/src/time-series/alignment.ts +4 -7
  984. package/src/time-series/chart-data.ts +2 -3
  985. package/src/time-series/forward-valuation.ts +6 -9
  986. package/src/time-series/fundamentals.ts +34 -96
  987. package/src/time-series/live-bars.ts +12 -15
  988. package/src/time-series/live-quotes.ts +4 -26
  989. package/src/time-series/market.ts +6 -9
  990. package/src/time-series/parsed-history-cache.ts +0 -4
  991. package/src/time-series/resolution.ts +35 -1
  992. package/src/time-series/resolve.ts +28 -20
  993. package/src/time-series/session-history.ts +4 -23
  994. package/src/time-series/spec.ts +11 -16
  995. package/src/time-series/studies.ts +26 -15
  996. package/src/time-series/transforms.ts +6 -9
  997. package/src/time-series/types.ts +6 -3
  998. package/src/types/broker.ts +10 -0
  999. package/src/types/config.ts +24 -2
  1000. package/src/types/data-provider.ts +13 -1
  1001. package/src/types/desktop-menu.ts +3 -1
  1002. package/src/types/financials.ts +102 -20
  1003. package/src/types/instrument.ts +2 -1
  1004. package/src/types/plugin.ts +30 -0
  1005. package/src/types/price-history.ts +2 -0
  1006. package/src/types/trading.ts +21 -2
  1007. package/src/ui/dialog-stack.ts +80 -0
  1008. package/src/ui/dialog.tsx +33 -2
  1009. package/src/ui/host.tsx +17 -0
  1010. package/src/ui/index.tsx +3 -10
  1011. package/src/ui/toast.tsx +95 -0
  1012. package/src/updater/index.ts +472 -0
  1013. package/src/utils/async-deadline.ts +34 -0
  1014. package/src/utils/calendar-date.ts +20 -0
  1015. package/src/utils/csv.ts +19 -2
  1016. package/src/utils/datetime-format.ts +103 -6
  1017. package/src/utils/double-escape-close.ts +1 -23
  1018. package/src/utils/errors.ts +4 -0
  1019. package/src/utils/exchanges.ts +10 -0
  1020. package/src/utils/financial-statements.ts +6 -25
  1021. package/src/utils/format.ts +6 -17
  1022. package/src/utils/futures-generic.ts +159 -0
  1023. package/src/utils/guards.ts +37 -0
  1024. package/src/utils/hash.ts +17 -2
  1025. package/src/utils/http-proxy-response.ts +122 -4
  1026. package/src/utils/math.ts +12 -0
  1027. package/src/utils/platform.ts +34 -0
  1028. package/src/utils/plugin-proxy-hosts.json +1 -2
  1029. package/src/utils/plugin-proxy-hosts.ts +3 -0
  1030. package/src/utils/price-history-integrity.ts +5 -8
  1031. package/src/utils/price-history.ts +36 -11
  1032. package/src/utils/sec.ts +3 -8
  1033. package/src/utils/semver.ts +15 -0
  1034. package/src/utils/shortcut-labels.ts +4 -29
  1035. package/src/utils/sort-values.ts +28 -0
  1036. package/src/utils/statement-gaps.ts +94 -0
  1037. package/src/utils/zoned-date-time.ts +12 -0
  1038. package/src/api-client/askg.test.ts +0 -256
  1039. package/src/api-client/errors.test.ts +0 -11
  1040. package/src/api-client/index.test.ts +0 -1591
  1041. package/src/api-client/paths.test.ts +0 -32
  1042. package/src/api-client/request.test.ts +0 -153
  1043. package/src/api-client/research-activity.test.ts +0 -316
  1044. package/src/api-client/session-request-lifetime.test.ts +0 -184
  1045. package/src/api-client/socket-health.test.ts +0 -86
  1046. package/src/api-client/socket-lifetime.test.ts +0 -76
  1047. package/src/api-client/socket-protocol.test.ts +0 -90
  1048. package/src/api-client/tape-socket.test.ts +0 -44
  1049. package/src/api-client/teams.test.ts +0 -270
  1050. package/src/app/app-bootstrap-state.test.ts +0 -157
  1051. package/src/app/global-shortcuts.test.tsx +0 -468
  1052. package/src/app/keybindings/chord.test.ts +0 -131
  1053. package/src/app/keybindings/resolve.test.ts +0 -103
  1054. package/src/app/language-observer.test.tsx +0 -82
  1055. package/src/app/pane-runtime/layout-placement.test.ts +0 -27
  1056. package/src/app/pane-runtime/plugin-bindings.test.ts +0 -117
  1057. package/src/app/pane-runtime/ticker-navigation-runtime.test.ts +0 -144
  1058. package/src/app/pane-runtime/ticker-open-runtime.test.tsx +0 -170
  1059. package/src/app/pane-template-dialog-wizard.test.tsx +0 -36
  1060. package/src/app/runtime/broker-import.test.tsx +0 -89
  1061. package/src/app/runtime/desktop-deeplink.test.ts +0 -169
  1062. package/src/app/runtime/layout-warmup.test.ts +0 -73
  1063. package/src/app/runtime/ticker-refresh.test.tsx +0 -115
  1064. package/src/architecture/browser-entry-graph.test.ts +0 -97
  1065. package/src/architecture/import-boundaries.test.ts +0 -136
  1066. package/src/assets/gloomberb-logo.ico +0 -0
  1067. package/src/assets/gloomberb-logo.png +0 -0
  1068. package/src/brokers/bond-price-basis.test.ts +0 -35
  1069. package/src/brokers/legacy-contract.test.ts +0 -51
  1070. package/src/brokers/profile-form.test.ts +0 -71
  1071. package/src/brokers/sync-broker-instance.test.ts +0 -599
  1072. package/src/brokers/test-broker.ts +0 -68
  1073. package/src/capabilities/registry.test.ts +0 -297
  1074. package/src/cli/base-converter.test.ts +0 -16
  1075. package/src/cli/commands/automation.ts +0 -98
  1076. package/src/cli/commands/futures-price-precision.test.tsx +0 -65
  1077. package/src/cli/commands/keybindings.test.ts +0 -48
  1078. package/src/cli/commands/market-fx.test.ts +0 -77
  1079. package/src/cli/commands/market-options.test.ts +0 -44
  1080. package/src/cli/commands/plugins.test.ts +0 -29
  1081. package/src/cli/commands/quote-price-basis.test.ts +0 -88
  1082. package/src/cli/commands/ticker-financial-units.test.ts +0 -78
  1083. package/src/cli/commands/ticker-period.test.ts +0 -62
  1084. package/src/cli/context.test.ts +0 -63
  1085. package/src/cli/entry.test.ts +0 -58
  1086. package/src/cli/history-rows.test.ts +0 -47
  1087. package/src/cli/options.test.ts +0 -45
  1088. package/src/cli/pane-functions/cloud-session.test.ts +0 -77
  1089. package/src/cli/pane-functions/data.test.ts +0 -17
  1090. package/src/cli/pane-functions/discovery.test.ts +0 -36
  1091. package/src/cli/pane-functions/dom.test.ts +0 -69
  1092. package/src/cli/pane-functions/headless.test.ts +0 -314
  1093. package/src/cli/pane-functions/index.test.ts +0 -266
  1094. package/src/cli/pane-functions/intraday-shot.test.ts +0 -399
  1095. package/src/cli/pane-functions/report.test.ts +0 -107
  1096. package/src/cli/pane-functions/screenshot.test.ts +0 -927
  1097. package/src/cli/registry.test.ts +0 -256
  1098. package/src/cli/result.test.ts +0 -133
  1099. package/src/cli/ticker-resolution.test.ts +0 -39
  1100. package/src/cli/visible-key-values.test.ts +0 -23
  1101. package/src/cli.test.ts +0 -437
  1102. package/src/components/chart/composite/axis-overlays.test.tsx +0 -80
  1103. package/src/components/chart/composite/composite-chart.test.tsx +0 -2019
  1104. package/src/components/chart/composite/downsample.test.ts +0 -136
  1105. package/src/components/chart/composite/format.test.ts +0 -258
  1106. package/src/components/chart/composite/fx-precision.test.ts +0 -111
  1107. package/src/components/chart/composite/interactions.test.ts +0 -231
  1108. package/src/components/chart/composite/panel-series.test.ts +0 -66
  1109. package/src/components/chart/composite/price-axis-labels.test.ts +0 -50
  1110. package/src/components/chart/composite/price-series.test.ts +0 -39
  1111. package/src/components/chart/composite/renderers.test.ts +0 -823
  1112. package/src/components/chart/composite/scene-market-cursor.test.ts +0 -148
  1113. package/src/components/chart/composite/scene.test.ts +0 -845
  1114. package/src/components/chart/composite/scroll-surface.test.tsx +0 -153
  1115. package/src/components/chart/composite/time-axis.test.ts +0 -281
  1116. package/src/components/chart/composite/time-scale.test.ts +0 -88
  1117. package/src/components/chart/composite/tools.test.ts +0 -371
  1118. package/src/components/chart/curve/curve-surface.test.tsx +0 -53
  1119. package/src/components/chart/curve/model.test.ts +0 -115
  1120. package/src/components/chart/native/bitmap-support.test.ts +0 -27
  1121. package/src/components/chart/native/kitty/index.test.ts +0 -537
  1122. package/src/components/chart/static/chart-surface.test.tsx +0 -159
  1123. package/src/components/chart/static/multi-line-chart-surface.tsx +0 -105
  1124. package/src/components/chart/static/scatter-chart-surface.test.ts +0 -30
  1125. package/src/components/chart/static/trail-chart-model.test.ts +0 -36
  1126. package/src/components/chart/surface3d/model.test.ts +0 -117
  1127. package/src/components/chart/surface3d/software.test.ts +0 -32
  1128. package/src/components/command-bar/assist/inventory.test.ts +0 -93
  1129. package/src/components/command-bar/assist/model.test.ts +0 -185
  1130. package/src/components/command-bar/helpers.test.ts +0 -162
  1131. package/src/components/command-bar/layout-items/current-layout.test.ts +0 -165
  1132. package/src/components/command-bar/list/badge.test.ts +0 -54
  1133. package/src/components/command-bar/list/model.test.ts +0 -129
  1134. package/src/components/command-bar/list/view.test.tsx +0 -113
  1135. package/src/components/command-bar/pane-settings.test.ts +0 -141
  1136. package/src/components/command-bar/panel/layout.test.ts +0 -171
  1137. package/src/components/command-bar/routes/root/results.test.ts +0 -161
  1138. package/src/components/command-bar/routes/root/search-providers.test.tsx +0 -224
  1139. package/src/components/command-bar/routes/root/selection.test.ts +0 -54
  1140. package/src/components/command-bar/routes/root/shortcuts.test.ts +0 -193
  1141. package/src/components/command-bar/routes/ticker-search/results.test.ts +0 -128
  1142. package/src/components/command-bar/surface/assist.test.tsx +0 -341
  1143. package/src/components/command-bar/surface/index.test.tsx +0 -1208
  1144. package/src/components/command-bar/surface/listing-selection.test.tsx +0 -84
  1145. package/src/components/command-bar/surface/pane.test.tsx +0 -937
  1146. package/src/components/command-bar/surface/portfolio.test.tsx +0 -453
  1147. package/src/components/command-bar/surface/test-harness.tsx +0 -353
  1148. package/src/components/command-bar/view-model.test.ts +0 -228
  1149. package/src/components/command-bar/workflow/broker.test.ts +0 -22
  1150. package/src/components/command-bar/workflow/collection-actions.test.ts +0 -105
  1151. package/src/components/command-bar/workflow/collection-identity.test.ts +0 -180
  1152. package/src/components/command-bar/workflow/ops.test.ts +0 -804
  1153. package/src/components/command-bar/workflow/route-actions.test.ts +0 -34
  1154. package/src/components/command-bar/workflow/ticker-listing-picker.test.ts +0 -41
  1155. package/src/components/company-logo.test.ts +0 -19
  1156. package/src/components/data-table/export.test.ts +0 -21
  1157. package/src/components/data-table/frozen-column.test.tsx +0 -114
  1158. package/src/components/data-table/horizontal-navigation.test.tsx +0 -181
  1159. package/src/components/data-table/stack-view.test.tsx +0 -226
  1160. package/src/components/data-table/view.test.tsx +0 -343
  1161. package/src/components/feed-data-table/stack-view.test.tsx +0 -46
  1162. package/src/components/input-search-bar.test.tsx +0 -137
  1163. package/src/components/layout/header.test.tsx +0 -82
  1164. package/src/components/layout/market-summary.test.ts +0 -81
  1165. package/src/components/layout/pane/content.test.tsx +0 -103
  1166. package/src/components/layout/pane/cycle-order.test.ts +0 -29
  1167. package/src/components/layout/pane/footer/current-actions.test.tsx +0 -108
  1168. package/src/components/layout/pane/footer/index.test.tsx +0 -199
  1169. package/src/components/layout/pane/footer/keyboard.test.ts +0 -57
  1170. package/src/components/layout/pane/footer/notice.desktop.test.tsx +0 -57
  1171. package/src/components/layout/pane/keyboard-scroll.test.tsx +0 -146
  1172. package/src/components/layout/pane/sidebar.test.tsx +0 -187
  1173. package/src/components/layout/pane/sizing.test.ts +0 -46
  1174. package/src/components/layout/shell/index.test.tsx +0 -1377
  1175. package/src/components/layout/shell/layout-state.test.ts +0 -33
  1176. package/src/components/layout/shell/menu.test.ts +0 -89
  1177. package/src/components/layout/shell/pane-occlusion.test.ts +0 -52
  1178. package/src/components/layout/shell/ticker-link-menu.test.ts +0 -82
  1179. package/src/components/layout/status-bar-groups.test.ts +0 -92
  1180. package/src/components/layout/status-bar.test.tsx +0 -306
  1181. package/src/components/layout/window-edit/mode.test.ts +0 -167
  1182. package/src/components/metric-treemap/layout.test.ts +0 -77
  1183. package/src/components/metric-treemap/surface.test.tsx +0 -62
  1184. package/src/components/onboarding/first-run-workspace.test.ts +0 -81
  1185. package/src/components/onboarding/onboarding-wizard.test.tsx +0 -1097
  1186. package/src/components/onboarding/wizard-model.test.ts +0 -67
  1187. package/src/components/pane-settings-dialog.test.tsx +0 -278
  1188. package/src/components/pane-template-wizard.test.tsx +0 -51
  1189. package/src/components/price-sparkline/model.test.ts +0 -27
  1190. package/src/components/quote-flash.test.ts +0 -30
  1191. package/src/components/sign-in-gate.test.tsx +0 -60
  1192. package/src/components/table-view-shared.test.ts +0 -11
  1193. package/src/components/ticker/badge/format.test.ts +0 -66
  1194. package/src/components/ticker/badge/list.test.tsx +0 -84
  1195. package/src/components/ticker/badge/text.test.tsx +0 -223
  1196. package/src/components/ticker/list-table.test.tsx +0 -281
  1197. package/src/components/ui/data-table/opentui/model.test.ts +0 -47
  1198. package/src/components/ui/data-table/visible-range.test.ts +0 -29
  1199. package/src/components/ui/display.desktop.test.tsx +0 -55
  1200. package/src/components/ui/display.test.tsx +0 -36
  1201. package/src/components/ui/external-link.test.tsx +0 -54
  1202. package/src/components/ui/message-composer.test.tsx +0 -81
  1203. package/src/components/ui/page-stack-view.test.tsx +0 -126
  1204. package/src/components/ui/prose.desktop.test.tsx +0 -50
  1205. package/src/components/ui/prose.test.ts +0 -22
  1206. package/src/components/ui/row-value-cache.test.ts +0 -17
  1207. package/src/components/ui/table-layout.test.ts +0 -108
  1208. package/src/components/ui/tabs.test.tsx +0 -114
  1209. package/src/components/ui/ui.test.tsx +0 -984
  1210. package/src/components/use-pane-notice-footer.test.tsx +0 -116
  1211. package/src/core/app-runtime.test.ts +0 -144
  1212. package/src/core/app-services.test.ts +0 -66
  1213. package/src/core/connection-health.test.ts +0 -143
  1214. package/src/data/cached-query.test.ts +0 -95
  1215. package/src/data/config/home.test.ts +0 -70
  1216. package/src/data/config/store/index.test.ts +0 -1241
  1217. package/src/data/memory-resource-store.test.ts +0 -24
  1218. package/src/data/plugin-cache.test.ts +0 -46
  1219. package/src/data/sqlite/cache.test.ts +0 -330
  1220. package/src/data/sqlite/retry.test.ts +0 -84
  1221. package/src/feedback/diagnostics.test.ts +0 -30
  1222. package/src/feedback/redact.test.ts +0 -50
  1223. package/src/feedback/screenshot.test.ts +0 -22
  1224. package/src/i18n/index.test.ts +0 -134
  1225. package/src/i18n/languages.test.ts +0 -34
  1226. package/src/index.tsx +0 -6
  1227. package/src/layout-marketplace/api.test.ts +0 -54
  1228. package/src/layout-marketplace/cloud.test.ts +0 -154
  1229. package/src/layout-marketplace/gallery-desktop.test.tsx +0 -216
  1230. package/src/layout-marketplace/gallery.test.tsx +0 -149
  1231. package/src/layout-marketplace/geometry.test.ts +0 -47
  1232. package/src/layout-marketplace/mini-workspace.test.tsx +0 -69
  1233. package/src/layout-marketplace/model.test.ts +0 -118
  1234. package/src/layout-marketplace/name-dialog.tsx +0 -60
  1235. package/src/layout-marketplace/payload.test.ts +0 -419
  1236. package/src/market-data/coordinator/chart-session.test.ts +0 -152
  1237. package/src/market-data/coordinator/events.test.ts +0 -68
  1238. package/src/market-data/coordinator/fx-refresh.test.ts +0 -199
  1239. package/src/market-data/coordinator/index.test.ts +0 -1174
  1240. package/src/market-data/coordinator/options-sharing.test.ts +0 -79
  1241. package/src/market-data/coordinator/subscriptions.test.ts +0 -652
  1242. package/src/market-data/frame-scheduler.test.ts +0 -82
  1243. package/src/market-data/history-session.test.ts +0 -151
  1244. package/src/market-data/hooks.test.tsx +0 -263
  1245. package/src/market-data/legacy-contract-hooks.test.tsx +0 -49
  1246. package/src/market-data/legacy-contract.test.ts +0 -99
  1247. package/src/market-data/market/format.test.ts +0 -284
  1248. package/src/market-data/market/status.test.ts +0 -26
  1249. package/src/market-data/performance.test.ts +0 -83
  1250. package/src/market-data/portfolio-instrument.test.ts +0 -80
  1251. package/src/market-data/published-us-sessions.test.ts +0 -65
  1252. package/src/market-data/query-store.test.ts +0 -87
  1253. package/src/market-data/quote-subscription-target.test.ts +0 -56
  1254. package/src/market-data/quotes/day-range.test.ts +0 -84
  1255. package/src/market-data/quotes/freshness.test.ts +0 -277
  1256. package/src/market-data/quotes/observation-time.test.ts +0 -98
  1257. package/src/market-data/quotes/price-basis.test.ts +0 -44
  1258. package/src/market-data/quotes/resolution.test.ts +0 -612
  1259. package/src/market-data/quotes/time.test.ts +0 -41
  1260. package/src/market-data/request-types.test.ts +0 -110
  1261. package/src/market-data/snapshot-contract.test.ts +0 -110
  1262. package/src/market-data/snapshot-provider.test.ts +0 -251
  1263. package/src/market-data/ticker-price-returns.test.ts +0 -26
  1264. package/src/news/aggregator.test.ts +0 -596
  1265. package/src/news/hooks.test.tsx +0 -66
  1266. package/src/notifications/app-notifier.test.ts +0 -199
  1267. package/src/pane-settings.test.ts +0 -38
  1268. package/src/plugins/builtin/account-management/model.test.ts +0 -149
  1269. package/src/plugins/builtin/account-management/navigation.test.ts +0 -27
  1270. package/src/plugins/builtin/alerts/alert-engine.test.ts +0 -105
  1271. package/src/plugins/builtin/alerts/events.test.ts +0 -28
  1272. package/src/plugins/builtin/alerts/index.test.tsx +0 -459
  1273. package/src/plugins/builtin/alerts/research.test.ts +0 -75
  1274. package/src/plugins/builtin/analytics/broker-performance.test.ts +0 -79
  1275. package/src/plugins/builtin/analytics/index.test.tsx +0 -657
  1276. package/src/plugins/builtin/analytics/metrics.test.ts +0 -138
  1277. package/src/plugins/builtin/analytics/pane-model.test.ts +0 -191
  1278. package/src/plugins/builtin/analytics/portfolio-identity.test.tsx +0 -272
  1279. package/src/plugins/builtin/analytics/return-window.test.ts +0 -72
  1280. package/src/plugins/builtin/analytics/risk-client.test.ts +0 -100
  1281. package/src/plugins/builtin/analytics/risk-evidence.test.ts +0 -123
  1282. package/src/plugins/builtin/analytics/risk-headless.test.ts +0 -27
  1283. package/src/plugins/builtin/analytics/risk-math.test.ts +0 -95
  1284. package/src/plugins/builtin/analytics/risk-model.test.ts +0 -284
  1285. package/src/plugins/builtin/analytics/sector-model.test.ts +0 -56
  1286. package/src/plugins/builtin/analytics/sharpe-cadence.test.ts +0 -111
  1287. package/src/plugins/builtin/backtest/engine.test.ts +0 -71
  1288. package/src/plugins/builtin/bond-calculator/math.test.ts +0 -97
  1289. package/src/plugins/builtin/bond-calculator/model.test.ts +0 -56
  1290. package/src/plugins/builtin/bond-calculator/pane.test.tsx +0 -84
  1291. package/src/plugins/builtin/broker-manager/index.test.tsx +0 -173
  1292. package/src/plugins/builtin/broker-manager/model.test.ts +0 -145
  1293. package/src/plugins/builtin/buildout/cells.test.tsx +0 -31
  1294. package/src/plugins/builtin/buildout/pane/header.tsx +0 -30
  1295. package/src/plugins/builtin/cds/client.test.ts +0 -103
  1296. package/src/plugins/builtin/cds/headless.test.ts +0 -48
  1297. package/src/plugins/builtin/cds/model.test.ts +0 -242
  1298. package/src/plugins/builtin/cds/pane.test.tsx +0 -139
  1299. package/src/plugins/builtin/central-bank-rates/model.test.ts +0 -84
  1300. package/src/plugins/builtin/changelog/model.test.ts +0 -77
  1301. package/src/plugins/builtin/chart-composer/catalog-inventory.test.ts +0 -105
  1302. package/src/plugins/builtin/chart-composer/editor/model.test.ts +0 -85
  1303. package/src/plugins/builtin/chart-composer/editor.test.tsx +0 -341
  1304. package/src/plugins/builtin/chart-composer/financial-periods.fixture.json +0 -225
  1305. package/src/plugins/builtin/chart-composer/follow-binding.test.tsx +0 -253
  1306. package/src/plugins/builtin/chart-composer/headless.test.ts +0 -158
  1307. package/src/plugins/builtin/chart-composer/loading.test.tsx +0 -134
  1308. package/src/plugins/builtin/chart-composer/pane-share.test.ts +0 -144
  1309. package/src/plugins/builtin/chart-composer/presets.test.ts +0 -672
  1310. package/src/plugins/builtin/chart-composer/quick-add.test.tsx +0 -245
  1311. package/src/plugins/builtin/chart-composer/quote-metadata.test.ts +0 -176
  1312. package/src/plugins/builtin/chart-composer/series-catalog.test.ts +0 -104
  1313. package/src/plugins/builtin/chart-composer/served-cadence-snapshot.test.ts +0 -161
  1314. package/src/plugins/builtin/chart-composer/settings.test.ts +0 -200
  1315. package/src/plugins/builtin/chart-composer/shortcuts.test.ts +0 -44
  1316. package/src/plugins/builtin/chart-composer/use-series-catalog.test.tsx +0 -94
  1317. package/src/plugins/builtin/chart-composer/viewport-labels.test.ts +0 -13
  1318. package/src/plugins/builtin/chat/chat.test.tsx +0 -1481
  1319. package/src/plugins/builtin/chat/composer-commands.test.ts +0 -30
  1320. package/src/plugins/builtin/chat/content/composer-runtime.test.tsx +0 -144
  1321. package/src/plugins/builtin/chat/content/mentions.test.ts +0 -74
  1322. package/src/plugins/builtin/chat/controller/session-lifetime.test.ts +0 -182
  1323. package/src/plugins/builtin/chat/controller/session.test.ts +0 -25
  1324. package/src/plugins/builtin/chat/controller.test.ts +0 -1894
  1325. package/src/plugins/builtin/chat/message/desktop.test.tsx +0 -88
  1326. package/src/plugins/builtin/chat/message/profile-popover.test.tsx +0 -127
  1327. package/src/plugins/builtin/chat/pane-state.test.ts +0 -31
  1328. package/src/plugins/builtin/chat/sidebar.test.tsx +0 -830
  1329. package/src/plugins/builtin/chat/test-harness.test.ts +0 -46
  1330. package/src/plugins/builtin/chat/test-harness.tsx +0 -267
  1331. package/src/plugins/builtin/cloud/askg/controller.test.ts +0 -525
  1332. package/src/plugins/builtin/cloud/askg/conversation-store.test.ts +0 -230
  1333. package/src/plugins/builtin/cloud/askg/executor.test.ts +0 -160
  1334. package/src/plugins/builtin/cloud/askg/manifest.test.ts +0 -153
  1335. package/src/plugins/builtin/cloud/askg/model.test.ts +0 -349
  1336. package/src/plugins/builtin/cloud/askg/pane.test.tsx +0 -356
  1337. package/src/plugins/builtin/cloud/askg/protocol.test.ts +0 -190
  1338. package/src/plugins/builtin/cloud/askg/undo.test.ts +0 -44
  1339. package/src/plugins/builtin/cloud/auth-model.test.ts +0 -67
  1340. package/src/plugins/builtin/cloud/buildout-module.tsx +0 -23
  1341. package/src/plugins/builtin/cloud/device-signin.test.ts +0 -217
  1342. package/src/plugins/builtin/cloud/reveal-in-scroll-box.ts +0 -34
  1343. package/src/plugins/builtin/cloud/team/collections.test.ts +0 -126
  1344. package/src/plugins/builtin/cloud/team/model.test.ts +0 -174
  1345. package/src/plugins/builtin/cloud/team/pane-model.test.ts +0 -114
  1346. package/src/plugins/builtin/cloud/team/pane.test.tsx +0 -234
  1347. package/src/plugins/builtin/cloud/team/store.test.ts +0 -231
  1348. package/src/plugins/builtin/cloud/thesis/board-pane.test.tsx +0 -266
  1349. package/src/plugins/builtin/cloud/thesis/model.test.ts +0 -171
  1350. package/src/plugins/builtin/cloud-tweets/pane-share.test.ts +0 -56
  1351. package/src/plugins/builtin/cloud-tweets/table.test.tsx +0 -125
  1352. package/src/plugins/builtin/congress-trades/aggregates.test.ts +0 -27
  1353. package/src/plugins/builtin/congress-trades/headless.test.ts +0 -113
  1354. package/src/plugins/builtin/congress-trades/model.test.ts +0 -129
  1355. package/src/plugins/builtin/connections/pane.test.tsx +0 -84
  1356. package/src/plugins/builtin/correlation/colors.test.ts +0 -39
  1357. package/src/plugins/builtin/correlation/compute.test.ts +0 -97
  1358. package/src/plugins/builtin/correlation/headless.test.ts +0 -147
  1359. package/src/plugins/builtin/correlation/index.test.tsx +0 -155
  1360. package/src/plugins/builtin/correlation/relationship/history.test.tsx +0 -62
  1361. package/src/plugins/builtin/correlation/relationship/layout.test.ts +0 -17
  1362. package/src/plugins/builtin/cot/model.test.ts +0 -89
  1363. package/src/plugins/builtin/credit-conditions/client.test.ts +0 -122
  1364. package/src/plugins/builtin/credit-conditions/headless.test.ts +0 -35
  1365. package/src/plugins/builtin/credit-conditions/index.test.tsx +0 -136
  1366. package/src/plugins/builtin/credit-conditions/model.test.ts +0 -56
  1367. package/src/plugins/builtin/crypto-board/client.test.ts +0 -51
  1368. package/src/plugins/builtin/crypto-board/model.test.ts +0 -111
  1369. package/src/plugins/builtin/crypto-board/pane.test.tsx +0 -130
  1370. package/src/plugins/builtin/crypto-board/test-fixture.ts +0 -80
  1371. package/src/plugins/builtin/custom-view/live-quotes.test.ts +0 -53
  1372. package/src/plugins/builtin/custom-view/view-spec.test.ts +0 -134
  1373. package/src/plugins/builtin/debt-maturities/debt-maturities.test.ts +0 -317
  1374. package/src/plugins/builtin/dividend-yield/calendar.ts +0 -9
  1375. package/src/plugins/builtin/dividend-yield/client.test.ts +0 -260
  1376. package/src/plugins/builtin/dividend-yield/dividend-source-integrity.test.ts +0 -233
  1377. package/src/plugins/builtin/dividend-yield/headless.test.ts +0 -123
  1378. package/src/plugins/builtin/dividend-yield/pane.test.tsx +0 -351
  1379. package/src/plugins/builtin/dividend-yield/provider-client.test.ts +0 -61
  1380. package/src/plugins/builtin/dividend-yield/reference-price.test.ts +0 -115
  1381. package/src/plugins/builtin/dividend-yield/view.test.ts +0 -81
  1382. package/src/plugins/builtin/earnings/data/cache.test.ts +0 -117
  1383. package/src/plugins/builtin/earnings/detail-model.test.ts +0 -103
  1384. package/src/plugins/builtin/earnings/detail-model.ts +0 -165
  1385. package/src/plugins/builtin/earnings/detail-view.tsx +0 -136
  1386. package/src/plugins/builtin/earnings/estimate-basis.test.ts +0 -184
  1387. package/src/plugins/builtin/earnings/estimate-fixtures.test-data.ts +0 -327
  1388. package/src/plugins/builtin/earnings/headless.test.ts +0 -82
  1389. package/src/plugins/builtin/earnings/model.test.ts +0 -98
  1390. package/src/plugins/builtin/earnings/table.test.ts +0 -76
  1391. package/src/plugins/builtin/earnings/table.ts +0 -246
  1392. package/src/plugins/builtin/earnings-calls/data.test.ts +0 -252
  1393. package/src/plugins/builtin/earnings-calls/headless-freshness.test.ts +0 -41
  1394. package/src/plugins/builtin/earnings-calls/headless.test.ts +0 -258
  1395. package/src/plugins/builtin/earnings-calls/pane.test.tsx +0 -520
  1396. package/src/plugins/builtin/earnings-calls/prose.test.ts +0 -51
  1397. package/src/plugins/builtin/econ/calendar-model.test.ts +0 -82
  1398. package/src/plugins/builtin/econ/fred-cache.test.ts +0 -188
  1399. package/src/plugins/builtin/econ/fred-client.test.ts +0 -79
  1400. package/src/plugins/builtin/econ/index.test.tsx +0 -144
  1401. package/src/plugins/builtin/econ-statistics/client.test.ts +0 -122
  1402. package/src/plugins/builtin/econ-statistics/headless.test.ts +0 -54
  1403. package/src/plugins/builtin/econ-statistics/pane.test.tsx +0 -69
  1404. package/src/plugins/builtin/econ-statistics/transform.test.ts +0 -109
  1405. package/src/plugins/builtin/econ-statistics/transform.ts +0 -94
  1406. package/src/plugins/builtin/econ-statistics/trend.ts +0 -57
  1407. package/src/plugins/builtin/econ-statistics/view.test.ts +0 -43
  1408. package/src/plugins/builtin/equity-screener/headless.test.ts +0 -22
  1409. package/src/plugins/builtin/equity-screener/model.test.ts +0 -116
  1410. package/src/plugins/builtin/equity-screener/results.test.tsx +0 -44
  1411. package/src/plugins/builtin/equity-screener/test-fixture.ts +0 -63
  1412. package/src/plugins/builtin/estimate-revisions/model.test.ts +0 -253
  1413. package/src/plugins/builtin/estimate-revisions/sorting.test.ts +0 -91
  1414. package/src/plugins/builtin/executives/format.test.ts +0 -23
  1415. package/src/plugins/builtin/executives/pane.test.tsx +0 -339
  1416. package/src/plugins/builtin/filing-events/feed.test.ts +0 -143
  1417. package/src/plugins/builtin/filing-events/pane.test.tsx +0 -125
  1418. package/src/plugins/builtin/futures/model.test.ts +0 -151
  1419. package/src/plugins/builtin/futures/pane.test.tsx +0 -219
  1420. package/src/plugins/builtin/futures/table.test.ts +0 -155
  1421. package/src/plugins/builtin/futures-curve/model.test.ts +0 -90
  1422. package/src/plugins/builtin/fx-matrix/export.test.ts +0 -30
  1423. package/src/plugins/builtin/fx-matrix/pairs.test.ts +0 -16
  1424. package/src/plugins/builtin/fx-matrix/pane.test.tsx +0 -109
  1425. package/src/plugins/builtin/fx-matrix/refresh.test.tsx +0 -69
  1426. package/src/plugins/builtin/help/components.tsx +0 -44
  1427. package/src/plugins/builtin/help/keybindings-editor.test.tsx +0 -164
  1428. package/src/plugins/builtin/holders/headless.test.ts +0 -58
  1429. package/src/plugins/builtin/holders/index.test.ts +0 -12
  1430. package/src/plugins/builtin/holders/thirteenf-match.test.ts +0 -30
  1431. package/src/plugins/builtin/insider/amendments.test.ts +0 -112
  1432. package/src/plugins/builtin/insider/headless.test.ts +0 -136
  1433. package/src/plugins/builtin/insider/insider-data.test.ts +0 -66
  1434. package/src/plugins/builtin/insider/pane.test.tsx +0 -112
  1435. package/src/plugins/builtin/iv-history/client.test.ts +0 -18
  1436. package/src/plugins/builtin/iv-history/model.test.ts +0 -87
  1437. package/src/plugins/builtin/jobs/model.test.ts +0 -119
  1438. package/src/plugins/builtin/jobs/pages.test.tsx +0 -103
  1439. package/src/plugins/builtin/kelly-sizer/index.test.tsx +0 -202
  1440. package/src/plugins/builtin/kelly-sizer/model.test.ts +0 -158
  1441. package/src/plugins/builtin/kelly-sizer/view.test.tsx +0 -88
  1442. package/src/plugins/builtin/market-movers/headless.test.ts +0 -34
  1443. package/src/plugins/builtin/market-movers/integrity.test.ts +0 -119
  1444. package/src/plugins/builtin/market-movers/pane-research.test.tsx +0 -138
  1445. package/src/plugins/builtin/market-movers/screener.test.ts +0 -333
  1446. package/src/plugins/builtin/market-valuation/client.test.ts +0 -283
  1447. package/src/plugins/builtin/market-valuation/headless.test.ts +0 -75
  1448. package/src/plugins/builtin/market-valuation/model.test.ts +0 -405
  1449. package/src/plugins/builtin/market-valuation/pane.test.tsx +0 -235
  1450. package/src/plugins/builtin/market-valuation/trend.ts +0 -87
  1451. package/src/plugins/builtin/money-markets/model.test.ts +0 -61
  1452. package/src/plugins/builtin/news/headless.test.ts +0 -149
  1453. package/src/plugins/builtin/news/wire/breaking/filters.test.ts +0 -99
  1454. package/src/plugins/builtin/news/wire/breaking/notifications.test.ts +0 -204
  1455. package/src/plugins/builtin/news/wire/breaking/pane.test.tsx +0 -128
  1456. package/src/plugins/builtin/news/wire/breaking/pane.tsx +0 -89
  1457. package/src/plugins/builtin/news/wire/feed-config.test.ts +0 -109
  1458. package/src/plugins/builtin/news/wire/news/detail-view.test.tsx +0 -279
  1459. package/src/plugins/builtin/news/wire/news/table.test.tsx +0 -223
  1460. package/src/plugins/builtin/news/wire/read-state.test.ts +0 -37
  1461. package/src/plugins/builtin/news/wire/rss/parser.test.ts +0 -178
  1462. package/src/plugins/builtin/news/wire/rss/source.test.ts +0 -153
  1463. package/src/plugins/builtin/notes/files.test.ts +0 -18
  1464. package/src/plugins/builtin/notes/quick-notes-pane.test.tsx +0 -209
  1465. package/src/plugins/builtin/notes/store.test.ts +0 -245
  1466. package/src/plugins/builtin/notes/ticker-notes-tab.test.tsx +0 -350
  1467. package/src/plugins/builtin/options/analytics.test.ts +0 -234
  1468. package/src/plugins/builtin/options/calc-seed.test.ts +0 -130
  1469. package/src/plugins/builtin/options/chain-integrity.test.tsx +0 -284
  1470. package/src/plugins/builtin/options/enrichment-hook.test.tsx +0 -149
  1471. package/src/plugins/builtin/options/enrichment.test.ts +0 -257
  1472. package/src/plugins/builtin/options/expiry-selection.test.tsx +0 -370
  1473. package/src/plugins/builtin/options/footer.test.ts +0 -60
  1474. package/src/plugins/builtin/options/live-quotes.test.ts +0 -421
  1475. package/src/plugins/builtin/options/market-reference.test.ts +0 -36
  1476. package/src/plugins/builtin/options/table.test.ts +0 -100
  1477. package/src/plugins/builtin/options/view.test.tsx +0 -657
  1478. package/src/plugins/builtin/options-calculator/binomial.test.ts +0 -264
  1479. package/src/plugins/builtin/options-calculator/boundary-integrity.test.tsx +0 -114
  1480. package/src/plugins/builtin/options-calculator/evidence.test.ts +0 -138
  1481. package/src/plugins/builtin/options-calculator/headless.test.ts +0 -39
  1482. package/src/plugins/builtin/options-calculator/inputs.test.ts +0 -24
  1483. package/src/plugins/builtin/options-calculator/model.test.ts +0 -242
  1484. package/src/plugins/builtin/options-calculator/pane.test.tsx +0 -305
  1485. package/src/plugins/builtin/options-calculator/surface.test.ts +0 -164
  1486. package/src/plugins/builtin/options-scenario/client.test.ts +0 -143
  1487. package/src/plugins/builtin/options-scenario/evidence.test.ts +0 -34
  1488. package/src/plugins/builtin/options-scenario/live.test.ts +0 -34
  1489. package/src/plugins/builtin/options-scenario/model.test.ts +0 -222
  1490. package/src/plugins/builtin/options-scenario/pane.test.tsx +0 -195
  1491. package/src/plugins/builtin/options-scenario/state.test.ts +0 -62
  1492. package/src/plugins/builtin/plugin-marketplace/model.test.ts +0 -493
  1493. package/src/plugins/builtin/plugin-module.test.ts +0 -101
  1494. package/src/plugins/builtin/portfolio-list/account-metrics.test.ts +0 -243
  1495. package/src/plugins/builtin/portfolio-list/bond-price-basis.test.ts +0 -120
  1496. package/src/plugins/builtin/portfolio-list/cell-version.test.ts +0 -89
  1497. package/src/plugins/builtin/portfolio-list/cli/render.test.ts +0 -261
  1498. package/src/plugins/builtin/portfolio-list/index.test.ts +0 -248
  1499. package/src/plugins/builtin/portfolio-list/live-valuation.test.ts +0 -94
  1500. package/src/plugins/builtin/portfolio-list/metrics.test.ts +0 -562
  1501. package/src/plugins/builtin/portfolio-list/mutations.test.ts +0 -200
  1502. package/src/plugins/builtin/portfolio-list/pane/data.test.ts +0 -54
  1503. package/src/plugins/builtin/portfolio-list/pane/index.test.tsx +0 -1835
  1504. package/src/plugins/builtin/portfolio-list/position-cost-integrity.test.ts +0 -101
  1505. package/src/plugins/builtin/portfolio-list/summary/index.test.ts +0 -184
  1506. package/src/plugins/builtin/portfolio-list/summary/live-accounts.test.tsx +0 -90
  1507. package/src/plugins/builtin/portfolio-list/use-cursor-neighbor-prefetch.test.tsx +0 -96
  1508. package/src/plugins/builtin/portfolio-list/use-throttled-cursor-symbol.test.tsx +0 -166
  1509. package/src/plugins/builtin/portfolio-list/use-throttled-ticker-order.test.tsx +0 -76
  1510. package/src/plugins/builtin/rate-path/model.test.ts +0 -50
  1511. package/src/plugins/builtin/realized-vol/chart-model.test.ts +0 -24
  1512. package/src/plugins/builtin/realized-vol/client.test.ts +0 -193
  1513. package/src/plugins/builtin/realized-vol/model.test.ts +0 -155
  1514. package/src/plugins/builtin/relative-rotation/model.test.ts +0 -194
  1515. package/src/plugins/builtin/research/analyst-headless.test.ts +0 -88
  1516. package/src/plugins/builtin/research/analyst-model.test.ts +0 -125
  1517. package/src/plugins/builtin/research/analyst-pane.test.tsx +0 -162
  1518. package/src/plugins/builtin/research/corporate-actions-pane.test.tsx +0 -77
  1519. package/src/plugins/builtin/research/equity-diagnostic-pane.test.tsx +0 -303
  1520. package/src/plugins/builtin/research/event-model.test.ts +0 -165
  1521. package/src/plugins/builtin/research/events-headless.test.ts +0 -43
  1522. package/src/plugins/builtin/research/headless.test.ts +0 -111
  1523. package/src/plugins/builtin/research/index.test.ts +0 -442
  1524. package/src/plugins/builtin/research/relative-valuation-headless.test.ts +0 -192
  1525. package/src/plugins/builtin/research/relative-valuation-model.test.ts +0 -49
  1526. package/src/plugins/builtin/research/relative-valuation-pane.test.tsx +0 -99
  1527. package/src/plugins/builtin/research-search/command-bar-search.test.ts +0 -81
  1528. package/src/plugins/builtin/research-search/document-view.test.tsx +0 -75
  1529. package/src/plugins/builtin/research-search/model.test.ts +0 -40
  1530. package/src/plugins/builtin/research-search/pane.test.tsx +0 -256
  1531. package/src/plugins/builtin/research-search/snippet.test.ts +0 -78
  1532. package/src/plugins/builtin/risk-factors/data.test.ts +0 -63
  1533. package/src/plugins/builtin/risk-factors/headless.test.ts +0 -40
  1534. package/src/plugins/builtin/risk-factors/pane.test.tsx +0 -56
  1535. package/src/plugins/builtin/risk-factors/test-fixtures.ts +0 -4
  1536. package/src/plugins/builtin/scanner/flow-history.test.tsx +0 -138
  1537. package/src/plugins/builtin/scanner/flow-model.test.ts +0 -180
  1538. package/src/plugins/builtin/scanner/flow-pane.test.tsx +0 -159
  1539. package/src/plugins/builtin/scanner/headless.test.ts +0 -121
  1540. package/src/plugins/builtin/scanner/hilo-model.test.ts +0 -44
  1541. package/src/plugins/builtin/sec/filing-content.test.ts +0 -57
  1542. package/src/plugins/builtin/sec/headless.test.ts +0 -99
  1543. package/src/plugins/builtin/sec/pane.test.tsx +0 -152
  1544. package/src/plugins/builtin/sectors/client.test.ts +0 -228
  1545. package/src/plugins/builtin/sectors/headless.test.ts +0 -87
  1546. package/src/plugins/builtin/sectors/pane-cache.test.tsx +0 -78
  1547. package/src/plugins/builtin/sectors/sector-model.test.ts +0 -119
  1548. package/src/plugins/builtin/shared/auto-refresh.test.tsx +0 -95
  1549. package/src/plugins/builtin/shared/auto-refresh.ts +0 -97
  1550. package/src/plugins/builtin/shared/live-streaming.ts +0 -60
  1551. package/src/plugins/builtin/shared/pane-footer.ts +0 -93
  1552. package/src/plugins/builtin/shared/plan-access.test.ts +0 -69
  1553. package/src/plugins/builtin/shared/plan-access.ts +0 -109
  1554. package/src/plugins/builtin/shared/public-pane.test.ts +0 -12
  1555. package/src/plugins/builtin/shared/read-state.ts +0 -104
  1556. package/src/plugins/builtin/shared/research-cloud-session.test.tsx +0 -143
  1557. package/src/plugins/builtin/shared/screener-live-quotes.test.ts +0 -111
  1558. package/src/plugins/builtin/shared/screener-live-quotes.ts +0 -165
  1559. package/src/plugins/builtin/shared/series-cache.test.ts +0 -106
  1560. package/src/plugins/builtin/shared/table-pane.ts +0 -32
  1561. package/src/plugins/builtin/shared/ticker-request.test.ts +0 -18
  1562. package/src/plugins/builtin/shared/ticker-request.test.tsx +0 -137
  1563. package/src/plugins/builtin/shared/ticker-source.ts +0 -32
  1564. package/src/plugins/builtin/shared/ticker-surface.test.ts +0 -84
  1565. package/src/plugins/builtin/shared/use-quote-board.test.tsx +0 -325
  1566. package/src/plugins/builtin/shared/volatility/live-session.test.ts +0 -91
  1567. package/src/plugins/builtin/shared/volatility/options.test.ts +0 -127
  1568. package/src/plugins/builtin/shared/volatility/realized.test.ts +0 -201
  1569. package/src/plugins/builtin/shared/volatility/realized.ts +0 -292
  1570. package/src/plugins/builtin/shared/volatility/smile.test.ts +0 -209
  1571. package/src/plugins/builtin/short-interest/client.test.ts +0 -55
  1572. package/src/plugins/builtin/short-interest/headless.test.ts +0 -96
  1573. package/src/plugins/builtin/short-interest/pane.test.tsx +0 -57
  1574. package/src/plugins/builtin/short-volume/model.test.ts +0 -39
  1575. package/src/plugins/builtin/thirteenf/api.test.ts +0 -149
  1576. package/src/plugins/builtin/thirteenf/data.test.ts +0 -291
  1577. package/src/plugins/builtin/thirteenf/headless.test.ts +0 -182
  1578. package/src/plugins/builtin/thirteenf/model.test.ts +0 -230
  1579. package/src/plugins/builtin/thirteenf/overlap.test.ts +0 -29
  1580. package/src/plugins/builtin/thirteenf/pane.test.tsx +0 -407
  1581. package/src/plugins/builtin/thirteenf/signals.test.ts +0 -16
  1582. package/src/plugins/builtin/ticker-detail/chart-tab-switch.test.tsx +0 -275
  1583. package/src/plugins/builtin/ticker-detail/data-panes/historical-price-precision.test.tsx +0 -120
  1584. package/src/plugins/builtin/ticker-detail/data-panes/historical-prices.test.tsx +0 -41
  1585. package/src/plugins/builtin/ticker-detail/financials/aggregation.test.ts +0 -79
  1586. package/src/plugins/builtin/ticker-detail/financials/model.test.ts +0 -276
  1587. package/src/plugins/builtin/ticker-detail/financials/period-integrity.test.tsx +0 -78
  1588. package/src/plugins/builtin/ticker-detail/fund-profile.test.tsx +0 -118
  1589. package/src/plugins/builtin/ticker-detail/headless.test.ts +0 -165
  1590. package/src/plugins/builtin/ticker-detail/index.test.tsx +0 -850
  1591. package/src/plugins/builtin/ticker-detail/overview/model.test.ts +0 -118
  1592. package/src/plugins/builtin/ticker-detail/overview-return-coverage.test.tsx +0 -71
  1593. package/src/plugins/builtin/ticker-detail/quote-monitor/card.test.tsx +0 -70
  1594. package/src/plugins/builtin/ticker-detail/quote-monitor/index.test.tsx +0 -261
  1595. package/src/plugins/builtin/ticker-detail/quote-monitor/retained-status.test.tsx +0 -134
  1596. package/src/plugins/builtin/ticker-detail/quote-status.test.tsx +0 -116
  1597. package/src/plugins/builtin/ticker-detail/quote-time-integrity.test.ts +0 -42
  1598. package/src/plugins/builtin/ticker-research-backend-plugin.ts +0 -10
  1599. package/src/plugins/builtin/ticker-research-plugin.ts +0 -61
  1600. package/src/plugins/builtin/time-sales/model.test.ts +0 -83
  1601. package/src/plugins/builtin/time-sales/snapshot-client.test.ts +0 -31
  1602. package/src/plugins/builtin/time-sales/test-fixture.ts +0 -12
  1603. package/src/plugins/builtin/time-sales/use-tape.test.tsx +0 -115
  1604. package/src/plugins/builtin/treasury-auctions/cache.test.ts +0 -215
  1605. package/src/plugins/builtin/treasury-auctions/client.test.ts +0 -207
  1606. package/src/plugins/builtin/treasury-auctions/headless.test.ts +0 -34
  1607. package/src/plugins/builtin/treasury-auctions/model.test.ts +0 -187
  1608. package/src/plugins/builtin/treasury-auctions/pane.test.tsx +0 -174
  1609. package/src/plugins/builtin/vol-surface/client.test.ts +0 -179
  1610. package/src/plugins/builtin/vol-surface/evidence.test.ts +0 -73
  1611. package/src/plugins/builtin/vol-surface/live.test.ts +0 -95
  1612. package/src/plugins/builtin/vol-surface/model.test.ts +0 -243
  1613. package/src/plugins/builtin/vol-surface/pane.test.tsx +0 -265
  1614. package/src/plugins/builtin/vol-surface/raster.test.ts +0 -28
  1615. package/src/plugins/builtin/vol-surface/stored.test.ts +0 -62
  1616. package/src/plugins/builtin/volatility/chart-model.test.ts +0 -61
  1617. package/src/plugins/builtin/volatility/client.test.ts +0 -207
  1618. package/src/plugins/builtin/volatility/evidence.test.ts +0 -49
  1619. package/src/plugins/builtin/volatility/headless.test.ts +0 -52
  1620. package/src/plugins/builtin/volatility/model.test.ts +0 -152
  1621. package/src/plugins/builtin/world-indices/headless.test.ts +0 -32
  1622. package/src/plugins/builtin/world-indices/pane.test.tsx +0 -156
  1623. package/src/plugins/builtin/world-venue-map/map.desktop.test.tsx +0 -45
  1624. package/src/plugins/builtin/world-venue-map/model.test.ts +0 -85
  1625. package/src/plugins/builtin/yield-curve/chart.test.ts +0 -23
  1626. package/src/plugins/builtin/yield-curve/headless.test.ts +0 -40
  1627. package/src/plugins/builtin/yield-curve/history.test.ts +0 -124
  1628. package/src/plugins/builtin/yield-curve/pane.test.tsx +0 -140
  1629. package/src/plugins/builtin/yield-curve/treasury-data.test.ts +0 -35
  1630. package/src/plugins/bundle.test.ts +0 -209
  1631. package/src/plugins/catalog-backend.test.ts +0 -47
  1632. package/src/plugins/catalog-browser.test.ts +0 -72
  1633. package/src/plugins/gridlock-notification.ts +0 -16
  1634. package/src/plugins/host-contract.ts +0 -72
  1635. package/src/plugins/host-link.test.ts +0 -133
  1636. package/src/plugins/host-module-imports.test.ts +0 -94
  1637. package/src/plugins/host-module-imports.ts +0 -73
  1638. package/src/plugins/host-resolver.test.ts +0 -96
  1639. package/src/plugins/launch-layout.test.ts +0 -131
  1640. package/src/plugins/loader.test.ts +0 -54
  1641. package/src/plugins/pane-manager.test.ts +0 -309
  1642. package/src/plugins/registry/index.test.ts +0 -601
  1643. package/src/plugins/registry/pane-settings.test.ts +0 -98
  1644. package/src/plugins/registry/setup-command.test.ts +0 -62
  1645. package/src/plugins/runtime/index.test.tsx +0 -328
  1646. package/src/plugins/seed.test.ts +0 -136
  1647. package/src/plugins/ticker-navigation.test.ts +0 -141
  1648. package/src/public/public-api.test.ts +0 -42
  1649. package/src/react/async-resource.test.tsx +0 -124
  1650. package/src/react/input.test.ts +0 -182
  1651. package/src/remote/controller.test.ts +0 -585
  1652. package/src/remote/json-patch.test.ts +0 -31
  1653. package/src/remote/schema.test.ts +0 -65
  1654. package/src/remote/semantic-tree.test.tsx +0 -105
  1655. package/src/remote/server.test.ts +0 -50
  1656. package/src/renderers/browser/bundled-plugins.test.ts +0 -41
  1657. package/src/renderers/browser/cloud-transport.test.ts +0 -68
  1658. package/src/renderers/browser/config-host.test.ts +0 -70
  1659. package/src/renderers/browser/deeplink-bridge.test.ts +0 -56
  1660. package/src/renderers/browser/error-boundary.tsx +0 -23
  1661. package/src/renderers/browser/http-proxy-transport.test.ts +0 -98
  1662. package/src/renderers/browser/research-entry.test.ts +0 -32
  1663. package/src/renderers/browser/storage.test.ts +0 -66
  1664. package/src/renderers/cloudflare/http-proxy.test.ts +0 -122
  1665. package/src/renderers/cloudflare/worker.test.ts +0 -155
  1666. package/src/renderers/electrobun/bun/application-menu/click.test.ts +0 -55
  1667. package/src/renderers/electrobun/bun/context-menu/click.test.ts +0 -67
  1668. package/src/renderers/electrobun/bun/context-menu/normalize.test.ts +0 -52
  1669. package/src/renderers/electrobun/bun/desktop/capability-bridge.test.ts +0 -112
  1670. package/src/renderers/electrobun/bun/desktop/http-fetch.test.ts +0 -89
  1671. package/src/renderers/electrobun/bun/desktop/http-stream.test.ts +0 -200
  1672. package/src/renderers/electrobun/bun/desktop/initialization.test.ts +0 -27
  1673. package/src/renderers/electrobun/bun/desktop/window-controls.test.ts +0 -53
  1674. package/src/renderers/electrobun/bun/desktop/window-controls.ts +0 -75
  1675. package/src/renderers/electrobun/bun/desktop/window-events.ts +0 -49
  1676. package/src/renderers/electrobun/bun/desktop/window-style.ts +0 -34
  1677. package/src/renderers/electrobun/bun/desktop/windows-custom-chrome.ts +0 -58
  1678. package/src/renderers/electrobun/bun/desktop/windows-icons.ts +0 -70
  1679. package/src/renderers/electrobun/bun/desktop/windows-native.ts +0 -75
  1680. package/src/renderers/electrobun/bun/desktop/workspace/index.test.ts +0 -147
  1681. package/src/renderers/electrobun/bun/window/frame.test.ts +0 -47
  1682. package/src/renderers/electrobun/view/application-menu-bridge.ts +0 -12
  1683. package/src/renderers/electrobun/view/cli-pane-shot-frame.test.tsx +0 -76
  1684. package/src/renderers/electrobun/view/cli-pane-shot-health.test.ts +0 -25
  1685. package/src/renderers/electrobun/view/context-menu.test.ts +0 -146
  1686. package/src/renderers/electrobun/view/data-table/frozen-column.test.tsx +0 -73
  1687. package/src/renderers/electrobun/view/data-table/horizontal-navigation.test.tsx +0 -82
  1688. package/src/renderers/electrobun/view/data-table/index.test.tsx +0 -127
  1689. package/src/renderers/electrobun/view/desktop/controls.test.tsx +0 -161
  1690. package/src/renderers/electrobun/view/desktop/list-view.test.tsx +0 -37
  1691. package/src/renderers/electrobun/view/desktop/window/snapshot.test.ts +0 -57
  1692. package/src/renderers/electrobun/view/desktop-deeplink-bridge.ts +0 -10
  1693. package/src/renderers/electrobun/view/dialog-host.test.ts +0 -25
  1694. package/src/renderers/electrobun/view/dialog-stack.test.tsx +0 -73
  1695. package/src/renderers/electrobun/view/external-plugins.test.ts +0 -57
  1696. package/src/renderers/electrobun/view/history-metadata-rpc.test.ts +0 -62
  1697. package/src/renderers/electrobun/view/host/ascii-text.test.ts +0 -48
  1698. package/src/renderers/electrobun/view/host/box.test.tsx +0 -171
  1699. package/src/renderers/electrobun/view/host/focus-scope.test.ts +0 -37
  1700. package/src/renderers/electrobun/view/host/scroll-box.desktop.test.tsx +0 -46
  1701. package/src/renderers/electrobun/view/host/style.test.ts +0 -15
  1702. package/src/renderers/electrobun/view/host/surface-3d.test.ts +0 -33
  1703. package/src/renderers/electrobun/view/input-host.test.tsx +0 -104
  1704. package/src/renderers/electrobun/view/key-event.test.ts +0 -34
  1705. package/src/renderers/electrobun/view/native-stubs/chart/kitty-support.ts +0 -19
  1706. package/src/renderers/electrobun/view/native-stubs/chart/surface-manager.ts +0 -36
  1707. package/src/renderers/electrobun/view/native-stubs/ibkr-native-loader.ts +0 -3
  1708. package/src/renderers/electrobun/view/native-stubs/native-stubs.test.ts +0 -42
  1709. package/src/renderers/electrobun/view/notes-files.ts +0 -56
  1710. package/src/renderers/electrobun/view/remote/backend-quote-subscription.test.ts +0 -87
  1711. package/src/renderers/electrobun/view/remote/capability-invoker.test.ts +0 -96
  1712. package/src/renderers/electrobun/view/remote/connection-health-backend.ts +0 -19
  1713. package/src/renderers/electrobun/view/remote/connection-health.test.ts +0 -44
  1714. package/src/renderers/electrobun/view/remote/quote-subscription-registry.test.ts +0 -86
  1715. package/src/renderers/electrobun/view/rpc-codec.test.ts +0 -112
  1716. package/src/renderers/electrobun/view/screenshot-watermark.test.ts +0 -48
  1717. package/src/renderers/electrobun/view/toast-host.test.tsx +0 -61
  1718. package/src/renderers/opentui/chart-surface.test.tsx +0 -147
  1719. package/src/renderers/opentui/image/loader.test.ts +0 -25
  1720. package/src/renderers/opentui/interaction-performance.test.ts +0 -79
  1721. package/src/renderers/opentui/terminal-media.test.ts +0 -173
  1722. package/src/renderers/share/chart.test.ts +0 -52
  1723. package/src/renderers/share/layout-view.test.tsx +0 -58
  1724. package/src/renderers/share/view.test.tsx +0 -120
  1725. package/src/shares/api.test.ts +0 -120
  1726. package/src/shares/location.test.ts +0 -19
  1727. package/src/shares/pane.test.ts +0 -110
  1728. package/src/sources/asml-earnings.test.ts +0 -197
  1729. package/src/sources/fixtures/sec-operating-expenses.json +0 -163
  1730. package/src/sources/fixtures/shop-20251231-quarterly-summary.html +0 -1
  1731. package/src/sources/fixtures/shop-20260630-quarterly-summary.html +0 -1
  1732. package/src/sources/fixtures/shop-operating-provider.json +0 -141
  1733. package/src/sources/fixtures/shop-quarterly-summary-provenance.json +0 -24
  1734. package/src/sources/fixtures/shop-submissions-20260922.json +0 -31
  1735. package/src/sources/gloomberb-cloud/history-coverage.test.ts +0 -119
  1736. package/src/sources/gloomberb-cloud/history-retention.test.ts +0 -207
  1737. package/src/sources/gloomberb-cloud/history-session.test.ts +0 -76
  1738. package/src/sources/gloomberb-cloud/index.test.ts +0 -1116
  1739. package/src/sources/gloomberb-cloud/normalizers.test.ts +0 -135
  1740. package/src/sources/gloomberb-cloud/quote-metadata.test.ts +0 -50
  1741. package/src/sources/gloomberb-cloud/valuation-observations.ts +0 -29
  1742. package/src/sources/history-coverage.test.ts +0 -40
  1743. package/src/sources/listing-history.ts +0 -52
  1744. package/src/sources/provider-router/arca-cache.test.ts +0 -97
  1745. package/src/sources/provider-router/asml-earnings-cache.test.ts +0 -158
  1746. package/src/sources/provider-router/broker-session.test.ts +0 -52
  1747. package/src/sources/provider-router/cache.test.ts +0 -133
  1748. package/src/sources/provider-router/cached-financials.test.ts +0 -711
  1749. package/src/sources/provider-router/cached-listing-identity.test.ts +0 -159
  1750. package/src/sources/provider-router/cached-routes.test.ts +0 -232
  1751. package/src/sources/provider-router/connection-health.test.ts +0 -28
  1752. package/src/sources/provider-router/financials.test.ts +0 -209
  1753. package/src/sources/provider-router/fixtures/quarterly-source-disagreements.json +0 -438
  1754. package/src/sources/provider-router/fixtures/shop-nasdaqgs.json +0 -137
  1755. package/src/sources/provider-router/history-boundary-cache.test.ts +0 -72
  1756. package/src/sources/provider-router/history-calendar-cache.test.ts +0 -301
  1757. package/src/sources/provider-router/history-exact-window.test.ts +0 -187
  1758. package/src/sources/provider-router/history-gap-cache.test.ts +0 -84
  1759. package/src/sources/provider-router/history-gaps.test.ts +0 -141
  1760. package/src/sources/provider-router/history-retention.test.ts +0 -239
  1761. package/src/sources/provider-router/history-session.test.ts +0 -138
  1762. package/src/sources/provider-router/history.test.ts +0 -780
  1763. package/src/sources/provider-router/index.test.ts +0 -1990
  1764. package/src/sources/provider-router/listing-history.test.ts +0 -139
  1765. package/src/sources/provider-router/listing-identity.test.ts +0 -128
  1766. package/src/sources/provider-router/nasdaqgs-listing.test.ts +0 -78
  1767. package/src/sources/provider-router/news.test.ts +0 -34
  1768. package/src/sources/provider-router/non-company-metadata.test.ts +0 -95
  1769. package/src/sources/provider-router/o-income-basis.test.ts +0 -64
  1770. package/src/sources/provider-router/operating-result-cache.test.ts +0 -44
  1771. package/src/sources/provider-router/operating-result-retry.test.ts +0 -221
  1772. package/src/sources/provider-router/profile-enrichment.test.ts +0 -168
  1773. package/src/sources/provider-router/quote-completion.test.ts +0 -62
  1774. package/src/sources/provider-router/quote-domain.test.ts +0 -92
  1775. package/src/sources/provider-router/quote-route.test.ts +0 -255
  1776. package/src/sources/provider-router/realtime-access.test.ts +0 -22
  1777. package/src/sources/provider-router/routing.test.ts +0 -39
  1778. package/src/sources/provider-router/search.test.ts +0 -191
  1779. package/src/sources/provider-router/shell-history-cache.test.ts +0 -131
  1780. package/src/sources/provider-router/statement-history.test.ts +0 -71
  1781. package/src/sources/provider-router/statement-observations.test.ts +0 -162
  1782. package/src/sources/provider-router/valuation-retractions.test.ts +0 -280
  1783. package/src/sources/reported-operating-results.test.ts +0 -286
  1784. package/src/sources/sec-bank-revenue.test.ts +0 -79
  1785. package/src/sources/sec-edgar-shares.fixture.json +0 -188
  1786. package/src/sources/sec-edgar-shares.test.ts +0 -66
  1787. package/src/sources/sec-edgar.test.ts +0 -924
  1788. package/src/sources/sec-income-attribution.test.ts +0 -93
  1789. package/src/sources/sec-operating-expenses.test.ts +0 -42
  1790. package/src/sources/yahoo-finance/fixtures/aapl-final-observation.json +0 -20
  1791. package/src/sources/yahoo-finance/history-session.test.ts +0 -120
  1792. package/src/sources/yahoo-finance/history.test.ts +0 -47
  1793. package/src/sources/yahoo-finance/mappers.test.ts +0 -176
  1794. package/src/sources/yahoo-finance/options.test.ts +0 -23
  1795. package/src/sources/yahoo-finance/requests.test.ts +0 -119
  1796. package/src/sources/yahoo-finance/snapshots.test.ts +0 -225
  1797. package/src/sources/yahoo-finance/symbols.test.ts +0 -18
  1798. package/src/sources/yahoo-finance.test.ts +0 -330
  1799. package/src/state/app/activity.test.ts +0 -54
  1800. package/src/state/app/bootstrap.test.ts +0 -664
  1801. package/src/state/app/context/index.test.ts +0 -604
  1802. package/src/state/app/context/index.test.tsx +0 -347
  1803. package/src/state/app/context/selector.test.tsx +0 -424
  1804. package/src/state/hooks/inline-ticker-failures.test.ts +0 -77
  1805. package/src/state/hooks/inline-tickers.test.tsx +0 -253
  1806. package/src/state/hooks/live-ticker-financials.test.tsx +0 -120
  1807. package/src/state/hooks/quote-streaming.test.ts +0 -44
  1808. package/src/state/hooks/quote-streaming.test.tsx +0 -442
  1809. package/src/state/persist-scheduler.test.ts +0 -151
  1810. package/src/state/selectors-ui.ts +0 -47
  1811. package/src/state/selectors.ts +0 -27
  1812. package/src/state/session-persistence.test.ts +0 -187
  1813. package/src/state/ticker-refresh-queue.test.ts +0 -46
  1814. package/src/sync/auth-transition.test.ts +0 -36
  1815. package/src/sync/controller.test.ts +0 -527
  1816. package/src/sync/core-contributors.test.ts +0 -643
  1817. package/src/test-support/fixtures/asml-earnings.json +0 -993
  1818. package/src/theme/colors.test.ts +0 -85
  1819. package/src/theme/font-scale.test.ts +0 -14
  1820. package/src/theme/theme-context.test.tsx +0 -67
  1821. package/src/theme/themes.test.ts +0 -100
  1822. package/src/tickers/instrument-kind.test.ts +0 -21
  1823. package/src/tickers/instrument-label.test.ts +0 -13
  1824. package/src/tickers/list.test.ts +0 -17
  1825. package/src/tickers/open-target.test.ts +0 -86
  1826. package/src/tickers/search/index.test.ts +0 -950
  1827. package/src/tickers/search-contract-context.test.tsx +0 -161
  1828. package/src/tickers/search-contract-templates.test.ts +0 -83
  1829. package/src/tickers/search-issuer-grouping.test.ts +0 -74
  1830. package/src/tickers/search-listing-ranking.test.tsx +0 -122
  1831. package/src/tickers/tokenizer.test.ts +0 -31
  1832. package/src/time-series/bond-price-history.test.ts +0 -52
  1833. package/src/time-series/calendar-month-end-resolution.test.ts +0 -106
  1834. package/src/time-series/calendar-window-resolution.test.ts +0 -133
  1835. package/src/time-series/chart-data.test.ts +0 -288
  1836. package/src/time-series/date-window.test.ts +0 -113
  1837. package/src/time-series/economic.test.ts +0 -44
  1838. package/src/time-series/financial-history-request.test.ts +0 -20
  1839. package/src/time-series/financial-period-coverage.test.ts +0 -37
  1840. package/src/time-series/financial-period-gaps.test.ts +0 -128
  1841. package/src/time-series/fixtures/q4-reported-common-income.json +0 -394
  1842. package/src/time-series/fixtures/q4-reported-per-share.json +0 -305
  1843. package/src/time-series/fixtures/quote-store.ts +0 -55
  1844. package/src/time-series/forward-valuation.test.ts +0 -131
  1845. package/src/time-series/fundamentals.test.ts +0 -592
  1846. package/src/time-series/history-retention.test.ts +0 -141
  1847. package/src/time-series/history-session-cache.test.ts +0 -250
  1848. package/src/time-series/hooks.test.ts +0 -59
  1849. package/src/time-series/legacy-contract-live.test.ts +0 -22
  1850. package/src/time-series/live-bars.test.ts +0 -290
  1851. package/src/time-series/live-quotes.test.ts +0 -208
  1852. package/src/time-series/market-price-units.test.ts +0 -75
  1853. package/src/time-series/parsed-history-identity.test.tsx +0 -142
  1854. package/src/time-series/price-comparison.test.ts +0 -233
  1855. package/src/time-series/price-history-integrity-window.test.ts +0 -137
  1856. package/src/time-series/price-history-integrity.test.ts +0 -195
  1857. package/src/time-series/q4-common-income.test.ts +0 -63
  1858. package/src/time-series/q4-per-share.test.ts +0 -144
  1859. package/src/time-series/realized-vol-study.test.ts +0 -189
  1860. package/src/time-series/reporting-currency.test.ts +0 -99
  1861. package/src/time-series/resolution.test.ts +0 -132
  1862. package/src/time-series/resolve.test.ts +0 -2471
  1863. package/src/time-series/sec-eps-research.test.ts +0 -55
  1864. package/src/time-series/seed-cadence.test.tsx +0 -219
  1865. package/src/time-series/served-cadence-consumers.test.ts +0 -52
  1866. package/src/time-series/session-history-domain.test.ts +0 -160
  1867. package/src/time-series/spec-studies.test.ts +0 -619
  1868. package/src/time-series/transforms.test.ts +0 -216
  1869. package/src/time-series/use-chart-resolution.test.tsx +0 -632
  1870. package/src/time-series/valuation-currency.test.ts +0 -129
  1871. package/src/time-series/valuation-denominator.test.ts +0 -240
  1872. package/src/time-series/valuation-live-status.test.ts +0 -64
  1873. package/src/time-series/valuation-price.test.ts +0 -267
  1874. package/src/types/config.test.ts +0 -161
  1875. package/src/ui/context-menu.test.ts +0 -95
  1876. package/src/ui/qr.test.ts +0 -79
  1877. package/src/updater/github-releases.test.ts +0 -41
  1878. package/src/updater.test.ts +0 -561
  1879. package/src/updater.ts +0 -480
  1880. package/src/utils/calendar-date.test.ts +0 -18
  1881. package/src/utils/cli-output.test.ts +0 -43
  1882. package/src/utils/csv.test.ts +0 -13
  1883. package/src/utils/currency-units.test.ts +0 -66
  1884. package/src/utils/dom-screenshot.test.ts +0 -52
  1885. package/src/utils/double-escape-close.test.ts +0 -33
  1886. package/src/utils/earnings-result.ts +0 -35
  1887. package/src/utils/exchange-rate-map.ts +0 -9
  1888. package/src/utils/exchange-rate-snapshot.test.ts +0 -33
  1889. package/src/utils/exchanges.test.ts +0 -62
  1890. package/src/utils/external-url.test.ts +0 -32
  1891. package/src/utils/financial-statements.test.ts +0 -211
  1892. package/src/utils/format.test.ts +0 -61
  1893. package/src/utils/fuzzy-search.test.ts +0 -94
  1894. package/src/utils/fx-market-hours.test.ts +0 -28
  1895. package/src/utils/fx-status.test.ts +0 -16
  1896. package/src/utils/html-entities.test.ts +0 -8
  1897. package/src/utils/inline-content-tokenizer.test.ts +0 -31
  1898. package/src/utils/instrument-identity.test.ts +0 -26
  1899. package/src/utils/latest-financial-period.test.ts +0 -19
  1900. package/src/utils/link-tokenizer.test.ts +0 -27
  1901. package/src/utils/main-thread-monitor.ts +0 -127
  1902. package/src/utils/main-thread-stall.test.ts +0 -59
  1903. package/src/utils/market-capitalization-consumers.test.ts +0 -59
  1904. package/src/utils/market-capitalization.test.ts +0 -38
  1905. package/src/utils/operating-result-aggregation.ts +0 -106
  1906. package/src/utils/operating-result-consumers.test.ts +0 -212
  1907. package/src/utils/operating-result.ts +0 -100
  1908. package/src/utils/options.test.ts +0 -20
  1909. package/src/utils/price-earnings.test.ts +0 -39
  1910. package/src/utils/price-history.test.ts +0 -230
  1911. package/src/utils/relative-time.ts +0 -8
  1912. package/src/utils/reported-earnings-result.ts +0 -336
  1913. package/src/utils/reported-money.test.ts +0 -25
  1914. package/src/utils/reported-operating-result.ts +0 -271
  1915. package/src/utils/save-text-file.test.ts +0 -24
  1916. package/src/utils/sec-eps-basis.test.ts +0 -82
  1917. package/src/utils/sec.test.ts +0 -60
  1918. package/src/utils/semver.test.ts +0 -31
  1919. package/src/utils/shop-operating-table.ts +0 -230
  1920. package/src/utils/shortcut-labels.test.ts +0 -20
  1921. package/src/utils/sort-values.test.ts +0 -11
  1922. package/src/utils/statement-observations.ts +0 -129
  1923. package/src/utils/throttled-fetch.test.ts +0 -186
  1924. package/src/utils/tweet-text.test.ts +0 -13
@@ -1,1894 +0,0 @@
1
- import { afterEach, beforeEach, describe, expect, jest, test } from "bun:test";
2
- import {
3
- apiClient,
4
- type ChatChannel,
5
- type ChatMessage,
6
- type ChatNotification,
7
- type ChatStateResponse,
8
- } from "../../../api-client";
9
- import { ApiRequestError } from "../../../api-client/errors";
10
- import { MemoryPluginPersistence as MemoryPersistence } from "../../../test-support/plugin-persistence";
11
- import type { AppNotificationRequest } from "../../../types/plugin";
12
- import { ChatController } from "./controller";
13
- import { SESSION_RETRY_MS } from "./controller/state";
14
-
15
- const testControllers = new Set<ChatController>();
16
-
17
- function createController(): ChatController {
18
- const controller = new ChatController();
19
- testControllers.add(controller);
20
- return controller;
21
- }
22
-
23
- function persistSession(persistence: MemoryPersistence, user: Record<string, unknown> = {}) {
24
- persistence.setState("session", {
25
- sessionToken: "token-123",
26
- user: { id: "u1", username: "vince", ...user },
27
- }, { schemaVersion: 1 });
28
- }
29
-
30
- function chatMessage(input: Pick<ChatMessage, "id" | "content" | "createdAt"> & Partial<ChatMessage>): ChatMessage {
31
- return { channelId: "everyone", replyToId: null, user: { id: "u1", username: "vince", displayName: "Vince" }, ...input };
32
- }
33
-
34
- const TRANSCRIPT_KIND = "channel-transcript";
35
- const TRANSCRIPT_KEY = "everyone";
36
- const TRANSCRIPT_SOURCE = "server";
37
- const TRANSCRIPT_SCHEMA_VERSION = 2;
38
- const originalConnectChannel = apiClient.connectChannel.bind(apiClient);
39
- const originalGetSession = apiClient.getSession.bind(apiClient);
40
- const originalGetMessages = apiClient.getMessages.bind(apiClient);
41
- const originalGetChannels = apiClient.getChannels.bind(apiClient);
42
- const originalGetChatPresence = apiClient.getChatPresence.bind(apiClient);
43
- const originalGetChatState = apiClient.getChatState.bind(apiClient);
44
- const originalGetAccountProfile = apiClient.getAccountProfile.bind(apiClient);
45
- const originalUpdateChatChannelState = apiClient.updateChatChannelState.bind(apiClient);
46
- const originalMarkChatNotificationsDelivered = apiClient.markChatNotificationsDelivered.bind(apiClient);
47
- const originalSubscribeChatNotifications = apiClient.subscribeChatNotifications.bind(apiClient);
48
- const originalSubscribeChatPresence = apiClient.subscribeChatPresence.bind(apiClient);
49
- const originalEditMessage = apiClient.editMessage.bind(apiClient);
50
-
51
- const SERVER_CHAT_CHANNELS: ChatChannel[] = [
52
- { id: "everyone", name: "everyone", created_at: "2026-03-26T12:10:05.684Z" },
53
- { id: "equities", name: "equities", created_at: "2026-05-09T00:00:00.000Z" },
54
- { id: "options", name: "options", created_at: "2026-05-09T00:00:00.000Z" },
55
- { id: "help", name: "help", created_at: "2026-05-09T00:00:00.000Z" },
56
- ];
57
-
58
- async function flushMicrotasks() {
59
- await Promise.resolve();
60
- await Promise.resolve();
61
- }
62
-
63
- function recentChatTimestamp(offsetMs = 60_000) {
64
- return new Date(Date.now() - offsetMs).toISOString();
65
- }
66
-
67
- function mentionNotification(overrides: Partial<ChatNotification> = {}): ChatNotification {
68
- const channelId = overrides.channelId ?? "everyone";
69
- const messageId = overrides.messageId ?? "m1";
70
- const createdAt = overrides.createdAt ?? "2026-03-28T00:00:00.000Z";
71
- return {
72
- id: overrides.id ?? "n1",
73
- type: overrides.type ?? "mention",
74
- channelId,
75
- messageId,
76
- createdAt,
77
- message: overrides.message ?? {
78
- id: messageId,
79
- channelId,
80
- content: "hey @vince",
81
- replyToId: null,
82
- createdAt,
83
- user: { id: "u2", username: "bob", displayName: "Bob" },
84
- },
85
- };
86
- }
87
-
88
- class TrackingPersistence extends MemoryPersistence {
89
- stateWrites = 0;
90
-
91
- override setState(key: string, value: unknown, options?: { schemaVersion?: number }): void {
92
- this.stateWrites += 1;
93
- super.setState(key, value, options);
94
- }
95
- }
96
-
97
- beforeEach(() => {
98
- apiClient.getChatPresence = async () => ({ onlineCount: 0 });
99
- apiClient.getChatState = async () => ({
100
- channels: SERVER_CHAT_CHANNELS,
101
- onlineCount: 0,
102
- channelStates: SERVER_CHAT_CHANNELS.map((channel) => ({
103
- channelId: channel.id,
104
- notificationsEnabled: false,
105
- lastReadMessageId: null,
106
- unreadCount: 0,
107
- })),
108
- notifications: [],
109
- });
110
- apiClient.updateChatChannelState = async (channelId, body) => ({
111
- channelId,
112
- notificationsEnabled: body.notificationsEnabled ?? false,
113
- lastReadMessageId: body.readThroughMessageId ?? null,
114
- unreadCount: 0,
115
- });
116
- apiClient.markChatNotificationsDelivered = async () => ({ delivered: 1 });
117
- apiClient.subscribeChatNotifications = () => () => {};
118
- apiClient.subscribeChatPresence = () => () => {};
119
- });
120
-
121
- afterEach(() => {
122
- for (const controller of testControllers) controller.dispose();
123
- testControllers.clear();
124
- jest.useRealTimers();
125
- apiClient.dispose();
126
- apiClient.setSessionToken(null);
127
- apiClient.setCookieSessionMode(false);
128
- apiClient.connectChannel = originalConnectChannel;
129
- apiClient.getSession = originalGetSession;
130
- apiClient.getMessages = originalGetMessages;
131
- apiClient.getChannels = originalGetChannels;
132
- apiClient.getChatPresence = originalGetChatPresence;
133
- apiClient.getChatState = originalGetChatState;
134
- apiClient.getAccountProfile = originalGetAccountProfile;
135
- apiClient.updateChatChannelState = originalUpdateChatChannelState;
136
- apiClient.markChatNotificationsDelivered = originalMarkChatNotificationsDelivered;
137
- apiClient.subscribeChatNotifications = originalSubscribeChatNotifications;
138
- apiClient.subscribeChatPresence = originalSubscribeChatPresence;
139
- apiClient.editMessage = originalEditMessage;
140
- });
141
-
142
- describe("ChatController", () => {
143
- test("hydrates cached session, draft, and transcript from plugin persistence", () => {
144
- const persistence = new MemoryPersistence();
145
- const controller = createController();
146
- const message: ChatMessage = chatMessage({
147
- id: "m1",
148
- content: "hello",
149
- createdAt: "2026-03-28T00:00:00.000Z",
150
- });
151
-
152
- persistSession(persistence);
153
- persistence.setState("channel:everyone", {
154
- draft: "cached draft",
155
- replyToId: "m1",
156
- lastCursor: "2026-03-28T00:00:00.000Z",
157
- lastViewedMessageId: "m1",
158
- }, { schemaVersion: 1 });
159
- persistence.setResource(TRANSCRIPT_KIND, TRANSCRIPT_KEY, {
160
- messages: [message],
161
- }, {
162
- sourceKey: TRANSCRIPT_SOURCE,
163
- schemaVersion: TRANSCRIPT_SCHEMA_VERSION,
164
- cachePolicy: { staleMs: 1_000, expireMs: 2_000 },
165
- });
166
-
167
- controller.attachPersistence(persistence);
168
-
169
- const snapshot = controller.getSnapshot();
170
- expect(apiClient.getSessionToken()).toBe("token-123");
171
- expect(snapshot.user?.username).toBe("vince");
172
- expect(snapshot.draft).toBe("cached draft");
173
- expect(snapshot.replyToId).toBe("m1");
174
- expect(snapshot.messages.map((entry) => entry.id)).toEqual(["m1"]);
175
- });
176
-
177
- test("uses a browser cookie session without exposing its token", async () => {
178
- const persistence = new MemoryPersistence();
179
- const controller = createController();
180
- const sentMessages: string[] = [];
181
-
182
- apiClient.setCookieSessionMode(true);
183
- apiClient.restoreCachedUser({
184
- id: "u1",
185
- username: "vince",
186
- emailVerified: true,
187
- });
188
- apiClient.getSession = async () => apiClient.getCurrentUser();
189
- apiClient.connectChannel = () => ({
190
- send: async (content) => {
191
- sentMessages.push(content);
192
- return {
193
- id: "m1",
194
- channelId: "everyone",
195
- content,
196
- replyToId: null,
197
- createdAt: "2026-08-23T00:00:00.000Z",
198
- user: { id: "u1", username: "vince", displayName: "Vince" },
199
- };
200
- },
201
- close: () => {},
202
- });
203
-
204
- controller.attachPersistence(persistence);
205
- await controller.refreshSession();
206
-
207
- expect(apiClient.getSessionToken()).toBeNull();
208
- expect(controller.getSnapshot()).toMatchObject({
209
- hasSavedSession: true,
210
- user: { id: "u1", username: "vince", emailVerified: true },
211
- });
212
- expect(controller.send("hello from the browser")).toBe(true);
213
- await flushMicrotasks();
214
- expect(sentMessages).toEqual(["hello from the browser"]);
215
- controller.dispose();
216
- });
217
-
218
- test("rejects unknown shortcut channels after the server list loads", async () => {
219
- const controller = createController();
220
- apiClient.getChannels = async () => SERVER_CHAT_CHANNELS;
221
-
222
- await expect(controller.resolveRequiredChannelId("help")).resolves.toBe("help");
223
- await expect(controller.resolveRequiredChannelId("made-up")).rejects.toThrow(
224
- 'Unknown chat channel "#made-up".',
225
- );
226
- });
227
-
228
- test("keeps private channels when a public refresh finishes after chat state", async () => {
229
- const persistence = new MemoryPersistence();
230
- const controller = createController();
231
- const directChannel: ChatChannel = {
232
- id: "dm:u2",
233
- name: "u2",
234
- kind: "direct",
235
- created_at: "2026-03-28T00:00:00.000Z",
236
- };
237
- const teamChannel: ChatChannel = {
238
- id: "team:org-1:trades",
239
- name: "trades",
240
- kind: "team",
241
- teamId: "org-1",
242
- created_at: "2026-09-14T00:00:00.000Z",
243
- };
244
- let resolvePublicChannels: ((channels: ChatChannel[]) => void) | undefined;
245
-
246
- persistSession(persistence, { emailVerified: true });
247
- apiClient.getChannels = () => new Promise((resolve) => {
248
- resolvePublicChannels = resolve;
249
- });
250
- apiClient.getChatState = async () => ({
251
- channels: [...SERVER_CHAT_CHANNELS, directChannel, teamChannel],
252
- onlineCount: 0,
253
- channelStates: [],
254
- notifications: [],
255
- });
256
- controller.attachPersistence(persistence);
257
-
258
- const publicRefresh = controller.refreshChannels();
259
- await controller.refreshChatState();
260
- expect(controller.getChannels().map((channel) => channel.id)).toContain(directChannel.id);
261
- expect(controller.getChannels().map((channel) => channel.id)).toContain(teamChannel.id);
262
-
263
- resolvePublicChannels!(SERVER_CHAT_CHANNELS);
264
- await publicRefresh;
265
-
266
- expect(controller.getChannels().map((channel) => channel.id)).toContain(directChannel.id);
267
- expect(controller.getChannels().map((channel) => channel.id)).toContain(teamChannel.id);
268
- });
269
-
270
- test("hydrates a cached verified user into the api client for offline use", async () => {
271
- const persistence = new MemoryPersistence();
272
- const controller = createController();
273
-
274
- persistSession(persistence, { emailVerified: true });
275
-
276
- controller.attachPersistence(persistence);
277
-
278
- expect(apiClient.getCurrentUser()).toMatchObject({
279
- id: "u1",
280
- username: "vince",
281
- emailVerified: true,
282
- });
283
- await expect(apiClient.ensureVerifiedSession()).resolves.toMatchObject({
284
- id: "u1",
285
- username: "vince",
286
- emailVerified: true,
287
- });
288
- });
289
-
290
- test("does not restore persisted websocket tokens", () => {
291
- const persistence = new MemoryPersistence();
292
- const controller = createController();
293
-
294
- persistence.setState("session", {
295
- sessionToken: "token-123",
296
- websocketToken: "stale-ws-token",
297
- user: { id: "u1", username: "vince", emailVerified: true },
298
- }, { schemaVersion: 1 });
299
-
300
- controller.attachPersistence(persistence);
301
-
302
- expect(apiClient.getSessionToken()).toBe("token-123");
303
- expect(apiClient.getWebSocketToken()).toBeNull();
304
- expect(apiClient.getCurrentUser()).toMatchObject({
305
- id: "u1",
306
- username: "vince",
307
- emailVerified: true,
308
- });
309
- });
310
-
311
- test("reset clears persisted chat state and session token", () => {
312
- const persistence = new MemoryPersistence();
313
- const controller = createController();
314
-
315
- persistSession(persistence);
316
- persistence.setState("channel:everyone", {
317
- draft: "cached draft",
318
- replyToId: null,
319
- lastCursor: null,
320
- lastViewedMessageId: null,
321
- }, { schemaVersion: 1 });
322
- persistence.setResource(TRANSCRIPT_KIND, TRANSCRIPT_KEY, {
323
- messages: [],
324
- }, {
325
- sourceKey: TRANSCRIPT_SOURCE,
326
- schemaVersion: TRANSCRIPT_SCHEMA_VERSION,
327
- cachePolicy: { staleMs: 1_000, expireMs: 2_000 },
328
- });
329
-
330
- controller.attachPersistence(persistence);
331
- controller.reset(true);
332
-
333
- expect(apiClient.getSessionToken()).toBeNull();
334
- expect(persistence.getState("session", { schemaVersion: 1 })).toBeNull();
335
- expect(persistence.getResource(TRANSCRIPT_KIND, TRANSCRIPT_KEY, {
336
- sourceKey: TRANSCRIPT_SOURCE,
337
- schemaVersion: TRANSCRIPT_SCHEMA_VERSION,
338
- })).toBeNull();
339
- });
340
-
341
- test("defers draft persistence and subscriber sync until the user pauses or leaves", () => {
342
- const persistence = new TrackingPersistence();
343
- const controller = createController();
344
- const draftSnapshots: string[] = [];
345
-
346
- controller.attachPersistence(persistence);
347
- const unsubscribe = controller.subscribe((snapshot) => {
348
- draftSnapshots.push(snapshot.draft);
349
- });
350
- draftSnapshots.length = 0;
351
- persistence.stateWrites = 0;
352
-
353
- controller.setDraft("h");
354
- controller.setDraft("he");
355
-
356
- expect(controller.getSnapshot().draft).toBe("he");
357
- expect(draftSnapshots).toEqual([]);
358
- expect(persistence.stateWrites).toBe(0);
359
- expect(persistence.getState("channel:everyone", { schemaVersion: 1 })).toBeNull();
360
-
361
- unsubscribe();
362
- controller.dispose();
363
-
364
- expect(persistence.getState<{ draft: string }>("channel:everyone", { schemaVersion: 1 })).toMatchObject({
365
- draft: "he",
366
- });
367
- });
368
-
369
- test("pauses verification polling while the app is backgrounded", () => {
370
- const controller = createController();
371
-
372
- apiClient.setSessionToken("token-123");
373
- (controller as any).session.sessionToken = "token-123";
374
- (controller as any).session.user = { id: "u1", username: "vince", emailVerified: false };
375
-
376
- controller.setAppActive(false);
377
- (controller as any).realtime.syncVerificationPolling();
378
- expect((controller as any).realtime.verificationPollTimer).toBeNull();
379
-
380
- controller.setAppActive(true);
381
- expect((controller as any).realtime.verificationPollTimer).not.toBeNull();
382
-
383
- controller.reset(true);
384
- });
385
-
386
- test("dispose stops verification polling and closes the live connection", () => {
387
- const controller = createController();
388
- let closed = false;
389
-
390
- apiClient.setSessionToken("token-123");
391
- (controller as any).session.sessionToken = "token-123";
392
- (controller as any).session.user = { id: "u1", username: "vince", emailVerified: false };
393
- (controller as any).realtime.syncVerificationPolling();
394
- expect((controller as any).realtime.verificationPollTimer).not.toBeNull();
395
-
396
- (controller as any).session.user = { id: "u1", username: "vince", emailVerified: true };
397
- apiClient.connectChannel = () => ({
398
- send: async () => {
399
- throw new Error("not implemented");
400
- },
401
- close: () => {
402
- closed = true;
403
- },
404
- });
405
-
406
- controller.ensureConnection();
407
-
408
- controller.dispose();
409
-
410
- expect(closed).toBe(true);
411
- expect((controller as any).realtime.verificationPollTimer).toBeNull();
412
- });
413
-
414
- test("runs a quiet safety refresh while the live connection is active", async () => {
415
- const persistence = new MemoryPersistence();
416
- const controller = createController();
417
- const originalSetInterval = globalThis.setInterval;
418
- const originalClearInterval = globalThis.clearInterval;
419
- const intervalCallbacks: Array<() => void> = [];
420
- const intervalHandle = { unref: () => {} };
421
- let cleared = false;
422
- let getMessagesCalls = 0;
423
- const loadingSnapshots: boolean[] = [];
424
-
425
- persistSession(persistence, { emailVerified: true });
426
-
427
- (globalThis as any).setInterval = (callback: () => void, timeout: number) => {
428
- expect(timeout).toBe(30_000);
429
- intervalCallbacks.push(callback);
430
- return intervalHandle;
431
- };
432
- (globalThis as any).clearInterval = (handle: unknown) => {
433
- if (handle === intervalHandle) {
434
- cleared = true;
435
- }
436
- };
437
-
438
- try {
439
- apiClient.getMessages = async () => {
440
- getMessagesCalls += 1;
441
- return [];
442
- };
443
- apiClient.connectChannel = () => ({
444
- send: async () => {
445
- throw new Error("not implemented");
446
- },
447
- close: () => {},
448
- });
449
-
450
- controller.attachPersistence(persistence);
451
- controller.ensureConnection();
452
- await flushMicrotasks();
453
-
454
- expect(intervalCallbacks).toHaveLength(1);
455
- expect(getMessagesCalls).toBe(1);
456
- expect(controller.getSnapshot().loading).toBe(false);
457
-
458
- controller.subscribe((snapshot) => {
459
- loadingSnapshots.push(snapshot.loading);
460
- });
461
- loadingSnapshots.length = 0;
462
-
463
- intervalCallbacks[0]!();
464
- await flushMicrotasks();
465
-
466
- expect(getMessagesCalls).toBe(2);
467
- expect(loadingSnapshots).toEqual([false]);
468
-
469
- controller.clearSession();
470
- expect((controller as any).realtime.safetyRefreshTimer).toBeNull();
471
- expect(cleared).toBe(true);
472
- } finally {
473
- controller.dispose();
474
- (globalThis as any).setInterval = originalSetInterval;
475
- (globalThis as any).clearInterval = originalClearInterval;
476
- }
477
- });
478
-
479
- test("validates a persisted native session through protected chat state", async () => {
480
- const persistence = new MemoryPersistence();
481
- const controller = createController();
482
- const directChannel: ChatChannel = {
483
- id: "dm:u2",
484
- name: "u2",
485
- kind: "direct",
486
- created_at: "2026-03-28T00:00:00.000Z",
487
- };
488
-
489
- persistSession(persistence, { emailVerified: true });
490
-
491
- controller.attachPersistence(persistence);
492
- apiClient.getSession = async () => {
493
- apiClient.restoreCachedUser(null);
494
- return null;
495
- };
496
- apiClient.getChatState = async () => ({
497
- channels: [...SERVER_CHAT_CHANNELS, directChannel],
498
- onlineCount: 0,
499
- channelStates: [],
500
- notifications: [],
501
- });
502
-
503
- await controller.refreshSession();
504
-
505
- expect(apiClient.getSessionToken()).toBe("token-123");
506
- expect(apiClient.getCurrentUser()?.id).toBe("u1");
507
- expect(controller.getChannels()).toContainEqual(directChannel);
508
- expect(persistence.getState<{
509
- sessionToken: string;
510
- user: { id: string; username: string; emailVerified: boolean };
511
- }>("session", { schemaVersion: 1 })).toEqual({
512
- sessionToken: "token-123",
513
- user: { id: "u1", username: "vince", emailVerified: true },
514
- });
515
- expect(controller.getSnapshot().user).toEqual({
516
- id: "u1",
517
- username: "vince",
518
- emailVerified: true,
519
- });
520
- controller.dispose();
521
- });
522
-
523
- test("clears an expired persisted session when protected chat rejects it", async () => {
524
- const persistence = new MemoryPersistence();
525
- const controller = createController();
526
-
527
- persistence.setState("session", {
528
- sessionToken: "expired-token",
529
- user: { id: "u1", username: "vince", emailVerified: true },
530
- }, { schemaVersion: 1 });
531
-
532
- controller.attachPersistence(persistence);
533
- apiClient.getSession = async () => {
534
- apiClient.restoreCachedUser(null);
535
- return null;
536
- };
537
- apiClient.getChatState = async () => {
538
- throw new ApiRequestError("Unauthorized", 401);
539
- };
540
-
541
- await controller.refreshSession();
542
-
543
- expect(apiClient.getSessionToken()).toBeNull();
544
- expect(apiClient.getCurrentUser()).toBeNull();
545
- expect(controller.getSnapshot().user).toBeNull();
546
- expect(persistence.getState("session", { schemaVersion: 1 })).toEqual({
547
- sessionToken: null,
548
- user: null,
549
- });
550
- controller.dispose();
551
- });
552
-
553
- test("clears an expired persisted session for an unverified user", async () => {
554
- const persistence = new MemoryPersistence();
555
- const controller = createController();
556
- let profileRequests = 0;
557
-
558
- persistence.setState("session", {
559
- sessionToken: "expired-token",
560
- user: { id: "u1", username: "vince", emailVerified: false },
561
- }, { schemaVersion: 1 });
562
-
563
- controller.attachPersistence(persistence);
564
- apiClient.getSession = async () => {
565
- apiClient.restoreCachedUser(null);
566
- return null;
567
- };
568
- apiClient.getAccountProfile = async () => {
569
- profileRequests += 1;
570
- throw new ApiRequestError("Unauthorized", 401);
571
- };
572
-
573
- await controller.refreshSession();
574
-
575
- expect(profileRequests).toBe(1);
576
- expect(apiClient.getSessionToken()).toBeNull();
577
- expect(apiClient.getCurrentUser()).toBeNull();
578
- expect(controller.getSnapshot().user).toBeNull();
579
- controller.dispose();
580
- });
581
-
582
- test("downgrades stale verification state when protected chat rejects it", async () => {
583
- const persistence = new MemoryPersistence();
584
- const controller = createController();
585
-
586
- persistSession(persistence, { emailVerified: true });
587
-
588
- controller.attachPersistence(persistence);
589
- apiClient.getSession = async () => {
590
- apiClient.restoreCachedUser(null);
591
- return null;
592
- };
593
- apiClient.getChatState = async () => {
594
- throw new ApiRequestError("Email verification required", 403);
595
- };
596
-
597
- await controller.refreshSession();
598
-
599
- expect(apiClient.getSessionToken()).toBe("token-123");
600
- expect(apiClient.getCurrentUser()?.emailVerified).toBe(false);
601
- expect(controller.getSnapshot().user?.emailVerified).toBe(false);
602
- expect(persistence.getState<{
603
- sessionToken: string;
604
- user: { id: string; username: string; emailVerified: boolean };
605
- }>("session", { schemaVersion: 1 })?.user.emailVerified).toBe(false);
606
- controller.dispose();
607
- });
608
-
609
- test("does not let a stale validation failure clear a replacement session", async () => {
610
- const persistence = new MemoryPersistence();
611
- const controller = createController();
612
- let rejectProbe: ((error: Error) => void) | null = null;
613
- let markProbeStarted: (() => void) | null = null;
614
- const probeStarted = new Promise<void>((resolve) => {
615
- markProbeStarted = resolve;
616
- });
617
-
618
- persistence.setState("session", {
619
- sessionToken: "old-token",
620
- user: { id: "u1", username: "vince", emailVerified: true },
621
- }, { schemaVersion: 1 });
622
-
623
- controller.attachPersistence(persistence);
624
- apiClient.getSession = async () => {
625
- apiClient.restoreCachedUser(null);
626
- return null;
627
- };
628
- apiClient.getChatState = () => new Promise((_, reject) => {
629
- rejectProbe = reject;
630
- markProbeStarted?.();
631
- });
632
-
633
- const refresh = controller.refreshSession();
634
- await probeStarted;
635
- controller.adoptSession("new-token", {
636
- id: "u2",
637
- username: "mara",
638
- emailVerified: true,
639
- });
640
- rejectProbe?.(new ApiRequestError("Unauthorized", 401));
641
- await refresh;
642
-
643
- expect(apiClient.getSessionToken()).toBe("new-token");
644
- expect(apiClient.getCurrentUser()?.id).toBe("u2");
645
- expect(controller.getSnapshot().user?.id).toBe("u2");
646
- expect(persistence.getState<{
647
- sessionToken: string;
648
- user: { id: string };
649
- }>("session", { schemaVersion: 1 })).toMatchObject({
650
- sessionToken: "new-token",
651
- user: { id: "u2" },
652
- });
653
- controller.dispose();
654
- });
655
-
656
- test("does not apply stale chat state after a replacement session", async () => {
657
- const persistence = new MemoryPersistence();
658
- const controller = createController();
659
- let resolveProbe: ((state: ChatStateResponse) => void) | null = null;
660
- let markProbeStarted: (() => void) | null = null;
661
- const probeStarted = new Promise<void>((resolve) => {
662
- markProbeStarted = resolve;
663
- });
664
- const oldDirectChannel: ChatChannel = {
665
- id: "dm:old-account",
666
- name: "old-account",
667
- kind: "direct",
668
- created_at: "2026-03-28T00:00:00.000Z",
669
- };
670
-
671
- persistence.setState("session", {
672
- sessionToken: "old-token",
673
- user: { id: "u1", username: "vince", emailVerified: true },
674
- }, { schemaVersion: 1 });
675
-
676
- controller.attachPersistence(persistence);
677
- apiClient.getSession = async () => {
678
- apiClient.restoreCachedUser(null);
679
- return null;
680
- };
681
- apiClient.getChatState = () => new Promise<ChatStateResponse>((resolve) => {
682
- resolveProbe = resolve;
683
- markProbeStarted?.();
684
- });
685
-
686
- const refresh = controller.refreshSession();
687
- await probeStarted;
688
- controller.adoptSession("new-token", {
689
- id: "u2",
690
- username: "mara",
691
- emailVerified: true,
692
- });
693
- resolveProbe?.({
694
- channels: [...SERVER_CHAT_CHANNELS, oldDirectChannel],
695
- onlineCount: 0,
696
- channelStates: [],
697
- notifications: [],
698
- });
699
- await refresh;
700
-
701
- expect(apiClient.getSessionToken()).toBe("new-token");
702
- expect(controller.getSnapshot().user?.id).toBe("u2");
703
- expect(controller.getChannels()).not.toContainEqual(oldDirectChannel);
704
- controller.dispose();
705
- });
706
-
707
- test("revalidates a persisted session after an offline validation probe", async () => {
708
- jest.useFakeTimers();
709
- const persistence = new MemoryPersistence();
710
- const controller = createController();
711
-
712
- persistSession(persistence, { emailVerified: true });
713
-
714
- controller.attachPersistence(persistence);
715
- apiClient.getSession = async () => {
716
- apiClient.restoreCachedUser(null);
717
- return null;
718
- };
719
- apiClient.getChatState = async () => {
720
- throw new Error("network down");
721
- };
722
-
723
- await controller.refreshSession();
724
-
725
- expect(apiClient.getSessionToken()).toBe("token-123");
726
- expect(apiClient.getCurrentUser()?.id).toBe("u1");
727
- expect(controller.getSnapshot().user?.id).toBe("u1");
728
- expect((controller as any).realtime.sessionRetryTimer).not.toBeNull();
729
-
730
- apiClient.getChatState = async () => {
731
- throw new ApiRequestError("Unauthorized", 401);
732
- };
733
- jest.advanceTimersByTime(SESSION_RETRY_MS);
734
- await controller.refreshSession();
735
-
736
- expect(apiClient.getSessionToken()).toBeNull();
737
- expect(controller.getSnapshot().user).toBeNull();
738
- expect((controller as any).realtime.sessionRetryTimer).toBeNull();
739
- controller.dispose();
740
- jest.useRealTimers();
741
- });
742
-
743
- test("signs out when get-session returns no user and no token is stored", async () => {
744
- const persistence = new MemoryPersistence();
745
- const controller = createController();
746
-
747
- persistence.setState("session", {
748
- sessionToken: null,
749
- user: { id: "u1", username: "vince", emailVerified: true },
750
- }, { schemaVersion: 1 });
751
-
752
- controller.attachPersistence(persistence);
753
- apiClient.getSession = async () => null;
754
-
755
- await controller.refreshSession();
756
-
757
- expect(apiClient.getSessionToken()).toBeNull();
758
- expect(controller.getSnapshot().user).toBeNull();
759
- controller.dispose();
760
- });
761
-
762
- test("keeps the cached session when session refresh fails transiently", async () => {
763
- const persistence = new MemoryPersistence();
764
- const controller = createController();
765
-
766
- persistSession(persistence, { emailVerified: true });
767
-
768
- controller.attachPersistence(persistence);
769
- apiClient.getSession = async () => {
770
- throw new Error("network down");
771
- };
772
-
773
- await expect(controller.refreshSession()).rejects.toThrow("network down");
774
- expect(apiClient.getSessionToken()).toBe("token-123");
775
- expect(persistence.getState<{
776
- sessionToken: string;
777
- user: { id: string; username: string; emailVerified: boolean };
778
- }>("session", { schemaVersion: 1 })).toEqual({
779
- sessionToken: "token-123",
780
- user: { id: "u1", username: "vince", emailVerified: true },
781
- });
782
- expect(controller.getSnapshot().user).toEqual({
783
- id: "u1",
784
- username: "vince",
785
- emailVerified: true,
786
- });
787
- expect((controller as any).realtime.sessionRetryTimer).not.toBeNull();
788
- controller.dispose();
789
- });
790
-
791
- test("refreshes the public transcript without requiring a session", async () => {
792
- const persistence = new MemoryPersistence();
793
- const controller = createController();
794
- const message: ChatMessage = chatMessage({
795
- id: "m1",
796
- content: "hello from the lobby",
797
- createdAt: "2026-03-28T00:00:00.000Z",
798
- });
799
-
800
- controller.attachPersistence(persistence);
801
- apiClient.getMessages = async () => [message];
802
-
803
- await controller.refreshMessages();
804
-
805
- expect(controller.getSnapshot().messages).toEqual([message]);
806
- expect(persistence.getResource(TRANSCRIPT_KIND, TRANSCRIPT_KEY, {
807
- sourceKey: TRANSCRIPT_SOURCE,
808
- schemaVersion: TRANSCRIPT_SCHEMA_VERSION,
809
- })?.value).toEqual({
810
- messages: [message],
811
- });
812
- });
813
-
814
- test("keeps per-channel drafts and transcripts isolated", () => {
815
- const persistence = new MemoryPersistence();
816
- const controller = createController();
817
- const everyoneMessage: ChatMessage = chatMessage({
818
- id: "m1",
819
- content: "general",
820
- createdAt: "2026-03-28T00:00:00.000Z",
821
- });
822
- const optionsMessage: ChatMessage = chatMessage({
823
- id: "m2",
824
- channelId: "options",
825
- content: "options note",
826
- createdAt: "2026-03-28T00:01:00.000Z",
827
- user: { id: "u2", username: "bob", displayName: "Bob" },
828
- });
829
-
830
- persistence.setState("channel:everyone", {
831
- draft: "general draft",
832
- replyToId: null,
833
- lastCursor: "m1",
834
- lastViewedMessageId: "m1",
835
- }, { schemaVersion: 1 });
836
- persistence.setState("channel:options", {
837
- draft: "options draft",
838
- replyToId: null,
839
- lastCursor: "m2",
840
- lastViewedMessageId: "m2",
841
- }, { schemaVersion: 1 });
842
- persistence.setResource(TRANSCRIPT_KIND, "everyone", { messages: [everyoneMessage] }, {
843
- sourceKey: TRANSCRIPT_SOURCE,
844
- schemaVersion: TRANSCRIPT_SCHEMA_VERSION,
845
- cachePolicy: { staleMs: 1_000, expireMs: 2_000 },
846
- });
847
- persistence.setResource(TRANSCRIPT_KIND, "options", { messages: [optionsMessage] }, {
848
- sourceKey: TRANSCRIPT_SOURCE,
849
- schemaVersion: TRANSCRIPT_SCHEMA_VERSION,
850
- cachePolicy: { staleMs: 1_000, expireMs: 2_000 },
851
- });
852
-
853
- controller.attachPersistence(persistence);
854
- controller.setChannelDraft("options", "updated options");
855
-
856
- expect(controller.getSnapshot().messages.map((entry) => entry.content)).toEqual(["general"]);
857
- expect(controller.getSnapshot().draft).toBe("general draft");
858
- expect(controller.getSnapshot("options").messages.map((entry) => entry.content)).toEqual(["options note"]);
859
- expect(controller.getSnapshot("options").draft).toBe("updated options");
860
- });
861
-
862
- test("stores the latest message id as the incremental cursor", async () => {
863
- const persistence = new MemoryPersistence();
864
- const controller = createController();
865
- const initial: ChatMessage = chatMessage({
866
- id: "m1",
867
- content: "hello",
868
- createdAt: "2026-03-28T00:00:00.000Z",
869
- });
870
- const next: ChatMessage = chatMessage({
871
- id: "m2",
872
- content: "new message",
873
- createdAt: "2026-03-28T00:01:00.000Z",
874
- user: { id: "u2", username: "bob", displayName: "Bob" },
875
- });
876
-
877
- persistence.setState("channel:everyone", {
878
- draft: "",
879
- replyToId: null,
880
- lastCursor: "m1",
881
- lastViewedMessageId: "m1",
882
- }, { schemaVersion: 1 });
883
- persistence.setResource(TRANSCRIPT_KIND, TRANSCRIPT_KEY, {
884
- messages: [initial],
885
- }, {
886
- sourceKey: TRANSCRIPT_SOURCE,
887
- schemaVersion: TRANSCRIPT_SCHEMA_VERSION,
888
- cachePolicy: { staleMs: 1_000, expireMs: 2_000 },
889
- });
890
-
891
- controller.attachPersistence(persistence);
892
-
893
- const calls: Array<{ channelId: string; opts?: { after?: string; before?: string; limit?: number } }> = [];
894
- apiClient.getMessages = async (channelId, opts) => {
895
- calls.push({ channelId, opts });
896
- if (!opts?.after) return [initial, next];
897
- return opts.after === "m1" ? [next] : [];
898
- };
899
-
900
- await controller.refreshMessages();
901
-
902
- expect(calls[0]?.opts?.after).toBeUndefined();
903
- expect(controller.getSnapshot().messages.map((entry) => entry.id)).toEqual(["m1", "m2"]);
904
- expect(persistence.getState<{ lastCursor: string }>("channel:everyone", { schemaVersion: 1 })).toMatchObject({
905
- lastCursor: "m2",
906
- });
907
-
908
- await controller.refreshMessages();
909
-
910
- expect(calls[1]?.opts?.after).toBe("m2");
911
- });
912
-
913
- test("recovers a message the cursor already moved past", async () => {
914
- const persistence = new MemoryPersistence();
915
- const controller = createController();
916
- const asked: ChatMessage = chatMessage({
917
- id: "m1",
918
- content: "why is the chart glitching",
919
- createdAt: "2026-03-28T00:00:00.000Z",
920
- });
921
- const missed: ChatMessage = chatMessage({
922
- id: "m2",
923
- content: "charts open with GP",
924
- replyToId: "m1",
925
- createdAt: "2026-03-28T00:01:00.000Z",
926
- user: { id: "u2", username: "gloombot", displayName: "Gloombot" },
927
- });
928
- const acknowledged: ChatMessage = chatMessage({
929
- id: "m3",
930
- content: "got it",
931
- createdAt: "2026-03-28T00:02:00.000Z",
932
- });
933
-
934
- // The cursor already sits on m3, so an incremental fetch can never ask for
935
- // m2 again even though the server still has it.
936
- persistence.setState("channel:everyone", {
937
- draft: "",
938
- replyToId: null,
939
- lastCursor: "m3",
940
- lastViewedMessageId: "m3",
941
- }, { schemaVersion: 1 });
942
- persistence.setResource(TRANSCRIPT_KIND, TRANSCRIPT_KEY, {
943
- messages: [asked, acknowledged],
944
- }, {
945
- sourceKey: TRANSCRIPT_SOURCE,
946
- schemaVersion: TRANSCRIPT_SCHEMA_VERSION,
947
- cachePolicy: { staleMs: 1_000, expireMs: 2_000 },
948
- });
949
-
950
- controller.attachPersistence(persistence);
951
-
952
- apiClient.getMessages = async (_channelId, opts) => (
953
- opts?.after ? [] : [asked, missed, acknowledged]
954
- );
955
-
956
- await controller.refreshMessages();
957
-
958
- expect(controller.getSnapshot().messages.map((entry) => entry.id)).toEqual(["m1", "m2", "m3"]);
959
- });
960
-
961
- test("hydrates missing transcript cache without marking history unread", async () => {
962
- const persistence = new MemoryPersistence();
963
- const controller = createController();
964
- const notifications: AppNotificationRequest[] = [];
965
- const history: ChatMessage = chatMessage({
966
- id: "m1",
967
- content: "already seen",
968
- createdAt: "2026-03-28T00:00:00.000Z",
969
- user: { id: "u2", username: "bob", displayName: "Bob" },
970
- });
971
-
972
- persistSession(persistence, { emailVerified: true });
973
- persistence.setState("channel:everyone", {
974
- draft: "",
975
- replyToId: null,
976
- lastCursor: "m1",
977
- lastViewedMessageId: "m1",
978
- }, { schemaVersion: 1 });
979
-
980
- controller.setNotifier((notification) => {
981
- notifications.push(notification);
982
- });
983
- controller.attachPersistence(persistence);
984
-
985
- const calls: Array<{ channelId: string; opts?: { after?: string; before?: string; limit?: number } }> = [];
986
- apiClient.getMessages = async (channelId, opts) => {
987
- calls.push({ channelId, opts });
988
- return opts?.after ? [] : [history];
989
- };
990
-
991
- await controller.refreshMessages();
992
-
993
- expect(calls).toEqual([{
994
- channelId: "everyone",
995
- opts: { limit: 50, after: undefined },
996
- }]);
997
- expect(controller.getSnapshot().messages).toEqual([history]);
998
- expect(controller.getSnapshot().channelStates.find((entry) => entry.channelId === "everyone")).toMatchObject({
999
- unreadCount: 0,
1000
- });
1001
- expect(notifications).toEqual([]);
1002
- });
1003
-
1004
- test("backfills from cached transcript when persisted cursor is ahead of the cache", async () => {
1005
- const persistence = new MemoryPersistence();
1006
- const controller = createController();
1007
- const cached: ChatMessage = chatMessage({
1008
- id: "m1",
1009
- content: "cached",
1010
- createdAt: "2026-03-28T00:00:00.000Z",
1011
- });
1012
- const fresh: ChatMessage = chatMessage({
1013
- id: "m2",
1014
- content: "fresh",
1015
- createdAt: "2026-03-28T00:01:00.000Z",
1016
- user: { id: "u2", username: "bob", displayName: "Bob" },
1017
- });
1018
-
1019
- persistence.setState("channel:everyone", {
1020
- draft: "",
1021
- replyToId: null,
1022
- lastCursor: "m99",
1023
- lastViewedMessageId: "m1",
1024
- }, { schemaVersion: 1 });
1025
- persistence.setResource(TRANSCRIPT_KIND, TRANSCRIPT_KEY, {
1026
- messages: [cached],
1027
- }, {
1028
- sourceKey: TRANSCRIPT_SOURCE,
1029
- schemaVersion: TRANSCRIPT_SCHEMA_VERSION,
1030
- cachePolicy: { staleMs: 1_000, expireMs: 2_000 },
1031
- });
1032
-
1033
- controller.attachPersistence(persistence);
1034
-
1035
- const calls: Array<{ channelId: string; opts?: { after?: string; before?: string; limit?: number } }> = [];
1036
- apiClient.getMessages = async (channelId, opts) => {
1037
- calls.push({ channelId, opts });
1038
- return opts?.after ? [] : [cached, fresh];
1039
- };
1040
-
1041
- await controller.refreshMessages();
1042
-
1043
- expect(calls[0]?.opts?.after).toBeUndefined();
1044
- expect(controller.getSnapshot().messages.map((entry) => entry.id)).toEqual(["m1", "m2"]);
1045
- expect(persistence.getState<{ lastCursor: string }>("channel:everyone", { schemaVersion: 1 })).toMatchObject({
1046
- lastCursor: "m2",
1047
- });
1048
-
1049
- await controller.refreshMessages();
1050
-
1051
- // The stale m99 cursor never reaches the server.
1052
- expect(calls[1]?.opts?.after).toBe("m2");
1053
- });
1054
-
1055
- test("shows a pending message immediately and replaces it when the send succeeds", async () => {
1056
- const persistence = new MemoryPersistence();
1057
- const controller = createController();
1058
- const replyTarget: ChatMessage = chatMessage({
1059
- id: "m1",
1060
- content: "first",
1061
- createdAt: "2026-03-28T00:00:00.000Z",
1062
- user: { id: "u2", username: "bob", displayName: "Bob" },
1063
- });
1064
- const sentMessage: ChatMessage = chatMessage({
1065
- id: "m2",
1066
- content: "hello",
1067
- replyToId: "m1",
1068
- createdAt: "2026-03-28T00:01:00.000Z",
1069
- replyTo: { content: "first", user: { username: "bob" } },
1070
- });
1071
-
1072
- persistSession(persistence, { emailVerified: true });
1073
- persistence.setState("channel:everyone", {
1074
- draft: "hello",
1075
- replyToId: "m1",
1076
- lastCursor: "m1",
1077
- lastViewedMessageId: "m1",
1078
- }, { schemaVersion: 1 });
1079
- persistence.setResource(TRANSCRIPT_KIND, TRANSCRIPT_KEY, {
1080
- messages: [replyTarget],
1081
- }, {
1082
- sourceKey: TRANSCRIPT_SOURCE,
1083
- schemaVersion: TRANSCRIPT_SCHEMA_VERSION,
1084
- cachePolicy: { staleMs: 1_000, expireMs: 2_000 },
1085
- });
1086
-
1087
- controller.attachPersistence(persistence);
1088
-
1089
- let resolveSend: (message: ChatMessage) => void = () => {
1090
- throw new Error("send resolver was not captured");
1091
- };
1092
- apiClient.connectChannel = () => ({
1093
- send: () => new Promise<ChatMessage>((resolve) => {
1094
- resolveSend = resolve;
1095
- }),
1096
- close: () => {},
1097
- });
1098
-
1099
- controller.send("hello", "m1");
1100
-
1101
- let snapshot = controller.getSnapshot();
1102
- expect(snapshot.draft).toBe("");
1103
- expect(snapshot.replyToId).toBeNull();
1104
- expect(snapshot.messages.map((message) => message.id)).toEqual(["m1", snapshot.messages[1]!.id]);
1105
- expect(snapshot.messages[1]).toMatchObject({
1106
- content: "hello",
1107
- replyToId: "m1",
1108
- clientStatus: "sending",
1109
- replyTo: { content: "first", user: { username: "bob" } },
1110
- });
1111
-
1112
- resolveSend?.(sentMessage);
1113
- await flushMicrotasks();
1114
-
1115
- snapshot = controller.getSnapshot();
1116
- expect(snapshot.messages).toEqual([replyTarget, sentMessage]);
1117
- });
1118
-
1119
- test("sends one idempotency key while the same message is pending", () => {
1120
- const persistence = new MemoryPersistence();
1121
- const controller = createController();
1122
- const clientMessageIds: Array<string | undefined> = [];
1123
-
1124
- persistSession(persistence, { emailVerified: true });
1125
-
1126
- controller.attachPersistence(persistence);
1127
- apiClient.getMessages = async () => [];
1128
- apiClient.connectChannel = () => ({
1129
- send: (_content, _replyToId, clientMessageId) => {
1130
- clientMessageIds.push(clientMessageId);
1131
- return new Promise<ChatMessage>(() => {});
1132
- },
1133
- close: () => {},
1134
- });
1135
-
1136
- const detachFirstView = controller.attachChannelView("everyone");
1137
- const detachSecondView = controller.attachChannelView("everyone");
1138
-
1139
- controller.sendToChannel("everyone", " hello ");
1140
- controller.sendToChannel("everyone", "hello");
1141
-
1142
- expect(clientMessageIds).toHaveLength(1);
1143
- expect(clientMessageIds[0]).toBeTruthy();
1144
- expect(controller.getSnapshot("everyone").messages).toHaveLength(1);
1145
-
1146
- detachFirstView();
1147
- detachSecondView();
1148
- });
1149
-
1150
- test("edits the latest message from the current user", async () => {
1151
- const persistence = new MemoryPersistence();
1152
- const controller = createController();
1153
- const original: ChatMessage = chatMessage({
1154
- id: "m1",
1155
- content: "helo",
1156
- createdAt: recentChatTimestamp(),
1157
- });
1158
-
1159
- persistSession(persistence, { emailVerified: true });
1160
- persistence.setResource(TRANSCRIPT_KIND, TRANSCRIPT_KEY, {
1161
- messages: [original],
1162
- }, {
1163
- sourceKey: TRANSCRIPT_SOURCE,
1164
- schemaVersion: TRANSCRIPT_SCHEMA_VERSION,
1165
- cachePolicy: { staleMs: 1_000, expireMs: 2_000 },
1166
- });
1167
- controller.attachPersistence(persistence);
1168
- apiClient.editMessage = async (channelId, messageId, content) => ({
1169
- ...original,
1170
- channelId,
1171
- id: messageId,
1172
- content,
1173
- editedAt: "2026-03-28T00:01:00.000Z",
1174
- });
1175
-
1176
- await expect(controller.editChannelMessage("everyone", "m1", "hello")).resolves.toBe(true);
1177
-
1178
- const [edited] = controller.getSnapshot().messages;
1179
- expect(edited).toMatchObject({
1180
- id: "m1",
1181
- content: "hello",
1182
- editedAt: "2026-03-28T00:01:00.000Z",
1183
- });
1184
- });
1185
-
1186
- test("refuses to edit after the edit window expires", async () => {
1187
- const persistence = new MemoryPersistence();
1188
- const controller = createController();
1189
- const notifications: AppNotificationRequest[] = [];
1190
- const original: ChatMessage = chatMessage({
1191
- id: "m1",
1192
- content: "old typo",
1193
- createdAt: recentChatTimestamp(16 * 60_000),
1194
- });
1195
-
1196
- persistSession(persistence, { emailVerified: true });
1197
- persistence.setResource(TRANSCRIPT_KIND, TRANSCRIPT_KEY, {
1198
- messages: [original],
1199
- }, {
1200
- sourceKey: TRANSCRIPT_SOURCE,
1201
- schemaVersion: TRANSCRIPT_SCHEMA_VERSION,
1202
- cachePolicy: { staleMs: 1_000, expireMs: 2_000 },
1203
- });
1204
- controller.setNotifier((notification) => notifications.push(notification));
1205
- controller.attachPersistence(persistence);
1206
- apiClient.editMessage = async () => {
1207
- throw new Error("should not call server");
1208
- };
1209
-
1210
- await expect(controller.editChannelMessage("everyone", "m1", "old fix")).resolves.toBe(false);
1211
-
1212
- expect(controller.getSnapshot().messages[0]?.content).toBe("old typo");
1213
- expect(notifications).toEqual([{ body: "Messages can only be edited within 15 minutes.", type: "error" }]);
1214
- });
1215
-
1216
- test("refuses to edit an older message from the current user", async () => {
1217
- const persistence = new MemoryPersistence();
1218
- const controller = createController();
1219
- const notifications: AppNotificationRequest[] = [];
1220
- const messages: ChatMessage[] = [
1221
- chatMessage({
1222
- id: "m1",
1223
- content: "older",
1224
- createdAt: "2026-03-28T00:00:00.000Z",
1225
- }),
1226
- chatMessage({
1227
- id: "m2",
1228
- content: "newer",
1229
- createdAt: "2026-03-28T00:01:00.000Z",
1230
- }),
1231
- ];
1232
-
1233
- persistSession(persistence, { emailVerified: true });
1234
- persistence.setResource(TRANSCRIPT_KIND, TRANSCRIPT_KEY, {
1235
- messages,
1236
- }, {
1237
- sourceKey: TRANSCRIPT_SOURCE,
1238
- schemaVersion: TRANSCRIPT_SCHEMA_VERSION,
1239
- cachePolicy: { staleMs: 1_000, expireMs: 2_000 },
1240
- });
1241
- controller.setNotifier((notification) => notifications.push(notification));
1242
- controller.attachPersistence(persistence);
1243
- apiClient.editMessage = async () => {
1244
- throw new Error("should not call server");
1245
- };
1246
-
1247
- await expect(controller.editChannelMessage("everyone", "m1", "edited")).resolves.toBe(false);
1248
-
1249
- expect(controller.getSnapshot().messages.map((message) => message.content)).toEqual(["older", "newer"]);
1250
- expect(notifications).toEqual([{ body: "Only your latest sent message can be edited.", type: "error" }]);
1251
- });
1252
-
1253
- test("marks a pending message as failed when sending errors", async () => {
1254
- const persistence = new MemoryPersistence();
1255
- const controller = createController();
1256
- const notifications: AppNotificationRequest[] = [];
1257
-
1258
- persistSession(persistence, { emailVerified: true });
1259
-
1260
- controller.setNotifier((notification) => {
1261
- notifications.push(notification);
1262
- });
1263
- controller.attachPersistence(persistence);
1264
-
1265
- apiClient.connectChannel = () => ({
1266
- send: async () => {
1267
- throw new Error("server offline");
1268
- },
1269
- close: () => {},
1270
- });
1271
-
1272
- controller.send("hello");
1273
- await flushMicrotasks();
1274
-
1275
- const snapshot = controller.getSnapshot();
1276
- expect(snapshot.messages).toHaveLength(1);
1277
- expect(snapshot.messages[0]).toMatchObject({
1278
- content: "hello",
1279
- clientStatus: "failed",
1280
- clientError: "server offline",
1281
- });
1282
- expect(notifications).toEqual([{ body: "server offline", type: "error" }]);
1283
- });
1284
-
1285
- test("tracks unread mentions from fetched messages without issuing local notifications", () => {
1286
- const persistence = new MemoryPersistence();
1287
- const controller = createController();
1288
- const notifications: AppNotificationRequest[] = [];
1289
- const message: ChatMessage = chatMessage({
1290
- id: "m1",
1291
- content: "hey @Vince can you take a look?",
1292
- createdAt: "2026-03-28T00:00:00.000Z",
1293
- user: { id: "u2", username: "bob", displayName: "Bob" },
1294
- });
1295
-
1296
- persistSession(persistence, { emailVerified: true });
1297
-
1298
- controller.setNotifier((notification) => {
1299
- notifications.push(notification);
1300
- });
1301
- controller.attachPersistence(persistence);
1302
-
1303
- (controller as any).mergeMessages([message]);
1304
-
1305
- expect(controller.getSnapshot().unreadMentionCount).toBe(1);
1306
- expect(notifications).toEqual([]);
1307
- expect(persistence.getState<{ lastCursor: string | null; lastViewedMessageId: string | null }>("channel:everyone", { schemaVersion: 1 })).toMatchObject({
1308
- lastCursor: "m1",
1309
- lastViewedMessageId: null,
1310
- });
1311
- });
1312
-
1313
- test("delivers background notifications while the focused chat stays unread", async () => {
1314
- const persistence = new MemoryPersistence();
1315
- const controller = createController();
1316
- const notifications: AppNotificationRequest[] = [];
1317
- const deliveredIds: string[][] = [];
1318
-
1319
- persistSession(persistence, { emailVerified: true });
1320
-
1321
- controller.setNotifier((notification) => {
1322
- notifications.push(notification);
1323
- return { toastVisible: false, desktopRequested: true };
1324
- });
1325
- apiClient.markChatNotificationsDelivered = async (ids) => {
1326
- deliveredIds.push(ids);
1327
- return { delivered: ids.length };
1328
- };
1329
- controller.attachPersistence(persistence);
1330
- const detachView = controller.attachView(true);
1331
- controller.setAppActive(false);
1332
-
1333
- (controller as any).handleChatNotification(mentionNotification());
1334
-
1335
- expect(notifications).toEqual([{
1336
- title: "#everyone",
1337
- body: "@bob mentioned you: hey @vince",
1338
- type: "info",
1339
- desktop: "when-inactive",
1340
- }]);
1341
- expect(controller.getSnapshot().unreadMentionCount).toBe(1);
1342
- expect(deliveredIds).toEqual([["n1"]]);
1343
-
1344
- controller.setAppActive(true);
1345
- await flushMicrotasks();
1346
- await flushMicrotasks();
1347
- expect(controller.getSnapshot().unreadMentionCount).toBe(0);
1348
- detachView();
1349
- });
1350
-
1351
- test("keeps undeliverable background notifications pending for email fallback", () => {
1352
- const persistence = new MemoryPersistence();
1353
- const controller = createController();
1354
- const deliveredIds: string[][] = [];
1355
- let desktopAvailable = false;
1356
- let presentationCount = 0;
1357
-
1358
- persistSession(persistence, { emailVerified: true });
1359
- controller.setNotifier(() => {
1360
- presentationCount += 1;
1361
- return { toastVisible: false, desktopRequested: desktopAvailable };
1362
- });
1363
- apiClient.markChatNotificationsDelivered = async (ids) => {
1364
- deliveredIds.push(ids);
1365
- return { delivered: ids.length };
1366
- };
1367
- controller.attachPersistence(persistence);
1368
- controller.setAppActive(false);
1369
-
1370
- const notification = mentionNotification({ type: "reply" });
1371
- (controller as any).handleChatNotification(notification);
1372
-
1373
- expect(presentationCount).toBe(1);
1374
- expect(deliveredIds).toEqual([]);
1375
-
1376
- desktopAvailable = true;
1377
- (controller as any).handleChatNotification({ ...notification, id: "n2" });
1378
-
1379
- expect(presentationCount).toBe(2);
1380
- expect(deliveredIds).toEqual([["n2"]]);
1381
- });
1382
-
1383
- test("marks mentions viewed when a chat view opens", () => {
1384
- const persistence = new MemoryPersistence();
1385
- const controller = createController();
1386
- const notifications: AppNotificationRequest[] = [];
1387
- const message: ChatMessage = chatMessage({
1388
- id: "m1",
1389
- content: "hey @vince",
1390
- createdAt: "2026-03-28T00:00:00.000Z",
1391
- user: { id: "u2", username: "bob", displayName: "Bob" },
1392
- });
1393
-
1394
- persistSession(persistence, { emailVerified: true });
1395
-
1396
- controller.setNotifier((notification) => {
1397
- notifications.push(notification);
1398
- });
1399
- controller.attachPersistence(persistence);
1400
-
1401
- (controller as any).mergeMessages([message]);
1402
-
1403
- expect(controller.getSnapshot().unreadMentionCount).toBe(1);
1404
-
1405
- const detachView = controller.attachView();
1406
-
1407
- expect(controller.getSnapshot().unreadMentionCount).toBe(0);
1408
- expect(notifications).toEqual([]);
1409
- expect(persistence.getState<{ lastViewedMessageId: string | null }>("channel:everyone", { schemaVersion: 1 })).toMatchObject({
1410
- lastViewedMessageId: "m1",
1411
- });
1412
- detachView();
1413
- });
1414
-
1415
- test("keeps focused foreground notifications read without presenting an alert", () => {
1416
- const persistence = new MemoryPersistence();
1417
- const controller = createController();
1418
- const notifications: AppNotificationRequest[] = [];
1419
- const deliveredIds: string[][] = [];
1420
-
1421
- persistSession(persistence, { emailVerified: true });
1422
-
1423
- controller.setNotifier((notification) => {
1424
- notifications.push(notification);
1425
- });
1426
- apiClient.markChatNotificationsDelivered = async (ids) => {
1427
- deliveredIds.push(ids);
1428
- return { delivered: ids.length };
1429
- };
1430
- controller.attachPersistence(persistence);
1431
- const detachView = controller.attachView(true);
1432
-
1433
- (controller as any).handleChatNotification(mentionNotification());
1434
-
1435
- expect(controller.getSnapshot().unreadMentionCount).toBe(0);
1436
- expect(notifications).toEqual([]);
1437
- expect(deliveredIds).toEqual([["n1"]]);
1438
- expect(persistence.getState<{ lastViewedMessageId: string | null }>("channel:everyone", { schemaVersion: 1 })).toMatchObject({
1439
- lastViewedMessageId: "m1",
1440
- });
1441
-
1442
- detachView();
1443
- });
1444
-
1445
- test("keeps an unfocused foreground chat unread while presenting an in-app alert", () => {
1446
- const persistence = new MemoryPersistence();
1447
- const controller = createController();
1448
- const notifications: AppNotificationRequest[] = [];
1449
- const deliveredIds: string[][] = [];
1450
-
1451
- persistSession(persistence, { emailVerified: true });
1452
- controller.setNotifier((notification) => {
1453
- notifications.push(notification);
1454
- return { toastVisible: true, desktopRequested: false };
1455
- });
1456
- apiClient.markChatNotificationsDelivered = async (ids) => {
1457
- deliveredIds.push(ids);
1458
- return { delivered: ids.length };
1459
- };
1460
- controller.attachPersistence(persistence);
1461
- const detachUnfocusedView = controller.attachView(false);
1462
-
1463
- (controller as any).handleChatNotification(mentionNotification());
1464
-
1465
- expect(notifications).toHaveLength(1);
1466
- expect(controller.getSnapshot().unreadMentionCount).toBe(1);
1467
- expect(deliveredIds).toEqual([["n1"]]);
1468
-
1469
- detachUnfocusedView();
1470
- const detachFocusedView = controller.attachView(true);
1471
- expect(controller.getSnapshot().unreadMentionCount).toBe(0);
1472
- detachFocusedView();
1473
- });
1474
-
1475
- test("loads server chat state, pending reply notifications, and acks delivery", async () => {
1476
- const persistence = new MemoryPersistence();
1477
- const controller = createController();
1478
- const notifications: AppNotificationRequest[] = [];
1479
- const deliveredIds: string[][] = [];
1480
-
1481
- persistSession(persistence, { emailVerified: true });
1482
- apiClient.getSession = async () => ({
1483
- id: "u1",
1484
- name: "Vince",
1485
- email: "vince@example.com",
1486
- username: "vince",
1487
- emailVerified: true,
1488
- image: null,
1489
- createdAt: "2026-01-01T00:00:00.000Z",
1490
- updatedAt: "2026-01-01T00:00:00.000Z",
1491
- });
1492
- apiClient.getChatState = async () => ({
1493
- channels: SERVER_CHAT_CHANNELS,
1494
- onlineCount: 7,
1495
- channelStates: [{
1496
- channelId: "options",
1497
- notificationsEnabled: true,
1498
- lastReadMessageId: "m1",
1499
- unreadCount: 3,
1500
- }],
1501
- notifications: [{
1502
- id: "n1",
1503
- type: "reply",
1504
- channelId: "options",
1505
- messageId: "m2",
1506
- createdAt: "2026-03-28T00:02:00.000Z",
1507
- message: chatMessage({
1508
- id: "m2",
1509
- channelId: "options",
1510
- content: "answering you",
1511
- replyToId: "m1",
1512
- createdAt: "2026-03-28T00:02:00.000Z",
1513
- user: { id: "u2", username: "bob", displayName: "Bob" },
1514
- replyTo: { content: "question", user: { id: "u1", username: "vince" } },
1515
- }),
1516
- }],
1517
- });
1518
- apiClient.markChatNotificationsDelivered = async (ids) => {
1519
- deliveredIds.push(ids);
1520
- return { delivered: ids.length };
1521
- };
1522
- apiClient.connectChannel = () => ({
1523
- send: async () => {
1524
- throw new Error("not implemented");
1525
- },
1526
- close: () => {},
1527
- });
1528
-
1529
- controller.setNotifier((notification) => {
1530
- notifications.push(notification);
1531
- return { toastVisible: true, desktopRequested: false };
1532
- });
1533
- controller.attachPersistence(persistence);
1534
-
1535
- await controller.refreshSession();
1536
-
1537
- expect(controller.getSnapshot("options").onlineCount).toBe(7);
1538
- expect(controller.getSnapshot("options").channelStates.find((entry) => entry.channelId === "options")).toMatchObject({
1539
- notificationsEnabled: true,
1540
- unreadCount: 3,
1541
- });
1542
- expect(notifications).toEqual([{
1543
- title: "#options",
1544
- body: "@bob replied to you: answering you",
1545
- type: "info",
1546
- desktop: "when-inactive",
1547
- }]);
1548
- expect(deliveredIds).toEqual([["n1"]]);
1549
- });
1550
-
1551
- test("toggles channel notifications optimistically and keeps the channel connected", async () => {
1552
- const persistence = new MemoryPersistence();
1553
- const controller = createController();
1554
- const connectedChannels: string[] = [];
1555
-
1556
- persistSession(persistence, { emailVerified: true });
1557
- apiClient.updateChatChannelState = async (channelId, body) => ({
1558
- channelId,
1559
- notificationsEnabled: body.notificationsEnabled === true,
1560
- lastReadMessageId: null,
1561
- unreadCount: 0,
1562
- });
1563
- apiClient.connectChannel = (channelId) => {
1564
- connectedChannels.push(channelId);
1565
- return {
1566
- send: async () => {
1567
- throw new Error("not implemented");
1568
- },
1569
- close: () => {},
1570
- };
1571
- };
1572
-
1573
- controller.attachPersistence(persistence);
1574
- controller.setChannelNotificationsEnabled("options", true);
1575
- await flushMicrotasks();
1576
-
1577
- expect(controller.getSnapshot("options").channelStates.find((entry) => entry.channelId === "options")).toMatchObject({
1578
- notificationsEnabled: true,
1579
- });
1580
- expect(connectedChannels).toContain("options");
1581
- });
1582
-
1583
- test("dedupes reply notifications by message id", () => {
1584
- const persistence = new MemoryPersistence();
1585
- const controller = createController();
1586
- const notifications: AppNotificationRequest[] = [];
1587
- const notification: ChatNotification = {
1588
- id: "n1",
1589
- type: "reply",
1590
- channelId: "everyone",
1591
- messageId: "m2",
1592
- createdAt: "2026-03-28T00:02:00.000Z",
1593
- message: chatMessage({
1594
- id: "m2",
1595
- content: "same reply",
1596
- replyToId: "m1",
1597
- createdAt: "2026-03-28T00:02:00.000Z",
1598
- user: { id: "u2", username: "bob", displayName: "Bob" },
1599
- replyTo: { content: "question", user: { id: "u1", username: "vince" } },
1600
- }),
1601
- };
1602
-
1603
- persistSession(persistence, { emailVerified: true });
1604
- controller.setNotifier((entry) => {
1605
- notifications.push(entry);
1606
- return { toastVisible: true, desktopRequested: false };
1607
- });
1608
- controller.attachPersistence(persistence);
1609
-
1610
- (controller as any).handleChatNotification(notification);
1611
- (controller as any).handleChatNotification({ ...notification, id: "n2" });
1612
-
1613
- expect(notifications).toHaveLength(1);
1614
- });
1615
-
1616
- test("opens a server-issued channel notification at its exact message", () => {
1617
- const persistence = new MemoryPersistence();
1618
- const controller = createController();
1619
- const notifications: AppNotificationRequest[] = [];
1620
- const openedMessages: string[] = [];
1621
- const message: ChatMessage = chatMessage({
1622
- id: "m1",
1623
- channelId: "options",
1624
- content: "new option flow",
1625
- createdAt: "2026-03-28T00:00:00.000Z",
1626
- user: { id: "u2", username: "bob", displayName: "Bob" },
1627
- });
1628
-
1629
- persistSession(persistence, { emailVerified: true });
1630
- controller.setNotifier((entry) => {
1631
- notifications.push(entry);
1632
- }, (channelId, messageId) => {
1633
- openedMessages.push(`${channelId}:${messageId}`);
1634
- });
1635
- controller.attachPersistence(persistence);
1636
-
1637
- (controller as any).handleChatNotification({
1638
- id: "n1",
1639
- type: "channel",
1640
- channelId: "options",
1641
- messageId: "m1",
1642
- createdAt: "2026-03-28T00:00:00.000Z",
1643
- message,
1644
- } satisfies ChatNotification);
1645
-
1646
- expect(notifications).toEqual([{
1647
- title: "#options",
1648
- body: "@bob: new option flow",
1649
- type: "info",
1650
- desktop: "when-inactive",
1651
- action: expect.objectContaining({ label: "Open" }),
1652
- }]);
1653
- notifications[0]?.action?.onClick();
1654
- expect(openedMessages).toEqual(["options:m1"]);
1655
- });
1656
-
1657
- test("uses direct channel labels in server-issued notification titles", async () => {
1658
- const persistence = new MemoryPersistence();
1659
- const controller = createController();
1660
- const notifications: AppNotificationRequest[] = [];
1661
- const directChannel: ChatChannel = {
1662
- id: "dm:u2",
1663
- name: "u2",
1664
- kind: "direct",
1665
- created_at: "2026-03-28T00:00:00.000Z",
1666
- dmUser: { id: "u2", username: "bob", displayName: "Bob" },
1667
- };
1668
- const message: ChatMessage = chatMessage({
1669
- id: "m1",
1670
- channelId: directChannel.id,
1671
- content: "ping",
1672
- createdAt: "2026-03-28T00:00:00.000Z",
1673
- user: { id: "u2", username: "bob", displayName: "Bob" },
1674
- });
1675
-
1676
- apiClient.getChatState = async () => ({
1677
- channels: [...SERVER_CHAT_CHANNELS, directChannel],
1678
- onlineCount: 0,
1679
- channelStates: [...SERVER_CHAT_CHANNELS, directChannel].map((channel) => ({
1680
- channelId: channel.id,
1681
- notificationsEnabled: false,
1682
- lastReadMessageId: null,
1683
- unreadCount: 0,
1684
- })),
1685
- notifications: [],
1686
- });
1687
- persistSession(persistence, { emailVerified: true });
1688
- controller.setNotifier((entry) => {
1689
- notifications.push(entry);
1690
- });
1691
- controller.attachPersistence(persistence);
1692
- await controller.refreshChatState();
1693
-
1694
- (controller as any).handleChatNotification({
1695
- id: "n1",
1696
- type: "channel",
1697
- channelId: directChannel.id,
1698
- messageId: "m1",
1699
- createdAt: "2026-03-28T00:00:00.000Z",
1700
- message,
1701
- } satisfies ChatNotification);
1702
-
1703
- expect(notifications).toEqual([{
1704
- title: "@bob",
1705
- body: "ping",
1706
- type: "info",
1707
- desktop: "when-inactive",
1708
- }]);
1709
- });
1710
-
1711
- test("tracks unread channel messages and clears them when the channel opens", () => {
1712
- const persistence = new MemoryPersistence();
1713
- const controller = createController();
1714
- const message: ChatMessage = chatMessage({
1715
- id: "m1",
1716
- channelId: "options",
1717
- content: "new option flow",
1718
- createdAt: "2026-03-28T00:00:00.000Z",
1719
- user: { id: "u2", username: "bob", displayName: "Bob" },
1720
- });
1721
-
1722
- persistSession(persistence, { emailVerified: true });
1723
- controller.attachPersistence(persistence);
1724
-
1725
- (controller as any).mergeMessages("options", [message]);
1726
-
1727
- expect(controller.getSnapshot("options").channelStates.find((entry) => entry.channelId === "options")).toMatchObject({
1728
- unreadCount: 1,
1729
- });
1730
-
1731
- const detachView = controller.attachChannelView("options");
1732
-
1733
- expect(controller.getSnapshot("options").channelStates.find((entry) => entry.channelId === "options")).toMatchObject({
1734
- unreadCount: 0,
1735
- });
1736
- detachView();
1737
- });
1738
-
1739
- test("server reply notifications fire even when channel notifications are disabled", () => {
1740
- const persistence = new MemoryPersistence();
1741
- const controller = createController();
1742
- const notifications: AppNotificationRequest[] = [];
1743
- const message: ChatMessage = chatMessage({
1744
- id: "m2",
1745
- channelId: "options",
1746
- content: "reply without channel notify",
1747
- replyToId: "m1",
1748
- createdAt: "2026-03-28T00:00:00.000Z",
1749
- user: { id: "u2", username: "bob", displayName: "Bob" },
1750
- replyTo: { content: "question", user: { id: "u1", username: "vince" } },
1751
- });
1752
-
1753
- persistSession(persistence, { emailVerified: true });
1754
- controller.setNotifier((notification) => {
1755
- notifications.push(notification);
1756
- });
1757
- controller.attachPersistence(persistence);
1758
-
1759
- (controller as any).handleChatNotification({
1760
- id: "n1",
1761
- type: "reply",
1762
- channelId: "options",
1763
- messageId: "m2",
1764
- createdAt: "2026-03-28T00:00:00.000Z",
1765
- message,
1766
- } satisfies ChatNotification);
1767
-
1768
- expect(notifications).toEqual([{
1769
- title: "#options",
1770
- body: "@bob replied to you: reply without channel notify",
1771
- type: "info",
1772
- desktop: "when-inactive",
1773
- }]);
1774
- });
1775
-
1776
- test("recovers from a legacy timestamp cursor by falling back to a full transcript fetch", async () => {
1777
- const persistence = new MemoryPersistence();
1778
- const controller = createController();
1779
- const cached: ChatMessage = chatMessage({
1780
- id: "m1",
1781
- content: "cached",
1782
- createdAt: "2026-03-28T00:00:00.000Z",
1783
- });
1784
- const fullTranscript: ChatMessage[] = [
1785
- cached,
1786
- chatMessage({
1787
- id: "m2",
1788
- content: "fresh",
1789
- createdAt: "2026-03-28T00:01:00.000Z",
1790
- user: { id: "u2", username: "bob", displayName: "Bob" },
1791
- }),
1792
- ];
1793
-
1794
- persistence.setState("channel:everyone", {
1795
- draft: "",
1796
- replyToId: null,
1797
- lastCursor: "2026-03-28T00:00:00.000Z",
1798
- lastViewedMessageId: "m1",
1799
- }, { schemaVersion: 1 });
1800
- persistence.setResource(TRANSCRIPT_KIND, TRANSCRIPT_KEY, {
1801
- messages: [cached],
1802
- }, {
1803
- sourceKey: TRANSCRIPT_SOURCE,
1804
- schemaVersion: TRANSCRIPT_SCHEMA_VERSION,
1805
- cachePolicy: { staleMs: 1_000, expireMs: 2_000 },
1806
- });
1807
-
1808
- controller.attachPersistence(persistence);
1809
-
1810
- const calls: Array<{ channelId: string; opts?: { after?: string; before?: string; limit?: number } }> = [];
1811
- apiClient.getMessages = async (channelId, opts) => {
1812
- calls.push({ channelId, opts });
1813
- return opts?.after ? [] : fullTranscript;
1814
- };
1815
-
1816
- await controller.refreshMessages();
1817
-
1818
- // The session backfill already ignores the cursor, so the legacy timestamp
1819
- // is never sent and the old wasted round trip is gone.
1820
- expect(calls).toHaveLength(1);
1821
- expect(calls[0]?.opts?.after).toBeUndefined();
1822
- expect(controller.getSnapshot().messages.map((entry) => entry.id)).toEqual(["m1", "m2"]);
1823
- expect(persistence.getState<{ lastCursor: string }>("channel:everyone", { schemaVersion: 1 })).toMatchObject({
1824
- lastCursor: "m2",
1825
- });
1826
- });
1827
-
1828
- test("loads older messages before the oldest cached message without moving the latest cursor", async () => {
1829
- const persistence = new MemoryPersistence();
1830
- const controller = createController();
1831
- const cached: ChatMessage[] = [
1832
- chatMessage({
1833
- id: "m3",
1834
- content: "cached older",
1835
- createdAt: "2026-03-28T00:03:00.000Z",
1836
- user: { id: "u3", username: "cara", displayName: "Cara" },
1837
- }),
1838
- chatMessage({
1839
- id: "m4",
1840
- content: "cached newer",
1841
- createdAt: "2026-03-28T00:04:00.000Z",
1842
- user: { id: "u4", username: "drew", displayName: "Drew" },
1843
- }),
1844
- ];
1845
- const older: ChatMessage[] = [
1846
- chatMessage({
1847
- id: "m1",
1848
- content: "oldest",
1849
- createdAt: "2026-03-28T00:01:00.000Z",
1850
- user: { id: "u1", username: "alice", displayName: "Alice" },
1851
- }),
1852
- chatMessage({
1853
- id: "m2",
1854
- content: "older",
1855
- createdAt: "2026-03-28T00:02:00.000Z",
1856
- user: { id: "u2", username: "bob", displayName: "Bob" },
1857
- }),
1858
- ];
1859
-
1860
- persistence.setState("channel:everyone", {
1861
- draft: "",
1862
- replyToId: null,
1863
- lastCursor: "m4",
1864
- lastViewedMessageId: "m4",
1865
- }, { schemaVersion: 1 });
1866
- persistence.setResource(TRANSCRIPT_KIND, TRANSCRIPT_KEY, {
1867
- messages: cached,
1868
- }, {
1869
- sourceKey: TRANSCRIPT_SOURCE,
1870
- schemaVersion: TRANSCRIPT_SCHEMA_VERSION,
1871
- cachePolicy: { staleMs: 1_000, expireMs: 2_000 },
1872
- });
1873
-
1874
- controller.attachPersistence(persistence);
1875
-
1876
- const calls: Array<{ channelId: string; opts?: { after?: string; before?: string; limit?: number } }> = [];
1877
- apiClient.getMessages = async (channelId, opts) => {
1878
- calls.push({ channelId, opts });
1879
- return opts?.before === "m3" ? older : [];
1880
- };
1881
-
1882
- await controller.loadOlderMessages();
1883
-
1884
- expect(calls).toEqual([{
1885
- channelId: "everyone",
1886
- opts: { limit: 50, before: "m3" },
1887
- }]);
1888
- expect(controller.getSnapshot().messages.map((entry) => entry.id)).toEqual(["m1", "m2", "m3", "m4"]);
1889
- expect(controller.getSnapshot().hasOlderMessages).toBe(false);
1890
- expect(persistence.getState<{ lastCursor: string }>("channel:everyone", { schemaVersion: 1 })).toMatchObject({
1891
- lastCursor: "m4",
1892
- });
1893
- });
1894
- });