gloomberb 0.20.3 → 0.20.5

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 (348) hide show
  1. package/README.md +2 -0
  2. package/bin/gloom +9 -0
  3. package/bin/without-bun.cjs +98 -0
  4. package/package.json +3 -1
  5. package/src/account/auth-dialog.tsx +17 -0
  6. package/src/api-client/data.ts +144 -35
  7. package/src/api-client/fx-interventions.ts +64 -0
  8. package/src/api-client/index.ts +1 -0
  9. package/src/api-client/release-summaries.ts +21 -0
  10. package/src/api-client/types/econ.ts +12 -0
  11. package/src/api-client/yield-curves.ts +1 -1
  12. package/src/app/global-shortcuts.ts +4 -1
  13. package/src/app/keybindings/actions.ts +8 -2
  14. package/src/app/keybindings/config.ts +2 -1
  15. package/src/app/keybindings/index.ts +1 -0
  16. package/src/app/keybindings/labels.ts +6 -1
  17. package/src/app/keybindings/resolve.ts +23 -4
  18. package/src/app/keybindings/terminal-keys.ts +35 -0
  19. package/src/app/pane-runtime/index.tsx +2 -2
  20. package/src/app/pane-runtime/ticker-open-runtime.ts +274 -67
  21. package/src/architecture/ui-literals-allowlist.json +1 -1
  22. package/src/capabilities/chart-series.ts +27 -1
  23. package/src/cli/commands/keybindings.ts +5 -5
  24. package/src/cli/commands/market.ts +154 -21
  25. package/src/cli/commands/news-search.ts +60 -10
  26. package/src/cli/commands/overview.ts +16 -1
  27. package/src/cli/commands/plugins.ts +27 -5
  28. package/src/cli/commands/remote.ts +16 -17
  29. package/src/cli/commands/system.ts +20 -4
  30. package/src/cli/commands/ticker.ts +60 -19
  31. package/src/cli/fx-forward.ts +25 -7
  32. package/src/cli/glossary.ts +19 -5
  33. package/src/cli/history-rows.ts +5 -3
  34. package/src/cli/index.ts +8 -8
  35. package/src/cli/known-gaps.ts +27 -1
  36. package/src/cli/listing-arg.ts +11 -1
  37. package/src/cli/name-entries.ts +5 -1
  38. package/src/cli/not-a-ticker.ts +4 -0
  39. package/src/cli/pane-functions/function-help.ts +5 -5
  40. package/src/cli/report-tables.ts +18 -6
  41. package/src/cli/result.ts +15 -7
  42. package/src/cli/types.ts +2 -0
  43. package/src/components/chart/composite/axis-overlays.tsx +22 -0
  44. package/src/components/chart/composite/composite-chart.tsx +54 -13
  45. package/src/components/chart/composite/event-captions.ts +109 -0
  46. package/src/components/chart/composite/event-guides.ts +74 -0
  47. package/src/components/chart/composite/rasterizer.ts +2 -0
  48. package/src/components/chart/composite/text-renderer.ts +2 -0
  49. package/src/components/chart/composite/types.ts +31 -0
  50. package/src/components/command-bar/layout-items/focused-pane.ts +5 -5
  51. package/src/components/command-bar/pane-settings.ts +2 -2
  52. package/src/components/command-bar/routes/root/provider-search.ts +5 -4
  53. package/src/components/command-bar/routes/root/results.ts +6 -2
  54. package/src/components/command-bar/routes/ticker-search/results.ts +51 -0
  55. package/src/components/command-bar/routes/ticker-search/route.ts +3 -2
  56. package/src/components/input-search-bar.tsx +9 -2
  57. package/src/components/layout/detached-pane-shell.tsx +1 -1
  58. package/src/components/layout/floating-pane.tsx +5 -1
  59. package/src/components/layout/pane/footer/index.tsx +21 -14
  60. package/src/components/layout/pane/footer/model.ts +6 -0
  61. package/src/components/layout/pane/header.tsx +2 -0
  62. package/src/components/layout/shell/action-menu-overlay.tsx +10 -5
  63. package/src/components/layout/shell/active-drag.ts +149 -105
  64. package/src/components/layout/shell/drag/drop-zones.ts +162 -0
  65. package/src/components/layout/shell/drag/index.ts +47 -218
  66. package/src/components/layout/shell/drag/live.ts +10 -3
  67. package/src/components/layout/shell/drag/overlays.tsx +182 -5
  68. package/src/components/layout/shell/drag/runtime.ts +29 -6
  69. package/src/components/layout/shell/drag/shared-edges.ts +156 -0
  70. package/src/components/layout/shell/index.tsx +11 -6
  71. package/src/components/layout/shell/menu.ts +11 -2
  72. package/src/components/layout/shell/native/pointer-runtime.ts +25 -0
  73. package/src/components/layout/shell/native/window-state.ts +2 -2
  74. package/src/components/layout/shell/pane/capture.ts +4 -1
  75. package/src/components/layout/shell/pane/layers.tsx +71 -7
  76. package/src/components/layout/shell/terminal-pointer-runtime.ts +18 -9
  77. package/src/components/layout/shell/window-mode/index.ts +8 -10
  78. package/src/components/layout/status-bar.tsx +6 -1
  79. package/src/components/layout/window-edit/mode.ts +39 -7
  80. package/src/components/layout/window-edit/presentation.ts +1 -1
  81. package/src/components/onboarding/first-run-workspace.ts +44 -2
  82. package/src/components/onboarding/onboarding-frame.tsx +11 -2
  83. package/src/components/onboarding/onboarding-keyboard.ts +20 -0
  84. package/src/components/onboarding/onboarding-wizard.tsx +16 -11
  85. package/src/components/onboarding/portfolio-step/positions-panel.tsx +62 -1
  86. package/src/components/onboarding/use-onboarding-progress.ts +12 -4
  87. package/src/components/pane-settings-dialog/desktop.tsx +2 -2
  88. package/src/components/pane-settings-dialog/tui.tsx +2 -2
  89. package/src/components/pane-settings-dialog/value.ts +6 -0
  90. package/src/components/pane-settings-dialog.tsx +3 -3
  91. package/src/components/reader/detail-reader.tsx +4 -0
  92. package/src/components/ui/button.tsx +2 -0
  93. package/src/components/ui/choice-dialog.tsx +1 -0
  94. package/src/components/ui/data-table/index.tsx +4 -3
  95. package/src/components/ui/index.ts +1 -1
  96. package/src/components/ui/list-view.tsx +7 -12
  97. package/src/components/ui/loading.tsx +10 -3
  98. package/src/components/ui/menu.tsx +6 -2
  99. package/src/components/ui/page-stack-view.tsx +3 -0
  100. package/src/components/ui/pane-link-chip.tsx +269 -54
  101. package/src/components/ui/query-bar.tsx +2 -1
  102. package/src/components/ui/quote.ts +14 -1
  103. package/src/components/ui/tabs.tsx +97 -19
  104. package/src/core/state/app/layout-reducer.ts +7 -0
  105. package/src/core/state/app/layout.ts +44 -7
  106. package/src/core/state/app/state.ts +1 -1
  107. package/src/core/state/app/types.ts +22 -2
  108. package/src/data/config/layout.ts +5 -2
  109. package/src/docs/snapshot.json +54 -13
  110. package/src/i18n/es.ts +9 -8
  111. package/src/i18n/ja.ts +9 -8
  112. package/src/i18n/ko.ts +9 -8
  113. package/src/i18n/zh-cn.ts +9 -8
  114. package/src/i18n/zh-tw.ts +9 -8
  115. package/src/layout/pane-manager/floating-actions.ts +17 -0
  116. package/src/layout/pane-manager/floating-stack.ts +187 -0
  117. package/src/layout/pane-manager/floating.ts +4 -2
  118. package/src/layout/pane-manager/gridlock.ts +5 -1
  119. package/src/layout/pane-manager/index.ts +11 -0
  120. package/src/layout/pane-manager/layout-state.ts +10 -3
  121. package/src/market-data/depositary-pair.ts +5 -3
  122. package/src/market-data/futures-board.ts +46 -1
  123. package/src/market-data/futures-contract.ts +12 -3
  124. package/src/market-data/fx-interventions.ts +270 -0
  125. package/src/market-data/market/dated-previous-close.ts +94 -15
  126. package/src/market-data/market/status.ts +17 -1
  127. package/src/news/news-model.ts +44 -2
  128. package/src/plugins/builtin/alerts/cli.ts +4 -4
  129. package/src/plugins/builtin/alerts/format.ts +1 -2
  130. package/src/plugins/builtin/alerts/headless.ts +1 -2
  131. package/src/plugins/builtin/alerts/move-checks.ts +12 -6
  132. package/src/plugins/builtin/alerts/move.ts +30 -9
  133. package/src/plugins/builtin/alerts/pane.tsx +0 -2
  134. package/src/plugins/builtin/alerts/storage.ts +4 -2
  135. package/src/plugins/builtin/alerts/types.ts +12 -0
  136. package/src/plugins/builtin/analytics/risk-client.ts +10 -4
  137. package/src/plugins/builtin/analytics/risk-episodes.ts +5 -4
  138. package/src/plugins/builtin/analytics/risk-headless.ts +4 -2
  139. package/src/plugins/builtin/analytics/risk-sectors.ts +91 -0
  140. package/src/plugins/builtin/awards/index.tsx +1 -1
  141. package/src/plugins/builtin/buildout/index.tsx +1 -0
  142. package/src/plugins/builtin/catalysts/index.tsx +2 -2
  143. package/src/plugins/builtin/cds/headless.ts +4 -0
  144. package/src/plugins/builtin/changelog/index.tsx +292 -101
  145. package/src/plugins/builtin/changelog/versions.ts +293 -0
  146. package/src/plugins/builtin/chart-composer/headless.ts +2 -1
  147. package/src/plugins/builtin/chart-composer/index.tsx +1 -0
  148. package/src/plugins/builtin/chart-composer/intervention-events.ts +105 -0
  149. package/src/plugins/builtin/chart-composer/pane.tsx +21 -7
  150. package/src/plugins/builtin/chat/content/composer.tsx +5 -4
  151. package/src/plugins/builtin/chat/content/index.tsx +12 -2
  152. package/src/plugins/builtin/chat/content/layout-metrics.ts +3 -3
  153. package/src/plugins/builtin/chat/content/open-targets.ts +3 -3
  154. package/src/plugins/builtin/chat/layout.ts +5 -2
  155. package/src/plugins/builtin/chat/message/pane-chip.tsx +61 -40
  156. package/src/plugins/builtin/chat/message/render-state.ts +2 -5
  157. package/src/plugins/builtin/chat/message/terminal.tsx +13 -15
  158. package/src/plugins/builtin/chat/pane-links/previews.ts +51 -5
  159. package/src/plugins/builtin/chat/pane-links/share-card.ts +36 -0
  160. package/src/plugins/builtin/cloud/askg/attached-pane.tsx +10 -5
  161. package/src/plugins/builtin/cloud/askg/controller.ts +141 -5
  162. package/src/plugins/builtin/cloud/askg/executor.ts +113 -4
  163. package/src/plugins/builtin/cloud/askg/manifest.ts +28 -13
  164. package/src/plugins/builtin/cloud/askg/model.ts +14 -4
  165. package/src/plugins/builtin/cloud/askg/pane.tsx +70 -46
  166. package/src/plugins/builtin/cloud/askg/tool-display.ts +1 -0
  167. package/src/plugins/builtin/cloud/askg/turn-parts.tsx +70 -0
  168. package/src/plugins/builtin/cloud/terminal-relay/engine.ts +50 -130
  169. package/src/plugins/builtin/cloud/terminal-relay/policy.ts +327 -7
  170. package/src/plugins/builtin/cloud/terminal-relay/prompts.tsx +2 -1
  171. package/src/plugins/builtin/cloud/terminal-relay/redact.ts +52 -9
  172. package/src/plugins/builtin/commodities-energy/index.tsx +1 -3
  173. package/src/plugins/builtin/commodities-energy/view-state.ts +3 -0
  174. package/src/plugins/builtin/commodity-balances/index.tsx +1 -0
  175. package/src/plugins/builtin/company-attention/index.tsx +1 -1
  176. package/src/plugins/builtin/company-kpis/headless.ts +3 -1
  177. package/src/plugins/builtin/company-kpis/index.tsx +2 -2
  178. package/src/plugins/builtin/cot/headless.ts +14 -2
  179. package/src/plugins/builtin/cot/index.tsx +1 -1
  180. package/src/plugins/builtin/cpi/index.tsx +1 -1
  181. package/src/plugins/builtin/crypto-board/index.tsx +1 -0
  182. package/src/plugins/builtin/dividend-yield/index.tsx +1 -0
  183. package/src/plugins/builtin/doe/index.tsx +1 -1
  184. package/src/plugins/builtin/earnings/index.tsx +2 -2
  185. package/src/plugins/builtin/earnings-calls/headless.ts +5 -1
  186. package/src/plugins/builtin/earnings-calls/index.tsx +1 -0
  187. package/src/plugins/builtin/econ/calendar-model.ts +74 -1
  188. package/src/plugins/builtin/econ/fred-catalog.ts +3 -1
  189. package/src/plugins/builtin/econ/index.tsx +1 -0
  190. package/src/plugins/builtin/econ-statistics/index.tsx +1 -0
  191. package/src/plugins/builtin/econ-statistics/pane.tsx +6 -0
  192. package/src/plugins/builtin/estimate-revisions/index.tsx +1 -0
  193. package/src/plugins/builtin/executives/index.tsx +1 -0
  194. package/src/plugins/builtin/filing-events/index.tsx +1 -0
  195. package/src/plugins/builtin/fixed-income/index.tsx +1 -0
  196. package/src/plugins/builtin/futures/index.tsx +25 -4
  197. package/src/plugins/builtin/futures/model.ts +28 -32
  198. package/src/plugins/builtin/futures/series.ts +4 -3
  199. package/src/plugins/builtin/futures/table.tsx +16 -9
  200. package/src/plugins/builtin/futures/use-board-terms.ts +3 -3
  201. package/src/plugins/builtin/futures-curve/headless.ts +3 -3
  202. package/src/plugins/builtin/futures-curve/index.tsx +1 -1
  203. package/src/plugins/builtin/futures-curve/model.ts +18 -0
  204. package/src/plugins/builtin/gpu/index.tsx +1 -1
  205. package/src/plugins/builtin/help/functions-table.tsx +1 -1
  206. package/src/plugins/builtin/help/index.tsx +14 -4
  207. package/src/plugins/builtin/help/keybindings-editor.tsx +19 -5
  208. package/src/plugins/builtin/holders/index.tsx +1 -0
  209. package/src/plugins/builtin/holders/report-header.ts +2 -2
  210. package/src/plugins/builtin/insider/index.tsx +1 -0
  211. package/src/plugins/builtin/iv-history/index.tsx +1 -1
  212. package/src/plugins/builtin/jobs/index.tsx +1 -0
  213. package/src/plugins/builtin/layout-manager/index.tsx +8 -8
  214. package/src/plugins/builtin/macro-day/headless.ts +27 -8
  215. package/src/plugins/builtin/macro-day/index.tsx +1 -1
  216. package/src/plugins/builtin/macro-day/model.ts +19 -3
  217. package/src/plugins/builtin/macro-day/pane.tsx +14 -9
  218. package/src/plugins/builtin/macro-day/releases.ts +25 -7
  219. package/src/plugins/builtin/market-valuation/index.tsx +1 -0
  220. package/src/plugins/builtin/market-valuation/pane.tsx +8 -0
  221. package/src/plugins/builtin/members/index.tsx +1 -1
  222. package/src/plugins/builtin/mna/index.tsx +1 -0
  223. package/src/plugins/builtin/news/headless.ts +2 -2
  224. package/src/plugins/builtin/news/index.tsx +4 -3
  225. package/src/plugins/builtin/news/wire/index.tsx +5 -1
  226. package/src/plugins/builtin/news/wire/news/detail-view.tsx +4 -0
  227. package/src/plugins/builtin/news/wire/news/list-search.ts +5 -2
  228. package/src/plugins/builtin/options/index.tsx +1 -0
  229. package/src/plugins/builtin/options-positioning/index.tsx +1 -0
  230. package/src/plugins/builtin/pe-band/index.tsx +1 -1
  231. package/src/plugins/builtin/perps/markets-section.tsx +5 -2
  232. package/src/plugins/builtin/plugin-marketplace/pane.tsx +11 -11
  233. package/src/plugins/builtin/portfolio-list/cli/portfolio-command.ts +25 -0
  234. package/src/plugins/builtin/portfolio-list/headless.ts +15 -6
  235. package/src/plugins/builtin/portfolio-list/summary/index.tsx +3 -1
  236. package/src/plugins/builtin/power/index.tsx +1 -1
  237. package/src/plugins/builtin/realized-vol/index.tsx +1 -1
  238. package/src/plugins/builtin/research/event-model.ts +9 -1
  239. package/src/plugins/builtin/research/event-sources.ts +22 -0
  240. package/src/plugins/builtin/research/headless.ts +11 -5
  241. package/src/plugins/builtin/research/index.tsx +4 -0
  242. package/src/plugins/builtin/research-search/index.tsx +1 -0
  243. package/src/plugins/builtin/research-search/pane.tsx +8 -0
  244. package/src/plugins/builtin/revenue-breakdown/index.tsx +1 -0
  245. package/src/plugins/builtin/reverse-dcf/index.tsx +1 -1
  246. package/src/plugins/builtin/risk-factors/index.tsx +1 -0
  247. package/src/plugins/builtin/scanner/headless.ts +52 -13
  248. package/src/plugins/builtin/seasonality/index.tsx +1 -1
  249. package/src/plugins/builtin/sec/index.tsx +1 -0
  250. package/src/plugins/builtin/series-inventory.ts +1 -1
  251. package/src/plugins/builtin/shared/cloud-upgrade.ts +27 -3
  252. package/src/plugins/builtin/shared/scanner-capture.ts +11 -3
  253. package/src/plugins/builtin/shared/series-list-detail.tsx +5 -0
  254. package/src/plugins/builtin/short-interest/index.tsx +1 -0
  255. package/src/plugins/builtin/social-mentions/index.tsx +1 -1
  256. package/src/plugins/builtin/supply-chain/index.tsx +1 -0
  257. package/src/plugins/builtin/thirteenf/data.ts +43 -10
  258. package/src/plugins/builtin/thirteenf/headless.ts +55 -11
  259. package/src/plugins/builtin/thirteenf/model.ts +25 -9
  260. package/src/plugins/builtin/thirteenf/report-notes.ts +27 -6
  261. package/src/plugins/builtin/thirteenf/types.ts +2 -0
  262. package/src/plugins/builtin/ticker-detail/adr-pair/model.ts +1 -1
  263. package/src/plugins/builtin/ticker-detail/financials/model.ts +12 -0
  264. package/src/plugins/builtin/ticker-detail/financials/ratio-table.tsx +3 -3
  265. package/src/plugins/builtin/ticker-detail/financials/tab.tsx +5 -5
  266. package/src/plugins/builtin/ticker-detail/headless.ts +18 -13
  267. package/src/plugins/builtin/ticker-detail/index.tsx +4 -0
  268. package/src/plugins/builtin/ticker-detail/overview/components.tsx +54 -5
  269. package/src/plugins/builtin/ticker-detail/overview/model.ts +6 -4
  270. package/src/plugins/builtin/ticker-detail/overview-tab.tsx +34 -17
  271. package/src/plugins/builtin/ticker-detail/pane.tsx +7 -2
  272. package/src/plugins/builtin/time-sales/client.ts +9 -11
  273. package/src/plugins/builtin/time-sales/index.tsx +1 -1
  274. package/src/plugins/builtin/treasury-auctions/after.ts +267 -0
  275. package/src/plugins/builtin/treasury-auctions/cache.ts +18 -3
  276. package/src/plugins/builtin/treasury-auctions/client.ts +33 -2
  277. package/src/plugins/builtin/treasury-auctions/headless.ts +109 -19
  278. package/src/plugins/builtin/treasury-auctions/index.tsx +14 -4
  279. package/src/plugins/builtin/treasury-auctions/model.ts +256 -28
  280. package/src/plugins/builtin/treasury-auctions/pane.tsx +139 -28
  281. package/src/plugins/builtin/treasury-auctions/treasury-direct.ts +5 -2
  282. package/src/plugins/builtin/treasury-auctions/types.ts +7 -1
  283. package/src/plugins/builtin/vol-surface/index.tsx +1 -1
  284. package/src/plugins/builtin/world-venue-map/index.ts +1 -0
  285. package/src/plugins/builtin/yield-curve/curves.ts +10 -4
  286. package/src/plugins/builtin/yield-curve/headless.ts +6 -2
  287. package/src/plugins/builtin/yield-curve/index.tsx +3 -3
  288. package/src/plugins/builtin/yield-curve/series.ts +10 -0
  289. package/src/plugins/builtin/yield-curve/world.ts +3 -1
  290. package/src/plugins/installer.ts +45 -0
  291. package/src/portfolio/column-values.ts +2 -1
  292. package/src/public/__snapshots__/public-api.test.ts.snap +4 -0
  293. package/src/public/remote.ts +7 -1
  294. package/src/remote/client.ts +191 -11
  295. package/src/remote/controller-utils.ts +13 -1
  296. package/src/remote/controller.ts +88 -26
  297. package/src/remote/endpoint.ts +24 -0
  298. package/src/remote/form.ts +59 -4
  299. package/src/remote/resources.ts +56 -19
  300. package/src/remote/schema.ts +22 -9
  301. package/src/remote/secrets.ts +12 -0
  302. package/src/remote/semantic-helpers.ts +29 -1
  303. package/src/remote/semantic-tree.tsx +44 -15
  304. package/src/remote/server.ts +2 -1
  305. package/src/remote/surface.tsx +192 -0
  306. package/src/remote/types.ts +5 -0
  307. package/src/renderers/cloudflare/worker.ts +16 -1
  308. package/src/renderers/dom/styles.css +40 -6
  309. package/src/renderers/opentui/host.tsx +6 -0
  310. package/src/renderers/share/layout-view.tsx +1 -1
  311. package/src/series/standalone.ts +2 -2
  312. package/src/shares/api.ts +21 -4
  313. package/src/shares/item.ts +73 -0
  314. package/src/shares/pane-item.ts +205 -0
  315. package/src/shares/pane.ts +4 -0
  316. package/src/shares/payload.ts +9 -5
  317. package/src/sources/gloomberb-cloud/news.ts +37 -12
  318. package/src/state/opening-ticker-panes.ts +47 -0
  319. package/src/test-support/cli-context.ts +2 -0
  320. package/src/test-support/preload.ts +4 -1
  321. package/src/tickers/instrument-kind.ts +23 -3
  322. package/src/tickers/renamed-listings.ts +105 -0
  323. package/src/tickers/search/index.ts +103 -16
  324. package/src/time-series/resolve.ts +2 -2
  325. package/src/types/config.ts +5 -0
  326. package/src/types/context-menu.ts +2 -0
  327. package/src/types/financials.ts +1 -0
  328. package/src/types/plugin-commands.ts +140 -0
  329. package/src/types/plugin-context.ts +125 -0
  330. package/src/types/plugin-contributions.ts +55 -0
  331. package/src/types/plugin-definition.ts +234 -0
  332. package/src/types/plugin-notifications.ts +38 -0
  333. package/src/types/plugin-pane-settings.ts +116 -0
  334. package/src/types/plugin-pane-templates.ts +160 -0
  335. package/src/types/plugin-panes.ts +243 -0
  336. package/src/types/plugin-reports.ts +35 -0
  337. package/src/types/plugin-shared.ts +14 -0
  338. package/src/types/plugin-state.ts +71 -0
  339. package/src/types/plugin.ts +14 -1169
  340. package/src/ui/index.tsx +14 -3
  341. package/src/updater/github-releases.ts +23 -0
  342. package/src/utils/central-banks.ts +86 -1
  343. package/src/utils/cli-output.ts +22 -9
  344. package/src/utils/datetime-format.ts +12 -3
  345. package/src/utils/depositary-receipt.ts +28 -3
  346. package/src/utils/fundamentals.ts +14 -0
  347. package/src/utils/max-drawdown.ts +97 -16
  348. package/src/utils/untrusted-text.ts +29 -0
@@ -21,11 +21,12 @@ import {
21
21
  import { linkHostPackages } from "../../plugins/host-link";
22
22
  import {
23
23
  installedPluginDirectories,
24
+ installedPluginDirectoriesNamed,
25
+ installedPluginId,
24
26
  loadRegistryListings,
25
27
  readPluginRemote,
26
28
  readPluginRemoteHeads,
27
29
  updatePlugin,
28
- validatePluginDirectoryName,
29
30
  type RegistryListing,
30
31
  } from "../../plugins/installer";
31
32
  import { isReservedBuiltinPluginId } from "../../plugins/ownership";
@@ -58,8 +59,19 @@ function absorbedNotice(absorbed: AbsorbedPlugin, directory: string | null): str
58
59
  return directory ? `${built}; remove this copy with "gloom remove ${directory}".` : `${built}.`;
59
60
  }
60
61
 
62
+ /**
63
+ * The folder of the installed plugin a command names, by its id or by its
64
+ * folder; fails when none, or more than one, answers to it.
65
+ */
66
+ export function installedPluginArg(name: string): string {
67
+ const matches = installedPluginDirectoriesNamed(name);
68
+ if (matches.length > 1) fail(`"${name}" is the id of ${matches.length} installed plugins: ${matches.join(", ")}.`, "Name one by its folder.");
69
+ if (matches.length === 0) fail(`Plugin "${name}" was not found.`, PLUGINS_DIR);
70
+ return matches[0]!;
71
+ }
72
+
61
73
  export async function updatePlugins(name?: string) {
62
- const dirs = name ? [validatePluginDirectoryName(name)] : installedPluginDirectories();
74
+ const dirs = name ? [installedPluginArg(name)] : installedPluginDirectories();
63
75
 
64
76
  if (dirs.length === 0) {
65
77
  console.log(cliStyles.muted("No plugins installed."));
@@ -197,7 +209,7 @@ function listedHostImports<T>(
197
209
  * build the desktop and web app need actually compiles.
198
210
  */
199
211
  async function doctorPlugin(nameOrPath: string): Promise<PluginDoctorReport> {
200
- const candidate = nameOrPath.includes("/") || nameOrPath.startsWith(".") ? resolve(nameOrPath) : join(PLUGINS_DIR, nameOrPath);
212
+ const candidate = nameOrPath.includes("/") || nameOrPath.startsWith(".") ? resolve(nameOrPath) : join(PLUGINS_DIR, installedPluginArg(nameOrPath));
201
213
  if (!existsSync(candidate)) fail(`Plugin "${nameOrPath}" was not found.`, PLUGINS_DIR);
202
214
  const directory = basename(candidate);
203
215
  const linked = lstatSync(candidate).isSymbolicLink();
@@ -272,6 +284,8 @@ async function doctorPlugin(nameOrPath: string): Promise<PluginDoctorReport> {
272
284
 
273
285
  if (!plugin.version) add("version", "warn", "No version; the marketplace cannot tell when an update is available.");
274
286
  if (isReservedBuiltinPluginId(plugin.id)) add("id", "fail", `"${plugin.id}" is reserved by a built-in module.`);
287
+ // gloom plugins and the plugin directory read gloom.json's; plugin enable takes the export's.
288
+ else if (manifest.id && manifest.id !== plugin.id) add("id", "warn", `gloom.json says "${manifest.id}" and the plugin exports "${plugin.id}": make them the same.`);
275
289
  else add("id", "ok", plugin.id);
276
290
 
277
291
  const badTargets = (plugin.targets ?? []).filter((target) => !ALL_PLUGIN_TARGETS.includes(target as PluginTarget));
@@ -316,6 +330,9 @@ export async function doctorPlugins(nameOrPath?: string): Promise<PluginDoctorRe
316
330
  }
317
331
 
318
332
  export interface InstalledPluginRow {
333
+ /** What `plugin info|enable|disable` take; every other plugin command takes it too. */
334
+ id: string;
335
+ /** The folder under the plugins directory, which every plugin command also takes. */
319
336
  name: string;
320
337
  version: string;
321
338
  commit: string;
@@ -361,6 +378,7 @@ async function readInstalledPlugins(options: { check?: boolean }): Promise<Insta
361
378
  const commit = readPluginCommit(dir);
362
379
  const blocked = builtIn ? absorbedNotice(builtIn, name) : linked ? null : checkPluginCompatibility(dir)?.error;
363
380
  const row: InstalledPluginRow = {
381
+ id: installedPluginId(name),
364
382
  name,
365
383
  version,
366
384
  commit: linked ? "linked" : commit ? commit.slice(0, 7) : "",
@@ -383,8 +401,11 @@ async function readInstalledPlugins(options: { check?: boolean }): Promise<Insta
383
401
 
384
402
  export async function listPlugins(ctx: CliCommandContext, options: { check?: boolean } = {}) {
385
403
  const plugins = await readInstalledPlugins(options);
404
+ // The folder `gloom install` names for the repository, where it is not the id.
405
+ const folders = plugins.some((plugin) => plugin.name !== plugin.id);
386
406
  const columns = [
387
- { key: "name", header: "Plugin", shrink: false },
407
+ { key: "id", header: "Plugin", shrink: false },
408
+ ...(folders ? [{ key: "folder", header: "Folder", value: (row: Record<string, unknown>) => row.name }] : []),
388
409
  { key: "version", header: "Version" },
389
410
  { key: "commit", header: "Commit" },
390
411
  ...(options.check ? [{ key: "update", header: "Update" }] : []),
@@ -400,11 +421,12 @@ export async function listPlugins(ctx: CliCommandContext, options: { check?: boo
400
421
  renderTable(
401
422
  columns.map(({ header, shrink }) => ({ header, shrink })),
402
423
  rows.map((row) => columns.map(({ key }) => {
424
+ if (key === "folder") return row.name === row.id ? "" : cliStyles.muted(row.name);
403
425
  const value = String(row[key as keyof InstalledPluginRow] ?? "");
404
426
  return key === "update" && value && value !== "up to date" ? cliStyles.warning(value) : value;
405
427
  })),
406
428
  ),
407
- ...rows.filter((row) => row.blocked).map((row) => cliStyles.warning(`${row.name} is not loaded: ${row.blocked}`)),
429
+ ...rows.filter((row) => row.blocked).map((row) => cliStyles.warning(`${row.id} is not loaded: ${row.blocked}`)),
408
430
  "",
409
431
  renderStats([["Directory", cliStyles.muted(PLUGINS_DIR)]]),
410
432
  ].join("\n");
@@ -1,9 +1,10 @@
1
1
  import { getDataDir } from "../../data/config/store";
2
2
  import type { CliCommandContext } from "../../types/plugin";
3
- import { sendRemoteControlRequest } from "../../remote/client";
3
+ import { RemoteAppError, RemoteAppNotRunningError, sendRemoteControlRequest } from "../../remote/client";
4
4
  import type { RemoteAppKind, RemoteControlRequest, RemoteControlResponse } from "../../remote/types";
5
5
  import { CLI_COMMAND_GROUPS } from "../help";
6
6
  import type { BuiltinCliCommandDef } from "../command-options";
7
+ import { failWithError } from "../errors";
7
8
 
8
9
  interface RemoteArgs {
9
10
  args: string[];
@@ -34,7 +35,7 @@ export const remoteCliCommand: BuiltinCliCommandDef = {
34
35
  { flags: "--interval <ms>", description: "How often watch polls, at least 100 (default 1000)" },
35
36
  { flags: "--dry-run", description: "Check a call, patch, or batch without applying it" },
36
37
  ],
37
- examples: ["remote schema", "remote get layout", "remote watch layout --limit 5"],
38
+ examples: ["remote help", "remote get app://snapshot", "remote get app://form", "remote watch app://layout/current --limit 5"],
38
39
  },
39
40
  execute: async (rawArgs, ctx) => {
40
41
  const parsed = parseRemoteArgs(rawArgs);
@@ -46,10 +47,12 @@ export const remoteCliCommand: BuiltinCliCommandDef = {
46
47
 
47
48
  // No data folder means this profile never opened the app, so none is running to drive.
48
49
  const dataDir = await getDataDir();
49
- if (!dataDir) {
50
- ctx.fail("No running Gloom app found.", "Open the desktop app or run gloom, then try again.");
51
- return;
52
- }
50
+ if (!dataDir) failToReachApp(new RemoteAppNotRunningError(parsed.appKind));
51
+ const send = (request: RemoteControlRequest) => sendRemoteControlRequest(request, { dataDir, appKind: parsed.appKind })
52
+ .catch((error: unknown) => {
53
+ if (error instanceof RemoteAppError) failToReachApp(error);
54
+ throw error;
55
+ });
53
56
 
54
57
  if (action === "watch") {
55
58
  const resource = parsed.args[1];
@@ -59,25 +62,21 @@ export const remoteCliCommand: BuiltinCliCommandDef = {
59
62
  }
60
63
  const limit = ctx.cliOptions.limit ?? Number.POSITIVE_INFINITY;
61
64
  for (let index = 0; index < limit; index += 1) {
62
- const response = await sendRemoteControlRequest({ type: "get", resource }, {
63
- dataDir,
64
- appKind: parsed.appKind,
65
- });
66
- printRemoteResponse(response, ctx);
65
+ printRemoteResponse(await send({ type: "get", resource }), ctx);
67
66
  if (index < limit - 1) await new Promise((resolve) => setTimeout(resolve, parsed.intervalMs));
68
67
  }
69
68
  return;
70
69
  }
71
70
 
72
- const request = buildRemoteRequest(action, parsed, ctx.cliOptions.dryRun);
73
- const response = await sendRemoteControlRequest(request, {
74
- dataDir,
75
- appKind: parsed.appKind,
76
- });
77
- printRemoteResponse(response, ctx);
71
+ printRemoteResponse(await send(buildRemoteRequest(action, parsed, ctx.cliOptions.dryRun)), ctx);
78
72
  },
79
73
  };
80
74
 
75
+ /** No app answers, two do, or one cannot be reached from here: with how to start one, which to pick, or what may block it. */
76
+ function failToReachApp(error: RemoteAppError): never {
77
+ return failWithError({ code: error.code, message: error.message, details: error.details });
78
+ }
79
+
81
80
  function parseRemoteArgs(rawArgs: string[]): RemoteArgs {
82
81
  const args: string[] = [];
83
82
  let appKind: RemoteAppKind | undefined;
@@ -283,7 +283,7 @@ export function createSystemCliCommands(): CliCommandDef[] {
283
283
  "config set timezone Asia/Tokyo",
284
284
  "config get keybindings",
285
285
  "config set keybindings.actions.ticker-search \"Ctrl+T\"",
286
- "config set keybindings.commands.Alt+1 \"DES AAPL\"",
286
+ "config set keybindings.commands.Alt+D \"DES AAPL\"",
287
287
  ],
288
288
  },
289
289
  execute: async (args, ctx) => {
@@ -527,10 +527,15 @@ export function createSystemCliCommands(): CliCommandDef[] {
527
527
  "plugin info <id>",
528
528
  "plugin enable <id>",
529
529
  "plugin disable <id>",
530
- "plugin doctor [name-or-path]",
530
+ "plugin doctor [id-or-path]",
531
531
  "plugin link <path>",
532
532
  ],
533
533
  sections: [{
534
+ title: "Naming a plugin",
535
+ lines: [
536
+ "Every plugin command takes an installed plugin's id or its folder, as gloom plugins lists them.",
537
+ ],
538
+ }, {
534
539
  title: "Developing a plugin",
535
540
  lines: [
536
541
  "link puts a symlink to a local checkout in the plugins folder, so edits are live on the next start.",
@@ -583,19 +588,30 @@ export function createSystemCliCommands(): CliCommandDef[] {
583
588
  )).length,
584
589
  }));
585
590
 
591
+ // An installed plugin by its folder too: `gloom install` names the
592
+ // folder for the repository (`gloom-hackernews`), and `gloom plugins`
593
+ // shows it beside the id (`hackernews`).
594
+ const pluginId = async (name: string): Promise<string> => {
595
+ if (services.services.pluginRegistry.allPlugins.has(name) || builtinPluginGroupMembers(name)) return name;
596
+ const { installedPluginDirectoriesNamed, installedPluginRegistryId } = await import("../../plugins/installer");
597
+ const [directory, ...others] = installedPluginDirectoriesNamed(name);
598
+ if (!directory || others.length > 0) return name;
599
+ return await installedPluginRegistryId(directory) ?? name;
600
+ };
601
+
586
602
  if (action === "list") {
587
603
  ctx.printResult({ data: pluginRows() });
588
604
  return;
589
605
  }
590
606
  if (action === "info") {
591
- const id = requireArg(args[1], "Usage: gloom plugin info <id>", ctx);
607
+ const id = await pluginId(requireArg(args[1], "Usage: gloom plugin info <id>", ctx));
592
608
  const row = pluginRows().find((plugin) => plugin.id === id);
593
609
  if (!row) ctx.fail(`Plugin "${id}" is not available.`);
594
610
  ctx.printResult({ data: row });
595
611
  return;
596
612
  }
597
613
  if (action === "enable" || action === "disable") {
598
- const id = requireArg(args[1], `Usage: gloom plugin ${action} <id>`, ctx);
614
+ const id = await pluginId(requireArg(args[1], `Usage: gloom plugin ${action} <id>`, ctx));
599
615
  // A retired id that now names a group of built-ins switches all of them.
600
616
  const targetIds = builtinPluginGroupMembers(id) ?? [id];
601
617
  for (const targetId of targetIds) {
@@ -2,7 +2,8 @@ import { logFailure } from "../../utils/log-failure";
2
2
  import { formatShortDate, parseDisplayDate } from "../../utils/datetime-format";
3
3
  import { formatReportedMoney, REPORTING_CURRENCY_NOT_SOURCED } from "../../utils/reported-money";
4
4
  import {
5
- appTtmRate, BANK_ENTERPRISE_VALUE, computedEnterpriseValueNote, convertedPriceEarningsNote, enterpriseValueLabel, enterpriseValueReconciliationNote,
5
+ appTtmRate, BANK_ENTERPRISE_VALUE, computedEnterpriseValueNote, convertedPriceEarningsNote, enterpriseValueCheck, enterpriseValueLabel,
6
+ enterpriseValueReconciliationNote,
6
7
  epsConversionNote, fundamentalsCurrency, isBankEnterpriseValue, reportedEnterpriseValue, trailingEpsSourceNote, ttmAtAppRate, ttmConversionNote,
7
8
  withBankEnterpriseValue,
8
9
  } from "../../utils/fundamentals";
@@ -55,6 +56,7 @@ import { instrumentTypeLabel, resolveTickerInstrumentKind } from "../../tickers/
55
56
  import { INDEX_POINTS_LABEL, isIndexLevel, reportedQuoteVolume } from "../../market-data/market/index-level";
56
57
  import type { SecFilingItem } from "../../types/data-provider";
57
58
  import type { NewsArticle } from "../../news/types";
59
+ import { summaryRestatesHeadline } from "../../news/news-model";
58
60
  import type { TickerRecord } from "../../types/ticker";
59
61
  import type { CliCommandContext } from "../../types/plugin";
60
62
  import { getPortfolioPositionMetrics, getPortfolioQuoteDisplay, lotCostFxRate, resolvePortfolioMarketValue, resolvePortfolioPositionPnl } from "../../portfolio/position-metrics";
@@ -107,7 +109,7 @@ import { readFundFacts } from "../../market-data/fund-facts";
107
109
  import { taxEquivalentLines, type TaxEquivalentAnalysis } from "../../market-data/tax-equivalent";
108
110
  import { isRoundTheClockCoin } from "../../utils/crypto-pair";
109
111
  import { ipoDetailNotes, ipoMetricRows, loadTickerIpo, type TickerIpo } from "../../plugins/builtin/ipo-calendar/listing-ipo";
110
- import { coinNewsFallbackNotice } from "../../sources/gloomberb-cloud/news";
112
+ import { newsFallbackNotice } from "../../sources/gloomberb-cloud/news";
111
113
 
112
114
  const NEWS_ITEM_LIMIT = 5;
113
115
  const SEC_FILING_LIMIT = 5;
@@ -193,26 +195,48 @@ function cashRunwayText(runway: CashRunway): string {
193
195
  return [part(quarter, "quarter"), trailing ? part(trailing, "TTM") : `TTM ${runway.trailingGap === "short-history" ? SHORT_RUNWAY_HISTORY : "not reported"}`].filter((text): text is string => !!text).join(" \u00b7 ");
194
196
  }
195
197
 
196
- function buildStatementMetrics(statement: FinancialStatement, currency?: string, codes = false, runway?: CashRunway | null): Array<[string, string]> {
198
+ /** The balance sheet lines of a statement: a quarter that ends on the year's closing day shares them with the year. */
199
+ const BALANCE_SHEET_FIELDS = [
200
+ "cashAndCashEquivalents", "cashCashEquivalentsAndShortTermInvestments", "totalAssets", "totalLiabilities", "totalDebt", "totalEquity",
201
+ ] as const satisfies ReadonlyArray<keyof FinancialStatement>;
202
+
203
+ /**
204
+ * A statement's lines. Income incl. NCI and Income Common print only where they read differently from Net Income,
205
+ * and `sameDay`, the year a quarter closes with, leaves out the balance sheet lines it already shows with the same
206
+ * figure: the two statements' balance sheets are one, on one date.
207
+ */
208
+ function buildStatementMetrics(
209
+ statement: FinancialStatement,
210
+ currency?: string,
211
+ codes = false,
212
+ runway?: CashRunway | null,
213
+ sameDay?: FinancialStatement | null,
214
+ ): Array<[string, string]> {
197
215
  const money = (value: number | undefined, perShare = false) => formatReportedMoney(value, currency, perShare, codes);
216
+ const netIncome = money(statement.netIncome);
217
+ const income = (value: number | undefined) => (value != null && money(value) === netIncome ? "—" : money(value));
218
+ const balance = (field: (typeof BALANCE_SHEET_FIELDS)[number]) => {
219
+ const text = money(statement[field]);
220
+ return sameDay?.date === statement.date && statement[field] != null && money(sameDay[field]) === text ? "—" : text;
221
+ };
198
222
  return [
199
223
  ["Revenue", money(statement.totalRevenue)],
200
224
  ["Gross Profit", money(statement.grossProfit)],
201
225
  ["Operating Income", money(statement.operatingIncome)],
202
- ["Net Income", money(statement.netIncome)],
203
- ["Income incl. NCI", money(statement.netIncomeIncludingNoncontrollingInterests)],
204
- ["Income Common", money(statement.netIncomeCommonStockholders)],
226
+ ["Net Income", netIncome],
227
+ ["Income incl. NCI", income(statement.netIncomeIncludingNoncontrollingInterests)],
228
+ ["Income Common", income(statement.netIncomeCommonStockholders)],
205
229
  ["EBITDA", money(statement.ebitda)],
206
230
  ["Operating Cash Flow", money(statement.operatingCashFlow)],
207
231
  ["Free Cash Flow", money(statement.freeCashFlow)],
208
- ["Cash", money(statement.cashAndCashEquivalents)],
209
- ["Cash + ST Inv", money(statement.cashCashEquivalentsAndShortTermInvestments)],
232
+ ["Cash", balance("cashAndCashEquivalents")],
233
+ ["Cash + ST Inv", balance("cashCashEquivalentsAndShortTermInvestments")],
210
234
  // The latest quarter's only: months of cash at its burn and the trailing year's.
211
235
  ...runway ? [["Cash Runway", cashRunwayText(runway)] as [string, string]] : [],
212
- ["Total Assets", money(statement.totalAssets)],
213
- ["Total Liabilities", money(statement.totalLiabilities)],
214
- ["Total Debt", money(statement.totalDebt)],
215
- ["Equity", money(statement.totalEquity)],
236
+ ["Total Assets", balance("totalAssets")],
237
+ ["Total Liabilities", balance("totalLiabilities")],
238
+ ["Total Debt", balance("totalDebt")],
239
+ ["Equity", balance("totalEquity")],
216
240
  ["Diluted EPS", money(statement.eps, true)],
217
241
  // Labelled only when the service says the row counts receipts.
218
242
  ["Diluted Shares", statement.dilutedShares != null && statement.shareBasis === "depositary_receipt"
@@ -591,6 +615,21 @@ function enterpriseValueFigure(figure: MetricFigure, fundamentals: TickerFinanci
591
615
  return label === "provider" && figure.text !== "—" ? { ...figure, text: `${figure.text} (provider)` } : figure;
592
616
  }
593
617
 
618
+ /**
619
+ * The fundamentals `ticker` reads its one EV from: where the provider's is more than 5% from market cap + debt - cash,
620
+ * the computed figure in its place, so the overview gives one number and no reconciliation line (`fundamentals` and
621
+ * `valuation` keep both, and JSON keeps the provider's beside its check).
622
+ */
623
+ function withComputedEnterpriseValue(
624
+ fundamentals: TickerFinancials["fundamentals"],
625
+ currency: string | undefined,
626
+ ): TickerFinancials["fundamentals"] {
627
+ const check = enterpriseValueLabel(fundamentals) === "provider" ? enterpriseValueCheck(fundamentals) : undefined;
628
+ if (!fundamentals || !check || !(typeof check.computed === "number" && check.computed > 0)
629
+ || (currency && check.currency && check.currency !== currency)) return fundamentals;
630
+ return { ...fundamentals, enterpriseValue: check.computed, enterpriseValueCheck: undefined };
631
+ }
632
+
594
633
  function percentFigure(fraction: number | null | undefined, format: (value: number) => string): MetricFigure {
595
634
  return fraction != null ? { text: format(fraction), value: fraction * 100, unit: "%" } : { text: "—" };
596
635
  }
@@ -1329,8 +1368,9 @@ export async function buildTickerReport({
1329
1368
  ? `${formatCompact(capitalization.value)} ${capitalization.currency}${await inBase(capitalization.value, capitalization.currency)}`
1330
1369
  : "—";
1331
1370
  // Shown in the same currency as the market cap, so the two can be compared.
1332
- const enterpriseValue = reportedEnterpriseValue(priced.fundamentals);
1333
1371
  const evCurrency = enterpriseValueCurrency(quote, fundamentals);
1372
+ const shownFundamentals = withComputedEnterpriseValue(priced.fundamentals, evCurrency);
1373
+ const enterpriseValue = reportedEnterpriseValue(shownFundamentals);
1334
1374
  const enterpriseValueText = `${formatReportedMoney(enterpriseValue, evCurrency)}${enterpriseValue != null && evCurrency
1335
1375
  ? await inBase(enterpriseValue, evCurrency) : ""}`;
1336
1376
 
@@ -1389,7 +1429,7 @@ export async function buildTickerReport({
1389
1429
 
1390
1430
  // A listing of the last year may have no statements yet: its IPO says how recent it is.
1391
1431
  const listing = { listedSince: ipo ? ipo.deal.listingDate ?? ipo.deal.firstDay?.session ?? null : null };
1392
- const metrics = withoutStockRows(fundamentalsMetrics(quote, priced.fundamentals, profile, { text: marketCapText }, priceReturns,
1432
+ const metrics = withoutStockRows(fundamentalsMetrics(quote, shownFundamentals, profile, { text: marketCapText }, priceReturns,
1393
1433
  fundamentalsCurrency(financials, listing), { text: enterpriseValueText }, distributions, bondFund, codes), isFund);
1394
1434
  const reportedCurrency = financials.financialCurrency?.trim();
1395
1435
  const statements = [...financials.annualStatements, ...financials.quarterlyStatements];
@@ -1401,7 +1441,7 @@ export async function buildTickerReport({
1401
1441
 
1402
1442
  const beforeFundamentals = lines.length;
1403
1443
  appendMetricSection(lines, "Fundamentals", metricLines(metrics));
1404
- for (const note of fundamentalsNotes(priced, metrics, quote?.currency)) lines.push(cliStyles.muted(note));
1444
+ for (const note of fundamentalsNotes({ ...priced, fundamentals: shownFundamentals }, metrics, quote?.currency)) lines.push(cliStyles.muted(note));
1405
1445
  // The trailing block beside statements in another currency, when no conversion says why.
1406
1446
  const split = metrics.some((metric) => TRAILING_MONEY_METRICS.has(metric.label) && metric.text !== "—")
1407
1447
  ? ttmCurrencySplitNote(priced.fundamentals, [latestAnnual, latestQuarter].flatMap((row) => row ? [statementCurrency(row)] : []))
@@ -1431,7 +1471,7 @@ export async function buildTickerReport({
1431
1471
  if (latestQuarter) {
1432
1472
  const runway = cashRunway(financials);
1433
1473
  appendMetricSection(lines, `Latest Quarter (${statementPeriodText(latestQuarter.date, statementFilings?.latestQuarter ?? null)})`,
1434
- buildStatementMetrics(latestQuarter, statementCurrency(latestQuarter), codes, runway));
1474
+ buildStatementMetrics(latestQuarter, statementCurrency(latestQuarter), codes, runway, latestAnnual));
1435
1475
  unsourced(latestQuarter);
1436
1476
  // How the months are counted, and an offering since the balance sheet that the cash does not include yet.
1437
1477
  if (burnsCash(runway)) lines.push(cliStyles.muted(runwayMethod(runway.includesShortTerm)));
@@ -1454,9 +1494,10 @@ export async function buildTickerReport({
1454
1494
  return publishedAt ? formatTimestamp(publishedAt.getTime()) : "";
1455
1495
  })(),
1456
1496
  ],
1457
- body: item.summary,
1497
+ // A summary that only says the headline again is left out; JSON keeps it.
1498
+ body: item.summary && !summaryRestatesHeadline(item.title, item.summary) ? item.summary : undefined,
1458
1499
  link: item.url,
1459
- })), recentNews[0]?.searchedFor ? coinNewsFallbackNotice(symbol, recentNews[0].searchedFor) : null);
1500
+ })), recentNews[0]?.searchedFor ? newsFallbackNotice(symbol, recentNews[0].searchedFor) : null);
1460
1501
 
1461
1502
  appendFeedSection(lines, "Recent SEC Filings", recentSecFilings.map((filing) => ({
1462
1503
  title: (() => {
@@ -1798,7 +1839,7 @@ export async function ticker(symbol: string, dependencies: TickerCommandDependen
1798
1839
  // stopped trading shows none of the profile and figures another listing under its symbol was served with.
1799
1840
  const shownFinancials = await atReportTtmRate(otherProfile ? withoutResearch(resolvedFinancials) : resolvedFinancials, toBase);
1800
1841
  if (dependencies.printResult) {
1801
- const newsNote = recentNews[0]?.searchedFor ? coinNewsFallbackNotice(requestSymbol, recentNews[0].searchedFor) : null;
1842
+ const newsNote = recentNews[0]?.searchedFor ? newsFallbackNotice(requestSymbol, recentNews[0].searchedFor) : null;
1802
1843
  const warnings = [...choiceNotes, quoteNote, newsNote].filter((note): note is string => !!note);
1803
1844
  dependencies.printResult({
1804
1845
  freshness,
@@ -72,11 +72,10 @@ export interface ImpliedForward {
72
72
  export function impliedForward(
73
73
  spot: number,
74
74
  days: number,
75
- base: Pick<CloudShortRate, "dayCountBasis"> & { value: number },
76
- quote: Pick<CloudShortRate, "dayCountBasis"> & { value: number; currency: string },
75
+ base: Pick<CloudShortRate, "dayCountBasis" | "compounding"> & { value: number },
76
+ quote: Pick<CloudShortRate, "dayCountBasis" | "compounding"> & { value: number; currency: string },
77
77
  ): ImpliedForward {
78
- const growth = (rate: { value: number; dayCountBasis: number }) => 1 + (rate.value / 100) * days / rate.dayCountBasis;
79
- const forward = spot * growth(quote) / growth(base);
78
+ const forward = spot * shortRateGrowth(quote, days) / shortRateGrowth(base, days);
80
79
  const pointSize = forwardPointSize(quote.currency);
81
80
  const premiumPercent = (forward / spot - 1) * 100;
82
81
  return {
@@ -89,6 +88,24 @@ export function impliedForward(
89
88
  };
90
89
  }
91
90
 
91
+ /**
92
+ * What one unit grows to over `days` at a short rate: simple interest on its
93
+ * day count, or, for a rate compounded over 252 business days (CDI),
94
+ * (1 + r)^(days / 365), business days taken as 252/365 of the calendar days.
95
+ */
96
+ function shortRateGrowth(rate: Pick<CloudShortRate, "dayCountBasis" | "compounding"> & { value: number }, days: number): number {
97
+ return rate.compounding === "business-252"
98
+ ? (1 + rate.value / 100) ** (days / 365)
99
+ : 1 + (rate.value / 100) * days / rate.dayCountBasis;
100
+ }
101
+
102
+ /** `(1 + 3.92% × 92/360)`, or `(1 + 13.65%)^(92/365)` for a compounded rate: one leg of the parity, as `fx --forward` prints it. */
103
+ export function shortRateGrowthText(rate: Pick<CloudShortRate, "dayCountBasis" | "compounding"> & { value: number }, days: number): string {
104
+ return rate.compounding === "business-252"
105
+ ? `(1 + ${formatRatePercent(rate.value)})^(${days}/365)`
106
+ : `(1 + ${formatRatePercent(rate.value)} × ${days}/${rate.dayCountBasis})`;
107
+ }
108
+
92
109
  /** A rate the forward can use: listed for the currency, with a value. */
93
110
  export type ShortRateLookup = { rate: CloudShortRate & { value: number } } | { error: string };
94
111
 
@@ -109,7 +126,7 @@ export function shortRateFor(currency: string, rates: readonly CloudShortRate[])
109
126
  }
110
127
 
111
128
  /** `6.776%`: a rate as its publisher prints it, to four decimals at most. */
112
- export function formatRatePercent(value: number): string {
129
+ function formatRatePercent(value: number): string {
113
130
  return `${Number(value.toFixed(4))}%`;
114
131
  }
115
132
 
@@ -124,7 +141,8 @@ export function formatForwardPoints(points: number): string {
124
141
  return `${points >= 0 ? "+" : ""}${points.toFixed(1)}`;
125
142
  }
126
143
 
127
- /** `TIIE 28d 6.776% (Banco de México, 2026-10-20; ACT/360)`. */
144
+ /** `TIIE 28d 6.776% (Banco de México, 2026-10-20; ACT/360)`, `CDI 13.65% (Banco Central do Brasil, 2026-11-05; BUS/252 compounded)`. */
128
145
  export function describeShortRate(rate: CloudShortRate & { value: number }): string {
129
- return `${rate.name} ${formatRatePercent(rate.value)} (${rate.publisher}, ${rate.asOf ?? "undated"}; ACT/${rate.dayCountBasis})`;
146
+ const basis = rate.compounding === "business-252" ? "BUS/252 compounded" : `ACT/${rate.dayCountBasis}`;
147
+ return `${rate.name} ${formatRatePercent(rate.value)} (${rate.publisher}, ${rate.asOf ?? "undated"}; ${basis})`;
130
148
  }
@@ -66,15 +66,17 @@ export const GLOSSARY: readonly GlossaryEntry[] = [
66
66
  + "Every winning bid is filled at it; for TIPS it is a real yield.",
67
67
  },
68
68
  {
69
- term: "Stop-out vs average", aliases: ["stop-out vs avg", "vs avg", "stop-out vs median"], functions: ["AUCT"],
70
- shown: ["Stop-out vs avg", "Stop-out vs average"],
71
- definition: "The high (stop-out) yield minus the auction's average/median yield, in basis points; bills compare discount rates. "
69
+ term: "Stop-out vs median", aliases: ["stop-out vs med", "vs med", "stop-out vs average", "stop-out vs avg", "vs avg"], functions: ["AUCT"],
70
+ shown: ["Stop-out vs median", "Stop-out vs average", "Stop-out vs average/median", "VS MED", "VS AVG", "VS AVG/MED"],
71
+ definition: "The high (stop-out) yield minus the auction's median yield, in basis points; bills compare discount rates. "
72
+ + "Treasury has sold at a single price since November 1998 and publishes the median accepted bid; before, most auctions "
73
+ + "were multiple-price and the figure is the average, so older auctions read stop-out vs average. "
72
74
  + "A wider gap means the last accepted bids cleared well above where most of the auction priced.",
73
75
  },
74
76
  {
75
77
  term: "Tail", aliases: ["tailed", "tailing", "auction tail"], functions: ["AUCT"], shown: ["tail"],
76
78
  definition: "How far an auction's high yield cleared above the when-issued yield at the 1 pm bid deadline; a tail reads as weak demand. "
77
- + "AUCT cannot show one, as its source has no when-issued yields, so it shows stop-out vs average instead.",
79
+ + "AUCT cannot show one, as its source has no when-issued yields, so it shows stop-out vs median instead.",
78
80
  },
79
81
  {
80
82
  term: "When-issued", short: "WI", aliases: ["when issued", "wi yield", "when-issued yield"], functions: ["AUCT"],
@@ -87,6 +89,18 @@ export const GLOSSARY: readonly GlossaryEntry[] = [
87
89
  definition: "A bill's yield at the highest accepted (stop-out) rate, restated as a bond-equivalent yield so it compares with "
88
90
  + "note yields. It reads higher than the bill's discount rate.",
89
91
  },
92
+ {
93
+ term: "Discount rate", aliases: ["bank discount rate", "high discount rate", "discount yield"], functions: ["AUCT"],
94
+ shown: ["Discount rate"],
95
+ definition: "How a bill is bid and quoted: the discount from face value as an annual rate on a 360-day year. "
96
+ + "The auction's high discount rate is the one its investment rate restates.",
97
+ },
98
+ {
99
+ term: "Auction percentile", aliases: ["b/c percentile", "b/c pctl", "indirect percentile", "dealer percentile"], functions: ["AUCT"],
100
+ shown: ["B/C pctl", "Indirect pctl", "Dealer pctl"],
101
+ definition: "Where an auction's bid-to-cover, indirect or dealer share ranks among the previous 24 auctions of the same "
102
+ + "tenor and type, from 0 (the lowest) to 100 (the highest). Blank with fewer than 12 before it.",
103
+ },
90
104
  {
91
105
  term: "High discount margin", aliases: ["discount margin", "frn margin"], functions: ["AUCT"],
92
106
  shown: ["High discount margin", "FRN"],
@@ -1005,7 +1019,7 @@ export interface GlossaryLookup {
1005
1019
  /** The entries the query names: by the term, its abbreviation or an alias. */
1006
1020
  exact: GlossaryEntry[];
1007
1021
  /**
1008
- * The others whose names hold each word of the query: `stop-out` finds stop-out vs average. Beside a term the
1022
+ * The others whose names hold each word of the query: `stop-out` finds stop-out vs median. Beside a term the
1009
1023
  * query names they hold the words whole; otherwise a word start is enough, and the whole ones come first.
1010
1024
  */
1011
1025
  partial: GlossaryEntry[];
@@ -19,7 +19,7 @@ import {
19
19
  isWickFlag, latestTradeIndex, missingVolumeNotice, pricePointIntegrityFlags, pricePointValues, pricePointWickFlags,
20
20
  } from "../utils/price-history-integrity";
21
21
  import { formatUtcTime } from "../utils/utc-time";
22
- import { maxDrawdown, type MaxDrawdown } from "../utils/max-drawdown";
22
+ import { maxDrawdown, type DrawdownScale, type MaxDrawdown } from "../utils/max-drawdown";
23
23
  import { historyCoverageNotice } from "../sources/history-coverage";
24
24
  import { barLastSession, barPeriodToDate, type BarPeriodToDate } from "../market-data/market/bar-period";
25
25
  import { barSizeFromGap, medianBarGap } from "../time-series/bar-spacing";
@@ -486,12 +486,14 @@ function historyContractRuns<Row extends Pick<HistoryRow, "contract" | "roll">>(
486
486
  */
487
487
  export function historyContractDrawdown(
488
488
  rows: readonly Pick<HistoryRow, "date" | "close" | "contract" | "roll">[],
489
+ scale: DrawdownScale = "return",
489
490
  ): { drawdown: MaxDrawdown; contract: string | null } | null {
490
491
  const runs = historyContractRuns(rows);
491
492
  let deepest: { drawdown: MaxDrawdown; contract: string | null } | null = null;
493
+ const depth = (drawdown: MaxDrawdown) => drawdown.bp ?? drawdown.drawdown;
492
494
  for (const run of runs) {
493
- const drawdown = maxDrawdown(run.rows);
494
- if (drawdown && (!deepest || drawdown.drawdown < deepest.drawdown.drawdown)) deepest = { drawdown, contract: runs.length > 1 ? run.contract : null };
495
+ const drawdown = maxDrawdown(run.rows, scale);
496
+ if (drawdown && (!deepest || depth(drawdown) < depth(deepest.drawdown))) deepest = { drawdown, contract: runs.length > 1 ? run.contract : null };
495
497
  }
496
498
  return deepest;
497
499
  }
package/src/cli/index.ts CHANGED
@@ -37,7 +37,7 @@ import { overviewCliCommands } from "./commands/overview";
37
37
  import { remoteCliCommand } from "./commands/remote";
38
38
  import { createSystemCliCommands } from "./commands/system";
39
39
  import { brokerCliCommand, ibkrCliCommand } from "./commands/broker";
40
- import { listPlugins, updatePlugins } from "./commands/plugins";
40
+ import { installedPluginArg, listPlugins, updatePlugins } from "./commands/plugins";
41
41
  import { installListedPlugin, removePlugin } from "../plugins/installer";
42
42
  import {
43
43
  catalogCommandHits,
@@ -276,17 +276,17 @@ export function createCoreCliCommands(
276
276
  },
277
277
  {
278
278
  name: "update",
279
- description: "Update installed plugins, or one by name",
279
+ description: "Update installed plugins, or one by id or folder",
280
280
  help: {
281
281
  group: CLI_COMMAND_GROUPS.plugins,
282
- usage: ["update [name]"],
282
+ usage: ["update [plugin]"],
283
283
  sections: [{
284
284
  title: "Updating Gloom itself",
285
285
  lines: [
286
286
  "The app updates itself from stable releases. config set updates.channel nightly adds the nightly build of main; see gloom help config.",
287
287
  ],
288
288
  }],
289
- examples: ["update", "update gloom-tv"],
289
+ examples: ["update", "update tv"],
290
290
  },
291
291
  execute: async (args) => {
292
292
  await updatePlugins(args[0]);
@@ -298,15 +298,15 @@ export function createCoreCliCommands(
298
298
  description: "Remove an installed plugin",
299
299
  help: {
300
300
  group: CLI_COMMAND_GROUPS.plugins,
301
- usage: ["remove <name>"],
302
- examples: ["remove gloom-tv"],
301
+ usage: ["remove <plugin>"],
302
+ examples: ["remove tv"],
303
303
  },
304
304
  execute: async (args) => {
305
305
  const name = args[0];
306
306
  if (!name) {
307
- fail("Usage: gloom remove <name>");
307
+ fail("Usage: gloom remove <plugin>");
308
308
  }
309
- await removePlugin(name);
309
+ await removePlugin(installedPluginArg(name));
310
310
  },
311
311
  },
312
312
  apiCliCommand,
@@ -98,7 +98,14 @@ export const MUNI_LINE = "Municipal bonds: no AAA muni curve (MMD and BVAL are l
98
98
  * carriers"). An entry without `words` matches the whole query alone, since
99
99
  * its terms are words of company names too ("carbon", "second").
100
100
  */
101
- const KNOWN_GAPS: ReadonlyArray<{ terms: readonly string[]; words?: readonly string[]; tickers?: readonly string[]; message: string }> = [
101
+ const KNOWN_GAPS: ReadonlyArray<{
102
+ terms: readonly string[];
103
+ words?: readonly string[];
104
+ tickers?: readonly string[];
105
+ /** A price the terminal has none of: where a ticker goes, the query answers this line rather than a company's name holding its words. */
106
+ unquoted?: boolean;
107
+ message: string;
108
+ }> = [
102
109
  {
103
110
  terms: ["EUA", "EUAs", "EU ETS", "EU allowance", "EU allowances", "EU carbon", "carbon", "carbon allowance", "carbon allowances",
104
111
  "carbon price", "carbon prices", "carbon credits", "emission allowances", "emissions allowances"],
@@ -127,6 +134,17 @@ const KNOWN_GAPS: ReadonlyArray<{ terms: readonly string[]; words?: readonly str
127
134
  message: "Baltic indices (BDI, Capesize, Panamax, Supramax) and freight forwards (FFA) are not covered. Traded proxies: BDRY (freight futures ETF), "
128
135
  + "SBLK, GNK, DSX (dry-bulk shipowners); chokepoint transits: fn CHOKE; news \"dry bulk\".",
129
136
  },
137
+ {
138
+ // Live iron ore futures (SGX, DCE, CME) are licensed; the IMF's monthly world price is the one the terminal has.
139
+ // "iron ore" typed for a quote was Kumba Iron Ore's stock, which its own name still finds.
140
+ terms: ["iron ore", "iron ore price", "iron ore prices", "iron ore futures", "iron ore 62", "62% Fe", "iron ore 62% Fe",
141
+ "iron ore fines", "SGX iron ore", "DCE iron ore", "iron ore spot"],
142
+ words: ["price", "prices", "futures", "future", "spot", "62", "fe", "cfr", "china", "fines", "monthly", "chart", "today",
143
+ "current", "latest", "live", "quote", "the", "of"],
144
+ unquoted: true,
145
+ message: "Iron ore: no live price (SGX, DCE and CME iron ore futures are licensed). The IMF's monthly world price: gloom fred PIORECRUSDM. "
146
+ + "Producers: VALE, RIO, BHP, KIO:JSE (Kumba Iron Ore).",
147
+ },
130
148
  {
131
149
  // What the terminal has for munis, and what it does not: the AAA curve every muni ratio quotes is licensed.
132
150
  terms: ["muni", "munis", "municipal", "municipals", "municipal bond", "municipal bonds", "muni bond", "muni bonds", "muni fund", "muni funds",
@@ -497,6 +515,14 @@ function namesKnownGap(gap: (typeof KNOWN_GAPS)[number], query: string): boolean
497
515
  return named.size > 0 && asked.every((word) => named.has(word) || gap.words!.includes(word));
498
516
  }
499
517
 
518
+ /**
519
+ * The line for a price the terminal has none of, typed where a ticker goes ("iron ore"), so it is never read as the
520
+ * company whose name holds its words (Kumba Iron Ore); null for anything else.
521
+ */
522
+ export function unquotedGapMessage(query: string): string | null {
523
+ return KNOWN_GAPS.find((gap) => gap.unquoted && namesKnownGap(gap, query))?.message ?? null;
524
+ }
525
+
500
526
  /**
501
527
  * The line for a query that names a known subject ("carbon allowances", "EUA", "panamax rates"), a Treasury yield
502
528
  * typed as a ticker (US10Y), a topic with no function ("defense budget"), or a macro release no series carries