gloomberb 0.20.7 → 0.20.8

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 (611) hide show
  1. package/README.ja.md +74 -0
  2. package/README.md +2 -0
  3. package/README.zh-CN.md +2 -0
  4. package/package.json +6 -1
  5. package/src/account/auth-model.ts +22 -0
  6. package/src/api-client/auth.ts +7 -2
  7. package/src/api-client/awards.ts +5 -0
  8. package/src/api-client/bond-trades.ts +22 -0
  9. package/src/api-client/catalysts.ts +11 -1
  10. package/src/api-client/data.ts +30 -6
  11. package/src/api-client/debt-maturities.ts +7 -0
  12. package/src/api-client/equity-screener.ts +17 -0
  13. package/src/api-client/errors.ts +2 -0
  14. package/src/api-client/exchange-announcements.ts +14 -7
  15. package/src/api-client/fund-facts.ts +21 -3
  16. package/src/api-client/futures-curve.ts +14 -1
  17. package/src/api-client/geo.ts +10 -0
  18. package/src/api-client/hiring.ts +2 -0
  19. package/src/api-client/index.ts +3 -0
  20. package/src/api-client/insider-signals.ts +14 -0
  21. package/src/api-client/members.ts +30 -2
  22. package/src/api-client/money-markets.ts +11 -1
  23. package/src/api-client/paths.ts +6 -1
  24. package/src/api-client/perps.ts +2 -0
  25. package/src/api-client/request.ts +2 -1
  26. package/src/api-client/socket.ts +7 -0
  27. package/src/api-client/types/econ.ts +2 -1
  28. package/src/api-client/types/filings-and-calls.ts +6 -0
  29. package/src/api-client/types/market.ts +4 -0
  30. package/src/api-client/web-experiments.ts +5 -6
  31. package/src/app/runtime/update.ts +2 -1
  32. package/src/architecture/floating-promise-allowlist.json +33 -106
  33. package/src/capabilities/asset-data-inputs.ts +183 -0
  34. package/src/capabilities/factories.ts +8 -2
  35. package/src/cli/base-converter.ts +36 -2
  36. package/src/cli/commands/api.ts +2 -2
  37. package/src/cli/commands/command-utils.ts +18 -0
  38. package/src/cli/commands/hong-kong-movers.ts +50 -0
  39. package/src/cli/commands/market.ts +539 -130
  40. package/src/cli/commands/options-chain.ts +7 -1
  41. package/src/cli/commands/overview.ts +74 -14
  42. package/src/cli/commands/plugins.ts +7 -6
  43. package/src/cli/commands/search.ts +52 -9
  44. package/src/cli/commands/system.ts +15 -10
  45. package/src/cli/commands/ticker.ts +97 -44
  46. package/src/cli/content-figures.ts +45 -0
  47. package/src/cli/context.ts +5 -0
  48. package/src/cli/desktop-pane-shot-routes.ts +13 -4
  49. package/src/cli/desktop-pane-shot.ts +86 -12
  50. package/src/cli/earnings-calendar.ts +36 -5
  51. package/src/cli/export-source.ts +17 -3
  52. package/src/cli/fx-pair.ts +111 -11
  53. package/src/cli/glossary.ts +36 -2
  54. package/src/cli/help.ts +1 -1
  55. package/src/cli/history-export.ts +29 -11
  56. package/src/cli/history-rows.ts +130 -21
  57. package/src/cli/index.ts +8 -5
  58. package/src/cli/known-gaps.ts +45 -1
  59. package/src/cli/listing-arg.ts +366 -19
  60. package/src/cli/pane-functions/capabilities.ts +2 -2
  61. package/src/cli/pane-functions/catalog.ts +105 -9
  62. package/src/cli/pane-functions/discovery.ts +2 -0
  63. package/src/cli/pane-functions/dom.ts +46 -9
  64. package/src/cli/pane-functions/freshness.ts +7 -3
  65. package/src/cli/pane-functions/function-help.ts +9 -6
  66. package/src/cli/pane-functions/headless.ts +77 -6
  67. package/src/cli/pane-functions/index.ts +141 -23
  68. package/src/cli/pane-functions/options.ts +1 -3
  69. package/src/cli/pane-functions/plugin-code.ts +169 -0
  70. package/src/cli/pane-functions/report.ts +10 -0
  71. package/src/cli/pane-functions/resolver.ts +69 -21
  72. package/src/cli/pane-functions/screenshot-assessment.ts +82 -3
  73. package/src/cli/pane-functions/screenshot-data-evidence.ts +3 -1
  74. package/src/cli/pane-functions/screenshot-types.ts +6 -0
  75. package/src/cli/quote-answer.ts +49 -2
  76. package/src/cli/registry.ts +42 -4
  77. package/src/cli/report-tables.ts +26 -6
  78. package/src/cli/result.ts +13 -2
  79. package/src/cli/series-search.ts +17 -7
  80. package/src/cli/statement-filings.ts +22 -8
  81. package/src/cli/symbol-args.ts +9 -0
  82. package/src/cli/ticker-resolution.ts +3 -2
  83. package/src/cli/unknown-command.ts +111 -14
  84. package/src/components/chart/composite/format.ts +15 -1
  85. package/src/components/chart/composite/legend.tsx +101 -47
  86. package/src/components/chart/composite/panel-labels.ts +4 -4
  87. package/src/components/chart/composite/panel-surface.tsx +4 -6
  88. package/src/components/chart/composite/scene/build.ts +180 -0
  89. package/src/components/chart/composite/scene/cursor.ts +226 -0
  90. package/src/components/chart/composite/scene/domain.ts +170 -0
  91. package/src/components/chart/composite/scene/markers.ts +115 -0
  92. package/src/components/chart/composite/scene/panels.ts +85 -0
  93. package/src/components/chart/composite/scene/points.ts +169 -0
  94. package/src/components/chart/composite/scene/projection.ts +105 -0
  95. package/src/components/chart/composite/scene/timeline.ts +71 -0
  96. package/src/components/chart/composite/scene.ts +12 -1066
  97. package/src/components/chart/composite/types.ts +4 -2
  98. package/src/components/chart/curve/model.ts +2 -2
  99. package/src/components/chart-table/axis.ts +18 -6
  100. package/src/components/command-bar/layout-items/focused-pane.ts +3 -0
  101. package/src/components/command-bar/list/model.ts +9 -0
  102. package/src/components/command-bar/pane-templates/items.ts +61 -15
  103. package/src/components/command-bar/pane-templates/workflow.ts +16 -5
  104. package/src/components/command-bar/routes/root/plugin-install.ts +7 -46
  105. package/src/components/command-bar/routes/root/provider-search.ts +8 -5
  106. package/src/components/command-bar/routes/root/results.ts +6 -1
  107. package/src/components/command-bar/routes/root/runtime.ts +1 -0
  108. package/src/components/command-bar/routes/root/shortcut-feedback.ts +4 -1
  109. package/src/components/command-bar/routes/ticker-search/actions.ts +7 -5
  110. package/src/components/command-bar/routes/ticker-search/results.ts +51 -3
  111. package/src/components/command-bar/view-model.ts +12 -0
  112. package/src/components/command-bar/workflow/ops.ts +21 -4
  113. package/src/components/command-bar/workflow/ticker-listing-picker.ts +3 -1
  114. package/src/components/command-bar/workflow/tickers.ts +6 -2
  115. package/src/components/data-table/view.tsx +46 -1
  116. package/src/components/form-modal/confirm.tsx +3 -2
  117. package/src/components/form-modal/content.tsx +3 -2
  118. package/src/components/form-modal/field-row.tsx +2 -0
  119. package/src/components/form-modal/host.tsx +18 -3
  120. package/src/components/form-modal/remote-reads.test-helpers.ts +34 -0
  121. package/src/components/index.ts +1 -1
  122. package/src/components/layout/pane/title.ts +21 -5
  123. package/src/components/layout/shell/pane/layers.tsx +20 -14
  124. package/src/components/layout/shell/pane-occlusion.ts +21 -0
  125. package/src/components/onboarding/desks-step.tsx +7 -1
  126. package/src/components/onboarding/onboarding-keyboard.ts +48 -6
  127. package/src/components/onboarding/onboarding-wizard.tsx +47 -8
  128. package/src/components/onboarding/portfolio-step/positions-panel.tsx +17 -3
  129. package/src/components/onboarding/use-onboarding-progress.ts +57 -14
  130. package/src/components/onboarding/wizard-positions.ts +2 -0
  131. package/src/components/paged-rows.ts +11 -5
  132. package/src/components/ticker/list-table-view.tsx +24 -5
  133. package/src/components/toggle-list.tsx +44 -1
  134. package/src/components/ui/data-table/opentui/index.tsx +7 -6
  135. package/src/components/ui/data-table/opentui/model.ts +7 -3
  136. package/src/components/ui/data-table/types.ts +13 -2
  137. package/src/components/ui/fields.tsx +16 -4
  138. package/src/components/ui/query-bar.tsx +43 -9
  139. package/src/components/ui/table-layout.ts +56 -2
  140. package/src/core/app-services.ts +7 -2
  141. package/src/core/connection-health.ts +26 -0
  142. package/src/core/state/app/layout.ts +12 -4
  143. package/src/data/config/layout.ts +3 -1
  144. package/src/data/config/store/node.ts +4 -2
  145. package/src/docs/snapshot.json +756 -216
  146. package/src/i18n/es.ts +4 -1
  147. package/src/i18n/ja.ts +4 -1
  148. package/src/i18n/ko.ts +4 -1
  149. package/src/i18n/zh-cn.ts +4 -1
  150. package/src/i18n/zh-tw.ts +4 -1
  151. package/src/layout/pane-follow.ts +1 -1
  152. package/src/layout/pane-manager/gridlock.ts +18 -5
  153. package/src/layout/pane-manager/index.ts +1 -0
  154. package/src/layout/pane-manager/transient.ts +56 -0
  155. package/src/layout-marketplace/gallery.tsx +2 -1
  156. package/src/layout-marketplace/model.ts +4 -10
  157. package/src/market-data/commodity-names.ts +24 -0
  158. package/src/market-data/connection-follow.ts +9 -7
  159. package/src/market-data/coordinator/auxiliary.ts +4 -3
  160. package/src/market-data/coordinator/entries.ts +22 -1
  161. package/src/market-data/coordinator/financials.ts +2 -3
  162. package/src/market-data/coordinator/index.ts +67 -12
  163. package/src/market-data/coordinator/quotes.ts +2 -3
  164. package/src/market-data/fund-facts.ts +7 -1
  165. package/src/market-data/futures-board.ts +38 -4
  166. package/src/market-data/futures-contract.ts +5 -2
  167. package/src/market-data/fx-closes.ts +4 -1
  168. package/src/market-data/market/bar-period.ts +15 -0
  169. package/src/market-data/market/format.ts +4 -2
  170. package/src/market-data/market/freshness.ts +4 -0
  171. package/src/market-data/market/status.ts +23 -3
  172. package/src/market-data/options-alternatives.ts +21 -9
  173. package/src/market-data/published-futures-sessions.ts +9 -0
  174. package/src/market-data/quotes/balance-sheet-rate.ts +34 -0
  175. package/src/market-data/quotes/delisting.ts +26 -2
  176. package/src/market-data/quotes/freshness.ts +62 -0
  177. package/src/market-data/quotes/listing-enterprise-value.ts +250 -19
  178. package/src/market-data/quotes/regular-session-valuation.ts +8 -0
  179. package/src/market-data/realized-volatility.ts +3 -1
  180. package/src/market-data/request-types.ts +2 -0
  181. package/src/market-data/selectors.ts +1 -0
  182. package/src/news/aggregator.ts +3 -3
  183. package/src/plugins/builtin/account-management/delete-account.ts +78 -0
  184. package/src/plugins/builtin/account-management/pane.tsx +22 -19
  185. package/src/plugins/builtin/account-management/password-dialog.tsx +75 -0
  186. package/src/plugins/builtin/alerts/alert-log.ts +3 -2
  187. package/src/plugins/builtin/alerts/cli-forms.ts +1 -1
  188. package/src/plugins/builtin/alerts/cli.ts +72 -4
  189. package/src/plugins/builtin/alerts/format.ts +8 -2
  190. package/src/plugins/builtin/alerts/index.tsx +8 -5
  191. package/src/plugins/builtin/alerts/pane.tsx +5 -3
  192. package/src/plugins/builtin/alerts/research-builder.ts +12 -0
  193. package/src/plugins/builtin/analytics/index.tsx +3 -3
  194. package/src/plugins/builtin/analytics/risk-client.ts +14 -3
  195. package/src/plugins/builtin/analytics/risk-pane.tsx +3 -3
  196. package/src/plugins/builtin/attention/pane.tsx +1 -1
  197. package/src/plugins/builtin/attention/trending.tsx +1 -1
  198. package/src/plugins/builtin/awards/detail.tsx +4 -1
  199. package/src/plugins/builtin/awards/headless.ts +7 -3
  200. package/src/plugins/builtin/awards/model.ts +11 -0
  201. package/src/plugins/builtin/awards/pane.tsx +12 -5
  202. package/src/plugins/builtin/backtest/client.ts +7 -2
  203. package/src/plugins/builtin/backtest/headless.ts +2 -1
  204. package/src/plugins/builtin/backtest/pane.tsx +4 -2
  205. package/src/plugins/builtin/bond-calculator/pane.tsx +1 -1
  206. package/src/plugins/builtin/broker-manager/sign-in-end.ts +1 -1
  207. package/src/plugins/builtin/broker-trading/orders.tsx +2 -2
  208. package/src/plugins/builtin/buildout/company/pane.tsx +1 -1
  209. package/src/plugins/builtin/buildout/model/index.ts +2 -2
  210. package/src/plugins/builtin/catalysts/headless.ts +9 -6
  211. package/src/plugins/builtin/catalysts/model.ts +72 -10
  212. package/src/plugins/builtin/catalysts/pane.tsx +10 -7
  213. package/src/plugins/builtin/cds/pane.tsx +5 -3
  214. package/src/plugins/builtin/central-bank-rates/pane.tsx +3 -2
  215. package/src/plugins/builtin/chart-composer/catalog-series.ts +59 -0
  216. package/src/plugins/builtin/chart-composer/headless-schema.ts +2 -1
  217. package/src/plugins/builtin/chart-composer/headless.ts +104 -23
  218. package/src/plugins/builtin/chart-composer/index.tsx +6 -3
  219. package/src/plugins/builtin/chart-composer/legend-names.ts +19 -0
  220. package/src/plugins/builtin/chart-composer/pane.tsx +37 -10
  221. package/src/plugins/builtin/chart-composer/presets.ts +63 -6
  222. package/src/plugins/builtin/chart-composer/roll-events.ts +38 -0
  223. package/src/plugins/builtin/chart-composer/series-catalog.ts +12 -5
  224. package/src/plugins/builtin/chart-composer/series-expression.ts +8 -4
  225. package/src/plugins/builtin/chart-composer/series-listings.ts +33 -9
  226. package/src/plugins/builtin/chart-composer/use-series-catalog.ts +2 -2
  227. package/src/plugins/builtin/clinical-trials/client.ts +13 -0
  228. package/src/plugins/builtin/clinical-trials/index.tsx +1 -1
  229. package/src/plugins/builtin/clinical-trials/pane.tsx +77 -27
  230. package/src/plugins/builtin/clinical-trials/search.ts +117 -0
  231. package/src/plugins/builtin/cloud/askg/conversation-store.ts +17 -6
  232. package/src/plugins/builtin/cloud/askg/lock-note.ts +4 -2
  233. package/src/plugins/builtin/cloud/askg/manifest.ts +3 -2
  234. package/src/plugins/builtin/cloud/askg/pane.tsx +2 -2
  235. package/src/plugins/builtin/cloud/askg/sources.ts +3 -3
  236. package/src/plugins/builtin/cloud/one-tap/one-tap-prompt.tsx +7 -3
  237. package/src/plugins/builtin/cloud/team/acm-tab.tsx +1 -1
  238. package/src/plugins/builtin/cloud/team/pane.tsx +17 -10
  239. package/src/plugins/builtin/cloud/team/views.ts +15 -3
  240. package/src/plugins/builtin/cloud/terminal-relay/redact.ts +105 -16
  241. package/src/plugins/builtin/cloud/thesis/board-pane.tsx +17 -2
  242. package/src/plugins/builtin/cloud/thesis/module.tsx +3 -2
  243. package/src/plugins/builtin/cloud/thesis/store.ts +17 -3
  244. package/src/plugins/builtin/commodities-energy/index.tsx +35 -3
  245. package/src/plugins/builtin/commodity-balances/index.tsx +1 -1
  246. package/src/plugins/builtin/company-attention/app-rank.tsx +1 -1
  247. package/src/plugins/builtin/company-attention/building.tsx +1 -1
  248. package/src/plugins/builtin/company-attention/model.ts +2 -1
  249. package/src/plugins/builtin/company-attention/moves.tsx +1 -1
  250. package/src/plugins/builtin/company-attention/pane.tsx +1 -1
  251. package/src/plugins/builtin/company-attention/signals.tsx +1 -1
  252. package/src/plugins/builtin/company-kpis/pane.tsx +1 -1
  253. package/src/plugins/builtin/correlation/headless.ts +7 -5
  254. package/src/plugins/builtin/correlation/history.ts +17 -6
  255. package/src/plugins/builtin/correlation/index.tsx +1 -1
  256. package/src/plugins/builtin/correlation/relationship/history.ts +1 -1
  257. package/src/plugins/builtin/correlation/relationship/pane.tsx +1 -1
  258. package/src/plugins/builtin/cot/headless.ts +10 -3
  259. package/src/plugins/builtin/cot/pane.tsx +2 -2
  260. package/src/plugins/builtin/cpi/pane.tsx +1 -1
  261. package/src/plugins/builtin/credit-boards/model.ts +1 -1
  262. package/src/plugins/builtin/credit-documents/pane.tsx +1 -1
  263. package/src/plugins/builtin/crypto-board/defi-view.tsx +2 -2
  264. package/src/plugins/builtin/crypto-board/defi.ts +9 -3
  265. package/src/plugins/builtin/crypto-board/headless.ts +19 -10
  266. package/src/plugins/builtin/crypto-board/model.ts +8 -0
  267. package/src/plugins/builtin/crypto-board/pane.tsx +11 -5
  268. package/src/plugins/builtin/crypto-board/series.ts +17 -3
  269. package/src/plugins/builtin/crypto-board/supply.ts +26 -3
  270. package/src/plugins/builtin/crypto-etf-flows/headless.ts +3 -2
  271. package/src/plugins/builtin/crypto-etf-flows/model.ts +13 -3
  272. package/src/plugins/builtin/crypto-etf-flows/pane.tsx +6 -3
  273. package/src/plugins/builtin/custom-view/pane.tsx +5 -5
  274. package/src/plugins/builtin/debt-maturities/client.ts +5 -0
  275. package/src/plugins/builtin/debt-maturities/headless.ts +3 -1
  276. package/src/plugins/builtin/debt-maturities/model.ts +1 -0
  277. package/src/plugins/builtin/debt-maturities/pane.tsx +1 -1
  278. package/src/plugins/builtin/dividend-yield/pane.tsx +1 -1
  279. package/src/plugins/builtin/doe/model.ts +1 -1
  280. package/src/plugins/builtin/doe/pane.tsx +1 -1
  281. package/src/plugins/builtin/earnings/board.tsx +2 -2
  282. package/src/plugins/builtin/earnings/history.tsx +1 -1
  283. package/src/plugins/builtin/earnings-calls/calendar.tsx +1 -1
  284. package/src/plugins/builtin/earnings-calls/data.ts +2 -1
  285. package/src/plugins/builtin/earnings-calls/headless.ts +15 -0
  286. package/src/plugins/builtin/earnings-calls/model.ts +68 -8
  287. package/src/plugins/builtin/earnings-calls/pane.tsx +29 -8
  288. package/src/plugins/builtin/earnings-calls/transcript-view.tsx +32 -2
  289. package/src/plugins/builtin/earnings-ripple/pane.tsx +1 -1
  290. package/src/plugins/builtin/econ/calendar-model.ts +94 -2
  291. package/src/plugins/builtin/econ/detail-view.tsx +15 -11
  292. package/src/plugins/builtin/econ/index.tsx +25 -9
  293. package/src/plugins/builtin/econ/types.ts +4 -1
  294. package/src/plugins/builtin/equity-screener/headless.ts +23 -7
  295. package/src/plugins/builtin/equity-screener/index.tsx +3 -0
  296. package/src/plugins/builtin/equity-screener/live.ts +39 -12
  297. package/src/plugins/builtin/equity-screener/model.ts +86 -5
  298. package/src/plugins/builtin/equity-screener/pane.tsx +20 -21
  299. package/src/plugins/builtin/equity-screener/results.ts +12 -3
  300. package/src/plugins/builtin/equity-screener/ticker-check.tsx +2 -2
  301. package/src/plugins/builtin/estimate-revisions/pane.tsx +2 -2
  302. package/src/plugins/builtin/executives/pane.tsx +2 -2
  303. package/src/plugins/builtin/exposure/pane.tsx +1 -1
  304. package/src/plugins/builtin/fear-greed/data.ts +3 -1
  305. package/src/plugins/builtin/fear-greed/headless.ts +8 -2
  306. package/src/plugins/builtin/fear-greed/pane.tsx +8 -4
  307. package/src/plugins/builtin/filing-events/pane.tsx +1 -1
  308. package/src/plugins/builtin/futures/index.tsx +5 -4
  309. package/src/plugins/builtin/futures/model.ts +17 -9
  310. package/src/plugins/builtin/futures/returns.ts +2 -0
  311. package/src/plugins/builtin/futures/series.ts +44 -8
  312. package/src/plugins/builtin/futures/table.tsx +3 -3
  313. package/src/plugins/builtin/futures-curve/client.ts +1 -0
  314. package/src/plugins/builtin/futures-curve/headless.ts +14 -12
  315. package/src/plugins/builtin/futures-curve/index.tsx +7 -4
  316. package/src/plugins/builtin/futures-curve/model.ts +93 -7
  317. package/src/plugins/builtin/futures-curve/pane.tsx +18 -7
  318. package/src/plugins/builtin/fx-matrix/amount.ts +2 -1
  319. package/src/plugins/builtin/fx-matrix/index.tsx +9 -0
  320. package/src/plugins/builtin/gpu/changes.tsx +1 -1
  321. package/src/plugins/builtin/gpu/equities.tsx +1 -1
  322. package/src/plugins/builtin/gpu/pane.tsx +2 -2
  323. package/src/plugins/builtin/help/function-card.tsx +4 -2
  324. package/src/plugins/builtin/help/function-index.ts +12 -6
  325. package/src/plugins/builtin/help/index.tsx +1 -1
  326. package/src/plugins/builtin/holders/beneficial-view.tsx +1 -1
  327. package/src/plugins/builtin/holders/pane.tsx +1 -1
  328. package/src/plugins/builtin/insider/base-values.ts +55 -0
  329. package/src/plugins/builtin/insider/headless.ts +307 -83
  330. package/src/plugins/builtin/insider/index.tsx +65 -23
  331. package/src/plugins/builtin/insider/insiders.tsx +26 -16
  332. package/src/plugins/builtin/insider/model.ts +2 -2
  333. package/src/plugins/builtin/insider/signals-cells.tsx +4 -1
  334. package/src/plugins/builtin/insider/signals-model.ts +13 -5
  335. package/src/plugins/builtin/insider/signals.tsx +5 -3
  336. package/src/plugins/builtin/insider/tickers.tsx +466 -0
  337. package/src/plugins/builtin/ipo-calendar/pane.tsx +1 -1
  338. package/src/plugins/builtin/iv-history/client.ts +35 -4
  339. package/src/plugins/builtin/iv-history/headless.ts +10 -4
  340. package/src/plugins/builtin/iv-history/model.ts +85 -16
  341. package/src/plugins/builtin/iv-history/pane.tsx +2 -2
  342. package/src/plugins/builtin/iv-history/screen-pane.tsx +6 -3
  343. package/src/plugins/builtin/jobs/pane.tsx +5 -5
  344. package/src/plugins/builtin/macro-day/pane.tsx +1 -1
  345. package/src/plugins/builtin/macro-day/release-table.ts +5 -5
  346. package/src/plugins/builtin/macro-day/releases.ts +11 -9
  347. package/src/plugins/builtin/market-movers/headless.ts +6 -2
  348. package/src/plugins/builtin/market-movers/screener.ts +18 -4
  349. package/src/plugins/builtin/members/breadth-pane.tsx +3 -3
  350. package/src/plugins/builtin/members/client.ts +24 -2
  351. package/src/plugins/builtin/members/headless.ts +66 -9
  352. package/src/plugins/builtin/members/index.tsx +7 -6
  353. package/src/plugins/builtin/members/model.ts +89 -5
  354. package/src/plugins/builtin/members/pane.tsx +70 -21
  355. package/src/plugins/builtin/mna/distress/pane.tsx +2 -1
  356. package/src/plugins/builtin/mna/pane.tsx +1 -1
  357. package/src/plugins/builtin/money-markets/client.ts +43 -15
  358. package/src/plugins/builtin/money-markets/headless.ts +18 -11
  359. package/src/plugins/builtin/money-markets/index.tsx +7 -6
  360. package/src/plugins/builtin/money-markets/model.ts +20 -5
  361. package/src/plugins/builtin/money-markets/pane.tsx +28 -17
  362. package/src/plugins/builtin/news/wire/news/footer.ts +11 -1
  363. package/src/plugins/builtin/news/wire/news/table.tsx +15 -5
  364. package/src/plugins/builtin/notes/headless.ts +94 -0
  365. package/src/plugins/builtin/notes/index.tsx +3 -1
  366. package/src/plugins/builtin/notes/store.ts +10 -3
  367. package/src/plugins/builtin/options/footer.ts +8 -2
  368. package/src/plugins/builtin/options/open-interest-as-of.ts +12 -3
  369. package/src/plugins/builtin/options/view.tsx +10 -1
  370. package/src/plugins/builtin/options-calculator/pane.tsx +1 -1
  371. package/src/plugins/builtin/options-positioning/client.ts +35 -8
  372. package/src/plugins/builtin/options-positioning/headless.ts +17 -7
  373. package/src/plugins/builtin/options-positioning/index.tsx +10 -0
  374. package/src/plugins/builtin/options-positioning/pane.tsx +16 -7
  375. package/src/plugins/builtin/options-scenario/csp-screen-pane.tsx +1 -1
  376. package/src/plugins/builtin/options-scenario/pane.tsx +1 -1
  377. package/src/plugins/builtin/pe-band/pane.tsx +2 -2
  378. package/src/plugins/builtin/perps/cascade-tabs.tsx +2 -2
  379. package/src/plugins/builtin/perps/client.ts +54 -15
  380. package/src/plugins/builtin/perps/headless.ts +39 -13
  381. package/src/plugins/builtin/perps/index.tsx +2 -1
  382. package/src/plugins/builtin/perps/model.ts +43 -1
  383. package/src/plugins/builtin/perps/pane.tsx +35 -18
  384. package/src/plugins/builtin/portfolio-list/allocation-rows.ts +74 -0
  385. package/src/plugins/builtin/portfolio-list/cell-version.ts +1 -0
  386. package/src/plugins/builtin/portfolio-list/cli/period-report.ts +7 -3
  387. package/src/plugins/builtin/portfolio-list/cli/portfolio-command.ts +33 -3
  388. package/src/plugins/builtin/portfolio-list/cli/render.ts +149 -24
  389. package/src/plugins/builtin/portfolio-list/headless.ts +30 -9
  390. package/src/plugins/builtin/portfolio-list/income.ts +17 -8
  391. package/src/plugins/builtin/portfolio-list/index.tsx +4 -4
  392. package/src/plugins/builtin/portfolio-list/pane/fx-day-moves.ts +52 -0
  393. package/src/plugins/builtin/portfolio-list/pane/index.tsx +76 -9
  394. package/src/plugins/builtin/portfolio-list/pane/target-weights.tsx +178 -0
  395. package/src/plugins/builtin/portfolio-list/period-pnl.ts +44 -5
  396. package/src/plugins/builtin/portfolio-list/settings.ts +12 -6
  397. package/src/plugins/builtin/portfolio-list/summary/index.tsx +9 -4
  398. package/src/plugins/builtin/portfolio-list/summary/totals.ts +21 -2
  399. package/src/plugins/builtin/portfolio-list/table.tsx +33 -25
  400. package/src/plugins/builtin/power/gas.tsx +2 -2
  401. package/src/plugins/builtin/power/prices.tsx +2 -2
  402. package/src/plugins/builtin/primary-dealers/pane.tsx +10 -11
  403. package/src/plugins/builtin/rate-path/model.ts +9 -0
  404. package/src/plugins/builtin/rate-path/pane.tsx +6 -5
  405. package/src/plugins/builtin/realized-vol/fx-proxy.ts +27 -0
  406. package/src/plugins/builtin/realized-vol/headless.ts +8 -6
  407. package/src/plugins/builtin/realized-vol/pane.tsx +13 -7
  408. package/src/plugins/builtin/relative-rotation/pane.tsx +1 -1
  409. package/src/plugins/builtin/research/analyst-headless.ts +5 -1
  410. package/src/plugins/builtin/research/analyst-model.ts +7 -1
  411. package/src/plugins/builtin/research/analyst-pane.tsx +1 -1
  412. package/src/plugins/builtin/research/relative-valuation-basis.ts +44 -4
  413. package/src/plugins/builtin/research/relative-valuation-headless.ts +59 -14
  414. package/src/plugins/builtin/research/relative-valuation-model.ts +65 -26
  415. package/src/plugins/builtin/research/relative-valuation-pane.tsx +42 -17
  416. package/src/plugins/builtin/revenue-breakdown/pane.tsx +1 -1
  417. package/src/plugins/builtin/reverse-dcf/client.ts +34 -4
  418. package/src/plugins/builtin/reverse-dcf/headless.ts +30 -15
  419. package/src/plugins/builtin/reverse-dcf/model.ts +190 -29
  420. package/src/plugins/builtin/reverse-dcf/pane.tsx +35 -13
  421. package/src/plugins/builtin/risk-factors/pane.tsx +2 -2
  422. package/src/plugins/builtin/roadmap/pane.tsx +2 -2
  423. package/src/plugins/builtin/scanner/flow-pane.tsx +4 -4
  424. package/src/plugins/builtin/scanner/headless.ts +15 -1
  425. package/src/plugins/builtin/seasonality/pane.tsx +1 -1
  426. package/src/plugins/builtin/sec/fund-facts-view.tsx +5 -2
  427. package/src/plugins/builtin/sec/fund-facts.ts +41 -1
  428. package/src/plugins/builtin/sec/headless.ts +8 -4
  429. package/src/plugins/builtin/sec/index.tsx +41 -13
  430. package/src/plugins/builtin/shared/ticker-company.ts +111 -0
  431. package/src/plugins/builtin/shared/use-quote-board.ts +37 -2
  432. package/src/plugins/builtin/shared/volatility/live-session.ts +23 -0
  433. package/src/plugins/builtin/shared/volatility-indices.ts +2 -0
  434. package/src/plugins/builtin/short-interest/publications-pane.tsx +1 -1
  435. package/src/plugins/builtin/short-volume/pane.tsx +1 -1
  436. package/src/plugins/builtin/social-mentions/outliers.tsx +3 -3
  437. package/src/plugins/builtin/social-mentions/pane.tsx +2 -2
  438. package/src/plugins/builtin/supply-chain/graph-pane.tsx +1 -1
  439. package/src/plugins/builtin/supply-chain/pane.tsx +1 -1
  440. package/src/plugins/builtin/themes/pane.tsx +4 -4
  441. package/src/plugins/builtin/thirteenf/api.ts +1 -0
  442. package/src/plugins/builtin/thirteenf/format.ts +5 -0
  443. package/src/plugins/builtin/thirteenf/headless.ts +2 -2
  444. package/src/plugins/builtin/thirteenf/model.ts +128 -5
  445. package/src/plugins/builtin/thirteenf/overlap-pane.tsx +1 -1
  446. package/src/plugins/builtin/thirteenf/report-notes.ts +10 -3
  447. package/src/plugins/builtin/thirteenf/signals-pane.tsx +1 -1
  448. package/src/plugins/builtin/thirteenf/table.ts +2 -2
  449. package/src/plugins/builtin/thirteenf/types.ts +12 -0
  450. package/src/plugins/builtin/ticker-detail/data-panes/historical-prices.tsx +27 -14
  451. package/src/plugins/builtin/ticker-detail/data-panes/returns-history.ts +6 -3
  452. package/src/plugins/builtin/ticker-detail/data-panes/returns-model.ts +14 -0
  453. package/src/plugins/builtin/ticker-detail/data-panes/returns-pane.tsx +4 -1
  454. package/src/plugins/builtin/ticker-detail/financials/aggregation.ts +87 -19
  455. package/src/plugins/builtin/ticker-detail/financials/exchange-results.ts +54 -0
  456. package/src/plugins/builtin/ticker-detail/financials/model.ts +114 -9
  457. package/src/plugins/builtin/ticker-detail/financials/ratios.ts +37 -20
  458. package/src/plugins/builtin/ticker-detail/financials/tab.tsx +42 -19
  459. package/src/plugins/builtin/ticker-detail/headless-schema.ts +3 -2
  460. package/src/plugins/builtin/ticker-detail/headless.ts +90 -31
  461. package/src/plugins/builtin/ticker-detail/overview/model.ts +22 -15
  462. package/src/plugins/builtin/ticker-detail/overview-tab.tsx +5 -2
  463. package/src/plugins/builtin/ticker-detail/quote-monitor/card.tsx +12 -7
  464. package/src/plugins/builtin/ticker-detail/quote-monitor/index.tsx +21 -0
  465. package/src/plugins/builtin/trace-bonds/client.ts +107 -10
  466. package/src/plugins/builtin/trace-bonds/detail.tsx +1 -1
  467. package/src/plugins/builtin/trace-bonds/headless.ts +20 -5
  468. package/src/plugins/builtin/trace-bonds/pane.tsx +15 -4
  469. package/src/plugins/builtin/treasury-auctions/hk-view.tsx +1 -1
  470. package/src/plugins/builtin/treasury-auctions/pane.tsx +1 -1
  471. package/src/plugins/builtin/treasury-daily/pane.tsx +2 -2
  472. package/src/plugins/builtin/vol-surface/charts.tsx +30 -5
  473. package/src/plugins/builtin/vol-surface/client.ts +40 -12
  474. package/src/plugins/builtin/vol-surface/events.ts +213 -0
  475. package/src/plugins/builtin/vol-surface/headless.ts +82 -13
  476. package/src/plugins/builtin/vol-surface/index.tsx +5 -1
  477. package/src/plugins/builtin/vol-surface/model.ts +42 -6
  478. package/src/plugins/builtin/vol-surface/pane.tsx +95 -23
  479. package/src/plugins/builtin/volatility/dvol.ts +14 -2
  480. package/src/plugins/builtin/volatility/headless.ts +3 -2
  481. package/src/plugins/builtin/volatility/index.tsx +1 -1
  482. package/src/plugins/builtin/volatility/pane.tsx +1 -1
  483. package/src/plugins/builtin/volatility/series.ts +7 -3
  484. package/src/plugins/builtin/world-venue-map/activity-series.ts +89 -0
  485. package/src/plugins/builtin/world-venue-map/chokepoint-report.ts +123 -0
  486. package/src/plugins/builtin/world-venue-map/evidence.ts +2 -0
  487. package/src/plugins/builtin/world-venue-map/geo-series.ts +35 -1
  488. package/src/plugins/builtin/world-venue-map/headless.ts +58 -9
  489. package/src/plugins/builtin/world-venue-map/index.ts +6 -3
  490. package/src/plugins/builtin/world-venue-map/layered-pane.tsx +6 -1
  491. package/src/plugins/builtin/world-venue-map/pane.tsx +4 -3
  492. package/src/plugins/builtin/yield-curve/index.tsx +12 -10
  493. package/src/plugins/builtin/yield-curve/swaps.tsx +1 -1
  494. package/src/plugins/extracted-plugins.ts +14 -10
  495. package/src/plugins/installer.ts +17 -1
  496. package/src/plugins/marketplace/feed.ts +14 -0
  497. package/src/plugins/marketplace/install-offer.ts +64 -0
  498. package/src/plugins/registry/contributions.ts +46 -8
  499. package/src/plugins/registry/index.ts +5 -0
  500. package/src/portfolio/collection-name.ts +38 -4
  501. package/src/portfolio/column-values.ts +32 -4
  502. package/src/portfolio/period-pnl.ts +4 -2
  503. package/src/react/async-resource.ts +24 -8
  504. package/src/remote/endpoint.ts +38 -12
  505. package/src/remote/secrets.ts +22 -6
  506. package/src/remote/server.ts +20 -4
  507. package/src/renderers/dom/data-table/index.tsx +2 -1
  508. package/src/renderers/dom/data-table/row.tsx +49 -7
  509. package/src/renderers/dom/desktop/controls.tsx +2 -0
  510. package/src/renderers/dom/desktop/query-bar.tsx +57 -7
  511. package/src/renderers/dom/host/surface-3d.tsx +46 -5
  512. package/src/renderers/dom/styles.css +17 -0
  513. package/src/renderers/electrobun/view/backend-rpc.ts +15 -21
  514. package/src/renderers/electrobun/view/cli-pane-shot-entry.tsx +16 -61
  515. package/src/renderers/electrobun/view/cli-pane-shot-socket.ts +134 -0
  516. package/src/renderers/electrobun/view/host-route.ts +119 -0
  517. package/src/renderers/electrobun/view/rpc-timeout.ts +6 -5
  518. package/src/renderers/opentui/toast-host.tsx +6 -3
  519. package/src/renderers/opentui/ui-host.tsx +29 -5
  520. package/src/series/registry.ts +1 -0
  521. package/src/series/standalone-catalog.ts +40 -0
  522. package/src/series/types.ts +10 -0
  523. package/src/series/validate.ts +5 -0
  524. package/src/shares/portable-layout.ts +2 -7
  525. package/src/sources/gloomberb-cloud/dated-chunks.ts +133 -0
  526. package/src/sources/gloomberb-cloud/index.ts +46 -5
  527. package/src/sources/gloomberb-cloud/news.ts +15 -9
  528. package/src/sources/gloomberb-cloud/normalizers.ts +17 -0
  529. package/src/sources/history-coverage.ts +13 -0
  530. package/src/sources/history-result.ts +1 -0
  531. package/src/sources/provider-errors.ts +9 -0
  532. package/src/sources/provider-router/batches.ts +7 -3
  533. package/src/sources/provider-router/financial-routes.ts +3 -1
  534. package/src/sources/provider-router/history.ts +6 -4
  535. package/src/sources/provider-router/index.ts +5 -1
  536. package/src/sources/provider-router/primary.ts +4 -3
  537. package/src/sources/provider-router/retrieved-at.ts +12 -0
  538. package/src/team/store.ts +17 -4
  539. package/src/telemetry/crash-reports.ts +3 -1
  540. package/src/test-support/cli-context.ts +3 -2
  541. package/src/test-support/test-env.ts +7 -0
  542. package/src/theme/themes.ts +16 -9
  543. package/src/theme/tone-contrast.ts +29 -5
  544. package/src/tickers/company-name-listing.ts +31 -3
  545. package/src/tickers/company-name.ts +9 -0
  546. package/src/tickers/index-roots.ts +56 -4
  547. package/src/tickers/listing-name.ts +7 -2
  548. package/src/tickers/listing-venues.ts +17 -2
  549. package/src/tickers/search/home-listing.ts +2 -0
  550. package/src/tickers/search/index.ts +64 -11
  551. package/src/tickers/search/major-listings.json +595 -592
  552. package/src/tickers/search/ranking.ts +19 -1
  553. package/src/tickers/terminal-codes.ts +5 -3
  554. package/src/time-series/bar-aggregation.ts +3 -2
  555. package/src/time-series/base-series.ts +18 -1
  556. package/src/time-series/chart-data.ts +9 -6
  557. package/src/time-series/chart-seed.ts +11 -3
  558. package/src/time-series/currency-conversion.ts +1 -0
  559. package/src/time-series/date-window.ts +8 -0
  560. package/src/time-series/formula-months.ts +57 -0
  561. package/src/time-series/fundamentals/period-points.ts +3 -3
  562. package/src/time-series/fundamentals/source-statements.ts +5 -4
  563. package/src/time-series/leverage.ts +12 -4
  564. package/src/time-series/live-bars.ts +12 -7
  565. package/src/time-series/live-quotes.ts +6 -2
  566. package/src/time-series/market.ts +10 -3
  567. package/src/time-series/price-comparison.ts +106 -0
  568. package/src/time-series/range.ts +10 -0
  569. package/src/time-series/resolve-context.ts +7 -2
  570. package/src/time-series/resolve.ts +61 -5
  571. package/src/time-series/series-name.ts +2 -2
  572. package/src/time-series/series-presentation.ts +91 -2
  573. package/src/time-series/session-bar.ts +13 -7
  574. package/src/time-series/spec.ts +21 -2
  575. package/src/time-series/studies/formula.ts +262 -36
  576. package/src/time-series/studies/leverage.ts +9 -3
  577. package/src/time-series/studies/resolve.ts +7 -2
  578. package/src/time-series/types.ts +34 -0
  579. package/src/time-series/use-chart-resolution.ts +18 -1
  580. package/src/types/data-provider.ts +7 -0
  581. package/src/types/financials.ts +103 -1
  582. package/src/types/headless.ts +64 -3
  583. package/src/types/instrument.ts +6 -0
  584. package/src/types/plugin-context.ts +9 -0
  585. package/src/types/plugin-pane-templates.ts +6 -0
  586. package/src/types/plugin-panes.ts +7 -0
  587. package/src/types/price-history.ts +6 -0
  588. package/src/ui/host.tsx +3 -1
  589. package/src/ui/index.tsx +7 -2
  590. package/src/utils/cli-output.ts +21 -1
  591. package/src/utils/currency-units.ts +14 -0
  592. package/src/utils/datetime-format.ts +11 -0
  593. package/src/utils/exchange-announcements.ts +26 -3
  594. package/src/utils/exchange-notation.generated.ts +3 -4
  595. package/src/utils/exchange-results.ts +144 -0
  596. package/src/utils/exchanges.ts +10 -0
  597. package/src/utils/financial-statements.ts +212 -22
  598. package/src/utils/fire-and-forget.ts +1 -1
  599. package/src/utils/fiscal-period.ts +41 -3
  600. package/src/utils/format.ts +10 -6
  601. package/src/utils/fundamentals.ts +179 -12
  602. package/src/utils/futures-generic.ts +26 -0
  603. package/src/utils/lease-liabilities.ts +15 -5
  604. package/src/utils/lookup-token.ts +22 -0
  605. package/src/utils/max-drawdown.ts +25 -4
  606. package/src/utils/price-history-integrity.ts +56 -8
  607. package/src/utils/price-history.ts +6 -2
  608. package/src/utils/price-window.ts +38 -2
  609. package/src/utils/replace-file.ts +47 -0
  610. package/src/utils/rpc-timeout-error.ts +16 -2
  611. package/src/utils/untrusted-text.ts +14 -0
@@ -3,12 +3,13 @@ import { ebitdaLacksDepreciation } from "../../utils/ebitda";
3
3
  import { formatShortDate, parseDisplayDate } from "../../utils/datetime-format";
4
4
  import { formatReportedMoney, REPORTING_CURRENCY_NOT_SOURCED } from "../../utils/reported-money";
5
5
  import {
6
- appTtmRate, BANK_ENTERPRISE_VALUE, computedEnterpriseValueNote, convertedPriceEarningsNote, enterpriseValueCheck, enterpriseValueLabel,
6
+ appTtmRate, BANK_ENTERPRISE_VALUE, computedEnterpriseValueNote, convertedPriceEarningsNote, enterpriseValueLabel,
7
7
  enterpriseValueReconciliationNote,
8
- epsConversionNote, fundamentalsCurrency, isBankEnterpriseValue, reportedEnterpriseValue, trailingEpsSourceNote, ttmAtAppRate, ttmConversionNote,
8
+ epsConversionNote, fundamentalsCurrency, isBankEnterpriseValue, reportedEnterpriseValue, trailingEpsFiscalYear, trailingEpsSourceNote, ttmAtAppRate, ttmConversionNote,
9
9
  withBankEnterpriseValue,
10
10
  } from "../../utils/fundamentals";
11
11
  import { latestFinancialPeriod } from "../../utils/latest-financial-period";
12
+ import { halfYearGrowthPeriod } from "../../utils/financial-statements";
12
13
  import { burnsCash, cashRunway, SHORT_RUNWAY_HISTORY, formatRunwayMonths, offeringNote, offeringsAfter, runwayMethod, type CashRunway, type OfferingFiling, type RunwayEstimate } from "../../utils/cash-runway";
13
14
  import { exportedFundamentals, formatPriceEarnings, forwardFiscalYear, NOT_MEANINGFUL, priceEarningsOnEarnings } from "../../utils/price-earnings";
14
15
  import { describeFundamentalMarketCap, marketCapBasisNote, selectMarketCapitalization, viewMarketCapitalization, withheldMarketCap } from "../../utils/market-capitalization";
@@ -21,7 +22,7 @@ import {
21
22
  formatPercentRaw,
22
23
  MISSING_VALUE,
23
24
  } from "../../utils/format";
24
- import { formatMarketCostWithCurrency, formatMarketPriceWithCurrency, formatMarketQuantity, nearParCoinPriceDigits, quoteFormatOptions, withCurrencyMinorDigits, type MarketFormatOptions } from "../../market-data/market/format";
25
+ import { formatMarketCostWithCurrency, formatMarketPriceWithCurrency, formatMarketQuantity, nearParCoinPriceDigits, quoteFormatOptions, withCurrencyMinorDigits, withStablePriceDigits, type MarketFormatOptions } from "../../market-data/market/format";
25
26
  import {
26
27
  cliStyles,
27
28
  cliTerminalWidth,
@@ -50,7 +51,11 @@ import {
50
51
  import { currencyCodeLabel, heldCurrencyUnit } from "../../utils/currency-units";
51
52
  import { quotedFxPair } from "../../utils/currency-pair";
52
53
  import type { AppConfig } from "../../types/config";
54
+ import { cleanFloat32Price, decimalPlaces } from "../../utils/float32-price";
53
55
  import type { CompanyProfile, DeclaredDividendAction, FinancialStatement, Quote, TickerFinancials } from "../../types/financials";
56
+ import { apiClient } from "../../api-client";
57
+ import { withBalanceSheetRate } from "../../market-data/quotes/balance-sheet-rate";
58
+ import { enterpriseValueBridgeNote, listingEnterpriseValue } from "../../market-data/quotes/listing-enterprise-value";
54
59
  import { atRegularSessionPrice, regularSessionValuationPrice } from "../../market-data/quotes/regular-session-valuation";
55
60
  import { computeTickerPriceReturns } from "../../market-data/ticker-price-returns";
56
61
  import { instrumentTypeLabel, resolveTickerInstrumentKind } from "../../tickers/instrument-kind";
@@ -83,8 +88,9 @@ import { ownerNames, rowSummary, rowSummaryTarget } from "../../plugins/builtin/
83
88
  import { fundFactsAbroadKey, hasFundFactsAbroad, isKnownNonUsListing, secFilingItemCodes, US_FUND_FACTS_ONLY } from "../../utils/sec";
84
89
  import { currentReportItemsLabel, hiddenFilingsNote, loadLatestFilings, type HiddenFilings } from "../../utils/sec-filings";
85
90
  import { canonicalExchange, exchangeLabel, isKnownExchangeCode, isUsListingExchange } from "../../utils/exchanges";
91
+ import { exchangeResultsNotes } from "../../utils/exchange-results";
86
92
  import {
87
- coinListingNotes, failIfNotTraded, failMovedSymbol, ListingArgError, listingChoiceNotes, listingFateLoader, listingIdentity, loadBareVenues,
93
+ coinListingNotes, failIfNotTraded, failMovedSymbol, failUnchosenListing, ListingArgError, listingChoiceNotes, listingFateLoader, listingIdentity, loadBareVenues,
88
94
  resolveCliListing, type CliListing, type ListingDataRequest,
89
95
  } from "../listing-arg";
90
96
  import { isUsSymbolVenue, movedAwayChange } from "../../tickers/ticker-changes";
@@ -177,6 +183,23 @@ function appendMetricSection(lines: string[], title: string, metrics: Array<[str
177
183
  * Last and the extended print, or a closed market's last quote with its day (ITA's $202.00 against $208.74
178
184
  * around a $206.65 close is no open book).
179
185
  */
186
+ /**
187
+ * The decimals a 52-week range prints at: the ones its own prices need once
188
+ * read as the float32 they come from (CL=F's 54.97999954 is 54.98), padded to
189
+ * the currency's minor unit and never past the instrument's stable decimals.
190
+ * A JSE line served in cents read 650.5600 at the four decimals cents allow;
191
+ * it reads 650.56, as Last and the day's range do, and a pence line's
192
+ * 25.5377 keeps its four.
193
+ */
194
+ function yearRangeOptions(quote: Quote, options: MarketFormatOptions): MarketFormatOptions {
195
+ if (options.fixedFractionDigits !== undefined) return options;
196
+ const stable = withStablePriceDigits(options, quote.currency, quote);
197
+ if (stable.fixedFractionDigits === undefined) return stable;
198
+ const written = [quote.low52w, quote.high52w].flatMap((price) => price != null && Number.isFinite(price) ? [decimalPlaces(cleanFloat32Price(price))] : []);
199
+ const digits = Math.max(options.minimumFractionDigits ?? 0, ...written);
200
+ return { ...stable, fixedFractionDigits: Math.min(stable.fixedFractionDigits, digits) };
201
+ }
202
+
180
203
  function bidAskText(quote: Quote, options: MarketFormatOptions): string {
181
204
  const text = formatBidAsk(quote.bid, quote.ask, quote.bidSize, quote.askSize, quote.currency, options);
182
205
  const label = text === "—" ? null : quoteBookSessionLabel(quote);
@@ -597,7 +620,7 @@ function consolidatedRangeBasis(quote: Quote): string | null {
597
620
 
598
621
  /** `Reporting currency not sourced for EPS (TTM) and Revenue (TTM).`: the trailing amounts shown bare. */
599
622
  function unsourcedCurrencyNote(metrics: readonly FundamentalsMetric[]): string | undefined {
600
- const bare = metrics.filter((metric) => TRAILING_MONEY_METRICS.has(metric.label) && metric.text !== "—" && !metric.unit)
623
+ const bare = metrics.filter((metric) => TRAILING_MONEY_METRICS.has(metricName(metric.label)) && metric.text !== "—" && !metric.unit)
601
624
  .map((metric) => metric.label);
602
625
  if (bare.length === 0) return undefined;
603
626
  const list = bare.length === 1 ? bare[0]! : `${bare.slice(0, -1).join(", ")} and ${bare.at(-1)}`;
@@ -605,31 +628,32 @@ function unsourcedCurrencyNote(metrics: readonly FundamentalsMetric[]): string |
605
628
  }
606
629
 
607
630
  /**
608
- * The EV line: labelled "(provider)" when it is more than 5% from market cap + debt - cash, "unavailable" when
609
- * withdrawn, N/M at or below zero as a P/E over a loss is.
631
+ * The EV line: the one every view shows (reportedEnterpriseValue, market cap + debt - cash where the provider's is
632
+ * more than 5% from it, with its inputs in a note), "unavailable" when withdrawn, N/M at or below zero as a P/E over
633
+ * a loss is.
610
634
  */
611
635
  function enterpriseValueFigure(figure: MetricFigure, fundamentals: TickerFinancials["fundamentals"]): MetricFigure {
612
636
  // A bank's: its deposits are funding, not debt.
613
637
  if (isBankEnterpriseValue(fundamentals)) return { text: BANK_ENTERPRISE_VALUE, value: "N/M", unit: figure.unit };
614
638
  const label = enterpriseValueLabel(fundamentals);
615
639
  if (label === "not-meaningful") return { ...multipleFigure(NOT_MEANINGFUL), unit: figure.unit };
616
- if (label === "unavailable") return { text: "unavailable", value: null, unit: figure.unit };
617
- return label === "provider" && figure.text !== "—" ? { ...figure, text: `${figure.text} (provider)` } : figure;
640
+ // A withdrawn EV the bridge stands in for shows the bridge (listingEnterpriseView).
641
+ if (label === "unavailable" && typeof figure.value !== "number") return { text: "unavailable", value: null, unit: figure.unit };
642
+ return figure;
618
643
  }
619
644
 
620
645
  /**
621
- * The fundamentals `ticker` reads its one EV from: where the provider's is more than 5% from market cap + debt - cash,
622
- * the computed figure in its place, so the overview gives one number and no reconciliation line (`fundamentals` and
623
- * `valuation` keep both, and JSON keeps the provider's beside its check).
646
+ * The EV `fundamentals`, `valuation`, RV and the reverse DCF read (listingEnterpriseValue), where it is not the one
647
+ * served: the bridge in place of a withdrawn figure, with the note that gives its inputs, or what a bridge lacks.
624
648
  */
625
- function withComputedEnterpriseValue(
626
- fundamentals: TickerFinancials["fundamentals"],
627
- currency: string | undefined,
628
- ): TickerFinancials["fundamentals"] {
629
- const check = enterpriseValueLabel(fundamentals) === "provider" ? enterpriseValueCheck(fundamentals) : undefined;
630
- if (!fundamentals || !check || !(typeof check.computed === "number" && check.computed > 0)
631
- || (currency && check.currency && check.currency !== currency)) return fundamentals;
632
- return { ...fundamentals, enterpriseValue: check.computed, enterpriseValueCheck: undefined };
649
+ function listingEnterpriseView(financials: Parameters<typeof listingEnterpriseValue>[0]): { figure?: MetricFigure; value?: number; currency?: string; note?: string } {
650
+ const listing = listingEnterpriseValue(financials);
651
+ if (listing.kind === "value" && listing.basis === "computed") {
652
+ return { figure: { text: formatReportedMoney(listing.value, listing.currency), value: listing.value, unit: listing.currency },
653
+ value: listing.value, currency: listing.currency, note: enterpriseValueBridgeNote(listing) ?? undefined };
654
+ }
655
+ return listing.kind === "unavailable" && listing.needs
656
+ ? { note: `Market cap + total debt - cash in place of the withdrawn EV needs ${listing.needs}.` } : {};
633
657
  }
634
658
 
635
659
  function percentFigure(fraction: number | null | undefined, format: (value: number) => string): MetricFigure {
@@ -824,10 +848,17 @@ function fundamentalsMetrics(
824
848
  marketCap: MetricFigure,
825
849
  priceReturns: { return1Y?: number | null; return3Y?: number | null },
826
850
  reportingCurrency: string | undefined,
827
- enterpriseValue = reportedMoney(reportedEnterpriseValue(fundamentals), enterpriseValueCurrency(quote, fundamentals)),
851
+ enterpriseValue = reportedMoney(
852
+ reportedEnterpriseValue(fundamentals, enterpriseValueCurrency(quote, fundamentals)),
853
+ enterpriseValueCurrency(quote, fundamentals),
854
+ ),
828
855
  distributions: DividendDistributions | null = null,
829
856
  bond: FundBondFacts | null = null,
830
857
  codes = false,
858
+ /** The fiscal year the trailing EPS is (trailingEpsFiscalYear), named on the EPS and P/E lines in place of TTM. */
859
+ epsYear?: string,
860
+ /** A half-year reporter's latest period growth compares halves, not quarters: "H1 2026 vs H1 2025" (halfYearGrowthPeriod). */
861
+ growthPeriod?: string | null,
831
862
  ): FundamentalsMetric[] {
832
863
  const signed = (value: number) => colorBySign(formatPercent(value), value);
833
864
  const receipt = fundamentals?.sharesOutstanding != null && sharesOutstandingInReceipts(quote, fundamentals, profile?.description);
@@ -835,7 +866,7 @@ function fundamentalsMetrics(
835
866
  { label: "Market Cap", ...marketCap },
836
867
  { label: "Enterprise Value", ...enterpriseValueFigure(enterpriseValue, withBankEnterpriseValue(fundamentals, profile)) },
837
868
  // A multiple over a loss is N/M, even beside a positive one the source served from an older period.
838
- { label: "P/E (TTM)", ...multipleFigure(priceEarningsOnEarnings(fundamentals?.trailingPE, fundamentals?.eps)) },
869
+ { label: epsYear ? `P/E ${epsYear}` : "P/E (TTM)", ...multipleFigure(priceEarningsOnEarnings(fundamentals?.trailingPE, fundamentals?.eps)) },
839
870
  // Next fiscal year's consensus, named by its year: `Forward P/E FY27`.
840
871
  {
841
872
  label: forwardLabel(fundamentals),
@@ -844,7 +875,7 @@ function fundamentalsMetrics(
844
875
  { label: "PEG", ...multipleFigure(fundamentals?.pegRatio) },
845
876
  // EPS (TTM) is the last four filed quarters' (filed-trailing-eps), so its twelve months can end before those of
846
877
  // the flows below, Gloom Cloud's trailing block; Gloom Cloud's EPS standing in is noted (trailingEpsSourceNote).
847
- { label: "EPS (TTM)", ...reportedMoney(fundamentals?.eps, fundamentals?.epsCurrency?.trim() || reportingCurrency, true, codes) },
878
+ { label: epsYear ? `EPS ${epsYear}` : "EPS (TTM)", ...reportedMoney(fundamentals?.eps, fundamentals?.epsCurrency?.trim() || reportingCurrency, true, codes) },
848
879
  {
849
880
  label: dividendYieldLabel(fundamentals?.dividendYieldBasis, bond),
850
881
  ...forwardYieldFigure(fundamentals, distributions, bond),
@@ -858,7 +889,7 @@ function fundamentalsMetrics(
858
889
  { label: "Operating Margin", ...percentFigure(fundamentals?.operatingMargin, formatFractionPercentCell) },
859
890
  { label: "Profit Margin", ...percentFigure(fundamentals?.profitMargin, formatFractionPercentCell) },
860
891
  { label: "Revenue Growth", ...percentFigure(fundamentals?.revenueGrowth, signed) },
861
- { label: "Last Quarter Growth", ...percentFigure(fundamentals?.lastQuarterGrowth, signed) },
892
+ { label: growthPeriod ? `Revenue ${growthPeriod}` : "Last Quarter Growth", ...percentFigure(fundamentals?.lastQuarterGrowth, signed) },
862
893
  { label: "1Y Return", ...percentFigure(priceReturns.return1Y, signed) },
863
894
  { label: "3Y Return", ...percentFigure(priceReturns.return3Y, signed) },
864
895
  {
@@ -913,7 +944,9 @@ function forwardLabel(fundamentals: TickerFinancials["fundamentals"]): string {
913
944
  }
914
945
 
915
946
  /** A line's name without the fiscal year a forward figure names: `Forward P/E FY27` is Forward P/E. */
916
- const metricName = (label: string) => label.replace(/ FY\d{2}$/, "");
947
+ /** A metric's name whatever period its label names: `Forward P/E FY28` is Forward P/E, `EPS FY Mar-26` is EPS (TTM), `Revenue H1 2026 vs H1 2025` the latest period's growth. */
948
+ const metricName = (label: string) => label.replace(/ FY\d{2}$/, "").replace(/^(EPS|P\/E) FY [A-Z][a-z]{2}-\d{2}$/, "$1 (TTM)")
949
+ .replace(/^Revenue H[12] .+ vs H[12] .+$/, "Last Quarter Growth");
917
950
 
918
951
  function withoutStockRows<T extends { label: string }>(metrics: T[], fund: boolean): T[] {
919
952
  return fund ? metrics.filter((metric) => !STOCK_ONLY_METRICS.has(metricName(metric.label))) : metrics;
@@ -932,9 +965,12 @@ const TRAILING_MONEY_METRICS = new Set(["EPS (TTM)", "Revenue (TTM)", "Net Incom
932
965
  * the regular session price (atRegularSessionPrice), the figures the lines show, so each note reads those.
933
966
  */
934
967
  function fundamentalsNotes(
935
- priced: Pick<TickerFinancials, "quote" | "fundamentals">,
968
+ /** With the statements where the report has them: the balance sheet says what a bridge's cash holds. */
969
+ priced: Pick<TickerFinancials, "quote" | "fundamentals"> & Partial<Pick<TickerFinancials, "annualStatements" | "quarterlyStatements">>,
936
970
  metrics: readonly FundamentalsMetric[],
937
971
  quoteCurrency: string | undefined,
972
+ /** The bridge's inputs, or what it lacks, where the EV is not the one served (listingEnterpriseView). */
973
+ listingNote?: string,
938
974
  ): string[] {
939
975
  const fundamentals = priced.fundamentals;
940
976
  const shown = (label: string) => metrics.some((metric) => metric.label === label && metric.text !== "—");
@@ -943,15 +979,18 @@ function fundamentalsNotes(
943
979
  ? marketCapBasisNote(viewMarketCapitalization(priced.quote, fundamentals, regularSessionValuationPrice(priced.quote)))
944
980
  : undefined;
945
981
  const conversion = [...TRAILING_MONEY_METRICS].some(shown) ? ttmConversionNote(fundamentals) : undefined;
946
- const eps = shown("EPS (TTM)") ? epsConversionNote(fundamentals) : undefined;
982
+ const eps = metrics.some((metric) => metricName(metric.label) === "EPS (TTM)" && metric.text !== "—") ? epsConversionNote(fundamentals) : undefined;
947
983
  const epsSource = trailingEpsSourceNote(fundamentals, { eps: shown("EPS (TTM)"), pe: shown("P/E (TTM)") });
948
- const priceEarnings = metrics.some((metric) => metric.label === "P/E (TTM)" && typeof metric.value === "number")
984
+ const priceEarnings = metrics.some((metric) => metricName(metric.label) === "P/E (TTM)" && typeof metric.value === "number")
949
985
  ? convertedPriceEarningsNote(fundamentals, quoteCurrency)
950
986
  : undefined;
951
987
  // Why the EV is labelled, withdrawn or N/M; for an insurer's, what Gloom Cloud computed it from.
952
988
  // A bank's EV line says why it is n/m.
989
+ const bridged = metrics.some((metric) => metric.label === "Enterprise Value" && typeof metric.value === "number")
990
+ && enterpriseValueLabel(fundamentals) === "unavailable";
953
991
  const enterpriseValue = shown("Enterprise Value") && !metrics.some((metric) => metric.text === BANK_ENTERPRISE_VALUE)
954
- ? enterpriseValueReconciliationNote(fundamentals) ?? computedEnterpriseValueNote(fundamentals)
992
+ ? bridged ? listingNote : [enterpriseValueReconciliationNote(fundamentals, enterpriseValueCurrency(priced.quote, fundamentals), priced)
993
+ ?? computedEnterpriseValueNote(fundamentals), listingNote].filter(Boolean).join(" ") || undefined
955
994
  : undefined;
956
995
  // A cap Gloom Cloud withheld says why, as RV and EQS do.
957
996
  const withheld = withheldMarketCap(fundamentals)?.note;
@@ -989,6 +1028,7 @@ function statementFilingsNotes(report: StatementFilingsReport | null | undefined
989
1028
  return [
990
1029
  ...latest ? [`Latest ${report.latestQuarter ? "quarter" : "annual period"} ${statementPeriodText(latest.date, latest)}.`] : [],
991
1030
  ...report.resultsRelease ? [resultsReleaseText(report.resultsRelease)] : [],
1031
+ ...report.exchangeResults ? exchangeResultsNotes(report.exchangeResults) : [],
992
1032
  ];
993
1033
  }
994
1034
 
@@ -1078,7 +1118,8 @@ function fundamentalsReportMetrics(snapshot: FundamentalsReportData, view: "fund
1078
1118
  ? { text: `${formatCompact(capitalization.value)} ${capitalization.currency}`, value: capitalization.value, unit: capitalization.currency }
1079
1119
  : { text: "—" };
1080
1120
  const metrics = withoutStockRows(fundamentalsMetrics(quote, fundamentals, financials.profile, marketCap, computeTickerPriceReturns(financials),
1081
- fundamentalsCurrency(financials), undefined, snapshot.distributions ?? null, snapshot.bondFund ?? null, snapshot.currencyCodes === true),
1121
+ fundamentalsCurrency(financials), listingEnterpriseView(snapshot).figure, snapshot.distributions ?? null, snapshot.bondFund ?? null, snapshot.currencyCodes === true,
1122
+ trailingEpsFiscalYear(financials), halfYearGrowthPeriod(financials)),
1082
1123
  resolveTickerInstrumentKind(null, financials) === "fund");
1083
1124
  if (view === "fundamentals") {
1084
1125
  return [...metrics, ...floatAndShortInterestMetrics(quote, fundamentals, financials.profile)]
@@ -1117,7 +1158,9 @@ export function renderFundamentalsReport(
1117
1158
  const fund = fundFactsNote(symbol, financials.exchange || quote?.exchangeName, financials, null, financials.fundFacts);
1118
1159
  if (lines.length === before) lines.push("", cliStyles.muted([`No ${view} reported for ${financials.symbol}.`, fund].filter(Boolean).join(" ")));
1119
1160
  else if (fund) lines.push(cliStyles.muted(fund));
1120
- for (const note of fundamentalsNotes(atRegularSessionPrice(financials), metrics, quote?.currency)) lines.push(cliStyles.muted(note));
1161
+ for (const note of fundamentalsNotes(atRegularSessionPrice(financials), metrics, quote?.currency, listingEnterpriseView(financials).note)) {
1162
+ lines.push(cliStyles.muted(note));
1163
+ }
1121
1164
  if (view === "fundamentals") {
1122
1165
  if (financials.taxEquivalent) {
1123
1166
  appendMetricSection(lines, "Tax-Equivalent Yield", taxEquivalentLines(financials.taxEquivalent).map((line) => [line.label, line.text]));
@@ -1192,7 +1235,7 @@ export function fundamentalsReportTables(
1192
1235
  notes: [
1193
1236
  ...metrics.length === 0
1194
1237
  ? [`No ${view} reported for ${financials.symbol}.`]
1195
- : fundamentalsNotes(atRegularSessionPrice(financials), metrics, financials.quote?.currency),
1238
+ : fundamentalsNotes(atRegularSessionPrice(financials), metrics, financials.quote?.currency, listingEnterpriseView(financials).note),
1196
1239
  ...fund ? [fund] : [],
1197
1240
  ...view === "fundamentals" ? statementFilingsNotes(financials.statementFilings) : [],
1198
1241
  ...bank?.notes ?? [],
@@ -1371,10 +1414,13 @@ export async function buildTickerReport({
1371
1414
  : "—";
1372
1415
  // Shown in the same currency as the market cap, so the two can be compared.
1373
1416
  const evCurrency = enterpriseValueCurrency(quote, fundamentals);
1374
- const shownFundamentals = withComputedEnterpriseValue(priced.fundamentals, evCurrency);
1375
- const enterpriseValue = reportedEnterpriseValue(shownFundamentals);
1376
- const enterpriseValueText = `${formatReportedMoney(enterpriseValue, evCurrency)}${enterpriseValue != null && evCurrency
1377
- ? await inBase(enterpriseValue, evCurrency) : ""}`;
1417
+ // Not across currencies: a check in another currency than the EV shown describes another figure.
1418
+ // A withdrawn EV gives way to the bridge `fundamentals` shows (listingEnterpriseView).
1419
+ const listingEv = listingEnterpriseView(financials);
1420
+ const enterpriseValue = listingEv.value ?? reportedEnterpriseValue(priced.fundamentals, evCurrency);
1421
+ const enterpriseValueCode = listingEv.currency ?? evCurrency;
1422
+ const enterpriseValueText = `${formatReportedMoney(enterpriseValue, enterpriseValueCode)}${enterpriseValue != null && enterpriseValueCode
1423
+ ? await inBase(enterpriseValue, enterpriseValueCode) : ""}`;
1378
1424
 
1379
1425
  if (quote) {
1380
1426
  // As the Overview reads it: the regular session, then the extended-hours print against its close.
@@ -1406,8 +1452,10 @@ export async function buildTickerReport({
1406
1452
  [quote.delisting ? "Last Session" : "Day Range", quote.low != null || quote.high != null
1407
1453
  ? `${formatPriceRange(quote.low, quote.high, quote.currency, quoteOptions)}${consolidatedRangeBasis(quote) ? ` (${consolidatedRangeBasis(quote)})` : ""}`
1408
1454
  : "—"],
1455
+ // The year's high and low come from bars (a continuous future's are float32, 54.97999954): they print at
1456
+ // the instrument's own decimals, as the Overview's ranges do, never at every digit the bars carry.
1409
1457
  ["52W Range", quote.low52w != null || quote.high52w != null
1410
- ? formatPriceRange(quote.low52w, quote.high52w, quote.currency, quoteOptions)
1458
+ ? formatPriceRange(quote.low52w, quote.high52w, quote.currency, yearRangeOptions(quote, quoteOptions))
1411
1459
  : "—"],
1412
1460
  ["Bid / Ask", bidAskText(quote, quoteOptions)],
1413
1461
  // An index's and a perpetual's 0 means none is counted, not no trades: no Volume row.
@@ -1431,8 +1479,9 @@ export async function buildTickerReport({
1431
1479
 
1432
1480
  // A listing of the last year may have no statements yet: its IPO says how recent it is.
1433
1481
  const listing = { listedSince: ipo ? ipo.deal.listingDate ?? ipo.deal.firstDay?.session ?? null : null };
1434
- const metrics = withoutStockRows(fundamentalsMetrics(quote, shownFundamentals, profile, { text: marketCapText }, priceReturns,
1435
- fundamentalsCurrency(financials, listing), { text: enterpriseValueText }, distributions, bondFund, codes), isFund);
1482
+ const metrics = withoutStockRows(fundamentalsMetrics(quote, priced.fundamentals, profile, { text: marketCapText }, priceReturns,
1483
+ fundamentalsCurrency(financials, listing), { text: enterpriseValueText, ...listingEv.value != null ? { value: listingEv.value } : {} }, distributions, bondFund, codes, trailingEpsFiscalYear(financials),
1484
+ halfYearGrowthPeriod(financials)), isFund);
1436
1485
  const reportedCurrency = financials.financialCurrency?.trim();
1437
1486
  const statements = [...financials.annualStatements, ...financials.quarterlyStatements];
1438
1487
  const fallbackCurrency = reportedCurrency && statements.every((row) => !row.currency?.trim() || row.currency.trim() === reportedCurrency)
@@ -1443,9 +1492,9 @@ export async function buildTickerReport({
1443
1492
 
1444
1493
  const beforeFundamentals = lines.length;
1445
1494
  appendMetricSection(lines, "Fundamentals", metricLines(metrics));
1446
- for (const note of fundamentalsNotes({ ...priced, fundamentals: shownFundamentals }, metrics, quote?.currency)) lines.push(cliStyles.muted(note));
1495
+ for (const note of fundamentalsNotes(priced, metrics, quote?.currency, listingEv.note)) lines.push(cliStyles.muted(note));
1447
1496
  // The trailing block beside statements in another currency, when no conversion says why.
1448
- const split = metrics.some((metric) => TRAILING_MONEY_METRICS.has(metric.label) && metric.text !== "—")
1497
+ const split = metrics.some((metric) => TRAILING_MONEY_METRICS.has(metricName(metric.label)) && metric.text !== "—")
1449
1498
  ? ttmCurrencySplitNote(priced.fundamentals, [latestAnnual, latestQuarter].flatMap((row) => row ? [statementCurrency(row)] : []))
1450
1499
  : undefined;
1451
1500
  if (split) lines.push(cliStyles.muted(split));
@@ -1686,7 +1735,7 @@ async function quoteUnavailableNote(dataProvider: MarketContext["dataProvider"],
1686
1735
  export async function ticker(symbol: string, dependencies: TickerCommandDependencies = {}) {
1687
1736
  const initMarketDataFn = dependencies.initMarketData ?? initMarketData;
1688
1737
  const failCommand = dependencies.fail ?? fail;
1689
- await withMarketData(initMarketDataFn, async ({ config, store, dataProvider, dataDir, statementSources }) => {
1738
+ await withMarketData(initMarketDataFn, async ({ config, store, dataProvider, dataDir, statementSources, fxHistory }) => {
1690
1739
  let listing: CliListing;
1691
1740
  try {
1692
1741
  listing = await resolveCliListing(symbol, dependencies.exchange, { store, dataProvider });
@@ -1721,6 +1770,8 @@ export async function ticker(symbol: string, dependencies: TickerCommandDependen
1721
1770
  // A known exchange the symbol is not listed on: say where it is.
1722
1771
  await failIfNotTraded(listing, { store, dataProvider }, { fail: failCommand });
1723
1772
  await failIfMovedAway();
1773
+ // A bare code several companies list (3988 is Bank of China in Hong Kong and Sys Holdings in Tokyo) asks which, as `quote` does.
1774
+ await failUnchosenListing(listing, { store, dataProvider }, { fail: failCommand }, request, error);
1724
1775
  const reason = error instanceof Error ? error.message : String(error);
1725
1776
  // A symbol no listing carries is not a failed fetch, and the message already names it.
1726
1777
  if (isNotATickerMessage(reason)) failCommand(reason);
@@ -1838,8 +1889,10 @@ export async function ticker(symbol: string, dependencies: TickerCommandDependen
1838
1889
  const listingNote = choiceNotes.join("\n") || undefined;
1839
1890
  const memberships = await membershipsLoad;
1840
1891
  // A converted TTM block at the rate the rest of the report converts at, the one `fx` reports. A listing that
1841
- // stopped trading shows none of the profile and figures another listing under its symbol was served with.
1842
- const shownFinancials = await atReportTtmRate(otherProfile ? withoutResearch(resolvedFinancials) : resolvedFinancials, toBase);
1892
+ // stopped trading shows none of the profile and figures another listing under its symbol was served with. A
1893
+ // withdrawn EV's bridge converts a balance sheet in another currency at our close on its date, as `fundamentals` does.
1894
+ const shownFinancials = await withBalanceSheetRate(
1895
+ await atReportTtmRate(otherProfile ? withoutResearch(resolvedFinancials) : resolvedFinancials, toBase), fxHistory ?? apiClient);
1843
1896
  if (dependencies.printResult) {
1844
1897
  const newsNote = recentNews[0]?.searchedFor ? newsFallbackNotice(requestSymbol, recentNews[0].searchedFor) : null;
1845
1898
  const warnings = [...choiceNotes, quoteNote, newsNote].filter((note): note is string => !!note);
@@ -0,0 +1,45 @@
1
+ /**
2
+ * The blocks of text with a figure in them that a pane's body shows, outside
3
+ * its controls, chrome, states and charts, and outside the labels of its
4
+ * tables and labelled values: what a capture of a pane that marks no rows
5
+ * (DIAG's prose, CORR's matrix) is read by.
6
+ *
7
+ * A block is the element a run of text lays out in: the inline pieces of one
8
+ * line (`Page {a} of {b}`, which React writes as several text nodes, or a
9
+ * figure in a span) count once. A label is not data: "52W High" or "10Y" over
10
+ * a "-" is an empty grid, as `filledKeyValueCount` reads it.
11
+ *
12
+ * Self-contained so the screenshot runner can evaluate it in the browser.
13
+ */
14
+ export function countContentFigures(root: HTMLElement, isVisible: (element: Element) => boolean): number {
15
+ const view = root.ownerDocument.defaultView!;
16
+ const body = root.querySelector<HTMLElement>('[data-gloom-role="pane-body"]') ?? root;
17
+ // Controls, chrome and states say nothing of data, and a chart counts what it plots: "1M" on a tab is not a figure.
18
+ const outside = [
19
+ "button", '[role="button"]', '[role="tab"]', '[role="tablist"]', "input", "textarea", "select", "svg", "canvas",
20
+ '[data-gloom-role="query-bar"]', '[data-gloom-role="pane-header"]', '[data-gloom-role="pane-footer"]', '[data-gloom-role="tab-list"]',
21
+ '[data-gloom-role="page-stack-header"]', '[data-gloom-role="shot-watermark"]', '[data-gloom-role*="chart"]',
22
+ '[data-gloom-ui="empty-state"]', '[data-gloom-ui="notice"]', '[data-gloom-ui="pane-status"]', '[data-gloom-ui="sign-in-wall"]',
23
+ '[data-gloom-ui="pro-lock"]',
24
+ // A table's header names its columns.
25
+ "th", "thead", '[role="columnheader"]', '[role="rowheader"]', '[data-gloom-role="data-table-header-row"]',
26
+ '[data-gloom-role="data-table-header-cell"]',
27
+ ].join(", ");
28
+ const labelled = '[data-gloom-ui="key-value-row"], [data-gloom-role="stat-grid-cell"]';
29
+ const blocks = new Set<Element>();
30
+ // 4 is NodeFilter.SHOW_TEXT, named by number so the function carries no global it might not find.
31
+ const walker = root.ownerDocument.createTreeWalker(body, 4);
32
+ for (let node = walker.nextNode(); node; node = walker.nextNode()) {
33
+ const parent = node.parentElement;
34
+ if (!parent || !/\d/.test(node.textContent ?? "") || parent.closest(outside) || !isVisible(parent)) continue;
35
+ // A labelled value's label is its first child: its value is the figure, if it has one.
36
+ if (parent.closest(labelled)?.firstElementChild?.contains(parent)) continue;
37
+ // An element that lays out inline (or names no display) is part of its parent's line.
38
+ let block: Element = parent;
39
+ while (block !== body && block.parentElement && /^(inline|contents|$)/.test(view.getComputedStyle(block).display)) {
40
+ block = block.parentElement;
41
+ }
42
+ blocks.add(block);
43
+ }
44
+ return blocks.size;
45
+ }
@@ -10,6 +10,7 @@ import type { PluginCapability } from "../capabilities";
10
10
  import type { AppConfig } from "../types/config";
11
11
  import type { GloomPlugin } from "../types/plugin";
12
12
  import { standaloneSeriesCatalog, standaloneSeriesInvoker, standaloneSeriesNamed } from "../series/standalone";
13
+ import { setStandaloneSeriesCatalog } from "../series/standalone-catalog";
13
14
  import type { PluginRegistry } from "../plugins/registry";
14
15
  import type { LoadedExternalPlugin } from "../plugins/loader";
15
16
  import { apiClient } from "../api-client";
@@ -127,6 +128,8 @@ export async function initMarketData(options: CliContextOptions = {}): Promise<M
127
128
  const seriesCapabilities = standaloneSeriesInvoker(plugins, context.dataDir, context.config.disabledPlugins);
128
129
  const findCatalogSeries = standaloneSeriesCatalog(plugins, context.config.disabledPlugins);
129
130
  const findCatalogSeriesNamed = standaloneSeriesNamed(plugins, context.config.disabledPlugins);
131
+ // A chart typed as a catalog series' id or name (`fn G fut:crack-321`) reads it from the plugins' declared series.
132
+ setStandaloneSeriesCatalog(plugins, context.config.disabledPlugins);
130
133
  return { ...context, dataProvider, seriesCapabilities, findCatalogSeries, findCatalogSeriesNamed, statementSources: cloudStatementReportSources };
131
134
  }
132
135
 
@@ -138,6 +141,8 @@ export async function initCliServices(options: CliServicesOptions = {}) {
138
141
  plugins: getLoadablePlugins(options.externalPlugins ?? []),
139
142
  externalPlugins: options.externalPlugins ?? [],
140
143
  interactive: false,
144
+ // The command exits once it has answered: no alert poller or stream starts for it.
145
+ runtime: "command",
141
146
  });
142
147
  services.providerRouter.setConfigAccessor(() => config);
143
148
  services.providerRouter.setBackgroundRevalidation(false);
@@ -8,9 +8,10 @@ export const SHOT_API_PROXY_PREFIX = "/__gloom_cli_api__";
8
8
  export const SHOT_MARKET_BRIDGE_PATH = "/__gloom_cli_market__";
9
9
  export const SHOT_HTTP_BRIDGE_PATH = "/__gloom_cli_http__";
10
10
  /**
11
- * The page's Cloud API reads, over one socket: a page's fetches share six
12
- * connections to its origin, so a board's seventy contract histories and terms
13
- * queued behind each other for seconds.
11
+ * The page's Cloud API reads and asset-data operations, over one socket: a
12
+ * page's fetches share six connections to its origin, so a board's seventy
13
+ * contract histories and terms queued behind each other for seconds, and the
14
+ * quotes it then asks for one at a time took four connections at once.
14
15
  */
15
16
  export const SHOT_API_SOCKET_PATH = "/__gloom_cli_api_socket__";
16
17
 
@@ -20,12 +21,20 @@ export function shotRouteUrl(route: string, pageUrl: string): URL {
20
21
  }
21
22
 
22
23
  /** A read the page sends over the socket: an API path with its query, and the request's headers. */
23
- export interface ShotApiSocketCall {
24
+ export interface ShotApiSocketRead {
24
25
  id: number;
25
26
  path: string;
26
27
  headers: Array<[string, string]>;
27
28
  }
28
29
 
30
+ /** An asset-data operation the page sends over the socket, answered as `SHOT_MARKET_BRIDGE_PATH` answers its body. */
31
+ export interface ShotMarketSocketCall {
32
+ id: number;
33
+ market: { operation: string; args: unknown[] };
34
+ }
35
+
36
+ export type ShotApiSocketCall = ShotApiSocketRead | ShotMarketSocketCall;
37
+
29
38
  /** The server's answer to a call: the response with its body in base64, or why it could not be made. */
30
39
  export type ShotApiSocketReply =
31
40
  | { id: number; status: number; statusText: string; headers: Array<[string, string]>; body: string }
@@ -20,6 +20,7 @@ import type { DatedObservation } from "../plugins/builtin/market-valuation/serie
20
20
  import type { DesktopExternalPluginBundle } from "../renderers/electrobun/shared/protocol";
21
21
  import type { HttpProxyRequestEnvelope, HttpProxyResponseEnvelope } from "../utils/http-proxy-response";
22
22
  import type { PaneAccessGate } from "./pane-functions/access-gate";
23
+ import { countContentFigures } from "./content-figures";
23
24
  import { readVisibleKeyValues } from "./visible-key-values";
24
25
  import { scrollTruncationReasons } from "./scroll-truncation";
25
26
  import {
@@ -27,8 +28,9 @@ import {
27
28
  SHOT_API_SOCKET_PATH,
28
29
  SHOT_HTTP_BRIDGE_PATH,
29
30
  SHOT_MARKET_BRIDGE_PATH,
30
- type ShotApiSocketCall,
31
+ type ShotApiSocketRead,
31
32
  type ShotApiSocketReply,
33
+ type ShotMarketSocketCall,
32
34
  } from "./desktop-pane-shot-routes";
33
35
  import { SHOT_REQUEST_REFUSED } from "../api-client/errors";
34
36
  import { SESSION_COOKIE_NAMES } from "../api-client/session-cookie";
@@ -186,8 +188,22 @@ export interface DesktopPaneShotRenderResult {
186
188
  errorStateMarkers: string[];
187
189
  emptyStateDetected: boolean;
188
190
  emptyStateMarkers: string[];
191
+ /**
192
+ * The words of the one empty or failed state a pane body shows with
193
+ * nothing else but its chrome (query bar, tabs, a table's header): its
194
+ * title, message and hint, a line each, without its buttons. Absent when
195
+ * the body shows anything more.
196
+ */
197
+ emptyStateText?: string[];
189
198
  /** A wall that needs an account, or a Pro lock on part of the pane. */
190
199
  accessGate?: PaneAccessGate | null;
200
+ /**
201
+ * The blocks of text with a figure in them that the pane's body shows
202
+ * outside its controls, chrome, notices, charts and labels
203
+ * (`countContentFigures`): what a pane that marks no rows (DIAG's prose,
204
+ * CORR's matrix) is read by. Absent in a capture that did not count them.
205
+ */
206
+ contentFigures?: number;
191
207
  semanticUi: RemoteUiNodeSnapshot[];
192
208
  /** The status line drawn in the capture's footer, as it fit the width. */
193
209
  statusLine?: string | null;
@@ -374,7 +390,7 @@ export function serveShotPage(
374
390
  },
375
391
  websocket: {
376
392
  message(socket, message) {
377
- void answerShotApiCall(String(message), apiProxy).then((reply) => socket.send(reply));
393
+ void answerShotApiCall(String(message), apiProxy, bridge).then((reply) => replyOverShotSocket(socket, reply));
378
394
  },
379
395
  },
380
396
  });
@@ -385,19 +401,39 @@ export function serveShotPage(
385
401
  }
386
402
 
387
403
  /**
388
- * One read the page sent over its API socket (`SHOT_API_SOCKET_PATH`), made
389
- * as the proxy makes it, with the session the page never holds: the reply's
390
- * JSON, its body in base64. A call that is not an API path answers why.
404
+ * Sends a call's reply to the page. A socket that drops it (Bun's send gives
405
+ * 0: the socket closed, or its buffer is past the limit) is closed, so the
406
+ * read waiting for it, and every read after it, is made over HTTP instead of
407
+ * holding the capture until it times out.
408
+ */
409
+ export function replyOverShotSocket(socket: { send(data: string): number; close(): void }, reply: string): void {
410
+ if (socket.send(reply) === 0) socket.close();
411
+ }
412
+
413
+ /**
414
+ * One call the page sent over its API socket (`SHOT_API_SOCKET_PATH`): a read
415
+ * made as the proxy makes it, with the session the page never holds, or an
416
+ * asset-data operation answered as the market bridge answers it. The reply's
417
+ * JSON, its body in base64. A call that is neither answers why.
391
418
  */
392
- export async function answerShotApiCall(message: string, apiProxy: DesktopPaneShotApiProxy): Promise<string> {
419
+ export async function answerShotApiCall(
420
+ message: string,
421
+ apiProxy: DesktopPaneShotApiProxy,
422
+ bridge: DesktopPaneShotBridge | null = null,
423
+ ): Promise<string> {
393
424
  let id = 0;
394
425
  try {
395
- const call = JSON.parse(message) as Partial<ShotApiSocketCall>;
426
+ const call = JSON.parse(message) as Partial<ShotApiSocketRead & ShotMarketSocketCall>;
396
427
  id = typeof call.id === "number" ? call.id : 0;
397
- if (typeof call.path !== "string" || !call.path.startsWith("/") || call.path.startsWith("//")) throw new Error("Not an API path.");
398
- const url = new URL(`${SHOT_API_PROXY_PREFIX}${call.path}`, "http://127.0.0.1");
399
- const sent = new Headers(Array.isArray(call.headers) ? call.headers : []);
400
- const response = await proxyShotApiRequest(new Request(url, { headers: sent }), url, apiProxy);
428
+ let response: Response;
429
+ if (call.market && typeof call.market === "object") {
430
+ response = await answerShotMarketCall(call.market, bridge);
431
+ } else {
432
+ if (typeof call.path !== "string" || !call.path.startsWith("/") || call.path.startsWith("//")) throw new Error("Not an API path.");
433
+ const url = new URL(`${SHOT_API_PROXY_PREFIX}${call.path}`, "http://127.0.0.1");
434
+ const sent = new Headers(Array.isArray(call.headers) ? call.headers : []);
435
+ response = await proxyShotApiRequest(new Request(url, { headers: sent }), url, apiProxy);
436
+ }
401
437
  const body = Buffer.from(await response.arrayBuffer()).toString("base64");
402
438
  const headers: Array<[string, string]> = [];
403
439
  response.headers.forEach((value, name) => headers.push([name, value]));
@@ -412,10 +448,24 @@ export async function answerShotApiCall(message: string, apiProxy: DesktopPaneSh
412
448
  async function runShotMarketBridge(
413
449
  request: Request,
414
450
  bridge: DesktopPaneShotBridge | null,
451
+ ): Promise<Response> {
452
+ if (!bridge) return Response.json({ ok: false, error: "No market bridge" }, { status: 404 });
453
+ let payload: { operation?: unknown; args?: unknown };
454
+ try {
455
+ payload = await request.json() as typeof payload;
456
+ } catch (error) {
457
+ return Response.json({ ok: false, error: errorMessage(error) });
458
+ }
459
+ return answerShotMarketCall(payload, bridge);
460
+ }
461
+
462
+ /** One asset-data operation run through the bridge, posted (`SHOT_MARKET_BRIDGE_PATH`) or sent over the socket. */
463
+ async function answerShotMarketCall(
464
+ payload: { operation?: unknown; args?: unknown },
465
+ bridge: DesktopPaneShotBridge | null,
415
466
  ): Promise<Response> {
416
467
  if (!bridge) return Response.json({ ok: false, error: "No market bridge" }, { status: 404 });
417
468
  try {
418
- const payload = await request.json() as { operation?: unknown; args?: unknown };
419
469
  const operation = typeof payload.operation === "string" ? payload.operation : "";
420
470
  const args = Array.isArray(payload.args) ? payload.args : [];
421
471
  const data = await bridge.marketData(operation, args);
@@ -911,6 +961,25 @@ async function readRenderedPaneState(session: CdpPage): Promise<DesktopPaneShotR
911
961
  // An empty sub-section off screen, such as a ticker's news list below
912
962
  // the fold, does not make the captured view empty.
913
963
  emptyStateDetected: [...root.querySelectorAll('[data-gloom-status="empty"]')].some(isVisible),
964
+ // A body that shows one empty or failed state and only its chrome
965
+ // beside it reads as the state's words, not as its filters' labels.
966
+ emptyStateText: (() => {
967
+ const body = root.querySelector('[data-gloom-role="pane-body"]') || root;
968
+ const states = [...body.querySelectorAll('[data-gloom-ui="empty-state"]')].filter(isVisible);
969
+ if (states.length !== 1) return [];
970
+ const chrome = '[data-gloom-role="query-bar"], [data-gloom-role="data-table-header-row"], [data-gloom-role="tab-list"], [data-gloom-role="page-stack-header"], [data-gloom-role="pane-footer"], [data-gloom-ui="empty-state"]';
971
+ const walker = document.createTreeWalker(body, NodeFilter.SHOW_TEXT);
972
+ for (let node = walker.nextNode(); node; node = walker.nextNode()) {
973
+ const parent = node.parentElement;
974
+ if (!normalize(node.textContent) || !parent || parent.closest(chrome) || !isVisible(parent)) continue;
975
+ return [];
976
+ }
977
+ return [...states[0].children]
978
+ .filter((child) => isVisible(child) && !child.querySelector('button, [role="button"]'))
979
+ .map((child) => normalize(child.innerText || child.textContent))
980
+ .filter(Boolean);
981
+ })(),
982
+ contentFigures: (${countContentFigures.toString()})(root, isVisible),
914
983
  // The shared sign-in wall and the Pro lock prompt every gated pane draws.
915
984
  accessGate: [...root.querySelectorAll('[data-gloom-ui="sign-in-wall"]')].some(isVisible) ? "sign-in"
916
985
  : [...root.querySelectorAll('[data-gloom-ui="pro-lock"]')].some(isVisible) ? "pro" : "",
@@ -937,6 +1006,8 @@ async function readRenderedPaneState(session: CdpPage): Promise<DesktopPaneShotR
937
1006
  loadingStateDetected?: boolean;
938
1007
  errorStateDetected?: boolean;
939
1008
  emptyStateDetected?: boolean;
1009
+ emptyStateText?: string[];
1010
+ contentFigures?: number;
940
1011
  accessGate?: string;
941
1012
  rows?: DesktopPaneShotRenderedRow[];
942
1013
  truncated?: boolean;
@@ -988,7 +1059,10 @@ async function readRenderedPaneState(session: CdpPage): Promise<DesktopPaneShotR
988
1059
  errorStateMarkers,
989
1060
  emptyStateDetected: value?.emptyStateDetected === true || emptyStateMarkers.length > 0,
990
1061
  emptyStateMarkers,
1062
+ ...(Array.isArray(value?.emptyStateText) && value.emptyStateText.length > 0
1063
+ ? { emptyStateText: value.emptyStateText.filter((line): line is string => typeof line === "string" && line.length > 0) } : {}),
991
1064
  accessGate,
1065
+ ...(typeof value?.contentFigures === "number" ? { contentFigures: value.contentFigures } : {}),
992
1066
  semanticUi: Array.isArray(value?.semanticUi) ? value.semanticUi : [],
993
1067
  };
994
1068
  }