@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
@@ -5,7 +5,6 @@ import { formatMarketPrice } from "../../../market-data/market/format";
5
5
  import { EXTENDED_PRINT_WORDS } from "../../../market-data/market/change-basis";
6
6
  import { EXTENDED_SESSION_MARKS } from "../../../market-data/market/status";
7
7
  import { formatShortDate } from "../../../utils/datetime-format";
8
- import { formatQuoteAgeWithSource } from "../../../market-data/quotes/time";
9
8
  import { alertListingKey, alertPriceText } from "./price-text";
10
9
  import { parsePublicTickerKey } from "../../../utils/exchanges";
11
10
  import { isRoundTheClockCoin } from "../../../utils/crypto-pair";
@@ -81,7 +80,21 @@ export function formatAlertDistance(alert: AlertRule): string {
81
80
  return `${/[1-9]/.test(fixed) ? (percent > 0 ? "+" : "-") : ""}${fixed}%`;
82
81
  }
83
82
 
84
- /** The Quote cell: the quote's age and feed, or, on the row of an alert that got none, why (a stale quote, or none). */
83
+ /**
84
+ * An instant in a cell, to the minute in UTC as the History tab writes its
85
+ * times under a "(UTC)" heading: `2026-11-20 23:20`.
86
+ */
87
+ export function alertMinuteUtc(time: number | null | undefined): string {
88
+ const iso = isoUtc(time);
89
+ return iso ? iso.slice(0, 16).replace("T", " ") : MISSING_VALUE;
90
+ }
91
+
92
+ /**
93
+ * The Quote cell: when the quote it was checked on is from, to the minute in
94
+ * UTC and marked ◷ when the feed was delayed (◷2026-11-20 23:20), a settled
95
+ * close by its session, or, on the row of an alert that got none, why (a
96
+ * stale quote, or none).
97
+ */
85
98
  export function formatQuoteChecked(alert: AlertRule): string {
86
99
  const basis = alert.metric ? closeBasis(alert.metric) : null;
87
100
  // A settled close reads as the session it is from: Oct 26 close, Oct 23 weekly.
@@ -90,16 +103,29 @@ export function formatQuoteChecked(alert: AlertRule): string {
90
103
  }
91
104
  if (basis) return `on ${basis}`;
92
105
  if (alert.lastCheckError) return /\bstale\b/i.test(alert.lastCheckError) ? "Stale" : "No quote";
93
- if (alert.lastQuoteUpdatedAt) {
94
- return formatQuoteAgeWithSource({
95
- lastUpdated: alert.lastQuoteUpdatedAt,
96
- dataSource: alert.lastQuoteSource,
97
- });
98
- }
106
+ // The quote's own time, never its age: a compliance record reads the instant the level was judged on.
107
+ if (alert.lastQuoteUpdatedAt) return `${alert.lastQuoteSource === "delayed" ? "◷" : ""}${alertMinuteUtc(alert.lastQuoteUpdatedAt)}`;
99
108
  if (alert.lastCheckedAt) return relativeTime(alert.lastCheckedAt);
100
109
  return NOT_CHECKED_YET;
101
110
  }
102
111
 
112
+ /**
113
+ * The detail's Quote line: the quote's own instant to the second with its feed
114
+ * (2026-11-20T23:20:59Z · delayed), or the close a daily rule read
115
+ * (2026-11-20 close); the row's cell otherwise.
116
+ */
117
+ export function quoteAsOfText(alert: AlertRule): string {
118
+ const basis = alert.metric ? closeBasis(alert.metric) : null;
119
+ if (alert.lastCheckError) return formatQuoteChecked(alert);
120
+ if (basis && alert.lastDailyClose) return `${alert.lastDailyClose} ${basis === "weekly close" ? "weekly close" : "close"}`;
121
+ if (!basis && alert.lastQuoteUpdatedAt) {
122
+ const source = alert.lastQuoteSource;
123
+ const feed = source === "live" ? "real-time" : source === "delayed" ? "delayed" : source === "snapshot" ? "snapshot" : null;
124
+ return `${isoUtc(alert.lastQuoteUpdatedAt)}${feed ? ` · ${feed}` : ""}`;
125
+ }
126
+ return formatQuoteChecked(alert);
127
+ }
128
+
103
129
  /** A time as lists and exports give it: ISO 8601 in UTC, to the second (2026-10-27T06:35:12Z); empty for none. */
104
130
  export function isoUtc(value: number | null | undefined): string {
105
131
  return value != null && Number.isFinite(value) && value > 0 ? new Date(value).toISOString().replace(/\.\d{3}Z$/, "Z") : "";
@@ -133,6 +159,39 @@ function readingUnit(alert: AlertRule): string {
133
159
  return alert.lastQuoteCurrency ?? "";
134
160
  }
135
161
 
162
+ /**
163
+ * The currency an alert's readings are in: the listing's for a price, a move
164
+ * or a moving average; none for a multiple, RSI, a ratio of two listings or an
165
+ * RRG quadrant, which carry no currency.
166
+ */
167
+ export function alertReadingCurrency(alert: AlertRule): string | null {
168
+ const unit = readingUnit(alert);
169
+ return unit && unit !== "x" ? unit : null;
170
+ }
171
+
172
+ /**
173
+ * The reading a daily rule is measured against, as the last reading is
174
+ * written: the slow average of an MA crossover or the average a close is held
175
+ * to (`59.73 USD on the 2026-11-20 close`). Empty for a rule judged against a
176
+ * fixed level, and before a check has read one.
177
+ */
178
+ export function alertComparatorReadingText(alert: AlertRule): string {
179
+ const kind = alert.metric?.kind;
180
+ if (kind !== "ma_cross" && kind !== "close_ma") return "";
181
+ const value = alert.lastCheckedTarget;
182
+ if (alert.lastCheckError || value == null || !Number.isFinite(value)) return "";
183
+ const unit = readingUnit(alert);
184
+ const figure = `${value.toFixed(2)}${unit ? ` ${unit}` : ""}`;
185
+ return alert.lastDailyClose ? `${figure} on the ${alert.lastDailyClose} close` : figure;
186
+ }
187
+
188
+ /** The listing a ratio or RRG rule divides by, as it was confirmed (`ACWI:NASDAQ`); empty for any other rule. */
189
+ export function alertBenchmarkListing(alert: Pick<AlertRule, "metric">): string {
190
+ const metric = alert.metric;
191
+ if (metric?.kind !== "rs_ratio" && metric?.kind !== "rrg") return "";
192
+ return metric.benchmarkExchange ? `${metric.benchmark}:${metric.benchmarkExchange}` : metric.benchmark;
193
+ }
194
+
136
195
  /** When the last reading is from: the quote's own time, or the daily close's; null with none. */
137
196
  export function alertReadingAt(alert: AlertRule): number | null {
138
197
  if (alert.lastCheckError || alert.lastCheckedPrice == null) return null;
@@ -17,7 +17,11 @@ import { checkedOnlyWithPro, checksProRules, needsProNote } from "./pro-rules";
17
17
  import { readerTimeZone } from "../../../utils/utc-time";
18
18
  import { eventAlertTarget, type EventAlertRule } from "./events";
19
19
  import {
20
+ alertBenchmarkListing,
21
+ alertComparatorReadingText,
20
22
  alertListing,
23
+ alertMinuteUtc,
24
+ alertReadingCurrency,
21
25
  isoUtc,
22
26
  measureLabel,
23
27
  triggerLabel,
@@ -37,6 +41,7 @@ import { readScheduledRule, scheduledEventName } from "./scheduled";
37
41
  import { readAlertStores } from "./storage";
38
42
  import { MOVE_CHECKS_KEY, readMoveChecks, withMoveChecks } from "./move-checks";
39
43
  import type { AlertRule } from "./types";
44
+ import { alertSessionLabel } from "./session";
40
45
 
41
46
  type AlertsTab = "prices" | "events" | "history";
42
47
 
@@ -64,6 +69,7 @@ const PRICE_COLUMNS: HeadlessPaneColumn[] = [
64
69
  { key: "targetPrice", header: "Target", align: "right", textFormat: (_value, row) => formatAlertTargetPrice(asAlert(row), 14) },
65
70
  { key: "awayPercent", header: "Away", align: "right", format: percent, textFormat: (_value, row) => formatAlertDistance(asAlert(row)) },
66
71
  { key: "condition", header: "Trigger", format: (value, row) => triggerLabel({ ...asAlert(row), condition: value as AlertRule["condition"] }) },
72
+ // The quote's own time to the minute (◷ when delayed), or the close a daily rule read, as the pane's cell says it.
67
73
  { key: "quoteAt", header: "Quote", textFormat: (_value, row) => formatQuoteChecked(asAlert(row)) },
68
74
  { key: "quoteSource", header: "Quote source" },
69
75
  { key: "lastCheckedAt", header: "Checked", format: instant },
@@ -76,18 +82,23 @@ const PRICE_COLUMNS: HeadlessPaneColumn[] = [
76
82
  // A measure's last reading in words, last so the columns before it keep their places: an RRG quadrant with the strength and momentum that place it,
77
83
  // a move with its close, and a price or move read off a pre-market, after-hours or overnight print with that session, as `alerts list` says it.
78
84
  { key: "reading", header: "Reading" },
85
+ { key: "session", header: "Session" },
86
+ // What the reading is measured against, as `alerts list --csv` gives it: a crossover's slow average, a ratio's benchmark listing.
87
+ { key: "comparatorReading", header: "Against" },
88
+ { key: "benchmarkListing", header: "Benchmark" },
79
89
  ];
80
90
  /** The terminal table keeps the pane's columns: the Quote cell already says the quote's age and feed. */
81
91
  const PRICE_TEXT_COLUMNS: HeadlessPaneColumn[] = [
82
- ...PRICE_COLUMNS.filter((column) => !["quoteSource", "lastCheckedAt", "created", "listing", "currency", "reading"].includes(column.key)),
83
- // The day it was made, as the Events table lists its rules.
84
- { key: "createdAt", header: "Since", textFormat: (value) => (typeof value === "number" ? isoUtc(value).slice(0, 10) : "") },
92
+ ...PRICE_COLUMNS.filter((column) => !["quoteSource", "lastCheckedAt", "created", "listing", "currency", "reading", "comparatorReading", "benchmarkListing"]
93
+ .includes(column.key)).map((column) => column.key === "quoteAt" ? { ...column, header: "Quote (UTC)" } : column),
94
+ // When it was made, to the minute, as the pane's Since says it.
95
+ { key: "createdAt", header: "Since (UTC)", textFormat: (value) => (typeof value === "number" ? alertMinuteUtc(value) : "") },
85
96
  ];
86
97
 
87
98
  const EVENT_COLUMNS: HeadlessPaneColumn[] = [
88
99
  { key: "event", header: "Event" },
89
100
  { key: "following", header: "Following" },
90
- { key: "eventDate", header: "Event date", textFormat: (value, row) => text(value) || (row.leadDays == null ? "" : "not known yet") },
101
+ { key: "eventDate", header: "Event date", textFormat: (value, row) => text(value) || (row.kind === "earnings_date" ? "waiting for next date" : row.leadDays == null ? "" : "not known yet") },
91
102
  // A results alert waits for the report instead of a lead time.
92
103
  { key: "leadDays", header: "Days before", align: "right", textFormat: (value, row) => (row.when === "results" ? "results" : value == null ? MISSING_VALUE : String(value)) },
93
104
  { key: "state", header: "State" },
@@ -124,17 +135,21 @@ function priceRow(alert: AlertRule): HeadlessPaneRow {
124
135
  const session = readingSessionWords(alert);
125
136
  return {
126
137
  ...stored,
138
+ session: alertSessionLabel(alert),
127
139
  awayPercent: away != null && Number.isFinite(away) ? Number(away.toFixed(2)) : null,
128
140
  quoteAt: quoted ? firedAlertTime(alert.lastQuoteUpdatedAt) : null,
129
141
  quoteSource: quoted ? alert.metric && closeBasis(alert.metric) || quoteSourceWords(alert.lastQuoteSource) : null,
130
142
  created: isoUtc(alert.createdAt) || null,
131
143
  listing: alertListing(alert),
132
- currency: alert.lastQuoteCurrency ?? null,
144
+ // The currency its readings are in: none for a ratio, RSI or a multiple.
145
+ currency: alertReadingCurrency(alert),
133
146
  reading: alert.metric && price != null && Number.isFinite(price) && Number.isFinite(target) ? metricReadingText(alert.metric, { value: price, target })
134
147
  // A move, with the session of the print it was read off and the close it is measured from, as `alerts list` words it.
135
148
  : alert.move && price != null && Number.isFinite(price) ? `${movePercentText(price)}${session} ${moveBasisText(alert.lastMoveBasis)}`
136
149
  // A price read off a pre-market, after-hours or overnight print says so, as `alerts list` does: 508.17 after hours.
137
150
  : session && price != null && Number.isFinite(price) ? `${alertPriceText(alert, price)}${session}` : null,
151
+ comparatorReading: alertComparatorReadingText(alert) || null,
152
+ benchmarkListing: alertBenchmarkListing(alert) || null,
138
153
  };
139
154
  }
140
155
 
@@ -267,11 +282,12 @@ export const alertsHeadless: HeadlessPaneDefinition<"rows"> = {
267
282
  description: "Your alerts: price, valuation and daily technical alerts with current price and distance to target, event alerts (earnings, CPI, FOMC and other economic calendar releases, filings, news, IV levels, market moves) or the alerts that went off, from this app and, signed in, Gloom Cloud.",
268
283
  freshness: { source: "Your alerts", status: "not-a-feed", basis: "your alert rules" },
269
284
  argument: { kind: "none" },
285
+ shotDeviceState: [FIRED_LOG_KEY, MOVE_CHECKS_KEY, IV_LEVEL_CHECKS_KEY].map((key) => ({ pluginId: ALERTS_PLUGIN_ID, key })),
270
286
  options: [{
271
287
  key: "tab",
272
288
  description: "Alerts tab: prices, events or history (alerts that went off; Gloom Cloud's deliveries when signed in).",
273
289
  type: "enum",
274
- values: ALERT_TABS.map(({ value }) => ({ value })),
290
+ values: ALERT_TABS,
275
291
  defaultValue: "prices",
276
292
  example: "--tab events",
277
293
  pluginState: { pluginId: ALERTS_PLUGIN_ID, key: "tab" },
@@ -45,6 +45,7 @@ import {
45
45
  moveWizardFields,
46
46
  parseAlertCommandValues,
47
47
  parseAlertShortcutValues,
48
+ slashSpellsListing,
48
49
  } from "./command";
49
50
  import { ALERTS_PLUGIN_ID, POLL_INTERVAL_MS, POLL_SECONDS_KEY, PRICE_DELIVERY } from "./constants";
50
51
  import { alertHistoryLockNote, alertsHeadless } from "./headless";
@@ -74,6 +75,7 @@ import type { StreamTickRange } from "../../../market-data/quotes/tick-range";
74
75
  import { isPenceQuotedLine, isSharePriceQuote } from "../../../market-data/market/format";
75
76
  import { alertPriceText, alertPriceWithCurrency, alertQuoteTime } from "./price-text";
76
77
  import { judgeMove, moveBasisText, moveFiredText, MOVE_DELIVERY } from "./move";
78
+ import { acceptsAlertSession, alertSessionField } from "./session";
77
79
  import { MOVE_REARM, moveNowText, planMoveAlerts } from "./cli-move";
78
80
  import { alertListing, readingSessionWords } from "./format";
79
81
  import type { AlertRule } from "./types";
@@ -92,16 +94,6 @@ let alertStream: AlertQuoteStream | null = null;
92
94
  */
93
95
  const STREAM_PERSIST_MS = 60_000;
94
96
 
95
- /** BTC/USD, BRK/B and EUR/USD are one listing written with a slash, as `alerts add` reads them; XLK/SPY is not. */
96
- function slashSpellsListing(symbol: string): boolean {
97
- try {
98
- return parseListingArg(symbol).key !== symbol.toUpperCase();
99
- } catch {
100
- // Intentional ignore: text the listing reader refuses is no pair to divide, so the quote's own error stands.
101
- return true;
102
- }
103
- }
104
-
105
97
  export const alertsPlugin: GloomPlugin = {
106
98
  id: ALERTS_PLUGIN_ID,
107
99
  name: "Alerts",
@@ -216,15 +208,19 @@ export const alertsPlugin: GloomPlugin = {
216
208
  let movesTouched = false;
217
209
  for (const alert of alerts) {
218
210
  if (alert.metric || (alert.status !== "active" && !alert.move)) continue;
219
- const quote = readStreamedAlertQuote(alert, undefined, now);
211
+ const latest = readStreamedAlertQuote(alert, undefined, now);
212
+ if (!latest) continue;
213
+ const range = tickRanges.get(buildQuoteKey(alertInstrument(alert)));
214
+ const regular = range?.regular?.latest;
215
+ const quote = acceptsAlertSession(alert, latest) ? latest : regular && (!regular.lastUpdated || regular.lastUpdated >= armingOf(alert))
216
+ ? alertQuoteAtTick({ ...latest, marketState: "REGULAR", overnightPrice: undefined }, regular, now) : null;
220
217
  // A quote older than the one the alert was last checked on is no news of its price.
221
- if (!quote || printedBeforeLastCheck(alert, quote)) continue;
218
+ if (!quote || !acceptsAlertSession(alert, quote) || printedBeforeLastCheck(alert, quote)) continue;
222
219
  // A new or edited alert's first check judges its quote alone: earlier ticks may be from before it. An edited
223
220
  // move rule is one too, though this device's reading of it (a poll's since the edit) comes back with it.
224
221
  const baseline = streamedBaselines.get(alert.id);
225
222
  const sameArming = baseline?.armedAt === armingOf(alert);
226
- const ticks = alert.lastCheckedPrice != null && sameArming
227
- ? tickRanges.get(buildQuoteKey(alertInstrument(alert))) : undefined;
223
+ const ticks = alert.lastCheckedPrice != null && sameArming ? (alert.regularHoursOnly ? range?.regular : range) : undefined;
228
224
  if (alert.move) {
229
225
  const status = alert.status;
230
226
  const atTick = ticks ? movedTick(alert, quote, ticks, now) : null;
@@ -307,7 +303,9 @@ export const alertsPlugin: GloomPlugin = {
307
303
  placeholder: "200.00",
308
304
  type: "text",
309
305
  },
306
+ alertSessionField("price"),
310
307
  ...moveWizardFields,
308
+ alertSessionField("move"),
311
309
  ...metricWizardFields,
312
310
  ],
313
311
  async execute(values) {
@@ -348,7 +346,8 @@ export const alertsPlugin: GloomPlugin = {
348
346
  const now = Date.now();
349
347
  const exchange = resolved.exchange ? canonicalExchange(resolved.exchange) : canonicalExchange(quote.listingExchangeName || quote.exchangeName);
350
348
  const saved = loadJudgedAlerts();
351
- const plan = planMoveAlerts({ kind: "move", symbols: [input.symbol], condition: input.condition, percent: input.price },
349
+ const plan = planMoveAlerts({ kind: "move", symbols: [input.symbol], condition: input.condition, percent: input.price,
350
+ ...input.regularHoursOnly ? { regularHoursOnly: true } : {} },
352
351
  [{ input: input.symbol, listing: { symbol, ...exchange ? { exchange } : {} }, quote }], saved, now);
353
352
  const existing = plan.existing[0]?.alert;
354
353
  if (existing) {
@@ -393,11 +392,14 @@ export const alertsPlugin: GloomPlugin = {
393
392
  const far = farTargetMessage(symbol, input.price, quote.price, named ? null : notTheCoinNote(input.symbol.toUpperCase(), quote) ?? commodityFutureNote(input.symbol, quote), isPenceQuotedLine(quote));
394
393
  if (!input.metric && far) throw new Error(far);
395
394
 
395
+ const eligible = acceptsAlertSession(input, quote);
396
396
  const alert: AlertRule = {
397
397
  ...createAlert(quote.symbol || symbol, input.condition, input.price),
398
- ...(!metric ? quoteAlertFields(quote) : {
399
- metric, exchange: quote.listingExchangeName || quote.exchangeName,
398
+ ...input.regularHoursOnly ? { regularHoursOnly: true } : {},
399
+ ...(!metric && eligible ? quoteAlertFields(quote) : {
400
+ ...(metric ? { metric } : {}), exchange: quote.listingExchangeName || quote.exchangeName,
400
401
  ...quote.currency ? { lastQuoteCurrency: quote.currency } : {},
402
+ ...(!metric && isPenceQuotedLine(quote) ? { lastQuotePence: true } : {}),
401
403
  }),
402
404
  };
403
405
  // A close not yet final is read once it is: the rule is kept and says when it is first judged.
@@ -426,12 +428,12 @@ export const alertsPlugin: GloomPlugin = {
426
428
  alertStream?.sync();
427
429
 
428
430
  // A level the price is already past goes off at the next check, as `alerts add` says.
429
- const met = !input.metric && levelAlreadyMet(alert.condition, quote.price, alert.targetPrice)
431
+ const met = eligible && !input.metric && levelAlreadyMet(alert.condition, quote.price, alert.targetPrice)
430
432
  ? `, already ${alert.condition}, so it goes off at the next check` : "";
431
433
  // What delivers it and what became of the symbol, as `alerts add` says them.
432
434
  ctx.notify({
433
435
  body: [
434
- `Alert set: ${formatAlertDescription(alert)}${input.metric ? firstCheck ? `, ${firstCheck}` : "" : `${isSharePriceQuote(quote) ? " per share" : ""} (current ${alertPriceWithCurrency(alert, quote.price)}${readingSessionWords(alert)} · ${alertQuoteTime(alert.lastQuoteUpdatedAt)}${met})`}.`,
436
+ `Alert set: ${formatAlertDescription(alert)}${input.metric ? firstCheck ? `, ${firstCheck}` : "" : eligible ? `${isSharePriceQuote(quote) ? " per share" : ""} (current ${alertPriceWithCurrency(alert, quote.price)}${readingSessionWords(alert)} · ${alertQuoteTime(alert.lastQuoteUpdatedAt)}${met})` : " (waiting for a regular-hours quote)"}.`,
435
437
  `${PRICE_DELIVERY.charAt(0).toUpperCase()}${PRICE_DELIVERY.slice(1)}.`,
436
438
  ...notes.map((note) => /[.?!]$/.test(note) ? note : `${note}.`),
437
439
  ].join(" "),
@@ -459,9 +461,8 @@ export const alertsPlugin: GloomPlugin = {
459
461
  type: "select",
460
462
  // Earnings first, as the command describes itself: an alert anyone can add for any US listing.
461
463
  defaultValue: "earnings_date",
462
- // Options flow and IV spikes are checked only with Pro, and say so before one is chosen.
463
464
  options: [...RESEARCH_FORM_KINDS.map((value) => ({ value, label: checkedOnlyWithPro({ kind: value }) ? `${RESEARCH_LABELS[value]} (Pro)` : RESEARCH_LABELS[value] })),
464
- ...EVENT_ALERT_TEMPLATES.map((entry) => ({ label: entry.label, value: entry.id }))],
465
+ ...EVENT_ALERT_TEMPLATES.map(({ id, kind, label }) => ({ value: id, label: checkedOnlyWithPro({ kind }) ? `${label} (Pro)` : label }))],
465
466
  },
466
467
  ...EVENT_ALERT_TEMPLATES.filter((entry) => entry.field != null).map((entry) => ({
467
468
  key: entry.id,
@@ -480,7 +481,6 @@ export const alertsPlugin: GloomPlugin = {
480
481
  if (initial.error) throw new Error(initial.error);
481
482
  if (initial.rules.length >= MAX_EVENT_ALERTS)
482
483
  throw new Error("Keep at most 40 event alerts.");
483
- // Earnings and macro events alert before a date: one has to be known, or the rule would never go off.
484
484
  const scheduled = event === "earnings_date" || event === "macro_event";
485
485
  const awaitsResults = event === "earnings_date" && values["earnings_date:when"] === "results";
486
486
  if (scheduled && !awaitsResults && parseLeadDays(values[`${event}:leadDays`]) == null)
@@ -511,8 +511,9 @@ export const alertsPlugin: GloomPlugin = {
511
511
  const lookup = (await lookupScheduledDates([target], scheduledEventSources(ctx.marketData), newYorkToday()))
512
512
  .get(scheduledTargetKey(target));
513
513
  if (!lookup || "error" in lookup) throw new Error(eventDateUnavailableMessage(target, lookup?.error ?? "no answer"));
514
- if (!lookup.date) throw new Error(noUpcomingEventMessage(target));
515
- rule = { ...rule, eventDate: lookup.date };
514
+ if (lookup.date) rule = { ...rule, eventDate: lookup.date };
515
+ else if (target.kind === "earnings") notes.push("Waiting for the next earnings date to be published.");
516
+ else throw new Error(noUpcomingEventMessage(target));
516
517
  }
517
518
  // Read again: the lookup took a while and the rules may have changed meanwhile.
518
519
  const result = scheduled ? readAll() : initial;
@@ -622,7 +623,7 @@ export const alertsPlugin: GloomPlugin = {
622
623
  }
623
624
  // A cached quote older than the alert's last check (one read before the app last closed) is left alone:
624
625
  // judged, it would set the alert off at a price already gone, or wind its baseline back.
625
- if (printedBeforeLastCheck(alert, quote)) continue;
626
+ if (!acceptsAlertSession(alert, quote) || printedBeforeLastCheck(alert, quote)) continue;
626
627
 
627
628
  if (alert.move) {
628
629
  checkMove(alert, quote, Date.now());
@@ -157,6 +157,7 @@ export function moveRuleOnly(alert: AlertRule): AlertRule {
157
157
  ...alert.exchange ? { exchange: alert.exchange } : {},
158
158
  condition: alert.condition,
159
159
  targetPrice: alert.targetPrice,
160
+ ...alert.regularHoursOnly ? { regularHoursOnly: true } : {},
160
161
  createdAt: alert.createdAt,
161
162
  ...alert.armedAt != null ? { armedAt: alert.armedAt } : {},
162
163
  status: "active",
@@ -5,6 +5,7 @@ import { relativeAlertText } from "./metric-command";
5
5
  import { levelAlertStoreKey, readLevelAlertStores } from "./storage";
6
6
  import { Box, type ScrollBoxRenderable } from "../../../ui";
7
7
  import { Button, DetailScrollBody, KeyValueRow, Notice, PaneStatusBody, PaneFooterScope, QueryBar, usePaneTabs } from "../../../components";
8
+ import { alertSessionLabel } from "./session";
8
9
  import { usePluginPaneState, usePluginState } from "../../runtime";
9
10
  import { EventAlertsPane } from "./events-pane";
10
11
  import { AlertHistoryPane } from "./history-pane";
@@ -42,9 +43,11 @@ import {
42
43
  conditionLabel,
43
44
  formatAlertDistance,
44
45
  formatAlertTargetPrice,
46
+ alertMinuteUtc,
45
47
  formatCurrentPrice,
46
48
  formatQuoteChecked,
47
49
  isoUtc,
50
+ quoteAsOfText,
48
51
  listingWithCurrency,
49
52
  measureLabel,
50
53
  relativeTime,
@@ -73,6 +76,7 @@ type AlertColumnId =
73
76
  | "away"
74
77
  | "condition"
75
78
  | "quote"
79
+ | "session"
76
80
  | "triggered"
77
81
  | "created";
78
82
 
@@ -89,11 +93,13 @@ const ALERT_COLUMNS: AlertColumn[] = [
89
93
  { id: "target", label: "Target", width: 10, align: "right" },
90
94
  { id: "away", label: "Away", width: 8, align: "right" },
91
95
  { id: "condition", label: "Trigger", width: 12, align: "left" },
92
- // Wide enough to say "not checked yet" for an alert no check has read.
93
- { id: "quote", label: "Quote", width: 15, align: "left" },
96
+ { id: "session", label: "Session", width: 12, align: "left" },
97
+ // The quote's own time to the minute, as History writes its times (◷2026-11-20 23:20 for a delayed feed), or a
98
+ // settled close by its session; wide enough to say "not checked yet" for an alert no check has read.
99
+ { id: "quote", label: "Quote (UTC)", width: 17, align: "left" },
94
100
  { id: "triggered", label: "Alerted", width: 8, align: "left" },
95
- // The day the alert was made (UTC), as Events lists its rules; the detail gives the instant.
96
- { id: "created", label: "Since", width: 10, align: "left" },
101
+ // When the alert was made, to the minute; the detail gives the second.
102
+ { id: "created", label: "Since (UTC)", width: 16, align: "left" },
97
103
  ];
98
104
 
99
105
  const DETAIL_ROW = { labelWidth: 10, emphasis: false } as const;
@@ -119,6 +125,7 @@ function AlertDetail({ alert, scrollRef }: { alert: AlertRule; scrollRef: RefObj
119
125
  {reason ? <Box paddingBottom={1}><Notice tone="warning">{reason}</Notice></Box> : null}
120
126
  <KeyValueRow {...DETAIL_ROW} label="State" value={alert.status === "triggered" ? "Triggered" : "Active"} tone={alert.status === "triggered" ? "positive" : "muted"} />
121
127
  <KeyValueRow {...DETAIL_ROW} label="Listing" value={listingWithCurrency(alertListing(alert), alert.lastQuoteCurrency)} />
128
+ <KeyValueRow {...DETAIL_ROW} label="Session" value={alertSessionLabel(alert)} />
122
129
  {/* With no quote the reason above says why; the price and its distance wait for one. */}
123
130
  {basis ? <KeyValueRow {...DETAIL_ROW} label="Close date" value={alert.lastDailyClose ?? `Awaiting ${basis}`} /> : null}
124
131
  {reason ? null : <KeyValueRow {...DETAIL_ROW} label={alert.move ? "Move" : "Current"} value={formatCurrentPrice(alert, 24, { words: true })} />}
@@ -132,7 +139,7 @@ function AlertDetail({ alert, scrollRef }: { alert: AlertRule; scrollRef: RefObj
132
139
  {reason || alert.move ? null : <KeyValueRow {...DETAIL_ROW} label="Away" value={formatAlertDistance(alert)} />}
133
140
  {reason
134
141
  ? alert.lastCheckedAt ? <KeyValueRow {...DETAIL_ROW} label="Checked" value={relativeTime(alert.lastCheckedAt)} tone="muted" /> : null
135
- : <KeyValueRow {...DETAIL_ROW} label="Quote" value={formatQuoteChecked(alert)} tone="muted" />}
142
+ : <KeyValueRow {...DETAIL_ROW} label="Quote" value={quoteAsOfText(alert)} tone="muted" />}
136
143
  {alert.triggeredAt ? <KeyValueRow {...DETAIL_ROW} label="Alerted" value={relativeTime(alert.triggeredAt)} /> : null}
137
144
  <KeyValueRow {...DETAIL_ROW} label="Armed" value={relativeTime(alert.armedAt ?? alert.createdAt)} tone="muted" />
138
145
  <KeyValueRow {...DETAIL_ROW} label="Created" value={isoUtc(alert.createdAt)} tone="muted" />
@@ -486,6 +493,8 @@ function PriceAlertsPane({ focused, width, height }: PaneProps) {
486
493
  };
487
494
  case "condition":
488
495
  return { text: triggerLabel(alert) };
496
+ case "session":
497
+ return { text: alertSessionLabel(alert, true) };
489
498
  case "quote":
490
499
  return {
491
500
  text: formatQuoteChecked(alert),
@@ -499,7 +508,7 @@ function PriceAlertsPane({ focused, width, height }: PaneProps) {
499
508
  color: colors.textDim,
500
509
  };
501
510
  case "created":
502
- return { text: isoUtc(alert.createdAt).slice(0, 10), color: colors.textDim };
511
+ return { text: alertMinuteUtc(alert.createdAt), value: isoUtc(alert.createdAt), color: colors.textDim };
503
512
  }
504
513
  }, []);
505
514
 
@@ -7,12 +7,17 @@ import { resolvePlanAccess, type PlanAccessUser } from "../../../api-client/plan
7
7
  import { proAlertFormNote, proAlertFree, proAlertSavedNote, proAlertsFree } from "../shared/options-pro-copy";
8
8
 
9
9
  /**
10
- * The rules Gloom Cloud checks only for an account with Pro, as docs/usage.md marks them: options flow and an
11
- * IV spike. A free account saves them, and nothing checks them; signing in alone does not change that.
10
+ * The rules checked only for an account with Pro. A free account saves them, and signing in alone does not change that.
12
11
  */
13
- const PRO_RULE_NAMES: Readonly<Record<string, string>> = { options_flow: "options flow", iv_spike: "IV spike" };
12
+ const PRO_RULE_NAMES: Readonly<Record<string, string>> = {
13
+ options_flow: "options flow",
14
+ iv_spike: "IV spike",
15
+ catalyst: "catalyst",
16
+ hiring_move: "hiring move",
17
+ perps_threshold: "perpetuals threshold",
18
+ };
14
19
 
15
- /** Whether a rule is checked only for an account with Gloom Cloud Pro (options flow, an IV spike). */
20
+ /** Whether a rule is checked only for an account with Gloom Cloud Pro. */
16
21
  export function checkedOnlyWithPro(rule: { kind: string }): boolean {
17
22
  return Object.hasOwn(PRO_RULE_NAMES, rule.kind);
18
23
  }
@@ -83,6 +83,15 @@ export function alertQuote(quote: Quote, symbol: string): Quote {
83
83
  };
84
84
  }
85
85
 
86
+ export function alertQuoteListingFields(quote: Quote): Pick<AlertRule, "lastQuoteCurrency" | "lastQuoteExchange" | "lastQuotePence"> {
87
+ const exchange = quote.listingExchangeName || quote.exchangeName;
88
+ return {
89
+ ...(quote.currency ? { lastQuoteCurrency: quote.currency } : {}),
90
+ ...(exchange ? { lastQuoteExchange: canonicalExchange(exchange) } : {}),
91
+ lastQuotePence: isPenceQuotedLine(quote) || undefined,
92
+ };
93
+ }
94
+
86
95
  export function quoteAlertFields(
87
96
  quote: Quote,
88
97
  checkedAt = Date.now(),
@@ -98,17 +107,13 @@ export function quoteAlertFields(
98
107
  | "lastQuotePence"
99
108
  | "lastQuoteSession"
100
109
  > & { lastCheckError?: undefined } {
101
- const exchange = quote.listingExchangeName || quote.exchangeName;
102
110
  return {
103
111
  lastCheckedPrice: quote.price,
104
112
  lastCheckedAt: checkedAt,
105
113
  lastQuoteUpdatedAt: quote.lastUpdated,
106
114
  lastQuoteSource: quote.dataSource,
107
115
  lastQuoteProviderId: quote.providerId,
108
- ...(quote.currency ? { lastQuoteCurrency: quote.currency } : {}),
109
- ...(exchange ? { lastQuoteExchange: canonicalExchange(exchange) } : {}),
110
- // A London line in pence writes its levels in pence; a quote that is not clears it.
111
- lastQuotePence: isPenceQuotedLine(quote) || undefined,
116
+ ...alertQuoteListingFields(quote),
112
117
  // An after-hours print says so wherever the reading is shown, as `quote` names it beside Last.
113
118
  lastQuoteSession: extendedPrintSession(quote, quote.price) ?? undefined,
114
119
  lastCheckError: undefined,
@@ -0,0 +1,28 @@
1
+ import type { WizardStep } from "../../../types/plugin";
2
+ import type { Quote } from "../../../types/financials";
3
+ import { isRegularSessionPrint } from "../../../market-data/quotes/tick-range";
4
+ import type { AlertRule } from "./types";
5
+
6
+ const SESSIONS = [
7
+ { value: "extended", label: "Regular and extended" },
8
+ { value: "regular", label: "Regular hours only" },
9
+ ];
10
+
11
+ export function alertSessionField(kind: "price" | "move"): WizardStep {
12
+ return { key: `${kind}:session`, label: "Session", type: "select", defaultValue: "extended", dependsOn: { key: "kind", value: kind }, options: SESSIONS };
13
+ }
14
+
15
+ /**
16
+ * The session an alert's readings come from. A valuation or daily technical
17
+ * rule reads the regular session's price or settled close, never an extended
18
+ * print, so it is regular hours only however it was saved.
19
+ */
20
+ export function alertSessionLabel(rule: Pick<AlertRule, "regularHoursOnly" | "metric">, short = false): string {
21
+ const regular = !!rule.regularHoursOnly || !!rule.metric;
22
+ if (short) return regular ? "Regular only" : "Reg. + ext.";
23
+ return SESSIONS[regular ? 1 : 0]!.label;
24
+ }
25
+
26
+ export function acceptsAlertSession(rule: Pick<AlertRule, "regularHoursOnly">, quote: Pick<Quote, "marketState" | "overnightPrice">): boolean {
27
+ return !rule.regularHoursOnly || isRegularSessionPrint(quote);
28
+ }
@@ -11,6 +11,7 @@ export interface AlertRule {
11
11
  exchange?: string;
12
12
  condition: AlertCondition;
13
13
  targetPrice: number;
14
+ regularHoursOnly?: true;
14
15
  metric?: import("./metric-model").AlertMetric;
15
16
  /**
16
17
  * A move from the previous close rather than a price level: `targetPrice` is
@@ -37,6 +37,7 @@ import { getPortfolioPositionValue } from "./sector-model";
37
37
  import type { AnalyticsMetricRow } from "./view";
38
38
  import { qualifySharpeCadence, qualifyReturnTimestamps, type SharpeCadenceResult, type ReturnTimestampResult, type TimestampHistory } from "./sharpe-cadence";
39
39
  import { isFiniteNumber } from "../../../utils/guards";
40
+ import { displayTickerKey } from "../../../utils/exchanges";
40
41
 
41
42
  export const PORTFOLIO_BENCHMARK = {
42
43
  symbol: "SPY", exchange: "ARCA", currency: "USD", isin: "US78462F1030",
@@ -126,7 +127,7 @@ export function buildPortfolioReturnSeries({
126
127
  let unsupportedReason = syntheticAccountUnsupportedReason(account);
127
128
  const historyIntegrity: PortfolioReturnSeriesResult["historyIntegrity"] = [];
128
129
  for (const { ticker, request } of chartTargets) {
129
- if (!request) unsupportedReason ??= `Broker contract unavailable for ${ticker.metadata.ticker}`;
130
+ if (!request) unsupportedReason ??= `Broker contract unavailable for ${displayTickerKey(ticker.metadata.ticker)}`;
130
131
  unsupportedReason ??= syntheticPositionUnsupportedReason(
131
132
  ticker,
132
133
  financials.get(ticker.metadata.ticker)?.quote?.currency || ticker.metadata.currency || columnContext.baseCurrency,
@@ -5,7 +5,7 @@ import { manualPortfolioValue } from "./manual-value";
5
5
  import type { Portfolio, TickerRecord } from "../../../types/ticker";
6
6
  import { MISSING_VALUE, formatCurrency, formatNumber } from "../../../utils/format";
7
7
  import { resolveCurrencyUnit } from "../../../utils/currency-units";
8
- import { canonicalExchange, isUsEquityExchange } from "../../../utils/exchanges";
8
+ import { canonicalExchange, displayTickerKey, isUsEquityExchange } from "../../../utils/exchanges";
9
9
  import {
10
10
  getPortfolioPositionMetrics,
11
11
  resolvePortfolioMarketValue,
@@ -312,7 +312,7 @@ function thirteenFWeighting(
312
312
  if (!Number.isFinite(value) || value <= 0)
313
313
  return {
314
314
  kind: "current",
315
- reason: `"${portfolio.name}" has no stored 13F weights and ${ticker.metadata.ticker} has no USD cost to rebuild them from, so the rows hold today's weights fixed. Re-import it (portfolio import --13f ${portfolio.importedFrom?.cik ?? "<CIK>"} --replace) for buy-and-hold.`,
315
+ reason: `"${portfolio.name}" has no stored 13F weights and ${displayTickerKey(ticker.metadata.ticker)} has no USD cost to rebuild them from, so the rows hold today's weights fixed. Re-import it (portfolio import --13f ${portfolio.importedFrom?.cik ?? "<CIK>"} --replace) for buy-and-hold.`,
316
316
  };
317
317
  values.set(ticker.metadata.ticker, value);
318
318
  }
@@ -3,7 +3,7 @@ import { fetchAttention } from "./client";
3
3
  import { ATTENTION_TABS, attentionPreviewNote, attentionTab, attentionWindow, attentionRows, emptyAttention, WINDOWS } from "./model";
4
4
  export const attentionHeadless: HeadlessPaneDefinition<"bundle"> = {
5
5
  shape: "bundle", argument: { kind: "free-text", optional: true, placeholder: "TICKER", description: "Optional listing-qualified ticker, such as 6758:JPX." },
6
- options: [{ key: "tab", type: "enum", values: ATTENTION_TABS.map(({ value }) => ({ value })), defaultValue: "ranking", description: "Rankings, abnormal attention, groups, history or evidence." },
6
+ options: [{ key: "tab", type: "enum", values: [...ATTENTION_TABS], defaultValue: "ranking", description: "Rankings, abnormal attention, groups, history or evidence." },
7
7
  { key: "window", type: "enum", values: WINDOWS.map(({ value }) => ({ value })), defaultValue: "now", description: "Latest completed publication hour, UTC day or trailing week." }],
8
8
  discovery: { aliases: ["ATTN"], dataRequirements: ["Privacy-qualified published research counts"],
9
9
  limitations: ["Pro dataset with three-row preview and latest history point.", "Suppressed hours are absent, never zero.", "Counts come from signed-in Gloom users and are not representative of all investors."] },
@@ -20,7 +20,7 @@ export const attentionHeadless: HeadlessPaneDefinition<"bundle"> = {
20
20
  const note = attentionPreviewNote(data, asked, outside);
21
21
  const lock = note ? { errors: [note] } : {};
22
22
  // A board that has published nothing yet says so, whatever the plan.
23
- const empty = data.status === "ready" ? {} : { empty: emptyAttention(data) };
23
+ const empty = data.status === "ready" ? {} : { empty: emptyAttention(data, asked) };
24
24
  const metadata = { asOf: data.asOf, stale: data.stale, complete: data.status === "ready" && !data.truncated,
25
25
  status: data.status, periodStart: data.periodStart, periodEnd: data.periodEnd, entitlement: data.entitlement,
26
26
  privacy: data.privacy, coverage: data.coverage, methodologyUrl: data.methodologyUrl, selectedListing: data.selectedListing ?? null, historyEvidence: data.historyEvidence ?? null, unit: "rounded researcher-hours" };
@@ -45,8 +45,13 @@ export function rowCell(row: AttentionRow, column: string) {
45
45
  if (column === "sharePct") return number(row.sharePct, 1);
46
46
  return typeof value === "number" ? number(value) : typeof value === "string" ? value : MISSING_VALUE;
47
47
  }
48
- export const emptyAttention = (data: AttentionPayload | null | undefined) => data?.status === "disabled"
49
- ? "Research attention collection is not enabled yet." : "Waiting for privacy-qualified research activity.";
48
+ /**
49
+ * What a board that has published nothing says, for a ticker when one was asked: nothing is published for any
50
+ * ticker, so no plan changes the answer.
51
+ */
52
+ export const emptyAttention = (data: AttentionPayload | null | undefined, ticker?: string) => data?.status === "disabled"
53
+ ? "Research attention collection is not enabled yet."
54
+ : ticker ? `No privacy-qualified research activity is published yet, for ${ticker} or any ticker.` : "Waiting for privacy-qualified research activity.";
50
55
 
51
56
  /** How many tickers the free preview lists: the top of the board by research hours. */
52
57
  const PREVIEW_ROWS = 3;
@@ -201,7 +201,8 @@ export function AttentionPane({ width, height, focused }: PaneProps) {
201
201
  {detailMode ? <Box flexGrow={1} flexBasis={0} flexDirection="column">{queryBar}
202
202
  <PaneStatusBody loading={!data ? resource.loading : !detailData && detail.loading} error={!data ? resource.error : !detailData ? detail.error : null}
203
203
  empty={!!data && !!detailData && !selected} subject={!data ? "research attention" : "ticker attention"}
204
- emptyTitle={data?.entitlement === "preview" ? "This ticker is outside the current preview." : "No privacy-qualified hours for this ticker."}>
204
+ emptyTitle={data && data.status !== "ready" ? emptyAttention(data, selectedSymbol || undefined)
205
+ : data?.entitlement === "preview" ? "This ticker is outside the current preview." : "No privacy-qualified hours for this ticker."}>
205
206
  {data && selected ? tab === "history" ? <History row={selected} width={width} height={bodyHeight - 1} focused={focused} preview={data.entitlement === "preview"} />
206
207
  : <Evidence row={selected} data={detailData ?? data} width={width} height={bodyHeight - 1} /> : null}
207
208
  </PaneStatusBody>