gloomberb 0.20.4 → 0.20.6

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 (316) hide show
  1. package/README.md +3 -1
  2. package/README.zh-CN.md +1 -1
  3. package/bin/gloom +9 -0
  4. package/bin/without-bun.cjs +98 -0
  5. package/package.json +4 -1
  6. package/src/api-client/data.ts +148 -37
  7. package/src/api-client/hk-tenders.ts +59 -0
  8. package/src/api-client/index.ts +1 -0
  9. package/src/api-client/types/econ.ts +30 -0
  10. package/src/api-client/yield-curves.ts +1 -1
  11. package/src/app/global-shortcuts.ts +4 -1
  12. package/src/app/keybindings/actions.ts +6 -0
  13. package/src/app/keybindings/config.ts +2 -1
  14. package/src/app/keybindings/index.ts +1 -0
  15. package/src/app/keybindings/labels.ts +6 -1
  16. package/src/app/keybindings/resolve.ts +23 -4
  17. package/src/app/keybindings/terminal-keys.ts +35 -0
  18. package/src/app/pane-runtime/index.tsx +2 -2
  19. package/src/app/pane-runtime/ticker-open-runtime.ts +68 -40
  20. package/src/app.tsx +18 -13
  21. package/src/architecture/floating-promise-allowlist.json +313 -0
  22. package/src/architecture/ui-literals-allowlist.json +1 -1
  23. package/src/capabilities/chart-series.ts +27 -1
  24. package/src/cli/commands/keybindings.ts +5 -5
  25. package/src/cli/commands/market.ts +238 -57
  26. package/src/cli/commands/news-search.ts +81 -14
  27. package/src/cli/commands/overview.ts +27 -6
  28. package/src/cli/commands/remote.ts +16 -17
  29. package/src/cli/commands/system.ts +1 -1
  30. package/src/cli/commands/ticker.ts +3 -1
  31. package/src/cli/early-command.ts +2 -0
  32. package/src/cli/errors.ts +10 -1
  33. package/src/cli/fx-forward.ts +89 -7
  34. package/src/cli/fx-pair.ts +1 -1
  35. package/src/cli/fx-quote-rate.ts +23 -0
  36. package/src/cli/glossary.ts +19 -5
  37. package/src/cli/help.ts +1 -0
  38. package/src/cli/history-rows.ts +5 -3
  39. package/src/cli/index-roots.ts +5 -4
  40. package/src/cli/index.ts +40 -3
  41. package/src/cli/known-gaps.ts +38 -9
  42. package/src/cli/listing-arg.ts +17 -5
  43. package/src/cli/name-entries.ts +5 -1
  44. package/src/cli/not-a-ticker.ts +4 -0
  45. package/src/cli/options.ts +52 -3
  46. package/src/cli/output-file.ts +5 -3
  47. package/src/cli/pane-functions/catalog.ts +15 -0
  48. package/src/cli/pane-functions/function-help.ts +4 -4
  49. package/src/cli/pane-functions/headless.ts +9 -4
  50. package/src/cli/pane-functions/index.ts +6 -4
  51. package/src/cli/pane-functions/resolver.ts +2 -2
  52. package/src/cli/result.ts +21 -2
  53. package/src/cli/spreadsheet-hint.ts +7 -3
  54. package/src/cli/treasury-yields.ts +5 -3
  55. package/src/components/chart/composite/legend.tsx +40 -2
  56. package/src/components/command-bar/pane-settings.ts +2 -2
  57. package/src/components/command-bar/routes/root/results.ts +6 -2
  58. package/src/components/command-bar/workflow/tickers.ts +2 -2
  59. package/src/components/data-table/view.tsx +9 -2
  60. package/src/components/input-search-bar.tsx +9 -2
  61. package/src/components/layout/pane/header.tsx +2 -0
  62. package/src/components/layout/shell/pane/capture.ts +4 -1
  63. package/src/components/layout/status-bar.tsx +6 -1
  64. package/src/components/onboarding/first-run-workspace.ts +44 -2
  65. package/src/components/onboarding/onboarding-frame.tsx +11 -2
  66. package/src/components/onboarding/onboarding-keyboard.ts +16 -0
  67. package/src/components/onboarding/onboarding-wizard.tsx +8 -8
  68. package/src/components/onboarding/portfolio-step/positions-panel.tsx +62 -1
  69. package/src/components/onboarding/use-onboarding-progress.ts +12 -4
  70. package/src/components/pane-settings-dialog/desktop.tsx +2 -2
  71. package/src/components/pane-settings-dialog/tui.tsx +2 -2
  72. package/src/components/pane-settings-dialog/value.ts +6 -0
  73. package/src/components/pane-settings-dialog.tsx +3 -3
  74. package/src/components/reader/detail-reader.tsx +4 -0
  75. package/src/components/ui/data-table/opentui/index.tsx +11 -4
  76. package/src/components/ui/data-table/opentui/model.ts +8 -6
  77. package/src/components/ui/data-table/types.ts +6 -1
  78. package/src/components/ui/index.ts +1 -1
  79. package/src/components/ui/page-stack-view.tsx +3 -0
  80. package/src/components/ui/pane-link-chip.tsx +269 -54
  81. package/src/components/ui/query-bar.tsx +2 -1
  82. package/src/components/ui/table-layout.ts +38 -1
  83. package/src/components/ui/tabs.tsx +97 -19
  84. package/src/core/state/app/layout-reducer.ts +7 -0
  85. package/src/core/state/app/layout.ts +44 -7
  86. package/src/core/state/app/state.ts +1 -1
  87. package/src/core/state/app/types.ts +22 -2
  88. package/src/docs/snapshot.json +30 -13
  89. package/src/market-data/depositary-pair.ts +5 -3
  90. package/src/market-data/market/change-basis.ts +9 -5
  91. package/src/market-data/market/dated-previous-close.ts +147 -17
  92. package/src/market-data/market/status.ts +17 -1
  93. package/src/market-data/quotes/contributions.ts +2 -0
  94. package/src/market-data/quotes/listing-enterprise-value.ts +50 -0
  95. package/src/plugins/builtin/alerts/metric-data.ts +15 -2
  96. package/src/plugins/builtin/analytics/risk-client.ts +10 -4
  97. package/src/plugins/builtin/analytics/risk-episodes.ts +5 -4
  98. package/src/plugins/builtin/analytics/risk-headless.ts +4 -2
  99. package/src/plugins/builtin/analytics/risk-sectors.ts +91 -0
  100. package/src/plugins/builtin/awards/index.tsx +1 -1
  101. package/src/plugins/builtin/backtest/headless.ts +1 -1
  102. package/src/plugins/builtin/buildout/index.tsx +1 -0
  103. package/src/plugins/builtin/catalysts/index.tsx +2 -2
  104. package/src/plugins/builtin/cds/headless.ts +4 -0
  105. package/src/plugins/builtin/cds/model.ts +0 -6
  106. package/src/plugins/builtin/chart-composer/formula.ts +16 -3
  107. package/src/plugins/builtin/chart-composer/headless-schema.ts +2 -0
  108. package/src/plugins/builtin/chart-composer/headless.ts +4 -2
  109. package/src/plugins/builtin/chart-composer/index.tsx +1 -0
  110. package/src/plugins/builtin/chart-composer/presets.ts +1 -0
  111. package/src/plugins/builtin/chat/content/composer.tsx +5 -4
  112. package/src/plugins/builtin/chat/content/index.tsx +12 -2
  113. package/src/plugins/builtin/chat/content/layout-metrics.ts +3 -3
  114. package/src/plugins/builtin/chat/content/open-targets.ts +3 -3
  115. package/src/plugins/builtin/chat/layout.ts +5 -2
  116. package/src/plugins/builtin/chat/message/pane-chip.tsx +61 -40
  117. package/src/plugins/builtin/chat/message/terminal.tsx +13 -15
  118. package/src/plugins/builtin/chat/pane-links/previews.ts +51 -5
  119. package/src/plugins/builtin/chat/pane-links/share-card.ts +36 -0
  120. package/src/plugins/builtin/cloud/askg/pane.tsx +55 -13
  121. package/src/plugins/builtin/cloud/askg/tool-display.ts +1 -0
  122. package/src/plugins/builtin/cloud/terminal-relay/redact.ts +5 -3
  123. package/src/plugins/builtin/commodity-balances/index.tsx +1 -0
  124. package/src/plugins/builtin/company-attention/index.tsx +1 -1
  125. package/src/plugins/builtin/company-kpis/headless.ts +3 -1
  126. package/src/plugins/builtin/company-kpis/index.tsx +2 -2
  127. package/src/plugins/builtin/cot/index.tsx +1 -1
  128. package/src/plugins/builtin/cpi/index.tsx +1 -1
  129. package/src/plugins/builtin/credit-boards/cdx-pane.tsx +20 -7
  130. package/src/plugins/builtin/credit-boards/client.ts +8 -0
  131. package/src/plugins/builtin/credit-boards/headless.ts +4 -1
  132. package/src/plugins/builtin/credit-boards/model.ts +58 -4
  133. package/src/plugins/builtin/credit-boards/series.ts +63 -6
  134. package/src/plugins/builtin/credit-boards/sovr-pane.tsx +3 -2
  135. package/src/plugins/builtin/credit-conditions/headless.ts +24 -6
  136. package/src/plugins/builtin/credit-conditions/index.tsx +1 -1
  137. package/src/plugins/builtin/credit-conditions/model.ts +12 -6
  138. package/src/plugins/builtin/credit-conditions/series.ts +2 -1
  139. package/src/plugins/builtin/crypto-board/index.tsx +1 -0
  140. package/src/plugins/builtin/dividend-yield/index.tsx +1 -0
  141. package/src/plugins/builtin/doe/index.tsx +1 -1
  142. package/src/plugins/builtin/earnings-calls/headless.ts +5 -1
  143. package/src/plugins/builtin/earnings-calls/index.tsx +1 -0
  144. package/src/plugins/builtin/econ/calendar-model.ts +115 -8
  145. package/src/plugins/builtin/econ/calendar-source.ts +7 -1
  146. package/src/plugins/builtin/econ/fred-catalog.ts +3 -1
  147. package/src/plugins/builtin/econ/index.tsx +42 -8
  148. package/src/plugins/builtin/econ/types.ts +3 -0
  149. package/src/plugins/builtin/econ-statistics/index.tsx +1 -0
  150. package/src/plugins/builtin/econ-statistics/pane.tsx +6 -0
  151. package/src/plugins/builtin/estimate-revisions/index.tsx +1 -0
  152. package/src/plugins/builtin/executives/index.tsx +1 -0
  153. package/src/plugins/builtin/filing-events/index.tsx +1 -0
  154. package/src/plugins/builtin/fixed-income/index.tsx +3 -0
  155. package/src/plugins/builtin/futures-curve/headless.ts +3 -3
  156. package/src/plugins/builtin/futures-curve/index.tsx +1 -1
  157. package/src/plugins/builtin/futures-curve/model.ts +18 -0
  158. package/src/plugins/builtin/fx-matrix/index.tsx +44 -14
  159. package/src/plugins/builtin/gpu/index.tsx +1 -1
  160. package/src/plugins/builtin/help/functions-table.tsx +1 -1
  161. package/src/plugins/builtin/help/index.tsx +11 -1
  162. package/src/plugins/builtin/help/keybindings-editor.tsx +7 -3
  163. package/src/plugins/builtin/holders/index.tsx +1 -0
  164. package/src/plugins/builtin/holders/report-header.ts +2 -2
  165. package/src/plugins/builtin/insider/index.tsx +1 -0
  166. package/src/plugins/builtin/iv-history/index.tsx +1 -1
  167. package/src/plugins/builtin/jobs/index.tsx +1 -0
  168. package/src/plugins/builtin/macro-day/headless.ts +27 -8
  169. package/src/plugins/builtin/macro-day/index.tsx +1 -1
  170. package/src/plugins/builtin/macro-day/model.ts +19 -3
  171. package/src/plugins/builtin/macro-day/pane.tsx +14 -9
  172. package/src/plugins/builtin/macro-day/releases.ts +25 -7
  173. package/src/plugins/builtin/market-valuation/index.tsx +1 -0
  174. package/src/plugins/builtin/market-valuation/pane.tsx +8 -0
  175. package/src/plugins/builtin/members/index.tsx +1 -1
  176. package/src/plugins/builtin/mna/index.tsx +1 -0
  177. package/src/plugins/builtin/news/index.tsx +1 -0
  178. package/src/plugins/builtin/news/wire/index.tsx +5 -1
  179. package/src/plugins/builtin/news/wire/news/detail-view.tsx +4 -0
  180. package/src/plugins/builtin/news/wire/news/list-search.ts +5 -2
  181. package/src/plugins/builtin/options/index.tsx +1 -0
  182. package/src/plugins/builtin/options-positioning/index.tsx +1 -0
  183. package/src/plugins/builtin/pe-band/index.tsx +1 -1
  184. package/src/plugins/builtin/portfolio-list/cli/portfolio-command.ts +25 -0
  185. package/src/plugins/builtin/portfolio-list/cli/render.ts +20 -3
  186. package/src/plugins/builtin/portfolio-list/cli/watchlist-command.ts +5 -1
  187. package/src/plugins/builtin/portfolio-list/headless.ts +15 -6
  188. package/src/plugins/builtin/power/index.tsx +1 -1
  189. package/src/plugins/builtin/realized-vol/index.tsx +1 -1
  190. package/src/plugins/builtin/research/headless-schema.ts +4 -3
  191. package/src/plugins/builtin/research/headless.ts +10 -4
  192. package/src/plugins/builtin/research/index.tsx +4 -0
  193. package/src/plugins/builtin/research/relative-valuation-columns.ts +145 -47
  194. package/src/plugins/builtin/research/relative-valuation-currency.ts +31 -0
  195. package/src/plugins/builtin/research/relative-valuation-headless.ts +25 -8
  196. package/src/plugins/builtin/research/relative-valuation-model.ts +40 -9
  197. package/src/plugins/builtin/research/relative-valuation-pane.tsx +3 -2
  198. package/src/plugins/builtin/research/relative-valuation-peers.ts +2 -2
  199. package/src/plugins/builtin/research-search/index.tsx +1 -0
  200. package/src/plugins/builtin/research-search/pane.tsx +8 -0
  201. package/src/plugins/builtin/revenue-breakdown/index.tsx +1 -0
  202. package/src/plugins/builtin/reverse-dcf/index.tsx +1 -1
  203. package/src/plugins/builtin/risk-factors/index.tsx +1 -0
  204. package/src/plugins/builtin/scanner/headless.ts +52 -13
  205. package/src/plugins/builtin/seasonality/index.tsx +1 -1
  206. package/src/plugins/builtin/sec/index.tsx +1 -0
  207. package/src/plugins/builtin/series-inventory.ts +1 -1
  208. package/src/plugins/builtin/shared/scanner-capture.ts +11 -3
  209. package/src/plugins/builtin/shared/series-list-detail.tsx +5 -0
  210. package/src/plugins/builtin/short-interest/index.tsx +1 -0
  211. package/src/plugins/builtin/social-mentions/index.tsx +1 -1
  212. package/src/plugins/builtin/supply-chain/index.tsx +1 -0
  213. package/src/plugins/builtin/thirteenf/api.ts +47 -4
  214. package/src/plugins/builtin/thirteenf/data.ts +43 -10
  215. package/src/plugins/builtin/thirteenf/headless.ts +55 -11
  216. package/src/plugins/builtin/thirteenf/model.ts +25 -9
  217. package/src/plugins/builtin/thirteenf/report-notes.ts +27 -6
  218. package/src/plugins/builtin/thirteenf/types.ts +2 -0
  219. package/src/plugins/builtin/ticker-detail/adr-pair/model.ts +1 -1
  220. package/src/plugins/builtin/ticker-detail/data-panes/historical-prices.tsx +8 -7
  221. package/src/plugins/builtin/ticker-detail/data-panes/history-bars.ts +8 -5
  222. package/src/plugins/builtin/ticker-detail/financials/model.ts +18 -2
  223. package/src/plugins/builtin/ticker-detail/financials/ratio-table.tsx +3 -3
  224. package/src/plugins/builtin/ticker-detail/financials/tab.tsx +6 -6
  225. package/src/plugins/builtin/ticker-detail/headless.ts +24 -17
  226. package/src/plugins/builtin/ticker-detail/index.tsx +4 -0
  227. package/src/plugins/builtin/ticker-detail/overview/model.ts +6 -4
  228. package/src/plugins/builtin/ticker-detail/overview-tab.tsx +6 -4
  229. package/src/plugins/builtin/time-sales/client.ts +9 -11
  230. package/src/plugins/builtin/time-sales/index.tsx +1 -1
  231. package/src/plugins/builtin/treasury-auctions/after.ts +267 -0
  232. package/src/plugins/builtin/treasury-auctions/cache.ts +54 -5
  233. package/src/plugins/builtin/treasury-auctions/client.ts +33 -2
  234. package/src/plugins/builtin/treasury-auctions/headless.ts +150 -22
  235. package/src/plugins/builtin/treasury-auctions/hk-headless.ts +126 -0
  236. package/src/plugins/builtin/treasury-auctions/hk-view.tsx +347 -0
  237. package/src/plugins/builtin/treasury-auctions/hk.ts +363 -0
  238. package/src/plugins/builtin/treasury-auctions/index.tsx +27 -4
  239. package/src/plugins/builtin/treasury-auctions/model.ts +264 -28
  240. package/src/plugins/builtin/treasury-auctions/pane.tsx +176 -41
  241. package/src/plugins/builtin/treasury-auctions/treasury-direct.ts +5 -2
  242. package/src/plugins/builtin/treasury-auctions/types.ts +7 -1
  243. package/src/plugins/builtin/vol-surface/index.tsx +1 -1
  244. package/src/plugins/builtin/world-venue-map/index.ts +1 -0
  245. package/src/plugins/builtin/yield-curve/curves.ts +10 -4
  246. package/src/plugins/builtin/yield-curve/headless.ts +6 -2
  247. package/src/plugins/builtin/yield-curve/index.tsx +3 -3
  248. package/src/plugins/builtin/yield-curve/series.ts +10 -0
  249. package/src/plugins/builtin/yield-curve/world.ts +3 -1
  250. package/src/portfolio/collection-name.ts +22 -0
  251. package/src/portfolio/column-values.ts +2 -1
  252. package/src/public/__snapshots__/public-api.test.ts.snap +4 -0
  253. package/src/public/remote.ts +7 -1
  254. package/src/remote/client.ts +191 -11
  255. package/src/remote/controller-utils.ts +13 -1
  256. package/src/remote/controller.ts +88 -26
  257. package/src/remote/endpoint.ts +24 -0
  258. package/src/remote/form.ts +59 -4
  259. package/src/remote/resources.ts +44 -18
  260. package/src/remote/schema.ts +21 -9
  261. package/src/remote/secrets.ts +12 -0
  262. package/src/remote/semantic-tree.tsx +14 -2
  263. package/src/remote/server.ts +2 -1
  264. package/src/remote/surface.tsx +192 -0
  265. package/src/remote/types.ts +5 -0
  266. package/src/renderers/dom/data-table/frozen-column.ts +3 -1
  267. package/src/renderers/dom/data-table/index.tsx +27 -9
  268. package/src/renderers/dom/data-table/row.tsx +2 -0
  269. package/src/renderers/electrobun/bun/desktop/backend.ts +27 -24
  270. package/src/renderers/electrobun/bun/desktop/detached-windows.ts +3 -3
  271. package/src/renderers/electrobun/bun/desktop/snapshot-commit.ts +77 -0
  272. package/src/renderers/electrobun/shared/protocol.ts +4 -0
  273. package/src/renderers/electrobun/view/backend-rpc.ts +3 -0
  274. package/src/renderers/electrobun/view/desktop/window/bridge.ts +3 -0
  275. package/src/renderers/opentui/host.tsx +6 -0
  276. package/src/series/standalone.ts +2 -2
  277. package/src/shares/api.ts +21 -4
  278. package/src/shares/item.ts +73 -0
  279. package/src/shares/pane-item.ts +205 -0
  280. package/src/shares/pane.ts +4 -0
  281. package/src/shares/payload.ts +9 -5
  282. package/src/sources/gloomberb-cloud/news.ts +2 -0
  283. package/src/sources/gloomberb-cloud/normalizers.ts +9 -5
  284. package/src/sources/provider-router/cache.ts +3 -1
  285. package/src/sync/controller.ts +17 -2
  286. package/src/sync/other-window-tabs.ts +32 -1
  287. package/src/sync/react.ts +4 -4
  288. package/src/tickers/renamed-listings.ts +105 -0
  289. package/src/tickers/search/index.ts +103 -16
  290. package/src/time-series/bar-spacing.ts +33 -0
  291. package/src/time-series/base-series.ts +21 -3
  292. package/src/time-series/chart-bounds.ts +31 -0
  293. package/src/time-series/field-catalog.ts +17 -0
  294. package/src/time-series/fundamentals.ts +143 -11
  295. package/src/time-series/ice-credit.ts +32 -6
  296. package/src/time-series/resolve.ts +11 -7
  297. package/src/time-series/session-bar.ts +78 -9
  298. package/src/time-series/studies/formula.ts +53 -10
  299. package/src/time-series/studies/pair.ts +18 -7
  300. package/src/time-series/studies/units.ts +49 -2
  301. package/src/time-series/types.ts +12 -0
  302. package/src/types/desktop-window.ts +2 -0
  303. package/src/types/financials.ts +7 -0
  304. package/src/types/headless.ts +8 -0
  305. package/src/types/plugin-pane-settings.ts +2 -0
  306. package/src/types/plugin-panes.ts +22 -0
  307. package/src/utils/central-banks.ts +86 -1
  308. package/src/utils/cli-output.ts +6 -3
  309. package/src/utils/datetime-format.ts +12 -3
  310. package/src/utils/depositary-receipt.ts +28 -3
  311. package/src/utils/ebitda.ts +128 -0
  312. package/src/utils/format.ts +1 -1
  313. package/src/utils/fundamentals.ts +14 -0
  314. package/src/utils/max-drawdown.ts +97 -16
  315. package/src/utils/shell-word.ts +13 -0
  316. package/src/utils/untrusted-text.ts +29 -0
@@ -3,8 +3,11 @@ import { usePaneFooter, useQueryBarSearch } from "../../../../../components";
3
3
  import type { NewsArticle } from "../../../../../news/types";
4
4
  import { filterNewsArticles } from "../filter-articles";
5
5
 
6
- /** Only what the list has loaded is filtered; older stories load as the list scrolls. */
7
- export const NEWS_LIST_SEARCH_PLACEHOLDER = "filter loaded stories";
6
+ /**
7
+ * Only what the list has loaded is filtered; older stories load as the list scrolls. A narrow pane's field shows
8
+ * the short form whole rather than "filter loaded st".
9
+ */
10
+ export const NEWS_LIST_SEARCH_PLACEHOLDER = ["filter loaded stories", "filter stories"] as const;
8
11
 
9
12
  export function useNewsListSearch<T extends NewsArticle>(articles: readonly T[]) {
10
13
  const [searchQuery, setSearchQuery] = useState("");
@@ -99,6 +99,7 @@ export const optionsModule: PluginModule = {
99
99
  icon: "O",
100
100
  component: OptionsPane,
101
101
  defaultPosition: "right",
102
+ shareItem: { ticker: true },
102
103
  tickerFollower: true,
103
104
  // An option the person holds shows their position.
104
105
  personalData: (context) => (holdsActiveTicker(context) ? "holdings" : null),
@@ -46,6 +46,7 @@ export const optionsPositioningModule: PluginModule = {
46
46
  icon: "O",
47
47
  get component(): typeof import("./pane").OptionsPositioningPane { const { OptionsPositioningPane } = require("./pane"); return OptionsPositioningPane; },
48
48
  defaultPosition: "right",
49
+ shareItem: { ticker: true },
49
50
  tickerFollower: true,
50
51
  defaultMode: "floating",
51
52
  defaultFloatingSize: { width: 104, height: 34 },
@@ -6,7 +6,7 @@ import { LOOKBACK_OPTIONS, PeBandPane } from "./pane";
6
6
  export const peBandModule: PluginModule = {
7
7
  panes: [{
8
8
  id: "pe-band", name: "P/E Band", icon: "P", component: PeBandPane,
9
- defaultPosition: "right", tickerFollower: true, instruments: ["equity"], defaultMode: "floating", defaultFloatingSize: { width: 90, height: 30 },
9
+ defaultPosition: "right", shareItem: { ticker: true }, tickerFollower: true, instruments: ["equity"], defaultMode: "floating", defaultFloatingSize: { width: 90, height: 30 },
10
10
  tableExport: true,
11
11
  settings: { title: "P/E Band Settings", fields: [
12
12
  { key: "lookbackYears", label: "Lookback", type: "select", options: LOOKBACK_OPTIONS },
@@ -406,6 +406,10 @@ async function setPositionCommand(
406
406
  }
407
407
  await store.saveTicker(result.ticker);
408
408
  if (adopted) await saveConfig(adopted);
409
+ // Said, never silent: a book named "LatAm Book USD" otherwise totals in BRL from its first PETR4 lot on.
410
+ const currencyNote = adopted && portfolioCurrency !== portfolio.currency
411
+ ? firstPositionCurrencyNote(portfolio, portfolioCurrency) : null;
412
+ if (currencyNote?.warning) notes.push(currencyNote.text);
409
413
  const saved = savedListingName(result.ticker);
410
414
  const quantity = formatMarketQuantity(shares, { assetCategory: result.ticker.metadata.assetCategory });
411
415
  // A cost in another currency converts at the rate it was bought at when the lot has one, else at the close of the
@@ -426,6 +430,7 @@ async function setPositionCommand(
426
430
  ...(future ? { contractMultiplier: multiplier ?? null, contractSize: size?.size ?? null } : {}),
427
431
  ...(purchaseDate ? { dateAcquired: purchaseDate } : {}),
428
432
  ...(foreign ? { costFxRate: boughtRate, costFxCurrency: portfolioCurrency, costFxDate: rateDate } : {}),
433
+ ...(currencyNote ? { totalsCurrency: portfolioCurrency } : {}),
429
434
  },
430
435
  warnings: notes.length > 0 ? notes : undefined,
431
436
  }, {
@@ -447,6 +452,7 @@ async function setPositionCommand(
447
452
  ? `Cost converted at today's rate into ${portfolioCurrency}: the FX close of the purchase date could not be read.`
448
453
  : `Cost converted at today's rate into ${portfolioCurrency}; add --date or --cost-fx to use the rate when bought.`)]
449
454
  : []),
455
+ ...(currencyNote && !currencyNote.warning ? [cliStyles.muted(currencyNote.text)] : []),
450
456
  ].join("\n"),
451
457
  });
452
458
  } catch (error) {
@@ -455,6 +461,25 @@ async function setPositionCommand(
455
461
  });
456
462
  }
457
463
 
464
+ /**
465
+ * What the first position of a book that follows its holdings' currency says
466
+ * when it moves the book off the one it had: a line, `"LatAm Book USD" now
467
+ * totals in BRL, its first position's currency.`, and a warning only when
468
+ * the book holds cash or targets already, which were set beside its old
469
+ * totals: `..., its cash and targets included. To keep USD, recreate it with
470
+ * --currency USD.`
471
+ */
472
+ function firstPositionCurrencyNote(portfolio: Portfolio, adopted: string): { text: string; warning: boolean } {
473
+ const note = `"${portfolio.name}" now totals in ${adopted}, its first position's currency`;
474
+ const held = [
475
+ portfolio.cash && portfolio.cash.amount !== 0 ? "cash" : null,
476
+ Object.keys(portfolio.targetWeights ?? {}).length > 0 ? "targets" : null,
477
+ ].filter((part): part is string => part !== null);
478
+ if (held.length === 0) return { text: `${note}.`, warning: false };
479
+ const was = portfolio.currency;
480
+ return { text: `${note}, its ${held.join(" and ")} included. To keep ${was}, recreate it with --currency ${was}.`, warning: true };
481
+ }
482
+
458
483
  /**
459
484
  * Sets the position, saying how to go on when the lots it replaces were
460
485
  * bought at FX rates one position cannot keep: give the whole position's rate.
@@ -1,6 +1,7 @@
1
1
  import { logFailure } from "../../../../utils/log-failure";
2
2
  import { createBaseConverter, type BaseConversion } from "../../../../cli/base-converter";
3
3
  import { quotedFxPair } from "../../../../utils/currency-pair";
4
+ import { commandWord } from "../../../../utils/shell-word";
4
5
  import { formatFxRate } from "../../../../cli/fx-pair";
5
6
  import { savedListingName } from "../../../../cli/listing-arg";
6
7
  import { currentListingName } from "../../../../tickers/listing-name";
@@ -87,7 +88,7 @@ import {
87
88
  } from "../../../../portfolio/allocation";
88
89
  import { findCachedPortfolioAccount } from "../cached-account";
89
90
  import { importedFromText } from "../imported-from";
90
- import { findNamedCollection } from "../../../../portfolio/collection-name";
91
+ import { findNamedCollection, watchlistMemberSymbol } from "../../../../portfolio/collection-name";
91
92
  import { isoDateToday } from "../../../../utils/calendar-date";
92
93
  import { lastTradeDate } from "../../../../tickers/listing-fate";
93
94
  import type { PriceWindow } from "../../../../utils/price-window";
@@ -194,10 +195,25 @@ export function renderCollectionOverview(config: AppConfig, tickers: TickerRecor
194
195
  ]),
195
196
  ));
196
197
  }
198
+ // Nothing in any of them: the commands that fill one, as `alerts` names the one that adds an alert.
199
+ const empty = [
200
+ ...config.portfolios.map((portfolio) => countCollectionTickers(tickers, "portfolios", portfolio.id)),
201
+ ...config.watchlists.map((watchlist) => countCollectionTickers(tickers, "watchlists", watchlist.id)),
202
+ ].every((count) => count === 0);
203
+ const adds = [
204
+ config.portfolios[0] ? collectionAddCommand("portfolio", config.portfolios[0].name) : null,
205
+ config.watchlists[0] ? collectionAddCommand("watchlist", config.watchlists[0].name) : null,
206
+ ].filter((command): command is string => command != null);
207
+ if (empty && adds.length > 0) blocks.push("", cliStyles.muted(`No tickers yet. Add some with ${adds.join(" or ")}.`));
197
208
 
198
209
  return blocks.join("\n");
199
210
  }
200
211
 
212
+ /** `gloom watchlist add Watchlist AAPL MSFT`: the command that adds tickers to a collection, its name quoted for any shell. */
213
+ export function collectionAddCommand(kind: "portfolio" | "watchlist", name: string): string {
214
+ return `gloom ${kind} add ${commandWord(name)} AAPL MSFT`;
215
+ }
216
+
201
217
  export interface ShowCollectionOptions {
202
218
  /** `--explain`: follow the report with what the terms it shows mean, as `fn <function> --explain` does. */
203
219
  explain?: boolean;
@@ -830,7 +846,7 @@ async function showCollectionWithMarketData(
830
846
 
831
847
  if (filtered.length === 0 && !structured && !hasCash) {
832
848
  console.log(cliStyles.bold(displayName));
833
- console.log(cliStyles.muted("No tickers in this collection."));
849
+ console.log(cliStyles.muted(`No tickers in this ${isPortfolio ? "portfolio" : "watchlist"}. Add some with ${collectionAddCommand(isPortfolio ? "portfolio" : "watchlist", displayName)}.`));
834
850
  if (explain) console.log(`\n${renderReportGlossary(EXPLAINED_REPORT, [])}`);
835
851
  return;
836
852
  }
@@ -1447,7 +1463,8 @@ async function valueWatchlistRows({
1447
1463
  values.push({
1448
1464
  ticker, quote, headline, extended, kind, venue, marketCap, funding, stale, lastTrade,
1449
1465
  row: {
1450
- symbol,
1466
+ // A listing abroad by its venue (ASML:AMS, 2330:TWSE), so a join on the export never meets the US line.
1467
+ symbol: watchlistMemberSymbol(ticker.metadata),
1451
1468
  ...listingColumns(ticker, quote),
1452
1469
  exchange: venue,
1453
1470
  kind,
@@ -20,7 +20,7 @@ import {
20
20
  deleteWatchlist as deleteWatchlistConfig,
21
21
  removeTickerFromWatchlist as removeWatchlistMembership,
22
22
  } from "../../../../portfolio/mutations";
23
- import { showCollection } from "./render";
23
+ import { collectionAddCommand, showCollection } from "./render";
24
24
  import { listingFields, misplacedSymbolList, refuseDryRun, takeCollectionName } from "./shared";
25
25
  import { addOneSymbol, addSymbols, FILE_OPTION, listAddLookups, printSymbolRows, progressNotice, removeSymbols, requireSymbolList, retryNotice, shellWord, SYMBOL_LIST_HELP } from "./bulk-symbols";
26
26
  import { readNameEntries } from "../../../../cli/name-entries";
@@ -209,6 +209,10 @@ async function listWatchlists(ctx: CliCommandContext) {
209
209
  String(watchlist.tickerCount),
210
210
  ]),
211
211
  ));
212
+ // Nothing in any of them: the command that fills one, as `alerts` names the one that adds an alert.
213
+ if (rows.every((watchlist) => watchlist.tickerCount === 0)) {
214
+ console.log(cliStyles.muted(`\nNo tickers yet. Add some with ${collectionAddCommand("watchlist", rows[0]!.name)}.`));
215
+ }
212
216
  });
213
217
  }
214
218
 
@@ -32,7 +32,7 @@ import { valuationBasisLabel, type PortfolioValuationBasis } from "../../../port
32
32
  import { futuresQuantityText, isFuturesTicker } from "../../../portfolio/futures-positions";
33
33
  import { dailyFuturesHistory, loadPortfolioFuturesTerms } from "../../../portfolio/futures-terms";
34
34
  import { loadPurchaseDateCostFx } from "../../../portfolio/cost-fx";
35
- import { EXTENDED_SESSION_LABELS, quoteHeadlineTime, type ExtendedSession } from "../../../market-data/market/status";
35
+ import { EXTENDED_SESSION_LABELS, getCompletedRegularSessionDisplay, quoteHeadlineTime, type ExtendedSession } from "../../../market-data/market/status";
36
36
  import {
37
37
  BROKER_ACCOUNT_MISSING_NOTE,
38
38
  CASH_SYMBOL,
@@ -53,6 +53,13 @@ import { REPORT_ROWS } from "../shared/headless-options";
53
53
  import { readPriceWindow, type PriceWindow } from "../../../utils/price-window";
54
54
  import { loadPeriodPnl, periodBasisText, periodBoughtText, periodUnpricedText } from "./period-pnl";
55
55
 
56
+ /** An extended print without a known regular close cannot supply a regular-session change. */
57
+ function regularChangeFields(quote: Quote | undefined, change: unknown) {
58
+ const known = quote && (!quote.marketState || quote.marketState === "REGULAR" || getCompletedRegularSessionDisplay(quote));
59
+ const value = known && typeof change === "number" && Number.isFinite(change) ? change : null;
60
+ return { changePercent: value, changeBasis: value == null ? null : "regular-session" };
61
+ }
62
+
56
63
  const DEFAULT_ROW_LIMIT = 50;
57
64
  const MAX_ROW_LIMIT = 200;
58
65
 
@@ -94,7 +101,7 @@ const POSITION_COLUMNS: HeadlessPaneColumn[] = [
94
101
  { key: "avgCost", header: "Avg Cost", align: "right", format: unitMoney("positionCurrency"), description: "Per unit, in the position's currency." },
95
102
  { key: "price", header: "Last", align: "right", format: unitMoney("priceCurrency"), description: "In the quote's currency." },
96
103
  { key: "priceCurrency", header: "Ccy" },
97
- { key: "changePercent", header: "Chg", align: "right", format: percent },
104
+ { key: "changePercent", header: "Regular %", align: "right", format: percent },
98
105
  { key: "marketValue", header: "Mkt Val", align: "right", format: wholeAmount, description: "In the portfolio's currency; negative for shorts." },
99
106
  { key: "unrealizedPnl", header: "P&L", align: "right", format: amount, description: "Unrealized, in the portfolio's currency." },
100
107
  { key: "weight", header: "Weight", align: "right", format: weight, description: "Percent of the total value, cash included; unpriced holdings are left out." },
@@ -147,7 +154,7 @@ const WATCHLIST_COLUMNS: HeadlessPaneColumn[] = [
147
154
  { key: "exchange", header: "Exchange" },
148
155
  { key: "price", header: "Last", align: "right" },
149
156
  { key: "priceCurrency", header: "Ccy" },
150
- { key: "changePercent", header: "Chg", align: "right", format: percent },
157
+ { key: "changePercent", header: "Regular %", align: "right", format: percent },
151
158
  ];
152
159
 
153
160
  /**
@@ -359,7 +366,8 @@ async function portfolioHoldings(
359
366
  // Last and Chg are the regular session; market value and P&L are at `valuationPrice`.
360
367
  price: finite(row.quotePrice),
361
368
  priceCurrency: row.quoteCurrency ?? null,
362
- changePercent: finite(headline?.changePercent),
369
+ ...regularChangeFields(quotes.get(ticker.metadata.ticker), headline?.changePercent),
370
+ extendedChangeBasis: extended ? "from-regular-close" : null,
363
371
  ...extendedQuoteFields(extended),
364
372
  marketValue,
365
373
  unrealizedPnl: finite(row.unrealizedPnl),
@@ -467,7 +475,7 @@ const PERIOD_COLUMNS: HeadlessPaneColumn[] = [
467
475
  { key: "shares", header: "Qty", align: "right", format: quantity },
468
476
  { key: "startPrice", header: "Start", align: "right", format: unitMoney("priceCurrency"), description: "The close before the window, in the quote's currency." },
469
477
  { key: "endPrice", header: "End", align: "right", format: unitMoney("priceCurrency"), description: "The last close in the window, in the quote's currency." },
470
- { key: "changePercent", header: "Chg", align: "right", format: percent },
478
+ { key: "changePercent", header: "Period %", align: "right", format: percent },
471
479
  { key: "pnl", header: "P&L", align: "right", format: amount, description: "The price move times the units held now, in the portfolio's currency at the end's rate." },
472
480
  { key: "contribution", header: "Contribution", align: "right", format: percent, description: "P&L over the book's value at the start, gross when it holds a short, in percent." },
473
481
  ];
@@ -584,7 +592,8 @@ async function watchlistHoldings(
584
592
  exchange: ticker.metadata.exchange || null,
585
593
  price: finite(headline?.price ?? quote?.price),
586
594
  priceCurrency: quote?.currency ?? null,
587
- changePercent: finite(headline ? headline.changePercent : quote?.changePercent),
595
+ ...regularChangeFields(quote, headline ? headline.changePercent : quote?.changePercent),
596
+ extendedChangeBasis: extended ? "from-regular-close" : null,
588
597
  ...extendedQuoteFields(extended),
589
598
  };
590
599
  });
@@ -14,7 +14,7 @@ const CACHES = [powerBoardCache, powerHistoryCache, powerDetailCache, powerPrice
14
14
  export const powerModule: PluginModule = {
15
15
  series: [...DAY_AHEAD_SERIES, ...CARBON_SERIES, ...GAS_STORAGE_SERIES],
16
16
  // POWER sets the symbol param, EPWR the prices tab.
17
- panes: [{ id: "power", name: "Power & Grid", icon: "P", get component(): typeof import("./pane").PowerPane { const { PowerPane } = require("./pane"); return PowerPane; }, defaultPosition: "right", defaultMode: "floating", identitySettings: ["tab", "symbol"],
17
+ panes: [{ id: "power", name: "Power & Grid", icon: "P", shareItem: { argument: true }, get component(): typeof import("./pane").PowerPane { const { PowerPane } = require("./pane"); return PowerPane; }, defaultPosition: "right", defaultMode: "floating", identitySettings: ["tab", "symbol"],
18
18
  defaultFloatingSize: { width: 132, height: 34 }, tableExport: true, headless: powerHeadless }],
19
19
  paneTemplates: [{ id: "power-pane", paneId: "power", label: "Power & Grid",
20
20
  description: "Pro: interconnection queues, historical MW and outcomes, datacenter loads, utility exposure and generation capacity, with primary evidence.",
@@ -6,7 +6,7 @@ import { ESTIMATOR_OPTIONS, WINDOW_OPTIONS } from "./settings";
6
6
  export const realizedVolModule: PluginModule = {
7
7
  panes: [{
8
8
  id: "realized-vol", name: "Realized Volatility", icon: "V", get component(): typeof import("./pane").RealizedVolPane { const { RealizedVolPane } = require("./pane"); return RealizedVolPane; },
9
- defaultPosition: "right", tickerFollower: true, defaultMode: "floating", defaultFloatingSize: { width: 112, height: 36 },
9
+ defaultPosition: "right", shareItem: { ticker: true }, tickerFollower: true, defaultMode: "floating", defaultFloatingSize: { width: 112, height: 36 },
10
10
  tableExport: true,
11
11
  quickSettings: [{ type: "toggle", key: "showIv", icon: "zap", label: "Current ATM IV" }],
12
12
  settings: { title: "Realized Volatility Settings", fields: [
@@ -22,8 +22,9 @@ export const paneSchemas = {
22
22
  settingKey: "extraColumns",
23
23
  placeholder: "fields",
24
24
  description: `Report columns to add, in order: ${EXTRA_COLUMN_IDS.join(", ")}. shortInterest is FINRA short interest as a percent of float at the latest settlement, `
25
- + "nextEarnings the next report date on the earnings calendar, target the mean analyst target and the analyst count, grossMargin and evEbitda the screener's stored figures. "
26
- + "Short interest, earnings dates, gross margin and EV/EBITDA cover US listings. CSV and JSON give each cell's source and as-of. The pane keeps its own columns",
25
+ + "nextEarnings the next report date on the earnings calendar, target the mean analyst target and the analyst count, grossMargin the trailing twelve months' gross margin, "
26
+ + "evEbitda the enterprise value over trailing operating income plus D&A, as GE's EV/EBITDA ends. "
27
+ + "Short interest and earnings dates cover US listings. CSV and JSON give each cell's source and as-of. The pane keeps its own columns",
27
28
  example: "--columns shortInterest,nextEarnings,target,grossMargin,evEbitda",
28
29
  normalize: normalizeExtraColumns,
29
30
  },
@@ -32,7 +33,7 @@ export const paneSchemas = {
32
33
  type: "string",
33
34
  settingKey: "capCurrency",
34
35
  placeholder: "ISO code",
35
- description: "Show every market cap in this currency, converted at the app's FX rates; the status line names each rate and its time",
36
+ description: "Show every market cap and analyst target in this currency, converted at the app's FX rates; the status line names each rate and its time",
36
37
  example: "--currency USD",
37
38
  normalize: normalizeCapCurrency,
38
39
  },
@@ -30,6 +30,8 @@ export interface EarningsEstimatesHeadlessDependencies {
30
30
  ): Promise<EarningsEstimateSources>;
31
31
  }
32
32
 
33
+ const ESTIMATE_COLUMNS = [...EARNINGS_ESTIMATE_COLUMNS, { key: "epsBasis", header: "EPS basis" }];
34
+
33
35
  const defaultDependencies: EarningsEstimatesHeadlessDependencies = {
34
36
  async loadSources(symbol, context) {
35
37
  const { actions, estimates, financials, currency, ...failures } = await loadEventSources(context.marketData, symbol);
@@ -63,7 +65,11 @@ function projectEarningsEstimatesHeadless(
63
65
  sources.financials,
64
66
  sources.currency,
65
67
  ).filter((row) => matchesKind(row, kind));
66
- const rows = matching.slice(0, limit).map((row) => ({ ...row }));
68
+ const rows = matching.slice(0, limit).map((row) => ({ ...row,
69
+ ...(row.status === "Q Est" || row.status === "FY Est" ? {
70
+ epsBasis: row.estimateInputs?.eps?.epsBasis === "gaap" ? "GAAP" : row.estimateInputs?.eps?.epsBasis === "adjusted" ? "adjusted" : "unknown",
71
+ } : {}),
72
+ }));
67
73
  const notice = eventSourceNotice({ variant: "earnings-estimates", symbol: args.symbols[0] ?? String(args.argument ?? ""),
68
74
  actions: sources.actions, estimates: sources.estimates,
69
75
  actionsError: sources.actions ? null : "Source unavailable", estimatesError: sources.estimates ? null : "Source unavailable",
@@ -73,7 +79,7 @@ function projectEarningsEstimatesHeadless(
73
79
  if (unmatchedReportedPeriods.length) errors.push(`No statement period identified for ${unmatchedReportedPeriods.length} reported earnings row(s); quarterly revenue is unavailable.`);
74
80
 
75
81
  return {
76
- columns: EARNINGS_ESTIMATE_COLUMNS,
82
+ columns: ESTIMATE_COLUMNS,
77
83
  rows,
78
84
  errors: errors.length ? errors : undefined,
79
85
  metadata: {
@@ -83,7 +89,7 @@ function projectEarningsEstimatesHeadless(
83
89
  returned: rows.length,
84
90
  truncated: rows.length < matching.length,
85
91
  coverageNote: notice?.text,
86
- epsBasis: `${EPS_BASIS_NOTE} The TTM row's EPS is the GAAP diluted trailing figure ticker shows as EPS (TTM): the last four filed quarters', or Gloom Cloud's TTM (named so) when they give none, or the four statement quarters' diluted EPS when neither is there; reported quarters of different bases are never summed, and the row adds an adjusted sum only when all four quarters are adjusted.`,
92
+ epsBasis: `Estimate basis is unknown unless the estimate source explicitly identifies GAAP or adjusted; never assume it matches a reported quarter. ${EPS_BASIS_NOTE} The TTM row's EPS is the GAAP diluted trailing figure ticker shows as EPS (TTM): the last four filed quarters', or Gloom Cloud's TTM (named so) when they give none, or the four statement quarters' diluted EPS when neither is there; reported quarters of different bases are never summed, and the row adds an adjusted sum only when all four quarters are adjusted.`,
87
93
  dateNote: "Fiscal period dates are not announcement dates. Revenue is attached only to an identified statement period.",
88
94
  unmatchedReportedPeriods,
89
95
  },
@@ -124,7 +130,7 @@ export function createEarningsEstimatesHeadless(
124
130
  maximum: 200,
125
131
  },
126
132
  ],
127
- columns: EARNINGS_ESTIMATE_COLUMNS,
133
+ columns: ESTIMATE_COLUMNS,
128
134
  describe: (args) => `Earnings Estimates | ${String(args.argument)}`,
129
135
  async load(args, context) {
130
136
  return projectEarningsEstimatesHeadless(
@@ -52,6 +52,7 @@ export const researchModule: PluginModule = {
52
52
  icon: "A",
53
53
  get component(): typeof import("./analyst-pane").AnalystResearchView { const { AnalystResearchView } = require("./analyst-pane"); return AnalystResearchView; },
54
54
  defaultPosition: "right",
55
+ shareItem: { ticker: true },
55
56
  tickerFollower: true,
56
57
  instruments: ["equity"],
57
58
  defaultMode: "floating",
@@ -67,6 +68,7 @@ export const researchModule: PluginModule = {
67
68
  icon: "D",
68
69
  get component(): typeof import("./equity-diagnostic-pane").EquityDiagnosticView { const { EquityDiagnosticView } = require("./equity-diagnostic-pane"); return EquityDiagnosticView; },
69
70
  defaultPosition: "right",
71
+ shareItem: { ticker: true },
70
72
  tickerFollower: true,
71
73
  instruments: ["equity"],
72
74
  defaultMode: "floating",
@@ -78,6 +80,7 @@ export const researchModule: PluginModule = {
78
80
  icon: "E",
79
81
  component: CorporateActionsView,
80
82
  defaultPosition: "right",
83
+ shareItem: { ticker: true },
81
84
  tickerFollower: true,
82
85
  defaultMode: "floating",
83
86
  defaultFloatingSize: { width: 104, height: 24 },
@@ -102,6 +105,7 @@ export const researchModule: PluginModule = {
102
105
  icon: "E",
103
106
  component: EarningsEstimatesPane,
104
107
  defaultPosition: "right",
108
+ shareItem: { ticker: true },
105
109
  tickerFollower: true,
106
110
  instruments: ["equity"],
107
111
  defaultMode: "floating",