gloomberb 0.20.2 → 0.20.4

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 (471) hide show
  1. package/README.md +1 -1
  2. package/README.zh-CN.md +1 -1
  3. package/package.json +2 -1
  4. package/src/account/auth-dialog.tsx +17 -0
  5. package/src/account/auth-form.tsx +13 -8
  6. package/src/account/upgrade-dialog.tsx +1 -1
  7. package/src/api-client/central-bank-rates.ts +5 -0
  8. package/src/api-client/data.ts +23 -4
  9. package/src/api-client/debt-maturities.ts +45 -2
  10. package/src/api-client/earnings.ts +4 -2
  11. package/src/api-client/errors.ts +21 -11
  12. package/src/api-client/fx-interventions.ts +64 -0
  13. package/src/api-client/index.ts +2 -0
  14. package/src/api-client/paths.ts +9 -1
  15. package/src/api-client/release-summaries.ts +21 -0
  16. package/src/api-client/social-mentions.ts +47 -0
  17. package/src/api-client/types/econ.ts +4 -0
  18. package/src/app/keybindings/actions.ts +2 -2
  19. package/src/app/pane-runtime/ticker-open-runtime.ts +245 -66
  20. package/src/app.tsx +11 -1
  21. package/src/cli/command-options.ts +2 -1
  22. package/src/cli/commands/market.ts +188 -30
  23. package/src/cli/commands/news-search.ts +1 -3
  24. package/src/cli/commands/options-chain.ts +23 -6
  25. package/src/cli/commands/overview.ts +13 -5
  26. package/src/cli/commands/plugins.ts +76 -23
  27. package/src/cli/commands/search.ts +25 -6
  28. package/src/cli/commands/system.ts +19 -3
  29. package/src/cli/commands/ticker.ts +64 -21
  30. package/src/cli/fx-quote-rate.ts +49 -1
  31. package/src/cli/glossary.ts +95 -15
  32. package/src/cli/history-rows.ts +9 -25
  33. package/src/cli/index.ts +14 -46
  34. package/src/cli/known-gaps.ts +3 -3
  35. package/src/cli/listing-arg.ts +78 -18
  36. package/src/cli/name-entries.ts +3 -2
  37. package/src/cli/not-a-ticker.ts +6 -2
  38. package/src/cli/pane-functions/capabilities.ts +12 -1
  39. package/src/cli/pane-functions/function-help.ts +26 -14
  40. package/src/cli/pane-functions/headless.ts +3 -1
  41. package/src/cli/pane-functions/index.ts +32 -4
  42. package/src/cli/pane-functions/market-session.ts +8 -3
  43. package/src/cli/pane-functions/resolver.ts +18 -11
  44. package/src/cli/pane-functions/screenshot-payload.ts +36 -6
  45. package/src/cli/pane-functions/screenshot-render.ts +4 -0
  46. package/src/cli/quote-answer.ts +10 -0
  47. package/src/cli/report-tables.ts +40 -8
  48. package/src/cli/result.ts +21 -9
  49. package/src/cli/spreadsheet-hint.ts +43 -0
  50. package/src/cli/symbol-list.ts +58 -4
  51. package/src/cli/symbol-rows.ts +49 -2
  52. package/src/cli/ticker-resolution.ts +98 -5
  53. package/src/cli/types.ts +2 -0
  54. package/src/cli/unknown-command.ts +88 -0
  55. package/src/components/chart/composite/axis-overlays.tsx +22 -0
  56. package/src/components/chart/composite/composite-chart.tsx +54 -13
  57. package/src/components/chart/composite/event-captions.ts +109 -0
  58. package/src/components/chart/composite/event-guides.ts +74 -0
  59. package/src/components/chart/composite/rasterizer.ts +2 -0
  60. package/src/components/chart/composite/text-renderer.ts +2 -0
  61. package/src/components/chart/composite/types.ts +31 -0
  62. package/src/components/command-bar/assist/model.ts +6 -1
  63. package/src/components/command-bar/commands/direct/index.ts +9 -1
  64. package/src/components/command-bar/commands/registry.ts +18 -0
  65. package/src/components/command-bar/layout-items/focused-pane.ts +5 -5
  66. package/src/components/command-bar/pane-actions.ts +30 -13
  67. package/src/components/command-bar/panel/index.tsx +6 -3
  68. package/src/components/command-bar/panel/prompt-binding.ts +4 -0
  69. package/src/components/command-bar/panel/types.ts +3 -0
  70. package/src/components/command-bar/routes/header-market.ts +108 -0
  71. package/src/components/command-bar/routes/root/command-items.ts +5 -0
  72. package/src/components/command-bar/routes/root/provider-search.ts +192 -33
  73. package/src/components/command-bar/routes/root/results.ts +3 -0
  74. package/src/components/command-bar/routes/root/runtime.ts +28 -5
  75. package/src/components/command-bar/routes/ticker-search/results.ts +104 -6
  76. package/src/components/command-bar/routes/ticker-search/route.ts +3 -2
  77. package/src/components/command-bar/routing/list-state.ts +38 -0
  78. package/src/components/command-bar/selection-hint.ts +28 -0
  79. package/src/components/command-bar/surface/index.tsx +41 -3
  80. package/src/components/command-bar/view-model.ts +15 -0
  81. package/src/components/command-bar/workflow/tickers.ts +3 -2
  82. package/src/components/company-logo.tsx +20 -2
  83. package/src/components/data-table/export.ts +13 -8
  84. package/src/components/feedback-dialog.tsx +2 -1
  85. package/src/components/form-modal/field-row.tsx +2 -1
  86. package/src/components/input-search-bar.tsx +2 -2
  87. package/src/components/layout/detached-pane-shell.tsx +1 -1
  88. package/src/components/layout/double-escape-close.ts +8 -5
  89. package/src/components/layout/floating-pane.tsx +5 -1
  90. package/src/components/layout/header.tsx +75 -44
  91. package/src/components/layout/market-summary.ts +322 -116
  92. package/src/components/layout/pane/footer/index.tsx +44 -19
  93. package/src/components/layout/pane/footer/model.ts +52 -20
  94. package/src/components/layout/pane/header.tsx +3 -2
  95. package/src/components/layout/shell/action-menu-overlay.tsx +10 -5
  96. package/src/components/layout/shell/active-drag.ts +149 -105
  97. package/src/components/layout/shell/chrome.ts +15 -15
  98. package/src/components/layout/shell/drag/drop-zones.ts +162 -0
  99. package/src/components/layout/shell/drag/index.ts +47 -218
  100. package/src/components/layout/shell/drag/live.ts +10 -3
  101. package/src/components/layout/shell/drag/overlays.tsx +182 -5
  102. package/src/components/layout/shell/drag/runtime.ts +29 -6
  103. package/src/components/layout/shell/drag/shared-edges.ts +156 -0
  104. package/src/components/layout/shell/index.tsx +11 -6
  105. package/src/components/layout/shell/menu.ts +11 -2
  106. package/src/components/layout/shell/native/pointer-runtime.ts +25 -0
  107. package/src/components/layout/shell/native/window-state.ts +2 -2
  108. package/src/components/layout/shell/pane/layers.tsx +71 -7
  109. package/src/components/layout/shell/terminal-pointer-runtime.ts +18 -9
  110. package/src/components/layout/shell/window-mode/index.ts +8 -10
  111. package/src/components/layout/status-bar.tsx +8 -7
  112. package/src/components/layout/status-widget-space.ts +8 -0
  113. package/src/components/layout/window-edit/mode.ts +39 -7
  114. package/src/components/layout/window-edit/presentation.ts +1 -1
  115. package/src/components/markdown-editor.tsx +2 -2
  116. package/src/components/onboarding/account-step/form-panel.tsx +0 -3
  117. package/src/components/onboarding/onboarding-keyboard.ts +19 -6
  118. package/src/components/onboarding/onboarding-wizard.tsx +69 -14
  119. package/src/components/onboarding/portfolio-step/broker-fields-panel.tsx +0 -1
  120. package/src/components/onboarding/portfolio-step/positions-panel.tsx +0 -2
  121. package/src/components/price-sparkline/model.ts +26 -10
  122. package/src/components/ticker/list-table-view.tsx +29 -4
  123. package/src/components/ui/button.tsx +15 -2
  124. package/src/components/ui/choice-dialog.tsx +1 -0
  125. package/src/components/ui/column-grid.tsx +18 -9
  126. package/src/components/ui/data-table/index.tsx +5 -4
  127. package/src/components/ui/data-table/opentui/index.tsx +2 -1
  128. package/src/components/ui/data-table/types.ts +18 -0
  129. package/src/components/ui/delayed-mark.tsx +3 -2
  130. package/src/components/ui/field-grid.tsx +0 -2
  131. package/src/components/ui/fields.tsx +7 -4
  132. package/src/components/ui/inline-quick-add.tsx +2 -2
  133. package/src/components/ui/key-hint-words.ts +153 -0
  134. package/src/components/ui/key-hints.tsx +73 -0
  135. package/src/components/ui/list-view.tsx +7 -12
  136. package/src/components/ui/loading.tsx +10 -3
  137. package/src/components/ui/menu.tsx +9 -3
  138. package/src/components/ui/message-composer.tsx +2 -2
  139. package/src/components/ui/quote.ts +14 -1
  140. package/src/components/ui/shortcut-hint.tsx +28 -3
  141. package/src/components/ui/tabs.tsx +7 -0
  142. package/src/components/ui/text-prompt-dialog.tsx +2 -1
  143. package/src/core/state/app/command-bar-launch.ts +3 -0
  144. package/src/data/config/layout.ts +5 -2
  145. package/src/data/config/store/normalize.ts +6 -0
  146. package/src/docs/snapshot.json +149 -74
  147. package/src/i18n/es.ts +33 -9
  148. package/src/i18n/ja.ts +33 -9
  149. package/src/i18n/ko.ts +33 -9
  150. package/src/i18n/zh-cn.ts +33 -9
  151. package/src/i18n/zh-tw.ts +33 -9
  152. package/src/layout/pane-manager/floating-actions.ts +17 -0
  153. package/src/layout/pane-manager/floating-stack.ts +187 -0
  154. package/src/layout/pane-manager/floating.ts +4 -2
  155. package/src/layout/pane-manager/gridlock.ts +16 -1
  156. package/src/layout/pane-manager/index.ts +11 -0
  157. package/src/layout/pane-manager/layout-state.ts +10 -3
  158. package/src/market-data/bars-per-year.ts +27 -9
  159. package/src/market-data/coordinator/quotes.ts +22 -3
  160. package/src/market-data/futures-board.ts +126 -1
  161. package/src/market-data/futures-contract.ts +21 -6
  162. package/src/market-data/fx-interventions.ts +270 -0
  163. package/src/market-data/market/change-basis.ts +2 -2
  164. package/src/market-data/market/dated-previous-close.ts +163 -47
  165. package/src/market-data/market/format.ts +14 -3
  166. package/src/market-data/market/freshness.ts +24 -7
  167. package/src/market-data/market/header-market.ts +154 -0
  168. package/src/market-data/market/index-level.ts +29 -0
  169. package/src/market-data/market/index-session-venues.ts +44 -0
  170. package/src/market-data/market/status.ts +7 -2
  171. package/src/market-data/market/venue-session.ts +72 -0
  172. package/src/market-data/model-dividend-yield.ts +23 -8
  173. package/src/market-data/options-alternatives.ts +39 -4
  174. package/src/market-data/published-apac-sessions.ts +40 -2
  175. package/src/market-data/quotes/export-identity.ts +76 -0
  176. package/src/market-data/quotes/freshness.ts +22 -0
  177. package/src/market-data/quotes/time.ts +42 -1
  178. package/src/market-data/realized-volatility.ts +11 -7
  179. package/src/market-data/tax-equivalent.ts +145 -27
  180. package/src/news/news-model.ts +44 -2
  181. package/src/plugins/builtin/account-management/pane.tsx +2 -2
  182. package/src/plugins/builtin/alerts/alert-engine.ts +12 -6
  183. package/src/plugins/builtin/alerts/alert-log.ts +6 -2
  184. package/src/plugins/builtin/alerts/calendar-events.ts +74 -12
  185. package/src/plugins/builtin/alerts/cli-forms.ts +11 -1
  186. package/src/plugins/builtin/alerts/cli-move.ts +234 -0
  187. package/src/plugins/builtin/alerts/cli.ts +223 -32
  188. package/src/plugins/builtin/alerts/command.ts +33 -6
  189. package/src/plugins/builtin/alerts/event-rows.ts +18 -4
  190. package/src/plugins/builtin/alerts/events-pane.tsx +6 -2
  191. package/src/plugins/builtin/alerts/events.ts +9 -0
  192. package/src/plugins/builtin/alerts/format.ts +39 -15
  193. package/src/plugins/builtin/alerts/headless.ts +30 -18
  194. package/src/plugins/builtin/alerts/history.ts +1 -0
  195. package/src/plugins/builtin/alerts/index.tsx +86 -12
  196. package/src/plugins/builtin/alerts/live.ts +2 -1
  197. package/src/plugins/builtin/alerts/move-checks.ts +161 -0
  198. package/src/plugins/builtin/alerts/move.ts +181 -0
  199. package/src/plugins/builtin/alerts/pane.tsx +50 -22
  200. package/src/plugins/builtin/alerts/price-text.ts +62 -0
  201. package/src/plugins/builtin/alerts/price.ts +17 -0
  202. package/src/plugins/builtin/alerts/quotes.ts +84 -3
  203. package/src/plugins/builtin/alerts/scheduled-check.ts +7 -1
  204. package/src/plugins/builtin/alerts/storage.ts +22 -7
  205. package/src/plugins/builtin/alerts/types.ts +25 -0
  206. package/src/plugins/builtin/analytics/risk-client.ts +60 -39
  207. package/src/plugins/builtin/analytics/risk-episodes.ts +18 -0
  208. package/src/plugins/builtin/analytics/risk-headless.ts +20 -4
  209. package/src/plugins/builtin/analytics/risk-model.ts +68 -1
  210. package/src/plugins/builtin/analytics/risk-pane.tsx +15 -3
  211. package/src/plugins/builtin/backtest/engine.ts +4 -2
  212. package/src/plugins/builtin/backtest/window.ts +3 -1
  213. package/src/plugins/builtin/broker-manager/sign-in-end.ts +1 -1
  214. package/src/plugins/builtin/central-bank-rates/client.ts +4 -0
  215. package/src/plugins/builtin/central-bank-rates/headless.ts +1 -1
  216. package/src/plugins/builtin/central-bank-rates/model.ts +18 -8
  217. package/src/plugins/builtin/central-bank-rates/pane.tsx +6 -3
  218. package/src/plugins/builtin/changelog/index.tsx +292 -101
  219. package/src/plugins/builtin/changelog/versions.ts +293 -0
  220. package/src/plugins/builtin/chart-composer/cli-options.ts +5 -0
  221. package/src/plugins/builtin/chart-composer/headless-schema.ts +17 -1
  222. package/src/plugins/builtin/chart-composer/headless.ts +2 -0
  223. package/src/plugins/builtin/chart-composer/intervention-events.ts +105 -0
  224. package/src/plugins/builtin/chart-composer/pane.tsx +21 -7
  225. package/src/plugins/builtin/chat/message/render-state.ts +2 -5
  226. package/src/plugins/builtin/cloud/askg/attached-pane.tsx +10 -5
  227. package/src/plugins/builtin/cloud/askg/controller.ts +141 -5
  228. package/src/plugins/builtin/cloud/askg/executor.ts +113 -4
  229. package/src/plugins/builtin/cloud/askg/manifest.ts +28 -13
  230. package/src/plugins/builtin/cloud/askg/model.ts +14 -4
  231. package/src/plugins/builtin/cloud/askg/pane.tsx +70 -46
  232. package/src/plugins/builtin/cloud/askg/turn-parts.tsx +70 -0
  233. package/src/plugins/builtin/cloud/terminal-relay/engine.ts +50 -130
  234. package/src/plugins/builtin/cloud/terminal-relay/policy.ts +327 -7
  235. package/src/plugins/builtin/cloud/terminal-relay/prompts.tsx +2 -1
  236. package/src/plugins/builtin/cloud/terminal-relay/redact.ts +47 -6
  237. package/src/plugins/builtin/cloud/upgrade-status-widget.tsx +9 -2
  238. package/src/plugins/builtin/commodities-energy/index.tsx +1 -3
  239. package/src/plugins/builtin/commodities-energy/view-state.ts +3 -0
  240. package/src/plugins/builtin/cot/headless.ts +14 -2
  241. package/src/plugins/builtin/crypto-board/headless.ts +82 -17
  242. package/src/plugins/builtin/crypto-board/index.tsx +24 -2
  243. package/src/plugins/builtin/crypto-board/model.ts +5 -2
  244. package/src/plugins/builtin/crypto-board/pane.tsx +4 -1
  245. package/src/plugins/builtin/debt-maturities/client.ts +111 -6
  246. package/src/plugins/builtin/debt-maturities/headless.ts +84 -1
  247. package/src/plugins/builtin/debt-maturities/model.ts +97 -14
  248. package/src/plugins/builtin/debt-maturities/pane.tsx +165 -15
  249. package/src/plugins/builtin/debt-maturities/series.ts +3 -1
  250. package/src/plugins/builtin/dividend-yield/client.ts +22 -6
  251. package/src/plugins/builtin/dividend-yield/headless.ts +113 -46
  252. package/src/plugins/builtin/dividend-yield/model.ts +5 -2
  253. package/src/plugins/builtin/dividend-yield/pane.tsx +6 -3
  254. package/src/plugins/builtin/dividend-yield/ranking-reads.ts +11 -4
  255. package/src/plugins/builtin/dividend-yield/ranking.ts +113 -18
  256. package/src/plugins/builtin/dividend-yield/types.ts +2 -0
  257. package/src/plugins/builtin/dividend-yield/view.ts +3 -0
  258. package/src/plugins/builtin/earnings/index.tsx +2 -2
  259. package/src/plugins/builtin/econ/calendar-model.ts +21 -3
  260. package/src/plugins/builtin/econ/detail-view.tsx +5 -3
  261. package/src/plugins/builtin/econ/figures.ts +13 -0
  262. package/src/plugins/builtin/econ/fred-catalog.ts +6 -3
  263. package/src/plugins/builtin/econ/index.tsx +5 -3
  264. package/src/plugins/builtin/econ/types.ts +5 -0
  265. package/src/plugins/builtin/equity-screener/footer.ts +45 -0
  266. package/src/plugins/builtin/equity-screener/pane.tsx +4 -18
  267. package/src/plugins/builtin/equity-screener/ticker-check.tsx +2 -1
  268. package/src/plugins/builtin/fixed-income/model.ts +1 -0
  269. package/src/plugins/builtin/futures/index.tsx +25 -4
  270. package/src/plugins/builtin/futures/model.ts +28 -32
  271. package/src/plugins/builtin/futures/series.ts +4 -3
  272. package/src/plugins/builtin/futures/table.tsx +17 -10
  273. package/src/plugins/builtin/futures/use-board-terms.ts +3 -3
  274. package/src/plugins/builtin/futures-curve/model.ts +3 -10
  275. package/src/plugins/builtin/help/function-card.tsx +2 -1
  276. package/src/plugins/builtin/help/function-index.ts +1 -0
  277. package/src/plugins/builtin/help/index.tsx +3 -3
  278. package/src/plugins/builtin/help/keybindings-editor.tsx +18 -4
  279. package/src/plugins/builtin/insider/client.ts +31 -14
  280. package/src/plugins/builtin/insider/signals-model.ts +2 -7
  281. package/src/plugins/builtin/iv-history/headless.ts +1 -2
  282. package/src/plugins/builtin/iv-history/model.ts +33 -23
  283. package/src/plugins/builtin/iv-history/screen-pane.tsx +0 -3
  284. package/src/plugins/builtin/kelly-sizer/headless.ts +64 -16
  285. package/src/plugins/builtin/kelly-sizer/history.ts +37 -28
  286. package/src/plugins/builtin/kelly-sizer/pane.tsx +43 -10
  287. package/src/plugins/builtin/kelly-sizer/sections.tsx +7 -2
  288. package/src/plugins/builtin/kelly-sizer/units.ts +29 -0
  289. package/src/plugins/builtin/layout-manager/index.tsx +8 -8
  290. package/src/plugins/builtin/news/headless.ts +2 -2
  291. package/src/plugins/builtin/news/index.tsx +10 -16
  292. package/src/plugins/builtin/news/overview-headlines.tsx +117 -0
  293. package/src/plugins/builtin/news/ticker-news.ts +35 -0
  294. package/src/plugins/builtin/news/wire/news/detail-view.tsx +8 -6
  295. package/src/plugins/builtin/news/wire/news/row.ts +49 -0
  296. package/src/plugins/builtin/news/wire/news/table.tsx +9 -20
  297. package/src/plugins/builtin/options/analytics.ts +7 -2
  298. package/src/plugins/builtin/options/live-quotes.ts +6 -1
  299. package/src/plugins/builtin/options/table.ts +3 -2
  300. package/src/plugins/builtin/options/view.tsx +11 -9
  301. package/src/plugins/builtin/options-scenario/client.ts +3 -0
  302. package/src/plugins/builtin/options-scenario/headless.ts +1 -1
  303. package/src/plugins/builtin/perps/client.ts +5 -4
  304. package/src/plugins/builtin/perps/headless.ts +134 -124
  305. package/src/plugins/builtin/perps/markets-section.tsx +7 -4
  306. package/src/plugins/builtin/perps/model.ts +8 -4
  307. package/src/plugins/builtin/perps/open-market.ts +4 -4
  308. package/src/plugins/builtin/perps/venue-markets.ts +3 -6
  309. package/src/plugins/builtin/plugin-marketplace/pane.tsx +11 -11
  310. package/src/plugins/builtin/portfolio-list/cell-version.ts +1 -0
  311. package/src/plugins/builtin/portfolio-list/cli/bulk-symbols.ts +34 -10
  312. package/src/plugins/builtin/portfolio-list/cli/period-report.ts +28 -2
  313. package/src/plugins/builtin/portfolio-list/cli/portfolio-command.ts +7 -3
  314. package/src/plugins/builtin/portfolio-list/cli/render.ts +66 -22
  315. package/src/plugins/builtin/portfolio-list/grid.tsx +5 -3
  316. package/src/plugins/builtin/portfolio-list/pane/data.ts +34 -1
  317. package/src/plugins/builtin/portfolio-list/pane/index.tsx +6 -0
  318. package/src/plugins/builtin/portfolio-list/pane/streaming.ts +15 -6
  319. package/src/plugins/builtin/portfolio-list/quick-add/resolution.ts +19 -7
  320. package/src/plugins/builtin/portfolio-list/summary/index.tsx +3 -1
  321. package/src/plugins/builtin/portfolio-list/table.tsx +30 -4
  322. package/src/plugins/builtin/realized-vol/evidence.ts +33 -6
  323. package/src/plugins/builtin/realized-vol/fx-proxy.ts +135 -0
  324. package/src/plugins/builtin/realized-vol/headless.ts +44 -8
  325. package/src/plugins/builtin/realized-vol/model.ts +9 -5
  326. package/src/plugins/builtin/realized-vol/pane.tsx +49 -15
  327. package/src/plugins/builtin/research/event-model.ts +9 -1
  328. package/src/plugins/builtin/research/event-sources.ts +22 -0
  329. package/src/plugins/builtin/research/headless.ts +3 -3
  330. package/src/plugins/builtin/sec/headless.ts +48 -6
  331. package/src/plugins/builtin/sec/index.tsx +6 -4
  332. package/src/plugins/builtin/sec/model.ts +4 -1
  333. package/src/plugins/builtin/shared/cloud-upgrade.ts +27 -3
  334. package/src/plugins/builtin/shared/earnings-calendar.ts +2 -0
  335. package/src/plugins/builtin/shared/market-cap-bands.ts +12 -0
  336. package/src/plugins/builtin/shared/report-freshness.ts +3 -1
  337. package/src/plugins/builtin/shared/use-quote-board.ts +5 -3
  338. package/src/plugins/builtin/shared/volatility/options.ts +63 -2
  339. package/src/plugins/builtin/social-mentions/headless.ts +72 -3
  340. package/src/plugins/builtin/social-mentions/index.tsx +8 -4
  341. package/src/plugins/builtin/social-mentions/lock-note.ts +6 -2
  342. package/src/plugins/builtin/social-mentions/outliers-client.ts +101 -0
  343. package/src/plugins/builtin/social-mentions/outliers-model.ts +162 -0
  344. package/src/plugins/builtin/social-mentions/outliers-names.ts +51 -0
  345. package/src/plugins/builtin/social-mentions/outliers.tsx +276 -0
  346. package/src/plugins/builtin/social-mentions/pane.tsx +32 -3
  347. package/src/plugins/builtin/supply-chain/graph-pane.tsx +2 -2
  348. package/src/plugins/builtin/thirteenf/api.ts +36 -2
  349. package/src/plugins/builtin/thirteenf/data.ts +4 -1
  350. package/src/plugins/builtin/thirteenf/headless.ts +14 -6
  351. package/src/plugins/builtin/thirteenf/model.ts +56 -1
  352. package/src/plugins/builtin/thirteenf/pane.tsx +8 -8
  353. package/src/plugins/builtin/thirteenf/report-notes.ts +11 -0
  354. package/src/plugins/builtin/thirteenf/table.ts +2 -1
  355. package/src/plugins/builtin/thirteenf/types.ts +6 -0
  356. package/src/plugins/builtin/ticker-detail/data-panes/historical-prices.tsx +23 -3
  357. package/src/plugins/builtin/ticker-detail/financials/model.ts +5 -0
  358. package/src/plugins/builtin/ticker-detail/headless-schema.ts +2 -1
  359. package/src/plugins/builtin/ticker-detail/headless.ts +21 -66
  360. package/src/plugins/builtin/ticker-detail/index.tsx +5 -0
  361. package/src/plugins/builtin/ticker-detail/overview/components.tsx +67 -6
  362. package/src/plugins/builtin/ticker-detail/overview/model.ts +6 -4
  363. package/src/plugins/builtin/ticker-detail/overview/pane.tsx +15 -0
  364. package/src/plugins/builtin/ticker-detail/overview/tax-equivalent.ts +69 -0
  365. package/src/plugins/builtin/ticker-detail/overview-tab.tsx +69 -19
  366. package/src/plugins/builtin/ticker-detail/pane.tsx +7 -2
  367. package/src/plugins/builtin/ticker-detail/quote-monitor/card.tsx +47 -24
  368. package/src/plugins/builtin/ticker-detail/quote-monitor/export.ts +46 -0
  369. package/src/plugins/builtin/ticker-detail/quote-monitor/index.tsx +20 -1
  370. package/src/plugins/builtin/ticker-detail/quote-monitor/rows.ts +120 -0
  371. package/src/plugins/builtin/ticker-detail/research-tabs.ts +1 -5
  372. package/src/plugins/builtin/ticker-detail/settings.ts +6 -6
  373. package/src/plugins/builtin/treasury-auctions/cache.ts +85 -19
  374. package/src/plugins/builtin/treasury-auctions/index.tsx +22 -11
  375. package/src/plugins/builtin/treasury-auctions/model.ts +23 -0
  376. package/src/plugins/builtin/treasury-auctions/treasury-direct.ts +128 -0
  377. package/src/plugins/builtin/world-indices/client.ts +2 -0
  378. package/src/plugins/compat.ts +15 -0
  379. package/src/plugins/host-link.ts +6 -1
  380. package/src/plugins/installer.ts +53 -3
  381. package/src/portfolio/column-values.ts +14 -4
  382. package/src/portfolio/listed-symbol.ts +78 -0
  383. package/src/portfolio/real-return.ts +172 -0
  384. package/src/public/__snapshots__/public-api.test.ts.snap +1 -0
  385. package/src/remote/resources.ts +12 -1
  386. package/src/remote/schema.ts +1 -0
  387. package/src/remote/semantic-helpers.ts +29 -1
  388. package/src/remote/semantic-tree.tsx +32 -15
  389. package/src/renderers/browser/config-host.ts +56 -15
  390. package/src/renderers/browser/main.tsx +3 -1
  391. package/src/renderers/browser/ui-host.tsx +1 -0
  392. package/src/renderers/cloudflare/http-proxy.ts +1 -0
  393. package/src/renderers/cloudflare/worker.ts +16 -1
  394. package/src/renderers/dom/boot-frame.ts +2 -2
  395. package/src/renderers/dom/data-table/row.tsx +4 -1
  396. package/src/renderers/dom/desktop/controls.tsx +4 -4
  397. package/src/renderers/dom/desktop/dialog-actions.tsx +60 -41
  398. package/src/renderers/dom/dom-ui-host.tsx +3 -1
  399. package/src/renderers/dom/host/input.tsx +4 -1
  400. package/src/renderers/dom/host/tabs.tsx +10 -1
  401. package/src/renderers/dom/styles.css +73 -19
  402. package/src/renderers/electrobun/bun/desktop/app-name.ts +1 -1
  403. package/src/renderers/opentui/host.tsx +2 -1
  404. package/src/renderers/share/layout-view.tsx +1 -1
  405. package/src/sources/gloomberb-cloud/fred-series.ts +12 -0
  406. package/src/sources/gloomberb-cloud/index.ts +31 -2
  407. package/src/sources/gloomberb-cloud/news.ts +35 -12
  408. package/src/sources/gloomberb-cloud/normalizers.ts +29 -3
  409. package/src/sources/provider-router/cached-routes.ts +19 -7
  410. package/src/state/opening-ticker-panes.ts +47 -0
  411. package/src/state/pane-table-export-registry.ts +19 -6
  412. package/src/test-support/cli-context.ts +2 -0
  413. package/src/test-support/preload.ts +8 -1
  414. package/src/theme/colors.ts +9 -1
  415. package/src/theme/themes.ts +62 -15
  416. package/src/theme/tone-contrast.ts +40 -0
  417. package/src/theme/ui-tokens.ts +23 -3
  418. package/src/tickers/batched-lookups.ts +57 -8
  419. package/src/tickers/company-name-listing.ts +156 -14
  420. package/src/tickers/company-name.ts +30 -6
  421. package/src/tickers/instrument-kind.ts +23 -3
  422. package/src/tickers/list.ts +7 -0
  423. package/src/tickers/search/home-listing.ts +31 -9
  424. package/src/tickers/search/index.ts +13 -3
  425. package/src/tickers/search/listing-index.ts +558 -0
  426. package/src/tickers/search/major-listings.chunk.ts +10 -0
  427. package/src/tickers/search/major-listings.json +3346 -0
  428. package/src/tickers/search/ranking.ts +68 -1
  429. package/src/tickers/search/types.ts +4 -0
  430. package/src/tickers/terminal-codes.ts +26 -1
  431. package/src/time-series/calendar-month-returns.ts +47 -0
  432. package/src/time-series/currency-conversion.ts +130 -0
  433. package/src/time-series/hooks.ts +2 -0
  434. package/src/time-series/price-comparison.ts +34 -11
  435. package/src/time-series/resolve-context.ts +3 -0
  436. package/src/time-series/resolve.ts +14 -2
  437. package/src/time-series/spec.ts +1 -0
  438. package/src/time-series/studies/indicators.ts +4 -1
  439. package/src/time-series/types.ts +8 -0
  440. package/src/types/config.ts +13 -0
  441. package/src/types/context-menu.ts +2 -0
  442. package/src/types/data-provider.ts +28 -0
  443. package/src/types/financials.ts +20 -2
  444. package/src/types/headless.ts +12 -0
  445. package/src/types/plugin-commands.ts +140 -0
  446. package/src/types/plugin-context.ts +125 -0
  447. package/src/types/plugin-contributions.ts +55 -0
  448. package/src/types/plugin-definition.ts +234 -0
  449. package/src/types/plugin-notifications.ts +38 -0
  450. package/src/types/plugin-pane-settings.ts +114 -0
  451. package/src/types/plugin-pane-templates.ts +160 -0
  452. package/src/types/plugin-panes.ts +221 -0
  453. package/src/types/plugin-reports.ts +35 -0
  454. package/src/types/plugin-shared.ts +14 -0
  455. package/src/types/plugin-state.ts +71 -0
  456. package/src/types/plugin.ts +14 -1169
  457. package/src/ui/host.tsx +8 -0
  458. package/src/ui/index.tsx +14 -3
  459. package/src/updater/github-releases.ts +23 -0
  460. package/src/utils/cli-output.ts +22 -9
  461. package/src/utils/datetime-format.ts +17 -3
  462. package/src/utils/display-number.ts +15 -0
  463. package/src/utils/double-escape-close.ts +61 -16
  464. package/src/utils/float32-price.ts +24 -0
  465. package/src/utils/forward-dividend.ts +81 -16
  466. package/src/utils/fx-market-hours.ts +11 -0
  467. package/src/utils/plugin-proxy-hosts.json +2 -1
  468. package/src/utils/price-history.ts +7 -6
  469. package/src/utils/report-timing.ts +62 -0
  470. package/src/utils/sec-filings.ts +32 -0
  471. package/src/utils/utc-time.ts +5 -0
@@ -19,7 +19,7 @@ import type {
19
19
  TickerFinancials,
20
20
  } from "../../types/financials";
21
21
  import { currencyPriceMinDigits, formatMarketPrice, formatMarketPriceWithCurrency, nearParCoinPriceDigits, penceFigure, quoteFormatOptions, withCurrencyMinorDigits } from "../../market-data/market/format";
22
- import { INDEX_POINTS_EXPORT_UNIT, isIndexLevel, reportedQuoteVolume } from "../../market-data/market/index-level";
22
+ import { INDEX_POINTS_EXPORT_UNIT, indexBarVolume, isIndexLevel, reportedQuoteVolume, YIELD_INDEX_EXPORT_UNIT } from "../../market-data/market/index-level";
23
23
  import { changeBasisJson, changeBasisLabel, changeBasisNote, futuresQuoteFromSettle, printPredatesChangeBasis, quoteChangeBasis, quotePreviousCloseDate, quoteSettleText } from "../../market-data/market/change-basis";
24
24
  import {
25
25
  EXTENDED_SESSION_LABELS,
@@ -60,7 +60,7 @@ import {
60
60
  ratingReason,
61
61
  } from "../../plugins/builtin/research/analyst-model";
62
62
  import { getPublishedUsEquityCalendarYears, getPublishedUsEquitySession } from "../../market-data/published-us-sessions";
63
- import { isQuoteStaleForCurrentSession, noPrintsTodayText } from "../../market-data/quotes/freshness";
63
+ import { awaitingFirstDelayedPrint, isQuoteStaleForCurrentSession, noPrintsTodayText } from "../../market-data/quotes/freshness";
64
64
  import {
65
65
  coinOptionsAlternativesText, isCoinWithoutOptions, isOptionsUnavailableError, listedOptionsAlternative, optionsUnavailableTitle,
66
66
  } from "../../market-data/options-alternatives";
@@ -75,7 +75,7 @@ import { latestFinancialPeriod } from "../../utils/latest-financial-period";
75
75
  import type { FuturesContractTermsPayload } from "../../api-client/futures-curve";
76
76
  import { currencyCodeLabel } from "../../utils/currency-units";
77
77
  import {
78
- futuresContractLines, futuresPricePer, futuresRollLines, isFuturesInstrument, loadFuturesPriceUnit, loadUsdPerMmbtu, usdPerMmbtuText, type UsdPerMmbtu,
78
+ futuresContractLines, futuresPricePer, futuresRollLines, futuresTickOption, isFuturesInstrument, loadFuturesPriceUnit, loadUsdPerMmbtu, usdPerMmbtuText, type UsdPerMmbtu,
79
79
  } from "../../market-data/futures-contract";
80
80
  import {
81
81
  chainHasExpiry,
@@ -129,6 +129,10 @@ import {
129
129
  import { historyCoverageNotice } from "../../sources/history-coverage";
130
130
  import { fetchHistoryResult } from "../../sources/history-result";
131
131
  import { settleWithin } from "../../utils/async-deadline";
132
+ import type { FxInterventionsPayload } from "../../api-client/fx-interventions";
133
+ import {
134
+ fxInterventionLatestNote, fxInterventionPair, fxInterventionWindowNote, loadFxInterventions, type FxInterventionPair,
135
+ } from "../../market-data/fx-interventions";
132
136
  import { maxDrawdownText } from "../../utils/max-drawdown";
133
137
  import { isPastPriceWindow, loadPriceWindowHistory, PRICE_WINDOW_FROM_HELP, PRICE_WINDOW_TO_HELP, priceWindowText, readPriceWindow, type PriceWindow } from "../../utils/price-window";
134
138
  import {
@@ -182,14 +186,14 @@ import { fail, isCliFailure, NO_DATA_CODE } from "../errors";
182
186
  import { createConcurrencyLimiter, mapWithConcurrency } from "../../utils/concurrency";
183
187
  import { MISSING_VOLUME_TEXT } from "../../utils/price-history-integrity";
184
188
  import { CRYPTO_BOARD_HINT, quoteNotes } from "./crypto-hints";
185
- import { bareFuturesCode, futuresBoardContract } from "../../market-data/futures-board";
189
+ import { bareFuturesCode, futuresBoardContract, futuresContractByWord } from "../../market-data/futures-board";
186
190
  import { commodityNamedIn, commoditySearchName } from "../../market-data/commodity-names";
187
191
  import { newsEmptyMessage } from "./news-hints";
192
+ import { METALS_NEWS_TOPIC } from "../../sources/gloomberb-cloud/news";
188
193
  import {
189
194
  closestStoriesReason,
190
195
  commodityNewsRoute,
191
196
  commonWordCandidate,
192
- METALS_NEWS_TOPIC,
193
197
  metalCodeNewsRoute,
194
198
  type MetalNewsRoute,
195
199
  metalNewsHeading,
@@ -198,6 +202,7 @@ import {
198
202
  newsSearchHeading,
199
203
  newsSearchText,
200
204
  newsSearchTextProblem,
205
+ newestFirst,
201
206
  noMetalStoriesMessage,
202
207
  noStoriesMessage,
203
208
  quotedSearchCommand,
@@ -205,13 +210,14 @@ import {
205
210
  searchNewsStories,
206
211
  wordMeansMore,
207
212
  } from "./news-search";
208
- import { formatUtcDayTime, formatUtcTime } from "../../utils/utc-time";
213
+ import { displayTimeZone, formatUtcDayTime, formatUtcTime } from "../../utils/utc-time";
214
+ import { localReportTiming } from "../../utils/report-timing";
209
215
  import { DAY_SO_FAR_TEXT, withSessionBar } from "../../time-series/session-bar";
210
216
  import { isFiniteNumber } from "../../utils/guards";
211
217
  import { exportedFundamentals } from "../../utils/price-earnings";
212
218
  import { withBankEnterpriseValue } from "../../utils/fundamentals";
213
219
  import { fundamentalsFreshness, quotesFreshness, rowsFreshness, valuationFreshness } from "../freshness";
214
- import { fxPairListing, fxQuoteRateObservation, readFxQuoteRate } from "../fx-quote-rate";
220
+ import { fxPairListing, fxQuoteRateObservation, METAL_NAMES, readFxQuoteRate } from "../fx-quote-rate";
215
221
  import { quoteBarNotes } from "../../market-data/quotes/intraday-bar";
216
222
  import { cedearRatioText, depositaryPairText, isReceiptSide, listingCedearRatio, listingDepositaryPair } from "../../market-data/depositary-pair";
217
223
  import { isPesoDollarPair, loadPesoDollarRates, pesoDollarRateLines, pesoDollarRatesJson } from "../peso-dollar-rates";
@@ -262,6 +268,7 @@ import {
262
268
  movedSymbolLine,
263
269
  ListingArgError,
264
270
  isNoProviderError,
271
+ isTitleCaseWord,
265
272
  requireCliListing,
266
273
  resolveCliListing,
267
274
  type CliListing,
@@ -272,7 +279,7 @@ import { liveCompanyQuestion } from "../company-name-hint";
272
279
  import { bareListingNote, listingFateNotes, loadNoQuoteLastTraded, noLongerTradingNote, noQuoteLastTraded, noQuoteLastTradeNote, SUCCESSOR_CHANGE_WAIT_MS, tradingListing, usVenueOf, type NoQuoteLastTrade } from "../../tickers/listing-fate";
273
280
  import { isYieldIndexSymbol } from "../../tickers/index-roots";
274
281
  import {
275
- analyzeTaxEquivalent, distributionBasis, loadTreasuryTenors, parseTaxRates, TAX_RATE_HELP_OPTIONS, taxEquivalentJson, type TaxRates,
282
+ analyzeTaxEquivalent, distributionBasis, loadTreasuryTenors, noBondFigures, parseTaxRates, TAX_RATE_HELP_OPTIONS, taxEquivalentJson, type TaxRates,
276
283
  } from "../../market-data/tax-equivalent";
277
284
  import { CBOE_YIELD_INDEX_CLOSE } from "../../plugins/builtin/shared/treasury-cutoffs";
278
285
  import { earningsCalendarFailure, earningsChoiceNote, earningsDateLabel, isListingAbroad, noListingCalendarNote, undatedListingsNote } from "../earnings-calendar";
@@ -294,6 +301,7 @@ import { phraseSearchReport } from "./search";
294
301
  import { secRegistrantMismatchMessage, SecRegistrantMismatchError, areDifferentCompanies } from "../../sources/sec-registrant";
295
302
  import { isCryptoPairSymbol, isRoundTheClockCoin } from "../../utils/crypto-pair";
296
303
  import { isUsListingExchange } from "../../utils/exchanges";
304
+ import { resolveTickerInstrumentKind } from "../../tickers/instrument-kind";
297
305
  import {
298
306
  describeFormerIssuer, describeTickerChange, movedAwayChange, startTickerChangeLookup, tickerChangeLine, type FormerIssuer, type TickerChange,
299
307
  } from "../../tickers/ticker-changes";
@@ -314,6 +322,9 @@ import {
314
322
  } from "../fx-forward";
315
323
  import { unavailableOnServer } from "../../plugins/builtin/shared/cloud-resource";
316
324
 
325
+ /** `08:00`: an instant's UTC clock. */
326
+ const utcClock = (time: number) => new Date(time).toISOString().slice(11, 16);
327
+
317
328
  /** `fx`'s forward form, for its usage line. */
318
329
  const FX_FORWARD_USAGE = "fx <base>/<quote> --forward <tenor>";
319
330
  import {
@@ -348,7 +359,7 @@ import {
348
359
  withIndexedHolders,
349
360
  } from "../../plugins/builtin/holders/index-holders";
350
361
  import { loadShownSecFilings } from "../../plugins/builtin/sec/forms";
351
- import { currentReportItemsLabel, hiddenFilingsMetadata, hiddenFilingsNote, type HiddenFilings } from "../../utils/sec-filings";
362
+ import { currentReportItemsLabel, form4TradeText, hiddenFilingsMetadata, hiddenFilingsNote, type HiddenFilings } from "../../utils/sec-filings";
352
363
  import { INSIDER_REPORT_FILINGS, loadParsedInsiderFilings } from "../../plugins/builtin/insider/client";
353
364
  import { insiderEmptyNotice, loadHomeInsiderReportsNote } from "../../plugins/builtin/insider/issuer";
354
365
  import { buildInsiderSummary } from "../../plugins/builtin/insider/model";
@@ -412,6 +423,16 @@ export function readHistoryRange(value: string): HistoryRange | null {
412
423
  return VALID_RANGES.has(range) ? range : null;
413
424
  }
414
425
 
426
+ /**
427
+ * The range a symbol's place holds, typed as a count and a unit (`1mo`, `3m`,
428
+ * `5 days`), or null. `history CC=F 1mo` loaded 1MO, a Milan listing, beside
429
+ * cocoa. A bare word stays a symbol: ALL and MAX are listings, and YTD only
430
+ * means a range after --range.
431
+ */
432
+ function rangeTypedAsSymbol(entry: string): HistoryRange | null {
433
+ return /^\s*\d+\s*[a-z]+\s*$/i.test(entry) ? readHistoryRange(entry) : null;
434
+ }
435
+
415
436
  function parseRange(value: string | undefined, ctx: Parameters<CliCommandDef["execute"]>[1]): HistoryRange {
416
437
  const range = readHistoryRange(value ?? "1Y");
417
438
  if (!range) ctx.fail(`Unknown range "${value}".`, `Use one of ${HISTORY_RANGES.join(", ")}.`);
@@ -432,9 +453,12 @@ function normalizeSymbols(args: string[]): string[] {
432
453
  return uniqueEntries(splitSymbolArgs(args));
433
454
  }
434
455
 
435
- /** Each entry once, a symbol upper-cased and a company's name in its typed case. */
456
+ /**
457
+ * Each entry once, a symbol upper-cased and a company's name in its typed case, a word written as a name
458
+ * (`Aeon`) too: it may be a company's name as much as a ticker (`titleCaseCompanyName`).
459
+ */
436
460
  function uniqueEntries(entries: readonly string[]): string[] {
437
- return uniqueSecuritySymbols(entries.map((entry) => isCompanyNameInput(entry) ? entry : entry.toUpperCase()));
461
+ return uniqueSecuritySymbols(entries.map((entry) => isCompanyNameInput(entry) || isTitleCaseWord(entry) ? entry : entry.toUpperCase()));
438
462
  }
439
463
 
440
464
  /**
@@ -559,7 +583,8 @@ const CHANGE_BASIS_EXPORT_COLUMNS = [
559
583
  * low and high) are already in the table's own cells.
560
584
  */
561
585
  function quoteTextColumns<Column extends { key: string }>(columns: Column[]): Array<Column | typeof CHANGE_BASIS_COLUMN> {
562
- const exported = new Set([...CHANGE_BASIS_EXPORT_COLUMNS, ...EXTENDED_CHANGE_EXPORT_COLUMNS, ...DAY_RANGE_EXPORT_COLUMNS].map((column) => column.key));
586
+ const exported = new Set([...CHANGE_BASIS_EXPORT_COLUMNS, ...EXTENDED_CHANGE_EXPORT_COLUMNS, ...DAY_RANGE_EXPORT_COLUMNS, CHANGE_BP_EXPORT_COLUMN]
587
+ .map((column) => column.key));
563
588
  const kept = columns.filter((column) => !exported.has(column.key));
564
589
  const at = kept.findIndex((column) => column.key === "changePercent") + 1;
565
590
  return [...kept.slice(0, at), CHANGE_BASIS_COLUMN, ...kept.slice(at)];
@@ -676,6 +701,14 @@ function quoteColumns() {
676
701
  ];
677
702
  }
678
703
 
704
+ /**
705
+ * A yield index's move in basis points, the move the table shows (`+2.2bp`), which an export of a table holding a
706
+ * yield adds after its other columns; Chg% keeps the percent change it always held, blank for no yield.
707
+ */
708
+ const CHANGE_BP_EXPORT_COLUMN = {
709
+ key: "changeBasisPoints", header: "Chg bp", value: (row: QuoteRow) => row.yieldIndex ? row.changeBasisPoints : null,
710
+ };
711
+
679
712
  /** The day's low and high as numbers, after the columns an export already had. */
680
713
  const DAY_RANGE_EXPORT_COLUMNS = [
681
714
  { key: "dayLow", header: "Day Low", value: (row: QuoteRow) => exportFigure(row.rawDayLow) },
@@ -765,6 +798,8 @@ function quoteRows(results: QuoteCliRecord[], now = Date.now()) {
765
798
  const nearParDigits = nearParCoinPriceDigits(quote);
766
799
  const options = {
767
800
  ...quoteFormatOptions(quote),
801
+ // A contract prints to its tick: the yen's 0.0063270, the euro's 1.11570.
802
+ ...futuresTickOption(result.futuresContract),
768
803
  minimumFractionDigits: indexPoints ? 2 : currencyPriceMinDigits(quote?.currency),
769
804
  // A coin near a dollar prints to four decimals, as `ticker`, `G` and CRYP print it.
770
805
  ...nearParDigits != null ? { fixedFractionDigits: nearParDigits } : {},
@@ -869,6 +904,8 @@ function filingRows(filings: SecFilingItem[]) {
869
904
  items: secFilingItemCodes(filing.items) ?? "",
870
905
  // A current report's items by number and name: the results 8-K reads apart from another filed that day.
871
906
  itemsLabel: currentReportItemsLabel(filing.items) ?? "",
907
+ // A Form 4's trade: whose shares, which way, how many and at what price.
908
+ trade: form4TradeText(filing) ?? "",
872
909
  }));
873
910
  }
874
911
 
@@ -1006,6 +1043,10 @@ function earningsRows(events: ResolvedEarningsEvent[]) {
1006
1043
  // Out, announced by the company, or projected from its past reports.
1007
1044
  status: earningsDateLabel(event.dateStatus),
1008
1045
  timing: event.timing,
1046
+ // The company's own time when it announced one ("at 21:00 SGT Sat 7 Nov"), else with a
1047
+ // timezone set the session on the reader's clock: "after close, about 05:05 SGT Tue 10 Nov".
1048
+ localTiming: localReportTiming(isoDate(event.earningsDate).slice(0, 10),
1049
+ event.timing === "AMC" ? "amc" : event.timing === "BMO" ? "bmo" : null, displayTimeZone(), event.releaseAt) ?? "",
1009
1050
  epsEstimate: event.epsEstimate,
1010
1051
  epsActual: event.epsActual,
1011
1052
  revenueEstimate: event.revenueEstimate,
@@ -1185,21 +1226,39 @@ async function runQuote(rawArgs: string[], ctx: Parameters<CliCommandDef["execut
1185
1226
  const label = `${row.target.symbol}${row.listing.name ? ` (${row.listing.name})` : ""}`;
1186
1227
  const stopped = noLongerTradingNote(label, row.quote, now);
1187
1228
  const ended = stopped && liveCompanies[index] ? `${stopped}. ${liveCompanies[index]}` : stopped;
1188
- const quiet = ended ? null : noPrintsTodayText(row.quote, now);
1189
- return [ended ?? (quiet ? `${label}: ${quiet}` : []), quoteBarNotes(label, row.quote, now)].flat();
1229
+ // Open by its venue's calendar, before the delayed feed's first print: Last is the previous close until then.
1230
+ const awaiting = ended ? null : awaitingFirstDelayedPrint(row.quote, now);
1231
+ const quiet = ended || awaiting ? null : noPrintsTodayText(row.quote, now);
1232
+ const waiting = awaiting && row.quote
1233
+ ? `${label}: open since ${utcClock(awaiting.open)} UTC; Last is the previous close until the first delayed print, about ${utcClock(awaiting.expected)} UTC`
1234
+ : null;
1235
+ return [ended ?? (quiet ? `${label}: ${quiet}` : waiting ?? []), quoteBarNotes(label, row.quote, now)].flat();
1190
1236
  }),
1191
- // A receipt and its home line each say the ratio, as `ticker` does; a CEDEAR names itself in its own.
1237
+ // A receipt says the ratio, as `ticker` does, and its home line too when the receipt is in the table; a CEDEAR names itself
1238
+ // in its own. A plain RHM.DE or BA.L quote involves no ADR, so it says nothing of one.
1192
1239
  ...data.flatMap((row) => {
1193
1240
  const cedear = listingCedearRatio({ quote: row.quote });
1194
1241
  if (cedear) return [`${cedearRatioText(cedear)}.`];
1195
1242
  const pair = listingDepositaryPair({ quote: row.quote });
1196
- return pair ? [`${row.target.symbol}: ${depositaryPairText(pair, isReceiptSide({ quote: row.quote }))}.`] : [];
1243
+ if (!pair) return [];
1244
+ const receiptSide = isReceiptSide({ quote: row.quote });
1245
+ const receiptQuoted = receiptSide || data.some((other) => other !== row && isReceiptSide({ quote: other.quote })
1246
+ && listingDepositaryPair({ quote: other.quote })?.receipt === pair.receipt);
1247
+ return receiptQuoted ? [`${row.target.symbol}: ${depositaryPairText(pair, receiptSide)}.`] : [];
1197
1248
  }),
1198
1249
  ...endedNotes.flatMap((note) => note ?? []),
1250
+ // A commodity's word read as a security's ticker (WTI is W&T Offshore, GOLD is Gold.com) names the future it may have meant.
1251
+ ...data.flatMap((row, index) => {
1252
+ const listing = asked[index]!;
1253
+ const contract = listing.exchange || !row.quote || isFuturesInstrument(row.target.symbol, row.quote.instrumentType)
1254
+ ? null : futuresContractByWord(row.target.symbol);
1255
+ return contract ? [`${row.target.symbol} is ${row.listing.name || "a security"}; for ${contract.name}, quote the future ${contract.symbol}.`] : [];
1256
+ }),
1199
1257
  // A cell shows only "unavailable", and an exported row only its status, so stderr names each failure; the JSON rows carry each reason.
1200
1258
  ...ctx.cliOptions.format !== "json" ? quoteNotes(data.filter((_row, index) => !endedNotes[index])) : [],
1201
1259
  ];
1202
- const columns = commandName === "compare" ? compareColumns() : quoteColumns();
1260
+ const holdsYield = data.some((row) => isYieldIndexSymbol(row.target.symbol));
1261
+ const columns = [...commandName === "compare" ? compareColumns() : quoteColumns(), ...holdsYield ? [CHANGE_BP_EXPORT_COLUMN] : []];
1203
1262
  const basisNotes = changeBasisNotes(data, now);
1204
1263
  const midNotes = extendedMidNotes(data);
1205
1264
  if (ctx.cliOptions.format !== "json") await primeBoardCoins(notes);
@@ -1223,7 +1282,9 @@ async function runQuote(rawArgs: string[], ctx: Parameters<CliCommandDef["execut
1223
1282
  symbolOrSeries: row.symbol,
1224
1283
  // A pair's rate is its quote currency per base: JPY per USD, as `history` and `fx` export it.
1225
1284
  currencyOrUnit: (row.currency && pairExportUnit(row.symbol, row.currency))
1226
- || row.currency || (row.yieldIndex ? "pct" : isIndexLevel(row.instrumentType) ? INDEX_POINTS_EXPORT_UNIT : null),
1285
+ || row.currency || (row.yieldIndex ? YIELD_INDEX_EXPORT_UNIT : isIndexLevel(row.instrumentType) ? INDEX_POINTS_EXPORT_UNIT : null),
1286
+ // Each row as of its own price (^TNX's 19:59 beside ^VIX's 21:15), as Updated says; a row with none is blank.
1287
+ asOf: row.updatedAt || null,
1227
1288
  }),
1228
1289
  // A row with no price or move says why in its status column, as the warnings do.
1229
1290
  exportStatus: quoteExportStatus,
@@ -1324,7 +1385,8 @@ function quoteFuturesContractText(data: QuoteCliRecord[]): string {
1324
1385
  // The move Chg% gives, in the quote's money and with what it is measured from: "vs Fri settle".
1325
1386
  const session = getRegularSessionDisplay(row.quote);
1326
1387
  const change: Array<[string, string]> = session?.change != null && Number.isFinite(session.change)
1327
- ? [["Change", quoteChangeText(row.quote, session, withCurrencyMinorDigits(quoteFormatOptions(row.quote, "FUTURE"), row.quote.currency), terms)]]
1388
+ ? [["Change", quoteChangeText(row.quote, session, { ...withCurrencyMinorDigits(quoteFormatOptions(row.quote, "FUTURE"), row.quote.currency),
1389
+ ...futuresTickOption(terms) }, terms)]]
1328
1390
  : [];
1329
1391
  // European gas beside Henry Hub: "≈ $30.832/MMBtu at EUR/USD 1.1650", a conversion that says so.
1330
1392
  const inUsd = row.usdPerMmbtu;
@@ -1450,6 +1512,35 @@ function historyCommand({ range, window }: HistoryAsk): string {
1450
1512
 
1451
1513
  /** How long `history` waits for a future's contract terms to name its unit before using the catalog's. */
1452
1514
  const HISTORY_PRICE_UNIT_WAIT_MS = 1_500;
1515
+ /** How long a yen pair's answer waits for Japan's intervention record, read beside it; the note is left out after. */
1516
+ const INTERVENTION_NOTE_WAIT_MS = 3_000;
1517
+
1518
+ /** Japan's intervention record for a yen pair, read beside its rate or bars; null for any other pair, or none in time. */
1519
+ function loadInterventionsFor(pair: FxInterventionPair | null, market: MarketContext): Promise<FxInterventionsPayload | null> {
1520
+ return pair ? settleWithin((market.fxInterventions ?? (() => loadFxInterventions()))(), INTERVENTION_NOTE_WAIT_MS) : Promise.resolve(null);
1521
+ }
1522
+
1523
+ /** The last day a bar's period covers: a weekly bar's Sunday, a monthly bar's month end, else its own day. */
1524
+ function barPeriodEnd(date: string, interval: string | null | undefined): string {
1525
+ const start = Date.parse(`${date}T00:00:00Z`);
1526
+ if (interval === "1wk") return new Date(start + 6 * 86_400_000).toISOString().slice(0, 10);
1527
+ if (interval !== "1mo") return date;
1528
+ const day = new Date(start);
1529
+ return new Date(Date.UTC(day.getUTCFullYear(), day.getUTCMonth() + 1, 0)).toISOString().slice(0, 10);
1530
+ }
1531
+
1532
+ /** The interventions from the first bar shown to the end of the last one's period. */
1533
+ async function interventionWindowNote(
1534
+ record: Promise<FxInterventionsPayload | null>,
1535
+ pair: FxInterventionPair | null,
1536
+ rows: readonly { date: string; interval?: string | null }[],
1537
+ ): Promise<string | null> {
1538
+ const first = rows[0]?.date.slice(0, 10), lastRow = rows.at(-1);
1539
+ const last = lastRow ? barPeriodEnd(lastRow.date.slice(0, 10), lastRow.interval) : undefined;
1540
+ if (!pair || !first || !last) return null;
1541
+ const payload = await record;
1542
+ return payload ? fxInterventionWindowNote(payload, pair, first, last) : null;
1543
+ }
1453
1544
 
1454
1545
  /** How long `history` waits for the daily bars that rebuild contradictory monthly bars before printing them with blanks. */
1455
1546
  const MONTHLY_REBUILD_WAIT_MS = 8_000;
@@ -1511,6 +1602,9 @@ async function loadListingHistory(
1511
1602
  // A future's prices are in its contract's unit (US cents / bushel), as FUT and G spell it; asked beside the bars.
1512
1603
  const priceUnit = isFuturesInstrument(symbol, null) ? settleWithin(loadFuturesPriceUnit(symbol), HISTORY_PRICE_UNIT_WAIT_MS) : Promise.resolve(null);
1513
1604
  const quoted = quoteAnswer.then((answer) => answer.quote);
1605
+ // USDJPY=X's bars name Japan's interventions they span.
1606
+ const interventionPair = fxInterventionPair(symbol, exchange);
1607
+ const interventions = loadInterventionsFor(interventionPair, market);
1514
1608
  const fate = lookups ? listingFateLoader(listing, market, quoted, { successor: true }) : null;
1515
1609
  const request = { command: historyCommand(ask), noun: "history", ...(fate ? { fate } : {}) };
1516
1610
  const [answered, quote] = await Promise.all([
@@ -1543,7 +1637,14 @@ async function loadListingHistory(
1543
1637
  const pair = quote?.instrumentType === "CURRENCY" || isCurrencyPairListing(symbol, exchange);
1544
1638
  // A London line's bars were priced in pence: cleaned there, and printed to the pence decimals `quote` shows.
1545
1639
  const priceDivisor = quotedPriceDivisor(quote);
1546
- const barRows = historyRows(pair ? points.map(({ volume: _volume, ...point }) => point) : points, resolution, unit.currency, unit.unit, volume, priceDivisor);
1640
+ // An index's uncounted 0 (^HSI's hourly bars) is blank, as `quote` and HP leave it.
1641
+ const instrumentType = quote?.instrumentType ?? listed?.instrumentType;
1642
+ const counted = pair ? points.map(({ volume: _volume, ...point }) => point)
1643
+ : isIndexLevel(instrumentType) ? points.map(({ volume: barVolume, ...point }) => {
1644
+ const reported = indexBarVolume(barVolume, instrumentType);
1645
+ return reported == null ? point : { ...point, volume: reported };
1646
+ }) : points;
1647
+ const barRows = historyRows(counted, resolution, unit.currency, unit.unit, volume, priceDivisor);
1547
1648
  // A monthly bar whose prices contradict each other keeps its close; its open, high and low come from the daily bars.
1548
1649
  const rows = await withMonthlyBarsRebuilt(barRows, market, symbol, exchange, context, priceDivisor,
1549
1650
  quote?.listingExchangeName || exchange || "");
@@ -1606,6 +1707,7 @@ async function loadListingHistory(
1606
1707
  // NG=F's rows are November's to the 23rd and December's from the 26th: each roll named, and thin bars said.
1607
1708
  historyRollNote(listing.symbol, data) ?? [], historyThinNote(data) ?? [],
1608
1709
  historyBarStatusNote(forming ? served : data, { tradingDay: venueTradingDay(venue, Date.now()) }) ?? [],
1710
+ await interventionWindowNote(interventions, interventionPair, data) ?? [],
1609
1711
  ].flat();
1610
1712
  return {
1611
1713
  listing, identity, unit, data, resolution, interval, intraday, volume, freshness, notes,
@@ -1746,6 +1848,19 @@ async function runHistory(rawArgs: string[], ctx: Parameters<CliCommandDef["exec
1746
1848
  const currency = file != null || requestedExchange ? null : currencyNameStop(args, "history");
1747
1849
  if (currency) ctx.fail(currency.message, currency.details);
1748
1850
  if (wide || file != null || args.includes("-") || uniqueEntries(args).length > 1 || args.some((arg) => /[,;]/.test(arg))) {
1851
+ // `history CC=F 1mo` asks for a month of cocoa, not for cocoa and 1MO: it says which option reads it.
1852
+ const typedRange = rangeOption == null && !window ? args.find((arg) => rangeTypedAsSymbol(arg)) : undefined;
1853
+ if (typedRange) {
1854
+ // The command as typed with the range moved to --range: its other options (--wide, --exchange) and the output
1855
+ // flags read before the command (--csv, --limit) stay.
1856
+ const range = rangeTypedAsSymbol(typedRange)!;
1857
+ const at = rawArgs.indexOf(typedRange);
1858
+ const { format, limit, tail } = ctx.cliOptions;
1859
+ const words = [...rawArgs.filter((_arg, index) => index !== at), "--range", range,
1860
+ ...format === "text" ? [] : [`--${format}`], ...limit == null ? [] : ["--limit", String(limit)], ...tail == null ? [] : ["--tail", String(tail)]];
1861
+ const shell = (arg: string) => /[\s"'$`\\!&|;<>()*?#~]/.test(arg) ? `"${arg.replace(/(["\\$`])/g, "\\$1")}"` : arg;
1862
+ ctx.fail(`"${typedRange}" reads as a range, not a symbol: give it as --range ${range}.`, `gloom history ${words.map(shell).join(" ")}`);
1863
+ }
1749
1864
  if (backAdjust) ctx.fail("--back-adjust stitches one continuous future, such as ES=F.", `Usage: gloom ${HISTORY_USAGE}`);
1750
1865
  return runHistoryList(args, file, requestedExchange, ask, ctx, { wide });
1751
1866
  }
@@ -2240,9 +2355,8 @@ async function runFinancials(rawArgs: string[], ctx: Parameters<CliCommandDef["e
2240
2355
  const distributions = view === "statements" ? null : loadDividendDistributions(
2241
2356
  market.dataProvider, listing.request, financials, { declared: ctx.cliOptions.format !== "json" });
2242
2357
  // A fund's facts: its bond figures beside its distribution yield, and whether fn ETF has any to point to.
2243
- const fundFacts = view === "statements" ? null : loadReportFundFacts(listing.request.symbol,
2244
- financials.quote?.tradingExchangeName || listing.request.exchange || financials.quote?.listingExchangeName || financials.quote?.exchangeName,
2245
- financials, listing.saved);
2358
+ const fundVenue = financials.quote?.tradingExchangeName || listing.request.exchange || financials.quote?.listingExchangeName || financials.quote?.exchangeName;
2359
+ const fundFacts = view === "statements" ? null : loadReportFundFacts(listing.request.symbol, fundVenue, financials, listing.saved);
2246
2360
  const treasury = rates ? loadTreasuryTenors() : null;
2247
2361
  const identity = listingIdentity(listing, financials.quote);
2248
2362
  const choice = await listingChoiceNotes(listing, market, financials.quote, venues);
@@ -2274,6 +2388,9 @@ async function runFinancials(rawArgs: string[], ctx: Parameters<CliCommandDef["e
2274
2388
  // On the SEC yield when the sponsor publishes one, else the distribution yield the line above shows.
2275
2389
  const taxEquivalent = rates ? analyzeTaxEquivalent({
2276
2390
  symbol: identity.symbol || listing.key, bond, rates, treasury: await treasury,
2391
+ // A stock, or a fund listed abroad, says why it has no bond figures rather than that none are loaded,
2392
+ // once its quote says what it is.
2393
+ noBondFigures: financials.quote ? noBondFigures(resolveTickerInstrumentKind(listing.saved, financials), fundVenue) : null,
2277
2394
  distribution: distributionBasis(priced.fundamentals?.dividendYield, priced.fundamentals?.dividendYieldBasis === "trailing" ? "trailing" : "forward"),
2278
2395
  }) : null;
2279
2396
  const report = { ...data, distributions: await distributions, statementFilings, bank: bank.bank, bankNote: bank.note, bondFund: bond, fundFacts: facts, taxEquivalent,
@@ -2501,6 +2618,14 @@ async function runNews(rawArgs: string[], ctx: Parameters<CliCommandDef["execute
2501
2618
  quoteLoad,
2502
2619
  ]);
2503
2620
  const searchedFor = listing ? articles[0]?.searchedFor : undefined;
2621
+ // A future's feed already searched its commodity's stories when none are filed under it (the pane reads the same
2622
+ // way): they print as they did when this command searched them, newest first under "the commodity KC=F trades".
2623
+ const searchedFuture = listing && searchedFor && !listing.exchange && !feed && isFuturesInstrument(listing.symbol, quote?.instrumentType)
2624
+ ? futuresBoardContract(listing.symbol) ?? bareFuturesCode(args[0]) : null;
2625
+ if (searchedFuture && commoditySearchName(searchedFuture) === searchedFor) {
2626
+ await printNewsSearch(searchedFor, newestFirst(articles), { reason: `the commodity ${searchedFuture.symbol} trades`, commodity: false }, ctx);
2627
+ return;
2628
+ }
2504
2629
  if (listing && searchedFor) {
2505
2630
  await printNewsSearch(searchedFor, articles, { reason: `no stories filed under ${listing.symbol}`, ticker: listing.key }, ctx);
2506
2631
  return;
@@ -2577,6 +2702,7 @@ const FILING_COLUMNS = [
2577
2702
  { key: "items", header: "Items" },
2578
2703
  { key: "itemsLabel", header: "Item names" },
2579
2704
  { key: "pressReleaseUrl", header: "Press release URL" },
2705
+ { key: "trade", header: "Trade" },
2580
2706
  ];
2581
2707
 
2582
2708
  // The text table names the items before the URL, which a narrow terminal drops first. A current report's
@@ -2585,7 +2711,8 @@ const FILING_TEXT_COLUMNS = [
2585
2711
  { key: "filingDate", header: "Date" },
2586
2712
  { key: "form", header: "Form" },
2587
2713
  { key: "companyName", header: "Company", maxWidth: 24 },
2588
- { key: "itemsLabel", header: "Items" },
2714
+ // A current report's items; a Form 4's trade, which its filer's name alone does not say.
2715
+ { key: "itemsLabel", header: "Items", format: (value: unknown, row: Record<string, unknown>) => String(value || row.trade || "") },
2589
2716
  { key: "url", header: "URL", optional: true,
2590
2717
  format: (value: unknown, row: Record<string, unknown>) => String(row.pressReleaseUrl || (value ?? "")) },
2591
2718
  ];
@@ -3170,6 +3297,9 @@ async function runOptions(rawArgs: string[], ctx: Parameters<CliCommandDef["exec
3170
3297
  const { value: expiration, flag: expirationFlag } = expirationOption;
3171
3298
  if (expirationOption.both) ctx.fail("--expiry is --expiration; give one of them.", `Usage: gloom ${OPTIONS_USAGE}`);
3172
3299
  const exchangeOption = takeOption(args, "--exchange");
3300
+ // Contracts a corporate action adjusted (ETHA1) price another deliverable: listed only when asked for.
3301
+ const adjusted = takeFlag(args, "--adjusted");
3302
+ if (adjusted && leapsOptions.leaps) ctx.fail("--adjusted lists one chain's adjusted contracts; it does not apply with --leaps.", `Usage: gloom ${OPTIONS_USAGE}`);
3173
3303
  if (leapsOptions.leaps) {
3174
3304
  // With --leaps, --expiration is a window of one expiry.
3175
3305
  const criteria = parseLeapsCriteria({ ...leapsOptions.raw, ...expirationOption.given ? { "--expiration": expiration ?? "" } : {} });
@@ -3206,6 +3336,12 @@ async function runOptions(rawArgs: string[], ctx: Parameters<CliCommandDef["exec
3206
3336
  // Expiries close on the listing's clock: a coin's options (Deribit) settle at 08:00 UTC on any day.
3207
3337
  const expiryVenue = optionExpiryVenue(symbol, exchange);
3208
3338
  const readChain = async (expiry: number | undefined) => {
3339
+ // The adjusted contracts are their own request, never the standard chain's cached one.
3340
+ if (adjusted) {
3341
+ return { result: undefined, chain: await market.dataProvider.getOptionsChain(symbol, exchange, expiry, {
3342
+ cacheMode: refresh ? "refresh" : "default", adjustedOptions: true,
3343
+ }) };
3344
+ }
3209
3345
  const cached = await market.dataProvider.getCachedQuery?.("getOptionsChain", [symbol, exchange, expiry, undefined])
3210
3346
  .load({ force: refresh });
3211
3347
  return {
@@ -3259,8 +3395,10 @@ async function runOptions(rawArgs: string[], ctx: Parameters<CliCommandDef["exec
3259
3395
  }
3260
3396
  const quote = await quotePromise;
3261
3397
  const identity = listingIdentity(listing, quote);
3262
- // IV and delta are valued at one spot and instant, named under the table and on every exported row.
3263
- const { chain, spot: modelSpot } = valueChainAtModelSpot(loaded, inputs, Date.now(), identity.exchange);
3398
+ // IV and delta are valued at one spot and instant, named under the table and on every exported row. Adjusted
3399
+ // contracts deliver something other than 100 shares, so the spot values none of them.
3400
+ const { chain, spot: modelSpot } = adjusted ? { chain: loaded, spot: null }
3401
+ : valueChainAtModelSpot(loaded, inputs, Date.now(), identity.exchange);
3264
3402
  const basis: OptionsChainBasis = { spot: modelSpot, dividendYield: inputs.dividendYield ?? null,
3265
3403
  openInterest: await loadOptionsChainOpenInterest(symbol, chain), ivFilled: chainHasFilledIv(chain) };
3266
3404
  const basisFields = optionsBasisFields(basis);
@@ -3274,7 +3412,7 @@ async function runOptions(rawArgs: string[], ctx: Parameters<CliCommandDef["exec
3274
3412
  // A venue that marks its contracts (Deribit) states IV and greeks without a quote.
3275
3413
  const marked = isMarkedChain(chain);
3276
3414
  const coin = chainCoinCurrency(chain);
3277
- const modelWarning = !marked && inputs.spot == null && (chain.calls.length > 0 || chain.puts.length > 0)
3415
+ const modelWarning = !marked && !adjusted && inputs.spot == null && (chain.calls.length > 0 || chain.puts.length > 0)
3278
3416
  ? `IV and delta need a current ${listing.key} quote; those columns are blank`
3279
3417
  : null;
3280
3418
  const listed = chain.expirationDates.length > 0 || chain.calls.length > 0 || chain.puts.length > 0;
@@ -3321,7 +3459,7 @@ async function runOptions(rawArgs: string[], ctx: Parameters<CliCommandDef["exec
3321
3459
  rows: (data: OptionsChain) => optionRows(data).map((row) => ({ ...row, ...basisFields })),
3322
3460
  // Choosing an expiry needs the list; once one is chosen the table is that expiry.
3323
3461
  summary: (data: OptionsChain) => expirationDate == null ? formatExpiryList(data.expirationDates) : "",
3324
- empty: `No option contracts for ${listingTitle(identity)}.`,
3462
+ empty: adjusted ? `No adjusted option contracts for ${listingTitle(identity)} on this expiry.` : `No option contracts for ${listingTitle(identity)}.`,
3325
3463
  ...(contractCount > 0 ? { footnote: optionsBasisFootnote(basis, chain) } : {}),
3326
3464
  exportIdentity: { symbolOrSeries: listing.key, currencyOrUnit: currency, interval: OPTIONS_EXPORT_INTERVAL },
3327
3465
  // Exports state each decimal's unit in its header and end every row with the spot and dates it is as of.
@@ -3338,6 +3476,8 @@ async function runOptions(rawArgs: string[], ctx: Parameters<CliCommandDef["exec
3338
3476
  { key: "delta", header: "Delta (decimal)" },
3339
3477
  { key: "volume", header: "Vol" },
3340
3478
  { key: "openInterest", header: "OI" },
3479
+ { key: "quoteStale", header: "Quote stale" },
3480
+ ...(adjusted ? [{ key: "deliverable", header: "Deliverable" }] : []),
3341
3481
  { key: "spot", header: "Spot" },
3342
3482
  { key: "spotBasis", header: "Spot basis" },
3343
3483
  { key: "spotAsOf", header: "Spot as of" },
@@ -3382,6 +3522,7 @@ async function runOptions(rawArgs: string[], ctx: Parameters<CliCommandDef["exec
3382
3522
  { key: "delta", header: "Delta", align: "right", format: formatOptionDeltaCell },
3383
3523
  { key: "volume", header: "Vol", align: "right", format: formatCountCell, optional: true, dropPriority: 1 },
3384
3524
  { key: "openInterest", header: "OI", align: "right", format: formatCountCell, optional: true, dropPriority: 1 },
3525
+ ...(adjusted ? [{ key: "deliverable", header: "Deliverable", format: (value: unknown) => typeof value === "string" ? value : "not stated" }] : []),
3385
3526
  ],
3386
3527
  });
3387
3528
  });
@@ -3524,6 +3665,10 @@ async function runFx(rawArgs: string[], ctx: Parameters<CliCommandDef["execute"]
3524
3665
  (payload) => ({ payload }),
3525
3666
  (error: unknown) => ({ error: unavailableOnServer(error, "Forwards are not available from Gloom Cloud yet: it serves no short rates.") }),
3526
3667
  ) : null;
3668
+ // A yen pair's rate names Japan's latest intervention in it; a conversion is about the amount, not the pair.
3669
+ const interventionPair = amount == null && !tenor && currency !== baseCurrency && (currency === "JPY" || baseCurrency === "JPY")
3670
+ ? { base: currency, quote: baseCurrency } : null;
3671
+ const interventions = loadInterventionsFor(interventionPair, market);
3527
3672
  // The pair's own quote, as `quote` and the FX board read it; a pair with none is crossed through the dollar.
3528
3673
  const now = Date.now();
3529
3674
  const read = await readFxQuoteRate(currency, baseCurrency, (targets, options) => market.dataProvider.getQuotesBatch(targets, options),
@@ -3551,6 +3696,7 @@ async function runFx(rawArgs: string[], ctx: Parameters<CliCommandDef["execute"]
3551
3696
  const row = {
3552
3697
  currency, baseCurrency, rate, asOf, stale, pair, inverse: 1 / rate,
3553
3698
  ...(quoted ? { quotes: quoted.quotes.map(({ symbol }) => symbol), ...(quoted.viaUsd ? { via: "USD" } : {}) } : {}),
3699
+ ...(quoted?.derivedFrom ? { derived: true, derivedFrom: quoted.derivedFrom } : {}),
3554
3700
  ...(amount == null ? {} : { amount, converted }),
3555
3701
  };
3556
3702
  // The closing line is the quote's own, as `quote` prints it: its time, and stale once older than the feed's delay.
@@ -3577,7 +3723,11 @@ async function runFx(rawArgs: string[], ctx: Parameters<CliCommandDef["execute"]
3577
3723
  const rateFields = (short: typeof base.rate) => ({
3578
3724
  currency: short.currency, name: short.name, tenor: short.tenor, value: short.value, asOf: short.asOf,
3579
3725
  dayCountBasis: short.dayCountBasis, publisher: short.publisher, sourceUrl: short.sourceUrl, stale: short.stale,
3726
+ ...(short.attribution ? { attribution: short.attribution } : {}),
3580
3727
  });
3728
+ // A publisher's licence asks for its attribution wherever its rate is shown (MAS's SORA).
3729
+ const attributions = [...new Set([base.rate, quote.rate].flatMap((short) => short.attribution
3730
+ ? [`${short.name}: ${short.attribution.text.replace(/\.$/, "")} (${short.attribution.licenceUrl}).`] : []))];
3581
3731
  const staleRates = [base.rate, quote.rate].filter((short) => short.stale)
3582
3732
  .map((short) => `${short.name} (${short.currency}) is the last copy read, dated ${short.asOf ?? "undated"}; its source could not be read since.`);
3583
3733
  const forwardRow = {
@@ -3595,6 +3745,7 @@ async function runFx(rawArgs: string[], ctx: Parameters<CliCommandDef["execute"]
3595
3745
  `${currency} rate: ${describeShortRate(base.rate)}`,
3596
3746
  `${baseCurrency} rate: ${describeShortRate(quote.rate)}`,
3597
3747
  `Covered interest parity: ${formatFxRate(rate)} × ${growth(quote.rate)} / ${growth(base.rate)}; each rate earns simple interest over the ${tenor.days} days, standing in for a ${tenor.label} term rate.`,
3748
+ ...attributions,
3598
3749
  ].join("\n"),
3599
3750
  exportIdentity: { symbolOrSeries: pair, currencyOrUnit: `${baseCurrency} per ${currency}`, interval: `forward ${tenor.label}` },
3600
3751
  columns: [
@@ -3619,15 +3770,21 @@ async function runFx(rawArgs: string[], ctx: Parameters<CliCommandDef["execute"]
3619
3770
  : [],
3620
3771
  ...rateNotes,
3621
3772
  ];
3773
+ const record = await interventions;
3774
+ const interventionNote = record && interventionPair ? fxInterventionLatestNote(record, interventionPair) : null;
3775
+ if (interventionNote) warnings.push(interventionNote);
3622
3776
  // The peso's dollar rate is the official one; the market rates Buenos Aires prices imply follow it, each with its inputs.
3623
3777
  const peso = isPesoDollarPair(currency, baseCurrency)
3624
3778
  ? await loadPesoDollarRates((targets) => market.dataProvider.getQuotesBatch(targets, { forceRefresh: ctx.cliOptions.refresh }))
3625
3779
  : null;
3626
3780
  if (peso && peso.missing.length > 0) warnings.push(`No price for ${peso.missing.join(", ")}, so the rates from ${peso.missing.length === 1 ? "it are" : "them are"} left out.`);
3627
3781
  // A cross says so, naming the dollar pairs it is read from: the pair has no quote of its own.
3782
+ // A metal with no spot quote is priced from its front-month future, and says so.
3783
+ const metal = quoted?.derivedFrom ? (METAL_NAMES[currency] ? currency : baseCurrency) : null;
3628
3784
  const rateText = [
3629
3785
  describeFxRate(request, rate, quoted && !quoted.viaUsd ? quoted.quotes[0] : undefined),
3630
3786
  ...quoted?.viaUsd ? [describeFxLegs(quoted.quotes)] : [],
3787
+ ...metal ? [`derived: ${METAL_NAMES[metal]!.toLowerCase()} from ${quoted!.derivedFrom}, the front-month future (spot ${METAL_NAMES[metal]!.toLowerCase()} is not quoted)`] : [],
3631
3788
  ...peso ? [`${peso.spotKind} rate`] : [],
3632
3789
  ].join(" · ");
3633
3790
  ctx.printResult({ data: [peso ? { ...row, ...pesoDollarRatesJson(peso) } : row], freshness, warnings: warnings.length > 0 ? warnings : undefined }, {
@@ -3638,7 +3795,7 @@ async function runFx(rawArgs: string[], ctx: Parameters<CliCommandDef["execute"]
3638
3795
  ...peso ? pesoDollarRateLines(peso) : [],
3639
3796
  ].join("\n"),
3640
3797
  // The rate is the base currency's price of one unit of the other, at the latest quote of each leg: USD per ZAR.
3641
- exportIdentity: { symbolOrSeries: pair, currencyOrUnit: `${baseCurrency} per ${currency}`, interval: "spot" },
3798
+ exportIdentity: { symbolOrSeries: pair, currencyOrUnit: `${baseCurrency} per ${currency}`, interval: quoted?.derivedFrom ? `derived from ${quoted.derivedFrom}` : "spot" },
3642
3799
  columns: [
3643
3800
  { key: "currency", header: "Currency" },
3644
3801
  { key: "baseCurrency", header: "Base" },
@@ -3722,7 +3879,7 @@ async function runEarnings(rawArgs: string[], ctx: Parameters<CliCommandDef["exe
3722
3879
  { key: "status", header: "Status" },
3723
3880
  { key: "symbol", header: "Symbol" },
3724
3881
  { key: "name", header: "Name" },
3725
- { key: "timing", header: "Timing" },
3882
+ { key: "timing", header: "Timing", format: (value: unknown, row: Record<string, unknown>) => String(row.localTiming || (value ?? "")) },
3726
3883
  { key: "epsEstimate", header: "EPS Est", align: "right", format: formatEpsCell },
3727
3884
  { key: "epsActual", header: "EPS", align: "right", format: formatEpsCell },
3728
3885
  ],
@@ -3821,6 +3978,7 @@ export const marketDataCliCommands: BuiltinCliCommandDef[] = [
3821
3978
  description: "Expiration as a date (2028-01-21) or Unix seconds; defaults to the nearest one, and lists the others. With --leaps: rank that expiry alone",
3822
3979
  },
3823
3980
  EXCHANGE_OPTION,
3981
+ { flags: "--adjusted", description: "List the contracts a corporate action adjusted (a numbered root such as ETHA1), each with what it delivers, in place of the standard ones" },
3824
3982
  { flags: "--leaps", description: "Rank long-dated contracts across the symbols given, as a stock replacement; more than a year out unless a window says otherwise" },
3825
3983
  { flags: "--side <calls|puts>", description: `With --leaps: the side to rank (default ${DEFAULT_LEAPS_CRITERIA.side}s)` },
3826
3984
  {
@@ -77,7 +77,7 @@ export function newsFallbackText(symbol: string): string | null {
77
77
  * the list is then read by date, which its help promises. A story with no
78
78
  * date goes last; equal dates keep the service's order.
79
79
  */
80
- function newestFirst(articles: readonly NewsArticle[]): NewsArticle[] {
80
+ export function newestFirst(articles: readonly NewsArticle[]): NewsArticle[] {
81
81
  const time = (article: NewsArticle) => {
82
82
  const at = new Date(article.publishedAt as Date | string | number).getTime();
83
83
  return Number.isFinite(at) ? at : -Infinity;
@@ -123,8 +123,6 @@ export function closestStoriesReason(text: string): string {
123
123
  return `no story has every word of "${text}"; the closest, most words first`;
124
124
  }
125
125
 
126
- /** The NI code of the metal markets: prices, futures, bullion and the trusts that hold it, not a miner's releases. */
127
- export const METALS_NEWS_TOPIC = "metals";
128
126
 
129
127
  /** A metal's market news, for what `news` was given: its name, its future, or its board code. */
130
128
  export interface MetalNewsRoute {