gloomberb 0.15.2 → 0.15.3

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 (1918) 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 +113 -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/index.tsx +3 -5
  420. package/src/plugins/builtin/correlation/relationship/pane.tsx +6 -7
  421. package/src/plugins/builtin/correlation/relationship/view-model.ts +7 -18
  422. package/src/plugins/builtin/cot/client.ts +14 -18
  423. package/src/plugins/builtin/cot/index.tsx +3 -2
  424. package/src/plugins/builtin/cot/model.ts +13 -10
  425. package/src/plugins/builtin/cot/pane.tsx +70 -45
  426. package/src/plugins/builtin/credit-boards/cdx-pane.tsx +140 -0
  427. package/src/plugins/builtin/credit-boards/client.ts +108 -0
  428. package/src/plugins/builtin/credit-boards/headless.ts +73 -0
  429. package/src/plugins/builtin/credit-boards/index.tsx +62 -0
  430. package/src/plugins/builtin/credit-boards/model.ts +221 -0
  431. package/src/plugins/builtin/credit-boards/sovr-pane.tsx +144 -0
  432. package/src/plugins/builtin/credit-conditions/index.tsx +33 -33
  433. package/src/plugins/builtin/crypto-board/client.ts +11 -34
  434. package/src/plugins/builtin/crypto-board/index.tsx +1 -1
  435. package/src/plugins/builtin/crypto-board/model.ts +14 -16
  436. package/src/plugins/builtin/crypto-board/pane.tsx +24 -50
  437. package/src/plugins/builtin/custom-view/index.tsx +1 -1
  438. package/src/plugins/builtin/custom-view/pane.tsx +1 -1
  439. package/src/plugins/builtin/custom-view/view-spec.ts +9 -12
  440. package/src/plugins/builtin/debt-maturities/client.ts +15 -42
  441. package/src/plugins/builtin/debt-maturities/model.ts +96 -31
  442. package/src/plugins/builtin/debt-maturities/pane.tsx +196 -223
  443. package/src/plugins/builtin/debt-maturities/wall-bar.tsx +63 -0
  444. package/src/plugins/builtin/debug/index.tsx +17 -46
  445. package/src/plugins/builtin/dividend-yield/client.ts +13 -33
  446. package/src/plugins/builtin/dividend-yield/model.ts +10 -22
  447. package/src/plugins/builtin/dividend-yield/pane.tsx +97 -143
  448. package/src/plugins/builtin/dividend-yield/trailing-cash.ts +3 -3
  449. package/src/plugins/builtin/dividend-yield/view.ts +2 -2
  450. package/src/plugins/builtin/earnings/board-model.ts +197 -0
  451. package/src/plugins/builtin/earnings/board-table.ts +84 -0
  452. package/src/plugins/builtin/earnings/board.tsx +236 -0
  453. package/src/plugins/builtin/earnings/client.ts +97 -0
  454. package/src/plugins/builtin/earnings/format.ts +62 -0
  455. package/src/plugins/builtin/earnings/headless.ts +134 -138
  456. package/src/plugins/builtin/earnings/history-model.ts +174 -0
  457. package/src/plugins/builtin/earnings/history-table.ts +84 -0
  458. package/src/plugins/builtin/earnings/history.tsx +107 -0
  459. package/src/plugins/builtin/earnings/index.tsx +70 -270
  460. package/src/plugins/builtin/earnings/model.ts +0 -99
  461. package/src/plugins/builtin/earnings-calls/data.ts +0 -5
  462. package/src/plugins/builtin/earnings-calls/format.ts +2 -8
  463. package/src/plugins/builtin/earnings-calls/index.tsx +0 -1
  464. package/src/plugins/builtin/earnings-calls/pane.tsx +16 -63
  465. package/src/plugins/builtin/earnings-calls/transcript-view.tsx +18 -61
  466. package/src/plugins/builtin/econ/calendar-model.ts +34 -1
  467. package/src/plugins/builtin/econ/detail-view.tsx +124 -139
  468. package/src/plugins/builtin/econ/fred-series-map.ts +1 -5
  469. package/src/plugins/builtin/econ/index.tsx +51 -90
  470. package/src/plugins/builtin/econ-statistics/client.ts +5 -4
  471. package/src/plugins/builtin/econ-statistics/defs.ts +1 -1
  472. package/src/plugins/builtin/econ-statistics/detail.tsx +32 -104
  473. package/src/plugins/builtin/econ-statistics/headless.ts +28 -50
  474. package/src/plugins/builtin/econ-statistics/index.tsx +1 -1
  475. package/src/plugins/builtin/econ-statistics/pane.tsx +36 -152
  476. package/src/plugins/builtin/econ-statistics/stats.ts +0 -5
  477. package/src/plugins/builtin/econ-statistics/view.ts +2 -4
  478. package/src/plugins/builtin/equity-screener/client.ts +2 -2
  479. package/src/plugins/builtin/equity-screener/live.ts +7 -9
  480. package/src/plugins/builtin/equity-screener/model.ts +67 -9
  481. package/src/plugins/builtin/equity-screener/pane.tsx +39 -58
  482. package/src/plugins/builtin/equity-screener/results.ts +2 -4
  483. package/src/plugins/builtin/estimate-revisions/client.ts +20 -49
  484. package/src/plugins/builtin/estimate-revisions/pane.tsx +71 -104
  485. package/src/plugins/builtin/executives/data.ts +3 -8
  486. package/src/plugins/builtin/executives/format.ts +3 -17
  487. package/src/plugins/builtin/executives/pane.tsx +33 -186
  488. package/src/plugins/builtin/fear-greed/cache.ts +100 -0
  489. package/src/plugins/builtin/fear-greed/charts.tsx +258 -0
  490. package/src/plugins/builtin/fear-greed/data.ts +376 -0
  491. package/src/plugins/builtin/fear-greed/format.ts +87 -0
  492. package/src/plugins/builtin/fear-greed/headless.ts +85 -0
  493. package/src/plugins/builtin/fear-greed/index.tsx +89 -0
  494. package/src/plugins/builtin/fear-greed/pane.tsx +112 -0
  495. package/src/plugins/builtin/filing-events/feed.ts +4 -14
  496. package/src/plugins/builtin/filing-events/pane.tsx +7 -21
  497. package/src/plugins/builtin/futures/contracts.ts +55 -33
  498. package/src/plugins/builtin/futures/index.tsx +61 -47
  499. package/src/plugins/builtin/futures/model.ts +39 -17
  500. package/src/plugins/builtin/futures/returns.ts +132 -0
  501. package/src/plugins/builtin/futures/table.tsx +72 -63
  502. package/src/plugins/builtin/futures/use-front-returns.ts +119 -0
  503. package/src/plugins/builtin/futures-curve/client.ts +30 -15
  504. package/src/plugins/builtin/futures-curve/headless.ts +10 -4
  505. package/src/plugins/builtin/futures-curve/index.tsx +2 -1
  506. package/src/plugins/builtin/futures-curve/model.ts +133 -18
  507. package/src/plugins/builtin/futures-curve/pane.tsx +141 -45
  508. package/src/plugins/builtin/fx-matrix/index.tsx +9 -17
  509. package/src/plugins/builtin/help/functions-table.tsx +2 -19
  510. package/src/plugins/builtin/help/index.tsx +6 -26
  511. package/src/plugins/builtin/help/shortcut-model.ts +7 -1
  512. package/src/plugins/builtin/holders/headless.ts +2 -2
  513. package/src/plugins/builtin/holders/index.tsx +0 -1
  514. package/src/plugins/builtin/holders/pane.tsx +43 -83
  515. package/src/plugins/builtin/holders/table-model.ts +1 -15
  516. package/src/plugins/builtin/holders/thirteenf-match.ts +4 -3
  517. package/src/plugins/builtin/holders/types.ts +1 -1
  518. package/src/plugins/builtin/insider/index.tsx +0 -1
  519. package/src/plugins/builtin/ipo-calendar/client.ts +93 -0
  520. package/src/plugins/builtin/ipo-calendar/headless.ts +159 -0
  521. package/src/plugins/builtin/ipo-calendar/index.tsx +47 -0
  522. package/src/plugins/builtin/ipo-calendar/model.ts +341 -0
  523. package/src/plugins/builtin/ipo-calendar/pane.tsx +233 -0
  524. package/src/plugins/builtin/iv-history/index.tsx +0 -1
  525. package/src/plugins/builtin/iv-history/pane.tsx +7 -4
  526. package/src/plugins/builtin/iv-history/rank.ts +0 -7
  527. package/src/plugins/builtin/iv-history/screen-pane.tsx +7 -12
  528. package/src/plugins/builtin/jobs/headless.ts +58 -76
  529. package/src/plugins/builtin/jobs/index.tsx +0 -1
  530. package/src/plugins/builtin/jobs/model.ts +7 -15
  531. package/src/plugins/builtin/jobs/pane.tsx +190 -154
  532. package/src/plugins/builtin/jobs/share-bars.tsx +2 -2
  533. package/src/plugins/builtin/kelly-sizer/fields.ts +1 -1
  534. package/src/plugins/builtin/kelly-sizer/model.ts +1 -26
  535. package/src/plugins/builtin/kelly-sizer/pane.tsx +22 -67
  536. package/src/plugins/builtin/kelly-sizer/sections.tsx +1 -1
  537. package/src/plugins/builtin/kelly-sizer/state.ts +2 -2
  538. package/src/plugins/builtin/kelly-sizer/test-support.tsx +18 -27
  539. package/src/plugins/builtin/layout-manager/index.tsx +13 -50
  540. package/src/plugins/builtin/macro-resources.ts +15 -0
  541. package/src/plugins/builtin/market-halts/client.ts +114 -0
  542. package/src/plugins/builtin/market-halts/index.tsx +41 -0
  543. package/src/plugins/builtin/market-halts/model.ts +323 -0
  544. package/src/plugins/builtin/market-halts/pane.tsx +239 -0
  545. package/src/plugins/builtin/market-heatmap/data.ts +305 -0
  546. package/src/plugins/builtin/market-heatmap/index.tsx +447 -0
  547. package/src/plugins/builtin/market-movers/client.ts +30 -3
  548. package/src/plugins/builtin/market-movers/footer.ts +19 -0
  549. package/src/plugins/builtin/market-movers/headless.ts +71 -5
  550. package/src/plugins/builtin/market-movers/index.tsx +135 -101
  551. package/src/plugins/builtin/market-movers/model.ts +11 -17
  552. package/src/plugins/builtin/market-movers/screener.ts +2 -8
  553. package/src/plugins/builtin/market-movers/session-body.tsx +237 -0
  554. package/src/plugins/builtin/market-movers/session-table.ts +96 -0
  555. package/src/plugins/builtin/market-movers/session.ts +233 -0
  556. package/src/plugins/builtin/market-movers/table.ts +15 -15
  557. package/src/plugins/builtin/market-valuation/cache.ts +2 -39
  558. package/src/plugins/builtin/market-valuation/chart-projection.ts +11 -34
  559. package/src/plugins/builtin/market-valuation/client.ts +4 -5
  560. package/src/plugins/builtin/market-valuation/defs.ts +0 -9
  561. package/src/plugins/builtin/market-valuation/detail.tsx +32 -89
  562. package/src/plugins/builtin/market-valuation/headless.ts +31 -51
  563. package/src/plugins/builtin/market-valuation/index.tsx +11 -1
  564. package/src/plugins/builtin/market-valuation/pane.tsx +37 -179
  565. package/src/plugins/builtin/market-valuation/view.ts +6 -7
  566. package/src/plugins/builtin/market-valuation/zone-scale/index.tsx +2 -2
  567. package/src/plugins/builtin/mna/client.ts +143 -0
  568. package/src/plugins/builtin/mna/detail.tsx +297 -0
  569. package/src/plugins/builtin/mna/headless.ts +82 -0
  570. package/src/plugins/builtin/mna/index.tsx +55 -0
  571. package/src/plugins/builtin/mna/model.ts +208 -0
  572. package/src/plugins/builtin/mna/pane.tsx +432 -0
  573. package/src/plugins/builtin/money-markets/client.ts +5 -17
  574. package/src/plugins/builtin/money-markets/model.ts +20 -0
  575. package/src/plugins/builtin/money-markets/pane.tsx +79 -46
  576. package/src/plugins/builtin/news/index.tsx +13 -14
  577. package/src/plugins/builtin/news/wire/categories.ts +35 -12
  578. package/src/plugins/builtin/news/wire/feed-config.ts +4 -13
  579. package/src/plugins/builtin/news/wire/index.tsx +43 -27
  580. package/src/plugins/builtin/news/wire/industry-pane.tsx +110 -105
  581. package/src/plugins/builtin/news/wire/news/detail-view.tsx +8 -25
  582. package/src/plugins/builtin/news/wire/news/footer.ts +2 -2
  583. package/src/plugins/builtin/news/wire/news/preset-pane.tsx +111 -61
  584. package/src/plugins/builtin/news/wire/news/query-presets.ts +66 -1
  585. package/src/plugins/builtin/news/wire/news/table.tsx +19 -62
  586. package/src/plugins/builtin/news/wire/read-state.ts +3 -17
  587. package/src/plugins/builtin/news/wire/rss/cli.ts +47 -0
  588. package/src/plugins/builtin/news/wire/rss/parser.ts +0 -4
  589. package/src/plugins/builtin/news/wire/rss/source.ts +2 -2
  590. package/src/plugins/builtin/notes/cli.ts +95 -0
  591. package/src/plugins/builtin/notes/files.ts +145 -88
  592. package/src/plugins/builtin/notes/index.tsx +4 -2
  593. package/src/plugins/builtin/notes/migration.ts +3 -1
  594. package/src/plugins/builtin/notes/quick-notes-pane.tsx +24 -40
  595. package/src/plugins/builtin/notes/ticker-notes-tab.tsx +4 -1
  596. package/src/plugins/builtin/options/analytics.ts +5 -7
  597. package/src/plugins/builtin/options/calc-seed.ts +2 -1
  598. package/src/plugins/builtin/options/enrichment-client.ts +10 -19
  599. package/src/plugins/builtin/options/enrichment-model.ts +1 -2
  600. package/src/plugins/builtin/options/footer.ts +2 -2
  601. package/src/plugins/builtin/options/index.tsx +1 -1
  602. package/src/plugins/builtin/options/live-quotes.ts +1 -4
  603. package/src/plugins/builtin/options/table.ts +15 -15
  604. package/src/plugins/builtin/options/types.ts +1 -1
  605. package/src/plugins/builtin/options/view.tsx +31 -9
  606. package/src/plugins/builtin/options-calculator/binomial.ts +17 -16
  607. package/src/plugins/builtin/options-calculator/evidence.ts +90 -24
  608. package/src/plugins/builtin/options-calculator/headless.ts +2 -1
  609. package/src/plugins/builtin/options-calculator/model.ts +2 -207
  610. package/src/plugins/builtin/options-calculator/pane.tsx +11 -39
  611. package/src/plugins/builtin/options-calculator/surface.ts +11 -21
  612. package/src/plugins/builtin/options-scenario/client.ts +9 -20
  613. package/src/plugins/builtin/options-scenario/evidence.ts +64 -8
  614. package/src/plugins/builtin/options-scenario/live.ts +2 -2
  615. package/src/plugins/builtin/options-scenario/model.ts +18 -28
  616. package/src/plugins/builtin/options-scenario/pane.tsx +18 -19
  617. package/src/plugins/builtin/plugin-marketplace/activation.ts +70 -0
  618. package/src/plugins/builtin/plugin-marketplace/feed.ts +12 -0
  619. package/src/plugins/builtin/plugin-marketplace/index.tsx +16 -4
  620. package/src/plugins/builtin/plugin-marketplace/model.ts +67 -9
  621. package/src/plugins/builtin/plugin-marketplace/pane.tsx +67 -101
  622. package/src/plugins/builtin/plugin-marketplace/store.ts +19 -1
  623. package/src/plugins/builtin/plugin-module.ts +4 -11
  624. package/src/plugins/builtin/portfolio-list/account-metrics.ts +17 -15
  625. package/src/plugins/builtin/portfolio-list/cli/render.ts +3 -4
  626. package/src/plugins/builtin/portfolio-list/cli/watchlist-command.ts +2 -1
  627. package/src/plugins/builtin/portfolio-list/column-values.ts +23 -34
  628. package/src/plugins/builtin/portfolio-list/index.tsx +1 -1
  629. package/src/plugins/builtin/portfolio-list/pane/index.tsx +19 -38
  630. package/src/plugins/builtin/portfolio-list/position-metrics.ts +0 -8
  631. package/src/plugins/builtin/portfolio-list/summary/index.tsx +20 -16
  632. package/src/plugins/builtin/rate-path/client.ts +7 -16
  633. package/src/plugins/builtin/rate-path/headless.ts +13 -9
  634. package/src/plugins/builtin/rate-path/model.ts +74 -17
  635. package/src/plugins/builtin/rate-path/pane.tsx +128 -63
  636. package/src/plugins/builtin/realized-vol/client.ts +13 -23
  637. package/src/plugins/builtin/realized-vol/evidence.ts +43 -20
  638. package/src/plugins/builtin/realized-vol/pane.tsx +13 -19
  639. package/src/plugins/builtin/relative-rotation/client.ts +9 -35
  640. package/src/plugins/builtin/relative-rotation/pane.tsx +46 -65
  641. package/src/plugins/builtin/research/analyst-model.ts +35 -32
  642. package/src/plugins/builtin/research/analyst-pane.tsx +124 -128
  643. package/src/plugins/builtin/research/corporate-actions-pane.tsx +23 -70
  644. package/src/plugins/builtin/research/equity-diagnostic-pane.tsx +7 -11
  645. package/src/plugins/builtin/research/event-sources.ts +64 -0
  646. package/src/plugins/builtin/research/events-headless.ts +7 -32
  647. package/src/plugins/builtin/research/headless.ts +11 -51
  648. package/src/plugins/builtin/research/index.tsx +0 -3
  649. package/src/plugins/builtin/research/relative-valuation-model.ts +0 -1
  650. package/src/plugins/builtin/research/relative-valuation-pane.tsx +50 -86
  651. package/src/plugins/builtin/research-search/data.ts +0 -4
  652. package/src/plugins/builtin/research-search/document-view.tsx +3 -9
  653. package/src/plugins/builtin/research-search/index.tsx +1 -0
  654. package/src/plugins/builtin/research-search/model.ts +4 -20
  655. package/src/plugins/builtin/research-search/pane.tsx +44 -131
  656. package/src/plugins/builtin/research-search/saved-view.tsx +10 -13
  657. package/src/plugins/builtin/revenue-breakdown/bars.tsx +113 -0
  658. package/src/plugins/builtin/revenue-breakdown/client.ts +114 -0
  659. package/src/plugins/builtin/revenue-breakdown/headless.ts +72 -0
  660. package/src/plugins/builtin/revenue-breakdown/index.tsx +58 -0
  661. package/src/plugins/builtin/revenue-breakdown/model.ts +157 -0
  662. package/src/plugins/builtin/revenue-breakdown/pane.tsx +290 -0
  663. package/src/plugins/builtin/risk-factors/data.ts +3 -8
  664. package/src/plugins/builtin/risk-factors/index.tsx +0 -1
  665. package/src/plugins/builtin/risk-factors/pane.tsx +29 -107
  666. package/src/plugins/builtin/scanner/denied.tsx +4 -16
  667. package/src/plugins/builtin/scanner/feed.ts +2 -2
  668. package/src/plugins/builtin/scanner/flow-pane.tsx +11 -18
  669. package/src/plugins/builtin/scanner/hilo-bars.tsx +31 -16
  670. package/src/plugins/builtin/scanner/hilo-model.ts +33 -0
  671. package/src/plugins/builtin/scanner/hilo-pane.tsx +8 -11
  672. package/src/plugins/builtin/scanner/index.ts +2 -3
  673. package/src/plugins/builtin/sec/filing-display.tsx +2 -6
  674. package/src/plugins/builtin/sec/index.tsx +2 -1
  675. package/src/plugins/builtin/sec/model.ts +8 -4
  676. package/src/plugins/builtin/sectors/index.tsx +19 -40
  677. package/src/plugins/builtin/sectors/move-bar.tsx +2 -2
  678. package/src/plugins/builtin/sectors/sector-model.ts +0 -5
  679. package/src/plugins/builtin/shared/cloud-resource.ts +56 -0
  680. package/src/plugins/builtin/shared/cloud-upgrade.ts +46 -11
  681. package/src/plugins/builtin/shared/filing-year-reader.tsx +123 -0
  682. package/src/plugins/builtin/shared/locked-rows.tsx +56 -0
  683. package/src/plugins/builtin/shared/pane-request.ts +35 -0
  684. package/src/plugins/builtin/shared/research-cloud-session.ts +1 -1
  685. package/src/plugins/builtin/shared/series-detail-chart.tsx +168 -0
  686. package/src/plugins/builtin/shared/series-list-detail.tsx +208 -0
  687. package/src/plugins/builtin/shared/stat-transform.ts +94 -0
  688. package/src/plugins/builtin/shared/ticker-request.ts +0 -6
  689. package/src/plugins/builtin/shared/trend.ts +81 -0
  690. package/src/plugins/builtin/shared/use-quote-board.ts +130 -4
  691. package/src/plugins/builtin/shared/volatility/index.ts +2 -1
  692. package/src/plugins/builtin/shared/volatility/options.ts +3 -3
  693. package/src/plugins/builtin/shared/volatility/pricing.ts +211 -0
  694. package/src/plugins/builtin/short-interest/client.ts +3 -12
  695. package/src/plugins/builtin/short-interest/index.tsx +0 -1
  696. package/src/plugins/builtin/short-interest/model.ts +51 -18
  697. package/src/plugins/builtin/short-interest/pane.tsx +64 -108
  698. package/src/plugins/builtin/short-interest/surface.tsx +9 -9
  699. package/src/plugins/builtin/short-interest/types.ts +0 -2
  700. package/src/plugins/builtin/short-volume/client.ts +8 -17
  701. package/src/plugins/builtin/short-volume/pane.tsx +28 -29
  702. package/src/plugins/builtin/social-mentions/client.ts +85 -0
  703. package/src/plugins/builtin/social-mentions/headless.ts +28 -0
  704. package/src/plugins/builtin/social-mentions/index.tsx +21 -0
  705. package/src/plugins/builtin/social-mentions/model.ts +92 -0
  706. package/src/plugins/builtin/social-mentions/pane.tsx +156 -0
  707. package/src/plugins/builtin/thirteenf/api.ts +13 -23
  708. package/src/plugins/builtin/thirteenf/data.ts +6 -8
  709. package/src/plugins/builtin/thirteenf/format.ts +3 -10
  710. package/src/plugins/builtin/thirteenf/headless.ts +9 -8
  711. package/src/plugins/builtin/thirteenf/index.tsx +0 -1
  712. package/src/plugins/builtin/thirteenf/model.ts +0 -31
  713. package/src/plugins/builtin/thirteenf/overlap-pane.tsx +12 -16
  714. package/src/plugins/builtin/thirteenf/pane.tsx +65 -255
  715. package/src/plugins/builtin/thirteenf/signals-pane.tsx +23 -44
  716. package/src/plugins/builtin/thirteenf/table.ts +58 -73
  717. package/src/plugins/builtin/thirteenf/types.ts +1 -1
  718. package/src/plugins/builtin/ticker-detail/data-panes/historical-prices.tsx +25 -17
  719. package/src/plugins/builtin/ticker-detail/financials/aggregation.ts +3 -7
  720. package/src/plugins/builtin/ticker-detail/financials/model.ts +121 -25
  721. package/src/plugins/builtin/ticker-detail/financials/period-end-history.ts +41 -0
  722. package/src/plugins/builtin/ticker-detail/financials/ratio-table.tsx +175 -0
  723. package/src/plugins/builtin/ticker-detail/financials/ratios.ts +669 -0
  724. package/src/plugins/builtin/ticker-detail/financials/tab.tsx +198 -111
  725. package/src/plugins/builtin/ticker-detail/headless-schema.ts +7 -2
  726. package/src/plugins/builtin/ticker-detail/headless.ts +86 -9
  727. package/src/plugins/builtin/ticker-detail/index.tsx +1 -1
  728. package/src/plugins/builtin/ticker-detail/overview/components.tsx +2 -2
  729. package/src/plugins/builtin/ticker-detail/overview-tab.tsx +2 -5
  730. package/src/plugins/builtin/ticker-detail/pane.tsx +45 -15
  731. package/src/plugins/builtin/ticker-detail/quote-monitor/card.tsx +3 -1
  732. package/src/plugins/builtin/ticker-detail/quote-monitor/index.tsx +1 -1
  733. package/src/plugins/builtin/time-sales/client.ts +5 -5
  734. package/src/plugins/builtin/time-sales/model.ts +52 -0
  735. package/src/plugins/builtin/time-sales/pane.tsx +24 -19
  736. package/src/plugins/builtin/treasury-auctions/index.tsx +0 -1
  737. package/src/plugins/builtin/treasury-auctions/model.ts +3 -10
  738. package/src/plugins/builtin/treasury-auctions/pane.tsx +42 -101
  739. package/src/plugins/builtin/treasury-auctions/types.ts +0 -2
  740. package/src/plugins/builtin/vol-surface/client.ts +8 -22
  741. package/src/plugins/builtin/vol-surface/evidence.ts +45 -17
  742. package/src/plugins/builtin/vol-surface/model.ts +5 -8
  743. package/src/plugins/builtin/vol-surface/pane.tsx +24 -23
  744. package/src/plugins/builtin/vol-surface/raster.ts +1 -9
  745. package/src/plugins/builtin/vol-surface/stored.ts +3 -4
  746. package/src/plugins/builtin/vol-surface/surface.tsx +4 -3
  747. package/src/plugins/builtin/volatility/chart-model.ts +36 -0
  748. package/src/plugins/builtin/volatility/charts.tsx +3 -20
  749. package/src/plugins/builtin/volatility/client.ts +8 -16
  750. package/src/plugins/builtin/volatility/evidence.ts +37 -21
  751. package/src/plugins/builtin/volatility/index.tsx +0 -2
  752. package/src/plugins/builtin/volatility/model.ts +55 -0
  753. package/src/plugins/builtin/volatility/pane.tsx +71 -37
  754. package/src/plugins/builtin/world-indices/client.ts +1 -4
  755. package/src/plugins/builtin/world-indices/footer.ts +3 -26
  756. package/src/plugins/builtin/world-indices/index.tsx +8 -9
  757. package/src/plugins/builtin/world-indices/model.ts +0 -14
  758. package/src/plugins/builtin/world-indices/table.tsx +15 -73
  759. package/src/plugins/builtin/world-venue-map/map.tsx +2 -2
  760. package/src/plugins/builtin/world-venue-map/model.ts +1 -4
  761. package/src/plugins/builtin/world-venue-map/pane.tsx +21 -87
  762. package/src/plugins/builtin/yahoo/index.ts +4 -38
  763. package/src/plugins/builtin/yield-curve/chart.ts +100 -1
  764. package/src/plugins/builtin/yield-curve/headless.ts +2 -0
  765. package/src/plugins/builtin/yield-curve/history.ts +86 -12
  766. package/src/plugins/builtin/yield-curve/index.tsx +102 -27
  767. package/src/plugins/builtin/yield-curve/treasury-data.ts +12 -12
  768. package/src/plugins/bundle.ts +41 -41
  769. package/src/plugins/catalog-backend.ts +4 -1
  770. package/src/plugins/catalog-browser.ts +34 -53
  771. package/src/plugins/catalog-manifest.ts +10 -0
  772. package/src/plugins/catalog-ui.ts +9 -5
  773. package/src/plugins/compat.ts +216 -0
  774. package/src/plugins/current-target.ts +3 -9
  775. package/src/plugins/event-bus.ts +8 -3
  776. package/src/plugins/external-runtime.ts +0 -21
  777. package/src/plugins/host-link.ts +78 -45
  778. package/src/plugins/host-modules.ts +117 -3
  779. package/src/plugins/host-resolver.ts +1 -6
  780. package/src/plugins/installer.ts +566 -0
  781. package/src/plugins/loader.ts +120 -16
  782. package/src/plugins/manager-node.ts +28 -28
  783. package/src/plugins/ownership.ts +11 -12
  784. package/src/plugins/pane-manager/gridlock.ts +25 -8
  785. package/src/plugins/pane-manager.ts +1 -0
  786. package/src/plugins/plugin-export.ts +24 -0
  787. package/src/plugins/registry/contributions.ts +10 -4
  788. package/src/plugins/registry/index.ts +13 -12
  789. package/src/plugins/registry/pane-settings.ts +6 -3
  790. package/src/plugins/registry/shared.ts +0 -4
  791. package/src/plugins/registry/slots.ts +10 -13
  792. package/src/plugins/runtime/context.tsx +12 -34
  793. package/src/plugins/runtime/index.tsx +9 -9
  794. package/src/plugins/seed.ts +3 -7
  795. package/src/plugins/web-bundled.ts +3 -12
  796. package/src/public/__snapshots__/public-api.test.ts.snap +519 -0
  797. package/src/public/broker.ts +14 -9
  798. package/src/public/index.ts +3 -0
  799. package/src/public/market-data.ts +19 -2
  800. package/src/public/quotes.ts +4 -4
  801. package/src/public/react.ts +11 -6
  802. package/src/public/test-support.ts +10 -2
  803. package/src/public/time-series.ts +30 -3
  804. package/src/public/utils.ts +3 -4
  805. package/src/react/assign-ref.ts +10 -0
  806. package/src/react/async-resource.ts +16 -5
  807. package/src/react/auto-refresh.ts +97 -0
  808. package/src/react/plugins/plugin-slot.tsx +4 -1
  809. package/src/react/read-state.ts +104 -0
  810. package/src/react/ticker-source.ts +32 -0
  811. package/src/remote/controller-utils.ts +0 -4
  812. package/src/remote/controller.ts +18 -14
  813. package/src/remote/layout-helpers.ts +4 -9
  814. package/src/remote/resources.ts +34 -0
  815. package/src/remote/revision.ts +2 -15
  816. package/src/remote/schema.ts +1 -0
  817. package/src/renderers/browser/app-services.ts +1 -1
  818. package/src/renderers/browser/bundled-plugins.ts +8 -7
  819. package/src/renderers/browser/cloud-transport.ts +3 -11
  820. package/src/renderers/browser/config-host.ts +13 -8
  821. package/src/renderers/browser/http-proxy-transport.ts +17 -45
  822. package/src/renderers/browser/main.tsx +52 -25
  823. package/src/renderers/cloudflare/http-proxy.ts +14 -54
  824. package/src/renderers/cloudflare/worker.ts +25 -6
  825. package/src/renderers/electrobun/bun/application-menu/click.ts +8 -20
  826. package/src/renderers/electrobun/bun/application-menu/index.ts +3 -4
  827. package/src/renderers/electrobun/bun/context-menu/click.ts +7 -26
  828. package/src/renderers/electrobun/bun/context-menu/normalize.ts +4 -9
  829. package/src/renderers/electrobun/bun/core-capabilities.ts +16 -64
  830. package/src/renderers/electrobun/bun/desktop/detached-windows.ts +6 -35
  831. package/src/renderers/electrobun/bun/desktop/host-requests.ts +0 -9
  832. package/src/renderers/electrobun/bun/desktop/http-fetch.ts +15 -63
  833. package/src/renderers/electrobun/bun/desktop/http-stream.ts +6 -19
  834. package/src/renderers/electrobun/bun/desktop/initialization.ts +9 -0
  835. package/src/renderers/electrobun/bun/desktop/macos-dock-icon.ts +91 -0
  836. package/src/renderers/electrobun/bun/desktop/plugin-state.ts +0 -7
  837. package/src/renderers/electrobun/bun/external-plugins.ts +35 -95
  838. package/src/renderers/electrobun/bun/index.ts +57 -45
  839. package/src/renderers/electrobun/bun/menu-event.ts +17 -0
  840. package/src/renderers/electrobun/bun/window/controls.ts +69 -0
  841. package/src/renderers/electrobun/bun/window/create.ts +84 -0
  842. package/src/renderers/electrobun/bun/window/events.ts +49 -0
  843. package/src/renderers/electrobun/bun/window/windows-custom-chrome.ts +43 -0
  844. package/src/renderers/electrobun/bun/window/windows-icons.ts +55 -0
  845. package/src/renderers/electrobun/bun/window/windows-native.ts +96 -0
  846. package/src/renderers/electrobun/shared/protocol.ts +35 -48
  847. package/src/renderers/electrobun/shared/quote-event-batch.ts +3 -3
  848. package/src/renderers/electrobun/view/app-services.ts +1 -1
  849. package/src/renderers/electrobun/view/backend-rpc.ts +74 -141
  850. package/src/renderers/electrobun/view/broker-remote-client.ts +32 -46
  851. package/src/renderers/electrobun/view/build-assets.ts +61 -49
  852. package/src/renderers/electrobun/view/capability-stream-client.ts +5 -25
  853. package/src/renderers/electrobun/view/capability-subscription.ts +50 -0
  854. package/src/renderers/electrobun/view/cli-pane-shot-entry.tsx +35 -93
  855. package/src/renderers/electrobun/view/context-menu.ts +6 -7
  856. package/src/renderers/electrobun/view/data-table/dom.ts +1 -2
  857. package/src/renderers/electrobun/view/data-table/index.tsx +17 -35
  858. package/src/renderers/electrobun/view/data-table/row.tsx +6 -2
  859. package/src/renderers/electrobun/view/desktop/controls.tsx +1 -1
  860. package/src/renderers/electrobun/view/desktop/popover.tsx +23 -0
  861. package/src/renderers/electrobun/view/desktop/window/bridge.ts +4 -4
  862. package/src/renderers/electrobun/view/dialog-host.tsx +21 -58
  863. package/src/renderers/electrobun/view/dom-host-providers.tsx +64 -0
  864. package/src/renderers/electrobun/view/dom-ui-host.tsx +5 -21
  865. package/src/renderers/electrobun/view/external-plugins.ts +17 -5
  866. package/src/renderers/electrobun/view/fatal-screen.tsx +1 -42
  867. package/src/renderers/electrobun/view/host/ascii-text.ts +6 -29
  868. package/src/renderers/electrobun/view/host/block-glyph-canvas.tsx +1 -1
  869. package/src/renderers/electrobun/view/host/focus-scope.ts +1 -1
  870. package/src/renderers/electrobun/view/host/input.tsx +95 -163
  871. package/src/renderers/electrobun/view/host/mouse.ts +1 -1
  872. package/src/renderers/electrobun/view/host/native.ts +2 -2
  873. package/src/renderers/electrobun/view/host/scroll-box.tsx +1 -1
  874. package/src/renderers/electrobun/view/host/style.ts +1 -1
  875. package/src/renderers/electrobun/view/host/surface-3d.tsx +2 -2
  876. package/src/renderers/electrobun/view/host/tabs.tsx +1 -1
  877. package/src/renderers/electrobun/view/host/text.tsx +1 -1
  878. package/src/renderers/electrobun/view/http-fetch.ts +13 -64
  879. package/src/renderers/electrobun/view/input-host.tsx +20 -35
  880. package/src/renderers/electrobun/view/key-event.ts +7 -5
  881. package/src/renderers/electrobun/view/main.tsx +76 -34
  882. package/src/renderers/electrobun/view/native-renderer.ts +6 -1
  883. package/src/renderers/electrobun/view/native-stubs/backend-rpc.ts +3 -58
  884. package/src/renderers/electrobun/view/remote/asset-data-client.ts +3 -6
  885. package/src/renderers/electrobun/view/remote/backend-quote-subscription.ts +34 -38
  886. package/src/renderers/electrobun/view/remote/connection-health.ts +14 -32
  887. package/src/renderers/electrobun/view/remote/persistence.ts +32 -63
  888. package/src/renderers/electrobun/view/remote/quote-subscription-registry.ts +2 -5
  889. package/src/renderers/electrobun/view/rpc-codec.ts +18 -20
  890. package/src/renderers/electrobun/view/screenshot-watermark.ts +1 -1
  891. package/src/renderers/electrobun/view/test-utils.tsx +4 -11
  892. package/src/renderers/electrobun/view/toast-host.tsx +29 -87
  893. package/src/renderers/electrobun/view/ui-host.tsx +8 -1
  894. package/src/renderers/electrobun/view/update-host.ts +2 -2
  895. package/src/renderers/opentui/chart-surface.tsx +11 -124
  896. package/src/renderers/opentui/dialog-host.tsx +45 -130
  897. package/src/renderers/opentui/host.tsx +3 -2
  898. package/src/renderers/opentui/image/surface.tsx +15 -174
  899. package/src/renderers/opentui/kitty-services.ts +15 -0
  900. package/src/renderers/opentui/native-surface.ts +176 -0
  901. package/src/renderers/opentui/start.tsx +57 -42
  902. package/src/renderers/opentui/test-utils.tsx +4 -20
  903. package/src/renderers/opentui/toast-host.tsx +7 -95
  904. package/src/renderers/opentui/ui-host.tsx +87 -2
  905. package/src/renderers/share/chart.ts +1 -1
  906. package/src/renderers/share/layout-view.tsx +2 -2
  907. package/src/shares/api.ts +0 -5
  908. package/src/shares/payload.ts +13 -16
  909. package/src/sources/gloomberb-cloud/index.ts +14 -15
  910. package/src/sources/gloomberb-cloud/news.ts +8 -4
  911. package/src/sources/gloomberb-cloud/normalizers.ts +34 -76
  912. package/src/sources/history-coverage.ts +25 -84
  913. package/src/sources/history-result.ts +2 -0
  914. package/src/sources/history-retention.ts +9 -11
  915. package/src/sources/provider-router/batches.ts +0 -4
  916. package/src/sources/provider-router/brokers.ts +2 -13
  917. package/src/sources/provider-router/cache.ts +38 -159
  918. package/src/sources/provider-router/cached-routes.ts +26 -1
  919. package/src/sources/provider-router/financial-routes.ts +3 -10
  920. package/src/sources/provider-router/financials.ts +2 -3
  921. package/src/sources/provider-router/history.ts +20 -70
  922. package/src/sources/provider-router/index.ts +8 -2
  923. package/src/sources/provider-router/news.ts +2 -1
  924. package/src/sources/provider-router/primary.ts +0 -8
  925. package/src/sources/provider-router/quote-route.ts +2 -2
  926. package/src/sources/provider-router/realtime-access.ts +10 -29
  927. package/src/sources/provider-router/search.ts +3 -12
  928. package/src/sources/provider-router/test-support.ts +0 -89
  929. package/src/sources/sec-edgar/acceptance-time.ts +11 -0
  930. package/src/sources/sec-edgar/fourth-quarter.ts +179 -0
  931. package/src/sources/sec-edgar.ts +47 -228
  932. package/src/sources/yahoo-finance/financials.ts +35 -13
  933. package/src/sources/yahoo-finance/history.ts +22 -58
  934. package/src/sources/yahoo-finance/http.ts +17 -25
  935. package/src/sources/yahoo-finance/mappers.ts +0 -23
  936. package/src/sources/yahoo-finance/options.ts +36 -44
  937. package/src/sources/yahoo-finance/quote-summary.ts +90 -141
  938. package/src/sources/yahoo-finance/requests.ts +22 -12
  939. package/src/sources/yahoo-finance/snapshots.ts +4 -6
  940. package/src/sources/yahoo-finance/symbols.ts +25 -0
  941. package/src/sources/yahoo-finance/yahoo-chart-interval.ts +1 -1
  942. package/src/sources/yahoo-finance.ts +80 -188
  943. package/src/state/app/bootstrap.ts +5 -5
  944. package/src/state/app/context/index.tsx +10 -13
  945. package/src/state/hooks/live-streaming.ts +60 -0
  946. package/src/state/hooks/quote-streaming.ts +16 -57
  947. package/src/state/hooks/session-snapshot.ts +0 -1
  948. package/src/state/pane-scroll-registry.tsx +9 -0
  949. package/src/sync/controller.ts +3 -1
  950. package/src/sync/core-contributors.ts +69 -37
  951. package/src/sync/profile-analytics.ts +5 -2
  952. package/src/telemetry/crash-reports-dom.ts +74 -0
  953. package/src/telemetry/crash-reports-node.ts +170 -0
  954. package/src/telemetry/crash-reports.ts +353 -0
  955. package/src/telemetry/live-config.ts +19 -0
  956. package/src/telemetry/usage-counts-dom.ts +22 -0
  957. package/src/telemetry/usage-counts.ts +391 -0
  958. package/src/test-support/app-store.ts +21 -0
  959. package/src/test-support/broker.ts +80 -0
  960. package/src/test-support/cli-context.ts +28 -0
  961. package/src/test-support/cloud-api.ts +85 -0
  962. package/src/test-support/console.ts +40 -0
  963. package/src/test-support/data-provider.ts +30 -0
  964. package/src/test-support/headless.ts +32 -0
  965. package/src/test-support/network-guard.ts +35 -0
  966. package/src/test-support/news.ts +21 -0
  967. package/src/test-support/pane.tsx +42 -22
  968. package/src/test-support/quote-store.ts +49 -0
  969. package/src/test-support/renderer-host.ts +10 -0
  970. package/src/test-support/rpc-loopback.ts +22 -0
  971. package/src/test-support/temp-db.ts +19 -0
  972. package/src/test-support/ticker.ts +15 -0
  973. package/src/test-support/time-series.ts +27 -0
  974. package/src/theme/app-icon.ts +127 -0
  975. package/src/theme/color-utils.ts +2 -1
  976. package/src/theme/themes.ts +3 -1
  977. package/src/time-series/alignment.ts +4 -7
  978. package/src/time-series/chart-data.ts +2 -3
  979. package/src/time-series/forward-valuation.ts +6 -9
  980. package/src/time-series/fundamentals.ts +34 -96
  981. package/src/time-series/live-bars.ts +12 -15
  982. package/src/time-series/live-quotes.ts +4 -26
  983. package/src/time-series/market.ts +6 -9
  984. package/src/time-series/parsed-history-cache.ts +0 -4
  985. package/src/time-series/resolution.ts +35 -1
  986. package/src/time-series/resolve.ts +28 -20
  987. package/src/time-series/session-history.ts +4 -23
  988. package/src/time-series/spec.ts +11 -16
  989. package/src/time-series/studies.ts +26 -15
  990. package/src/time-series/transforms.ts +6 -9
  991. package/src/time-series/types.ts +6 -3
  992. package/src/types/broker.ts +10 -0
  993. package/src/types/config.ts +24 -2
  994. package/src/types/data-provider.ts +13 -1
  995. package/src/types/desktop-menu.ts +3 -1
  996. package/src/types/financials.ts +71 -20
  997. package/src/types/instrument.ts +2 -1
  998. package/src/types/plugin.ts +30 -0
  999. package/src/types/price-history.ts +2 -0
  1000. package/src/types/trading.ts +21 -2
  1001. package/src/ui/dialog-stack.ts +80 -0
  1002. package/src/ui/dialog.tsx +33 -2
  1003. package/src/ui/host.tsx +17 -0
  1004. package/src/ui/index.tsx +3 -10
  1005. package/src/ui/toast.tsx +95 -0
  1006. package/src/updater/index.ts +472 -0
  1007. package/src/utils/async-deadline.ts +34 -0
  1008. package/src/utils/calendar-date.ts +20 -0
  1009. package/src/utils/csv.ts +19 -2
  1010. package/src/utils/datetime-format.ts +103 -6
  1011. package/src/utils/double-escape-close.ts +1 -23
  1012. package/src/utils/errors.ts +4 -0
  1013. package/src/utils/exchanges.ts +10 -0
  1014. package/src/utils/financial-statements.ts +6 -25
  1015. package/src/utils/format.ts +6 -17
  1016. package/src/utils/futures-generic.ts +159 -0
  1017. package/src/utils/guards.ts +37 -0
  1018. package/src/utils/hash.ts +17 -2
  1019. package/src/utils/http-proxy-response.ts +122 -4
  1020. package/src/utils/math.ts +12 -0
  1021. package/src/utils/platform.ts +34 -0
  1022. package/src/utils/plugin-proxy-hosts.json +1 -2
  1023. package/src/utils/plugin-proxy-hosts.ts +3 -0
  1024. package/src/utils/price-history-integrity.ts +5 -8
  1025. package/src/utils/price-history.ts +36 -11
  1026. package/src/utils/sec.ts +3 -8
  1027. package/src/utils/semver.ts +15 -0
  1028. package/src/utils/shortcut-labels.ts +4 -29
  1029. package/src/utils/sort-values.ts +28 -0
  1030. package/src/utils/statement-gaps.ts +94 -0
  1031. package/src/utils/zoned-date-time.ts +12 -0
  1032. package/src/api-client/askg.test.ts +0 -256
  1033. package/src/api-client/errors.test.ts +0 -11
  1034. package/src/api-client/index.test.ts +0 -1591
  1035. package/src/api-client/paths.test.ts +0 -32
  1036. package/src/api-client/request.test.ts +0 -153
  1037. package/src/api-client/research-activity.test.ts +0 -316
  1038. package/src/api-client/session-request-lifetime.test.ts +0 -184
  1039. package/src/api-client/socket-health.test.ts +0 -86
  1040. package/src/api-client/socket-lifetime.test.ts +0 -76
  1041. package/src/api-client/socket-protocol.test.ts +0 -90
  1042. package/src/api-client/tape-socket.test.ts +0 -44
  1043. package/src/api-client/teams.test.ts +0 -270
  1044. package/src/app/app-bootstrap-state.test.ts +0 -157
  1045. package/src/app/global-shortcuts.test.tsx +0 -468
  1046. package/src/app/keybindings/chord.test.ts +0 -131
  1047. package/src/app/keybindings/resolve.test.ts +0 -103
  1048. package/src/app/language-observer.test.tsx +0 -82
  1049. package/src/app/pane-runtime/layout-placement.test.ts +0 -27
  1050. package/src/app/pane-runtime/plugin-bindings.test.ts +0 -117
  1051. package/src/app/pane-runtime/ticker-navigation-runtime.test.ts +0 -144
  1052. package/src/app/pane-runtime/ticker-open-runtime.test.tsx +0 -170
  1053. package/src/app/pane-template-dialog-wizard.test.tsx +0 -36
  1054. package/src/app/runtime/broker-import.test.tsx +0 -89
  1055. package/src/app/runtime/desktop-deeplink.test.ts +0 -169
  1056. package/src/app/runtime/layout-warmup.test.ts +0 -73
  1057. package/src/app/runtime/ticker-refresh.test.tsx +0 -115
  1058. package/src/architecture/browser-entry-graph.test.ts +0 -97
  1059. package/src/architecture/import-boundaries.test.ts +0 -136
  1060. package/src/assets/gloomberb-logo.ico +0 -0
  1061. package/src/assets/gloomberb-logo.png +0 -0
  1062. package/src/brokers/bond-price-basis.test.ts +0 -35
  1063. package/src/brokers/legacy-contract.test.ts +0 -51
  1064. package/src/brokers/profile-form.test.ts +0 -71
  1065. package/src/brokers/sync-broker-instance.test.ts +0 -599
  1066. package/src/brokers/test-broker.ts +0 -68
  1067. package/src/capabilities/registry.test.ts +0 -297
  1068. package/src/cli/base-converter.test.ts +0 -16
  1069. package/src/cli/commands/automation.ts +0 -98
  1070. package/src/cli/commands/futures-price-precision.test.tsx +0 -65
  1071. package/src/cli/commands/keybindings.test.ts +0 -48
  1072. package/src/cli/commands/market-fx.test.ts +0 -77
  1073. package/src/cli/commands/market-options.test.ts +0 -44
  1074. package/src/cli/commands/plugins.test.ts +0 -29
  1075. package/src/cli/commands/quote-price-basis.test.ts +0 -88
  1076. package/src/cli/commands/ticker-financial-units.test.ts +0 -78
  1077. package/src/cli/commands/ticker-period.test.ts +0 -62
  1078. package/src/cli/context.test.ts +0 -63
  1079. package/src/cli/entry.test.ts +0 -58
  1080. package/src/cli/history-rows.test.ts +0 -47
  1081. package/src/cli/options.test.ts +0 -45
  1082. package/src/cli/pane-functions/cloud-session.test.ts +0 -77
  1083. package/src/cli/pane-functions/data.test.ts +0 -17
  1084. package/src/cli/pane-functions/discovery.test.ts +0 -36
  1085. package/src/cli/pane-functions/dom.test.ts +0 -69
  1086. package/src/cli/pane-functions/headless.test.ts +0 -314
  1087. package/src/cli/pane-functions/index.test.ts +0 -266
  1088. package/src/cli/pane-functions/intraday-shot.test.ts +0 -399
  1089. package/src/cli/pane-functions/report.test.ts +0 -107
  1090. package/src/cli/pane-functions/screenshot.test.ts +0 -927
  1091. package/src/cli/registry.test.ts +0 -256
  1092. package/src/cli/result.test.ts +0 -133
  1093. package/src/cli/ticker-resolution.test.ts +0 -39
  1094. package/src/cli/visible-key-values.test.ts +0 -23
  1095. package/src/cli.test.ts +0 -437
  1096. package/src/components/chart/composite/axis-overlays.test.tsx +0 -80
  1097. package/src/components/chart/composite/composite-chart.test.tsx +0 -2019
  1098. package/src/components/chart/composite/downsample.test.ts +0 -136
  1099. package/src/components/chart/composite/format.test.ts +0 -258
  1100. package/src/components/chart/composite/fx-precision.test.ts +0 -111
  1101. package/src/components/chart/composite/interactions.test.ts +0 -231
  1102. package/src/components/chart/composite/panel-series.test.ts +0 -66
  1103. package/src/components/chart/composite/price-axis-labels.test.ts +0 -50
  1104. package/src/components/chart/composite/price-series.test.ts +0 -39
  1105. package/src/components/chart/composite/renderers.test.ts +0 -823
  1106. package/src/components/chart/composite/scene-market-cursor.test.ts +0 -148
  1107. package/src/components/chart/composite/scene.test.ts +0 -845
  1108. package/src/components/chart/composite/scroll-surface.test.tsx +0 -153
  1109. package/src/components/chart/composite/time-axis.test.ts +0 -281
  1110. package/src/components/chart/composite/time-scale.test.ts +0 -88
  1111. package/src/components/chart/composite/tools.test.ts +0 -371
  1112. package/src/components/chart/curve/curve-surface.test.tsx +0 -53
  1113. package/src/components/chart/curve/model.test.ts +0 -115
  1114. package/src/components/chart/native/bitmap-support.test.ts +0 -27
  1115. package/src/components/chart/native/kitty/index.test.ts +0 -537
  1116. package/src/components/chart/static/chart-surface.test.tsx +0 -159
  1117. package/src/components/chart/static/multi-line-chart-surface.tsx +0 -105
  1118. package/src/components/chart/static/scatter-chart-surface.test.ts +0 -30
  1119. package/src/components/chart/static/trail-chart-model.test.ts +0 -36
  1120. package/src/components/chart/surface3d/model.test.ts +0 -117
  1121. package/src/components/chart/surface3d/software.test.ts +0 -32
  1122. package/src/components/command-bar/assist/inventory.test.ts +0 -93
  1123. package/src/components/command-bar/assist/model.test.ts +0 -185
  1124. package/src/components/command-bar/helpers.test.ts +0 -162
  1125. package/src/components/command-bar/layout-items/current-layout.test.ts +0 -165
  1126. package/src/components/command-bar/list/badge.test.ts +0 -54
  1127. package/src/components/command-bar/list/model.test.ts +0 -129
  1128. package/src/components/command-bar/list/view.test.tsx +0 -113
  1129. package/src/components/command-bar/pane-settings.test.ts +0 -141
  1130. package/src/components/command-bar/panel/layout.test.ts +0 -171
  1131. package/src/components/command-bar/routes/root/results.test.ts +0 -161
  1132. package/src/components/command-bar/routes/root/search-providers.test.tsx +0 -224
  1133. package/src/components/command-bar/routes/root/selection.test.ts +0 -54
  1134. package/src/components/command-bar/routes/root/shortcuts.test.ts +0 -193
  1135. package/src/components/command-bar/routes/ticker-search/results.test.ts +0 -128
  1136. package/src/components/command-bar/surface/assist.test.tsx +0 -341
  1137. package/src/components/command-bar/surface/index.test.tsx +0 -1208
  1138. package/src/components/command-bar/surface/listing-selection.test.tsx +0 -84
  1139. package/src/components/command-bar/surface/pane.test.tsx +0 -937
  1140. package/src/components/command-bar/surface/portfolio.test.tsx +0 -453
  1141. package/src/components/command-bar/surface/test-harness.tsx +0 -353
  1142. package/src/components/command-bar/view-model.test.ts +0 -228
  1143. package/src/components/command-bar/workflow/broker.test.ts +0 -22
  1144. package/src/components/command-bar/workflow/collection-actions.test.ts +0 -105
  1145. package/src/components/command-bar/workflow/collection-identity.test.ts +0 -180
  1146. package/src/components/command-bar/workflow/ops.test.ts +0 -804
  1147. package/src/components/command-bar/workflow/route-actions.test.ts +0 -34
  1148. package/src/components/command-bar/workflow/ticker-listing-picker.test.ts +0 -41
  1149. package/src/components/company-logo.test.ts +0 -19
  1150. package/src/components/data-table/export.test.ts +0 -21
  1151. package/src/components/data-table/frozen-column.test.tsx +0 -114
  1152. package/src/components/data-table/horizontal-navigation.test.tsx +0 -181
  1153. package/src/components/data-table/stack-view.test.tsx +0 -226
  1154. package/src/components/data-table/view.test.tsx +0 -343
  1155. package/src/components/feed-data-table/stack-view.test.tsx +0 -46
  1156. package/src/components/input-search-bar.test.tsx +0 -137
  1157. package/src/components/layout/header.test.tsx +0 -82
  1158. package/src/components/layout/market-summary.test.ts +0 -81
  1159. package/src/components/layout/pane/content.test.tsx +0 -103
  1160. package/src/components/layout/pane/cycle-order.test.ts +0 -29
  1161. package/src/components/layout/pane/footer/current-actions.test.tsx +0 -108
  1162. package/src/components/layout/pane/footer/index.test.tsx +0 -199
  1163. package/src/components/layout/pane/footer/keyboard.test.ts +0 -57
  1164. package/src/components/layout/pane/footer/notice.desktop.test.tsx +0 -57
  1165. package/src/components/layout/pane/keyboard-scroll.test.tsx +0 -146
  1166. package/src/components/layout/pane/sidebar.test.tsx +0 -187
  1167. package/src/components/layout/pane/sizing.test.ts +0 -46
  1168. package/src/components/layout/shell/index.test.tsx +0 -1377
  1169. package/src/components/layout/shell/layout-state.test.ts +0 -33
  1170. package/src/components/layout/shell/menu.test.ts +0 -89
  1171. package/src/components/layout/shell/pane-occlusion.test.ts +0 -52
  1172. package/src/components/layout/shell/ticker-link-menu.test.ts +0 -82
  1173. package/src/components/layout/status-bar-groups.test.ts +0 -92
  1174. package/src/components/layout/status-bar.test.tsx +0 -306
  1175. package/src/components/layout/window-edit/mode.test.ts +0 -167
  1176. package/src/components/metric-treemap/layout.test.ts +0 -77
  1177. package/src/components/metric-treemap/surface.test.tsx +0 -62
  1178. package/src/components/onboarding/first-run-workspace.test.ts +0 -81
  1179. package/src/components/onboarding/onboarding-wizard.test.tsx +0 -1097
  1180. package/src/components/onboarding/wizard-model.test.ts +0 -67
  1181. package/src/components/pane-settings-dialog.test.tsx +0 -278
  1182. package/src/components/pane-template-wizard.test.tsx +0 -51
  1183. package/src/components/price-sparkline/model.test.ts +0 -27
  1184. package/src/components/quote-flash.test.ts +0 -30
  1185. package/src/components/sign-in-gate.test.tsx +0 -60
  1186. package/src/components/table-view-shared.test.ts +0 -11
  1187. package/src/components/ticker/badge/format.test.ts +0 -66
  1188. package/src/components/ticker/badge/list.test.tsx +0 -84
  1189. package/src/components/ticker/badge/text.test.tsx +0 -223
  1190. package/src/components/ticker/list-table.test.tsx +0 -281
  1191. package/src/components/ui/data-table/opentui/model.test.ts +0 -47
  1192. package/src/components/ui/data-table/visible-range.test.ts +0 -29
  1193. package/src/components/ui/display.desktop.test.tsx +0 -55
  1194. package/src/components/ui/display.test.tsx +0 -36
  1195. package/src/components/ui/external-link.test.tsx +0 -54
  1196. package/src/components/ui/message-composer.test.tsx +0 -81
  1197. package/src/components/ui/page-stack-view.test.tsx +0 -126
  1198. package/src/components/ui/prose.desktop.test.tsx +0 -50
  1199. package/src/components/ui/prose.test.ts +0 -22
  1200. package/src/components/ui/row-value-cache.test.ts +0 -17
  1201. package/src/components/ui/table-layout.test.ts +0 -108
  1202. package/src/components/ui/tabs.test.tsx +0 -114
  1203. package/src/components/ui/ui.test.tsx +0 -984
  1204. package/src/components/use-pane-notice-footer.test.tsx +0 -116
  1205. package/src/core/app-runtime.test.ts +0 -144
  1206. package/src/core/app-services.test.ts +0 -66
  1207. package/src/core/connection-health.test.ts +0 -143
  1208. package/src/data/cached-query.test.ts +0 -95
  1209. package/src/data/config/home.test.ts +0 -70
  1210. package/src/data/config/store/index.test.ts +0 -1241
  1211. package/src/data/memory-resource-store.test.ts +0 -24
  1212. package/src/data/plugin-cache.test.ts +0 -46
  1213. package/src/data/sqlite/cache.test.ts +0 -330
  1214. package/src/data/sqlite/retry.test.ts +0 -84
  1215. package/src/feedback/diagnostics.test.ts +0 -30
  1216. package/src/feedback/redact.test.ts +0 -50
  1217. package/src/feedback/screenshot.test.ts +0 -22
  1218. package/src/i18n/index.test.ts +0 -134
  1219. package/src/i18n/languages.test.ts +0 -34
  1220. package/src/index.tsx +0 -6
  1221. package/src/layout-marketplace/api.test.ts +0 -54
  1222. package/src/layout-marketplace/cloud.test.ts +0 -154
  1223. package/src/layout-marketplace/gallery-desktop.test.tsx +0 -216
  1224. package/src/layout-marketplace/gallery.test.tsx +0 -149
  1225. package/src/layout-marketplace/geometry.test.ts +0 -47
  1226. package/src/layout-marketplace/mini-workspace.test.tsx +0 -69
  1227. package/src/layout-marketplace/model.test.ts +0 -118
  1228. package/src/layout-marketplace/name-dialog.tsx +0 -60
  1229. package/src/layout-marketplace/payload.test.ts +0 -419
  1230. package/src/market-data/coordinator/chart-session.test.ts +0 -152
  1231. package/src/market-data/coordinator/events.test.ts +0 -68
  1232. package/src/market-data/coordinator/fx-refresh.test.ts +0 -199
  1233. package/src/market-data/coordinator/index.test.ts +0 -1174
  1234. package/src/market-data/coordinator/options-sharing.test.ts +0 -79
  1235. package/src/market-data/coordinator/subscriptions.test.ts +0 -652
  1236. package/src/market-data/frame-scheduler.test.ts +0 -82
  1237. package/src/market-data/history-session.test.ts +0 -151
  1238. package/src/market-data/hooks.test.tsx +0 -263
  1239. package/src/market-data/legacy-contract-hooks.test.tsx +0 -49
  1240. package/src/market-data/legacy-contract.test.ts +0 -99
  1241. package/src/market-data/market/format.test.ts +0 -284
  1242. package/src/market-data/market/status.test.ts +0 -26
  1243. package/src/market-data/performance.test.ts +0 -83
  1244. package/src/market-data/portfolio-instrument.test.ts +0 -80
  1245. package/src/market-data/published-us-sessions.test.ts +0 -65
  1246. package/src/market-data/query-store.test.ts +0 -87
  1247. package/src/market-data/quote-subscription-target.test.ts +0 -56
  1248. package/src/market-data/quotes/day-range.test.ts +0 -84
  1249. package/src/market-data/quotes/freshness.test.ts +0 -277
  1250. package/src/market-data/quotes/observation-time.test.ts +0 -98
  1251. package/src/market-data/quotes/price-basis.test.ts +0 -44
  1252. package/src/market-data/quotes/resolution.test.ts +0 -612
  1253. package/src/market-data/quotes/time.test.ts +0 -41
  1254. package/src/market-data/request-types.test.ts +0 -110
  1255. package/src/market-data/snapshot-contract.test.ts +0 -110
  1256. package/src/market-data/snapshot-provider.test.ts +0 -251
  1257. package/src/market-data/ticker-price-returns.test.ts +0 -26
  1258. package/src/news/aggregator.test.ts +0 -596
  1259. package/src/news/hooks.test.tsx +0 -66
  1260. package/src/notifications/app-notifier.test.ts +0 -199
  1261. package/src/pane-settings.test.ts +0 -38
  1262. package/src/plugins/builtin/account-management/model.test.ts +0 -149
  1263. package/src/plugins/builtin/account-management/navigation.test.ts +0 -27
  1264. package/src/plugins/builtin/alerts/alert-engine.test.ts +0 -105
  1265. package/src/plugins/builtin/alerts/events.test.ts +0 -28
  1266. package/src/plugins/builtin/alerts/index.test.tsx +0 -459
  1267. package/src/plugins/builtin/alerts/research.test.ts +0 -75
  1268. package/src/plugins/builtin/analytics/broker-performance.test.ts +0 -79
  1269. package/src/plugins/builtin/analytics/index.test.tsx +0 -657
  1270. package/src/plugins/builtin/analytics/metrics.test.ts +0 -138
  1271. package/src/plugins/builtin/analytics/pane-model.test.ts +0 -191
  1272. package/src/plugins/builtin/analytics/portfolio-identity.test.tsx +0 -272
  1273. package/src/plugins/builtin/analytics/return-window.test.ts +0 -72
  1274. package/src/plugins/builtin/analytics/risk-client.test.ts +0 -100
  1275. package/src/plugins/builtin/analytics/risk-evidence.test.ts +0 -123
  1276. package/src/plugins/builtin/analytics/risk-headless.test.ts +0 -27
  1277. package/src/plugins/builtin/analytics/risk-math.test.ts +0 -95
  1278. package/src/plugins/builtin/analytics/risk-model.test.ts +0 -284
  1279. package/src/plugins/builtin/analytics/sector-model.test.ts +0 -56
  1280. package/src/plugins/builtin/analytics/sharpe-cadence.test.ts +0 -111
  1281. package/src/plugins/builtin/backtest/engine.test.ts +0 -71
  1282. package/src/plugins/builtin/bond-calculator/math.test.ts +0 -97
  1283. package/src/plugins/builtin/bond-calculator/model.test.ts +0 -56
  1284. package/src/plugins/builtin/bond-calculator/pane.test.tsx +0 -84
  1285. package/src/plugins/builtin/broker-manager/index.test.tsx +0 -173
  1286. package/src/plugins/builtin/broker-manager/model.test.ts +0 -145
  1287. package/src/plugins/builtin/buildout/cells.test.tsx +0 -31
  1288. package/src/plugins/builtin/buildout/pane/header.tsx +0 -30
  1289. package/src/plugins/builtin/cds/client.test.ts +0 -103
  1290. package/src/plugins/builtin/cds/headless.test.ts +0 -48
  1291. package/src/plugins/builtin/cds/model.test.ts +0 -242
  1292. package/src/plugins/builtin/cds/pane.test.tsx +0 -139
  1293. package/src/plugins/builtin/central-bank-rates/model.test.ts +0 -84
  1294. package/src/plugins/builtin/changelog/model.test.ts +0 -77
  1295. package/src/plugins/builtin/chart-composer/catalog-inventory.test.ts +0 -105
  1296. package/src/plugins/builtin/chart-composer/editor/model.test.ts +0 -85
  1297. package/src/plugins/builtin/chart-composer/editor.test.tsx +0 -341
  1298. package/src/plugins/builtin/chart-composer/financial-periods.fixture.json +0 -225
  1299. package/src/plugins/builtin/chart-composer/follow-binding.test.tsx +0 -253
  1300. package/src/plugins/builtin/chart-composer/headless.test.ts +0 -158
  1301. package/src/plugins/builtin/chart-composer/loading.test.tsx +0 -134
  1302. package/src/plugins/builtin/chart-composer/pane-share.test.ts +0 -144
  1303. package/src/plugins/builtin/chart-composer/presets.test.ts +0 -672
  1304. package/src/plugins/builtin/chart-composer/quick-add.test.tsx +0 -245
  1305. package/src/plugins/builtin/chart-composer/quote-metadata.test.ts +0 -176
  1306. package/src/plugins/builtin/chart-composer/series-catalog.test.ts +0 -104
  1307. package/src/plugins/builtin/chart-composer/served-cadence-snapshot.test.ts +0 -161
  1308. package/src/plugins/builtin/chart-composer/settings.test.ts +0 -200
  1309. package/src/plugins/builtin/chart-composer/shortcuts.test.ts +0 -44
  1310. package/src/plugins/builtin/chart-composer/use-series-catalog.test.tsx +0 -94
  1311. package/src/plugins/builtin/chart-composer/viewport-labels.test.ts +0 -13
  1312. package/src/plugins/builtin/chat/chat.test.tsx +0 -1481
  1313. package/src/plugins/builtin/chat/composer-commands.test.ts +0 -30
  1314. package/src/plugins/builtin/chat/content/composer-runtime.test.tsx +0 -144
  1315. package/src/plugins/builtin/chat/content/mentions.test.ts +0 -74
  1316. package/src/plugins/builtin/chat/controller/session-lifetime.test.ts +0 -182
  1317. package/src/plugins/builtin/chat/controller/session.test.ts +0 -25
  1318. package/src/plugins/builtin/chat/controller.test.ts +0 -1894
  1319. package/src/plugins/builtin/chat/message/desktop.test.tsx +0 -88
  1320. package/src/plugins/builtin/chat/message/profile-popover.test.tsx +0 -127
  1321. package/src/plugins/builtin/chat/pane-state.test.ts +0 -31
  1322. package/src/plugins/builtin/chat/sidebar.test.tsx +0 -830
  1323. package/src/plugins/builtin/chat/test-harness.test.ts +0 -46
  1324. package/src/plugins/builtin/chat/test-harness.tsx +0 -267
  1325. package/src/plugins/builtin/cloud/askg/controller.test.ts +0 -525
  1326. package/src/plugins/builtin/cloud/askg/conversation-store.test.ts +0 -230
  1327. package/src/plugins/builtin/cloud/askg/executor.test.ts +0 -160
  1328. package/src/plugins/builtin/cloud/askg/manifest.test.ts +0 -153
  1329. package/src/plugins/builtin/cloud/askg/model.test.ts +0 -349
  1330. package/src/plugins/builtin/cloud/askg/pane.test.tsx +0 -356
  1331. package/src/plugins/builtin/cloud/askg/protocol.test.ts +0 -190
  1332. package/src/plugins/builtin/cloud/askg/undo.test.ts +0 -44
  1333. package/src/plugins/builtin/cloud/auth-model.test.ts +0 -67
  1334. package/src/plugins/builtin/cloud/buildout-module.tsx +0 -23
  1335. package/src/plugins/builtin/cloud/device-signin.test.ts +0 -217
  1336. package/src/plugins/builtin/cloud/reveal-in-scroll-box.ts +0 -34
  1337. package/src/plugins/builtin/cloud/team/collections.test.ts +0 -126
  1338. package/src/plugins/builtin/cloud/team/model.test.ts +0 -174
  1339. package/src/plugins/builtin/cloud/team/pane-model.test.ts +0 -114
  1340. package/src/plugins/builtin/cloud/team/pane.test.tsx +0 -234
  1341. package/src/plugins/builtin/cloud/team/store.test.ts +0 -231
  1342. package/src/plugins/builtin/cloud/thesis/board-pane.test.tsx +0 -266
  1343. package/src/plugins/builtin/cloud/thesis/model.test.ts +0 -171
  1344. package/src/plugins/builtin/cloud-tweets/pane-share.test.ts +0 -56
  1345. package/src/plugins/builtin/cloud-tweets/table.test.tsx +0 -125
  1346. package/src/plugins/builtin/congress-trades/aggregates.test.ts +0 -27
  1347. package/src/plugins/builtin/congress-trades/headless.test.ts +0 -113
  1348. package/src/plugins/builtin/congress-trades/model.test.ts +0 -129
  1349. package/src/plugins/builtin/connections/pane.test.tsx +0 -84
  1350. package/src/plugins/builtin/correlation/colors.test.ts +0 -39
  1351. package/src/plugins/builtin/correlation/compute.test.ts +0 -97
  1352. package/src/plugins/builtin/correlation/headless.test.ts +0 -147
  1353. package/src/plugins/builtin/correlation/index.test.tsx +0 -155
  1354. package/src/plugins/builtin/correlation/relationship/history.test.tsx +0 -62
  1355. package/src/plugins/builtin/correlation/relationship/layout.test.ts +0 -17
  1356. package/src/plugins/builtin/cot/model.test.ts +0 -89
  1357. package/src/plugins/builtin/credit-conditions/client.test.ts +0 -122
  1358. package/src/plugins/builtin/credit-conditions/headless.test.ts +0 -35
  1359. package/src/plugins/builtin/credit-conditions/index.test.tsx +0 -136
  1360. package/src/plugins/builtin/credit-conditions/model.test.ts +0 -56
  1361. package/src/plugins/builtin/crypto-board/client.test.ts +0 -51
  1362. package/src/plugins/builtin/crypto-board/model.test.ts +0 -111
  1363. package/src/plugins/builtin/crypto-board/pane.test.tsx +0 -130
  1364. package/src/plugins/builtin/crypto-board/test-fixture.ts +0 -80
  1365. package/src/plugins/builtin/custom-view/live-quotes.test.ts +0 -53
  1366. package/src/plugins/builtin/custom-view/view-spec.test.ts +0 -134
  1367. package/src/plugins/builtin/debt-maturities/debt-maturities.test.ts +0 -317
  1368. package/src/plugins/builtin/dividend-yield/calendar.ts +0 -9
  1369. package/src/plugins/builtin/dividend-yield/client.test.ts +0 -260
  1370. package/src/plugins/builtin/dividend-yield/dividend-source-integrity.test.ts +0 -233
  1371. package/src/plugins/builtin/dividend-yield/headless.test.ts +0 -123
  1372. package/src/plugins/builtin/dividend-yield/pane.test.tsx +0 -351
  1373. package/src/plugins/builtin/dividend-yield/provider-client.test.ts +0 -61
  1374. package/src/plugins/builtin/dividend-yield/reference-price.test.ts +0 -115
  1375. package/src/plugins/builtin/dividend-yield/view.test.ts +0 -81
  1376. package/src/plugins/builtin/earnings/data/cache.test.ts +0 -117
  1377. package/src/plugins/builtin/earnings/detail-model.test.ts +0 -103
  1378. package/src/plugins/builtin/earnings/detail-model.ts +0 -165
  1379. package/src/plugins/builtin/earnings/detail-view.tsx +0 -136
  1380. package/src/plugins/builtin/earnings/estimate-basis.test.ts +0 -184
  1381. package/src/plugins/builtin/earnings/estimate-fixtures.test-data.ts +0 -327
  1382. package/src/plugins/builtin/earnings/headless.test.ts +0 -82
  1383. package/src/plugins/builtin/earnings/model.test.ts +0 -98
  1384. package/src/plugins/builtin/earnings/table.test.ts +0 -76
  1385. package/src/plugins/builtin/earnings/table.ts +0 -246
  1386. package/src/plugins/builtin/earnings-calls/data.test.ts +0 -252
  1387. package/src/plugins/builtin/earnings-calls/headless-freshness.test.ts +0 -41
  1388. package/src/plugins/builtin/earnings-calls/headless.test.ts +0 -258
  1389. package/src/plugins/builtin/earnings-calls/pane.test.tsx +0 -520
  1390. package/src/plugins/builtin/earnings-calls/prose.test.ts +0 -51
  1391. package/src/plugins/builtin/econ/calendar-model.test.ts +0 -82
  1392. package/src/plugins/builtin/econ/fred-cache.test.ts +0 -188
  1393. package/src/plugins/builtin/econ/fred-client.test.ts +0 -79
  1394. package/src/plugins/builtin/econ/index.test.tsx +0 -144
  1395. package/src/plugins/builtin/econ-statistics/client.test.ts +0 -122
  1396. package/src/plugins/builtin/econ-statistics/headless.test.ts +0 -54
  1397. package/src/plugins/builtin/econ-statistics/pane.test.tsx +0 -69
  1398. package/src/plugins/builtin/econ-statistics/transform.test.ts +0 -109
  1399. package/src/plugins/builtin/econ-statistics/transform.ts +0 -94
  1400. package/src/plugins/builtin/econ-statistics/trend.ts +0 -57
  1401. package/src/plugins/builtin/econ-statistics/view.test.ts +0 -43
  1402. package/src/plugins/builtin/equity-screener/headless.test.ts +0 -22
  1403. package/src/plugins/builtin/equity-screener/model.test.ts +0 -116
  1404. package/src/plugins/builtin/equity-screener/results.test.tsx +0 -44
  1405. package/src/plugins/builtin/equity-screener/test-fixture.ts +0 -63
  1406. package/src/plugins/builtin/estimate-revisions/model.test.ts +0 -253
  1407. package/src/plugins/builtin/estimate-revisions/sorting.test.ts +0 -91
  1408. package/src/plugins/builtin/executives/format.test.ts +0 -23
  1409. package/src/plugins/builtin/executives/pane.test.tsx +0 -339
  1410. package/src/plugins/builtin/filing-events/feed.test.ts +0 -143
  1411. package/src/plugins/builtin/filing-events/pane.test.tsx +0 -125
  1412. package/src/plugins/builtin/futures/model.test.ts +0 -151
  1413. package/src/plugins/builtin/futures/pane.test.tsx +0 -219
  1414. package/src/plugins/builtin/futures/table.test.ts +0 -155
  1415. package/src/plugins/builtin/futures-curve/model.test.ts +0 -90
  1416. package/src/plugins/builtin/fx-matrix/export.test.ts +0 -30
  1417. package/src/plugins/builtin/fx-matrix/pairs.test.ts +0 -16
  1418. package/src/plugins/builtin/fx-matrix/pane.test.tsx +0 -109
  1419. package/src/plugins/builtin/fx-matrix/refresh.test.tsx +0 -69
  1420. package/src/plugins/builtin/help/components.tsx +0 -44
  1421. package/src/plugins/builtin/help/keybindings-editor.test.tsx +0 -164
  1422. package/src/plugins/builtin/holders/headless.test.ts +0 -58
  1423. package/src/plugins/builtin/holders/index.test.ts +0 -12
  1424. package/src/plugins/builtin/holders/thirteenf-match.test.ts +0 -30
  1425. package/src/plugins/builtin/insider/amendments.test.ts +0 -112
  1426. package/src/plugins/builtin/insider/headless.test.ts +0 -136
  1427. package/src/plugins/builtin/insider/insider-data.test.ts +0 -66
  1428. package/src/plugins/builtin/insider/pane.test.tsx +0 -112
  1429. package/src/plugins/builtin/iv-history/client.test.ts +0 -18
  1430. package/src/plugins/builtin/iv-history/model.test.ts +0 -87
  1431. package/src/plugins/builtin/jobs/model.test.ts +0 -119
  1432. package/src/plugins/builtin/jobs/pages.test.tsx +0 -103
  1433. package/src/plugins/builtin/kelly-sizer/index.test.tsx +0 -202
  1434. package/src/plugins/builtin/kelly-sizer/model.test.ts +0 -158
  1435. package/src/plugins/builtin/kelly-sizer/view.test.tsx +0 -88
  1436. package/src/plugins/builtin/market-movers/headless.test.ts +0 -34
  1437. package/src/plugins/builtin/market-movers/integrity.test.ts +0 -119
  1438. package/src/plugins/builtin/market-movers/pane-research.test.tsx +0 -138
  1439. package/src/plugins/builtin/market-movers/screener.test.ts +0 -333
  1440. package/src/plugins/builtin/market-valuation/client.test.ts +0 -283
  1441. package/src/plugins/builtin/market-valuation/headless.test.ts +0 -75
  1442. package/src/plugins/builtin/market-valuation/model.test.ts +0 -405
  1443. package/src/plugins/builtin/market-valuation/pane.test.tsx +0 -235
  1444. package/src/plugins/builtin/market-valuation/trend.ts +0 -87
  1445. package/src/plugins/builtin/money-markets/model.test.ts +0 -61
  1446. package/src/plugins/builtin/news/headless.test.ts +0 -149
  1447. package/src/plugins/builtin/news/wire/breaking/filters.test.ts +0 -99
  1448. package/src/plugins/builtin/news/wire/breaking/notifications.test.ts +0 -204
  1449. package/src/plugins/builtin/news/wire/breaking/pane.test.tsx +0 -128
  1450. package/src/plugins/builtin/news/wire/breaking/pane.tsx +0 -89
  1451. package/src/plugins/builtin/news/wire/feed-config.test.ts +0 -109
  1452. package/src/plugins/builtin/news/wire/news/detail-view.test.tsx +0 -279
  1453. package/src/plugins/builtin/news/wire/news/table.test.tsx +0 -223
  1454. package/src/plugins/builtin/news/wire/read-state.test.ts +0 -37
  1455. package/src/plugins/builtin/news/wire/rss/parser.test.ts +0 -178
  1456. package/src/plugins/builtin/news/wire/rss/source.test.ts +0 -153
  1457. package/src/plugins/builtin/notes/files.test.ts +0 -18
  1458. package/src/plugins/builtin/notes/quick-notes-pane.test.tsx +0 -209
  1459. package/src/plugins/builtin/notes/store.test.ts +0 -245
  1460. package/src/plugins/builtin/notes/ticker-notes-tab.test.tsx +0 -350
  1461. package/src/plugins/builtin/options/analytics.test.ts +0 -234
  1462. package/src/plugins/builtin/options/calc-seed.test.ts +0 -130
  1463. package/src/plugins/builtin/options/chain-integrity.test.tsx +0 -284
  1464. package/src/plugins/builtin/options/enrichment-hook.test.tsx +0 -149
  1465. package/src/plugins/builtin/options/enrichment.test.ts +0 -257
  1466. package/src/plugins/builtin/options/expiry-selection.test.tsx +0 -370
  1467. package/src/plugins/builtin/options/footer.test.ts +0 -60
  1468. package/src/plugins/builtin/options/live-quotes.test.ts +0 -421
  1469. package/src/plugins/builtin/options/market-reference.test.ts +0 -36
  1470. package/src/plugins/builtin/options/table.test.ts +0 -100
  1471. package/src/plugins/builtin/options/view.test.tsx +0 -657
  1472. package/src/plugins/builtin/options-calculator/binomial.test.ts +0 -264
  1473. package/src/plugins/builtin/options-calculator/boundary-integrity.test.tsx +0 -114
  1474. package/src/plugins/builtin/options-calculator/evidence.test.ts +0 -138
  1475. package/src/plugins/builtin/options-calculator/headless.test.ts +0 -39
  1476. package/src/plugins/builtin/options-calculator/inputs.test.ts +0 -24
  1477. package/src/plugins/builtin/options-calculator/model.test.ts +0 -242
  1478. package/src/plugins/builtin/options-calculator/pane.test.tsx +0 -305
  1479. package/src/plugins/builtin/options-calculator/surface.test.ts +0 -164
  1480. package/src/plugins/builtin/options-scenario/client.test.ts +0 -143
  1481. package/src/plugins/builtin/options-scenario/evidence.test.ts +0 -34
  1482. package/src/plugins/builtin/options-scenario/live.test.ts +0 -34
  1483. package/src/plugins/builtin/options-scenario/model.test.ts +0 -222
  1484. package/src/plugins/builtin/options-scenario/pane.test.tsx +0 -195
  1485. package/src/plugins/builtin/options-scenario/state.test.ts +0 -62
  1486. package/src/plugins/builtin/plugin-marketplace/model.test.ts +0 -493
  1487. package/src/plugins/builtin/plugin-module.test.ts +0 -101
  1488. package/src/plugins/builtin/portfolio-list/account-metrics.test.ts +0 -243
  1489. package/src/plugins/builtin/portfolio-list/bond-price-basis.test.ts +0 -120
  1490. package/src/plugins/builtin/portfolio-list/cell-version.test.ts +0 -89
  1491. package/src/plugins/builtin/portfolio-list/cli/render.test.ts +0 -261
  1492. package/src/plugins/builtin/portfolio-list/index.test.ts +0 -248
  1493. package/src/plugins/builtin/portfolio-list/live-valuation.test.ts +0 -94
  1494. package/src/plugins/builtin/portfolio-list/metrics.test.ts +0 -562
  1495. package/src/plugins/builtin/portfolio-list/mutations.test.ts +0 -200
  1496. package/src/plugins/builtin/portfolio-list/pane/data.test.ts +0 -54
  1497. package/src/plugins/builtin/portfolio-list/pane/index.test.tsx +0 -1835
  1498. package/src/plugins/builtin/portfolio-list/position-cost-integrity.test.ts +0 -101
  1499. package/src/plugins/builtin/portfolio-list/summary/index.test.ts +0 -184
  1500. package/src/plugins/builtin/portfolio-list/summary/live-accounts.test.tsx +0 -90
  1501. package/src/plugins/builtin/portfolio-list/use-cursor-neighbor-prefetch.test.tsx +0 -96
  1502. package/src/plugins/builtin/portfolio-list/use-throttled-cursor-symbol.test.tsx +0 -166
  1503. package/src/plugins/builtin/portfolio-list/use-throttled-ticker-order.test.tsx +0 -76
  1504. package/src/plugins/builtin/rate-path/model.test.ts +0 -50
  1505. package/src/plugins/builtin/realized-vol/chart-model.test.ts +0 -24
  1506. package/src/plugins/builtin/realized-vol/client.test.ts +0 -193
  1507. package/src/plugins/builtin/realized-vol/model.test.ts +0 -155
  1508. package/src/plugins/builtin/relative-rotation/model.test.ts +0 -194
  1509. package/src/plugins/builtin/research/analyst-headless.test.ts +0 -88
  1510. package/src/plugins/builtin/research/analyst-model.test.ts +0 -125
  1511. package/src/plugins/builtin/research/analyst-pane.test.tsx +0 -162
  1512. package/src/plugins/builtin/research/corporate-actions-pane.test.tsx +0 -77
  1513. package/src/plugins/builtin/research/equity-diagnostic-pane.test.tsx +0 -303
  1514. package/src/plugins/builtin/research/event-model.test.ts +0 -165
  1515. package/src/plugins/builtin/research/events-headless.test.ts +0 -43
  1516. package/src/plugins/builtin/research/headless.test.ts +0 -111
  1517. package/src/plugins/builtin/research/index.test.ts +0 -442
  1518. package/src/plugins/builtin/research/relative-valuation-headless.test.ts +0 -192
  1519. package/src/plugins/builtin/research/relative-valuation-model.test.ts +0 -49
  1520. package/src/plugins/builtin/research/relative-valuation-pane.test.tsx +0 -99
  1521. package/src/plugins/builtin/research-search/command-bar-search.test.ts +0 -81
  1522. package/src/plugins/builtin/research-search/document-view.test.tsx +0 -75
  1523. package/src/plugins/builtin/research-search/model.test.ts +0 -40
  1524. package/src/plugins/builtin/research-search/pane.test.tsx +0 -256
  1525. package/src/plugins/builtin/research-search/snippet.test.ts +0 -78
  1526. package/src/plugins/builtin/risk-factors/data.test.ts +0 -63
  1527. package/src/plugins/builtin/risk-factors/headless.test.ts +0 -40
  1528. package/src/plugins/builtin/risk-factors/pane.test.tsx +0 -56
  1529. package/src/plugins/builtin/risk-factors/test-fixtures.ts +0 -4
  1530. package/src/plugins/builtin/scanner/flow-history.test.tsx +0 -138
  1531. package/src/plugins/builtin/scanner/flow-model.test.ts +0 -180
  1532. package/src/plugins/builtin/scanner/flow-pane.test.tsx +0 -159
  1533. package/src/plugins/builtin/scanner/headless.test.ts +0 -121
  1534. package/src/plugins/builtin/scanner/hilo-model.test.ts +0 -44
  1535. package/src/plugins/builtin/sec/filing-content.test.ts +0 -57
  1536. package/src/plugins/builtin/sec/headless.test.ts +0 -99
  1537. package/src/plugins/builtin/sec/pane.test.tsx +0 -152
  1538. package/src/plugins/builtin/sectors/client.test.ts +0 -228
  1539. package/src/plugins/builtin/sectors/headless.test.ts +0 -87
  1540. package/src/plugins/builtin/sectors/pane-cache.test.tsx +0 -78
  1541. package/src/plugins/builtin/sectors/sector-model.test.ts +0 -119
  1542. package/src/plugins/builtin/shared/auto-refresh.test.tsx +0 -95
  1543. package/src/plugins/builtin/shared/auto-refresh.ts +0 -97
  1544. package/src/plugins/builtin/shared/live-streaming.ts +0 -60
  1545. package/src/plugins/builtin/shared/pane-footer.ts +0 -93
  1546. package/src/plugins/builtin/shared/plan-access.test.ts +0 -69
  1547. package/src/plugins/builtin/shared/plan-access.ts +0 -109
  1548. package/src/plugins/builtin/shared/public-pane.test.ts +0 -12
  1549. package/src/plugins/builtin/shared/read-state.ts +0 -104
  1550. package/src/plugins/builtin/shared/research-cloud-session.test.tsx +0 -143
  1551. package/src/plugins/builtin/shared/screener-live-quotes.test.ts +0 -111
  1552. package/src/plugins/builtin/shared/screener-live-quotes.ts +0 -165
  1553. package/src/plugins/builtin/shared/series-cache.test.ts +0 -106
  1554. package/src/plugins/builtin/shared/table-pane.ts +0 -32
  1555. package/src/plugins/builtin/shared/ticker-request.test.ts +0 -18
  1556. package/src/plugins/builtin/shared/ticker-request.test.tsx +0 -137
  1557. package/src/plugins/builtin/shared/ticker-source.ts +0 -32
  1558. package/src/plugins/builtin/shared/ticker-surface.test.ts +0 -84
  1559. package/src/plugins/builtin/shared/use-quote-board.test.tsx +0 -325
  1560. package/src/plugins/builtin/shared/volatility/live-session.test.ts +0 -91
  1561. package/src/plugins/builtin/shared/volatility/options.test.ts +0 -127
  1562. package/src/plugins/builtin/shared/volatility/realized.test.ts +0 -201
  1563. package/src/plugins/builtin/shared/volatility/realized.ts +0 -292
  1564. package/src/plugins/builtin/shared/volatility/smile.test.ts +0 -209
  1565. package/src/plugins/builtin/short-interest/client.test.ts +0 -55
  1566. package/src/plugins/builtin/short-interest/headless.test.ts +0 -96
  1567. package/src/plugins/builtin/short-interest/pane.test.tsx +0 -57
  1568. package/src/plugins/builtin/short-volume/model.test.ts +0 -39
  1569. package/src/plugins/builtin/thirteenf/api.test.ts +0 -149
  1570. package/src/plugins/builtin/thirteenf/data.test.ts +0 -291
  1571. package/src/plugins/builtin/thirteenf/headless.test.ts +0 -182
  1572. package/src/plugins/builtin/thirteenf/model.test.ts +0 -230
  1573. package/src/plugins/builtin/thirteenf/overlap.test.ts +0 -29
  1574. package/src/plugins/builtin/thirteenf/pane.test.tsx +0 -407
  1575. package/src/plugins/builtin/thirteenf/signals.test.ts +0 -16
  1576. package/src/plugins/builtin/ticker-detail/chart-tab-switch.test.tsx +0 -275
  1577. package/src/plugins/builtin/ticker-detail/data-panes/historical-price-precision.test.tsx +0 -120
  1578. package/src/plugins/builtin/ticker-detail/data-panes/historical-prices.test.tsx +0 -41
  1579. package/src/plugins/builtin/ticker-detail/financials/aggregation.test.ts +0 -79
  1580. package/src/plugins/builtin/ticker-detail/financials/model.test.ts +0 -276
  1581. package/src/plugins/builtin/ticker-detail/financials/period-integrity.test.tsx +0 -78
  1582. package/src/plugins/builtin/ticker-detail/fund-profile.test.tsx +0 -118
  1583. package/src/plugins/builtin/ticker-detail/headless.test.ts +0 -165
  1584. package/src/plugins/builtin/ticker-detail/index.test.tsx +0 -850
  1585. package/src/plugins/builtin/ticker-detail/overview/model.test.ts +0 -118
  1586. package/src/plugins/builtin/ticker-detail/overview-return-coverage.test.tsx +0 -71
  1587. package/src/plugins/builtin/ticker-detail/quote-monitor/card.test.tsx +0 -70
  1588. package/src/plugins/builtin/ticker-detail/quote-monitor/index.test.tsx +0 -261
  1589. package/src/plugins/builtin/ticker-detail/quote-monitor/retained-status.test.tsx +0 -134
  1590. package/src/plugins/builtin/ticker-detail/quote-status.test.tsx +0 -116
  1591. package/src/plugins/builtin/ticker-detail/quote-time-integrity.test.ts +0 -42
  1592. package/src/plugins/builtin/ticker-research-backend-plugin.ts +0 -10
  1593. package/src/plugins/builtin/ticker-research-plugin.ts +0 -61
  1594. package/src/plugins/builtin/time-sales/model.test.ts +0 -83
  1595. package/src/plugins/builtin/time-sales/snapshot-client.test.ts +0 -31
  1596. package/src/plugins/builtin/time-sales/test-fixture.ts +0 -12
  1597. package/src/plugins/builtin/time-sales/use-tape.test.tsx +0 -115
  1598. package/src/plugins/builtin/treasury-auctions/cache.test.ts +0 -215
  1599. package/src/plugins/builtin/treasury-auctions/client.test.ts +0 -207
  1600. package/src/plugins/builtin/treasury-auctions/headless.test.ts +0 -34
  1601. package/src/plugins/builtin/treasury-auctions/model.test.ts +0 -187
  1602. package/src/plugins/builtin/treasury-auctions/pane.test.tsx +0 -174
  1603. package/src/plugins/builtin/vol-surface/client.test.ts +0 -179
  1604. package/src/plugins/builtin/vol-surface/evidence.test.ts +0 -73
  1605. package/src/plugins/builtin/vol-surface/live.test.ts +0 -95
  1606. package/src/plugins/builtin/vol-surface/model.test.ts +0 -243
  1607. package/src/plugins/builtin/vol-surface/pane.test.tsx +0 -265
  1608. package/src/plugins/builtin/vol-surface/raster.test.ts +0 -28
  1609. package/src/plugins/builtin/vol-surface/stored.test.ts +0 -62
  1610. package/src/plugins/builtin/volatility/chart-model.test.ts +0 -61
  1611. package/src/plugins/builtin/volatility/client.test.ts +0 -207
  1612. package/src/plugins/builtin/volatility/evidence.test.ts +0 -49
  1613. package/src/plugins/builtin/volatility/headless.test.ts +0 -52
  1614. package/src/plugins/builtin/volatility/model.test.ts +0 -152
  1615. package/src/plugins/builtin/world-indices/headless.test.ts +0 -32
  1616. package/src/plugins/builtin/world-indices/pane.test.tsx +0 -156
  1617. package/src/plugins/builtin/world-venue-map/map.desktop.test.tsx +0 -45
  1618. package/src/plugins/builtin/world-venue-map/model.test.ts +0 -85
  1619. package/src/plugins/builtin/yield-curve/chart.test.ts +0 -23
  1620. package/src/plugins/builtin/yield-curve/headless.test.ts +0 -40
  1621. package/src/plugins/builtin/yield-curve/history.test.ts +0 -124
  1622. package/src/plugins/builtin/yield-curve/pane.test.tsx +0 -140
  1623. package/src/plugins/builtin/yield-curve/treasury-data.test.ts +0 -35
  1624. package/src/plugins/bundle.test.ts +0 -209
  1625. package/src/plugins/catalog-backend.test.ts +0 -47
  1626. package/src/plugins/catalog-browser.test.ts +0 -72
  1627. package/src/plugins/gridlock-notification.ts +0 -16
  1628. package/src/plugins/host-contract.ts +0 -72
  1629. package/src/plugins/host-link.test.ts +0 -133
  1630. package/src/plugins/host-module-imports.test.ts +0 -94
  1631. package/src/plugins/host-module-imports.ts +0 -73
  1632. package/src/plugins/host-resolver.test.ts +0 -96
  1633. package/src/plugins/launch-layout.test.ts +0 -131
  1634. package/src/plugins/loader.test.ts +0 -54
  1635. package/src/plugins/pane-manager.test.ts +0 -309
  1636. package/src/plugins/registry/index.test.ts +0 -601
  1637. package/src/plugins/registry/pane-settings.test.ts +0 -98
  1638. package/src/plugins/registry/setup-command.test.ts +0 -62
  1639. package/src/plugins/runtime/index.test.tsx +0 -328
  1640. package/src/plugins/seed.test.ts +0 -136
  1641. package/src/plugins/ticker-navigation.test.ts +0 -141
  1642. package/src/public/public-api.test.ts +0 -42
  1643. package/src/react/async-resource.test.tsx +0 -124
  1644. package/src/react/input.test.ts +0 -182
  1645. package/src/remote/controller.test.ts +0 -585
  1646. package/src/remote/json-patch.test.ts +0 -31
  1647. package/src/remote/schema.test.ts +0 -65
  1648. package/src/remote/semantic-tree.test.tsx +0 -105
  1649. package/src/remote/server.test.ts +0 -50
  1650. package/src/renderers/browser/bundled-plugins.test.ts +0 -41
  1651. package/src/renderers/browser/cloud-transport.test.ts +0 -68
  1652. package/src/renderers/browser/config-host.test.ts +0 -70
  1653. package/src/renderers/browser/deeplink-bridge.test.ts +0 -56
  1654. package/src/renderers/browser/error-boundary.tsx +0 -23
  1655. package/src/renderers/browser/http-proxy-transport.test.ts +0 -98
  1656. package/src/renderers/browser/research-entry.test.ts +0 -32
  1657. package/src/renderers/browser/storage.test.ts +0 -66
  1658. package/src/renderers/cloudflare/http-proxy.test.ts +0 -122
  1659. package/src/renderers/cloudflare/worker.test.ts +0 -155
  1660. package/src/renderers/electrobun/bun/application-menu/click.test.ts +0 -55
  1661. package/src/renderers/electrobun/bun/context-menu/click.test.ts +0 -67
  1662. package/src/renderers/electrobun/bun/context-menu/normalize.test.ts +0 -52
  1663. package/src/renderers/electrobun/bun/desktop/capability-bridge.test.ts +0 -112
  1664. package/src/renderers/electrobun/bun/desktop/http-fetch.test.ts +0 -89
  1665. package/src/renderers/electrobun/bun/desktop/http-stream.test.ts +0 -200
  1666. package/src/renderers/electrobun/bun/desktop/initialization.test.ts +0 -27
  1667. package/src/renderers/electrobun/bun/desktop/window-controls.test.ts +0 -53
  1668. package/src/renderers/electrobun/bun/desktop/window-controls.ts +0 -75
  1669. package/src/renderers/electrobun/bun/desktop/window-events.ts +0 -49
  1670. package/src/renderers/electrobun/bun/desktop/window-style.ts +0 -34
  1671. package/src/renderers/electrobun/bun/desktop/windows-custom-chrome.ts +0 -58
  1672. package/src/renderers/electrobun/bun/desktop/windows-icons.ts +0 -70
  1673. package/src/renderers/electrobun/bun/desktop/windows-native.ts +0 -75
  1674. package/src/renderers/electrobun/bun/desktop/workspace/index.test.ts +0 -147
  1675. package/src/renderers/electrobun/bun/window/frame.test.ts +0 -47
  1676. package/src/renderers/electrobun/view/application-menu-bridge.ts +0 -12
  1677. package/src/renderers/electrobun/view/cli-pane-shot-frame.test.tsx +0 -76
  1678. package/src/renderers/electrobun/view/cli-pane-shot-health.test.ts +0 -25
  1679. package/src/renderers/electrobun/view/context-menu.test.ts +0 -146
  1680. package/src/renderers/electrobun/view/data-table/frozen-column.test.tsx +0 -73
  1681. package/src/renderers/electrobun/view/data-table/horizontal-navigation.test.tsx +0 -82
  1682. package/src/renderers/electrobun/view/data-table/index.test.tsx +0 -127
  1683. package/src/renderers/electrobun/view/desktop/controls.test.tsx +0 -161
  1684. package/src/renderers/electrobun/view/desktop/list-view.test.tsx +0 -37
  1685. package/src/renderers/electrobun/view/desktop/window/snapshot.test.ts +0 -57
  1686. package/src/renderers/electrobun/view/desktop-deeplink-bridge.ts +0 -10
  1687. package/src/renderers/electrobun/view/dialog-host.test.ts +0 -25
  1688. package/src/renderers/electrobun/view/dialog-stack.test.tsx +0 -73
  1689. package/src/renderers/electrobun/view/external-plugins.test.ts +0 -57
  1690. package/src/renderers/electrobun/view/history-metadata-rpc.test.ts +0 -62
  1691. package/src/renderers/electrobun/view/host/ascii-text.test.ts +0 -48
  1692. package/src/renderers/electrobun/view/host/box.test.tsx +0 -171
  1693. package/src/renderers/electrobun/view/host/focus-scope.test.ts +0 -37
  1694. package/src/renderers/electrobun/view/host/scroll-box.desktop.test.tsx +0 -46
  1695. package/src/renderers/electrobun/view/host/style.test.ts +0 -15
  1696. package/src/renderers/electrobun/view/host/surface-3d.test.ts +0 -33
  1697. package/src/renderers/electrobun/view/input-host.test.tsx +0 -104
  1698. package/src/renderers/electrobun/view/key-event.test.ts +0 -34
  1699. package/src/renderers/electrobun/view/native-stubs/chart/kitty-support.ts +0 -19
  1700. package/src/renderers/electrobun/view/native-stubs/chart/surface-manager.ts +0 -36
  1701. package/src/renderers/electrobun/view/native-stubs/ibkr-native-loader.ts +0 -3
  1702. package/src/renderers/electrobun/view/native-stubs/native-stubs.test.ts +0 -42
  1703. package/src/renderers/electrobun/view/notes-files.ts +0 -56
  1704. package/src/renderers/electrobun/view/remote/backend-quote-subscription.test.ts +0 -87
  1705. package/src/renderers/electrobun/view/remote/capability-invoker.test.ts +0 -96
  1706. package/src/renderers/electrobun/view/remote/connection-health-backend.ts +0 -19
  1707. package/src/renderers/electrobun/view/remote/connection-health.test.ts +0 -44
  1708. package/src/renderers/electrobun/view/remote/quote-subscription-registry.test.ts +0 -86
  1709. package/src/renderers/electrobun/view/rpc-codec.test.ts +0 -112
  1710. package/src/renderers/electrobun/view/screenshot-watermark.test.ts +0 -48
  1711. package/src/renderers/electrobun/view/toast-host.test.tsx +0 -61
  1712. package/src/renderers/opentui/chart-surface.test.tsx +0 -147
  1713. package/src/renderers/opentui/image/loader.test.ts +0 -25
  1714. package/src/renderers/opentui/interaction-performance.test.ts +0 -79
  1715. package/src/renderers/opentui/terminal-media.test.ts +0 -173
  1716. package/src/renderers/share/chart.test.ts +0 -52
  1717. package/src/renderers/share/layout-view.test.tsx +0 -58
  1718. package/src/renderers/share/view.test.tsx +0 -120
  1719. package/src/shares/api.test.ts +0 -120
  1720. package/src/shares/location.test.ts +0 -19
  1721. package/src/shares/pane.test.ts +0 -110
  1722. package/src/sources/asml-earnings.test.ts +0 -197
  1723. package/src/sources/fixtures/sec-operating-expenses.json +0 -163
  1724. package/src/sources/fixtures/shop-20251231-quarterly-summary.html +0 -1
  1725. package/src/sources/fixtures/shop-20260630-quarterly-summary.html +0 -1
  1726. package/src/sources/fixtures/shop-operating-provider.json +0 -141
  1727. package/src/sources/fixtures/shop-quarterly-summary-provenance.json +0 -24
  1728. package/src/sources/fixtures/shop-submissions-20260922.json +0 -31
  1729. package/src/sources/gloomberb-cloud/history-coverage.test.ts +0 -119
  1730. package/src/sources/gloomberb-cloud/history-retention.test.ts +0 -207
  1731. package/src/sources/gloomberb-cloud/history-session.test.ts +0 -76
  1732. package/src/sources/gloomberb-cloud/index.test.ts +0 -1116
  1733. package/src/sources/gloomberb-cloud/normalizers.test.ts +0 -135
  1734. package/src/sources/gloomberb-cloud/quote-metadata.test.ts +0 -50
  1735. package/src/sources/gloomberb-cloud/valuation-observations.ts +0 -29
  1736. package/src/sources/history-coverage.test.ts +0 -40
  1737. package/src/sources/listing-history.ts +0 -52
  1738. package/src/sources/provider-router/arca-cache.test.ts +0 -97
  1739. package/src/sources/provider-router/asml-earnings-cache.test.ts +0 -158
  1740. package/src/sources/provider-router/broker-session.test.ts +0 -52
  1741. package/src/sources/provider-router/cache.test.ts +0 -133
  1742. package/src/sources/provider-router/cached-financials.test.ts +0 -711
  1743. package/src/sources/provider-router/cached-listing-identity.test.ts +0 -159
  1744. package/src/sources/provider-router/cached-routes.test.ts +0 -232
  1745. package/src/sources/provider-router/connection-health.test.ts +0 -28
  1746. package/src/sources/provider-router/financials.test.ts +0 -209
  1747. package/src/sources/provider-router/fixtures/quarterly-source-disagreements.json +0 -438
  1748. package/src/sources/provider-router/fixtures/shop-nasdaqgs.json +0 -137
  1749. package/src/sources/provider-router/history-boundary-cache.test.ts +0 -72
  1750. package/src/sources/provider-router/history-calendar-cache.test.ts +0 -301
  1751. package/src/sources/provider-router/history-exact-window.test.ts +0 -187
  1752. package/src/sources/provider-router/history-gap-cache.test.ts +0 -84
  1753. package/src/sources/provider-router/history-gaps.test.ts +0 -141
  1754. package/src/sources/provider-router/history-retention.test.ts +0 -239
  1755. package/src/sources/provider-router/history-session.test.ts +0 -138
  1756. package/src/sources/provider-router/history.test.ts +0 -780
  1757. package/src/sources/provider-router/index.test.ts +0 -1990
  1758. package/src/sources/provider-router/listing-history.test.ts +0 -139
  1759. package/src/sources/provider-router/listing-identity.test.ts +0 -128
  1760. package/src/sources/provider-router/nasdaqgs-listing.test.ts +0 -78
  1761. package/src/sources/provider-router/news.test.ts +0 -34
  1762. package/src/sources/provider-router/non-company-metadata.test.ts +0 -95
  1763. package/src/sources/provider-router/o-income-basis.test.ts +0 -64
  1764. package/src/sources/provider-router/operating-result-cache.test.ts +0 -44
  1765. package/src/sources/provider-router/operating-result-retry.test.ts +0 -221
  1766. package/src/sources/provider-router/profile-enrichment.test.ts +0 -168
  1767. package/src/sources/provider-router/quote-completion.test.ts +0 -62
  1768. package/src/sources/provider-router/quote-domain.test.ts +0 -92
  1769. package/src/sources/provider-router/quote-route.test.ts +0 -255
  1770. package/src/sources/provider-router/realtime-access.test.ts +0 -22
  1771. package/src/sources/provider-router/routing.test.ts +0 -39
  1772. package/src/sources/provider-router/search.test.ts +0 -191
  1773. package/src/sources/provider-router/shell-history-cache.test.ts +0 -131
  1774. package/src/sources/provider-router/statement-history.test.ts +0 -71
  1775. package/src/sources/provider-router/statement-observations.test.ts +0 -162
  1776. package/src/sources/provider-router/valuation-retractions.test.ts +0 -280
  1777. package/src/sources/reported-operating-results.test.ts +0 -286
  1778. package/src/sources/sec-bank-revenue.test.ts +0 -79
  1779. package/src/sources/sec-edgar-shares.fixture.json +0 -188
  1780. package/src/sources/sec-edgar-shares.test.ts +0 -66
  1781. package/src/sources/sec-edgar.test.ts +0 -924
  1782. package/src/sources/sec-income-attribution.test.ts +0 -93
  1783. package/src/sources/sec-operating-expenses.test.ts +0 -42
  1784. package/src/sources/yahoo-finance/fixtures/aapl-final-observation.json +0 -20
  1785. package/src/sources/yahoo-finance/history-session.test.ts +0 -120
  1786. package/src/sources/yahoo-finance/history.test.ts +0 -47
  1787. package/src/sources/yahoo-finance/mappers.test.ts +0 -176
  1788. package/src/sources/yahoo-finance/options.test.ts +0 -23
  1789. package/src/sources/yahoo-finance/requests.test.ts +0 -119
  1790. package/src/sources/yahoo-finance/snapshots.test.ts +0 -225
  1791. package/src/sources/yahoo-finance/symbols.test.ts +0 -18
  1792. package/src/sources/yahoo-finance.test.ts +0 -330
  1793. package/src/state/app/activity.test.ts +0 -54
  1794. package/src/state/app/bootstrap.test.ts +0 -664
  1795. package/src/state/app/context/index.test.ts +0 -604
  1796. package/src/state/app/context/index.test.tsx +0 -347
  1797. package/src/state/app/context/selector.test.tsx +0 -424
  1798. package/src/state/hooks/inline-ticker-failures.test.ts +0 -77
  1799. package/src/state/hooks/inline-tickers.test.tsx +0 -253
  1800. package/src/state/hooks/live-ticker-financials.test.tsx +0 -120
  1801. package/src/state/hooks/quote-streaming.test.ts +0 -44
  1802. package/src/state/hooks/quote-streaming.test.tsx +0 -442
  1803. package/src/state/persist-scheduler.test.ts +0 -151
  1804. package/src/state/selectors-ui.ts +0 -47
  1805. package/src/state/selectors.ts +0 -27
  1806. package/src/state/session-persistence.test.ts +0 -187
  1807. package/src/state/ticker-refresh-queue.test.ts +0 -46
  1808. package/src/sync/auth-transition.test.ts +0 -36
  1809. package/src/sync/controller.test.ts +0 -527
  1810. package/src/sync/core-contributors.test.ts +0 -643
  1811. package/src/test-support/fixtures/asml-earnings.json +0 -993
  1812. package/src/theme/colors.test.ts +0 -85
  1813. package/src/theme/font-scale.test.ts +0 -14
  1814. package/src/theme/theme-context.test.tsx +0 -67
  1815. package/src/theme/themes.test.ts +0 -100
  1816. package/src/tickers/instrument-kind.test.ts +0 -21
  1817. package/src/tickers/instrument-label.test.ts +0 -13
  1818. package/src/tickers/list.test.ts +0 -17
  1819. package/src/tickers/open-target.test.ts +0 -86
  1820. package/src/tickers/search/index.test.ts +0 -950
  1821. package/src/tickers/search-contract-context.test.tsx +0 -161
  1822. package/src/tickers/search-contract-templates.test.ts +0 -83
  1823. package/src/tickers/search-issuer-grouping.test.ts +0 -74
  1824. package/src/tickers/search-listing-ranking.test.tsx +0 -122
  1825. package/src/tickers/tokenizer.test.ts +0 -31
  1826. package/src/time-series/bond-price-history.test.ts +0 -52
  1827. package/src/time-series/calendar-month-end-resolution.test.ts +0 -106
  1828. package/src/time-series/calendar-window-resolution.test.ts +0 -133
  1829. package/src/time-series/chart-data.test.ts +0 -288
  1830. package/src/time-series/date-window.test.ts +0 -113
  1831. package/src/time-series/economic.test.ts +0 -44
  1832. package/src/time-series/financial-history-request.test.ts +0 -20
  1833. package/src/time-series/financial-period-coverage.test.ts +0 -37
  1834. package/src/time-series/financial-period-gaps.test.ts +0 -128
  1835. package/src/time-series/fixtures/q4-reported-common-income.json +0 -394
  1836. package/src/time-series/fixtures/q4-reported-per-share.json +0 -305
  1837. package/src/time-series/fixtures/quote-store.ts +0 -55
  1838. package/src/time-series/forward-valuation.test.ts +0 -131
  1839. package/src/time-series/fundamentals.test.ts +0 -592
  1840. package/src/time-series/history-retention.test.ts +0 -141
  1841. package/src/time-series/history-session-cache.test.ts +0 -250
  1842. package/src/time-series/hooks.test.ts +0 -59
  1843. package/src/time-series/legacy-contract-live.test.ts +0 -22
  1844. package/src/time-series/live-bars.test.ts +0 -290
  1845. package/src/time-series/live-quotes.test.ts +0 -208
  1846. package/src/time-series/market-price-units.test.ts +0 -75
  1847. package/src/time-series/parsed-history-identity.test.tsx +0 -142
  1848. package/src/time-series/price-comparison.test.ts +0 -233
  1849. package/src/time-series/price-history-integrity-window.test.ts +0 -137
  1850. package/src/time-series/price-history-integrity.test.ts +0 -195
  1851. package/src/time-series/q4-common-income.test.ts +0 -63
  1852. package/src/time-series/q4-per-share.test.ts +0 -144
  1853. package/src/time-series/realized-vol-study.test.ts +0 -189
  1854. package/src/time-series/reporting-currency.test.ts +0 -99
  1855. package/src/time-series/resolution.test.ts +0 -132
  1856. package/src/time-series/resolve.test.ts +0 -2471
  1857. package/src/time-series/sec-eps-research.test.ts +0 -55
  1858. package/src/time-series/seed-cadence.test.tsx +0 -219
  1859. package/src/time-series/served-cadence-consumers.test.ts +0 -52
  1860. package/src/time-series/session-history-domain.test.ts +0 -160
  1861. package/src/time-series/spec-studies.test.ts +0 -619
  1862. package/src/time-series/transforms.test.ts +0 -216
  1863. package/src/time-series/use-chart-resolution.test.tsx +0 -632
  1864. package/src/time-series/valuation-currency.test.ts +0 -129
  1865. package/src/time-series/valuation-denominator.test.ts +0 -240
  1866. package/src/time-series/valuation-live-status.test.ts +0 -64
  1867. package/src/time-series/valuation-price.test.ts +0 -267
  1868. package/src/types/config.test.ts +0 -161
  1869. package/src/ui/context-menu.test.ts +0 -95
  1870. package/src/ui/qr.test.ts +0 -79
  1871. package/src/updater/github-releases.test.ts +0 -41
  1872. package/src/updater.test.ts +0 -561
  1873. package/src/updater.ts +0 -480
  1874. package/src/utils/calendar-date.test.ts +0 -18
  1875. package/src/utils/cli-output.test.ts +0 -43
  1876. package/src/utils/csv.test.ts +0 -13
  1877. package/src/utils/currency-units.test.ts +0 -66
  1878. package/src/utils/dom-screenshot.test.ts +0 -52
  1879. package/src/utils/double-escape-close.test.ts +0 -33
  1880. package/src/utils/earnings-result.ts +0 -35
  1881. package/src/utils/exchange-rate-map.ts +0 -9
  1882. package/src/utils/exchange-rate-snapshot.test.ts +0 -33
  1883. package/src/utils/exchanges.test.ts +0 -62
  1884. package/src/utils/external-url.test.ts +0 -32
  1885. package/src/utils/financial-statements.test.ts +0 -211
  1886. package/src/utils/format.test.ts +0 -61
  1887. package/src/utils/fuzzy-search.test.ts +0 -94
  1888. package/src/utils/fx-market-hours.test.ts +0 -28
  1889. package/src/utils/fx-status.test.ts +0 -16
  1890. package/src/utils/html-entities.test.ts +0 -8
  1891. package/src/utils/inline-content-tokenizer.test.ts +0 -31
  1892. package/src/utils/instrument-identity.test.ts +0 -26
  1893. package/src/utils/latest-financial-period.test.ts +0 -19
  1894. package/src/utils/link-tokenizer.test.ts +0 -27
  1895. package/src/utils/main-thread-monitor.ts +0 -127
  1896. package/src/utils/main-thread-stall.test.ts +0 -59
  1897. package/src/utils/market-capitalization-consumers.test.ts +0 -59
  1898. package/src/utils/market-capitalization.test.ts +0 -38
  1899. package/src/utils/operating-result-aggregation.ts +0 -106
  1900. package/src/utils/operating-result-consumers.test.ts +0 -212
  1901. package/src/utils/operating-result.ts +0 -100
  1902. package/src/utils/options.test.ts +0 -20
  1903. package/src/utils/price-earnings.test.ts +0 -39
  1904. package/src/utils/price-history.test.ts +0 -230
  1905. package/src/utils/relative-time.ts +0 -8
  1906. package/src/utils/reported-earnings-result.ts +0 -336
  1907. package/src/utils/reported-money.test.ts +0 -25
  1908. package/src/utils/reported-operating-result.ts +0 -271
  1909. package/src/utils/save-text-file.test.ts +0 -24
  1910. package/src/utils/sec-eps-basis.test.ts +0 -82
  1911. package/src/utils/sec.test.ts +0 -60
  1912. package/src/utils/semver.test.ts +0 -31
  1913. package/src/utils/shop-operating-table.ts +0 -230
  1914. package/src/utils/shortcut-labels.test.ts +0 -20
  1915. package/src/utils/sort-values.test.ts +0 -11
  1916. package/src/utils/statement-observations.ts +0 -129
  1917. package/src/utils/throttled-fetch.test.ts +0 -186
  1918. package/src/utils/tweet-text.test.ts +0 -13
@@ -1,2471 +0,0 @@
1
- import { FINANCIAL_VINTAGE_NOTICE } from "../utils/financial-statements";
2
- import { describe, expect, spyOn, test } from "bun:test";
3
- import { chartSeriesSourceKey } from "../capabilities";
4
- import type { FredSeriesData, FredSeriesLoadResult } from "../data/fred-series";
5
- import { buildCustomChartPreset } from "../plugins/builtin/chart-composer/presets";
6
- import { createTestDataProvider } from "../test-support/data-provider";
7
- import type { TickerFinancials } from "../types/financials";
8
- import { chartQuoteOverrideKeyForSource } from "./live-quotes";
9
- import {
10
- ChartResolveCache,
11
- mergePriceHistoryWindows,
12
- resolveChartSpecData,
13
- seedChartResolutionResult,
14
- } from "./resolve";
15
- import { CHART_SPEC_VERSION, type ChartSeriesSpec, type ChartSpec } from "./types";
16
-
17
- function chartSeries(input: Pick<ChartSeriesSpec, "source"> & Partial<ChartSeriesSpec>): ChartSeriesSpec {
18
- return { id: "price", style: "line", transform: "raw", axis: "left", panelId: "main", interpolation: "none", ...input };
19
- }
20
-
21
- function chartSpec(input: Pick<ChartSpec, "viewport" | "series"> & Partial<ChartSpec>): ChartSpec {
22
- return { version: CHART_SPEC_VERSION, panels: [{ id: "main" }], studies: [], ...input };
23
- }
24
-
25
- const emptyFinancials = (): TickerFinancials => ({
26
- annualStatements: [],
27
- quarterlyStatements: [],
28
- priceHistory: [],
29
- });
30
-
31
- const fredLoad = (
32
- data: FredSeriesData = { observations: [], info: null },
33
- overrides: Partial<FredSeriesLoadResult> = {},
34
- ): FredSeriesLoadResult => ({
35
- data,
36
- fetchedAt: Date.parse("2026-03-01T00:00:00Z"),
37
- stale: false,
38
- source: "network",
39
- ...overrides,
40
- });
41
-
42
- describe("resolveChartSpecData", () => {
43
- test("credit stress windows disclose source coverage without clipping buffers or scaling effective yields", async () => {
44
- const spec = buildCustomChartPreset("FRED:BAMLC0A0CM,FRED:BAMLC0A0CMEY");
45
- const requests: string[] = [];
46
- const sources = {
47
- now: new Date("2026-09-11"),
48
- loadFredSeries: async (request: { seriesId: string; startDate?: string }) => {
49
- requests.push(request.startDate!);
50
- const yieldSeries = request.seriesId.endsWith("EY");
51
- return fredLoad({
52
- observations: [
53
- { date: "2023-09-12", value: yieldSeries ? 5.82 : 1.23 },
54
- { date: "2025-04-09", value: yieldSeries ? 5.5 : 1.21 },
55
- { date: "2026-09-10", value: yieldSeries ? 5.68 : 0.8 },
56
- ],
57
- info: { id: request.seriesId, title: yieldSeries ? "IG effective yield" : "IG OAS", units: "Percent",
58
- frequency: "Daily, Close", seasonalAdjustment: "Not Seasonally Adjusted", source: "FRED", notes: "",
59
- observationStart: "2023-09-12", observationEnd: "2026-09-10" },
60
- });
61
- },
62
- };
63
- const fiveYear = await resolveChartSpecData(spec, sources);
64
- expect(fiveYear.warnings.filter((warning) => warning.includes("FRED coverage"))).toHaveLength(2);
65
- expect(fiveYear.warnings.some((warning) => warning.includes("vintage dates"))).toBe(true);
66
- expect(fiveYear.series.map((series) => series.points.at(-1)?.value)).toEqual([0.8, 5.68]);
67
- expect(fiveYear.series.map((series) => series.unit)).toEqual(["%", "%"]);
68
- const recent = await resolveChartSpecData({ ...spec, viewport: { ...spec.viewport, range: "1Y" } }, sources);
69
- expect(requests.at(-1)! < "2023-09-12").toBe(true); // Calculation buffer predates the visible window.
70
- expect(recent.warnings.some((warning) => warning.includes("FRED coverage"))).toBe(false);
71
- const old = await resolveChartSpecData({ ...spec, viewport: { ...spec.viewport,
72
- dateWindow: { start: "2020-01-01", end: "2020-06-30" } } }, sources);
73
- expect(old.series.every((series) => series.points.length === 0)).toBe(true);
74
- expect(old.warnings.filter((warning) => warning.includes("Earlier dates are unavailable"))).toHaveLength(2);
75
- expect(old.viewport.start?.toISOString().slice(0, 10)).toBe("2020-01-01");
76
- });
77
-
78
- test("credit history keeps newer observations when source coverage metadata lags", async () => {
79
- const spec = buildCustomChartPreset("FRED:BAMLC0A0CM");
80
- spec.viewport.dateWindow = { start: "2021-09-16", end: "2026-09-16" };
81
- const data: FredSeriesData = {
82
- observations: [{ date: "2023-09-18", value: 1.22 }, { date: "2026-09-14", value: 0.8 }],
83
- info: { id: "BAMLC0A0CM", title: "IG OAS", units: "Percent", frequency: "Daily, Close",
84
- seasonalAdjustment: "Not Seasonally Adjusted", source: "FRED", notes: "",
85
- observationStart: "2023-09-12", observationEnd: "2026-09-10" },
86
- };
87
- const sources = { loadFredSeries: async () => fredLoad(data) };
88
- const before = await resolveChartSpecData(spec, sources);
89
- expect(before.series[0]?.points.at(-1)?.value).toBe(0.8);
90
- expect(before.series[0]?.points.at(-1)?.date.toISOString()).toBe("2026-09-14T00:00:00.000Z");
91
- expect(before.warnings.some((warning) => warning.includes("exact coverage dates are unavailable"))).toBe(true);
92
- expect(before.warnings.some((warning) => warning.includes("2026-09-10"))).toBe(false);
93
- data.info = { ...data.info!, observationStart: "2023-09-18", observationEnd: "2026-09-14" };
94
- const recovered = await resolveChartSpecData(spec, sources);
95
- expect(recovered.series[0]?.points).toEqual(before.series[0]?.points);
96
- expect(recovered.warnings.some((warning) => warning.includes("2023-09-18 to 2026-09-14"))).toBe(true);
97
- expect(recovered.warnings.some((warning) => warning.includes("exact coverage dates are unavailable"))).toBe(false);
98
- });
99
-
100
- test("qualified price charts retain quote metadata without injecting the fetched snapshot into history", async () => {
101
- let quoteCalls = 0;
102
- let financialCalls = 0;
103
- const history = [{ date: new Date("2026-01-15"), close: 77.53, volume: 1234 }];
104
- const provider = createTestDataProvider({
105
- getQuote: async () => { quoteCalls++; return { symbol: "NESN", listingExchangeName: "SWX", currency: "CHF", instrumentType: "EQUITY", price: 999, change: 0, changePercent: 0, lastUpdated: Date.parse("2026-01-16") }; },
106
- getTickerFinancials: async () => { financialCalls++; return emptyFinancials(); },
107
- getPriceHistory: async () => history,
108
- getPriceHistoryForResolution: async () => history,
109
- });
110
- const spec = chartSpec({ viewport: { range: "1M", resolution: "1d" }, series: [chartSeries({ source: { kind: "security", instrument: { symbol: "NESN", exchange: "SWX" }, fieldId: "market.close" } })] });
111
- const cache = new ChartResolveCache();
112
- const sources = { dataProvider: provider, loadFredSeries: async () => fredLoad(), now: new Date("2026-01-16") };
113
- const result = await resolveChartSpecData(spec, sources, cache);
114
- expect(result.series[0]).toMatchObject({ unit: "CHF/share", unitGroup: "price:CHF", volumeUnit: "shares" });
115
- expect(result.series[0]?.points.map((point) => point.value)).toEqual([77.53]);
116
- await resolveChartSpecData(spec, sources, cache);
117
- expect(quoteCalls).toBe(1);
118
- expect(financialCalls).toBe(0);
119
-
120
- const unavailable = createTestDataProvider({
121
- // Optional metadata can also fail synchronously in a provider adapter.
122
- getQuote: () => { throw new Error("Quote temporarily unavailable"); },
123
- getPriceHistory: async () => history,
124
- getPriceHistoryForResolution: async () => history,
125
- });
126
- const withoutMetadata = await resolveChartSpecData(spec, { ...sources, dataProvider: unavailable });
127
- expect(withoutMetadata.errors).toEqual([]);
128
- expect(withoutMetadata.series[0]?.points.map((point) => point.value)).toEqual([77.53]);
129
- expect(withoutMetadata.series[0]?.unit).toBe("currency");
130
- });
131
-
132
- test("seeds study series so their panels survive the wait for real data", async () => {
133
- const date = new Date("2026-01-05T00:00:00.000Z");
134
- const seeded = seedChartResolutionResult(
135
- chartSpec({
136
- viewport: { range: "1M", resolution: "auto" },
137
- panels: [{ id: "main" }, { id: "volume" }],
138
- series: [chartSeries({
139
- source: {
140
- kind: "security",
141
- instrument: { symbol: "TEST", exchange: "NASDAQ" },
142
- fieldId: "market.ohlcv",
143
- },
144
- style: "candles",
145
- })],
146
- studies: [{
147
- id: "volume",
148
- kind: "volume",
149
- inputSeriesIds: ["price"],
150
- parameters: {},
151
- panelId: "volume",
152
- axis: "left",
153
- }],
154
- }),
155
- new Map([[
156
- chartQuoteOverrideKeyForSource({
157
- kind: "security",
158
- instrument: { symbol: "TEST", exchange: "NASDAQ" },
159
- fieldId: "market.ohlcv",
160
- }),
161
- [{ date, open: 10, high: 12, low: 9, close: 11, volume: 5_000 }],
162
- ]]),
163
- );
164
-
165
- const volume = seeded?.series.find((entry) => entry.panelId === "volume");
166
- expect(volume?.points.map((point) => point.value)).toEqual([5_000]);
167
- expect(seeded?.bufferedSeries?.find((entry) => entry.panelId === "volume")?.points).toHaveLength(1);
168
- });
169
-
170
- test("a currency-only live quote still loads security type without replacing its price", async () => {
171
- let quoteCalls = 0;
172
- let financialCalls = 0;
173
- const source = { kind: "security" as const, instrument: { symbol: "NVDA", exchange: "XNAS" }, fieldId: "market.close" };
174
- const history = [{ date: new Date("2026-01-15T14:30:00Z"), close: 77.53, volume: 1234 }];
175
- const provider = createTestDataProvider({
176
- getQuote: async () => { quoteCalls++; return { symbol: "NVDA", listingExchangeName: "NASDAQ", currency: "USD", instrumentType: "Common Stock", price: 999, change: 0, changePercent: 0, lastUpdated: Date.parse("2026-01-16T16:00:00Z") }; },
177
- getTickerFinancials: async () => { financialCalls++; return emptyFinancials(); },
178
- getPriceHistory: async () => history,
179
- getPriceHistoryForResolution: async () => history,
180
- });
181
- const spec = chartSpec({ viewport: { range: "1M", resolution: "1d" }, series: [chartSeries({ source })],
182
- studies: [{ id: "volume", kind: "volume", inputSeriesIds: ["price"], parameters: {}, panelId: "main", axis: "left" }] });
183
- const sources = { dataProvider: provider, loadFredSeries: async () => fredLoad(), now: new Date("2026-01-16T16:00:00Z"),
184
- quoteOverrides: new Map([[chartQuoteOverrideKeyForSource(source), { symbol: "NVDA", currency: "USD", price: 78, change: 0, changePercent: 0, lastUpdated: Date.parse("2026-01-16T16:00:00Z") }]]) };
185
- const cache = new ChartResolveCache();
186
- const result = await resolveChartSpecData(spec, sources, cache);
187
- expect(result.series[0]).toMatchObject({ unit: "USD/share", volumeUnit: "shares" });
188
- expect(result.series.find((series) => series.id === "volume")?.unit).toBe("shares");
189
- expect(result.series[0]?.points.map((point) => point.value)).toEqual([77.53, 78]);
190
- expect(result.warnings.some((warning) => warning.includes("Volume unit unknown"))).toBe(false);
191
- await resolveChartSpecData(spec, sources, cache);
192
- expect(quoteCalls).toBe(1);
193
- expect(financialCalls).toBe(0);
194
- });
195
-
196
- test("direct volume fields and volume studies retain established units without labeling crypto volume as shares", async () => {
197
- for (const [instrumentType, expectedUnit] of [["EQUITY", "shares"], ["Common Stock", "shares"], ["FUTURE", "contracts"], ["CRYPTOCURRENCY", ""], [undefined, ""]] as const) {
198
- const history = [{ date: new Date("2026-01-15"), close: 1, volume: 1234 }];
199
- const financials = { ...emptyFinancials(), quote: { symbol: "TEST", currency: "USD", price: 1, change: 0, changePercent: 0, lastUpdated: Date.parse("2026-01-15"), instrumentType }, priceHistory: history };
200
- const provider = createTestDataProvider({
201
- getQuote: async () => financials.quote,
202
- getTickerFinancials: async () => financials,
203
- getPriceHistory: async () => history,
204
- getPriceHistoryForResolution: async () => history,
205
- });
206
- const result = await resolveChartSpecData(chartSpec({
207
- viewport: { range: "1M", resolution: "1d" },
208
- series: [chartSeries({ id: "direct", source: { kind: "security", instrument: { symbol: "TEST" }, fieldId: "market.volume" } }), chartSeries({ id: "price", source: { kind: "security", instrument: { symbol: "TEST" }, fieldId: "market.close" } })],
209
- studies: [{ id: "volume", kind: "volume", inputSeriesIds: ["price"], parameters: {}, panelId: "main", axis: "left" }],
210
- }), { dataProvider: provider, loadFredSeries: async () => fredLoad(), now: new Date("2026-01-16") });
211
- for (const id of ["direct", "volume"]) {
212
- expect(result.series.find((entry) => entry.id === id)?.unit).toBe(expectedUnit);
213
- expect(result.series.find((entry) => entry.id === id)?.points.map((point) => point.value)).toEqual([1234]);
214
- }
215
- expect(result.warnings.some((warning) => warning.includes("Volume unit unknown"))).toBe(!expectedUnit);
216
- }
217
- });
218
-
219
- test("cached history honors the visible date range before the network resolves", () => {
220
- const source = { kind: "security" as const, instrument: { symbol: "TEST", exchange: "NASDAQ" }, fieldId: "market.close" };
221
- const history = ["2021-01-01", "2026-08-01", "2026-08-15", "2026-09-10"].map((day, i) => ({
222
- date: new Date(`${day}T00:00:00Z`), close: 100 + i, volume: 1_000 + i,
223
- }));
224
- const seeded = seedChartResolutionResult(chartSpec({
225
- viewport: { range: "1M", resolution: "auto" },
226
- series: [chartSeries({ source, transform: "percent" })],
227
- }), new Map([[chartQuoteOverrideKeyForSource(source), history]]));
228
- expect(seeded?.viewport?.start.toISOString()).toBe("2026-08-10T00:00:00.000Z");
229
- expect(seeded?.viewport?.end.toISOString()).toBe("2026-09-10T00:00:00.000Z");
230
- expect(seeded?.series[0]?.points.map((p) => p.date.toISOString().slice(0, 10))).toEqual(["2026-08-15", "2026-09-10"]);
231
- expect(seeded?.series[0]?.points[0]?.value).toBe(0);
232
- expect(seeded?.bufferedSeries?.[0]?.points).toHaveLength(4);
233
- });
234
-
235
- test("a point-limited seed exposes a viewport only for an explicit date window", () => {
236
- const source = { kind: "security" as const, instrument: { symbol: "TEST", exchange: "NASDAQ" }, fieldId: "market.close" };
237
- const history = ["2026-08-01", "2026-08-15", "2026-09-10"].map((day, index) => ({
238
- date: new Date(`${day}T00:00:00Z`), close: 100 + index,
239
- }));
240
- const cached = new Map([[chartQuoteOverrideKeyForSource(source), history]]);
241
- const spec = chartSpec({ viewport: { range: "1Y", resolution: "auto", maxPoints: 2 }, series: [chartSeries({ source })] });
242
- const seed = seedChartResolutionResult(spec, cached);
243
- expect(seed?.series[0]?.points).toHaveLength(2);
244
- expect(seed?.viewport).toBeUndefined();
245
- expect(seed?.bufferedSeries).toBeUndefined();
246
- const explicit = seedChartResolutionResult({ ...spec, viewport: {
247
- ...spec.viewport, dateWindow: { start: "2026-08-01", end: "2026-09-10" },
248
- } }, cached);
249
- expect(explicit?.viewport?.start.toISOString()).toBe("2026-08-01T00:00:00.000Z");
250
- expect(explicit?.viewport?.end.toISOString()).toBe("2026-09-10T23:59:59.999Z");
251
- });
252
-
253
- test("stale cached observations cannot move a current preset window into the past", () => {
254
- const source = { kind: "security" as const, instrument: { symbol: "TEST" }, fieldId: "market.close" };
255
- const cached = new Map([[chartQuoteOverrideKeyForSource(source), [{ date: new Date("2026-08-31T00:00:00Z"), close: 100 }]]]);
256
- const result = seedChartResolutionResult(chartSpec({ viewport: { range: "1M", resolution: "auto" },
257
- series: [chartSeries({ source })] }), cached, new Date("2026-09-10T18:00:00Z"));
258
- expect(result?.viewport).toEqual({ start: new Date("2026-08-10T18:00:00Z"), end: new Date("2026-09-10T18:00:00Z") });
259
- });
260
-
261
- test("keeps study output over the whole buffered history its base series carries", async () => {
262
- const history = Array.from({ length: 900 }, (_, day) => {
263
- const date = new Date(Date.UTC(2024, 0, 1) + day * 86_400_000);
264
- return date.getUTCDay() === 0 || date.getUTCDay() === 6
265
- ? null
266
- : { date, open: 100, high: 101, low: 99, close: 100 + (day % 7), volume: 1_000 + day };
267
- }).filter((point): point is NonNullable<typeof point> => point !== null);
268
- const provider = createTestDataProvider({
269
- getTickerFinancials: async () => emptyFinancials(),
270
- getChartResolutionSupport: () => [{ resolution: "1d", maxRange: "ALL" }],
271
- getPriceHistoryForResolution: async () => history,
272
- getDetailedPriceHistory: async () => history,
273
- });
274
- const spec: ChartSpec = chartSpec({
275
- viewport: { range: "1Y", resolution: "1d" },
276
- panels: [{ id: "main" }, { id: "volume", label: "Volume", height: 0.24 }],
277
- series: [chartSeries({
278
- source: {
279
- kind: "security",
280
- instrument: { symbol: "TEST", exchange: "NASDAQ" },
281
- fieldId: "market.close",
282
- },
283
- })],
284
- studies: [{
285
- id: "volume",
286
- kind: "volume",
287
- inputSeriesIds: ["price"],
288
- parameters: {},
289
- panelId: "volume",
290
- axis: "left",
291
- }],
292
- });
293
- const sources = {
294
- dataProvider: provider,
295
- now: new Date("2026-06-15T00:00:00.000Z"),
296
- loadFredSeries: async () => fredLoad(),
297
- };
298
- const cache = new ChartResolveCache();
299
-
300
- await resolveChartSpecData(spec, sources, cache);
301
- // Panning back accumulates older bars into the buffer. The study has to
302
- // follow, or it empties out wherever the base series has already been.
303
- const panned = await resolveChartSpecData(spec, sources, cache, {
304
- requestViewport: {
305
- start: new Date("2024-02-01T00:00:00.000Z"),
306
- end: new Date("2024-08-01T00:00:00.000Z"),
307
- },
308
- });
309
-
310
- const span = (id: string) => {
311
- const entry = panned.bufferedSeries?.find((candidate) => candidate.id === id);
312
- return entry && entry.points.length > 0
313
- ? {
314
- first: entry.points[0]!.date.toISOString(),
315
- last: entry.points.at(-1)!.date.toISOString(),
316
- }
317
- : null;
318
- };
319
- expect(span("volume")).toEqual(span("price"));
320
- });
321
-
322
- test("routes futures and Treasury aliases through the existing market and FRED pipelines", async () => {
323
- const marketRequests: string[] = [];
324
- const fredRequests: string[] = [];
325
- const provider = createTestDataProvider({
326
- getTickerFinancials: async () => emptyFinancials(),
327
- getPriceHistoryForResolution: async (symbol) => {
328
- marketRequests.push(symbol);
329
- return [{ date: new Date("2026-02-01T00:00:00Z"), close: 6_100 }];
330
- },
331
- });
332
-
333
- const result = await resolveChartSpecData(
334
- buildCustomChartPreset("FUT:ES, UST:10Y"),
335
- {
336
- dataProvider: provider,
337
- now: new Date("2026-03-01T00:00:00Z"),
338
- loadFredSeries: async ({ seriesId }) => {
339
- fredRequests.push(seriesId);
340
- return fredLoad({
341
- observations: [{ date: "2026-02-01", value: 4.25 }],
342
- info: null,
343
- });
344
- },
345
- },
346
- );
347
-
348
- expect(result.errors).toEqual([]);
349
- expect(marketRequests).toEqual(["ES=F"]);
350
- expect(fredRequests).toEqual(["DGS10"]);
351
- expect(result.series.map((series) => series.points[0]?.value ?? series.points[0]?.close))
352
- .toEqual([6_100, 4.25]);
353
- });
354
-
355
- test("keeps missing capability series visible with a useful error and resolves them through the injected boundary", async () => {
356
- const spec: ChartSpec = chartSpec({
357
- viewport: { range: "1M", resolution: "auto" },
358
- series: [chartSeries({
359
- id: "plugin-series",
360
- source: { kind: "capability", capabilityId: "charts.test", seriesId: "one" },
361
- style: "area",
362
- axis: "auto",
363
- })],
364
- });
365
- const sources = { dataProvider: null, loadFredSeries: async () => fredLoad(), now: new Date("2026-02-01") };
366
- const missing = await resolveChartSpecData(spec, sources);
367
- expect(missing.series).toHaveLength(1);
368
- expect(missing.series[0]?.points).toEqual([]);
369
- expect(missing.errors[0]).toContain('Chart series capability "charts.test" is unavailable');
370
-
371
- const resolved = await resolveChartSpecData(spec, {
372
- ...sources,
373
- resolveCapabilitySeries: async () => ({
374
- id: "provider-id",
375
- label: "Provider Label",
376
- color: "#fff",
377
- unit: "value",
378
- unitGroup: "value",
379
- nativeFrequency: "daily",
380
- dataShape: "scalar",
381
- style: "line",
382
- transform: "raw",
383
- axis: "left",
384
- panelId: "provider",
385
- interpolation: "none",
386
- points: [{ date: new Date("2026-01-15"), observedAt: new Date("2026-01-15"), value: 42 }],
387
- }),
388
- });
389
- expect(resolved.errors).toEqual([]);
390
- expect(resolved.series[0]).toMatchObject({ id: "plugin-series", style: "area", panelId: "main" });
391
- expect(resolved.series[0]?.points[0]?.value).toBe(42);
392
- });
393
-
394
- test("resolves capability coverage for each effective panned viewport and caches by structured bounds", async () => {
395
- const spec: ChartSpec = chartSpec({
396
- viewport: { range: "1M", resolution: "auto" },
397
- series: [chartSeries({
398
- id: "plugin-series",
399
- source: { kind: "capability", capabilityId: "charts.test", seriesId: "provider/series" },
400
- })],
401
- });
402
- const requested: ChartSpec["viewport"][] = [];
403
- const cache = new ChartResolveCache();
404
- const sources = {
405
- dataProvider: null,
406
- loadFredSeries: async () => fredLoad(),
407
- now: new Date("2026-03-01T00:00:00.000Z"),
408
- resolveCapabilitySeries: async (_source: any, viewport: ChartSpec["viewport"]) => {
409
- requested.push(viewport);
410
- const date = new Date(viewport.dateWindow!.start);
411
- return {
412
- id: "provider",
413
- label: "Provider",
414
- color: "#ffffff",
415
- unit: "value",
416
- unitGroup: "value",
417
- nativeFrequency: "daily" as const,
418
- dataShape: "scalar" as const,
419
- style: "line" as const,
420
- transform: "raw" as const,
421
- axis: "left" as const,
422
- panelId: "main",
423
- interpolation: "none" as const,
424
- points: [{ date, observedAt: date, value: 1 }],
425
- };
426
- },
427
- };
428
- const firstViewport = { start: new Date("2026-01-01T00:00:00.000Z"), end: new Date("2026-01-08T00:00:00.000Z") };
429
- const secondViewport = { start: new Date("2026-02-01T00:00:00.000Z"), end: new Date("2026-02-08T00:00:00.000Z") };
430
-
431
- await resolveChartSpecData(spec, sources, cache, { requestViewport: firstViewport });
432
- const panned = await resolveChartSpecData(spec, sources, cache, { requestViewport: secondViewport });
433
- await resolveChartSpecData(spec, sources, cache, { requestViewport: firstViewport });
434
-
435
- expect(panned.series[0]?.points[0]?.date.toISOString()).toBe(secondViewport.start.toISOString());
436
- expect(panned.viewport).toEqual(secondViewport);
437
- expect(requested.map((viewport) => viewport.dateWindow)).toEqual([
438
- { start: firstViewport.start.toISOString(), end: firstViewport.end.toISOString() },
439
- { start: secondViewport.start.toISOString(), end: secondViewport.end.toISOString() },
440
- ]);
441
- expect(chartSeriesSourceKey({ kind: "capability", capabilityId: "a", seriesId: "b:c" }))
442
- .not.toBe(chartSeriesSourceKey({ kind: "capability", capabilityId: "a-b", seriesId: "c" }));
443
- });
444
-
445
- test("derives Auto fetch resolution from the finest explicit market period", async () => {
446
- const cases = [
447
- { range: "ALL" as const, periods: ["daily", "monthly"] as const, expected: "1d" },
448
- { range: "ALL" as const, periods: ["weekly", "monthly"] as const, expected: "1wk" },
449
- { range: "1Y" as const, periods: ["monthly"] as const, expected: "1d" },
450
- ];
451
-
452
- for (const scenario of cases) {
453
- const requestedResolutions: string[] = [];
454
- const provider = createTestDataProvider({
455
- getTickerFinancials: async () => emptyFinancials(),
456
- getPriceHistoryForResolution: async (_symbol, _exchange, _range, resolution) => {
457
- requestedResolutions.push(resolution);
458
- return [{ date: new Date("2025-01-07T16:00:00Z"), close: 100 }];
459
- },
460
- });
461
- const spec: ChartSpec = chartSpec({
462
- viewport: { range: scenario.range, resolution: "auto" },
463
- series: scenario.periods.map((period, index) => (chartSeries({
464
- id: `price-${index}`,
465
- source: {
466
- kind: "security" as const,
467
- instrument: { symbol: `TEST${index}` },
468
- fieldId: "market.close",
469
- period,
470
- },
471
- style: "line" as const,
472
- transform: "raw" as const,
473
- axis: "left" as const,
474
- interpolation: "none" as const,
475
- }))),
476
- });
477
-
478
- const result = await resolveChartSpecData(spec, {
479
- dataProvider: provider,
480
- now: new Date("2025-01-08T00:00:00Z"),
481
- loadFredSeries: async () => fredLoad(),
482
- });
483
-
484
- expect(result.errors).toEqual([]);
485
- expect(new Set(requestedResolutions)).toEqual(new Set([scenario.expected]));
486
- }
487
- });
488
-
489
- test("skips financials and broker resolution support for ohlcv charts with an exchange", async () => {
490
- let financialCalls = 0;
491
- let resolveSupport: (() => void) | null = null;
492
- const supportGate = new Promise<void>((resolve) => {
493
- resolveSupport = resolve;
494
- });
495
- const provider = createTestDataProvider({
496
- getTickerFinancials: async () => {
497
- financialCalls += 1;
498
- return emptyFinancials();
499
- },
500
- getChartResolutionSupport: async () => {
501
- await supportGate;
502
- return [{ resolution: "1d" as const, maxRange: "5Y" as const }];
503
- },
504
- getPriceHistoryForResolution: async () => [
505
- { date: new Date("2025-01-07T16:00:00Z"), close: 100 },
506
- ],
507
- });
508
- const spec: ChartSpec = chartSpec({
509
- viewport: { range: "5Y", resolution: "auto" },
510
- series: [chartSeries({
511
- source: {
512
- kind: "security",
513
- instrument: { symbol: "TEST", exchange: "NASDAQ" },
514
- fieldId: "market.ohlcv",
515
- },
516
- style: "candles",
517
- })],
518
- });
519
-
520
- const result = await Promise.race([
521
- resolveChartSpecData(spec, {
522
- dataProvider: provider,
523
- now: new Date("2025-01-08T00:00:00Z"),
524
- loadFredSeries: async () => fredLoad(),
525
- }),
526
- new Promise<never>((_, reject) => {
527
- setTimeout(() => reject(new Error("hung waiting for broker resolution support")), 200);
528
- }),
529
- ]);
530
-
531
- expect(financialCalls).toBe(0);
532
- expect(result.errors).toEqual([]);
533
- expect(result.series[0]?.points).toHaveLength(1);
534
- resolveSupport?.();
535
- });
536
-
537
- test("does not relabel provider-default history as a manually requested resolution", async () => {
538
- let genericHistoryCalls = 0;
539
- const provider = createTestDataProvider({
540
- getTickerFinancials: async () => emptyFinancials(),
541
- getPriceHistoryForResolution: async () => [],
542
- getPriceHistory: async () => {
543
- genericHistoryCalls += 1;
544
- return [{ date: new Date("2025-01-07T16:00:00Z"), close: 100 }];
545
- },
546
- });
547
- const spec: ChartSpec = chartSpec({
548
- viewport: { range: "1W", resolution: "5m" },
549
- series: [chartSeries({
550
- source: { kind: "security", instrument: { symbol: "TEST" }, fieldId: "market.close" },
551
- })],
552
- });
553
-
554
- const result = await resolveChartSpecData(spec, {
555
- dataProvider: provider,
556
- now: new Date("2025-01-08T00:00:00Z"),
557
- loadFredSeries: async () => fredLoad(),
558
- });
559
-
560
- expect(genericHistoryCalls).toBe(0);
561
- // The series keeps its legend slot with no observations so the chart and the
562
- // series editor agree on what the user added.
563
- expect(result.series.map((entry) => [entry.id, entry.points.length])).toEqual([["price", 0]]);
564
- expect(result.errors).toEqual([
565
- "price: Requested 5m price history is unavailable for TEST. Choose Auto or a supported interval.",
566
- ]);
567
- });
568
-
569
- test("falls back from an unsupported manual interval while exposing source capabilities", async () => {
570
- const requestedResolutions: string[] = [];
571
- const provider = createTestDataProvider({
572
- getTickerFinancials: async () => emptyFinancials(),
573
- getChartResolutionSupport: () => [
574
- { resolution: "15m", maxRange: "1M" },
575
- { resolution: "1h", maxRange: "3M" },
576
- ],
577
- getPriceHistoryForResolution: async (_symbol, _exchange, _range, resolution) => {
578
- requestedResolutions.push(resolution);
579
- return [{ date: new Date("2026-07-30T15:00:00Z"), close: 100 }];
580
- },
581
- });
582
- const spec: ChartSpec = chartSpec({
583
- viewport: { range: "1M", resolution: "45m" },
584
- series: [chartSeries({
585
- source: {
586
- kind: "security",
587
- instrument: { symbol: "TEST", exchange: "NASDAQ" },
588
- fieldId: "market.close",
589
- },
590
- })],
591
- });
592
-
593
- const result = await resolveChartSpecData(spec, {
594
- dataProvider: provider,
595
- now: new Date("2026-07-30T16:00:00Z"),
596
- loadFredSeries: async () => fredLoad(),
597
- });
598
-
599
- expect(requestedResolutions).toEqual(["15m"]);
600
- expect(result.errors).toEqual([]);
601
- expect(result.warnings).toContain(
602
- "45M data is unavailable for this range. Auto resolution was used instead.",
603
- );
604
- expect(result.resolutionSupport).toEqual([
605
- { resolution: "15m", maxRange: "1M" },
606
- { resolution: "1h", maxRange: "3M" },
607
- ]);
608
- });
609
-
610
- test("picks a supported interval when the range preset is unsupported", async () => {
611
- const requestedResolutions: string[] = [];
612
- const provider = createTestDataProvider({
613
- getTickerFinancials: async () => emptyFinancials(),
614
- getChartResolutionSupport: () => [
615
- { resolution: "5m", maxRange: "1W" },
616
- { resolution: "15m", maxRange: "1M" },
617
- { resolution: "1h", maxRange: "3M" },
618
- ],
619
- getPriceHistoryForResolution: async (_symbol, _exchange, _range, resolution) => {
620
- requestedResolutions.push(resolution);
621
- if (resolution === "1m") throw new Error("1m unsupported");
622
- return [{ date: new Date("2026-07-30T15:00:00Z"), close: 100 }];
623
- },
624
- });
625
- const series = chartSeries({
626
- source: {
627
- kind: "security",
628
- instrument: { symbol: "NVDA", exchange: "XNAS" },
629
- fieldId: "market.ohlcv",
630
- },
631
- style: "candles",
632
- });
633
- const sources = {
634
- dataProvider: provider,
635
- now: new Date("2026-07-30T16:00:00Z"),
636
- loadFredSeries: async () => fredLoad(),
637
- };
638
- const cache = new ChartResolveCache();
639
-
640
- // GIP opens on a hard 1m interval; the provider only serves 5m and coarser.
641
- const manual = await resolveChartSpecData(
642
- chartSpec({ viewport: { range: "1D", resolution: "1m" }, series: [series] }),
643
- sources,
644
- cache,
645
- );
646
- expect(manual.errors).toEqual([]);
647
- expect(manual.warnings).toContain(
648
- "1M data is unavailable for this range. Auto resolution was used instead.",
649
- );
650
-
651
- // The pane then flips the spec to Auto, reusing the same cache.
652
- const auto = await resolveChartSpecData(
653
- chartSpec({ viewport: { range: "1D", resolution: "auto" }, series: [series] }),
654
- sources,
655
- cache,
656
- );
657
- expect(auto.errors).toEqual([]);
658
- expect(auto.resolution).toBe("5m");
659
- expect(new Set(requestedResolutions)).toEqual(new Set(["5m"]));
660
- });
661
-
662
- test("price-only charts paint with a placeholder list, then adopt the source's real intervals", async () => {
663
- let resolveSupport: ((value: Array<{ resolution: "1m" | "5m" | "30m" | "1d"; maxRange: "1W" | "1M" | "6M" | "5Y" }>) => void) | null = null;
664
- const supportGate = new Promise<Array<{ resolution: "1m" | "5m" | "30m" | "1d"; maxRange: "1W" | "1M" | "6M" | "5Y" }>>((resolve) => {
665
- resolveSupport = resolve;
666
- });
667
- const requestedResolutions: string[] = [];
668
- const provider = createTestDataProvider({
669
- getTickerFinancials: async () => emptyFinancials(),
670
- getChartResolutionSupport: () => supportGate,
671
- getPriceHistoryForResolution: async (_symbol, _exchange, _range, resolution) => {
672
- requestedResolutions.push(resolution);
673
- return [{ date: new Date("2026-07-30T15:00:00Z"), close: 100 }];
674
- },
675
- });
676
- const spec = chartSpec({
677
- viewport: { range: "1D", resolution: "auto" },
678
- series: [chartSeries({
679
- source: { kind: "security", instrument: { symbol: "NVDA", exchange: "XNAS" }, fieldId: "market.ohlcv" },
680
- style: "candles",
681
- })],
682
- });
683
- const sources = {
684
- dataProvider: provider,
685
- now: new Date("2026-07-30T16:00:00Z"),
686
- loadFredSeries: async () => fredLoad(),
687
- };
688
- const cache = new ChartResolveCache();
689
- let settledNotifications = 0;
690
-
691
- const first = await resolveChartSpecData(spec, sources, cache, {
692
- onResolutionSupportSettled: () => { settledNotifications += 1; },
693
- });
694
- // The placeholder omits 1m, but it must not talk Auto out of the 1D preset.
695
- expect(first.errors).toEqual([]);
696
- expect(first.resolution).toBe("1m");
697
- expect(first.resolutionSupport?.map((entry) => entry.resolution)).toEqual(["5m", "15m", "1h", "1d", "1wk", "1mo"]);
698
- expect(settledNotifications).toBe(0);
699
-
700
- resolveSupport!([
701
- { resolution: "1m", maxRange: "1W" },
702
- { resolution: "5m", maxRange: "1M" },
703
- { resolution: "30m", maxRange: "6M" },
704
- { resolution: "1d", maxRange: "5Y" },
705
- ]);
706
- await supportGate;
707
- await new Promise((resolve) => setTimeout(resolve, 0));
708
- expect(settledNotifications).toBe(1);
709
-
710
- const second = await resolveChartSpecData(spec, sources, cache, {
711
- onResolutionSupportSettled: () => { settledNotifications += 1; },
712
- });
713
- expect(second.resolution).toBe("1m");
714
- expect(second.resolutionSupport?.map((entry) => entry.resolution)).toEqual(["1m", "5m", "30m", "1d"]);
715
- expect(settledNotifications).toBe(1);
716
- expect(new Set(requestedResolutions)).toEqual(new Set(["1m"]));
717
- });
718
-
719
- test("one-shot loaders wait for the real interval list", async () => {
720
- const provider = createTestDataProvider({
721
- getTickerFinancials: async () => emptyFinancials(),
722
- getChartResolutionSupport: async () => [
723
- { resolution: "5m" as const, maxRange: "1W" as const },
724
- { resolution: "1d" as const, maxRange: "5Y" as const },
725
- ],
726
- getPriceHistoryForResolution: async () => [{ date: new Date("2026-07-30T15:00:00Z"), close: 100 }],
727
- });
728
- const spec = chartSpec({
729
- viewport: { range: "1D", resolution: "auto" },
730
- series: [chartSeries({
731
- source: { kind: "security", instrument: { symbol: "NVDA", exchange: "XNAS" }, fieldId: "market.ohlcv" },
732
- style: "candles",
733
- })],
734
- });
735
- const result = await resolveChartSpecData(spec, {
736
- dataProvider: provider,
737
- now: new Date("2026-07-30T16:00:00Z"),
738
- loadFredSeries: async () => fredLoad(),
739
- }, undefined, { awaitResolutionSupport: true });
740
- expect(result.resolution).toBe("5m");
741
- expect(result.resolutionSupport?.map((entry) => entry.resolution)).toEqual(["5m", "1d"]);
742
- });
743
-
744
- test("a failed manual interval request does not poison the Auto retry", async () => {
745
- let calls = 0;
746
- const provider = createTestDataProvider({
747
- getTickerFinancials: async () => emptyFinancials(),
748
- getPriceHistoryForResolution: async () => {
749
- calls += 1;
750
- throw new Error("resolution api unsupported");
751
- },
752
- getPriceHistory: async () => [{ date: new Date("2026-07-30T15:00:00Z"), close: 100 }],
753
- });
754
- const series = chartSeries({
755
- source: { kind: "security", instrument: { symbol: "TEST", exchange: "NASDAQ" }, fieldId: "market.close" },
756
- });
757
- const sources = {
758
- dataProvider: provider,
759
- now: new Date("2026-07-30T16:00:00Z"),
760
- loadFredSeries: async () => fredLoad(),
761
- };
762
- const cache = new ChartResolveCache();
763
-
764
- const manual = await resolveChartSpecData(
765
- chartSpec({ viewport: { range: "1D", resolution: "1m" }, series: [series] }),
766
- sources,
767
- cache,
768
- );
769
- expect(manual.errors).toEqual([
770
- "price: Requested 1m price history is unavailable for TEST:XNAS. Choose Auto or a supported interval.",
771
- ]);
772
-
773
- const auto = await resolveChartSpecData(
774
- chartSpec({ viewport: { range: "1D", resolution: "auto" }, series: [series] }),
775
- sources,
776
- cache,
777
- );
778
- expect(auto.errors).toEqual([]);
779
- expect(auto.series[0]?.points).toHaveLength(1);
780
- expect(calls).toBe(2);
781
- });
782
-
783
- test.each([
784
- { selected: "1wk", maxRange: "ALL", range: "ALL", expected: "1wk" },
785
- { selected: "1mo", maxRange: "ALL", range: "ALL", expected: "1mo" },
786
- { selected: "1wk", maxRange: "5Y", range: "ALL", expected: "1mo" },
787
- { selected: "5m", maxRange: "1W", range: "ALL", expected: "1mo" },
788
- { selected: "1wk", maxRange: "5Y", range: "1Y", expected: "1wk" },
789
- ] as const)("honors $selected/$range only within the provider's $maxRange limit", async ({ selected, maxRange, range, expected }) => {
790
- const requests: string[] = [];
791
- const provider = createTestDataProvider({
792
- getTickerFinancials: async () => emptyFinancials(),
793
- getChartResolutionSupport: () => [
794
- { resolution: selected, maxRange },
795
- { resolution: "1mo", maxRange: "ALL" },
796
- ],
797
- getPriceHistoryForResolution: async (_symbol, _exchange, _range, resolution) => {
798
- requests.push(resolution);
799
- return [{ date: new Date("2026-08-03"), close: resolution === "1wk" ? 35 : 33 }];
800
- },
801
- });
802
- const spec = chartSpec({
803
- viewport: { range, resolution: selected },
804
- series: [chartSeries({ source: {
805
- kind: "security", instrument: { symbol: "TEST", exchange: "LSE" }, fieldId: "market.close",
806
- } })],
807
- });
808
- const result = await resolveChartSpecData(spec, {
809
- dataProvider: provider, now: new Date("2026-09-11"), loadFredSeries: async () => fredLoad(),
810
- });
811
-
812
- expect(requests).toEqual([expected]);
813
- expect(result.resolution).toBe(expected);
814
- expect(result.series[0]?.points.at(-1)?.value).toBe(expected === "1wk" ? 35 : 33);
815
- expect(result.errors).toEqual([]);
816
- expect(result.warnings.some((warning) => warning.includes("Auto resolution was used instead")))
817
- .toBe(expected !== selected);
818
- });
819
-
820
- test.each(["ALL", "5Y"] as const)("checks explicit long date windows against the %s manual limit", async (maxRange) => {
821
- const requests: string[] = [];
822
- const provider = createTestDataProvider({
823
- getTickerFinancials: async () => emptyFinancials(),
824
- getChartResolutionSupport: () => [
825
- { resolution: "1wk", maxRange },
826
- { resolution: "1mo", maxRange: "ALL" },
827
- ],
828
- getDetailedPriceHistory: async (_symbol, _exchange, _start, _end, resolution) => {
829
- requests.push(resolution);
830
- return [{ date: new Date("1997-07-01"), close: 10 }];
831
- },
832
- });
833
- const spec = chartSpec({
834
- viewport: { range: "ALL", resolution: "1wk", dateWindow: { start: "1997-01-01", end: "2026-09-11" } },
835
- series: [chartSeries({ source: {
836
- kind: "security", instrument: { symbol: "TEST", exchange: "LSE" }, fieldId: "market.close",
837
- } })],
838
- });
839
- const result = await resolveChartSpecData(spec, {
840
- dataProvider: provider, now: new Date("2026-09-11"), loadFredSeries: async () => fredLoad(),
841
- });
842
- expect(requests).toEqual([maxRange === "ALL" ? "1wk" : "1mo"]);
843
- expect(result.errors).toEqual([]);
844
- });
845
-
846
- test("requires every comparison source to support the manual ALL interval", async () => {
847
- const requests: string[] = [];
848
- const provider = createTestDataProvider({
849
- getTickerFinancials: async () => emptyFinancials(),
850
- getChartResolutionSupport: (symbol) => [
851
- { resolution: "1wk", maxRange: symbol === "UNLIMITED" ? "ALL" : "5Y" },
852
- { resolution: "1mo", maxRange: "ALL" },
853
- ],
854
- getPriceHistoryForResolution: async (symbol, _exchange, _range, resolution) => {
855
- requests.push(`${symbol}:${resolution}`);
856
- return [{ date: new Date("2026-08-03"), close: 33 }];
857
- },
858
- });
859
- const spec = chartSpec({
860
- viewport: { range: "ALL", resolution: "1wk" },
861
- series: ["UNLIMITED", "LIMITED"].map((symbol) => chartSeries({ id: symbol, source: {
862
- kind: "security", instrument: { symbol, exchange: "LSE" }, fieldId: "market.close",
863
- } })),
864
- });
865
- const result = await resolveChartSpecData(spec, {
866
- dataProvider: provider, now: new Date("2026-09-11"), loadFredSeries: async () => fredLoad(),
867
- });
868
- expect(requests.sort()).toEqual(["LIMITED:1mo", "UNLIMITED:1mo"]);
869
- expect(result.resolution).toBe("1mo");
870
- expect(result.resolutionSupport).toContainEqual({ resolution: "1wk", maxRange: "5Y" });
871
- expect(result.warnings).toContain("1WK data is unavailable for this range. Auto resolution was used instead.");
872
- });
873
-
874
- test("keeps the snapshot exchange when a newer quote omits it", async () => {
875
- const historyExchanges: string[] = [];
876
- const source = {
877
- kind: "security" as const,
878
- instrument: { symbol: "SNDK" },
879
- fieldId: "market.ohlcv",
880
- };
881
- const provider = createTestDataProvider({
882
- getTickerFinancials: async () => ({
883
- ...emptyFinancials(),
884
- quote: {
885
- symbol: "SNDK",
886
- price: 1_240,
887
- currency: "USD",
888
- change: 20,
889
- changePercent: 1.64,
890
- lastUpdated: Date.parse("2026-07-30T15:25:00Z"),
891
- listingExchangeName: "XNAS",
892
- },
893
- }),
894
- getPriceHistoryForResolution: async (_symbol, exchange) => {
895
- historyExchanges.push(exchange);
896
- return [{
897
- date: new Date("2026-07-30T15:20:00Z"),
898
- open: 1_235,
899
- high: 1_242,
900
- low: 1_233,
901
- close: 1_240,
902
- }];
903
- },
904
- });
905
- const spec: ChartSpec = chartSpec({
906
- viewport: { range: "1D", resolution: "5m" },
907
- series: [{
908
- id: "price",
909
- source,
910
- style: "candles",
911
- transform: "raw",
912
- axis: "left",
913
- panelId: "main",
914
- interpolation: "none",
915
- }],
916
- });
917
-
918
- const result = await resolveChartSpecData(spec, {
919
- dataProvider: provider,
920
- now: new Date("2026-07-30T15:30:00Z"),
921
- quoteOverrides: new Map([[
922
- chartQuoteOverrideKeyForSource(source),
923
- {
924
- symbol: "SNDK",
925
- price: 1_245,
926
- currency: "USD",
927
- change: 25,
928
- changePercent: 2.05,
929
- lastUpdated: Date.parse("2026-07-30T15:26:00Z"),
930
- },
931
- ]]),
932
- loadFredSeries: async () => fredLoad(),
933
- });
934
-
935
- expect(result.errors).toEqual([]);
936
- expect(historyExchanges).toEqual(["XNAS"]);
937
- // A formed bar is stamped at its opening, like the provider's bars.
938
- expect(result.series[0]?.points.at(-1)?.date.toISOString())
939
- .toBe("2026-07-30T15:25:00.000Z");
940
- expect(result.series[0]?.timeBasis).toMatchObject({
941
- kind: "market",
942
- timeZone: "America/New_York",
943
- cadenceMs: 5 * 60_000,
944
- });
945
- });
946
-
947
- test("resolves the exchange before selecting an adaptive Auto resolution", async () => {
948
- const supportExchanges: string[] = [];
949
- const historyRequests: Array<{ exchange: string; resolution: string }> = [];
950
- const provider = createTestDataProvider({
951
- getTickerFinancials: async () => ({
952
- ...emptyFinancials(),
953
- quote: {
954
- symbol: "SNDK",
955
- price: 1_240,
956
- currency: "USD",
957
- change: 20,
958
- changePercent: 1.64,
959
- lastUpdated: Date.parse("2026-07-30T15:25:00Z"),
960
- listingExchangeName: "XNAS",
961
- },
962
- }),
963
- getChartResolutionSupport: (_symbol, exchange) => {
964
- supportExchanges.push(exchange);
965
- return exchange === "XNAS"
966
- ? [{ resolution: "5m", maxRange: "1W" }]
967
- : [{ resolution: "1d", maxRange: "5Y" }];
968
- },
969
- getDetailedPriceHistory: async (_symbol, exchange, _start, _end, resolution) => {
970
- historyRequests.push({ exchange, resolution });
971
- return [{ date: new Date("2026-07-30T15:20:00Z"), close: 1_240 }];
972
- },
973
- });
974
- const spec: ChartSpec = chartSpec({
975
- viewport: { range: "1D", resolution: "auto" },
976
- series: [chartSeries({
977
- source: {
978
- kind: "security",
979
- instrument: { symbol: "SNDK" },
980
- fieldId: "market.close",
981
- },
982
- })],
983
- });
984
-
985
- const result = await resolveChartSpecData(
986
- spec,
987
- {
988
- dataProvider: provider,
989
- now: new Date("2026-07-30T15:30:00Z"),
990
- loadFredSeries: async () => fredLoad(),
991
- },
992
- new ChartResolveCache(),
993
- {
994
- autoViewport: {
995
- start: new Date("2026-07-30T09:30:00Z"),
996
- end: new Date("2026-07-30T15:30:00Z"),
997
- },
998
- targetPointCount: 100,
999
- },
1000
- );
1001
-
1002
- expect(result.errors).toEqual([]);
1003
- expect(supportExchanges).toEqual(["XNAS"]);
1004
- expect(historyRequests).toEqual([{ exchange: "XNAS", resolution: "5m" }]);
1005
- });
1006
-
1007
- test("uses provider-default history as a valid fallback for Auto resolution", async () => {
1008
- let genericHistoryCalls = 0;
1009
- const provider = createTestDataProvider({
1010
- getTickerFinancials: async () => emptyFinancials(),
1011
- getPriceHistoryForResolution: async () => {
1012
- throw new Error("5m is unavailable");
1013
- },
1014
- getPriceHistory: async () => {
1015
- genericHistoryCalls += 1;
1016
- return [{ date: new Date("2025-01-07T16:00:00Z"), close: 100 }];
1017
- },
1018
- });
1019
- const spec: ChartSpec = chartSpec({
1020
- viewport: { range: "1W", resolution: "auto" },
1021
- series: [chartSeries({
1022
- source: { kind: "security", instrument: { symbol: "TEST" }, fieldId: "market.close" },
1023
- })],
1024
- });
1025
-
1026
- const result = await resolveChartSpecData(spec, {
1027
- dataProvider: provider,
1028
- now: new Date("2025-01-08T00:00:00Z"),
1029
- loadFredSeries: async () => fredLoad(),
1030
- });
1031
-
1032
- expect(genericHistoryCalls).toBe(1);
1033
- expect(result.errors).toEqual([]);
1034
- expect(result.series[0]?.points.map((point) => point.value)).toEqual([100]);
1035
- });
1036
-
1037
- test("clamps preload history to the provider limit without coarsening the visible interval", async () => {
1038
- const requests: Array<{ range: string; resolution: string }> = [];
1039
- const provider = createTestDataProvider({
1040
- getTickerFinancials: async () => emptyFinancials(),
1041
- getChartResolutionSupport: () => [{ resolution: "5m", maxRange: "1W" }],
1042
- getPriceHistoryForResolution: async (_symbol, _exchange, range, resolution) => {
1043
- requests.push({ range, resolution });
1044
- return [{ date: new Date("2025-01-07T16:00:00Z"), close: 100 }];
1045
- },
1046
- });
1047
- const spec: ChartSpec = chartSpec({
1048
- viewport: { range: "1W", resolution: "auto" },
1049
- series: [chartSeries({
1050
- source: { kind: "security", instrument: { symbol: "TEST" }, fieldId: "market.close" },
1051
- })],
1052
- });
1053
-
1054
- const result = await resolveChartSpecData(spec, {
1055
- dataProvider: provider,
1056
- now: new Date("2025-01-08T00:00:00Z"),
1057
- loadFredSeries: async () => fredLoad(),
1058
- });
1059
-
1060
- expect(result.errors).toEqual([]);
1061
- expect(requests).toEqual([{ range: "1W", resolution: "5m" }]);
1062
- });
1063
-
1064
- test("keeps Auto zoom selection while loading a separately panned history window", async () => {
1065
- const detailedRequests: Array<{
1066
- start: string;
1067
- end: string;
1068
- resolution: string;
1069
- }> = [];
1070
- const provider = createTestDataProvider({
1071
- getTickerFinancials: async () => emptyFinancials(),
1072
- getChartResolutionSupport: () => [
1073
- { resolution: "15m", maxRange: "1M" },
1074
- { resolution: "1h", maxRange: "6M" },
1075
- { resolution: "1d", maxRange: "5Y" },
1076
- ],
1077
- getDetailedPriceHistory: async (_symbol, _exchange, start, end, resolution) => {
1078
- detailedRequests.push({
1079
- start: start.toISOString(),
1080
- end: end.toISOString(),
1081
- resolution,
1082
- });
1083
- return [{ date: new Date("2025-01-15T16:00:00.000Z"), close: 100 }];
1084
- },
1085
- });
1086
- const spec: ChartSpec = chartSpec({
1087
- viewport: { range: "3M", resolution: "auto" },
1088
- series: [chartSeries({
1089
- source: {
1090
- kind: "security",
1091
- instrument: { symbol: "TEST", exchange: "NASDAQ" },
1092
- fieldId: "market.close",
1093
- },
1094
- })],
1095
- });
1096
-
1097
- const result = await resolveChartSpecData(
1098
- spec,
1099
- {
1100
- dataProvider: provider,
1101
- now: new Date("2025-04-01T00:00:00.000Z"),
1102
- loadFredSeries: async () => fredLoad(),
1103
- },
1104
- new ChartResolveCache(),
1105
- {
1106
- autoViewport: {
1107
- start: new Date("2025-03-10T00:00:00.000Z"),
1108
- end: new Date("2025-03-17T00:00:00.000Z"),
1109
- },
1110
- requestViewport: {
1111
- start: new Date("2025-01-10T00:00:00.000Z"),
1112
- end: new Date("2025-01-17T00:00:00.000Z"),
1113
- },
1114
- targetPointCount: 100,
1115
- },
1116
- );
1117
-
1118
- expect(spec.viewport.resolution).toBe("auto");
1119
- expect(detailedRequests).toHaveLength(1);
1120
- expect(detailedRequests[0]?.resolution).toBe("15m");
1121
- expect(detailedRequests[0]?.end).toBe("2025-01-17T00:00:00.001Z");
1122
- expect(result.viewport?.start.toISOString()).toBe("2025-01-10T00:00:00.000Z");
1123
- expect(result.viewport?.end.toISOString()).toBe("2025-01-17T00:00:00.000Z");
1124
- expect(result.series[0]?.timeBasis).toMatchObject({
1125
- kind: "market",
1126
- timeZone: "America/New_York",
1127
- cadenceMs: 15 * 60 * 1_000,
1128
- });
1129
- });
1130
-
1131
- test("accumulates historical windows without replacing the current tail", async () => {
1132
- const detailedRequests: Array<{ start: string; end: string }> = [];
1133
- const currentHistory = [
1134
- { date: "2026-01-02T16:00:00.000Z" as unknown as Date, close: 110 },
1135
- { date: new Date("2026-07-30T16:00:00.000Z"), close: 120 },
1136
- ];
1137
- const historicalHistory = [
1138
- { date: new Date("2024-08-01T16:00:00.000Z"), close: 90 },
1139
- { date: new Date("2025-07-29T16:00:00.000Z"), close: 100 },
1140
- ];
1141
- const provider = createTestDataProvider({
1142
- getTickerFinancials: async () => emptyFinancials(),
1143
- getChartResolutionSupport: () => [
1144
- { resolution: "1h", maxRange: "1Y" },
1145
- { resolution: "1d", maxRange: "ALL" },
1146
- ],
1147
- getPriceHistoryForResolution: async () => currentHistory,
1148
- getDetailedPriceHistory: async (_symbol, _exchange, start, end) => {
1149
- detailedRequests.push({
1150
- start: start.toISOString(),
1151
- end: end.toISOString(),
1152
- });
1153
- return historicalHistory;
1154
- },
1155
- });
1156
- const spec: ChartSpec = chartSpec({
1157
- viewport: { range: "1Y", resolution: "1h" },
1158
- series: [chartSeries({
1159
- source: {
1160
- kind: "security",
1161
- instrument: { symbol: "TEST", exchange: "NASDAQ" },
1162
- fieldId: "market.close",
1163
- },
1164
- })],
1165
- });
1166
- const sources = {
1167
- dataProvider: provider,
1168
- now: new Date("2026-07-30T16:00:00.000Z"),
1169
- loadFredSeries: async () => fredLoad(),
1170
- };
1171
- const cache = new ChartResolveCache();
1172
-
1173
- const current = await resolveChartSpecData(spec, sources, cache);
1174
- const historical = await resolveChartSpecData(spec, sources, cache, {
1175
- requestViewport: {
1176
- start: new Date("2024-07-30T16:00:00.000Z"),
1177
- end: new Date("2025-07-30T16:00:00.000Z"),
1178
- },
1179
- });
1180
- const revisitedCurrent = await resolveChartSpecData(spec, sources, cache);
1181
- const bufferedDates = (result: typeof current) => (
1182
- result.bufferedSeries?.[0]?.points.map((point) => point.date.toISOString())
1183
- );
1184
-
1185
- expect(detailedRequests).toEqual([{
1186
- start: "2024-07-30T16:00:00.000Z",
1187
- end: "2025-07-30T16:00:00.001Z",
1188
- }]);
1189
- expect(current.resolutionSupport).toEqual([
1190
- { resolution: "1h", maxRange: "1Y" },
1191
- { resolution: "1d", maxRange: "ALL" },
1192
- ]);
1193
- expect(bufferedDates(historical)).toEqual([
1194
- "2024-08-01T16:00:00.000Z",
1195
- "2025-07-29T16:00:00.000Z",
1196
- "2026-01-02T16:00:00.000Z",
1197
- "2026-07-30T16:00:00.000Z",
1198
- ]);
1199
- expect(bufferedDates(revisitedCurrent)).toEqual(bufferedDates(historical));
1200
- expect(revisitedCurrent.bufferedSeries?.[0]?.points.at(-1)?.value).toBe(120);
1201
- });
1202
-
1203
- test("keeps one daily bar per session when windows come from sources that stamp bars differently", async () => {
1204
- // The trailing window is stamped at the opening bell, the panned window at
1205
- // local midnight, so the same sessions arrive with timestamps hours apart.
1206
- const currentHistory = [
1207
- { date: new Date("2026-07-28T13:30:00.000Z"), close: 110 },
1208
- { date: new Date("2026-07-29T13:30:00.000Z"), close: 115 },
1209
- { date: new Date("2026-07-30T13:30:00.000Z"), close: 120 },
1210
- ];
1211
- const historicalHistory = [
1212
- { date: new Date("2026-07-23T22:00:00.000Z"), close: 100 },
1213
- { date: new Date("2026-07-27T22:00:00.000Z"), close: 111 },
1214
- { date: new Date("2026-07-28T22:00:00.000Z"), close: 116 },
1215
- { date: new Date("2026-07-29T22:00:00.000Z"), close: 121 },
1216
- ];
1217
- const provider = createTestDataProvider({
1218
- getTickerFinancials: async () => emptyFinancials(),
1219
- getChartResolutionSupport: () => [{ resolution: "1d", maxRange: "ALL" }],
1220
- getPriceHistoryForResolution: async () => currentHistory,
1221
- getDetailedPriceHistory: async () => historicalHistory,
1222
- });
1223
- const spec: ChartSpec = chartSpec({
1224
- viewport: { range: "1Y", resolution: "1d" },
1225
- series: [chartSeries({
1226
- source: {
1227
- kind: "security",
1228
- instrument: { symbol: "TEST", exchange: "NASDAQ" },
1229
- fieldId: "market.close",
1230
- },
1231
- })],
1232
- });
1233
- const sources = {
1234
- dataProvider: provider,
1235
- now: new Date("2026-07-30T16:00:00.000Z"),
1236
- loadFredSeries: async () => fredLoad(),
1237
- };
1238
- const cache = new ChartResolveCache();
1239
-
1240
- await resolveChartSpecData(spec, sources, cache);
1241
- const panned = await resolveChartSpecData(spec, sources, cache, {
1242
- requestViewport: {
1243
- start: new Date("2026-07-20T00:00:00.000Z"),
1244
- end: new Date("2026-07-30T16:00:00.000Z"),
1245
- },
1246
- });
1247
-
1248
- const points = panned.bufferedSeries?.[0]?.points ?? [];
1249
- expect(points.map((point) => point.date.toISOString())).toEqual([
1250
- "2026-07-23T22:00:00.000Z",
1251
- "2026-07-28T13:30:00.000Z",
1252
- "2026-07-29T13:30:00.000Z",
1253
- "2026-07-30T13:30:00.000Z",
1254
- ]);
1255
- expect(points.map((point) => point.value)).toEqual([100, 110, 115, 120]);
1256
- });
1257
-
1258
- test("keeps percent transforms and studies defined in a panned history window", async () => {
1259
- const provider = createTestDataProvider({
1260
- getTickerFinancials: async () => emptyFinancials(),
1261
- getDetailedPriceHistory: async () => [
1262
- { date: new Date("2024-10-15T16:00:00.000Z"), close: 100 },
1263
- { date: new Date("2024-10-16T16:00:00.000Z"), close: 110 },
1264
- ],
1265
- });
1266
- const spec: ChartSpec = chartSpec({
1267
- viewport: { range: "3M", resolution: "1d" },
1268
- series: [chartSeries({
1269
- source: {
1270
- kind: "security",
1271
- instrument: { symbol: "TEST", exchange: "NASDAQ" },
1272
- fieldId: "market.close",
1273
- },
1274
- transform: "percent",
1275
- })],
1276
- studies: [{
1277
- id: "sma",
1278
- kind: "sma",
1279
- inputSeriesIds: ["price"],
1280
- parameters: { period: 2 },
1281
- panelId: "main",
1282
- axis: "left",
1283
- }],
1284
- });
1285
-
1286
- const result = await resolveChartSpecData(
1287
- spec,
1288
- {
1289
- dataProvider: provider,
1290
- now: new Date("2025-04-01T00:00:00.000Z"),
1291
- loadFredSeries: async () => fredLoad(),
1292
- },
1293
- new ChartResolveCache(),
1294
- {
1295
- requestViewport: {
1296
- start: new Date("2024-10-10T00:00:00.000Z"),
1297
- end: new Date("2024-10-17T00:00:00.000Z"),
1298
- },
1299
- },
1300
- );
1301
-
1302
- expect(result.errors).toEqual([]);
1303
- expect(result.bufferedSeries?.find((series) => series.id === "price")?.points.map((point) => point.value))
1304
- .toEqual([0, 10]);
1305
- expect(result.bufferedSeries?.find((series) => series.id === "sma")?.points.map((point) => point.value))
1306
- .toEqual([5]);
1307
- });
1308
-
1309
- test("resolves unrelated price, filed fundamental, and economic series on one chart", async () => {
1310
- const provider = createTestDataProvider({
1311
- getTickerFinancials: async (symbol) => symbol === "MSFT"
1312
- ? {
1313
- ...emptyFinancials(),
1314
- annualStatements: [{
1315
- date: "2025-12-31",
1316
- availableAt: "2026-02-15",
1317
- fieldAvailability: { totalRevenue: "2026-02-15" },
1318
- totalRevenue: 250,
1319
- }],
1320
- }
1321
- : emptyFinancials(),
1322
- getPriceHistoryForResolution: async (symbol, _exchange, _range, resolution) => {
1323
- expect(symbol).toBe("AAPL");
1324
- expect(resolution).toBe("1d");
1325
- return [
1326
- { date: new Date("2024-12-31T00:00:00Z"), close: 80 },
1327
- { date: new Date("2025-04-01T00:00:00Z"), close: 100 },
1328
- { date: new Date("2026-03-01T00:00:00Z"), close: 125 },
1329
- ];
1330
- },
1331
- });
1332
- const spec: ChartSpec = chartSpec({
1333
- viewport: { range: "1Y", resolution: "1d" },
1334
- panels: [{ id: "main" }, { id: "macro", height: 0.4 }],
1335
- series: [
1336
- chartSeries({
1337
- id: "aapl-price",
1338
- source: { kind: "security", instrument: { symbol: "AAPL" }, fieldId: "market.close" },
1339
- transform: "percent",
1340
- axis: "auto",
1341
- }),
1342
- chartSeries({
1343
- id: "msft-revenue",
1344
- source: {
1345
- kind: "security",
1346
- instrument: { symbol: "MSFT" },
1347
- fieldId: "fundamental.totalRevenue",
1348
- period: "annual",
1349
- timestampMode: "available-at",
1350
- },
1351
- style: "columns",
1352
- axis: "auto",
1353
- interpolation: "step-after",
1354
- }),
1355
- chartSeries({
1356
- id: "cpi",
1357
- source: { kind: "economic", provider: "fred", seriesId: "CPIAUCSL" },
1358
- style: "step",
1359
- axis: "auto",
1360
- panelId: "macro",
1361
- interpolation: "step-after",
1362
- }),
1363
- ],
1364
- });
1365
-
1366
- const result = await resolveChartSpecData(spec, {
1367
- dataProvider: provider,
1368
- now: new Date("2026-03-31T00:00:00Z"),
1369
- loadFredSeries: async () => fredLoad({
1370
- observations: [
1371
- { date: "2025-03-01", value: 310 },
1372
- { date: "2026-03-01", value: 320 },
1373
- ],
1374
- info: {
1375
- id: "CPIAUCSL",
1376
- title: "Consumer Price Index",
1377
- units: "Index 1982-1984=100",
1378
- frequency: "Monthly",
1379
- seasonalAdjustment: "Seasonally Adjusted",
1380
- source: "FRED",
1381
- notes: "",
1382
- },
1383
- }, {
1384
- fetchedAt: Date.parse("2026-03-15T00:00:00Z"),
1385
- stale: true,
1386
- source: "stale-fallback",
1387
- refreshError: "network unavailable",
1388
- }),
1389
- });
1390
-
1391
- expect(result.errors).toEqual([]);
1392
- expect(result.series).toHaveLength(3);
1393
- const price = result.series.find((entry) => entry.id === "aapl-price")!;
1394
- expect(price.points.map((point) => point.value)).toEqual([0, 25]);
1395
- expect(price.axis).toBe("left");
1396
- const bufferedPrice = result.bufferedSeries?.find((entry) => entry.id === "aapl-price");
1397
- expect(bufferedPrice?.points.map((point) => point.value)).toEqual([-20, 0, 25]);
1398
- const revenue = result.series.find((entry) => entry.id === "msft-revenue")!;
1399
- expect(revenue.points[0]?.date.toISOString().slice(0, 10)).toBe("2026-02-15");
1400
- expect(revenue.axis).toBe("right");
1401
- expect(result.series.find((entry) => entry.id === "cpi")?.panelId).toBe("macro");
1402
- expect(result.warnings[0]).toContain("FRED refresh failed (network unavailable)");
1403
- expect(result.warnings[0]).toContain("cached data fetched 2026-03-15");
1404
- expect(result.warnings.some((warning) => warning.includes("FRED vintage dates"))).toBe(true);
1405
- expect(result.viewport).toEqual({
1406
- start: new Date("2025-03-31T00:00:00.000Z"),
1407
- end: new Date("2026-03-31T00:00:00.000Z"),
1408
- });
1409
- });
1410
-
1411
- test("uses an exact custom window, derives its auto resolution, and warms studies before clipping", async () => {
1412
- let detailRequest: {
1413
- start: Date;
1414
- end: Date;
1415
- barSize: string;
1416
- } | null = null;
1417
- const provider = createTestDataProvider({
1418
- getTickerFinancials: async () => emptyFinancials(),
1419
- getDetailedPriceHistory: async (_symbol, _exchange, start, end, barSize) => {
1420
- detailRequest = { start, end, barSize };
1421
- return [
1422
- { date: new Date("2024-12-30T16:00:00Z"), close: 10 },
1423
- { date: new Date("2024-12-31T16:00:00Z"), close: 20 },
1424
- { date: new Date("2025-01-01T16:00:00Z"), close: 30 },
1425
- { date: new Date("2025-01-31T16:00:00Z"), close: 40 },
1426
- ];
1427
- },
1428
- });
1429
- const spec: ChartSpec = chartSpec({
1430
- viewport: {
1431
- range: "1Y",
1432
- resolution: "auto",
1433
- dateWindow: { start: "2025-01-01", end: "2025-01-31" },
1434
- },
1435
- series: [chartSeries({
1436
- source: { kind: "security", instrument: { symbol: "TEST" }, fieldId: "market.close" },
1437
- })],
1438
- studies: [{
1439
- id: "sma",
1440
- kind: "sma",
1441
- inputSeriesIds: ["price"],
1442
- parameters: { period: 3 },
1443
- panelId: "main",
1444
- axis: "left",
1445
- }],
1446
- });
1447
-
1448
- const result = await resolveChartSpecData(spec, {
1449
- dataProvider: provider,
1450
- now: new Date("2026-03-01T00:00:00Z"),
1451
- loadFredSeries: async () => fredLoad(),
1452
- });
1453
-
1454
- expect(detailRequest).not.toBeNull();
1455
- expect(detailRequest!.barSize).toBe("15m");
1456
- expect(detailRequest!.start.getTime()).toBeLessThan(new Date("2025-01-01T00:00:00Z").getTime());
1457
- expect(detailRequest!.end.toISOString()).toBe("2025-02-01T00:00:00.000Z");
1458
- expect(result.series.find((entry) => entry.id === "price")?.points.map((point) => point.date.toISOString())).toEqual([
1459
- "2025-01-01T16:00:00.000Z",
1460
- "2025-01-31T16:00:00.000Z",
1461
- ]);
1462
- expect(result.series.find((entry) => entry.id === "sma")?.points.map((point) => point.value)).toEqual([20, 30]);
1463
- expect(result.viewport).toEqual({
1464
- start: new Date("2025-01-01T00:00:00.000Z"),
1465
- end: new Date("2025-01-31T23:59:59.999Z"),
1466
- });
1467
- });
1468
-
1469
- test("falls back to a trailing range that reaches a historical custom window", async () => {
1470
- let detailAttempted = false;
1471
- let requestedRange = "";
1472
- let requestedResolution = "";
1473
- const provider = createTestDataProvider({
1474
- getTickerFinancials: async () => emptyFinancials(),
1475
- getDetailedPriceHistory: async () => {
1476
- detailAttempted = true;
1477
- return [];
1478
- },
1479
- getPriceHistoryForResolution: async (_symbol, _exchange, range, resolution) => {
1480
- requestedRange = range;
1481
- requestedResolution = resolution;
1482
- return [{ date: new Date("2025-01-31T16:00:00Z"), close: 40 }];
1483
- },
1484
- });
1485
- const spec: ChartSpec = chartSpec({
1486
- viewport: {
1487
- range: "1D",
1488
- resolution: "auto",
1489
- dateWindow: { start: "2025-01-01", end: "2025-01-31" },
1490
- },
1491
- series: [chartSeries({
1492
- source: { kind: "security", instrument: { symbol: "TEST" }, fieldId: "market.close" },
1493
- })],
1494
- });
1495
-
1496
- const result = await resolveChartSpecData(spec, {
1497
- dataProvider: provider,
1498
- now: new Date("2026-03-01T00:00:00Z"),
1499
- loadFredSeries: async () => fredLoad(),
1500
- });
1501
-
1502
- expect(detailAttempted).toBe(true);
1503
- expect(requestedRange).toBe("5Y");
1504
- expect(requestedResolution).toBe("15m");
1505
- expect(result.series[0]?.points).toHaveLength(1);
1506
- });
1507
-
1508
- test("retains the prior step observation as the custom window's left-edge anchor", async () => {
1509
- const provider = createTestDataProvider({
1510
- getTickerFinancials: async () => ({
1511
- ...emptyFinancials(),
1512
- annualStatements: [{
1513
- date: "2024-09-30",
1514
- availableAt: "2024-12-15",
1515
- fieldAvailability: { totalRevenue: "2024-12-15" },
1516
- totalRevenue: 90,
1517
- }],
1518
- }),
1519
- });
1520
- const spec: ChartSpec = chartSpec({
1521
- viewport: {
1522
- range: "1M",
1523
- resolution: "auto",
1524
- dateWindow: { start: "2025-01-01", end: "2025-01-31" },
1525
- },
1526
- series: [chartSeries({
1527
- id: "revenue",
1528
- source: {
1529
- kind: "security",
1530
- instrument: { symbol: "TEST" },
1531
- fieldId: "fundamental.totalRevenue",
1532
- period: "annual",
1533
- timestampMode: "available-at",
1534
- },
1535
- style: "step",
1536
- interpolation: "step-after",
1537
- })],
1538
- });
1539
-
1540
- const result = await resolveChartSpecData(spec, {
1541
- dataProvider: provider,
1542
- now: new Date("2025-02-01T00:00:00Z"),
1543
- loadFredSeries: async () => fredLoad(),
1544
- });
1545
-
1546
- const anchor = result.series[0]?.points[0];
1547
- expect(result.series[0]?.points).toHaveLength(1);
1548
- expect(anchor?.date.toISOString()).toBe("2024-12-15T00:00:00.000Z");
1549
- expect(anchor?.value).toBe(90);
1550
- });
1551
-
1552
- test("retains an as-of anchor for ratio and spread formulas across a custom window", async () => {
1553
- const provider = createTestDataProvider({
1554
- getTickerFinancials: async (symbol) => ({
1555
- ...emptyFinancials(),
1556
- financialCurrency: "USD",
1557
- quarterlyStatements: symbol === "LEFT"
1558
- ? [
1559
- {
1560
- date: "2024-12-31",
1561
- availableAt: "2025-02-10",
1562
- fieldAvailability: { totalRevenue: "2025-02-10" },
1563
- totalRevenue: 100,
1564
- },
1565
- {
1566
- date: "2025-03-31",
1567
- availableAt: "2025-05-10",
1568
- fieldAvailability: { totalRevenue: "2025-05-10" },
1569
- totalRevenue: 120,
1570
- },
1571
- ]
1572
- : [
1573
- {
1574
- date: "2024-12-31",
1575
- availableAt: "2025-02-20",
1576
- fieldAvailability: { totalRevenue: "2025-02-20" },
1577
- totalRevenue: 50,
1578
- },
1579
- {
1580
- date: "2025-03-31",
1581
- availableAt: "2025-06-10",
1582
- fieldAvailability: { totalRevenue: "2025-06-10" },
1583
- totalRevenue: 40,
1584
- },
1585
- ],
1586
- }),
1587
- });
1588
- const fundamental = (id: string, symbol: string): ChartSpec["series"][number] => (chartSeries({
1589
- id,
1590
- source: {
1591
- kind: "security",
1592
- instrument: { symbol },
1593
- fieldId: "fundamental.totalRevenue",
1594
- period: "quarterly",
1595
- timestampMode: "available-at",
1596
- },
1597
- // The built-in fundamental comparison preset uses columns without
1598
- // display interpolation; formula calculation still uses as-of values.
1599
- style: "columns",
1600
- }));
1601
- const spec: ChartSpec = chartSpec({
1602
- viewport: {
1603
- range: "1Y",
1604
- resolution: "auto",
1605
- dateWindow: { start: "2025-04-01", end: "2025-07-31" },
1606
- },
1607
- panels: [{ id: "main" }, { id: "formula" }],
1608
- series: [fundamental("left", "LEFT"), fundamental("right", "RIGHT")],
1609
- studies: [
1610
- {
1611
- id: "ratio",
1612
- kind: "ratio",
1613
- inputSeriesIds: ["left", "right"],
1614
- parameters: {},
1615
- panelId: "formula",
1616
- axis: "left",
1617
- },
1618
- {
1619
- id: "spread",
1620
- kind: "spread",
1621
- inputSeriesIds: ["left", "right"],
1622
- parameters: {},
1623
- panelId: "formula",
1624
- axis: "left",
1625
- },
1626
- ],
1627
- });
1628
-
1629
- const result = await resolveChartSpecData(spec, {
1630
- dataProvider: provider,
1631
- now: new Date("2025-08-01T00:00:00Z"),
1632
- loadFredSeries: async () => fredLoad(),
1633
- });
1634
-
1635
- expect(result.errors).toEqual([]);
1636
- expect(result.series.find(({ id }) => id === "ratio")).toMatchObject({
1637
- style: "step",
1638
- interpolation: "step-after",
1639
- });
1640
- expect(result.series.find(({ id }) => id === "ratio")?.points.map((point) => ({
1641
- date: point.date.toISOString().slice(0, 10),
1642
- value: point.value,
1643
- }))).toEqual([
1644
- { date: "2025-02-20", value: 2 },
1645
- { date: "2025-05-10", value: 2.4 },
1646
- { date: "2025-06-10", value: 3 },
1647
- ]);
1648
- expect(result.series.find(({ id }) => id === "spread")?.points[0]).toMatchObject({
1649
- date: new Date("2025-02-20T00:00:00Z"),
1650
- value: 50,
1651
- });
1652
- });
1653
-
1654
- test("keeps an explicit viewport when a latest-observation cap is also set", async () => {
1655
- const provider = createTestDataProvider({
1656
- getTickerFinancials: async () => ({
1657
- ...emptyFinancials(),
1658
- annualStatements: [
1659
- {
1660
- date: "2023-12-31",
1661
- availableAt: "2025-01-10",
1662
- fieldAvailability: { totalRevenue: "2025-01-10" },
1663
- totalRevenue: 100,
1664
- },
1665
- {
1666
- date: "2024-12-31",
1667
- availableAt: "2025-02-10",
1668
- fieldAvailability: { totalRevenue: "2025-02-10" },
1669
- totalRevenue: 120,
1670
- },
1671
- ],
1672
- }),
1673
- });
1674
- const spec: ChartSpec = chartSpec({
1675
- viewport: {
1676
- range: "ALL",
1677
- resolution: "auto",
1678
- dateWindow: { start: "2025-01-01", end: "2025-02-28" },
1679
- maxPoints: 1,
1680
- },
1681
- series: [chartSeries({
1682
- id: "revenue",
1683
- source: {
1684
- kind: "security",
1685
- instrument: { symbol: "TEST" },
1686
- fieldId: "fundamental.totalRevenue",
1687
- period: "annual",
1688
- timestampMode: "available-at",
1689
- },
1690
- style: "step",
1691
- interpolation: "step-after",
1692
- })],
1693
- });
1694
-
1695
- const result = await resolveChartSpecData(spec, {
1696
- dataProvider: provider,
1697
- now: new Date("2025-03-01T00:00:00Z"),
1698
- loadFredSeries: async () => fredLoad(),
1699
- });
1700
-
1701
- expect(result.series[0]?.points.map((point) => point.value)).toEqual([120]);
1702
- expect(result.viewport).toEqual({
1703
- start: new Date("2025-01-01T00:00:00.000Z"),
1704
- end: new Date("2025-02-28T23:59:59.999Z"),
1705
- });
1706
- });
1707
-
1708
- test("keeps hidden base series available to visible studies without rendering the base", async () => {
1709
- const provider = createTestDataProvider({
1710
- getTickerFinancials: async () => emptyFinancials(),
1711
- getPriceHistoryForResolution: async () => [
1712
- { date: new Date("2025-01-01T16:00:00Z"), close: 10 },
1713
- { date: new Date("2025-01-02T16:00:00Z"), close: 20 },
1714
- { date: new Date("2025-01-03T16:00:00Z"), close: 30 },
1715
- ],
1716
- });
1717
- const spec: ChartSpec = chartSpec({
1718
- viewport: { range: "1Y", resolution: "1d" },
1719
- series: [chartSeries({
1720
- source: {
1721
- kind: "security",
1722
- instrument: { symbol: "TEST", exchange: "NASDAQ" },
1723
- fieldId: "market.close",
1724
- },
1725
- visible: false,
1726
- })],
1727
- studies: [{
1728
- id: "sma",
1729
- kind: "sma",
1730
- inputSeriesIds: ["price"],
1731
- parameters: { period: 2 },
1732
- panelId: "main",
1733
- axis: "left",
1734
- }],
1735
- });
1736
-
1737
- const result = await resolveChartSpecData(spec, {
1738
- dataProvider: provider,
1739
- now: new Date("2025-01-04T00:00:00Z"),
1740
- loadFredSeries: async () => fredLoad(),
1741
- });
1742
-
1743
- expect(result.errors).toEqual([]);
1744
- expect(result.series.map((series) => series.id)).toEqual(["sma"]);
1745
- expect(result.legendSeries?.map((series) => series.id)).toEqual(["price", "sma"]);
1746
- expect(result.series[0]?.points.map((point) => point.value)).toEqual([15, 25]);
1747
- expect(result.legendSeries?.find((series) => series.id === "price")?.timeBasis)
1748
- .toMatchObject({ kind: "market", timeZone: "America/New_York" });
1749
- expect(result.timelineSeries?.map((series) => series.id)).toEqual(["price"]);
1750
- expect(result.series[0]?.timeBasis)
1751
- .toMatchObject({ kind: "market", timeZone: "America/New_York" });
1752
- });
1753
-
1754
- test("applies a streamed quote override before recomputing transforms and studies", async () => {
1755
- const now = Date.now();
1756
- const source = {
1757
- kind: "security" as const,
1758
- instrument: { symbol: "LIVE" },
1759
- fieldId: "market.close",
1760
- };
1761
- const provider = createTestDataProvider({
1762
- getTickerFinancials: async () => ({
1763
- ...emptyFinancials(),
1764
- quote: {
1765
- symbol: "LIVE",
1766
- price: 115,
1767
- currency: "USD",
1768
- change: 5,
1769
- changePercent: 4.5,
1770
- lastUpdated: now - 500,
1771
- },
1772
- }),
1773
- getPriceHistoryForResolution: async () => [
1774
- { date: new Date(now - 2 * 86_400_000), close: 100 },
1775
- { date: new Date(now - 86_400_000), close: 110 },
1776
- ],
1777
- });
1778
- const spec: ChartSpec = chartSpec({
1779
- viewport: { range: "1Y", resolution: "1d" },
1780
- series: [{
1781
- id: "price",
1782
- source,
1783
- style: "line",
1784
- transform: "percent",
1785
- axis: "left",
1786
- panelId: "main",
1787
- interpolation: "none",
1788
- }],
1789
- studies: [{
1790
- id: "sma",
1791
- kind: "sma",
1792
- inputSeriesIds: ["price"],
1793
- parameters: { period: 2 },
1794
- panelId: "main",
1795
- axis: "left",
1796
- }],
1797
- });
1798
- const quoteOverrides = new Map([[
1799
- chartQuoteOverrideKeyForSource(source),
1800
- {
1801
- symbol: "LIVE",
1802
- price: 121,
1803
- currency: "USD",
1804
- change: 11,
1805
- changePercent: 10,
1806
- lastUpdated: now,
1807
- },
1808
- ]]);
1809
-
1810
- const result = await resolveChartSpecData(spec, {
1811
- dataProvider: provider,
1812
- now: new Date(now),
1813
- quoteOverrides,
1814
- loadFredSeries: async () => fredLoad(),
1815
- });
1816
-
1817
- expect(result.errors).toEqual([]);
1818
- const price = result.series.find((entry) => entry.id === "price")!;
1819
- expect(price.points).toHaveLength(3);
1820
- expect(price.points.at(-1)?.date.getTime()).toBe(now);
1821
- expect(price.points.at(-1)?.value).toBeCloseTo(21);
1822
- const sma = result.series.find((entry) => entry.id === "sma")!;
1823
- expect(sma.points).toHaveLength(2);
1824
- expect(sma.points.at(-1)?.date.getTime()).toBe(now);
1825
- expect(sma.points.at(-1)?.value).toBeCloseTo(15.5);
1826
- });
1827
-
1828
- test.each([0, 60_000])("validates a quote received after resolution starts against %i ms elapsed", async (elapsed) => {
1829
- const now = Date.parse("2026-08-05T22:00:00Z");
1830
- const quoteTime = now + 60_000;
1831
- const clock = spyOn(Date, "now").mockReturnValue(now);
1832
- const provider = createTestDataProvider({
1833
- getTickerFinancials: async () => ({
1834
- ...emptyFinancials(),
1835
- quote: {
1836
- symbol: "FRESH",
1837
- price: 130,
1838
- currency: "USD",
1839
- change: 30,
1840
- changePercent: 30,
1841
- lastUpdated: quoteTime,
1842
- listingExchangeName: "XNAS",
1843
- marketState: "POST",
1844
- postMarketPrice: 129,
1845
- postMarketChange: -1,
1846
- postMarketChangePercent: -0.77,
1847
- },
1848
- }),
1849
- getPriceHistoryForResolution: async () => {
1850
- clock.mockReturnValue(now + elapsed);
1851
- return [
1852
- { date: new Date(now - 2 * 86_400_000), open: 99, high: 102, low: 98, close: 100 },
1853
- { date: new Date(now - 86_400_000), open: 100, high: 101, low: 99, close: 100 },
1854
- ];
1855
- },
1856
- });
1857
- const spec: ChartSpec = chartSpec({
1858
- viewport: { range: "6M", resolution: "1d" },
1859
- series: [chartSeries({
1860
- source: {
1861
- kind: "security",
1862
- instrument: { symbol: "FRESH", exchange: "XNAS" },
1863
- fieldId: "market.ohlcv",
1864
- },
1865
- style: "candles",
1866
- })],
1867
- studies: [{
1868
- id: "sma",
1869
- kind: "sma",
1870
- inputSeriesIds: ["price"],
1871
- parameters: { period: 2 },
1872
- panelId: "main",
1873
- axis: "left",
1874
- }],
1875
- });
1876
-
1877
- try {
1878
- const result = await resolveChartSpecData(spec, {
1879
- dataProvider: provider,
1880
- now: new Date(now),
1881
- quoteOverrides: new Map([[
1882
- chartQuoteOverrideKeyForSource({
1883
- kind: "security",
1884
- instrument: { symbol: "FRESH", exchange: "XNAS" },
1885
- fieldId: "market.ohlcv",
1886
- }),
1887
- {
1888
- symbol: "FRESH",
1889
- price: 130,
1890
- currency: "USD",
1891
- change: 30,
1892
- changePercent: 30,
1893
- lastUpdated: quoteTime,
1894
- listingExchangeName: "XNAS",
1895
- marketState: "POST",
1896
- postMarketPrice: 129,
1897
- postMarketChange: -1,
1898
- postMarketChangePercent: -0.77,
1899
- },
1900
- ]]),
1901
- loadFredSeries: async () => fredLoad(),
1902
- });
1903
-
1904
- expect(result.errors).toEqual([]);
1905
- expect(result.viewport?.end.getTime()).toBe(elapsed ? quoteTime : now);
1906
- const price = result.series.find((entry) => entry.id === "price");
1907
- const sma = result.series.find((entry) => entry.id === "sma");
1908
- expect(price?.points.at(-1)?.date.getTime()).toBe(elapsed ? quoteTime : now - 86_400_000);
1909
- expect(price?.points.at(-1)?.close).toBe(elapsed ? 129 : 100);
1910
- expect(price?.latestChangePercent).toBe(elapsed ? 30 : undefined);
1911
- expect(sma?.points.at(-1)?.date.getTime()).toBe(elapsed ? quoteTime : now - 86_400_000);
1912
- } finally { clock.mockRestore(); }
1913
- });
1914
-
1915
- test.each(["line", "candles"] as const)("keeps one daily bar when a live quote updates a %s chart", async (style) => {
1916
- const now = Date.parse("2026-09-10T18:44:00Z");
1917
- const source = { kind: "security" as const, instrument: { symbol: "SQQQ", exchange: "NASDAQ" }, fieldId: "market.close" };
1918
- const provider = createTestDataProvider({
1919
- getPriceHistoryForResolution: async () => [{
1920
- date: new Date("2026-09-10T13:30:00Z"), open: 40, high: 41, low: 39, close: 39.77, volume: 1000,
1921
- }],
1922
- });
1923
- const result = await resolveChartSpecData(chartSpec({
1924
- viewport: { range: "1M", resolution: "1d" },
1925
- series: [{ id: "price", source, style, transform: "raw", axis: "left", panelId: "main", interpolation: "none" }],
1926
- }), {
1927
- dataProvider: provider,
1928
- now: new Date(now),
1929
- quoteOverrides: new Map([[chartQuoteOverrideKeyForSource(source), {
1930
- symbol: "SQQQ", price: 39.75, currency: "USD", change: 0, changePercent: 0,
1931
- lastUpdated: now, listingExchangeName: "NASDAQ", marketState: "REGULAR",
1932
- }]]),
1933
- });
1934
- expect(result.errors).toEqual([]);
1935
- expect(result.series[0]?.points).toHaveLength(1);
1936
- expect(result.series[0]?.points[0]).toMatchObject({ value: 39.75, open: 40, high: 41, low: 39, volume: 1000 });
1937
- });
1938
-
1939
- test("retains the known listing session when the quote omits exchange metadata", async () => {
1940
- const now = Date.parse("2026-09-11T00:01:00Z");
1941
- const source = { kind: "security" as const, instrument: { symbol: "SQQQ", exchange: "NASDAQ" }, fieldId: "market.close" };
1942
- const result = await resolveChartSpecData(chartSpec({
1943
- viewport: { range: "1M", resolution: "1d" },
1944
- series: [{ id: "price", source, style: "line", transform: "raw", axis: "left", panelId: "main", interpolation: "none" }],
1945
- }), {
1946
- dataProvider: createTestDataProvider({ getPriceHistoryForResolution: async () => [
1947
- { date: new Date("2026-09-10T00:00:00Z"), close: 100 },
1948
- ] }),
1949
- now: new Date(now),
1950
- quoteOverrides: new Map([[chartQuoteOverrideKeyForSource(source), {
1951
- symbol: "SQQQ", price: 100, postMarketPrice: 105, currency: "USD", change: 0, changePercent: 0,
1952
- lastUpdated: now - 60_000, marketState: "POST",
1953
- }]]),
1954
- });
1955
- expect(result.errors).toEqual([]);
1956
- expect(result.series[0]?.points).toHaveLength(1);
1957
- expect(result.series[0]?.points[0]?.value).toBe(105);
1958
- });
1959
-
1960
- test("reuses raw source loads while live quotes recompute the chart tail", async () => {
1961
- const now = Date.parse("2026-05-15T20:30:00Z");
1962
- const source = {
1963
- kind: "security" as const,
1964
- instrument: { symbol: "LIVE" },
1965
- fieldId: "market.close",
1966
- };
1967
- let financialCalls = 0;
1968
- let historyCalls = 0;
1969
- let fredCalls = 0;
1970
- const provider = createTestDataProvider({
1971
- getTickerFinancials: async () => {
1972
- financialCalls += 1;
1973
- return emptyFinancials();
1974
- },
1975
- getPriceHistoryForResolution: async () => {
1976
- historyCalls += 1;
1977
- return [{ date: new Date(now - 86_400_000), close: 100 }];
1978
- },
1979
- });
1980
- const spec: ChartSpec = chartSpec({
1981
- viewport: { range: "1Y", resolution: "1d" },
1982
- series: [{
1983
- id: "price",
1984
- source,
1985
- style: "line",
1986
- transform: "raw",
1987
- axis: "left",
1988
- panelId: "main",
1989
- interpolation: "none",
1990
- }, chartSeries({
1991
- id: "cpi",
1992
- source: { kind: "economic", provider: "fred", seriesId: "CPIAUCSL" },
1993
- axis: "right",
1994
- })],
1995
- });
1996
- const loadFredSeries = async () => {
1997
- fredCalls += 1;
1998
- return fredLoad({
1999
- observations: [{ date: "2026-05-01", value: 320 }],
2000
- info: null,
2001
- });
2002
- };
2003
- const cache = new ChartResolveCache();
2004
-
2005
- await resolveChartSpecData(spec, {
2006
- dataProvider: provider,
2007
- now: new Date(now),
2008
- loadFredSeries,
2009
- }, cache);
2010
- const live = await resolveChartSpecData(spec, {
2011
- dataProvider: provider,
2012
- now: new Date(now + 1_000),
2013
- loadFredSeries,
2014
- quoteOverrides: new Map([[
2015
- chartQuoteOverrideKeyForSource(source),
2016
- {
2017
- symbol: "LIVE",
2018
- price: 105,
2019
- currency: "USD",
2020
- change: 5,
2021
- changePercent: 5,
2022
- lastUpdated: now,
2023
- },
2024
- ]]),
2025
- }, cache);
2026
-
2027
- expect(financialCalls).toBe(1);
2028
- expect(historyCalls).toBe(1);
2029
- expect(fredCalls).toBe(1);
2030
- expect(live.errors).toEqual([]);
2031
- expect(live.series.find((entry) => entry.id === "price")?.points.at(-1)?.value).toBe(105);
2032
- });
2033
-
2034
- test("derives current trailing multiples from the live quote and latest public TTM inputs", async () => {
2035
- const quoteTime = Date.parse("2025-05-01T16:00:00Z");
2036
- const statements = [
2037
- {
2038
- date: "2024-03-31",
2039
- availableAt: "2024-05-01",
2040
- totalRevenue: 100,
2041
- ebitda: 20,
2042
- freeCashFlow: 10,
2043
- eps: 1,
2044
- basicShares: 10,
2045
- totalDebt: 50,
2046
- cashAndCashEquivalents: 20,
2047
- },
2048
- {
2049
- date: "2024-06-30",
2050
- availableAt: "2024-08-01",
2051
- totalRevenue: 110,
2052
- ebitda: 22,
2053
- freeCashFlow: 11,
2054
- eps: 1.1,
2055
- basicShares: 10,
2056
- totalDebt: 50,
2057
- cashAndCashEquivalents: 20,
2058
- },
2059
- {
2060
- date: "2024-09-30",
2061
- availableAt: "2024-11-01",
2062
- totalRevenue: 120,
2063
- ebitda: 24,
2064
- freeCashFlow: 12,
2065
- eps: 1.2,
2066
- basicShares: 10,
2067
- totalDebt: 50,
2068
- cashAndCashEquivalents: 20,
2069
- },
2070
- {
2071
- date: "2024-12-31",
2072
- availableAt: "2025-02-15",
2073
- totalRevenue: 130,
2074
- ebitda: 26,
2075
- freeCashFlow: 13,
2076
- eps: 1.3,
2077
- basicShares: 10,
2078
- totalDebt: 50,
2079
- cashAndCashEquivalents: 20,
2080
- },
2081
- {
2082
- date: "2025-03-31",
2083
- // This newer TTM window is not public at the quote timestamp.
2084
- availableAt: "2025-05-15",
2085
- totalRevenue: 1_000,
2086
- ebitda: 500,
2087
- freeCashFlow: 400,
2088
- eps: 20,
2089
- basicShares: 20,
2090
- totalDebt: 100,
2091
- cashAndCashEquivalents: 5,
2092
- },
2093
- ];
2094
- const provider = createTestDataProvider({
2095
- getTickerFinancials: async () => ({
2096
- ...emptyFinancials(),
2097
- quarterlyStatements: statements,
2098
- financialCurrency: "USD",
2099
- quote: {
2100
- symbol: "LIVE",
2101
- price: 50,
2102
- currency: "USD",
2103
- change: 0,
2104
- changePercent: 0,
2105
- lastUpdated: quoteTime - 1_000,
2106
- },
2107
- }),
2108
- getPriceHistoryForResolution: async () => [
2109
- { date: new Date("2024-04-30T16:00:00Z"), close: 40 },
2110
- { date: new Date("2024-07-31T16:00:00Z"), close: 45 },
2111
- { date: new Date("2024-10-31T16:00:00Z"), close: 48 },
2112
- { date: new Date("2025-02-14T16:00:00Z"), close: 50 },
2113
- ],
2114
- });
2115
- const valuationFields = [
2116
- "trailingPE",
2117
- "priceSales",
2118
- "evSales",
2119
- "evEbitda",
2120
- "priceFcf",
2121
- ] as const;
2122
- const makeSeries = (metric: typeof valuationFields[number]): ChartSpec["series"][number] => (chartSeries({
2123
- id: metric,
2124
- source: {
2125
- kind: "security",
2126
- instrument: { symbol: "LIVE" },
2127
- fieldId: `valuation.${metric}`,
2128
- period: "quarterly",
2129
- timestampMode: "available-at",
2130
- },
2131
- style: "step",
2132
- interpolation: "step-after",
2133
- }));
2134
- const spec: ChartSpec = chartSpec({
2135
- viewport: { range: "1Y", resolution: "1d" },
2136
- series: valuationFields.map(makeSeries),
2137
- });
2138
- const firstSource = spec.series[0]!.source;
2139
- if (firstSource.kind !== "security") throw new Error("expected security source");
2140
- const quoteOverrides = new Map([[
2141
- chartQuoteOverrideKeyForSource(firstSource),
2142
- {
2143
- symbol: "LIVE",
2144
- price: 60,
2145
- currency: "USD",
2146
- change: 10,
2147
- changePercent: 20,
2148
- lastUpdated: quoteTime,
2149
- },
2150
- ]]);
2151
-
2152
- const result = await resolveChartSpecData(spec, {
2153
- dataProvider: provider,
2154
- now: new Date(quoteTime),
2155
- quoteOverrides,
2156
- loadFredSeries: async () => fredLoad(),
2157
- });
2158
-
2159
- expect(result.errors).toEqual([]);
2160
- const currentValue = (id: string) => {
2161
- const point = result.series.find((series) => series.id === id)?.points.at(-1);
2162
- expect(point).toMatchObject({
2163
- date: new Date(quoteTime),
2164
- periodLabel: "Current",
2165
- provenance: { quality: "derived" },
2166
- });
2167
- return point?.value;
2168
- };
2169
- expect(currentValue("trailingPE")).toBeCloseTo(60 / 4.6, 10);
2170
- expect(currentValue("priceSales")).toBeCloseTo(600 / 460, 10);
2171
- expect(currentValue("evSales")).toBeCloseTo(630 / 460, 10);
2172
- expect(currentValue("evEbitda")).toBeCloseTo(630 / 92, 10);
2173
- expect(currentValue("priceFcf")).toBeCloseTo(600 / 46, 10);
2174
- });
2175
-
2176
- test("does not re-timestamp provider forward PE or PEG on quote overrides", async () => {
2177
- const snapshotTime = Date.parse("2025-04-30T16:00:00Z");
2178
- const overrideTime = Date.parse("2025-05-01T16:00:00Z");
2179
- let historyCalls = 0;
2180
- const provider = createTestDataProvider({
2181
- getTickerFinancials: async () => ({
2182
- ...emptyFinancials(),
2183
- fundamentals: { forwardPE: 15, pegRatio: 1.5 },
2184
- quote: {
2185
- symbol: "STATIC",
2186
- price: 50,
2187
- currency: "USD",
2188
- change: 0,
2189
- changePercent: 0,
2190
- lastUpdated: snapshotTime,
2191
- },
2192
- }),
2193
- getPriceHistoryForResolution: async () => {
2194
- historyCalls += 1;
2195
- return [];
2196
- },
2197
- });
2198
- const makeSeries = (metric: "forwardPE" | "pegRatio"): ChartSpec["series"][number] => (chartSeries({
2199
- id: metric,
2200
- source: {
2201
- kind: "security",
2202
- instrument: { symbol: "STATIC" },
2203
- fieldId: `valuation.${metric}`,
2204
- timestampMode: "available-at",
2205
- },
2206
- style: "step",
2207
- interpolation: "step-after",
2208
- }));
2209
- const spec: ChartSpec = chartSpec({
2210
- viewport: { range: "1Y", resolution: "1d" },
2211
- series: [makeSeries("forwardPE"), makeSeries("pegRatio")],
2212
- });
2213
- const firstSource = spec.series[0]!.source;
2214
- if (firstSource.kind !== "security") throw new Error("expected security source");
2215
- const quoteOverrides = new Map([[
2216
- chartQuoteOverrideKeyForSource(firstSource),
2217
- {
2218
- symbol: "STATIC",
2219
- price: 60,
2220
- currency: "USD",
2221
- change: 10,
2222
- changePercent: 20,
2223
- lastUpdated: overrideTime,
2224
- },
2225
- ]]);
2226
-
2227
- const result = await resolveChartSpecData(spec, {
2228
- dataProvider: provider,
2229
- now: new Date(overrideTime),
2230
- quoteOverrides,
2231
- loadFredSeries: async () => fredLoad(),
2232
- });
2233
-
2234
- expect(result.errors).toEqual([]);
2235
- expect(historyCalls).toBe(0);
2236
- expect(result.series.find(({ id }) => id === "forwardPE")?.points).toEqual([
2237
- expect.objectContaining({ date: new Date(snapshotTime), value: 15 }),
2238
- ]);
2239
- expect(result.series.find(({ id }) => id === "pegRatio")?.points).toEqual([
2240
- expect.objectContaining({ date: new Date(snapshotTime), value: 1.5 }),
2241
- ]);
2242
- });
2243
-
2244
- test("merges streamed quotes into the active OHLC resolution bucket", async () => {
2245
- const now = Date.now();
2246
- const source = {
2247
- kind: "security" as const,
2248
- instrument: { symbol: "LIVE" },
2249
- fieldId: "market.ohlcv",
2250
- };
2251
- const provider = createTestDataProvider({
2252
- getTickerFinancials: async () => emptyFinancials(),
2253
- getPriceHistoryForResolution: async () => [
2254
- {
2255
- date: new Date(now - 10 * 60_000),
2256
- open: 100,
2257
- high: 110,
2258
- low: 99,
2259
- close: 108,
2260
- volume: 1_000,
2261
- },
2262
- {
2263
- date: new Date(now - 4 * 60_000),
2264
- open: 108,
2265
- high: 120,
2266
- low: 105,
2267
- close: 115,
2268
- volume: 800,
2269
- },
2270
- ],
2271
- });
2272
- const spec: ChartSpec = chartSpec({
2273
- viewport: { range: "1D", resolution: "5m" },
2274
- series: [{
2275
- id: "price",
2276
- source,
2277
- style: "candles",
2278
- transform: "raw",
2279
- axis: "left",
2280
- panelId: "main",
2281
- interpolation: "none",
2282
- }],
2283
- });
2284
- const quoteOverrides = new Map([[
2285
- chartQuoteOverrideKeyForSource(source),
2286
- {
2287
- symbol: "LIVE",
2288
- price: 121,
2289
- currency: "USD",
2290
- change: 6,
2291
- changePercent: 5.2,
2292
- lastUpdated: now,
2293
- },
2294
- ]]);
2295
-
2296
- const result = await resolveChartSpecData(spec, {
2297
- dataProvider: provider,
2298
- now: new Date(now),
2299
- quoteOverrides,
2300
- loadFredSeries: async () => fredLoad(),
2301
- });
2302
-
2303
- expect(result.errors).toEqual([]);
2304
- const price = result.series.find((entry) => entry.id === "price")!;
2305
- expect(price.points).toHaveLength(2);
2306
- expect(price.points.at(-1)).toMatchObject({
2307
- date: new Date(now - 4 * 60_000),
2308
- value: 121,
2309
- open: 108,
2310
- high: 121,
2311
- low: 105,
2312
- close: 121,
2313
- volume: 800,
2314
- });
2315
- });
2316
-
2317
- test("calculates formulas and volume from raw inputs before display transforms", async () => {
2318
- const provider = createTestDataProvider({
2319
- getTickerFinancials: async () => emptyFinancials(),
2320
- getPriceHistoryForResolution: async (symbol) => symbol === "LEFT"
2321
- ? [
2322
- { date: new Date("2025-01-01T00:00:00Z"), close: 100, volume: 1_000 },
2323
- { date: new Date("2025-01-02T00:00:00Z"), close: 120, volume: 1_200 },
2324
- ]
2325
- : [
2326
- { date: new Date("2025-01-01T00:00:00Z"), close: 200, volume: 2_000 },
2327
- { date: new Date("2025-01-02T00:00:00Z"), close: 240, volume: 2_400 },
2328
- ],
2329
- });
2330
- const makeSeries = (id: string, symbol: string): ChartSpec["series"][number] => (chartSeries({
2331
- id,
2332
- source: { kind: "security", instrument: { symbol }, fieldId: "market.ohlcv" },
2333
- transform: "percent",
2334
- }));
2335
- const spec: ChartSpec = chartSpec({
2336
- viewport: { range: "1Y", resolution: "1d" },
2337
- panels: [{ id: "main" }, { id: "formula" }, { id: "volume" }],
2338
- series: [makeSeries("left", "LEFT"), makeSeries("right", "RIGHT")],
2339
- studies: [
2340
- {
2341
- id: "ratio",
2342
- kind: "ratio",
2343
- inputSeriesIds: ["left", "right"],
2344
- parameters: {},
2345
- panelId: "formula",
2346
- axis: "left",
2347
- },
2348
- {
2349
- id: "volume",
2350
- kind: "volume",
2351
- inputSeriesIds: ["left"],
2352
- parameters: {},
2353
- panelId: "volume",
2354
- axis: "left",
2355
- },
2356
- {
2357
- id: "sma",
2358
- kind: "sma",
2359
- inputSeriesIds: ["left"],
2360
- parameters: { period: 2 },
2361
- panelId: "main",
2362
- axis: "left",
2363
- },
2364
- ],
2365
- });
2366
-
2367
- const result = await resolveChartSpecData(spec, {
2368
- dataProvider: provider,
2369
- now: new Date("2025-01-02T00:00:00Z"),
2370
- loadFredSeries: async () => fredLoad(),
2371
- });
2372
-
2373
- expect(result.errors).toEqual([]);
2374
- expect(result.series.find((series) => series.id === "ratio")?.points.map((point) => point.value))
2375
- .toEqual([0.5, 0.5]);
2376
- expect(result.series.find((series) => series.id === "volume")?.points.map((point) => point.value))
2377
- .toEqual([1_000, 1_200]);
2378
- expect(result.series.find((series) => series.id === "sma")).toMatchObject({
2379
- transform: "percent",
2380
- unit: "%",
2381
- });
2382
- expect(result.series.find((series) => series.id === "sma")?.points.map((point) => point.value))
2383
- .toEqual([10]);
2384
- });
2385
- });
2386
-
2387
- describe("mergePriceHistoryWindows", () => {
2388
- const legacyMerge = (
2389
- current: TickerFinancials["priceHistory"],
2390
- incoming: TickerFinancials["priceHistory"],
2391
- resolution: "1h" | "1d",
2392
- ) => {
2393
- const byTimestamp = new Map<number, TickerFinancials["priceHistory"][number]>();
2394
- for (const point of [...current, ...incoming]) {
2395
- const timestamp = point.date.getTime();
2396
- if (Number.isFinite(timestamp)) byTimestamp.set(timestamp, point);
2397
- }
2398
- const sorted = [...byTimestamp.values()].sort((left, right) => left.date.getTime() - right.date.getTime());
2399
- if (resolution === "1h") return sorted;
2400
- const plotted = new Set(current.map((point) => point.date.getTime()));
2401
- const merged: TickerFinancials["priceHistory"] = [];
2402
- for (const point of sorted) {
2403
- const previous = merged.at(-1);
2404
- if (!previous || point.date.getTime() - previous.date.getTime() >= 86_400_000 * 0.8) {
2405
- merged.push(point);
2406
- } else if (!plotted.has(previous.date.getTime()) && plotted.has(point.date.getTime())) {
2407
- merged[merged.length - 1] = point;
2408
- }
2409
- }
2410
- return merged;
2411
- };
2412
-
2413
- test("linear merge matches the prior merge for overlaps, duplicates, and unsorted fallback", () => {
2414
- const point = (date: string, close: number) => ({ date: new Date(date), close });
2415
- const sortedCurrent = [
2416
- point("2026-07-28T13:30:00Z", 110),
2417
- point("2026-07-29T13:30:00Z", 115),
2418
- point("2026-07-29T13:30:00Z", 116),
2419
- point("2026-07-30T13:30:00Z", 120),
2420
- ];
2421
- const incoming = [
2422
- point("2026-07-27T22:00:00Z", 111),
2423
- point("2026-07-29T13:30:00Z", 999),
2424
- point("2026-07-29T22:00:00Z", 121),
2425
- ];
2426
-
2427
- for (const current of [sortedCurrent, [...sortedCurrent].reverse()]) {
2428
- for (const resolution of ["1h", "1d"] as const) {
2429
- expect(mergePriceHistoryWindows(current, incoming, resolution)).toEqual(
2430
- legacyMerge(current, incoming, resolution),
2431
- );
2432
- }
2433
- }
2434
- });
2435
- });
2436
-
2437
- test("financial charts disclose snapshot vintages once without changing period or availability timestamps", async () => {
2438
- const dataProvider = createTestDataProvider({ getTickerFinancials: async () => ({
2439
- annualStatements: [{ date: "2017-06-30", totalRevenue: 96_571_000_000, netIncome: 25_489_000_000, fieldAvailability: { totalRevenue: "2018-08-03", netIncome: "2018-08-03" } }],
2440
- quarterlyStatements: [], priceHistory: [],
2441
- }) });
2442
- for (const timestampMode of ["period-end", "available-at"] as const) {
2443
- const result = await resolveChartSpecData(chartSpec({ viewport: { range: "ALL", resolution: "auto" },
2444
- series: ["totalRevenue", "netIncome"].map((field) => chartSeries({ id: field, style: "columns",
2445
- source: { kind: "security", instrument: { symbol: "MSFT", exchange: "NASDAQ" }, fieldId: `fundamental.${field}`, period: "annual", timestampMode },
2446
- })),
2447
- }), { dataProvider });
2448
- expect(result.warnings.filter((warning) => warning === FINANCIAL_VINTAGE_NOTICE)).toHaveLength(1);
2449
- expect(result.series[0]?.points[0]).toMatchObject({ value: 96_571_000_000, observedAt: new Date("2017-06-30T00:00:00Z"), availableAt: new Date("2018-08-03T00:00:00Z"), date: new Date(timestampMode === "period-end" ? "2017-06-30T00:00:00Z" : "2018-08-03T00:00:00Z") });
2450
- }
2451
- });
2452
-
2453
- test.each([-9, 0, 12])("forward P/E chart handles reported multiple %s without inventing comparable points", async (forwardPE) => {
2454
- const now = new Date("2026-06-01T16:00:00Z");
2455
- const financials = { ...emptyFinancials(), fundamentals: { forwardPE },
2456
- quote: { symbol: "TEST", price: 20, currency: "USD", change: 0, changePercent: 0, lastUpdated: now.getTime() } };
2457
- const provider = createTestDataProvider({ getTickerFinancials: async () => financials });
2458
- const spec = chartSpec({ viewport: { range: "1Y", resolution: "auto" }, series: [chartSeries({
2459
- source: { kind: "security", instrument: { symbol: "TEST" }, fieldId: "valuation.forwardPE" },
2460
- })] });
2461
- const result = await resolveChartSpecData(spec, { dataProvider: provider, now, loadFredSeries: async () => fredLoad() });
2462
- expect(result.errors).toEqual([]);
2463
- if (forwardPE > 0) {
2464
- expect(result.series[0]?.points.map((point) => point.value)).toEqual([12]);
2465
- expect(result.series[0]?.warning).toBeUndefined();
2466
- } else {
2467
- expect(result.series[0]?.points).toEqual([]);
2468
- expect(result.series[0]?.warning).toContain("not meaningful");
2469
- }
2470
- expect(financials.fundamentals.forwardPE).toBe(forwardPE);
2471
- });