@gloom-sh/terminal 0.20.17 → 0.20.19

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 (453) hide show
  1. package/package.json +3 -1
  2. package/src/account/auth-dialog.tsx +19 -1
  3. package/src/account/billing.ts +2 -1
  4. package/src/account/heard-from-question.tsx +235 -0
  5. package/src/account/heard-from.ts +97 -0
  6. package/src/api-client/cot.ts +5 -6
  7. package/src/api-client/data.ts +14 -3
  8. package/src/api-client/heard-from.ts +72 -0
  9. package/src/api-client/index.ts +64 -6
  10. package/src/api-client/mna.ts +18 -0
  11. package/src/api-client/request.ts +162 -40
  12. package/src/api-client/supply-chain.ts +9 -0
  13. package/src/api-client/types/billing.ts +35 -1
  14. package/src/api-client/types/news.ts +45 -0
  15. package/src/api-client/types/world-venues.ts +9 -0
  16. package/src/app/global-shortcuts.ts +5 -3
  17. package/src/app/pro-welcome/keys.ts +27 -0
  18. package/src/app/pro-welcome/model.ts +158 -0
  19. package/src/app/pro-welcome/row.tsx +176 -0
  20. package/src/app/pro-welcome/use-pro-welcome.ts +156 -0
  21. package/src/app/runtime/external-profile-changes.ts +135 -0
  22. package/src/app.tsx +37 -4
  23. package/src/architecture/core-builtin-allowlist.json +1 -1
  24. package/src/architecture/floating-promise-allowlist.json +1 -2
  25. package/src/architecture/shortcut-labels-allowlist.json +1 -0
  26. package/src/cli/alert-listing.ts +98 -0
  27. package/src/cli/commands/market.ts +191 -39
  28. package/src/cli/commands/overview.ts +7 -1
  29. package/src/cli/commands/plugins.ts +3 -2
  30. package/src/cli/commands/search.ts +30 -6
  31. package/src/cli/commands/ticker.ts +13 -6
  32. package/src/cli/context.ts +24 -5
  33. package/src/cli/csv-export.ts +2 -1
  34. package/src/cli/desktop-pane-shot-browser.ts +3 -1
  35. package/src/cli/desktop-pane-shot-view.ts +0 -1
  36. package/src/cli/desktop-pane-shot.ts +276 -52
  37. package/src/cli/errors.ts +3 -9
  38. package/src/cli/exit-codes.ts +1 -1
  39. package/src/cli/glossary.ts +65 -11
  40. package/src/cli/help.ts +1 -1
  41. package/src/cli/history-demergers.ts +117 -0
  42. package/src/cli/history-rows.ts +8 -4
  43. package/src/cli/index.ts +2 -1
  44. package/src/cli/known-gaps.ts +16 -0
  45. package/src/cli/known-us-stocks.ts +18 -0
  46. package/src/cli/listing-arg.ts +192 -38
  47. package/src/cli/pane-functions/catalog-snapshot-build.ts +83 -0
  48. package/src/cli/pane-functions/catalog-snapshot.json +877 -0
  49. package/src/cli/pane-functions/catalog-snapshot.ts +62 -0
  50. package/src/cli/pane-functions/catalog.ts +50 -16
  51. package/src/cli/pane-functions/data.ts +16 -4
  52. package/src/cli/pane-functions/dom.ts +54 -8
  53. package/src/cli/pane-functions/freshness.ts +39 -4
  54. package/src/cli/pane-functions/function-help.ts +3 -3
  55. package/src/cli/pane-functions/headless.ts +9 -1
  56. package/src/cli/pane-functions/index.ts +175 -50
  57. package/src/cli/pane-functions/report-notices.ts +10 -0
  58. package/src/cli/pane-functions/resolver.ts +11 -7
  59. package/src/cli/pane-functions/screenshot-assessment.ts +38 -10
  60. package/src/cli/pane-functions/screenshot-data-evidence.ts +7 -15
  61. package/src/cli/pane-functions/screenshot-payload.ts +36 -1
  62. package/src/cli/pane-functions/screenshot-render.ts +24 -9
  63. package/src/cli/pane-functions/screenshot-types.ts +9 -0
  64. package/src/cli/quote-answer.ts +33 -17
  65. package/src/cli/registry.ts +22 -2
  66. package/src/cli/result.ts +22 -4
  67. package/src/cli/scroll-truncation.ts +7 -2
  68. package/src/cli/series-search.ts +45 -6
  69. package/src/cli/shot-temp-dir.ts +4 -9
  70. package/src/cli/ticker-resolution.ts +1 -1
  71. package/src/cli/unreachable.ts +21 -0
  72. package/src/components/chart/composite/drawing-store.ts +11 -7
  73. package/src/components/chart/composite/format.ts +1 -0
  74. package/src/components/chart/composite/legend.tsx +48 -20
  75. package/src/components/chart/composite/panel-surface/panel-cursor.tsx +3 -3
  76. package/src/components/chart/composite/panel-surface/plot-gestures.ts +9 -2
  77. package/src/components/chart/composite/panel-surface.tsx +1 -1
  78. package/src/components/chart/composite/price-axis-labels.tsx +7 -5
  79. package/src/components/chart/composite/tools.ts +164 -39
  80. package/src/components/chart-table/header.tsx +11 -2
  81. package/src/components/chart-table/layout.ts +16 -17
  82. package/src/components/command-bar/pane-templates/items.ts +17 -1
  83. package/src/components/command-bar/routes/root/provider-search.ts +10 -1
  84. package/src/components/command-bar/routes/root/results.ts +34 -2
  85. package/src/components/command-bar/routes/root/runtime.ts +19 -4
  86. package/src/components/command-bar/routes/ticker-search/results.ts +5 -0
  87. package/src/components/command-bar/routes/ticker-search/route.ts +5 -0
  88. package/src/components/command-bar/selection-runtime.ts +29 -5
  89. package/src/components/command-bar/surface/index.tsx +4 -1
  90. package/src/components/command-bar/workflow/alert.ts +32 -13
  91. package/src/components/data-table/view.tsx +15 -2
  92. package/src/components/form-modal/content.tsx +9 -4
  93. package/src/components/index.ts +1 -1
  94. package/src/components/layout/header.tsx +9 -5
  95. package/src/components/layout/pane/capture-status.ts +6 -0
  96. package/src/components/layout/pane/footer/index.tsx +2 -0
  97. package/src/components/layout/pane/footer/model.ts +123 -17
  98. package/src/components/layout/pane/header.tsx +16 -2
  99. package/src/components/layout/pane/status-footer.ts +24 -0
  100. package/src/components/market-board/index.tsx +4 -2
  101. package/src/components/onboarding/onboarding-frame.tsx +6 -2
  102. package/src/components/onboarding/onboarding-keyboard.ts +7 -1
  103. package/src/components/onboarding/onboarding-wizard.tsx +3 -1
  104. package/src/components/onboarding/portfolio-step/positions-panel.tsx +24 -15
  105. package/src/components/onboarding/setup-cards.ts +36 -0
  106. package/src/components/onboarding/use-onboarding-progress.ts +22 -1
  107. package/src/components/onboarding/wizard-account.ts +6 -1
  108. package/src/components/onboarding/wizard-model.ts +32 -6
  109. package/src/components/onboarding/wizard-positions.ts +1 -1
  110. package/src/components/price-performance.tsx +26 -8
  111. package/src/components/reader/article-reader.tsx +12 -5
  112. package/src/components/sign-in-gate.tsx +3 -1
  113. package/src/components/toggle-list.tsx +6 -8
  114. package/src/components/ui/confirm-dialog.tsx +47 -7
  115. package/src/components/ui/data-table/opentui/index.tsx +7 -0
  116. package/src/components/ui/data-table/types.ts +8 -0
  117. package/src/components/ui/display.tsx +17 -2
  118. package/src/components/ui/index.ts +1 -1
  119. package/src/components/ui/stat-grid.tsx +4 -0
  120. package/src/components/ui/status.tsx +13 -1
  121. package/src/components/ui/table-layout.ts +34 -2
  122. package/src/components/use-pane-notice-footer.tsx +16 -3
  123. package/src/data/config/store/index.ts +31 -0
  124. package/src/data/config/store/node.ts +61 -11
  125. package/src/data/config/store/normalize.ts +4 -6
  126. package/src/data/config/store/shared-file.ts +309 -0
  127. package/src/data/profile-merge.ts +299 -0
  128. package/src/data/sqlite/checkpointer.ts +11 -1
  129. package/src/data/sqlite/database.ts +1 -1
  130. package/src/data/ticker-repository.ts +134 -10
  131. package/src/data/ticker-store.ts +67 -0
  132. package/src/data/ticker-writes.ts +5 -0
  133. package/src/i18n/es.ts +27 -0
  134. package/src/i18n/ja.ts +27 -0
  135. package/src/i18n/ko.ts +27 -0
  136. package/src/i18n/zh-cn.ts +27 -0
  137. package/src/i18n/zh-tw.ts +27 -0
  138. package/src/layout-marketplace/gallery-desktop.tsx +2 -2
  139. package/src/market-data/ah-pair.ts +122 -0
  140. package/src/market-data/coordinator/entries.ts +6 -4
  141. package/src/market-data/coordinator/index.ts +14 -3
  142. package/src/market-data/depositary-pair.ts +6 -2
  143. package/src/market-data/futures-board.ts +36 -29
  144. package/src/market-data/futures-contract.ts +37 -1
  145. package/src/market-data/hooks.tsx +33 -2
  146. package/src/market-data/market/change-basis.ts +11 -1
  147. package/src/market-data/market/header-market.ts +11 -0
  148. package/src/market-data/market/status.ts +40 -4
  149. package/src/market-data/performance.ts +127 -32
  150. package/src/market-data/quotes/time.ts +5 -2
  151. package/src/market-data/split-terms.ts +28 -0
  152. package/src/news/types.ts +28 -0
  153. package/src/notifications/app-badge.ts +2 -3
  154. package/src/notifications/app-notifier.ts +5 -0
  155. package/src/plugins/builtin/account-management/footer.ts +1 -1
  156. package/src/plugins/builtin/account-management/keyboard.ts +4 -0
  157. package/src/plugins/builtin/account-management/model.ts +1 -0
  158. package/src/plugins/builtin/account-management/pane.tsx +75 -7
  159. package/src/plugins/builtin/account-management/payment-recovery-row.tsx +12 -5
  160. package/src/plugins/builtin/account-management/pro-cancel.tsx +197 -0
  161. package/src/plugins/builtin/account-management/trial-cancel.ts +1 -1
  162. package/src/plugins/builtin/alerts/cli-move.ts +2 -2
  163. package/src/plugins/builtin/alerts/cli.ts +101 -48
  164. package/src/plugins/builtin/alerts/command.ts +39 -9
  165. package/src/plugins/builtin/alerts/constants.ts +10 -0
  166. package/src/plugins/builtin/alerts/earnings-listing.ts +20 -0
  167. package/src/plugins/builtin/alerts/event-rows.ts +9 -3
  168. package/src/plugins/builtin/alerts/events-pane.tsx +16 -10
  169. package/src/plugins/builtin/alerts/format.ts +24 -8
  170. package/src/plugins/builtin/alerts/headless.ts +12 -6
  171. package/src/plugins/builtin/alerts/index.tsx +97 -16
  172. package/src/plugins/builtin/alerts/move-checks.ts +7 -0
  173. package/src/plugins/builtin/alerts/option-contract.ts +197 -0
  174. package/src/plugins/builtin/alerts/pane.tsx +1 -1
  175. package/src/plugins/builtin/alerts/price.ts +30 -5
  176. package/src/plugins/builtin/alerts/pro-rules.ts +62 -0
  177. package/src/plugins/builtin/alerts/quotes.ts +26 -2
  178. package/src/plugins/builtin/alerts/research-builder.ts +5 -10
  179. package/src/plugins/builtin/alerts/scheduled.ts +6 -1
  180. package/src/plugins/builtin/alerts/types.ts +7 -0
  181. package/src/plugins/builtin/analytics/account-returns.ts +1 -1
  182. package/src/plugins/builtin/analytics/manual-value.ts +61 -0
  183. package/src/plugins/builtin/analytics/pane-model.ts +2 -2
  184. package/src/plugins/builtin/analytics/risk-book.ts +7 -7
  185. package/src/plugins/builtin/analytics/risk-client.ts +27 -14
  186. package/src/plugins/builtin/analytics/risk-headless.ts +13 -8
  187. package/src/plugins/builtin/analytics/risk-model.ts +92 -4
  188. package/src/plugins/builtin/analytics/risk-pane.tsx +85 -38
  189. package/src/plugins/builtin/awards/pane.tsx +1 -1
  190. package/src/plugins/builtin/broker-trading/orders.tsx +2 -2
  191. package/src/plugins/builtin/buildout/company/pane.tsx +4 -14
  192. package/src/plugins/builtin/catalysts/model.ts +2 -1
  193. package/src/plugins/builtin/central-bank-rates/model.ts +8 -2
  194. package/src/plugins/builtin/central-bank-rates/pane.tsx +5 -3
  195. package/src/plugins/builtin/chart-composer/chart-spec.ts +5 -0
  196. package/src/plugins/builtin/chart-composer/cli-options.ts +9 -5
  197. package/src/plugins/builtin/chart-composer/data-catalog-pane.tsx +2 -6
  198. package/src/plugins/builtin/chart-composer/headless-schema.ts +14 -10
  199. package/src/plugins/builtin/chart-composer/headless.ts +2 -0
  200. package/src/plugins/builtin/chart-composer/index.tsx +17 -5
  201. package/src/plugins/builtin/chart-composer/pane.tsx +19 -6
  202. package/src/plugins/builtin/chart-composer/viewport-labels.ts +2 -17
  203. package/src/plugins/builtin/chat/controller/notifications.ts +1 -0
  204. package/src/plugins/builtin/chat/index.tsx +0 -1
  205. package/src/plugins/builtin/cloud/auth-actions.tsx +11 -6
  206. package/src/plugins/builtin/cloud/company-picker.tsx +5 -3
  207. package/src/plugins/builtin/cloud/upgrade-command.ts +1 -1
  208. package/src/plugins/builtin/commodities-energy/index.tsx +1 -1
  209. package/src/plugins/builtin/company-kpis/headless.ts +10 -5
  210. package/src/plugins/builtin/company-kpis/latest.ts +45 -0
  211. package/src/plugins/builtin/company-kpis/model.ts +57 -15
  212. package/src/plugins/builtin/company-kpis/pane.tsx +22 -8
  213. package/src/plugins/builtin/composite/alt-data.ts +20 -0
  214. package/src/plugins/builtin/composite/application.ts +14 -0
  215. package/src/plugins/builtin/composite/broker.ts +12 -0
  216. package/src/plugins/builtin/composite/credit.ts +33 -0
  217. package/src/plugins/builtin/composite/crypto.ts +10 -0
  218. package/src/plugins/builtin/composite/earnings.ts +12 -0
  219. package/src/plugins/builtin/composite/filings.ts +13 -0
  220. package/src/plugins/builtin/composite/futures-commodities.ts +23 -0
  221. package/src/plugins/builtin/composite/global-markets.ts +12 -0
  222. package/src/plugins/builtin/composite/options-volatility.ts +23 -0
  223. package/src/plugins/builtin/composite/ownership.ts +23 -0
  224. package/src/plugins/builtin/composite/portfolio.ts +10 -0
  225. package/src/plugins/builtin/composite/quant.ts +15 -0
  226. package/src/plugins/builtin/composite/rates-macro.ts +30 -0
  227. package/src/plugins/builtin/composite/screeners.ts +11 -0
  228. package/src/plugins/builtin/composite/shared.ts +11 -0
  229. package/src/plugins/builtin/composite/ticker-core.ts +36 -0
  230. package/src/plugins/builtin/congress-trades/headless.ts +31 -3
  231. package/src/plugins/builtin/congress-trades/model.ts +9 -5
  232. package/src/plugins/builtin/correlation/index.tsx +13 -17
  233. package/src/plugins/builtin/correlation/matrix/model.ts +18 -0
  234. package/src/plugins/builtin/cot/client.ts +2 -3
  235. package/src/plugins/builtin/cot/headless.ts +16 -16
  236. package/src/plugins/builtin/cot/index.tsx +6 -6
  237. package/src/plugins/builtin/cot/model.ts +25 -5
  238. package/src/plugins/builtin/cot/pane.tsx +11 -6
  239. package/src/plugins/builtin/cot/series.ts +11 -8
  240. package/src/plugins/builtin/cpi/model.ts +15 -4
  241. package/src/plugins/builtin/cpi/pane.tsx +29 -7
  242. package/src/plugins/builtin/dividend-yield/client.ts +57 -16
  243. package/src/plugins/builtin/dividend-yield/headless.ts +17 -11
  244. package/src/plugins/builtin/dividend-yield/model.ts +4 -3
  245. package/src/plugins/builtin/dividend-yield/pane.tsx +22 -18
  246. package/src/plugins/builtin/dividend-yield/ranking.ts +1 -1
  247. package/src/plugins/builtin/dividend-yield/types.ts +4 -0
  248. package/src/plugins/builtin/dividend-yield/view.ts +23 -12
  249. package/src/plugins/builtin/doe/model.ts +30 -0
  250. package/src/plugins/builtin/doe/pane.tsx +8 -2
  251. package/src/plugins/builtin/earnings/board-table.ts +9 -4
  252. package/src/plugins/builtin/earnings/fiscal-quarter.ts +39 -0
  253. package/src/plugins/builtin/earnings/headless.ts +16 -6
  254. package/src/plugins/builtin/earnings/history-model.ts +6 -4
  255. package/src/plugins/builtin/earnings/history-table.ts +7 -4
  256. package/src/plugins/builtin/earnings-calls/calendar.tsx +4 -3
  257. package/src/plugins/builtin/earnings-calls/pane.tsx +8 -2
  258. package/src/plugins/builtin/earnings-ripple/pane.tsx +2 -2
  259. package/src/plugins/builtin/econ/calendar-model.ts +16 -0
  260. package/src/plugins/builtin/econ/index.tsx +7 -2
  261. package/src/plugins/builtin/equity-screener/headless.ts +4 -1
  262. package/src/plugins/builtin/equity-screener/model.ts +7 -6
  263. package/src/plugins/builtin/estimate-revisions/headless.ts +1 -1
  264. package/src/plugins/builtin/exposure/model.ts +10 -0
  265. package/src/plugins/builtin/exposure/pane.tsx +10 -3
  266. package/src/plugins/builtin/futures/model.ts +14 -1
  267. package/src/plugins/builtin/futures/series.ts +1 -8
  268. package/src/plugins/builtin/fx-matrix/amount.ts +15 -1
  269. package/src/plugins/builtin/fx-matrix/headless.ts +12 -6
  270. package/src/plugins/builtin/fx-matrix/index.tsx +25 -7
  271. package/src/plugins/builtin/fx-matrix/settings.ts +9 -4
  272. package/src/plugins/builtin/insider/detail.tsx +36 -7
  273. package/src/plugins/builtin/insider/filing-stories.ts +110 -0
  274. package/src/plugins/builtin/insider/headless.ts +37 -2
  275. package/src/plugins/builtin/insider/index.tsx +79 -10
  276. package/src/plugins/builtin/insider/model.ts +43 -5
  277. package/src/plugins/builtin/ipo-calendar/client.ts +11 -1
  278. package/src/plugins/builtin/ipo-calendar/model.ts +3 -7
  279. package/src/plugins/builtin/jobs/headless.ts +2 -1
  280. package/src/plugins/builtin/jobs/model.ts +6 -0
  281. package/src/plugins/builtin/jobs/pane.tsx +8 -3
  282. package/src/plugins/builtin/kelly-sizer/pane.tsx +9 -4
  283. package/src/plugins/builtin/market-valuation/pane.tsx +22 -10
  284. package/src/plugins/builtin/mna/detail.tsx +67 -6
  285. package/src/plugins/builtin/mna/headless.ts +128 -13
  286. package/src/plugins/builtin/mna/model.ts +219 -16
  287. package/src/plugins/builtin/mna/pane.tsx +34 -6
  288. package/src/plugins/builtin/money-markets/model.ts +14 -5
  289. package/src/plugins/builtin/money-markets/pane.tsx +4 -3
  290. package/src/plugins/builtin/news/wire/news/detail-view.tsx +118 -10
  291. package/src/plugins/builtin/news/wire/news/footer.ts +3 -8
  292. package/src/plugins/builtin/news/wire/news/story-evidence.ts +178 -0
  293. package/src/plugins/builtin/options/analytics.ts +1 -1
  294. package/src/plugins/builtin/options/view.tsx +18 -11
  295. package/src/plugins/builtin/options-positioning/model.ts +11 -0
  296. package/src/plugins/builtin/options-positioning/pane.tsx +22 -1
  297. package/src/plugins/builtin/options-scenario/client.ts +49 -8
  298. package/src/plugins/builtin/options-scenario/csp-screen-pane.tsx +22 -6
  299. package/src/plugins/builtin/options-scenario/csp-screen.ts +39 -12
  300. package/src/plugins/builtin/options-scenario/headless.ts +7 -3
  301. package/src/plugins/builtin/options-scenario/model.ts +33 -2
  302. package/src/plugins/builtin/options-scenario/pane.tsx +3 -4
  303. package/src/plugins/builtin/options-scenario/strategy-screen.ts +7 -5
  304. package/src/plugins/builtin/pe-band/client.ts +13 -1
  305. package/src/plugins/builtin/pe-band/headless.ts +2 -2
  306. package/src/plugins/builtin/pe-band/model.ts +63 -10
  307. package/src/plugins/builtin/pe-band/pane.tsx +5 -5
  308. package/src/plugins/builtin/perps/cascade.ts +4 -3
  309. package/src/plugins/builtin/perps/markets-section.tsx +5 -2
  310. package/src/plugins/builtin/perps/model.ts +4 -3
  311. package/src/plugins/builtin/portfolio-list/allocation-rows.ts +26 -7
  312. package/src/plugins/builtin/portfolio-list/cli/portfolio-command.ts +66 -13
  313. package/src/plugins/builtin/portfolio-list/cli/render.ts +76 -33
  314. package/src/plugins/builtin/portfolio-list/headless.ts +69 -22
  315. package/src/plugins/builtin/portfolio-list/pane/data.ts +3 -3
  316. package/src/plugins/builtin/portfolio-list/pane/index.tsx +29 -14
  317. package/src/plugins/builtin/portfolio-list/summary/index.tsx +2 -2
  318. package/src/plugins/builtin/portfolio-list/table.tsx +3 -2
  319. package/src/plugins/builtin/relative-rotation/pane.tsx +2 -3
  320. package/src/plugins/builtin/research/corporate-actions-pane.tsx +33 -14
  321. package/src/plugins/builtin/research/event-model.ts +43 -19
  322. package/src/plugins/builtin/research/headless.ts +8 -1
  323. package/src/plugins/builtin/research/relative-valuation-pane.tsx +19 -17
  324. package/src/plugins/builtin/research-search/index.tsx +3 -1
  325. package/src/plugins/builtin/scanner/denied.tsx +16 -4
  326. package/src/plugins/builtin/scanner/flow-pane.tsx +1 -1
  327. package/src/plugins/builtin/scanner/hilo-pane.tsx +1 -1
  328. package/src/plugins/builtin/sec/filing-display.tsx +14 -2
  329. package/src/plugins/builtin/sec/headless.ts +42 -4
  330. package/src/plugins/builtin/sec/index.tsx +21 -1
  331. package/src/plugins/builtin/sectors/index.tsx +6 -9
  332. package/src/plugins/builtin/sectors/sector-model.ts +1 -1
  333. package/src/plugins/builtin/shared/cloud-upgrade.ts +1 -1
  334. package/src/plugins/builtin/shared/earnings-report.ts +49 -5
  335. package/src/plugins/builtin/shared/options-pro-copy.ts +34 -0
  336. package/src/plugins/builtin/shared/report-freshness.ts +2 -3
  337. package/src/plugins/builtin/shared/statement-currency.ts +23 -0
  338. package/src/plugins/builtin/shared/ticker-surface.ts +1 -1
  339. package/src/plugins/builtin/supply-chain/client.ts +34 -9
  340. package/src/plugins/builtin/supply-chain/evidence.ts +3 -2
  341. package/src/plugins/builtin/supply-chain/flow.tsx +4 -3
  342. package/src/plugins/builtin/supply-chain/graph-model.ts +14 -7
  343. package/src/plugins/builtin/supply-chain/graph-pane.tsx +3 -1
  344. package/src/plugins/builtin/supply-chain/graph.tsx +6 -3
  345. package/src/plugins/builtin/supply-chain/headless.ts +19 -4
  346. package/src/plugins/builtin/supply-chain/model.ts +50 -6
  347. package/src/plugins/builtin/supply-chain/pane.tsx +79 -18
  348. package/src/plugins/builtin/themes/headless.ts +4 -4
  349. package/src/plugins/builtin/themes/model.ts +11 -8
  350. package/src/plugins/builtin/themes/pane.tsx +2 -2
  351. package/src/plugins/builtin/ticker-detail/adr-pair/ah.ts +62 -0
  352. package/src/plugins/builtin/ticker-detail/adr-pair/headless.ts +119 -20
  353. package/src/plugins/builtin/ticker-detail/adr-pair/model.ts +51 -1
  354. package/src/plugins/builtin/ticker-detail/adr-pair/tab.tsx +25 -14
  355. package/src/plugins/builtin/ticker-detail/financials/model.ts +22 -32
  356. package/src/plugins/builtin/ticker-detail/financials/tab.tsx +7 -9
  357. package/src/plugins/builtin/ticker-detail/headless-schema.ts +2 -0
  358. package/src/plugins/builtin/ticker-detail/headless.ts +28 -12
  359. package/src/plugins/builtin/ticker-detail/overview/board-lot.ts +21 -0
  360. package/src/plugins/builtin/ticker-detail/overview/model.ts +28 -2
  361. package/src/plugins/builtin/ticker-detail/overview/pane.tsx +8 -0
  362. package/src/plugins/builtin/ticker-detail/overview-tab.tsx +68 -13
  363. package/src/plugins/builtin/ticker-detail/quote-monitor/card.tsx +9 -2
  364. package/src/plugins/builtin/ticker-detail/quote-monitor/index.tsx +5 -2
  365. package/src/plugins/builtin/volatility/model.ts +17 -0
  366. package/src/plugins/builtin/volatility/pane.tsx +16 -7
  367. package/src/plugins/builtin/world-indices/index.tsx +2 -0
  368. package/src/plugins/builtin/world-indices/table.tsx +15 -0
  369. package/src/plugins/builtin/world-venue-map/evidence.ts +3 -2
  370. package/src/plugins/builtin/world-venue-map/headless.ts +32 -18
  371. package/src/plugins/builtin/world-venue-map/index.ts +19 -6
  372. package/src/plugins/builtin/world-venue-map/layered-pane.tsx +9 -5
  373. package/src/plugins/builtin/world-venue-map/layers.ts +33 -11
  374. package/src/plugins/builtin/world-venue-map/map.tsx +12 -0
  375. package/src/plugins/builtin/world-venue-map/model.ts +6 -1
  376. package/src/plugins/builtin/world-venue-map/pane.tsx +35 -6
  377. package/src/plugins/builtin/world-venue-map/place.ts +119 -0
  378. package/src/plugins/builtin/world-venue-map/venue-header.tsx +5 -3
  379. package/src/plugins/catalog-browser.ts +10 -1
  380. package/src/plugins/catalog-data.ts +20 -0
  381. package/src/plugins/catalog-lazy.ts +51 -0
  382. package/src/plugins/catalog-ui.ts +16 -18
  383. package/src/plugins/host-smoke.ts +5 -2
  384. package/src/portfolio/allocation.ts +79 -19
  385. package/src/portfolio/cash-balances.ts +76 -0
  386. package/src/portfolio/mutations.ts +43 -8
  387. package/src/public/__snapshots__/public-api.test.ts.snap +1 -0
  388. package/src/renderers/browser/activity.ts +16 -0
  389. package/src/renderers/browser/app-badge-host.ts +14 -0
  390. package/src/renderers/browser/main.tsx +5 -0
  391. package/src/renderers/browser/notifications.ts +103 -0
  392. package/src/renderers/browser/ui-host.tsx +4 -0
  393. package/src/renderers/desktop/window-layouts.ts +14 -0
  394. package/src/renderers/dom/data-table/index.tsx +27 -4
  395. package/src/renderers/dom/data-table/row.tsx +2 -0
  396. package/src/renderers/dom/host/tabs.tsx +57 -8
  397. package/src/renderers/dom/styles.css +13 -5
  398. package/src/renderers/electrobun/bun/desktop/backend-requests.ts +4 -0
  399. package/src/renderers/electrobun/bun/desktop/backend.ts +22 -1
  400. package/src/renderers/electrobun/bun/window/native-min-size.ts +6 -1
  401. package/src/renderers/electrobun/shared/protocol.ts +4 -0
  402. package/src/renderers/electrobun/view/cli-pane-shot-frame.tsx +50 -12
  403. package/src/renderers/electrobun/view/http-fetch.ts +3 -2
  404. package/src/renderers/electrobun/view/remote/ticker-repository.ts +10 -0
  405. package/src/series/standalone-catalog.ts +5 -4
  406. package/src/series/standalone.ts +13 -7
  407. package/src/sources/gloomberb-cloud/index.ts +22 -9
  408. package/src/sources/gloomberb-cloud/news.ts +35 -0
  409. package/src/sources/gloomberb-cloud/perpetuals.ts +60 -3
  410. package/src/sources/provider-errors.ts +34 -7
  411. package/src/sources/provider-router/financials.ts +20 -13
  412. package/src/sources/provider-router/history.ts +32 -6
  413. package/src/sources/provider-router/index.ts +4 -0
  414. package/src/sources/provider-router/search.ts +1 -0
  415. package/src/sync/collections-contributor.ts +3 -1
  416. package/src/sync/config-merge.ts +10 -1
  417. package/src/sync/sanitize.ts +26 -2
  418. package/src/tickers/company-name-listing.ts +16 -2
  419. package/src/tickers/listing-fate.ts +12 -8
  420. package/src/tickers/renamed-listings.ts +43 -10
  421. package/src/tickers/search/home-listing.ts +28 -0
  422. package/src/tickers/search/index.ts +19 -7
  423. package/src/tickers/terminal-codes.ts +11 -1
  424. package/src/time-series/base-series.ts +39 -6
  425. package/src/time-series/chart-seed.ts +2 -2
  426. package/src/time-series/history-quality.ts +4 -1
  427. package/src/time-series/hooks.ts +2 -0
  428. package/src/time-series/price-comparison.ts +17 -23
  429. package/src/time-series/reporting.ts +1 -1
  430. package/src/time-series/resolution.ts +13 -0
  431. package/src/time-series/resolve-context.ts +6 -0
  432. package/src/time-series/resolve.ts +42 -3
  433. package/src/time-series/spec.ts +2 -2
  434. package/src/time-series/types.ts +3 -2
  435. package/src/types/data-provider.ts +11 -0
  436. package/src/types/financials.ts +48 -4
  437. package/src/types/headless.ts +1 -0
  438. package/src/types/issuer-listings.ts +2 -0
  439. package/src/types/plugin-notifications.ts +3 -0
  440. package/src/types/price-history.ts +6 -4
  441. package/src/types/ticker.ts +10 -2
  442. package/src/ui/host.tsx +2 -0
  443. package/src/utils/cli-output.ts +1 -1
  444. package/src/utils/declared-dividends.ts +13 -1
  445. package/src/utils/dividend-cash.ts +5 -1
  446. package/src/utils/exchange-announcements.ts +7 -2
  447. package/src/utils/forward-dividend.ts +4 -3
  448. package/src/utils/fundamentals.ts +40 -0
  449. package/src/utils/network-failure.ts +2 -0
  450. package/src/utils/price-history-integrity.ts +9 -1
  451. package/src/utils/remove-folder.ts +37 -0
  452. package/src/utils/trailing-dividend.ts +1 -1
  453. package/src/plugins/builtin/composite-plugins.ts +0 -285
@@ -51,6 +51,7 @@ import {
51
51
  buildEventRows,
52
52
  eventSourceNotice,
53
53
  formatEventMetric,
54
+ isFundListing,
54
55
  type EventFinancials,
55
56
  type EventRow,
56
57
  type EventStatus,
@@ -156,7 +157,10 @@ function sharedMetricCurrency(rows: readonly EventRow[]): string | undefined {
156
157
  return currencies.size === 1 ? only : undefined;
157
158
  }
158
159
 
159
- export function buildEventColumns(width: number, unit?: string, variant: "corporate-actions" | "earnings-estimates" = "corporate-actions"): EventColumn[] {
160
+ /** The earnings figures a fund's events never have: its rows are distributions and splits. */
161
+ const EARNINGS_COLUMN_IDS: ReadonlySet<EventColumnId> = new Set(["period", "qEps", "qRevenue", "annualEps", "annualRevenue"]);
162
+
163
+ export function buildEventColumns(width: number, unit?: string, variant: "corporate-actions" | "earnings-estimates" = "corporate-actions", fund = false): EventColumn[] {
160
164
  if (variant === "earnings-estimates") {
161
165
  return fitChartTableColumns<EventColumn>([
162
166
  { id: "date", label: "DATE", width: 11, align: "left" },
@@ -180,6 +184,7 @@ export function buildEventColumns(width: number, unit?: string, variant: "corpor
180
184
  { id: "value", label: "VALUE", width: 11, align: "right" },
181
185
  { id: "detail", label: "DETAIL", width: 9, align: "left", flexGrow: 1 },
182
186
  ];
187
+ if (fund) return fitChartTableColumns(columns.filter((column) => !EARNINGS_COLUMN_IDS.has(column.id)), width, ["detail"]);
183
188
  return fitChartTableColumns(columns, width, ["annualRevenue", "annualEps", "qRevenue", "qEps", "detail"]);
184
189
  }
185
190
 
@@ -444,6 +449,7 @@ export function CorporateActionsView({
444
449
  // Only the statements and the trailing EPS are read, so the rows do not rebuild on price ticks.
445
450
  const { financials: tickerFinancials } = usePaneTicker();
446
451
  const quarterlyStatements = tickerFinancials?.quarterlyStatements;
452
+ const annualStatements = tickerFinancials?.annualStatements;
447
453
  const financialCurrency = tickerFinancials?.financialCurrency;
448
454
  const trailingEps = tickerFinancials?.fundamentals?.eps;
449
455
  const trailingEpsCurrency = tickerFinancials?.fundamentals?.epsCurrency;
@@ -451,15 +457,23 @@ export function CorporateActionsView({
451
457
  const fundamentalsCurrency = tickerFinancials?.fundamentals?.financialCurrency;
452
458
  const marketCapCurrency = tickerFinancials?.fundamentals?.marketCapCurrency;
453
459
  const quoteCurrency = tickerFinancials?.quote?.currency;
460
+ // The listing's type, as `fn EVT` reads it: a fund's events are its distributions, never a feed's EPS rows.
461
+ const quoteType = tickerFinancials?.quote?.instrumentType;
462
+ const metadataType = tickerFinancials?.quoteMetadata?.instrumentType;
454
463
  const financialsData = useMemo<EventFinancials | null>(
455
- () => (quarterlyStatements || financialCurrency || trailingEps != null ? {
464
+ () => (quarterlyStatements || financialCurrency || trailingEps != null || quoteType || metadataType ? {
456
465
  quarterlyStatements: quarterlyStatements ?? [],
466
+ // Their last end names the fiscal quarters (Q1 FY2027), as GUIDE and ERN name them.
467
+ annualStatements: annualStatements ?? [],
457
468
  financialCurrency,
458
469
  fundamentals: { eps: trailingEps, epsCurrency: trailingEpsCurrency, financialCurrency: fundamentalsCurrency, marketCapCurrency, trailingEpsSource },
459
- quote: quoteCurrency ? { currency: quoteCurrency } : null,
470
+ quote: quoteCurrency || quoteType ? { currency: quoteCurrency ?? "", instrumentType: quoteType } : null,
471
+ quoteMetadata: metadataType ? { instrumentType: metadataType } : null,
460
472
  } : null),
461
- [financialCurrency, fundamentalsCurrency, marketCapCurrency, quarterlyStatements, quoteCurrency, trailingEps, trailingEpsCurrency, trailingEpsSource],
473
+ [annualStatements, financialCurrency, fundamentalsCurrency, marketCapCurrency, metadataType, quarterlyStatements, quoteCurrency, quoteType,
474
+ trailingEps, trailingEpsCurrency, trailingEpsSource],
462
475
  );
476
+ const fund = isFundListing(financialsData);
463
477
  const actionsLoader = useCallback((nextSymbol: string, nextExchange: string, forceRefresh: boolean) => {
464
478
  if (!dataProvider?.getCorporateActions) throw new Error("Corporate actions source unavailable");
465
479
  return dataProvider.getCorporateActions(nextSymbol, nextExchange, forceRefresh ? { cacheMode: "refresh" } : undefined);
@@ -478,7 +492,7 @@ export function CorporateActionsView({
478
492
  error: actionsError,
479
493
  reload: reloadActions,
480
494
  } = useTickerRequest<CorporateActionsData>(actionsLoader, symbol, exchange);
481
- const { data: calendarEvent, reload: reloadCalendar } = useTickerRequest(calendarLoader, symbol, exchange);
495
+ const { data: calendarEvent, loading: calendarLoading, error: calendarError, reload: reloadCalendar } = useTickerRequest(calendarLoader, symbol, exchange);
482
496
  // The listing's own day, as `earnings` reads a report date: SIE:XETRA's has passed once Berlin's day has.
483
497
  const today = listingDay(exchange);
484
498
  const actionsData = useMemo(
@@ -509,7 +523,7 @@ export function CorporateActionsView({
509
523
  ((row.qEps != null || row.annualEps != null) && !row.epsCurrency)
510
524
  || ((row.qRevenue != null || row.annualRevenue != null) && !row.revenueCurrency));
511
525
  const currencyMeta = [unit, hasUnstatedCurrency ? "? currency unstated" : null].filter(Boolean).join(" · ");
512
- const columns = useMemo(() => buildEventColumns(width, unit, variant), [width, unit, variant]);
526
+ const columns = useMemo(() => buildEventColumns(width, unit, variant, fund), [width, unit, variant, fund]);
513
527
  const sourceNotice = useMemo(() => (
514
528
  actionsLoading || analystLoading
515
529
  ? null
@@ -518,10 +532,11 @@ export function CorporateActionsView({
518
532
  symbol: symbol ?? "this ticker",
519
533
  actions: actionsData,
520
534
  actionsError,
521
- estimates: analystData,
522
- estimatesError: analystError,
535
+ // A fund has no analyst estimates to miss.
536
+ estimates: fund ? null : analystData,
537
+ estimatesError: fund ? null : analystError,
523
538
  })
524
- ), [actionsData, actionsError, actionsLoading, analystData, analystError, analystLoading, symbol, variant]);
539
+ ), [actionsData, actionsError, actionsLoading, analystData, analystError, analystLoading, fund, symbol, variant]);
525
540
  // Keyed by row id, not by position, so a reload or a shared layout comes
526
541
  // back to the same event.
527
542
  const [selectedKey, setSelectedKey] = usePluginPaneState<string | null>("selectedKey", null);
@@ -542,12 +557,14 @@ export function CorporateActionsView({
542
557
  const rowBackground = useCallback((row: EventRow) => (
543
558
  row.date > today ? futureRowBackground : undefined
544
559
  ), [futureRowBackground, today]);
545
- const loading = actionsLoading || analystLoading;
560
+ const loading = actionsLoading || analystLoading || (calendarLoading && !!recordedActions);
546
561
  const authWall = !loading && !actionsData && !analystData && (isCloudSessionRequired(actionsError) || isCloudSessionRequired(analystError));
547
562
  // Parallel requests fail with the same message ("No ticker selected"), so the
548
563
  // footer must report each distinct reason once.
549
564
  const error = [...new Set([actionsError, analystError].filter((value): value is string => !!value && !isCloudSessionRequired(value)))]
550
565
  .join(" | ") || null;
566
+ const loadError = error ?? (sourceNotice?.failed ? sourceNotice.text : null)
567
+ ?? (recordedActions && !rows.length ? calendarError : null);
551
568
  const reload = useCallback(() => {
552
569
  reloadActions();
553
570
  reloadAnalyst();
@@ -675,7 +692,8 @@ export function CorporateActionsView({
675
692
  usePaneStatusFooter({
676
693
  registrationId: footerPaneId,
677
694
  loading,
678
- error: error ?? (sourceNotice?.failed ? sourceNotice.text : null),
695
+ error: loadError,
696
+ emptyResult: !!actionsData && !rows.length && !sourceNotice,
679
697
  });
680
698
 
681
699
  usePaneNoticeFooter({
@@ -714,6 +732,7 @@ export function CorporateActionsView({
714
732
  columns={columns}
715
733
  items={rows}
716
734
  scrollToIndex={selectedIdx}
735
+ scrollToIndexAlign={variant === "earnings-estimates" ? "start" : undefined}
717
736
  scrollToIndexVersion={rows.length}
718
737
  sortColumnId={null}
719
738
  sortDirection="asc"
@@ -725,9 +744,9 @@ export function CorporateActionsView({
725
744
  ]}
726
745
  selectedTextOverridesCellColor
727
746
  getRowBackgroundColor={rowBackground}
728
- emptyStateTitle={loading
729
- ? (variant === "earnings-estimates" ? "Loading earnings estimates..." : "Loading events...")
730
- : error ?? sourceNotice?.text ?? (variant === "earnings-estimates" ? "No earnings estimates" : "No events")}
747
+ status={{ loading: loading && !rows.length, error: !loading && !rows.length ? loadError : null,
748
+ subject: variant === "earnings-estimates" ? "earnings estimates" : "events" }}
749
+ emptyStateTitle={sourceNotice?.text ?? (variant === "earnings-estimates" ? "No earnings estimates" : "No events")}
731
750
  />
732
751
  );
733
752
  }
@@ -1,3 +1,4 @@
1
+ import { splitShareTerms } from "../../../market-data/split-terms";
1
2
  import type {
2
3
  AnalystEstimateRecord,
3
4
  AnalystResearchData,
@@ -16,11 +17,14 @@ import {
16
17
  } from "../../../utils/format";
17
18
  import { computeTTM } from "../ticker-detail/financials/aggregation";
18
19
  import { classifyInstrumentType } from "../../../tickers/instrument-kind";
19
- import { declaredDividends } from "../../../utils/declared-dividends";
20
+ import { declaredDividendCash, declaredDividends } from "../../../utils/declared-dividends";
21
+ import { fiscalPeriodText, fiscalQuarterInYear, fiscalQuarterText, fiscalYearText } from "../earnings/fiscal-quarter";
22
+ import { fiscalYearEndMonth } from "../../../utils/fiscal-period";
20
23
  import { isReasonCode, readableStatus } from "../../../utils/reason-codes";
21
24
  import { fundamentalsEpsCurrency, SERVED_TRAILING_EPS } from "../../../utils/fundamentals";
22
25
  import { isNotMeaningful, NOT_MEANINGFUL, NOT_MEANINGFUL_TEXT, NOT_MEANINGFUL_TONE, type Rate } from "../../../utils/growth";
23
26
  import {
27
+ ACTUAL_PENDING,
24
28
  earningsDateStatus,
25
29
  earningsDetail,
26
30
  earningsDetailParts,
@@ -29,14 +33,13 @@ import {
29
33
  epsSurprise,
30
34
  inFiscalMonth,
31
35
  isProvisionalActual,
32
- quarterLabel,
33
36
  showsEpsBasis,
34
37
  type EpsBasisName,
35
38
  } from "../shared/earnings-report";
36
39
 
37
40
  export const CORPORATE_ACTION_COVERAGE = "Split-feed factors may include spinoff price adjustments. Merger terms, spinoff distributions, and security conversions are not covered.";
38
41
 
39
- export type EventStatus = "Earnings" | "Q Est" | "FY Est" | "TTM" | "Dividend" | "Factor";
42
+ export type EventStatus = "Earnings" | "Q Est" | "FY Est" | "TTM" | "Dividend" | "Split" | "Factor";
40
43
 
41
44
  export interface EventRow {
42
45
  id: string;
@@ -165,14 +168,17 @@ function buildEstimatePairs(data: AnalystResearchData | null): EstimatePair[] {
165
168
  return [...pairs.values()];
166
169
  }
167
170
 
168
- function formatEstimateDetail(pair: EstimatePair): string {
171
+ function formatEstimateDetail(pair: EstimatePair, relative?: string): string {
169
172
  const analystCounts: string[] = [];
170
173
  if (pair.eps?.analysts != null) analystCounts.push(`${pair.eps.analysts} EPS`);
171
174
  if (pair.revenue?.analysts != null) analystCounts.push(`${pair.revenue.analysts} rev`);
172
- if (analystCounts.length) return `${analystCounts.join(" / ")} analysts`;
173
- return "Consensus";
175
+ const counts = analystCounts.length ? `${analystCounts.join(" / ")} analysts` : "Consensus";
176
+ return relative ? `${relative}, ${counts}` : counts;
174
177
  }
175
178
 
179
+ /** An estimate period the fiscal calendar names: the current or next quarter or year. */
180
+ const NAMED_ESTIMATE_PERIOD = /^(?:cur|next) (?:qtr|yr)$/;
181
+
176
182
  /**
177
183
  * An estimate's growth over its year-ago figure: the source's, except off a year-ago figure at or below zero, where
178
184
  * it is N/M whatever the source worked out (a loss of 0.40 to a profit of 0.10 is no +125%). Undefined where there is none.
@@ -210,14 +216,19 @@ function estimateValue(growth: Rate | undefined): string {
210
216
  * the figure `ticker` prints as EPS (TTM) (the filed quarters' when they give one, see time-series/filed-trailing-eps).
211
217
  */
212
218
  export type EventFinancials = Pick<TickerFinancials, "quarterlyStatements" | "financialCurrency"> & {
219
+ /** The years, whose last end names the fiscal quarters (`Q1 FY2027`) as GUIDE and ERN do. */
220
+ annualStatements?: readonly Pick<FinancialStatement, "date">[];
213
221
  fundamentals?: Pick<NonNullable<TickerFinancials["fundamentals"]>, "eps" | "epsCurrency" | "financialCurrency" | "marketCapCurrency" | "trailingEpsSource"> | null;
214
222
  /** The listing's currency, which says whether an unlabelled EPS can be in the statements' (fundamentalsCurrency), and its type. */
215
223
  quote?: Pick<NonNullable<TickerFinancials["quote"]>, "currency" | "instrumentType"> | null;
216
224
  quoteMetadata?: Pick<NonNullable<TickerFinancials["quoteMetadata"]>, "instrumentType"> | null;
217
225
  };
218
226
 
219
- /** A fund (an ETF, a closed-end fund) reports no earnings: a feed's EPS rows for one are another company's or noise. */
220
- function isFundListing(financials: EventFinancials | null): boolean {
227
+ /**
228
+ * A fund (an ETF, a closed-end fund) reports no earnings: a feed's EPS rows, estimates and statements for one
229
+ * are another company's or noise, so its events are its distributions and splits alone.
230
+ */
231
+ export function isFundListing(financials: EventFinancials | null): boolean {
221
232
  return [financials?.quote?.instrumentType, financials?.quoteMetadata?.instrumentType].some((type) => classifyInstrumentType(type) === "fund");
222
233
  }
223
234
 
@@ -336,6 +347,7 @@ function eventSortRank(status: EventStatus): number {
336
347
  case "Earnings": return 2;
337
348
  case "TTM": return 3;
338
349
  case "Dividend": return 4;
350
+ case "Split":
339
351
  case "Factor": return 5;
340
352
  }
341
353
  }
@@ -350,7 +362,8 @@ function upcomingEarningsDetail(earning: CorporateActionsData["earnings"][number
350
362
  if (earning.epsActual != null || !time) return earningsDetail(earning);
351
363
  const parts = earningsDetailParts(earning);
352
364
  if (parts.length === 0) return `Pending, ${time}`;
353
- const at = earningsDateStatus(parts[0]) ? 1 : 0;
365
+ // The time follows whether the date is announced, or that the report is out with its actual pending.
366
+ const at = earningsDateStatus(parts[0]) || parts[0] === ACTUAL_PENDING ? 1 : 0;
354
367
  return [...parts.slice(0, at), time, ...parts.slice(at)].join(", ");
355
368
  }
356
369
 
@@ -361,12 +374,15 @@ export function buildEventRows(
361
374
  currency: string,
362
375
  ): EventRow[] {
363
376
  const rows: EventRow[] = [];
364
- const quarterlyStatements = sortedQuarterlyStatements(financials);
365
- const earnings = isFundListing(financials) ? [] : data?.earnings ?? [];
377
+ const fund = isFundListing(financials);
378
+ const quarterlyStatements = fund ? [] : sortedQuarterlyStatements(financials);
379
+ const earnings = fund ? [] : data?.earnings ?? [];
366
380
  const ttm = ttmRow(quarterlyStatements, earnings, financials);
367
381
  if (ttm) rows.push(ttm);
368
382
 
369
383
  const earningsIds = earningsRowIds(earnings);
384
+ // Quarters and years by the names GUIDE and ERN give them (Q1 FY2027), where the company's years say when they end.
385
+ const yearEnd = fiscalYearEndMonth(financials?.annualStatements ?? []);
370
386
  // An upcoming report often arrives without a currency; the feed's reported
371
387
  // quarters give it when they all agree on one.
372
388
  const feedCurrencies = new Set(earnings.map((earning) => earning.currency).filter(Boolean));
@@ -390,7 +406,7 @@ export function buildEventRows(
390
406
  dateType: earning.dateType,
391
407
  status: "Earnings",
392
408
  // The fiscal quarter, never the time of day ("After Hours"), which the row keeps as reportTime.
393
- period: statement ? quarterLabel(statement.date) : earning.fiscalPeriod ? quarterLabel(earning.fiscalPeriod) : MISSING_VALUE,
409
+ period: fiscalPeriodText(earning.fiscalPeriod ?? statement?.date, fiscalQuarterInYear(earning.fiscalPeriod ?? statement?.date, yearEnd)),
394
410
  ...(earning.time?.trim() ? { reportTime: earning.time.trim() } : {}),
395
411
  detail: upcomingEarningsDetail(earning),
396
412
  epsCurrency: earning.currency ?? (earning.epsActual == null ? feedCurrency : reportedCurrency),
@@ -422,16 +438,20 @@ export function buildEventRows(
422
438
  }
423
439
 
424
440
  const reportedPeriodEnds = reportedPeriodTimes(earnings, quarterlyStatements);
425
- for (const pair of buildEstimatePairs(estimates)) {
441
+ for (const pair of fund ? [] : buildEstimatePairs(estimates)) {
426
442
  const isFiscal = isFiscalEstimatePeriod(pair.period);
427
443
  if (!isFiscal && isReportedQuarter(pair.date, reportedPeriodEnds)) continue;
428
444
  const growth = estimatePairGrowth(pair);
445
+ const relative = formatPeriod(pair.period);
446
+ const named = !NAMED_ESTIMATE_PERIOD.test(relative) ? null
447
+ : isFiscal ? fiscalYearText(pair.date, yearEnd) : fiscalQuarterText(fiscalQuarterInYear(pair.date, yearEnd));
429
448
  rows.push({
430
449
  id: `estimate:${pair.date}:${pair.period}`,
431
450
  date: pair.date,
432
451
  status: isFiscal ? "FY Est" : "Q Est",
433
- period: formatPeriod(pair.period),
434
- detail: formatEstimateDetail(pair),
452
+ // Named as the company's fiscal calendar names it; which one it is from today ("cur qtr") leads the detail.
453
+ period: named ?? relative,
454
+ detail: formatEstimateDetail(pair, named ? relative : undefined),
435
455
  providerId: estimates?.providerId,
436
456
  fetchedAt: estimates?.fetchedAt,
437
457
  estimateInputs: {
@@ -466,25 +486,29 @@ export function buildEventRows(
466
486
 
467
487
  // Declared and unpaid: its own row at its ex-date, apart from the paid distributions above.
468
488
  for (const dividend of declaredDividends(data)) {
489
+ const cash = declaredDividendCash(dividend, data?.currency ?? currency);
469
490
  rows.push({
470
491
  id: `div-declared:${dividend.exDate}`,
471
492
  date: dividend.exDate,
472
493
  status: "Dividend",
473
494
  period: MISSING_VALUE,
474
495
  // A one-off beside the regular payments says so: "Declared special, payable 2026-11-25".
475
- detail: `Declared${dividend.special ? " special" : ""}${dividend.payDate ? `, payable ${dividend.payDate}` : ""}`,
476
- value: formatDistributionAmount(dividend.amount, data?.currency ?? currency),
496
+ detail: `Declared${dividend.special ? " special" : ""}${cash.estimate ? `, ${cash.estimate}` : ""}${dividend.payDate ? `, payable ${dividend.payDate}` : ""}`,
497
+ value: cash.amount,
477
498
  tone: "positive",
478
499
  });
479
500
  }
480
501
 
481
502
  for (const split of data?.splits ?? []) {
503
+ // A factor of whole share counts is a split, said in its terms (DBS's bonus issue: 11-for-10, 1 new share for
504
+ // every 10 held); any other may be a spinoff's price adjustment, and says no more than that.
505
+ const terms = splitShareTerms(split);
482
506
  rows.push({
483
507
  id: `split:${split.date}:${split.description ?? ""}`,
484
508
  date: split.date,
485
- status: "Factor",
509
+ status: terms ? "Split" : "Factor",
486
510
  period: MISSING_VALUE,
487
- detail: "Split/adjustment",
511
+ detail: terms ?? "Split/adjustment",
488
512
  providerDescription: split.description,
489
513
  adjustmentFactor: split.fromFactor && split.toFactor ? split.toFactor / split.fromFactor : split.ratio,
490
514
  value: split.fromFactor && split.toFactor
@@ -53,6 +53,12 @@ function matchesKind(row: EventRow, kind: string): boolean {
53
53
  return row.status === "Earnings" && row.earningsState === "reported";
54
54
  }
55
55
 
56
+ /** The newest of the sources' read times (ISO instants); null when none says. */
57
+ function newestRead(...times: Array<string | undefined>): string | null {
58
+ const read = times.filter((time): time is string => !!time && Number.isFinite(Date.parse(time)));
59
+ return read.length ? read.reduce((newest, time) => (Date.parse(time) > Date.parse(newest) ? time : newest)) : null;
60
+ }
61
+
56
62
  function projectEarningsEstimatesHeadless(
57
63
  sources: EarningsEstimateSources,
58
64
  args: HeadlessPaneLoadArgs,
@@ -76,13 +82,14 @@ function projectEarningsEstimatesHeadless(
76
82
  });
77
83
  const errors = [...(sources.errors ?? []), ...(notice?.failed ? [notice.text] : [])];
78
84
  const unmatchedReportedPeriods = matching.filter((row) => row.earningsState === "reported" && !row.fiscalPeriodEnd).map((row) => row.date);
79
- if (unmatchedReportedPeriods.length) errors.push(`No statement period identified for ${unmatchedReportedPeriods.length} reported earnings row(s); quarterly revenue is unavailable.`);
80
85
 
81
86
  return {
82
87
  columns: ESTIMATE_COLUMNS,
83
88
  rows,
84
89
  errors: errors.length ? errors : undefined,
85
90
  metadata: {
91
+ // When Gloom Cloud read the figures (the newer of the earnings rows' and the estimates' reads): the export's as_of.
92
+ asOf: newestRead(sources.actions?.fetchedAt, sources.estimates?.fetchedAt),
86
93
  currency: sources.currency,
87
94
  kind,
88
95
  total: matching.length,
@@ -5,7 +5,6 @@ import { TextAttributes } from "../../../ui";
5
5
  import {
6
6
  DataTableView,
7
7
  usePaneStatusFooter,
8
- usePaneNoticeFooter,
9
8
  type DataTableCell,
10
9
  type DataTableColumn,
11
10
  type DataTableKeyEvent,
@@ -183,6 +182,17 @@ interface PeerSnapshot {
183
182
  error?: string;
184
183
  }
185
184
 
185
+ /** What concerns one peer's row, each a sentence: why its figures failed or are old, and why its EV/Sales reads as it does. */
186
+ function relativeRowNotes(row: RelativeRow): string[] {
187
+ return [
188
+ row.error ? `${row.error.replace(/\.$/, "")}.` : null,
189
+ row.quoteStale ? "Its quote is stale." : null,
190
+ row.fundamentalsProvenance?.stale ? `${RELATIVE_VALUATION_STALE_FUNDAMENTALS_NOTICE}.` : null,
191
+ row.evSalesUnavailable ?? null,
192
+ row.evSalesNote ?? null,
193
+ ].filter((note): note is string => !!note);
194
+ }
195
+
186
196
  function peerQuoteKey(symbol: string): string {
187
197
  return buildQuoteKey({ symbol: normalizeSymbol(symbol), exchange: "", instrument: null });
188
198
  }
@@ -342,21 +352,9 @@ export function RelativeValuationPane({ focused, width, height }: PaneProps) {
342
352
  [comparableRows, order],
343
353
  );
344
354
 
345
- const staleSymbols = rows.filter((row) => row.quoteStale).map((row) => row.symbol);
346
- const rowErrors = rows.filter((row) => row.error).map((row) => `${row.symbol}: ${row.error}`);
347
- const status = [error, peerError, ...rowErrors, staleSymbols.length ? `Stale quotes: ${staleSymbols.join(", ")}` : null,
348
- missingFx ? "Market-cap FX unavailable" : null].filter(Boolean).join(" · ") || null;
349
-
350
- usePaneNoticeFooter({
351
- registrationId: "relative-valuation-notices",
352
- notices: [
353
- ...rows.filter((row) => row.fundamentalsProvenance?.stale)
354
- .map((row) => `${row.symbol}: ${RELATIVE_VALUATION_STALE_FUNDAMENTALS_NOTICE}.`),
355
- ...rows.flatMap((row) => row.evSalesUnavailable ? [`${row.symbol}: ${row.evSalesUnavailable}`] : []),
356
- ...rows.flatMap((row) => row.evSalesNote ? [`${row.symbol}: ${row.evSalesNote}`] : []),
357
- ],
358
- focused,
359
- });
355
+ // The footer says what concerns the whole comparison; what concerns one peer is on its row (its symbol
356
+ // in the warning colour) and, for the selected row, under the table (`rowNote`).
357
+ const status = [error, peerError, missingFx ? "Market-cap FX unavailable" : null].filter(Boolean).join(" · ") || null;
360
358
 
361
359
  useClampSelectedIndex(rows.length, selectedIdx, setSelectedIdx);
362
360
 
@@ -387,7 +385,7 @@ export function RelativeValuationPane({ focused, width, height }: PaneProps) {
387
385
  if (row.notMeaningful.forwardPE) return notMeaningfulCell();
388
386
  return { text: `${formatPriceEarnings(row.reportedMultiples.forwardPE)}${row.forwardPEPeriod ? ` ${row.forwardPEPeriod}` : ""}`, color: colors.text };
389
387
  case "evSales":
390
- // A withdrawn EV says so, one at or below zero reads N/M as a P/E over a loss does; the footer says why.
388
+ // A withdrawn EV says so, one at or below zero reads N/M as a P/E over a loss does; the row's note says why.
391
389
  if (row.evSales == null && row.notMeaningful.evSales) return notMeaningfulCell();
392
390
  return row.evSales == null && row.evSalesUnavailable
393
391
  ? { text: "EV n/a", color: colors.textDim }
@@ -437,6 +435,10 @@ export function RelativeValuationPane({ focused, width, height }: PaneProps) {
437
435
  onHeaderClick={handleHeaderClick}
438
436
  getItemKey={(row) => row.symbol}
439
437
  renderCell={renderCell}
438
+ rowNote={(row) => {
439
+ const notes = relativeRowNotes(row);
440
+ return notes.length ? `${canonicalTickerKey(row.symbol)}: ${notes.join(" ")}` : null;
441
+ }}
440
442
  selectedTextOverridesCellColor
441
443
  getExportMetadata={() => sortedRows.flatMap((row) => [
442
444
  [row.symbol, "Quote as of", parseDisplayDate(row.quoteAsOf)?.toISOString() ?? "unavailable", "Stale", String(row.quoteStale ?? "unknown")],
@@ -9,7 +9,7 @@ import {
9
9
  } from "./model";
10
10
 
11
11
  const description =
12
- "Full-text search across earnings call transcripts, news wires, and SEC filings, with saved searches and keyword alerts.";
12
+ "Full-text search across earnings call transcripts, news wires, and SEC filings, with saved searches; free with a Gloom account, alerts on new hits are Pro.";
13
13
 
14
14
  function queryFromOptions(options?: PaneTemplateCreateOptions): string {
15
15
  return (options?.arg ?? options?.values?.query ?? "").trim();
@@ -37,6 +37,8 @@ export const researchSearchPlugin: GloomPlugin = {
37
37
  {
38
38
  id: RESEARCH_SEARCH_PANE_ID,
39
39
  reportFreshness: { status: "not-a-feed", basis: "search results" },
40
+ // Searching needs an account, not a plan: the catalog marks it Sign-in, not Pro.
41
+ reportRequirements: ["Free Gloom sign-in"],
40
42
  name: "Research Search",
41
43
  icon: "RS",
42
44
  shareItem: { open: true },
@@ -1,12 +1,24 @@
1
1
  import { ProWall, SignInWall } from "../cloud/auth-actions";
2
+ import { FLOW_FREE, FLOW_PRO_NOTE } from "../shared/options-pro-copy";
2
3
 
3
4
  /**
4
5
  * Options flow is the one scanner with no delayed tier to fall back to, so a
5
- * refusal is a call to action. Signed-out users need to sign in, not upgrade.
6
+ * refusal is a call to action. Signed out, FLOW still asks for a sign-in
7
+ * first, but says it is Pro: a free account would not stream it. The highs
8
+ * and lows scanner has a delayed tier, so a sign-in is all it asks.
6
9
  */
7
- export function ScannerDeniedState({ reason, placement, width, height }: { reason: string | null; placement: string; width: number; height: number }) {
10
+ export function ScannerDeniedState({ scanner, reason, placement, width, height }: {
11
+ scanner: "flow" | "hilo";
12
+ reason: string | null;
13
+ placement: string;
14
+ width: number;
15
+ height: number;
16
+ }) {
17
+ const flow = scanner === "flow";
8
18
  if (reason === "auth_required") {
9
- return <SignInWall placement={`${placement.replace(/-wall$/, "")}-signin`} width={width} height={height} action="stream the market scanners" />;
19
+ return <SignInWall placement={`${placement.replace(/-wall$/, "")}-signin`} width={width} height={height}
20
+ action={flow ? "stream options flow with Gloom Cloud Pro" : "stream the market scanners"}
21
+ hint={flow ? FLOW_PRO_NOTE : undefined} />;
10
22
  }
11
23
 
12
24
  return (
@@ -14,7 +26,7 @@ export function ScannerDeniedState({ reason, placement, width, height }: { reaso
14
26
  placement={placement}
15
27
  width={width} height={height}
16
28
  title="Options flow is part of Gloom Cloud Pro."
17
- message="Real-time sweeps, blocks and large premium prints across US options exchanges."
29
+ message={`Real-time sweeps, blocks and large premium prints across US options exchanges.${flow ? ` ${FLOW_FREE}` : ""}`}
18
30
  />
19
31
  );
20
32
  }
@@ -367,7 +367,7 @@ function FlowPane({ focused, width, height }: PaneProps) {
367
367
  }, [setCursorSymbol]);
368
368
 
369
369
  if (feed.denied) {
370
- return <ScannerDeniedState reason={feed.deniedReason} placement="flow-wall" width={width} height={height} />;
370
+ return <ScannerDeniedState scanner="flow" reason={feed.deniedReason} placement="flow-wall" width={width} height={height} />;
371
371
  }
372
372
 
373
373
  const queryBar = (
@@ -151,7 +151,7 @@ function HiloPane({ focused, width, height }: PaneProps) {
151
151
  }, []);
152
152
 
153
153
  if (feed.denied) {
154
- return <ScannerDeniedState reason={feed.deniedReason} placement="hilo-wall" width={width} height={height} />;
154
+ return <ScannerDeniedState scanner="hilo" reason={feed.deniedReason} placement="hilo-wall" width={width} height={height} />;
155
155
  }
156
156
 
157
157
  const renderTable = (side: Side, rows: ScannerHiloExtreme[]) => (
@@ -16,10 +16,22 @@ export function renderFilingNotice(message: string) {
16
16
  return <EmptyState title={message} />;
17
17
  }
18
18
 
19
+ /** The most decimals a filed price is read to: Form 4 prices go to four, a weighted average sometimes further. */
20
+ const FILED_PRICE_DIGITS = 6;
21
+
22
+ /**
23
+ * A price as the form filed it, never fewer than cents: $219.7219 where the
24
+ * filer wrote 219.7219, $212.17, $0.00. Rounded to cents, a weighted average
25
+ * would no longer add up to the form's own total.
26
+ */
27
+ function formatFiledPrice(value: number): string {
28
+ return formatCurrency(value, "USD", FILED_PRICE_DIGITS);
29
+ }
30
+
19
31
  export function buildInsiderTransactionTitle(transaction: InsiderTransaction): string {
20
32
  const type = transactionTypeLabel(transaction.transactionType);
21
33
  const price = transaction.pricePerShare != null
22
- ? ` @ ${formatCurrency(transaction.pricePerShare)}`
34
+ ? ` @ ${formatFiledPrice(transaction.pricePerShare)}`
23
35
  : "";
24
36
  const value = transaction.totalValue != null
25
37
  ? ` | $${formatCompact(transaction.totalValue)}`
@@ -36,7 +48,7 @@ export function buildInsiderTransactionDetailBody(transaction: InsiderTransactio
36
48
  `Security: ${transaction.securityTitle || MISSING_VALUE}${transaction.isDerivative ? " (derivative)" : ""}`,
37
49
  `Acquired/Disposed: ${transaction.acquiredDisposed === "A" ? "Acquired" : transaction.acquiredDisposed === "D" ? "Disposed" : transaction.acquiredDisposed || MISSING_VALUE}`,
38
50
  `Shares: ${transaction.shares != null ? formatNumber(transaction.shares, Number.isInteger(transaction.shares) ? 0 : 4) : MISSING_VALUE}`,
39
- `Price/Share: ${transaction.pricePerShare != null ? formatCurrency(transaction.pricePerShare) : MISSING_VALUE}`,
51
+ `Price/Share: ${transaction.pricePerShare != null ? formatFiledPrice(transaction.pricePerShare) : MISSING_VALUE}`,
40
52
  `Total Value: ${transaction.totalValue != null ? formatCurrency(transaction.totalValue) : MISSING_VALUE}`,
41
53
  `Shares Owned After: ${transaction.sharesOwned != null ? formatNumber(transaction.sharesOwned, Number.isInteger(transaction.sharesOwned) ? 0 : 4) : MISSING_VALUE}`,
42
54
  `Ownership: ${transaction.ownershipType === "D" ? "Direct" : transaction.ownershipType === "I" ? "Indirect" : transaction.ownershipType || MISSING_VALUE}${transaction.ownershipNature ? ` — ${transaction.ownershipNature}` : ""}`,
@@ -12,6 +12,7 @@ import { hasFundFactsAbroad, US_FUND_FACTS_ONLY } from "../../../utils/sec";
12
12
  import type { SecFilingItem } from "../../../types/data-provider";
13
13
  import type { FundFactsPayload } from "../../../api-client/fund-facts";
14
14
  import { errorMessage } from "../../../utils/errors";
15
+ import { filingStoryNote, loadFilingStories, type FilingStory } from "../insider/filing-stories";
15
16
  import { logFailure } from "../../../utils/log-failure";
16
17
  import { loadSecFilings } from "./client";
17
18
  import { ETF_FILING_FORMS, filterFilingsByForms, fundSeriesFilings, loadShownSecFilings, SEC_FILING_FETCH_LIMIT } from "./forms";
@@ -48,9 +49,42 @@ const hasItems = (rows: readonly HeadlessPaneRow[]) => rows.some((row) => typeof
48
49
  /** A current report's press release exhibit, printed only when some row has one; exports keep it with the filing's link. */
49
50
  const PRESS_RELEASE_COLUMN: HeadlessPaneColumn = { key: "pressReleaseUrl", header: "Press release" };
50
51
 
52
+ /** The stories that report a Form 4, under its row, as INS prints them under its lines; JSON has them as `stories`. */
53
+ const STORIES_NOTE_COLUMN: HeadlessPaneColumn = {
54
+ key: "storiesNote", header: "Stories", underRow: true, format: (value) => typeof value === "string" ? value : "",
55
+ };
56
+
51
57
  function secTextColumns(rows: readonly HeadlessPaneRow[]): HeadlessPaneColumn[] {
52
58
  const columns = hasItems(rows) ? SEC_COLUMNS : SEC_COLUMNS.filter((column) => column.key !== "items");
53
- return rows.some((row) => typeof row.pressReleaseUrl === "string" && row.pressReleaseUrl) ? [...columns, PRESS_RELEASE_COLUMN] : columns;
59
+ const withRelease = rows.some((row) => typeof row.pressReleaseUrl === "string" && row.pressReleaseUrl) ? [...columns, PRESS_RELEASE_COLUMN] : columns;
60
+ return rows.some((row) => typeof row.storiesNote === "string" && row.storiesNote) ? [...withRelease, STORIES_NOTE_COLUMN] : withRelease;
61
+ }
62
+
63
+ const INSIDER_FORM = /^4(?:\/A)?$/i;
64
+
65
+ /**
66
+ * The Form 4 rows with the stories that report them: `stories` on the row, and
67
+ * a note under it that names each (`fn story <id>` opens one). The other rows,
68
+ * and a Form 4 Gloom Cloud could not be asked about, stay as they were, and
69
+ * the report says nothing of it: the stories are a lead, not its data.
70
+ */
71
+ async function withFilingStories(
72
+ rows: HeadlessPaneRow[],
73
+ ctx: HeadlessPaneContext,
74
+ dependencies: SecHeadlessDependencies,
75
+ ): Promise<HeadlessPaneRow[]> {
76
+ const accessions = rows
77
+ .filter((row) => typeof row.form === "string" && INSIDER_FORM.test(row.form.trim()))
78
+ .map((row) => row.accessionNumber)
79
+ .filter((value): value is string => typeof value === "string");
80
+ const load = dependencies.loadFilingStories;
81
+ if (!load || accessions.length === 0) return rows;
82
+ const found = await load(accessions, ctx).catch(logFailure("sec.headless", "Read the stories reporting Form 4s failed", new Map<string, FilingStory[]>()));
83
+ return rows.map((row) => {
84
+ const stories = typeof row.accessionNumber === "string" ? found.get(row.accessionNumber) : undefined;
85
+ if (!stories) return row;
86
+ return { ...row, stories: stories.map((story) => ({ ...story })), ...(stories.length ? { storiesNote: stories.map(filingStoryNote).join("\n") } : {}) };
87
+ });
54
88
  }
55
89
 
56
90
  /**
@@ -74,10 +108,13 @@ export interface SecHeadlessDependencies {
74
108
  args: HeadlessPaneLoadArgs,
75
109
  ctx: HeadlessPaneContext,
76
110
  ): Promise<SecFilingItem[]>;
111
+ /** The stories reporting each Form 4, by accession number (Gloom Cloud's match); none asked when absent. */
112
+ loadFilingStories?(accessions: readonly string[], ctx: HeadlessPaneContext): Promise<Map<string, FilingStory[]>>;
77
113
  }
78
114
 
79
115
  const defaultDependencies: SecHeadlessDependencies = {
80
116
  loadFilings: (symbol, limit, _args, ctx) => loadSecFilings(ctx.marketData, symbol, limit),
117
+ loadFilingStories: (accessions, ctx) => loadFilingStories(accessions, ctx.apiClient),
81
118
  };
82
119
 
83
120
  /**
@@ -140,14 +177,15 @@ export function createSecHeadless(dependencies: SecHeadlessDependencies = defaul
140
177
  // A form filter searches every filing listed for the issuer and keeps the supplements it names; without
141
178
  // one, a bank's pricing supplements and a trust's other funds stay out unless --all, as in `filings`.
142
179
  const { filings, hidden } = await loadShownSecFilings(load, limit, { form: form || null, all: args.options.all === true });
143
- const note = hidden && hiddenFilingsNote(hidden);
144
- const rows = buildSecFilingRows(filings);
180
+ const hiddenNote = hidden && hiddenFilingsNote(hidden);
181
+ const rows = await withFilingStories(buildSecFilingRows(filings), ctx, dependencies);
182
+ const notes = hiddenNote ? [hiddenNote] : [];
145
183
  // A listing abroad whose company files nothing with the SEC says where its exchange publishes its announcements.
146
184
  const page = !form && filings.length === 0 ? listingAnnouncementsPage(symbol) : null;
147
185
  return {
148
186
  rows,
149
187
  textColumns: secTextColumns(rows),
150
- ...(note || filings[0]?.companyFrom ? { notes: [...(note ? [note] : []), ...companyDataNotes(filings[0]?.companyFrom)] } : {}),
188
+ ...(notes.length || filings[0]?.companyFrom ? { notes: [...notes, ...companyDataNotes(filings[0]?.companyFrom)] } : {}),
151
189
  ...(form ? { empty: `No ${form} filings found for ${symbol}.` }
152
190
  : page ? { empty: `${symbol} files no SEC reports. ${page.name}: ${page.url}` } : {}),
153
191
  metadata: {