@gloom-sh/terminal 0.20.20 → 0.20.21

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 (365) hide show
  1. package/package.json +3 -1
  2. package/src/api-client/data.ts +1 -1
  3. package/src/api-client/equity-screener.ts +17 -0
  4. package/src/api-client/futures-curve.ts +5 -0
  5. package/src/api-client/market-discovery.ts +8 -0
  6. package/src/api-client/members.ts +2 -0
  7. package/src/api-client/paths.ts +3 -0
  8. package/src/api-client/perps.ts +20 -0
  9. package/src/api-client/request.ts +53 -7
  10. package/src/api-client/types/filings-and-calls.ts +2 -0
  11. package/src/app/pane-runtime/plugin-bindings.ts +6 -4
  12. package/src/app/pro-welcome/model.ts +15 -11
  13. package/src/app/pro-welcome/row.tsx +3 -3
  14. package/src/app/pro-welcome/use-pro-welcome.ts +2 -2
  15. package/src/app/runtime/startup.ts +3 -2
  16. package/src/app.tsx +3 -2
  17. package/src/capabilities/asset-data-inputs.ts +5 -0
  18. package/src/capabilities/factories.ts +8 -3
  19. package/src/capabilities/registry.ts +1 -0
  20. package/src/capabilities/types.ts +1 -0
  21. package/src/cli/commands/market.ts +68 -35
  22. package/src/cli/commands/options-chain.ts +2 -2
  23. package/src/cli/commands/overview.ts +10 -9
  24. package/src/cli/commands/ticker.ts +19 -4
  25. package/src/cli/desktop-pane-shot.ts +11 -3
  26. package/src/cli/export-source.ts +35 -2
  27. package/src/cli/glossary.ts +3 -2
  28. package/src/cli/helpers.ts +2 -1
  29. package/src/cli/history-demergers.ts +41 -10
  30. package/src/cli/history-rows.ts +3 -1
  31. package/src/cli/known-gaps.ts +21 -7
  32. package/src/cli/listing-arg.ts +22 -11
  33. package/src/cli/pane-functions/capabilities.ts +4 -9
  34. package/src/cli/pane-functions/catalog-snapshot.json +29 -29
  35. package/src/cli/pane-functions/catalog.ts +1 -18
  36. package/src/cli/pane-functions/data.ts +8 -4
  37. package/src/cli/pane-functions/financial-ratio-shot.ts +20 -5
  38. package/src/cli/pane-functions/freshness.ts +57 -12
  39. package/src/cli/pane-functions/function-help.ts +2 -2
  40. package/src/cli/pane-functions/headless.ts +6 -0
  41. package/src/cli/pane-functions/index.ts +11 -4
  42. package/src/cli/pane-functions/market-session.ts +25 -0
  43. package/src/cli/pane-functions/report-notices.ts +10 -0
  44. package/src/cli/pane-functions/resolver.ts +75 -3
  45. package/src/cli/pane-functions/screenshot-bridge.ts +1 -0
  46. package/src/cli/pane-functions/screenshot-data-evidence.ts +1 -0
  47. package/src/cli/pane-functions/screenshot-payload.ts +38 -5
  48. package/src/cli/pane-functions/screenshot-render.ts +20 -7
  49. package/src/cli/perpetual-contract.ts +14 -1
  50. package/src/cli/report-tables.ts +11 -2
  51. package/src/cli/result.ts +6 -1
  52. package/src/components/chart-table/layout.ts +8 -4
  53. package/src/components/command-bar/list/model.ts +2 -0
  54. package/src/components/command-bar/pane-templates/items.ts +5 -25
  55. package/src/components/command-bar/panel/index.tsx +7 -4
  56. package/src/components/command-bar/routes/root/provider-search.ts +4 -4
  57. package/src/components/command-bar/routes/root/results.ts +6 -2
  58. package/src/components/command-bar/routes/ticker-search/results.ts +19 -0
  59. package/src/components/command-bar/routes/ticker-search/route.ts +3 -3
  60. package/src/components/command-bar/routes/ticker-search/title.ts +23 -0
  61. package/src/components/command-bar/routing/list-state.ts +17 -5
  62. package/src/components/command-bar/selection-runtime.ts +3 -2
  63. package/src/components/command-bar/surface/index.tsx +2 -0
  64. package/src/components/command-bar/workflow/alert.ts +6 -4
  65. package/src/components/command-bar/workflow/collection-actions.ts +2 -1
  66. package/src/components/layout/pane/footer/index.tsx +1 -0
  67. package/src/components/layout/pane/footer/model.ts +20 -7
  68. package/src/components/layout/pane/title.ts +11 -2
  69. package/src/components/price-selector-dialog.tsx +8 -4
  70. package/src/components/ticker/badge/list.tsx +4 -3
  71. package/src/components/ticker/list-table-view.tsx +12 -1
  72. package/src/components/ui/query-bar.tsx +20 -14
  73. package/src/data/cached-query.ts +20 -4
  74. package/src/data/news-pane-snapshots.ts +2 -1
  75. package/src/data/plugin-cache.ts +5 -1
  76. package/src/data/saved-copies.ts +68 -2
  77. package/src/docs/snapshot.json +65 -14
  78. package/src/docs/topics.ts +11 -9
  79. package/src/i18n/es.ts +1 -0
  80. package/src/i18n/ja.ts +1 -0
  81. package/src/i18n/ko.ts +1 -0
  82. package/src/i18n/zh-cn.ts +1 -0
  83. package/src/i18n/zh-tw.ts +1 -0
  84. package/src/market-data/coordinator/index.ts +25 -5
  85. package/src/market-data/depositary-pair.ts +27 -10
  86. package/src/market-data/futures-roll-returns.ts +54 -7
  87. package/src/market-data/fx-closes.ts +14 -0
  88. package/src/market-data/market/futures-product-hours.ts +113 -0
  89. package/src/market-data/market/futures-week.ts +2 -0
  90. package/src/market-data/market/globex-day.ts +9 -2
  91. package/src/market-data/market/status.ts +32 -25
  92. package/src/market-data/market/venue-session.ts +18 -0
  93. package/src/market-data/options-alternatives.ts +49 -7
  94. package/src/market-data/perpetual-open-interest.ts +41 -0
  95. package/src/market-data/quotes/contributions.ts +4 -2
  96. package/src/market-data/quotes/export-identity.ts +11 -3
  97. package/src/market-data/quotes/freshness.ts +3 -2
  98. package/src/market-data/quotes/resolution.ts +9 -2
  99. package/src/market-data/quotes/tick-range.ts +22 -1
  100. package/src/market-data/quotes/time.ts +34 -4
  101. package/src/market-data/split-terms.ts +3 -2
  102. package/src/news/aggregator.ts +1 -0
  103. package/src/news/news-model.ts +12 -2
  104. package/src/news/types.ts +15 -0
  105. package/src/plugins/builtin/alerts/alert-engine.ts +2 -0
  106. package/src/plugins/builtin/alerts/cli-forms.ts +3 -2
  107. package/src/plugins/builtin/alerts/cli-move.ts +5 -2
  108. package/src/plugins/builtin/alerts/cli.ts +50 -25
  109. package/src/plugins/builtin/alerts/command.ts +51 -3
  110. package/src/plugins/builtin/alerts/event-rows.ts +1 -1
  111. package/src/plugins/builtin/alerts/events-pane.tsx +1 -1
  112. package/src/plugins/builtin/alerts/format.ts +67 -8
  113. package/src/plugins/builtin/alerts/headless.ts +22 -6
  114. package/src/plugins/builtin/alerts/index.tsx +26 -25
  115. package/src/plugins/builtin/alerts/move-checks.ts +1 -0
  116. package/src/plugins/builtin/alerts/pane.tsx +15 -6
  117. package/src/plugins/builtin/alerts/pro-rules.ts +9 -4
  118. package/src/plugins/builtin/alerts/quotes.ts +10 -5
  119. package/src/plugins/builtin/alerts/session.ts +28 -0
  120. package/src/plugins/builtin/alerts/types.ts +1 -0
  121. package/src/plugins/builtin/analytics/pane-model.ts +2 -1
  122. package/src/plugins/builtin/analytics/risk-model.ts +2 -2
  123. package/src/plugins/builtin/attention/headless.ts +2 -2
  124. package/src/plugins/builtin/attention/model.ts +7 -2
  125. package/src/plugins/builtin/attention/pane.tsx +2 -1
  126. package/src/plugins/builtin/awards/headless.ts +1 -1
  127. package/src/plugins/builtin/broker-trading/ticket.tsx +13 -5
  128. package/src/plugins/builtin/buildout/detail/company.tsx +0 -1
  129. package/src/plugins/builtin/buildout/detail/ui.tsx +7 -5
  130. package/src/plugins/builtin/buildout/model/normalizers.ts +0 -1
  131. package/src/plugins/builtin/buildout/model/types.ts +0 -1
  132. package/src/plugins/builtin/buildout/pane/index.tsx +9 -0
  133. package/src/plugins/builtin/buildout/pane/status.tsx +11 -0
  134. package/src/plugins/builtin/catalysts/headless.ts +1 -1
  135. package/src/plugins/builtin/chart-composer/headless.ts +14 -6
  136. package/src/plugins/builtin/chart-composer/pane.tsx +2 -1
  137. package/src/plugins/builtin/chart-composer/session-history.ts +14 -2
  138. package/src/plugins/builtin/chat/controller/index.ts +5 -3
  139. package/src/plugins/builtin/chat/controller/session-runtime.ts +18 -8
  140. package/src/plugins/builtin/chat/index.tsx +1 -1
  141. package/src/plugins/builtin/cloud/auth-actions.tsx +4 -2
  142. package/src/plugins/builtin/cloud/mcp-connect/dialog.tsx +4 -1
  143. package/src/plugins/builtin/cloud/thesis/ticker-tab.tsx +2 -1
  144. package/src/plugins/builtin/company-attention/headless.ts +2 -1
  145. package/src/plugins/builtin/company-kpis/headless.ts +1 -1
  146. package/src/plugins/builtin/correlation/headless.ts +3 -3
  147. package/src/plugins/builtin/correlation/history.ts +1 -0
  148. package/src/plugins/builtin/correlation/index.tsx +7 -5
  149. package/src/plugins/builtin/correlation/matrix/selection.ts +21 -3
  150. package/src/plugins/builtin/correlation/relationship/model.ts +5 -0
  151. package/src/plugins/builtin/correlation/relationship/pane.tsx +3 -2
  152. package/src/plugins/builtin/correlation/relationship/view-model.ts +3 -2
  153. package/src/plugins/builtin/credit-documents/headless.ts +1 -1
  154. package/src/plugins/builtin/dividend-yield/client.ts +81 -10
  155. package/src/plugins/builtin/dividend-yield/headless.ts +21 -10
  156. package/src/plugins/builtin/dividend-yield/model.ts +1 -1
  157. package/src/plugins/builtin/dividend-yield/pane.tsx +9 -5
  158. package/src/plugins/builtin/dividend-yield/ranking.ts +15 -5
  159. package/src/plugins/builtin/dividend-yield/reference-price.ts +3 -0
  160. package/src/plugins/builtin/dividend-yield/types.ts +12 -0
  161. package/src/plugins/builtin/dividend-yield/view.ts +30 -7
  162. package/src/plugins/builtin/doe/headless.ts +1 -1
  163. package/src/plugins/builtin/doe/pane.tsx +16 -7
  164. package/src/plugins/builtin/earnings-calls/data.ts +8 -5
  165. package/src/plugins/builtin/earnings-ripple/headless.ts +1 -1
  166. package/src/plugins/builtin/econ/calendar-model.ts +1 -1
  167. package/src/plugins/builtin/econ/index.tsx +26 -18
  168. package/src/plugins/builtin/equity-screener/client.ts +1 -1
  169. package/src/plugins/builtin/equity-screener/headless.ts +149 -31
  170. package/src/plugins/builtin/equity-screener/live.ts +23 -5
  171. package/src/plugins/builtin/equity-screener/model.ts +27 -12
  172. package/src/plugins/builtin/equity-screener/pane.tsx +5 -5
  173. package/src/plugins/builtin/exposure/headless.ts +1 -1
  174. package/src/plugins/builtin/exposure/holdings.ts +2 -2
  175. package/src/plugins/builtin/futures/index.tsx +29 -1
  176. package/src/plugins/builtin/futures/model.ts +93 -10
  177. package/src/plugins/builtin/futures/returns.ts +54 -1
  178. package/src/plugins/builtin/futures/table.tsx +14 -2
  179. package/src/plugins/builtin/futures/use-front-returns.ts +20 -3
  180. package/src/plugins/builtin/futures-curve/client.ts +1 -1
  181. package/src/plugins/builtin/futures-curve/headless.ts +9 -3
  182. package/src/plugins/builtin/futures-curve/model.ts +19 -5
  183. package/src/plugins/builtin/futures-curve/pane.tsx +12 -6
  184. package/src/plugins/builtin/gpu/headless.ts +1 -1
  185. package/src/plugins/builtin/gpu/model.ts +1 -1
  186. package/src/plugins/builtin/help/function-index.ts +16 -8
  187. package/src/plugins/builtin/help/functions-table.tsx +6 -4
  188. package/src/plugins/builtin/help/shortcut-model.ts +7 -2
  189. package/src/plugins/builtin/holders/headless.ts +16 -5
  190. package/src/plugins/builtin/holders/pane.tsx +43 -5
  191. package/src/plugins/builtin/insider/client.ts +118 -11
  192. package/src/plugins/builtin/insider/filing-stories.ts +36 -20
  193. package/src/plugins/builtin/insider/issuer.ts +5 -2
  194. package/src/plugins/builtin/iv-history/headless.ts +2 -0
  195. package/src/plugins/builtin/macro-day/client.ts +2 -3
  196. package/src/plugins/builtin/macro-day/comparison.ts +58 -0
  197. package/src/plugins/builtin/macro-day/headless.ts +47 -3
  198. package/src/plugins/builtin/macro-day/index.tsx +32 -9
  199. package/src/plugins/builtin/macro-day/model.ts +1 -1
  200. package/src/plugins/builtin/macro-day/pane.tsx +99 -12
  201. package/src/plugins/builtin/market-heatmap/index.tsx +2 -2
  202. package/src/plugins/builtin/market-movers/footer.ts +29 -3
  203. package/src/plugins/builtin/market-movers/headless.ts +12 -5
  204. package/src/plugins/builtin/market-movers/index.tsx +3 -3
  205. package/src/plugins/builtin/market-movers/session-body.tsx +6 -3
  206. package/src/plugins/builtin/market-valuation/detail.tsx +3 -3
  207. package/src/plugins/builtin/market-valuation/headless.ts +6 -6
  208. package/src/plugins/builtin/market-valuation/pane.tsx +2 -3
  209. package/src/plugins/builtin/market-valuation/view.ts +6 -8
  210. package/src/plugins/builtin/members/client.ts +9 -2
  211. package/src/plugins/builtin/members/headless.ts +8 -10
  212. package/src/plugins/builtin/members/model.ts +29 -17
  213. package/src/plugins/builtin/members/pane.tsx +10 -12
  214. package/src/plugins/builtin/money-markets/headless.ts +1 -1
  215. package/src/plugins/builtin/news/headless.ts +4 -0
  216. package/src/plugins/builtin/news/index.tsx +3 -1
  217. package/src/plugins/builtin/news/wire/industry-pane.tsx +2 -1
  218. package/src/plugins/builtin/news/wire/news/preset-pane.tsx +1 -1
  219. package/src/plugins/builtin/news/wire/persisted-articles.ts +8 -4
  220. package/src/plugins/builtin/notes/headless.ts +7 -0
  221. package/src/plugins/builtin/notes/index.tsx +1 -1
  222. package/src/plugins/builtin/notes/quick-notes-pane.tsx +18 -2
  223. package/src/plugins/builtin/options/view.tsx +7 -6
  224. package/src/plugins/builtin/options-positioning/headless.ts +4 -4
  225. package/src/plugins/builtin/options-positioning/pane.tsx +7 -3
  226. package/src/plugins/builtin/options-scenario/client.ts +20 -4
  227. package/src/plugins/builtin/options-scenario/headless.ts +1 -1
  228. package/src/plugins/builtin/pe-band/client.ts +5 -9
  229. package/src/plugins/builtin/pe-band/headless.ts +11 -13
  230. package/src/plugins/builtin/pe-band/model.ts +39 -60
  231. package/src/plugins/builtin/pe-band/pane.tsx +14 -15
  232. package/src/plugins/builtin/perps/equity-row.tsx +3 -1
  233. package/src/plugins/builtin/perps/freshness.ts +16 -9
  234. package/src/plugins/builtin/perps/headless.ts +4 -1
  235. package/src/plugins/builtin/perps/markets-section.tsx +16 -10
  236. package/src/plugins/builtin/perps/model.ts +33 -2
  237. package/src/plugins/builtin/perps/pane.tsx +3 -2
  238. package/src/plugins/builtin/perps/status-line.ts +12 -3
  239. package/src/plugins/builtin/perps/venue-markets.ts +38 -0
  240. package/src/plugins/builtin/plugin-marketplace/pane.tsx +4 -3
  241. package/src/plugins/builtin/portfolio-list/cell-version.ts +1 -1
  242. package/src/plugins/builtin/portfolio-list/cli/render.ts +46 -7
  243. package/src/plugins/builtin/portfolio-list/headless.ts +31 -8
  244. package/src/plugins/builtin/portfolio-list/settings.ts +3 -0
  245. package/src/plugins/builtin/portfolio-list/table.tsx +7 -1
  246. package/src/plugins/builtin/power/headless.ts +1 -1
  247. package/src/plugins/builtin/realized-vol/headless.ts +1 -1
  248. package/src/plugins/builtin/research/corporate-actions-pane.tsx +27 -13
  249. package/src/plugins/builtin/scanner/feed.ts +7 -4
  250. package/src/plugins/builtin/scanner/flow-pane.tsx +8 -4
  251. package/src/plugins/builtin/scanner/headless.ts +57 -26
  252. package/src/plugins/builtin/scanner/hilo-pane.tsx +6 -3
  253. package/src/plugins/builtin/scanner/lock-note.ts +3 -2
  254. package/src/plugins/builtin/scanner/us-session.ts +9 -0
  255. package/src/plugins/builtin/seasonality/client.ts +46 -10
  256. package/src/plugins/builtin/seasonality/headless.ts +29 -11
  257. package/src/plugins/builtin/seasonality/model.ts +101 -24
  258. package/src/plugins/builtin/seasonality/pane.tsx +10 -6
  259. package/src/plugins/builtin/sec/filing-content.ts +13 -0
  260. package/src/plugins/builtin/sec/index.tsx +16 -11
  261. package/src/plugins/builtin/sectors/client.ts +27 -5
  262. package/src/plugins/builtin/sectors/headless.ts +2 -1
  263. package/src/plugins/builtin/sectors/index.tsx +22 -10
  264. package/src/plugins/builtin/shared/cloud-resource.ts +3 -3
  265. package/src/plugins/builtin/shared/extended-print.ts +38 -0
  266. package/src/plugins/builtin/shared/pro-feature-wall.tsx +1 -1
  267. package/src/plugins/builtin/shared/report-freshness.ts +7 -3
  268. package/src/plugins/builtin/shared/scanner-capture.ts +16 -3
  269. package/src/plugins/builtin/shared/ticker-company.ts +17 -8
  270. package/src/plugins/builtin/shared/use-quote-board.ts +11 -4
  271. package/src/plugins/builtin/social-mentions/client.ts +7 -3
  272. package/src/plugins/builtin/social-mentions/outliers.tsx +9 -2
  273. package/src/plugins/builtin/thirteenf/api.ts +24 -3
  274. package/src/plugins/builtin/thirteenf/data.ts +21 -8
  275. package/src/plugins/builtin/thirteenf/headless.ts +7 -3
  276. package/src/plugins/builtin/thirteenf/signals-pane.tsx +10 -3
  277. package/src/plugins/builtin/thirteenf/signals.ts +22 -1
  278. package/src/plugins/builtin/ticker-detail/adr-pair/model.ts +4 -2
  279. package/src/plugins/builtin/ticker-detail/financials/model.ts +7 -0
  280. package/src/plugins/builtin/ticker-detail/financials/ratio-table.tsx +15 -6
  281. package/src/plugins/builtin/ticker-detail/financials/ratios.ts +5 -4
  282. package/src/plugins/builtin/ticker-detail/financials/tab.tsx +14 -5
  283. package/src/plugins/builtin/ticker-detail/headless.ts +32 -26
  284. package/src/plugins/builtin/ticker-detail/index.tsx +1 -1
  285. package/src/plugins/builtin/ticker-detail/overview/components.tsx +8 -3
  286. package/src/plugins/builtin/ticker-detail/overview/model.ts +28 -5
  287. package/src/plugins/builtin/ticker-detail/overview/pane.tsx +14 -1
  288. package/src/plugins/builtin/ticker-detail/overview-tab.tsx +9 -8
  289. package/src/plugins/builtin/ticker-detail/pane.tsx +16 -9
  290. package/src/plugins/builtin/ticker-detail/quote-monitor/card.tsx +41 -23
  291. package/src/plugins/builtin/ticker-detail/quote-monitor/rows.ts +30 -13
  292. package/src/plugins/builtin/ticker-detail/settings.ts +9 -2
  293. package/src/plugins/builtin/time-sales/headless.ts +49 -13
  294. package/src/plugins/builtin/time-sales/model.ts +2 -2
  295. package/src/plugins/builtin/time-sales/window.ts +84 -10
  296. package/src/plugins/builtin/vol-surface/charts.tsx +4 -2
  297. package/src/plugins/builtin/vol-surface/events.ts +12 -5
  298. package/src/plugins/builtin/vol-surface/headless.ts +1 -1
  299. package/src/plugins/builtin/vol-surface/pane.tsx +15 -7
  300. package/src/plugins/builtin/world-indices/footer.ts +1 -1
  301. package/src/plugins/builtin/world-venue-map/chokepoint-report.ts +3 -1
  302. package/src/plugins/builtin/world-venue-map/headless.ts +27 -13
  303. package/src/plugins/builtin/yield-curve/client.ts +3 -1
  304. package/src/plugins/duplicates.ts +60 -0
  305. package/src/plugins/loader.ts +12 -3
  306. package/src/plugins/marketplace/model.ts +10 -1
  307. package/src/portfolio/column-values.ts +52 -5
  308. package/src/react/async-resource.ts +8 -7
  309. package/src/renderers/browser/bundled-plugins.ts +2 -1
  310. package/src/renderers/dom/build-assets.ts +20 -0
  311. package/src/renderers/dom/data-table/index.tsx +36 -2
  312. package/src/renderers/dom/es2023-array-methods.ts +57 -0
  313. package/src/renderers/dom/host/surface-fit.ts +64 -13
  314. package/src/renderers/dom/styles.css +6 -1
  315. package/src/renderers/electrobun/bun/external-plugins.ts +16 -6
  316. package/src/renderers/electrobun/shared/protocol.ts +2 -0
  317. package/src/renderers/electrobun/view/cli-pane-shot-entry.tsx +31 -7
  318. package/src/renderers/electrobun/view/cli-pane-shot-frame.tsx +15 -8
  319. package/src/renderers/electrobun/view/external-plugins.ts +1 -0
  320. package/src/renderers/electrobun/view/remote/asset-data-client.ts +1 -0
  321. package/src/series/types.ts +1 -0
  322. package/src/sources/gloomberb-cloud/fred-attribution.ts +6 -5
  323. package/src/sources/gloomberb-cloud/index.ts +42 -5
  324. package/src/sources/gloomberb-cloud/news.ts +15 -2
  325. package/src/sources/gloomberb-cloud/normalizers.ts +9 -0
  326. package/src/sources/history-result.ts +2 -1
  327. package/src/sources/history-retention.ts +14 -2
  328. package/src/sources/listing-symbols.ts +1 -1
  329. package/src/sources/provider-router/cache.ts +32 -3
  330. package/src/sources/provider-router/cached-routes.ts +25 -0
  331. package/src/sources/provider-router/connection-health.ts +1 -0
  332. package/src/sources/provider-router/history.ts +2 -2
  333. package/src/sources/provider-router/index.ts +14 -0
  334. package/src/sources/provider-router/sec-filings-page.ts +25 -0
  335. package/src/sources/sec-edgar/content.ts +67 -36
  336. package/src/tickers/listing-fate.ts +28 -0
  337. package/src/tickers/search/home-listing.ts +3 -0
  338. package/src/tickers/search/index-root-lead.ts +40 -0
  339. package/src/tickers/terminal-codes.ts +7 -4
  340. package/src/time-series/base-series.ts +17 -8
  341. package/src/time-series/fundamentals/historical-valuation.ts +2 -2
  342. package/src/time-series/fundamentals/series.ts +15 -12
  343. package/src/time-series/history-acquisition.ts +2 -0
  344. package/src/time-series/market.ts +3 -1
  345. package/src/time-series/price-comparison.ts +3 -1
  346. package/src/time-series/resolve-context.ts +8 -0
  347. package/src/time-series/resolve.ts +50 -10
  348. package/src/time-series/types.ts +1 -0
  349. package/src/time-series/use-chart-resolution.ts +2 -2
  350. package/src/time-series/valuation-currency.ts +40 -12
  351. package/src/types/data-provider.ts +30 -1
  352. package/src/types/financials.ts +23 -0
  353. package/src/types/headless.ts +23 -0
  354. package/src/types/instrument.ts +1 -0
  355. package/src/utils/crypto-pair.ts +16 -0
  356. package/src/utils/exchange-announcements.ts +2 -1
  357. package/src/utils/exchange-notation.generated.ts +58 -1
  358. package/src/utils/exchanges.ts +43 -1
  359. package/src/utils/format.ts +37 -2
  360. package/src/utils/function-search.ts +38 -0
  361. package/src/utils/fuzzy-search.ts +10 -6
  362. package/src/utils/option-choice.ts +15 -0
  363. package/src/utils/price-history.ts +15 -1
  364. package/src/utils/reason-codes.ts +6 -3
  365. package/src/utils/trailing-dividend.ts +241 -28
@@ -611,6 +611,7 @@ export interface QuoteBoardStatus {
611
611
  loading: number;
612
612
  /** Symbols showing their last good quote after a failed load. */
613
613
  stale: number;
614
+ staleSymbol: string | null;
614
615
  /** Symbols with no quote to show at all. */
615
616
  unavailable: number;
616
617
  latestTs: number;
@@ -621,15 +622,19 @@ export interface QuoteBoardStatus {
621
622
  export function quoteBoardStatus(quotes: BoardQuoteMap): QuoteBoardStatus {
622
623
  let loading = 0;
623
624
  let stale = 0;
625
+ let staleSymbol: string | null = null;
624
626
  let unavailable = 0;
625
627
  let latestTs = 0;
626
- for (const state of quotes.values()) {
628
+ for (const [symbol, state] of quotes) {
627
629
  if (state.loading) loading += 1;
628
- if (state.stale) stale += 1;
630
+ if (state.stale) {
631
+ stale += 1;
632
+ staleSymbol = stale === 1 ? state.quote?.symbol ?? symbol : null;
633
+ }
629
634
  else if (!state.quote && !state.loading) unavailable += 1;
630
635
  latestTs = Math.max(latestTs, state.quote?.lastUpdated ?? 0);
631
636
  }
632
- return { loading, stale, unavailable, latestTs, savedAt: oldestSavedCopyAt(Array.from(quotes.values(), (state) => state.quote)) };
637
+ return { loading, stale, staleSymbol, unavailable, latestTs, savedAt: oldestSavedCopyAt(Array.from(quotes.values(), (state) => state.quote)) };
633
638
  }
634
639
 
635
640
  /** The quotes a board shows, for the footer's delayed clock (`useQuoteDelayFooter`). */
@@ -642,7 +647,7 @@ export function quoteBoardFooterInfo(status: QuoteBoardStatus): PaneFooterSegmen
642
647
  const info: PaneFooterSegment[] = [];
643
648
  if (status.loading > 0) info.push({ id: "loading", parts: [{ text: "loading", tone: "muted" }] });
644
649
  if (status.stale > 0) {
645
- info.push({ id: "stale", parts: [{ text: `${status.stale} stale`, tone: "warning" }] });
650
+ info.push({ id: "stale", parts: [{ text: `${status.staleSymbol ?? status.stale} stale`, tone: "warning" }] });
646
651
  }
647
652
  if (status.unavailable > 0) {
648
653
  info.push({ id: "error", parts: [{ text: `${status.unavailable} unavailable`, tone: "warning" }] });
@@ -749,6 +754,7 @@ const boardHeadlines = new WeakMap<Quote, Quote>();
749
754
  * price's (quoteHeadlineTime), as `quote` dates it.
750
755
  */
751
756
  export function boardHeadlineQuote(quote: Quote): Quote {
757
+ if (quote.futuresPriceKind) return quote;
752
758
  const cached = boardHeadlines.get(quote);
753
759
  if (cached) return cached;
754
760
  const display = getRegularSessionDisplay(quote);
@@ -781,6 +787,7 @@ export function renderQuoteBoardCell(
781
787
 
782
788
  switch (kind) {
783
789
  case "status": {
790
+ if (state?.stale && !format.sessionText) return { text: "!", value: "stale", color: colors.warning };
784
791
  if (format.sessionText) {
785
792
  return { text: quoteSessionLabel(quote, format.now) ?? MISSING_VALUE, color: quoteSessionColor(quote, colors, format.now) };
786
793
  }
@@ -3,6 +3,7 @@ import { apiClient } from "../../../api-client";
3
3
  import { isAccessDenied } from "../../../api-client/errors";
4
4
  import type { SocialMentionDayPosts, SocialMentionPost, SocialMentionsPayload, SocialMentionsRange } from "../../../api-client/social-mentions";
5
5
  import { createPluginCache, savedCopyForTransientFailure } from "../../../data/plugin-cache";
6
+ import { markSavedCopy, stampRetrievedAt, withSavedCopyMarkOf } from "../../../data/saved-copies";
6
7
  import { CLOUD_SESSION_REQUIRED } from "../shared/research-cloud-session";
7
8
  import { unavailableOnServer } from "../shared/cloud-resource";
8
9
  import { logFailure } from "../../../utils/log-failure";
@@ -71,14 +72,17 @@ const cacheKey = (symbol: string, range: SocialMentionsRange) => `${range}:${sym
71
72
  export function cachedSocialMentions(symbol: string, range: SocialMentionsRange): SocialMentionsResource | null {
72
73
  const cached = socialMentionsCache.get(cacheKey(symbol, range), { allowExpired: true });
73
74
  if (!cached) return null;
74
- try { return { payload: validateSocialMentions(cached.data, symbol, range), stale: false, refreshError: null }; }
75
+ try {
76
+ const answer = { payload: validateSocialMentions(cached.data, symbol, range), stale: false, refreshError: null };
77
+ return cached.fromEarlierRun || cached.stale ? markSavedCopy(answer, cached.fetchedAt) : stampRetrievedAt(answer, cached.fetchedAt);
78
+ }
75
79
  catch (error) { return logFailure("social-mentions.client", "Validate cached social mentions failed", null)(error); }
76
80
  }
77
81
  export async function loadSocialMentions(symbol: string, range: SocialMentionsRange, force = false): Promise<SocialMentionsResource> {
78
82
  // A refusal (a signed-out session, any other 4xx but 408 and 429) or a reply that fails validation shows as itself.
79
83
  const result = savedCopyForTransientFailure(await socialMentionsCache.load(cacheKey(symbol, range), () => fetchSocialMentions(symbol, range), { force }));
80
- return { payload: validateSocialMentions(result.data, symbol, range), stale: result.stale, refreshError: result.refreshError ?? null,
81
- ...(result.source === "stale-fallback" ? { savedAt: result.fetchedAt } : {}) };
84
+ return withSavedCopyMarkOf(stampRetrievedAt({ payload: validateSocialMentions(result.data, symbol, range), stale: result.stale,
85
+ refreshError: result.refreshError ?? null, ...(result.source === "stale-fallback" ? { savedAt: result.fetchedAt } : {}) }, result.fetchedAt), result);
82
86
  }
83
87
 
84
88
  /**
@@ -11,6 +11,7 @@ import {
11
11
  } from "../../../components";
12
12
  import { usePaneRefreshKey } from "../../../components/data-table/table-pane";
13
13
  import { ageFooterSegment } from "../../../components/layout/pane/footer";
14
+ import { retrievedAtOf, stampRetrievedAt, withSavedCopyMarkOf } from "../../../data/saved-copies";
14
15
  import { useUtcDay } from "../../../react/auto-refresh";
15
16
  import { reportFooterSegment } from "../shared/source-footer";
16
17
  import { socialMentionsHeadless } from "./headless";
@@ -58,6 +59,12 @@ interface SocialOutliersAnswer {
58
59
  resource: CloudResource<SocialOutliersPayload>;
59
60
  }
60
61
 
62
+ function outliersAnswer(query: SocialOutliersQuery, resource: CloudResource<SocialOutliersPayload>): SocialOutliersAnswer {
63
+ const fetchedAt = retrievedAtOf(resource);
64
+ const answer = { query, resource };
65
+ return fetchedAt != null ? stampRetrievedAt(answer, fetchedAt) : withSavedCopyMarkOf(answer, resource);
66
+ }
67
+
61
68
  /** A multiple this high reads in the warning tone, as it does in the ticker's own days. */
62
69
  const LOUD_RATIO = 2.5;
63
70
 
@@ -96,13 +103,13 @@ export function SocialOutliersView({ width, height, focused, renderTicker }: {
96
103
  // Each ticker is named as search names it, in one batched request with the ranking.
97
104
  const marketData = useMarketData();
98
105
  const loader = useCallback(
99
- async (force: boolean): Promise<SocialOutliersAnswer> => ({ query, resource: await loadSocialOutliers(query, { force, names: marketData }) }),
106
+ async (force: boolean) => outliersAnswer(query, await loadSocialOutliers(query, { force, names: marketData })),
100
107
  [marketData, query, session.displayScope],
101
108
  );
102
109
  const resource = useAsyncResource(loader, {
103
110
  initialData: () => {
104
111
  const cached = cachedSocialOutliers(query);
105
- return cached ? { query, resource: cached } : null;
112
+ return cached ? outliersAnswer(query, cached) : null;
106
113
  },
107
114
  clearOnError: (error) => error instanceof Error && isCloudSessionRequired(error.message),
108
115
  // Another window or filter keeps the rows on screen, loading, until its own arrive.
@@ -54,6 +54,8 @@ interface Forms13FRequestOptions extends Forms13FReadOptions {
54
54
  signal?: AbortSignal;
55
55
  /** Gloom Cloud only: a path the public 13F source does not serve. */
56
56
  cloudOnly?: boolean;
57
+ /** When the service's stored copy of the part a reader is shown was read (ms); the oldest of every row by default. */
58
+ shownCopyTime?: (value: unknown) => number | null;
57
59
  }
58
60
 
59
61
  let forms13FPersistence: PluginPersistence | null = null;
@@ -173,6 +175,23 @@ function storedCopyTime(value: unknown): number | null {
173
175
  return Number.isFinite(oldest) ? oldest : null;
174
176
  }
175
177
 
178
+ /**
179
+ * When a filings list's stored copy was read, by the filings of the quarter a
180
+ * reader is shown (`period`, else the newest the list holds): a fund's row
181
+ * shows that quarter's report alone, so a filing of an older quarter read on
182
+ * an earlier day does not date it (Spark's 30 Sep 13F read on 21 Nov beside
183
+ * its older ones read on 7 Nov).
184
+ */
185
+ function quarterCopyTime(period: string | undefined) {
186
+ return (value: unknown): number | null => {
187
+ const rows = Array.isArray(value) ? value : [value];
188
+ const periodOf = (row: unknown) => stringOrEmpty(asRecord(row).period_of_report);
189
+ const quarter = period ?? rows.map(periodOf).reduce((newest, each) => (each > newest ? each : newest), "");
190
+ const shown = rows.filter((row) => periodOf(row) === quarter);
191
+ return storedCopyTime(shown.length > 0 ? shown : rows);
192
+ };
193
+ }
194
+
176
195
  async function fetchForms13F<T>(
177
196
  path: string,
178
197
  params: Record<string, string | number | undefined>,
@@ -240,7 +259,7 @@ async function fetchForms13F<T>(
240
259
  const storedAt = storedCopyTime(value);
241
260
  if (storedAt != null) {
242
261
  if (current()) failedRefreshes.add(key);
243
- options.onSavedCopy?.(storedAt);
262
+ options.onSavedCopy?.(options.shownCopyTime?.(value) ?? storedAt);
244
263
  return value;
245
264
  }
246
265
  if (current()) {
@@ -410,15 +429,17 @@ export async function listThirteenFForms(
410
429
  to: string,
411
430
  limit = 12,
412
431
  signal?: AbortSignal,
413
- options: Forms13FReadOptions & { offset?: number } = {},
432
+ /** `shownPeriod`: the list stands for one quarter's report (that one, or "newest"), whose filings date its saved copy. */
433
+ options: Forms13FReadOptions & { offset?: number; shownPeriod?: string } = {},
414
434
  ): Promise<ThirteenFFormSummary[]> {
435
+ const { shownPeriod, ...read } = options;
415
436
  const raw = await fetchForms13F<unknown>("/forms", {
416
437
  cik: normalizeCik(cik),
417
438
  from,
418
439
  to,
419
440
  limit,
420
441
  offset: options.offset ?? 0,
421
- }, { ...options, signal });
442
+ }, { ...read, signal, ...(shownPeriod ? { shownCopyTime: quarterCopyTime(shownPeriod === "newest" ? undefined : shownPeriod) } : {}) });
422
443
  return arrayResponse(raw).map(mapForm).filter((form): form is ThirteenFFormSummary => !!form);
423
444
  }
424
445
 
@@ -60,9 +60,11 @@ async function loadReportsForFunds(
60
60
  while (!options.signal?.aborted && index < funds.length) {
61
61
  const fund = funds[index++]!;
62
62
  try {
63
- const forms = await listThirteenFForms(fund.cik, options.from, options.to, 100, options.signal, options);
64
- const periods = buildPeriodReports(forms);
65
63
  const selectedPeriod = options.periods?.get(fund.cik);
64
+ // The row shows one quarter's report: its filings date the row's saved copy.
65
+ const forms = await listThirteenFForms(fund.cik, options.from, options.to, 100, options.signal,
66
+ { ...options, shownPeriod: selectedPeriod ?? "newest" });
67
+ const periods = buildPeriodReports(forms);
66
68
  const report = selectedPeriod ? periods.find((item) => item.periodOfReport === selectedPeriod) : periods[0];
67
69
  if (report) reports.set(fund.cik, report);
68
70
  } catch {
@@ -260,7 +262,7 @@ async function loadBrowserPage(
260
262
  if (!trimmed) return { rows: [], quarter };
261
263
  if (/^\d{6,10}$/.test(trimmed)) {
262
264
  const cik = normalizeCik(trimmed);
263
- const forms = await listThirteenFForms(cik, from, to, 100, signal, apiOptions);
265
+ const forms = await listThirteenFForms(cik, from, to, 100, signal, { ...apiOptions, shownPeriod: "newest" });
264
266
  const report = buildPeriodReports(forms)[0];
265
267
  const form = report?.filings.at(-1);
266
268
  const fund = { cik, name: form?.companyName || cik };
@@ -273,16 +275,24 @@ async function loadBrowserPage(
273
275
  nextOffset: offset + 1,
274
276
  };
275
277
  }
276
- const found = await searchThirteenFFunds(trimmed, browserLimit, signal, pageApiOptions);
278
+ // The rows show each fund's report, whose filings date the page: the names found, and the ranking, date it only
279
+ // when no report answers, or when a ranked fund is shown (ARK's 30 Sep report read on 13 Nov, not the name
280
+ // search read on 7 Nov).
281
+ const listed: { savedAt?: number } = {};
282
+ const noteListed = (savedAt: number) => { listed.savedAt = Math.min(listed.savedAt ?? savedAt, savedAt); };
283
+ const found = await searchThirteenFFunds(trimmed, browserLimit, signal, { ...pageApiOptions, onSavedCopy: noteListed });
277
284
  const funds = oneFundPerCik(found);
278
- const topFunds = await listTopThirteenFFunds(quarter, browserLimit, signal, apiOptions).catch((error: unknown): ThirteenFTopFund[] => {
279
- if (!signal?.aborted) logFailure("thirteenf.data", "Load performance ranks for fund search failed")(error);
280
- return [];
281
- });
285
+ let rankedAt: number | undefined;
286
+ const topFunds = await listTopThirteenFFunds(quarter, browserLimit, signal, { ...apiOptions, onSavedCopy: (savedAt) => { rankedAt = savedAt; } })
287
+ .catch((error: unknown): ThirteenFTopFund[] => {
288
+ if (!signal?.aborted) logFailure("thirteenf.data", "Load performance ranks for fund search failed")(error);
289
+ return [];
290
+ });
282
291
  const topByCik = new Map(topFunds.map((fund) => [fund.cik, fund]));
283
292
  const matchedTopFunds = funds
284
293
  .map((fund) => topByCik.get(fund.cik))
285
294
  .filter((fund): fund is ThirteenFTopFund => !!fund);
295
+ if (rankedAt != null && matchedTopFunds.length > 0) options.onSavedCopy?.(rankedAt);
286
296
  const rows = buildBrowserRows({ funds: oneFundPerCik(found), topFunds: matchedTopFunds, source: "funds" });
287
297
  const result: BrowserLoadResult = {
288
298
  rows,
@@ -292,6 +302,9 @@ async function loadBrowserPage(
292
302
  };
293
303
  fillReports(result, rows, loadReportsForFunds(funds.slice(0, Math.min(browserLimit, FORM_ENRICHMENT_LIMIT)), {
294
304
  from, to, signal, ...apiOptions,
305
+ }).then((loaded) => {
306
+ if (loaded.reports.size === 0 && listed.savedAt != null) options.onSavedCopy?.(listed.savedAt);
307
+ return loaded;
295
308
  }), (reports) => buildBrowserRows({
296
309
  funds: oneFundPerCik(found, reports),
297
310
  topFunds: matchedTopFunds,
@@ -15,7 +15,7 @@ import { buildFundOverlap, buildManagerEtfOverlap, overlapPeriod } from "./overl
15
15
  import type { FundMembersPayload, MemberFundsPayload } from "../../../api-client/members";
16
16
  import { fetchFunds, fetchMembers } from "../members/client";
17
17
  import { coveredFund } from "../members/model";
18
- import { appendTickerHoldings, loadCrowding, loadTickerHoldings, quarterFallbackText, type CrowdingRow, type TickerHoldings } from "./signals";
18
+ import { appendTickerHoldings, holdersTicker, loadCrowding, loadTickerHoldings, quarterFallbackText, type CrowdingRow, type TickerHoldings } from "./signals";
19
19
  import {
20
20
  AS_FILED_VALUE,
21
21
  compareCrowding,
@@ -710,10 +710,11 @@ export function createThirteenFHeadless(
710
710
  freshness: { asOf: metadata.period }, errors: metadata.warnings };
711
711
  }
712
712
  let holdings: TickerHoldings | null = null;
713
+ // "SQ became XYZ on 2025-01-21; showing XYZ.": the holders of a ticker whose company moved are its new symbol's.
714
+ let renamedNote: string | null = null;
713
715
  let shadowed: Promise<ThirteenFFund[]> = Promise.resolve([]);
714
716
  if (view === "ticker-holdings") {
715
717
  if (!query) throw new Error("13F ticker holdings requires a ticker.");
716
- const ticker = query.replace(/^\$/, "").toUpperCase();
717
718
  // A lowercase word read as a ticker may name a fund too ("ares"); asked alongside, so it costs no wait.
718
719
  if (requestedView === "auto" && !query.startsWith("$") && query !== query.toUpperCase()) {
719
720
  // The name search matches anywhere ("man" in every Management); the word and a space keeps it to whole words.
@@ -725,6 +726,9 @@ export function createThirteenFHeadless(
725
726
  // Intentional ignore: only cancellation reaches this guard; the awaited promise still rejects.
726
727
  });
727
728
  }
729
+ const read = await holdersTicker(query.replace(/^\$/, "").toUpperCase(), ctx.marketData);
730
+ const ticker = read.ticker;
731
+ renamedNote = read.note ?? null;
728
732
  try {
729
733
  holdings = await loadTickerHoldings(ticker, Number(args.options.offset ?? 0), ctx.signal);
730
734
  // The endpoint pages 25 funds at a time.
@@ -762,7 +766,7 @@ export function createThirteenFHeadless(
762
766
  totalValue: summary.shownValue,
763
767
  valueScope: "shown funds",
764
768
  valueBasis: "as reported at period end",
765
- notices: [...flagNotices, ...summary.notices, ...fallbackNotices(metadata), ...(alsoFunds.length ? [shadowedFundsText(query, alsoFunds)] : [])],
769
+ notices: [...renamedNote ? [renamedNote] : [], ...flagNotices, ...summary.notices, ...fallbackNotices(metadata), ...(alsoFunds.length ? [shadowedFundsText(query, alsoFunds)] : [])],
766
770
  },
767
771
  freshness: { asOf: metadata.period },
768
772
  errors: metadata.warnings,
@@ -6,14 +6,14 @@ import { colors } from "../../../theme/colors";
6
6
  import type { PaneProps } from "../../../types/plugin";
7
7
  import { Box, type ScrollBoxRenderable } from "../../../ui";
8
8
  import { isPlainKey } from "../../../utils/keyboard";
9
- import { usePluginPaneState, usePluginTickerActions } from "../../runtime";
9
+ import { useAssetData, usePluginPaneState, usePluginTickerActions } from "../../runtime";
10
10
  import { useMineTickers } from "../shared/mine-tickers";
11
11
  import { usePaneStatusFooter } from "../../../components/layout/pane/status-footer";
12
12
  import { usePaneRefreshKey } from "../../../components/data-table/table-pane";
13
13
  import { useAsyncResource } from "../../../react/async-resource";
14
14
  import { actionLabel, formatMoneyCompact, formatShares, formatWeightMaybe } from "./format";
15
15
  import { FundDetailView } from "./pane";
16
- import { appendTickerHoldings, loadCrowding, loadTickerHoldings, quarterFallbackFooter, type Crowding, type CrowdingRow, type TickerHolderRow } from "./signals";
16
+ import { appendTickerHoldings, holdersTicker, loadCrowding, loadTickerHoldings, quarterFallbackFooter, type Crowding, type CrowdingRow, type TickerHolderRow } from "./signals";
17
17
  import { usePaneTickerIdentity } from "../../../state/hooks/pane-ticker";
18
18
 
19
19
  export function ThirteenFTickerPane({ focused, width, height }: Pick<PaneProps, "focused" | "width" | "height">) {
@@ -46,7 +46,14 @@ export function ThirteenFTickerHoldingsView({ symbol, focused, width, height, qu
46
46
  return () => onDetailChange?.(false);
47
47
  }, [fund, onDetailChange]);
48
48
  const scrollRef = useRef<ScrollBoxRenderable | null>(null);
49
- const loadPage = useCallback(({ offset, signal }: PageRequest) => loadTickerHoldings(symbol, offset, signal), [symbol]);
49
+ // A ticker whose company moved (SQ) is read under its new symbol (XYZ) before any holders request, and says so.
50
+ const marketData = useAssetData();
51
+ const read = useMemo(() => holdersTicker(symbol, marketData), [symbol, marketData]);
52
+ const loadPage = useCallback(async ({ offset, signal }: PageRequest) => {
53
+ const { ticker, note } = await read;
54
+ const page = await loadTickerHoldings(ticker, offset, signal);
55
+ return note ? { ...page, warnings: [note, ...page.warnings] } : page;
56
+ }, [read]);
50
57
  const paged = usePagedRows(symbol ? loadPage : null);
51
58
  // Later pages merge into the first the same way the headless command merges them.
52
59
  const data = useMemo(() => (paged.pages.length > 0 ? paged.pages.reduce(appendTickerHoldings) : null), [paged.pages]);
@@ -2,6 +2,9 @@ import { apiClient } from "../../../api-client";
2
2
  import type { PaneFooterSegment } from "../../../components";
3
3
  import { formatShortDate } from "../../../utils/datetime-format";
4
4
  import type { HoldingAction } from "./types";
5
+ import { thirteenFDueDate } from "./model";
6
+ import { movedListing, movedListingNote } from "../../../tickers/listing-fate";
7
+ import { logFailure } from "../../../utils/log-failure";
5
8
 
6
9
  export interface TickerHolderRow {
7
10
  id: string;
@@ -42,11 +45,18 @@ interface SignalsBase {
42
45
  asOf: string;
43
46
  }
44
47
 
48
+ /**
49
+ * "30 Sep holders not indexed yet (13Fs due 16 Nov); showing 30 Jun": why a
50
+ * ticker's holders, or the crowding ranks, are of the quarter before the
51
+ * newest one due. The filings are in: each fund's own 13F shows the newer
52
+ * quarter (`fn 13F ARK`). What is missing is the index of holders by
53
+ * security, which loads a quarter weeks after its deadline.
54
+ */
45
55
  export function quarterFallbackText(data: Pick<SignalsBase, "period" | "fallbackFromPeriod"> | null | undefined): string | null {
46
56
  if (!data?.fallbackFromPeriod || data.fallbackFromPeriod <= data.period) return null;
47
57
  const year = data.fallbackFromPeriod.slice(0, 4) !== data.period.slice(0, 4) ? "numeric" : false;
48
58
  const date = (period: string) => formatShortDate(period, { utc: true, year });
49
- return `${date(data.fallbackFromPeriod)} quarter not complete yet; showing ${date(data.period)}`;
59
+ return `${date(data.fallbackFromPeriod)} holders not indexed yet (13Fs due ${date(thirteenFDueDate(data.fallbackFromPeriod))}); showing ${date(data.period)}`;
50
60
  }
51
61
 
52
62
  export function quarterFallbackFooter(data: Parameters<typeof quarterFallbackText>[0]): PaneFooterSegment[] {
@@ -76,6 +86,17 @@ export async function loadTickerHoldings(ticker: string, offset = 0, signal?: Ab
76
86
  signal?.throwIfAborted();
77
87
  return result;
78
88
  }
89
+ /**
90
+ * What a ticker's 13F holders are read under: the symbol its company trades
91
+ * as now when it moved (SQ became XYZ), with the note that says so, asked
92
+ * before any holders request. The holders source maps a symbol to its
93
+ * security, and an old one maps to nothing: it gave up after 20 s.
94
+ */
95
+ export async function holdersTicker(ticker: string, marketData: Parameters<typeof movedListing>[1] | null | undefined): Promise<{ ticker: string; note?: string }> {
96
+ const change = marketData ? await movedListing({ symbol: ticker }, marketData)
97
+ .catch(logFailure("thirteenf-signals", "Read whether a 13F ticker moved failed", null)) : null;
98
+ return change ? { ticker: change.tradesAs, note: movedListingNote(change) } : { ticker };
99
+ }
79
100
  export async function loadCrowding(signal?: AbortSignal): Promise<Crowding> {
80
101
  signal?.throwIfAborted();
81
102
  const result = await apiClient.getCloudSec13F("crowding", { limit: 25 }) as Crowding;
@@ -7,7 +7,7 @@ import { formatMarketPriceWithCurrency, liveQuoteFormatOptions, type MarketForma
7
7
  import { heldCurrencyUnit } from "../../../../utils/currency-units";
8
8
  import { adrRatioText } from "../../../../utils/depositary-receipt";
9
9
  import {
10
- compareDepositaryPair, dollarPairLabel, formatPairRate, isReceiptSide, listingDepositaryPair, pairPriceInput, pairTimeText,
10
+ compareDepositaryPair, dollarPairLabel, formatPairRate, isReceiptSide, listingDepositaryPair, pairListingKey, pairPriceInput, pairTimeText,
11
11
  premiumText, ratioCount, spotRateKind, type DepositaryPairComparison, type PairPriceInput, type PairSpotInput,
12
12
  } from "../../../../market-data/depositary-pair";
13
13
  import { AH_SPOT_LABEL, ahListingKey, type AhComparison } from "../../../../market-data/ah-pair";
@@ -78,7 +78,9 @@ export function adrPairComparison(
78
78
  spot: PairSpotInput | null,
79
79
  now = Date.now(),
80
80
  ): DepositaryPairComparison | null {
81
- return compareDepositaryPair(legs.pair.ratio, pairPriceInput(legs.receiptKey, quotes.receipt), pairPriceInput(legs.homeKey, quotes.home), spot, now);
81
+ // Each leg named as every other listing is (SHEL:LSE, SHEL:NYSE), not as its source writes it (SHEL.L).
82
+ const receiptKey = pairListingKey(legs.receiptKey, quotes.receipt?.listingExchangeName || quotes.receipt?.exchangeName);
83
+ return compareDepositaryPair(legs.pair.ratio, pairPriceInput(receiptKey, quotes.receipt), pairPriceInput(pairListingKey(legs.homeKey), quotes.home), spot, now);
82
84
  }
83
85
 
84
86
  export interface AdrPairFigure {
@@ -357,6 +357,13 @@ export function latestFinancialPeriodEnd(statements: readonly FinancialTableStat
357
357
  .reduce<string | undefined>((max, end) => (end && (!max || end > max) ? end : max), undefined);
358
358
  }
359
359
 
360
+ export function financialGrowthNotice(period: FinancialPeriod, statements: readonly FinancialStatement[]): string {
361
+ if (period === "annual") return "Growth: YoY.";
362
+ return statements.some((statement) => statement.date !== "TTM" && (statementPeriodMonths(statement) ?? 3) > 3)
363
+ ? "Growth: QoQ; half-year growth is YoY."
364
+ : "Growth: QoQ.";
365
+ }
366
+
360
367
  export function financialStatementDateNotice(statements: readonly FinancialStatement[]): string {
361
368
  const dated = statements.filter(({ date }) => date !== "TTM");
362
369
  return [
@@ -10,6 +10,9 @@ import { useAssetData } from "../../../runtime";
10
10
  import { colors, priceColor } from "../../../../theme/colors";
11
11
  import { notMeaningfulColor } from "../../../../components/ui/not-meaningful";
12
12
  import type { PricePoint } from "../../../../types/financials";
13
+ import type { FxCloses } from "../../../../market-data/fx-closes";
14
+ import { apiClient } from "../../../../api-client";
15
+ import { loadValuationFx } from "../../../../time-series/valuation-currency";
13
16
  import { displayWidth, padTo } from "../../../../utils/format";
14
17
  import { useBoundTicker, useTickerRequest } from "../../shared/ticker-request";
15
18
  import type { FinancialTableStatement } from "./aggregation";
@@ -54,6 +57,7 @@ export function ratioNameCell(
54
57
 
55
58
  export interface PeriodEndHistoryState {
56
59
  data: PricePoint[] | undefined;
60
+ fx?: ReadonlyMap<string, FxCloses>;
57
61
  loading: boolean;
58
62
  error: string | null;
59
63
  }
@@ -63,18 +67,23 @@ export interface PeriodEndHistoryState {
63
67
  * mounts only while the Valuation tab is open, so the other tabs never ask for
64
68
  * history and the table itself needs no plugin runtime.
65
69
  */
66
- export function PeriodEndHistoryLoader({ oldestPeriodEnd, onChange }: {
70
+ export function PeriodEndHistoryLoader({ oldestPeriodEnd, fxCurrencies, onChange }: {
67
71
  oldestPeriodEnd: string;
72
+ fxCurrencies: string;
68
73
  onChange: (state: PeriodEndHistoryState | null) => void;
69
74
  }) {
70
75
  const provider = useAssetData();
71
76
  const { symbol, exchange } = useBoundTicker();
72
- const loader = useCallback((nextSymbol: string, nextExchange: string, forceRefresh: boolean): Promise<PricePoint[]> => {
77
+ const loader = useCallback(async (nextSymbol: string, nextExchange: string, forceRefresh: boolean) => {
73
78
  if (!provider) throw new Error("Market data unavailable");
74
- return loadPeriodEndHistory(provider, nextSymbol, nextExchange, oldestPeriodEnd, forceRefresh ? { cacheMode: "refresh" } : undefined);
75
- }, [oldestPeriodEnd, provider]);
76
- const { data, loading, error } = useTickerRequest(loader, symbol, exchange, ["period-end-history", oldestPeriodEnd]);
77
- useEffect(() => onChange({ data: data ?? undefined, loading, error: error ? String(error) : null }), [data, error, loading, onChange]);
79
+ const [prices, fx] = await Promise.all([
80
+ loadPeriodEndHistory(provider, nextSymbol, nextExchange, oldestPeriodEnd, forceRefresh ? { cacheMode: "refresh" } : undefined),
81
+ loadValuationFx(fxCurrencies ? fxCurrencies.split(",") : [], oldestPeriodEnd, apiClient),
82
+ ]);
83
+ return { prices, fx };
84
+ }, [oldestPeriodEnd, provider, fxCurrencies]);
85
+ const { data, loading, error } = useTickerRequest(loader, symbol, exchange, ["period-end-history", oldestPeriodEnd, fxCurrencies]);
86
+ useEffect(() => onChange({ data: data?.prices, fx: data?.fx, loading, error: error ? String(error) : null }), [data, error, loading, onChange]);
78
87
  useEffect(() => () => onChange(null), [onChange]);
79
88
  return null;
80
89
  }
@@ -1,4 +1,4 @@
1
- import { createValuationCurrencyContext } from "../../../../time-series/valuation-currency";
1
+ import { createValuationCurrencyContext, type ValuationCurrencyContext } from "../../../../time-series/valuation-currency";
2
2
  import type { CompanyProfile, FinancialStatement, PricePoint, TickerFinancials } from "../../../../types/financials";
3
3
  import { MISSING_VALUE, formatNumber, pickUnit } from "../../../../utils/format";
4
4
  import { pricePointIntegrity } from "../../../../utils/price-history-integrity";
@@ -922,14 +922,15 @@ export function ratioTableForFinancials(
922
922
  period: FinancialPeriod,
923
923
  history?: readonly PricePoint[] | null,
924
924
  proceeds?: { periodEnd: string; filings: readonly OfferingFiling[] },
925
+ currencies: ValuationCurrencyContext = createValuationCurrencyContext(financials),
925
926
  ): RatioTableModel {
926
927
  const annual = byDate(financials.annualStatements);
927
928
  const quarterly = byDate(financials.quarterlyStatements);
928
929
  const { statements } = selectFinancialStatements(period, "income", annual, quarterly, undefined, financials.trailingStatement);
929
- const currencies = createValuationCurrencyContext(financials);
930
930
  const price = (statement: FinancialTableStatement): RatioAmount => {
931
- const close = history ? periodEndClose(history, ratioPeriodEnd(statement)) : undefined;
932
- return (close === undefined ? null : currencies.priceInStatementUnits(statement, close)) ?? "no-price";
931
+ const date = ratioPeriodEnd(statement);
932
+ const close = history ? periodEndClose(history, date) : undefined;
933
+ return (close === undefined ? null : currencies.priceInStatementUnits(statement, close, date)) ?? "no-price";
933
934
  };
934
935
  return buildRatioTableModel(tab, ratioPeriods(statements, ratioOpenings(period, annual, quarterly), period, price, { annual, quarterly }), "all", financials.profile, proceeds);
935
936
  }
@@ -16,6 +16,7 @@ import {
16
16
  import { colors, priceColor } from "../../../../theme/colors";
17
17
  import { notMeaningfulColor } from "../../../../components/ui/not-meaningful";
18
18
  import { isNotMeaningful } from "../../../../utils/growth";
19
+ import { useRemoteUiNode } from "../../../../remote/semantic-tree";
19
20
  import { fiscalYearEndMonth } from "../../../../utils/fiscal-period";
20
21
  import { displayWidth, padTo } from "../../../../utils/format";
21
22
  import { filledPeriodPublications, filledPeriodsNote, stalePeriodNote } from "../../../../utils/financial-statements";
@@ -30,6 +31,7 @@ import {
30
31
  financialCellParts,
31
32
  financialColumnPeriod,
32
33
  financialFiscalHeader,
34
+ financialGrowthNotice,
33
35
  formatFinancialCell,
34
36
  formatFinancialCellValue,
35
37
  financialStatementCurrency,
@@ -339,6 +341,11 @@ export function ResolvedFinancialsTab({
339
341
  // One currency for every column goes in the query bar with the growth basis;
340
342
  // a column in a different currency (or none) says so in its own header.
341
343
  const growthBasis = isAnnual ? "YoY" : "QoQ";
344
+ useRemoteUiNode(!ratioTab && displayStatements.length ? {
345
+ role: "report-notice",
346
+ label: "Growth",
347
+ getMetadata: () => ({ text: financialGrowthNotice(resolvedPeriod, displayStatements), key: "growthBasis", value: growthBasis }),
348
+ } : null);
342
349
  const yearEndMonth = useMemo(() => fiscalYearEndMonth(annualStatements), [annualStatements]);
343
350
  const annualDates = useMemo(() => new Set(annualStatements.map(({ date }) => date)), [annualStatements]);
344
351
  const { rows, unit } = useMemo(
@@ -458,7 +465,8 @@ export function ResolvedFinancialsTab({
458
465
  const oldestPeriodEnd = oldestRatioPeriodEnd(displayStatements);
459
466
  const [loadedHistory, setHistory] = useState<PeriodEndHistoryState | null>(null);
460
467
  const history: PeriodEndHistoryState = isValuation && loadedHistory ? loadedHistory : { data: undefined, loading: isValuation, error: null };
461
- const currencies = useMemo(() => financials ? createValuationCurrencyContext(financials) : null, [financials]);
468
+ const currencies = useMemo(() => financials ? createValuationCurrencyContext(financials, history.fx) : null, [financials, history.fx]);
469
+ const valuationFxCurrencies = isValuation ? currencies?.fxCurrencies(displayStatements).sort().join(",") ?? "" : "";
462
470
  const { symbol: boundSymbol, exchange: boundExchange } = useBoundTicker();
463
471
  const latestRunway = financials && ratioTab?.key === "liquidity" ? cashRunway(financials) : null;
464
472
  const runwayPeriodEnd = burnsCash(latestRunway) ? latestRunway.periodEnd : null;
@@ -469,8 +477,9 @@ export function ResolvedFinancialsTab({
469
477
  const price = (statement: FinancialTableStatement): RatioAmount => {
470
478
  if (!isValuation) return "no-price";
471
479
  if (!history.data) return history.error && !history.loading ? "no-price" : "loading";
472
- const close = periodEndClose(history.data, ratioPeriodEnd(statement));
473
- return (close === undefined ? null : currencies?.priceInStatementUnits(statement, close)) ?? "no-price";
480
+ const date = ratioPeriodEnd(statement);
481
+ const close = periodEndClose(history.data, date);
482
+ return (close === undefined ? null : currencies?.priceInStatementUnits(statement, close, date)) ?? "no-price";
474
483
  };
475
484
  const expanded = new Set(ratioTab.ratios.map((ratio) => ratio.id).filter((id) => !collapsedGroups.has(id)));
476
485
  return buildRatioTableModel(ratioTab, ratioPeriods(displayStatements, openings, resolvedPeriod, price, { annual: annualStatements, quarterly: quarterlyStatements }), expanded, financials?.profile,
@@ -515,7 +524,7 @@ export function ResolvedFinancialsTab({
515
524
  ...financialStatementLimitations(financials),
516
525
  ...(offeringNote ? [offeringNote] : []),
517
526
  ...(isValuation && history.error && !history.data ? ["Period-end prices are unavailable, so valuation ratios are too."] : []),
518
- ...(isValuation ? [currencies?.warning(displayStatements) ?? ""] : []),
527
+ ...(isValuation && !history.loading ? [currencies?.conversionNote(displayStatements, ratioPeriodEnd) ?? "", currencies?.warning(displayStatements, ratioPeriodEnd) ?? ""] : []),
519
528
  ],
520
529
  focused,
521
530
  });
@@ -573,7 +582,7 @@ export function ResolvedFinancialsTab({
573
582
  paddingX={nativePaneChrome ? 0 : 1}
574
583
  overflow="hidden"
575
584
  >
576
- {isValuation && oldestPeriodEnd ? <PeriodEndHistoryLoader oldestPeriodEnd={oldestPeriodEnd} onChange={setHistory} /> : null}
585
+ {isValuation && oldestPeriodEnd ? <PeriodEndHistoryLoader oldestPeriodEnd={oldestPeriodEnd} fxCurrencies={valuationFxCurrencies} onChange={setHistory} /> : null}
577
586
  {ratioModel ? (
578
587
  <RatioTable
579
588
  focused={focused}