@gloom-sh/terminal 0.20.20 → 0.20.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -1
- package/src/api-client/data.ts +1 -1
- package/src/api-client/equity-screener.ts +17 -0
- package/src/api-client/futures-curve.ts +5 -0
- package/src/api-client/market-discovery.ts +8 -0
- package/src/api-client/members.ts +2 -0
- package/src/api-client/paths.ts +3 -0
- package/src/api-client/perps.ts +20 -0
- package/src/api-client/request.ts +53 -7
- package/src/api-client/types/filings-and-calls.ts +2 -0
- package/src/app/pane-runtime/plugin-bindings.ts +6 -4
- package/src/app/pro-welcome/model.ts +15 -11
- package/src/app/pro-welcome/row.tsx +3 -3
- package/src/app/pro-welcome/use-pro-welcome.ts +2 -2
- package/src/app/runtime/startup.ts +3 -2
- package/src/app.tsx +3 -2
- package/src/capabilities/asset-data-inputs.ts +5 -0
- package/src/capabilities/factories.ts +8 -3
- package/src/capabilities/registry.ts +1 -0
- package/src/capabilities/types.ts +1 -0
- package/src/cli/commands/market.ts +68 -35
- package/src/cli/commands/options-chain.ts +2 -2
- package/src/cli/commands/overview.ts +10 -9
- package/src/cli/commands/ticker.ts +19 -4
- package/src/cli/desktop-pane-shot.ts +11 -3
- package/src/cli/export-source.ts +35 -2
- package/src/cli/glossary.ts +3 -2
- package/src/cli/helpers.ts +2 -1
- package/src/cli/history-demergers.ts +41 -10
- package/src/cli/history-rows.ts +3 -1
- package/src/cli/known-gaps.ts +21 -7
- package/src/cli/listing-arg.ts +22 -11
- package/src/cli/pane-functions/capabilities.ts +4 -9
- package/src/cli/pane-functions/catalog-snapshot.json +29 -29
- package/src/cli/pane-functions/catalog.ts +1 -18
- package/src/cli/pane-functions/data.ts +8 -4
- package/src/cli/pane-functions/financial-ratio-shot.ts +20 -5
- package/src/cli/pane-functions/freshness.ts +57 -12
- package/src/cli/pane-functions/function-help.ts +2 -2
- package/src/cli/pane-functions/headless.ts +6 -0
- package/src/cli/pane-functions/index.ts +11 -4
- package/src/cli/pane-functions/market-session.ts +25 -0
- package/src/cli/pane-functions/report-notices.ts +10 -0
- package/src/cli/pane-functions/resolver.ts +75 -3
- package/src/cli/pane-functions/screenshot-bridge.ts +1 -0
- package/src/cli/pane-functions/screenshot-data-evidence.ts +1 -0
- package/src/cli/pane-functions/screenshot-payload.ts +38 -5
- package/src/cli/pane-functions/screenshot-render.ts +20 -7
- package/src/cli/perpetual-contract.ts +14 -1
- package/src/cli/report-tables.ts +11 -2
- package/src/cli/result.ts +6 -1
- package/src/components/chart-table/layout.ts +8 -4
- package/src/components/command-bar/list/model.ts +2 -0
- package/src/components/command-bar/pane-templates/items.ts +5 -25
- package/src/components/command-bar/panel/index.tsx +7 -4
- package/src/components/command-bar/routes/root/provider-search.ts +4 -4
- package/src/components/command-bar/routes/root/results.ts +6 -2
- package/src/components/command-bar/routes/ticker-search/results.ts +19 -0
- package/src/components/command-bar/routes/ticker-search/route.ts +3 -3
- package/src/components/command-bar/routes/ticker-search/title.ts +23 -0
- package/src/components/command-bar/routing/list-state.ts +17 -5
- package/src/components/command-bar/selection-runtime.ts +3 -2
- package/src/components/command-bar/surface/index.tsx +2 -0
- package/src/components/command-bar/workflow/alert.ts +6 -4
- package/src/components/command-bar/workflow/collection-actions.ts +2 -1
- package/src/components/layout/pane/footer/index.tsx +1 -0
- package/src/components/layout/pane/footer/model.ts +20 -7
- package/src/components/layout/pane/title.ts +11 -2
- package/src/components/price-selector-dialog.tsx +8 -4
- package/src/components/ticker/badge/list.tsx +4 -3
- package/src/components/ticker/list-table-view.tsx +12 -1
- package/src/components/ui/query-bar.tsx +20 -14
- package/src/data/cached-query.ts +20 -4
- package/src/data/news-pane-snapshots.ts +2 -1
- package/src/data/plugin-cache.ts +5 -1
- package/src/data/saved-copies.ts +68 -2
- package/src/docs/snapshot.json +65 -14
- package/src/docs/topics.ts +11 -9
- package/src/i18n/es.ts +1 -0
- package/src/i18n/ja.ts +1 -0
- package/src/i18n/ko.ts +1 -0
- package/src/i18n/zh-cn.ts +1 -0
- package/src/i18n/zh-tw.ts +1 -0
- package/src/market-data/coordinator/index.ts +25 -5
- package/src/market-data/depositary-pair.ts +27 -10
- package/src/market-data/futures-roll-returns.ts +54 -7
- package/src/market-data/fx-closes.ts +14 -0
- package/src/market-data/market/futures-product-hours.ts +113 -0
- package/src/market-data/market/futures-week.ts +2 -0
- package/src/market-data/market/globex-day.ts +9 -2
- package/src/market-data/market/status.ts +32 -25
- package/src/market-data/market/venue-session.ts +18 -0
- package/src/market-data/options-alternatives.ts +49 -7
- package/src/market-data/perpetual-open-interest.ts +41 -0
- package/src/market-data/quotes/contributions.ts +4 -2
- package/src/market-data/quotes/export-identity.ts +11 -3
- package/src/market-data/quotes/freshness.ts +3 -2
- package/src/market-data/quotes/resolution.ts +9 -2
- package/src/market-data/quotes/tick-range.ts +22 -1
- package/src/market-data/quotes/time.ts +34 -4
- package/src/market-data/split-terms.ts +3 -2
- package/src/news/aggregator.ts +1 -0
- package/src/news/news-model.ts +12 -2
- package/src/news/types.ts +15 -0
- package/src/plugins/builtin/alerts/alert-engine.ts +2 -0
- package/src/plugins/builtin/alerts/cli-forms.ts +3 -2
- package/src/plugins/builtin/alerts/cli-move.ts +5 -2
- package/src/plugins/builtin/alerts/cli.ts +50 -25
- package/src/plugins/builtin/alerts/command.ts +51 -3
- package/src/plugins/builtin/alerts/event-rows.ts +1 -1
- package/src/plugins/builtin/alerts/events-pane.tsx +1 -1
- package/src/plugins/builtin/alerts/format.ts +67 -8
- package/src/plugins/builtin/alerts/headless.ts +22 -6
- package/src/plugins/builtin/alerts/index.tsx +26 -25
- package/src/plugins/builtin/alerts/move-checks.ts +1 -0
- package/src/plugins/builtin/alerts/pane.tsx +15 -6
- package/src/plugins/builtin/alerts/pro-rules.ts +9 -4
- package/src/plugins/builtin/alerts/quotes.ts +10 -5
- package/src/plugins/builtin/alerts/session.ts +28 -0
- package/src/plugins/builtin/alerts/types.ts +1 -0
- package/src/plugins/builtin/analytics/pane-model.ts +2 -1
- package/src/plugins/builtin/analytics/risk-model.ts +2 -2
- package/src/plugins/builtin/attention/headless.ts +2 -2
- package/src/plugins/builtin/attention/model.ts +7 -2
- package/src/plugins/builtin/attention/pane.tsx +2 -1
- package/src/plugins/builtin/awards/headless.ts +1 -1
- package/src/plugins/builtin/broker-trading/ticket.tsx +13 -5
- package/src/plugins/builtin/buildout/detail/company.tsx +0 -1
- package/src/plugins/builtin/buildout/detail/ui.tsx +7 -5
- package/src/plugins/builtin/buildout/model/normalizers.ts +0 -1
- package/src/plugins/builtin/buildout/model/types.ts +0 -1
- package/src/plugins/builtin/buildout/pane/index.tsx +9 -0
- package/src/plugins/builtin/buildout/pane/status.tsx +11 -0
- package/src/plugins/builtin/catalysts/headless.ts +1 -1
- package/src/plugins/builtin/chart-composer/headless.ts +14 -6
- package/src/plugins/builtin/chart-composer/pane.tsx +2 -1
- package/src/plugins/builtin/chart-composer/session-history.ts +14 -2
- package/src/plugins/builtin/chat/controller/index.ts +5 -3
- package/src/plugins/builtin/chat/controller/session-runtime.ts +18 -8
- package/src/plugins/builtin/chat/index.tsx +1 -1
- package/src/plugins/builtin/cloud/auth-actions.tsx +4 -2
- package/src/plugins/builtin/cloud/mcp-connect/dialog.tsx +4 -1
- package/src/plugins/builtin/cloud/thesis/ticker-tab.tsx +2 -1
- package/src/plugins/builtin/company-attention/headless.ts +2 -1
- package/src/plugins/builtin/company-kpis/headless.ts +1 -1
- package/src/plugins/builtin/correlation/headless.ts +3 -3
- package/src/plugins/builtin/correlation/history.ts +1 -0
- package/src/plugins/builtin/correlation/index.tsx +7 -5
- package/src/plugins/builtin/correlation/matrix/selection.ts +21 -3
- package/src/plugins/builtin/correlation/relationship/model.ts +5 -0
- package/src/plugins/builtin/correlation/relationship/pane.tsx +3 -2
- package/src/plugins/builtin/correlation/relationship/view-model.ts +3 -2
- package/src/plugins/builtin/credit-documents/headless.ts +1 -1
- package/src/plugins/builtin/dividend-yield/client.ts +81 -10
- package/src/plugins/builtin/dividend-yield/headless.ts +21 -10
- package/src/plugins/builtin/dividend-yield/model.ts +1 -1
- package/src/plugins/builtin/dividend-yield/pane.tsx +9 -5
- package/src/plugins/builtin/dividend-yield/ranking.ts +15 -5
- package/src/plugins/builtin/dividend-yield/reference-price.ts +3 -0
- package/src/plugins/builtin/dividend-yield/types.ts +12 -0
- package/src/plugins/builtin/dividend-yield/view.ts +30 -7
- package/src/plugins/builtin/doe/headless.ts +1 -1
- package/src/plugins/builtin/doe/pane.tsx +16 -7
- package/src/plugins/builtin/earnings-calls/data.ts +8 -5
- package/src/plugins/builtin/earnings-ripple/headless.ts +1 -1
- package/src/plugins/builtin/econ/calendar-model.ts +1 -1
- package/src/plugins/builtin/econ/index.tsx +26 -18
- package/src/plugins/builtin/equity-screener/client.ts +1 -1
- package/src/plugins/builtin/equity-screener/headless.ts +149 -31
- package/src/plugins/builtin/equity-screener/live.ts +23 -5
- package/src/plugins/builtin/equity-screener/model.ts +27 -12
- package/src/plugins/builtin/equity-screener/pane.tsx +5 -5
- package/src/plugins/builtin/exposure/headless.ts +1 -1
- package/src/plugins/builtin/exposure/holdings.ts +2 -2
- package/src/plugins/builtin/futures/index.tsx +29 -1
- package/src/plugins/builtin/futures/model.ts +93 -10
- package/src/plugins/builtin/futures/returns.ts +54 -1
- package/src/plugins/builtin/futures/table.tsx +14 -2
- package/src/plugins/builtin/futures/use-front-returns.ts +20 -3
- package/src/plugins/builtin/futures-curve/client.ts +1 -1
- package/src/plugins/builtin/futures-curve/headless.ts +9 -3
- package/src/plugins/builtin/futures-curve/model.ts +19 -5
- package/src/plugins/builtin/futures-curve/pane.tsx +12 -6
- package/src/plugins/builtin/gpu/headless.ts +1 -1
- package/src/plugins/builtin/gpu/model.ts +1 -1
- package/src/plugins/builtin/help/function-index.ts +16 -8
- package/src/plugins/builtin/help/functions-table.tsx +6 -4
- package/src/plugins/builtin/help/shortcut-model.ts +7 -2
- package/src/plugins/builtin/holders/headless.ts +16 -5
- package/src/plugins/builtin/holders/pane.tsx +43 -5
- package/src/plugins/builtin/insider/client.ts +118 -11
- package/src/plugins/builtin/insider/filing-stories.ts +36 -20
- package/src/plugins/builtin/insider/issuer.ts +5 -2
- package/src/plugins/builtin/iv-history/headless.ts +2 -0
- package/src/plugins/builtin/macro-day/client.ts +2 -3
- package/src/plugins/builtin/macro-day/comparison.ts +58 -0
- package/src/plugins/builtin/macro-day/headless.ts +47 -3
- package/src/plugins/builtin/macro-day/index.tsx +32 -9
- package/src/plugins/builtin/macro-day/model.ts +1 -1
- package/src/plugins/builtin/macro-day/pane.tsx +99 -12
- package/src/plugins/builtin/market-heatmap/index.tsx +2 -2
- package/src/plugins/builtin/market-movers/footer.ts +29 -3
- package/src/plugins/builtin/market-movers/headless.ts +12 -5
- package/src/plugins/builtin/market-movers/index.tsx +3 -3
- package/src/plugins/builtin/market-movers/session-body.tsx +6 -3
- package/src/plugins/builtin/market-valuation/detail.tsx +3 -3
- package/src/plugins/builtin/market-valuation/headless.ts +6 -6
- package/src/plugins/builtin/market-valuation/pane.tsx +2 -3
- package/src/plugins/builtin/market-valuation/view.ts +6 -8
- package/src/plugins/builtin/members/client.ts +9 -2
- package/src/plugins/builtin/members/headless.ts +8 -10
- package/src/plugins/builtin/members/model.ts +29 -17
- package/src/plugins/builtin/members/pane.tsx +10 -12
- package/src/plugins/builtin/money-markets/headless.ts +1 -1
- package/src/plugins/builtin/news/headless.ts +4 -0
- package/src/plugins/builtin/news/index.tsx +3 -1
- package/src/plugins/builtin/news/wire/industry-pane.tsx +2 -1
- package/src/plugins/builtin/news/wire/news/preset-pane.tsx +1 -1
- package/src/plugins/builtin/news/wire/persisted-articles.ts +8 -4
- package/src/plugins/builtin/notes/headless.ts +7 -0
- package/src/plugins/builtin/notes/index.tsx +1 -1
- package/src/plugins/builtin/notes/quick-notes-pane.tsx +18 -2
- package/src/plugins/builtin/options/view.tsx +7 -6
- package/src/plugins/builtin/options-positioning/headless.ts +4 -4
- package/src/plugins/builtin/options-positioning/pane.tsx +7 -3
- package/src/plugins/builtin/options-scenario/client.ts +20 -4
- package/src/plugins/builtin/options-scenario/headless.ts +1 -1
- package/src/plugins/builtin/pe-band/client.ts +5 -9
- package/src/plugins/builtin/pe-band/headless.ts +11 -13
- package/src/plugins/builtin/pe-band/model.ts +39 -60
- package/src/plugins/builtin/pe-band/pane.tsx +14 -15
- package/src/plugins/builtin/perps/equity-row.tsx +3 -1
- package/src/plugins/builtin/perps/freshness.ts +16 -9
- package/src/plugins/builtin/perps/headless.ts +4 -1
- package/src/plugins/builtin/perps/markets-section.tsx +16 -10
- package/src/plugins/builtin/perps/model.ts +33 -2
- package/src/plugins/builtin/perps/pane.tsx +3 -2
- package/src/plugins/builtin/perps/status-line.ts +12 -3
- package/src/plugins/builtin/perps/venue-markets.ts +38 -0
- package/src/plugins/builtin/plugin-marketplace/pane.tsx +4 -3
- package/src/plugins/builtin/portfolio-list/cell-version.ts +1 -1
- package/src/plugins/builtin/portfolio-list/cli/render.ts +46 -7
- package/src/plugins/builtin/portfolio-list/headless.ts +31 -8
- package/src/plugins/builtin/portfolio-list/settings.ts +3 -0
- package/src/plugins/builtin/portfolio-list/table.tsx +7 -1
- package/src/plugins/builtin/power/headless.ts +1 -1
- package/src/plugins/builtin/realized-vol/headless.ts +1 -1
- package/src/plugins/builtin/research/corporate-actions-pane.tsx +27 -13
- package/src/plugins/builtin/scanner/feed.ts +7 -4
- package/src/plugins/builtin/scanner/flow-pane.tsx +8 -4
- package/src/plugins/builtin/scanner/headless.ts +57 -26
- package/src/plugins/builtin/scanner/hilo-pane.tsx +6 -3
- package/src/plugins/builtin/scanner/lock-note.ts +3 -2
- package/src/plugins/builtin/scanner/us-session.ts +9 -0
- package/src/plugins/builtin/seasonality/client.ts +46 -10
- package/src/plugins/builtin/seasonality/headless.ts +29 -11
- package/src/plugins/builtin/seasonality/model.ts +101 -24
- package/src/plugins/builtin/seasonality/pane.tsx +10 -6
- package/src/plugins/builtin/sec/filing-content.ts +13 -0
- package/src/plugins/builtin/sec/index.tsx +16 -11
- package/src/plugins/builtin/sectors/client.ts +27 -5
- package/src/plugins/builtin/sectors/headless.ts +2 -1
- package/src/plugins/builtin/sectors/index.tsx +22 -10
- package/src/plugins/builtin/shared/cloud-resource.ts +3 -3
- package/src/plugins/builtin/shared/extended-print.ts +38 -0
- package/src/plugins/builtin/shared/pro-feature-wall.tsx +1 -1
- package/src/plugins/builtin/shared/report-freshness.ts +7 -3
- package/src/plugins/builtin/shared/scanner-capture.ts +16 -3
- package/src/plugins/builtin/shared/ticker-company.ts +17 -8
- package/src/plugins/builtin/shared/use-quote-board.ts +11 -4
- package/src/plugins/builtin/social-mentions/client.ts +7 -3
- package/src/plugins/builtin/social-mentions/outliers.tsx +9 -2
- package/src/plugins/builtin/thirteenf/api.ts +24 -3
- package/src/plugins/builtin/thirteenf/data.ts +21 -8
- package/src/plugins/builtin/thirteenf/headless.ts +7 -3
- package/src/plugins/builtin/thirteenf/signals-pane.tsx +10 -3
- package/src/plugins/builtin/thirteenf/signals.ts +22 -1
- package/src/plugins/builtin/ticker-detail/adr-pair/model.ts +4 -2
- package/src/plugins/builtin/ticker-detail/financials/model.ts +7 -0
- package/src/plugins/builtin/ticker-detail/financials/ratio-table.tsx +15 -6
- package/src/plugins/builtin/ticker-detail/financials/ratios.ts +5 -4
- package/src/plugins/builtin/ticker-detail/financials/tab.tsx +14 -5
- package/src/plugins/builtin/ticker-detail/headless.ts +32 -26
- package/src/plugins/builtin/ticker-detail/index.tsx +1 -1
- package/src/plugins/builtin/ticker-detail/overview/components.tsx +8 -3
- package/src/plugins/builtin/ticker-detail/overview/model.ts +28 -5
- package/src/plugins/builtin/ticker-detail/overview/pane.tsx +14 -1
- package/src/plugins/builtin/ticker-detail/overview-tab.tsx +9 -8
- package/src/plugins/builtin/ticker-detail/pane.tsx +16 -9
- package/src/plugins/builtin/ticker-detail/quote-monitor/card.tsx +41 -23
- package/src/plugins/builtin/ticker-detail/quote-monitor/rows.ts +30 -13
- package/src/plugins/builtin/ticker-detail/settings.ts +9 -2
- package/src/plugins/builtin/time-sales/headless.ts +49 -13
- package/src/plugins/builtin/time-sales/model.ts +2 -2
- package/src/plugins/builtin/time-sales/window.ts +84 -10
- package/src/plugins/builtin/vol-surface/charts.tsx +4 -2
- package/src/plugins/builtin/vol-surface/events.ts +12 -5
- package/src/plugins/builtin/vol-surface/headless.ts +1 -1
- package/src/plugins/builtin/vol-surface/pane.tsx +15 -7
- package/src/plugins/builtin/world-indices/footer.ts +1 -1
- package/src/plugins/builtin/world-venue-map/chokepoint-report.ts +3 -1
- package/src/plugins/builtin/world-venue-map/headless.ts +27 -13
- package/src/plugins/builtin/yield-curve/client.ts +3 -1
- package/src/plugins/duplicates.ts +60 -0
- package/src/plugins/loader.ts +12 -3
- package/src/plugins/marketplace/model.ts +10 -1
- package/src/portfolio/column-values.ts +52 -5
- package/src/react/async-resource.ts +8 -7
- package/src/renderers/browser/bundled-plugins.ts +2 -1
- package/src/renderers/dom/build-assets.ts +20 -0
- package/src/renderers/dom/data-table/index.tsx +36 -2
- package/src/renderers/dom/es2023-array-methods.ts +57 -0
- package/src/renderers/dom/host/surface-fit.ts +64 -13
- package/src/renderers/dom/styles.css +6 -1
- package/src/renderers/electrobun/bun/external-plugins.ts +16 -6
- package/src/renderers/electrobun/shared/protocol.ts +2 -0
- package/src/renderers/electrobun/view/cli-pane-shot-entry.tsx +31 -7
- package/src/renderers/electrobun/view/cli-pane-shot-frame.tsx +15 -8
- package/src/renderers/electrobun/view/external-plugins.ts +1 -0
- package/src/renderers/electrobun/view/remote/asset-data-client.ts +1 -0
- package/src/series/types.ts +1 -0
- package/src/sources/gloomberb-cloud/fred-attribution.ts +6 -5
- package/src/sources/gloomberb-cloud/index.ts +42 -5
- package/src/sources/gloomberb-cloud/news.ts +15 -2
- package/src/sources/gloomberb-cloud/normalizers.ts +9 -0
- package/src/sources/history-result.ts +2 -1
- package/src/sources/history-retention.ts +14 -2
- package/src/sources/listing-symbols.ts +1 -1
- package/src/sources/provider-router/cache.ts +32 -3
- package/src/sources/provider-router/cached-routes.ts +25 -0
- package/src/sources/provider-router/connection-health.ts +1 -0
- package/src/sources/provider-router/history.ts +2 -2
- package/src/sources/provider-router/index.ts +14 -0
- package/src/sources/provider-router/sec-filings-page.ts +25 -0
- package/src/sources/sec-edgar/content.ts +67 -36
- package/src/tickers/listing-fate.ts +28 -0
- package/src/tickers/search/home-listing.ts +3 -0
- package/src/tickers/search/index-root-lead.ts +40 -0
- package/src/tickers/terminal-codes.ts +7 -4
- package/src/time-series/base-series.ts +17 -8
- package/src/time-series/fundamentals/historical-valuation.ts +2 -2
- package/src/time-series/fundamentals/series.ts +15 -12
- package/src/time-series/history-acquisition.ts +2 -0
- package/src/time-series/market.ts +3 -1
- package/src/time-series/price-comparison.ts +3 -1
- package/src/time-series/resolve-context.ts +8 -0
- package/src/time-series/resolve.ts +50 -10
- package/src/time-series/types.ts +1 -0
- package/src/time-series/use-chart-resolution.ts +2 -2
- package/src/time-series/valuation-currency.ts +40 -12
- package/src/types/data-provider.ts +30 -1
- package/src/types/financials.ts +23 -0
- package/src/types/headless.ts +23 -0
- package/src/types/instrument.ts +1 -0
- package/src/utils/crypto-pair.ts +16 -0
- package/src/utils/exchange-announcements.ts +2 -1
- package/src/utils/exchange-notation.generated.ts +58 -1
- package/src/utils/exchanges.ts +43 -1
- package/src/utils/format.ts +37 -2
- package/src/utils/function-search.ts +38 -0
- package/src/utils/fuzzy-search.ts +10 -6
- package/src/utils/option-choice.ts +15 -0
- package/src/utils/price-history.ts +15 -1
- package/src/utils/reason-codes.ts +6 -3
- package/src/utils/trailing-dividend.ts +241 -28
|
@@ -17,7 +17,7 @@ import { useSearchFocusUp } from "../../../components/input-search-bar";
|
|
|
17
17
|
import { useMembersMenu, type MemberList } from "../shared/members-menu";
|
|
18
18
|
import { cachedChanges, cachedFunds, cachedMembers, cachedStockFunds, loadChanges, loadFunds, loadMembers, loadStockFunds } from "./client";
|
|
19
19
|
import { canonicalFund, changeColumns, changeLabel, changeReason, coverageText, coveredFund, decimal, DEFAULT_SORT, holdingsBasisText, holdingsCaveats, isTab, memberColumns, memberRows,
|
|
20
|
-
membersFeed, membersTitle, noStockFundsMessage, percent, stockFundAsOf, stockFundAsOfFits, stockFundColumns, stockFundRows,
|
|
20
|
+
membersFeed, membersTitle, noStockFundsMessage, percent, stockFundAsOf, stockFundAsOfFits, stockFundColumns, stockFundRows, stockListingInput, TABS,
|
|
21
21
|
type MembersTab } from "./model";
|
|
22
22
|
|
|
23
23
|
type ViewProps = Pick<PaneProps, "width" | "height" | "focused"> & { fund: string; active: boolean };
|
|
@@ -222,7 +222,7 @@ function StockFunds({ symbol, width, height, focused }: ListProps & { symbol: st
|
|
|
222
222
|
if (column.id === "weight") return { text: row.weight == null ? MISSING_VALUE : decimal(row.weight * 100), value: row.weight == null ? null : row.weight * 100 };
|
|
223
223
|
return { text: stockFundAsOf(row, !stockFundAsOfFits(width)), color: colors.textMuted };
|
|
224
224
|
}, [colors, width]);
|
|
225
|
-
const none = noStockFundsMessage(symbol, "pane");
|
|
225
|
+
const none = noStockFundsMessage(data?.symbol ?? symbol, "pane");
|
|
226
226
|
return <PaneStatusBody subject="funds holding the stock" loading={!data && resource.loading} error={!data ? resource.error : null}
|
|
227
227
|
empty={!!data && !data.funds.length} emptyTitle={none.title} emptyMessage={none.message}>
|
|
228
228
|
{data && !!data.funds.length && <DataTableView<SectionedRow<StockFund>> items={rows} columns={stockFundColumns(width)} rootWidth={width} rootHeight={height} focused={focused}
|
|
@@ -232,29 +232,27 @@ function StockFunds({ symbol, width, height, focused }: ListProps & { symbol: st
|
|
|
232
232
|
renderCell={renderCell} selectedTextOverridesCellColor emptyStateTitle={none.title} />}
|
|
233
233
|
</PaneStatusBody>;
|
|
234
234
|
}
|
|
235
|
-
type FundPaneProps = ListProps & { fund: string;
|
|
235
|
+
type FundPaneProps = ListProps & { fund: string; listing: string; funds: MemberFundsPayload["funds"] | undefined };
|
|
236
236
|
/**
|
|
237
237
|
* The covered list is the server's, so a fund it adds opens without an app update. A symbol it does not hold is a
|
|
238
238
|
* stock, and the pane lists the covered funds holding it. A list that cannot be read leaves the fund's own load to
|
|
239
239
|
* report the failure.
|
|
240
240
|
*/
|
|
241
|
-
function CoveredFund({ fund,
|
|
242
|
-
if (funds?.length && !coveredFund(funds, fund)) {
|
|
243
|
-
|
|
244
|
-
if (!symbol) return <PaneStatusBody empty emptyTitle={`${requested.toUpperCase()} is not a US listing.`}
|
|
245
|
-
emptyMessage="Funds are looked through by US ticker: name the US listing, such as an ADR (INFY, TSM)." />;
|
|
246
|
-
return <StockFunds key={symbol} symbol={symbol} {...props} />;
|
|
241
|
+
function CoveredFund({ fund, listing, funds, ...props }: FundPaneProps) {
|
|
242
|
+
if (listing.includes(":") || funds?.length && !coveredFund(funds, fund)) {
|
|
243
|
+
return <StockFunds key={listing} symbol={listing} {...props} />;
|
|
247
244
|
}
|
|
248
245
|
return <FundView key={fund} fund={fund} {...props} />;
|
|
249
246
|
}
|
|
250
247
|
export function MembersPane(props: PaneProps) {
|
|
251
|
-
const { symbol } = usePaneTickerIdentity();
|
|
248
|
+
const { symbol, ticker } = usePaneTickerIdentity();
|
|
252
249
|
const [chosen, choose] = usePluginPaneState("fund", "");
|
|
253
250
|
const requested = symbol ?? chosen;
|
|
251
|
+
const listing = stockListingInput(requested, ticker?.metadata.exchange);
|
|
254
252
|
const fund = canonicalFund(requested);
|
|
255
253
|
const resource = useAsyncResource(loadFunds, { initialData: cachedFunds });
|
|
256
254
|
const funds = resource.data?.payload.funds;
|
|
257
|
-
usePaneTitle(membersTitle(requested, !!fund && !!funds?.length && !coveredFund(funds, fund)));
|
|
255
|
+
usePaneTitle(listing.includes(":") ? membersTitle(listing, true) : membersTitle(requested, !!fund && !!funds?.length && !coveredFund(funds, fund)));
|
|
258
256
|
if (!fund) return <FundPicker {...props} choose={choose} />;
|
|
259
|
-
return <CoveredFund fund={fund}
|
|
257
|
+
return <CoveredFund fund={fund} listing={listing} funds={funds} {...props} />;
|
|
260
258
|
}
|
|
@@ -32,7 +32,7 @@ export const moneyMarketsHeadless: HeadlessPaneDefinition<"bundle"> = {
|
|
|
32
32
|
shape: "bundle", argument: { kind: "none" },
|
|
33
33
|
freshness: FRED_FRESHNESS,
|
|
34
34
|
options: [{ key: "tab", type: "enum", description: "Money-market view: US rates, bills or liquidity, or Hong Kong's Exchange Fund Bill yields.",
|
|
35
|
-
values: MONEY_MARKET_TABS.map(({ value }) => ({ value })), defaultValue: "rates" }],
|
|
35
|
+
values: MONEY_MARKET_TABS.map(({ value, label }) => ({ value, label })), defaultValue: "rates" }],
|
|
36
36
|
describe: (args) => isHongKongTab(args.options.tab) ? "Hong Kong money markets" : "US money markets",
|
|
37
37
|
async load(args, ctx) {
|
|
38
38
|
const hongKong = isHongKongTab(args.options.tab);
|
|
@@ -55,7 +55,11 @@ const defaultDependencies: NewsHeadlessDependencies = {
|
|
|
55
55
|
function newsRow(article: NewsArticle) {
|
|
56
56
|
return {
|
|
57
57
|
id: article.id,
|
|
58
|
+
// Its first publication; the service's other times for it kept beside it, as sent.
|
|
58
59
|
publishedAt: article.publishedAt.toISOString(),
|
|
60
|
+
lastPublishedAt: article.times?.lastPublishedAt ?? null,
|
|
61
|
+
firstSeenAt: article.times?.firstSeenAt ?? null,
|
|
62
|
+
lastSeenAt: article.times?.lastSeenAt ?? null,
|
|
59
63
|
source: article.source,
|
|
60
64
|
headline: article.title,
|
|
61
65
|
summary: article.summary ?? null,
|
|
@@ -26,6 +26,7 @@ import { createTickerSurfacePaneTemplate } from "../shared/ticker-surface";
|
|
|
26
26
|
import { tickerNewsHeadless } from "./headless";
|
|
27
27
|
import { usePaneTickerIdentity } from "../../../state/hooks/pane-ticker";
|
|
28
28
|
import { TICKER_NEWS_TAB_ID, TICKER_NEWS_TEMPLATE_ID, tickerNewsQuery, tickerNewsStateKeys } from "./ticker-news";
|
|
29
|
+
import { displayTickerKey } from "../../../utils/exchanges";
|
|
29
30
|
|
|
30
31
|
const DEFAULT_SORT: NewsSortPreference = { columnId: "time", direction: "desc" };
|
|
31
32
|
|
|
@@ -47,6 +48,7 @@ function TickerNewsView({ width, height, focused }: { width: number; height: num
|
|
|
47
48
|
const loaded = usePersistedNewsArticles(
|
|
48
49
|
`articles:${instrument?.symbol ?? "none"}:${instrument?.exchange ?? ""}`,
|
|
49
50
|
newsState.articles,
|
|
51
|
+
newsState.phase === "error",
|
|
50
52
|
);
|
|
51
53
|
const news = useNewsMuteFilter(loaded, newsMutesApplyToFeed(newsQuery?.feed));
|
|
52
54
|
const search = useNewsListSearch(news, "ticker-news", symbol);
|
|
@@ -124,7 +126,7 @@ function TickerNewsView({ width, height, focused }: { width: number; height: num
|
|
|
124
126
|
loadedCount: loaded.length,
|
|
125
127
|
unmutedCount: news.length,
|
|
126
128
|
fallback: {
|
|
127
|
-
title: `No news for ${ticker.metadata.ticker}`,
|
|
129
|
+
title: `No news for ${displayTickerKey(ticker.metadata.ticker)}`,
|
|
128
130
|
hint: "Stories appear as sources publish them.",
|
|
129
131
|
},
|
|
130
132
|
});
|
|
@@ -57,8 +57,9 @@ function useIndustryArticles(entry: NewsIndustryCode | null): IndustryArticles {
|
|
|
57
57
|
const topicArticles = usePersistedNewsArticles(
|
|
58
58
|
`industry:topic:${entry?.topic ?? "none"}:articles`,
|
|
59
59
|
topicState.articles,
|
|
60
|
+
topicState.phase === "error",
|
|
60
61
|
);
|
|
61
|
-
const allArticles = usePersistedNewsArticles("industry:sector:all:articles", sectorState.articles);
|
|
62
|
+
const allArticles = usePersistedNewsArticles("industry:sector:all:articles", sectorState.articles, sectorState.phase === "error");
|
|
62
63
|
const sector = entry?.sector;
|
|
63
64
|
const sectorArticles = useMemo(() => (
|
|
64
65
|
sector
|
|
@@ -164,7 +164,7 @@ export function NewsPresetPane({
|
|
|
164
164
|
? parseNewsFeedSettings(storedFeeds, storedDisabledIds).error
|
|
165
165
|
: undefined, [query.feed, storedFeeds, storedDisabledIds]);
|
|
166
166
|
const newsState = useNewsArticles(query);
|
|
167
|
-
const persisted = usePersistedNewsArticles(`${paneKey}:articles`, newsState.articles);
|
|
167
|
+
const persisted = usePersistedNewsArticles(`${paneKey}:articles`, newsState.articles, newsState.phase === "error");
|
|
168
168
|
const articles = useNewsMuteFilter(persisted, newsMutesApplyToFeed(query.feed));
|
|
169
169
|
const { scrollRef, onBodyScrollActivity } = useNewsTableLoadMore(query, newsState);
|
|
170
170
|
// The aggregator opens a query in "loading", so the first paint is a loading
|
|
@@ -5,6 +5,8 @@ import { usePaneInstance } from "../../../../state/app/context";
|
|
|
5
5
|
import type { MarketNewsItem, NewsStoryItem } from "../../../../types/news-source";
|
|
6
6
|
import { usePluginPaneState } from "../../../runtime";
|
|
7
7
|
import { usePluginRenderContext } from "../../../runtime/context";
|
|
8
|
+
import { useSavedCopyFooter } from "../../../../components/layout/pane/footer/registration";
|
|
9
|
+
import { retrievedAtOf } from "../../../../data/saved-copies";
|
|
8
10
|
|
|
9
11
|
const MAX_PERSISTED_ARTICLES = 200;
|
|
10
12
|
const EMPTY_PERSISTED_ARTICLES: PersistedNewsArticle[] = [];
|
|
@@ -116,22 +118,24 @@ function serializeArticles(articles: MarketNewsItem[]): PersistedNewsArticle[] {
|
|
|
116
118
|
|
|
117
119
|
const subscribeToSession = (listener: () => void) => apiClient.subscribeCurrentUser(listener);
|
|
118
120
|
|
|
119
|
-
export function usePersistedNewsArticles(key: string, articles: MarketNewsItem[]): MarketNewsItem[] {
|
|
121
|
+
export function usePersistedNewsArticles(key: string, articles: MarketNewsItem[], refreshFailed = false): MarketNewsItem[] {
|
|
120
122
|
const { pluginId, runtime } = usePluginRenderContext();
|
|
121
123
|
const pane = usePaneInstance();
|
|
122
124
|
const scope = useSyncExternalStore(subscribeToSession, cloudNewsSnapshotScope, cloudNewsSnapshotScope);
|
|
123
125
|
const snapshots = runtime.newsPaneSnapshots;
|
|
124
126
|
const storageKey = `${key}:v2`;
|
|
125
127
|
const cached = useMemo(() => {
|
|
126
|
-
if (articles.length || !pane) return
|
|
127
|
-
|
|
128
|
+
if (articles.length || !pane) return null;
|
|
129
|
+
const saved = snapshots?.read<PersistedNewsArticle>(pane, pluginId, storageKey, scope);
|
|
130
|
+
return saved ? { articles: restoreArticles(saved), fetchedAt: retrievedAtOf(saved) } : null;
|
|
128
131
|
}, [articles, pane, pluginId, scope, snapshots, storageKey]);
|
|
132
|
+
useSavedCopyFooter(refreshFailed && cached?.articles.length ? cached.fetchedAt : null, false);
|
|
129
133
|
useEffect(() => {
|
|
130
134
|
if (articles.length && pane && scope != null) {
|
|
131
135
|
snapshots?.write(pane, pluginId, storageKey, scope, serializeArticles(articles));
|
|
132
136
|
}
|
|
133
137
|
}, [articles, pane, pluginId, scope, snapshots, storageKey]);
|
|
134
|
-
return articles.length ? articles : cached;
|
|
138
|
+
return articles.length ? articles : cached?.articles ?? [];
|
|
135
139
|
}
|
|
136
140
|
|
|
137
141
|
export function usePersistedStory(articles: MarketNewsItem[]): MarketNewsItem[] {
|
|
@@ -73,6 +73,13 @@ export const notesHeadless = {
|
|
|
73
73
|
{ key: "text", header: "Text", textHeader: "First line", shrink: true, textFormat: (value) => firstLine(typeof value === "string" ? value : "") },
|
|
74
74
|
],
|
|
75
75
|
discovery: { screenshotReadiness: "ready" },
|
|
76
|
+
async shotState(_args, load) {
|
|
77
|
+
if (apiClient.getSessionToken()) return {};
|
|
78
|
+
const { rows } = await load();
|
|
79
|
+
return { settings: { localNotesSnapshot: rows.flatMap(({ id, title, updated, text }) =>
|
|
80
|
+
typeof id === "string" && typeof title === "string" && typeof text === "string"
|
|
81
|
+
? [{ id, title, updatedAt: typeof updated === "string" ? Date.parse(updated) : undefined, text }] : []) } };
|
|
82
|
+
},
|
|
76
83
|
async load(_args, context) {
|
|
77
84
|
const { store, offline } = await personalStore(context);
|
|
78
85
|
const index = [...await store.loadQuickNotesIndex()].sort((a, b) => (b.updatedAt ?? 0) - (a.updatedAt ?? 0));
|
|
@@ -32,7 +32,7 @@ export const notesPlugin: GloomPlugin = {
|
|
|
32
32
|
// First signed-in launch: the .md files on disk go up, then stay on disk
|
|
33
33
|
// as the export format. Older cloud copies never overwrite newer files.
|
|
34
34
|
const migrate = async () => {
|
|
35
|
-
if (migrating || !apiClient.isVerified() || notesMigratedAt(ctx.persistence)) return;
|
|
35
|
+
if (ctx.runtime === "command" || migrating || !apiClient.isVerified() || notesMigratedAt(ctx.persistence)) return;
|
|
36
36
|
const cloud = registry.cloud({ kind: "user" });
|
|
37
37
|
if (!cloud) return;
|
|
38
38
|
migrating = true;
|
|
@@ -2,6 +2,8 @@ import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
|
2
2
|
import { apiClient } from "../../../api-client";
|
|
3
3
|
import { Box, Text, type InputRenderable, type TextareaRenderable } from "../../../ui";
|
|
4
4
|
import { useShortcut } from "../../../react/input";
|
|
5
|
+
import { useRemoteUiNode } from "../../../remote/semantic-tree";
|
|
6
|
+
import { usePaneInstance } from "../../../state/app/context";
|
|
5
7
|
import { isPlainKey } from "../../../utils/keyboard";
|
|
6
8
|
import type { PaneProps } from "../../../types/plugin";
|
|
7
9
|
import { colors } from "../../../theme/colors";
|
|
@@ -27,7 +29,7 @@ import {
|
|
|
27
29
|
resolveNoteConflict,
|
|
28
30
|
useNoteTeams,
|
|
29
31
|
} from "./owner";
|
|
30
|
-
import { NoteConflictError, type NoteOwner, noteOwnerKey, type NotesStoreRegistry } from "./store";
|
|
32
|
+
import { NoteConflictError, type NoteOwner, noteOwnerKey, type NotesStore, type NotesStoreRegistry } from "./store";
|
|
31
33
|
import { useSyncedText } from "./text-state";
|
|
32
34
|
|
|
33
35
|
const notesLog = debugLog.createLogger("notes");
|
|
@@ -37,11 +39,24 @@ interface OwnedQuickNote extends QuickNoteEntry {
|
|
|
37
39
|
owner: NoteOwner;
|
|
38
40
|
}
|
|
39
41
|
|
|
42
|
+
function snapshotStore(notes: Array<QuickNoteEntry & { text: string }>): NotesStore {
|
|
43
|
+
return {
|
|
44
|
+
owner: { kind: "user" }, readOnly: true,
|
|
45
|
+
load: async (id) => notes.find((note) => note.id === id)?.text ?? "",
|
|
46
|
+
loadQuickNotesIndex: async () => notes.map(({ text: _text, ...entry }) => entry),
|
|
47
|
+
list: async () => notes.map(({ id, text, updatedAt }) => ({ key: id, text, updatedAt: updatedAt ?? 0 })),
|
|
48
|
+
quickNoteKey: (id) => id,
|
|
49
|
+
save: async () => {}, delete: async () => {}, saveQuickNotesIndex: async () => {},
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
|
|
40
53
|
export function createQuickNotesPane(registry: NotesStoreRegistry) {
|
|
41
54
|
return function QuickNotesPane({ focused, width }: PaneProps) {
|
|
42
55
|
const dialog = useDialog();
|
|
43
56
|
const { notify } = usePluginAppActions();
|
|
44
57
|
const teams = useNoteTeams();
|
|
58
|
+
const captured = usePaneInstance()?.settings?.localNotesSnapshot as Array<QuickNoteEntry & { text: string }> | undefined;
|
|
59
|
+
const capturedStore = useMemo(() => captured ? snapshotStore(captured) : null, [captured]);
|
|
45
60
|
const teamKey = teams.map((team) => team.id).join(",");
|
|
46
61
|
const owners = useMemo<NoteOwner[]>(
|
|
47
62
|
() => [{ kind: "user" }, ...teams.map((team) => ({ kind: "team" as const, teamId: team.id }))],
|
|
@@ -49,7 +64,7 @@ export function createQuickNotesPane(registry: NotesStoreRegistry) {
|
|
|
49
64
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
50
65
|
[teamKey],
|
|
51
66
|
);
|
|
52
|
-
const storeFor = useCallback((owner: NoteOwner) => registry.forOwner(owner), []);
|
|
67
|
+
const storeFor = useCallback((owner: NoteOwner) => owner.kind === "user" && capturedStore ? capturedStore : registry.forOwner(owner), [capturedStore]);
|
|
53
68
|
const tabOwner = useCallback((tabId: string | null, list: readonly OwnedQuickNote[]): NoteOwner => (
|
|
54
69
|
list.find((tab) => tab.id === tabId)?.owner ?? { kind: "user" }
|
|
55
70
|
), []);
|
|
@@ -72,6 +87,7 @@ export function createQuickNotesPane(registry: NotesStoreRegistry) {
|
|
|
72
87
|
const unreadableIndexRef = useRef(new Set<string>());
|
|
73
88
|
const [indexError, setIndexError] = useState<{ message: string; owners: NoteOwner[] } | null>(null);
|
|
74
89
|
const activeTab = tabs.find((tab) => tab.id === activeTabId);
|
|
90
|
+
useRemoteUiNode(activeTab && noteText.trim() ? { role: "report-note", label: "Quick note" } : null);
|
|
75
91
|
// Closing a tab deletes its note, which a teammate's team note refuses.
|
|
76
92
|
const mayDelete = useCallback((tab: OwnedQuickNote) => (
|
|
77
93
|
mayDeleteNote(tab, teams, apiClient.getCurrentUser()?.id ?? null)
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
expiryIsoDate, findListedExpiry, formatDaysToExpiry, daysToExpiry, isLiveOptionExpiry, missingExpiryMessage, missingExpiryText, optionExpiryVenue,
|
|
14
14
|
readOptionExpiration,
|
|
15
15
|
} from "../../../utils/option-expiry";
|
|
16
|
-
import { canonicalTickerKey } from "../../../utils/exchanges";
|
|
16
|
+
import { canonicalTickerKey, displayTickerKey } from "../../../utils/exchanges";
|
|
17
17
|
import {
|
|
18
18
|
COIN_OPTIONS_HINT, coinOptionsAlternativesText, isCoinWithoutOptions, isOptionsUnavailableError, listedOptionsAlternative,
|
|
19
19
|
optionsUnavailableDetails, optionsUnavailableHint, optionsUnavailableTitle,
|
|
@@ -412,9 +412,9 @@ export function OptionsView({ width, height, focused, nestedInTabs = false, ivRa
|
|
|
412
412
|
role: "report-failure",
|
|
413
413
|
label: "Options not served",
|
|
414
414
|
getMetadata: () => ({
|
|
415
|
-
message: optionsUnavailableTitle(effectiveTicker),
|
|
415
|
+
message: optionsUnavailableTitle(effectiveTicker, effectiveExchange),
|
|
416
416
|
details: isCoinWithoutOptions(effectiveTicker) ? coinOptionsAlternativesText("fn OMON")
|
|
417
|
-
: optionsUnavailableDetails(effectiveTicker, (symbol) => `gloom fn OMON ${symbol}
|
|
417
|
+
: optionsUnavailableDetails(effectiveTicker, (symbol) => `gloom fn OMON ${symbol}`, effectiveExchange),
|
|
418
418
|
}),
|
|
419
419
|
} : null);
|
|
420
420
|
|
|
@@ -1002,11 +1002,12 @@ export function OptionsView({ width, height, focused, nestedInTabs = false, ivRa
|
|
|
1002
1002
|
}
|
|
1003
1003
|
if (error && !chain && isOptionsUnavailableError(error)) {
|
|
1004
1004
|
// A future, commodity or FX pair with no chain of its own: the listed fund whose options stand in, and OSA on it.
|
|
1005
|
+
// A listing whose venue lists options (0700 on HKEX): that Gloom does not serve them, and what it does serve.
|
|
1005
1006
|
const alternative = listedOptionsAlternative(effectiveTicker);
|
|
1006
1007
|
return (
|
|
1007
1008
|
<EmptyState
|
|
1008
|
-
title={optionsUnavailableTitle(effectiveTicker)}
|
|
1009
|
-
hint={optionsUnavailableHint(effectiveTicker)}
|
|
1009
|
+
title={optionsUnavailableTitle(effectiveTicker, effectiveExchange)}
|
|
1010
|
+
hint={optionsUnavailableHint(effectiveTicker, effectiveExchange)}
|
|
1010
1011
|
actions={alternative ? <>
|
|
1011
1012
|
<Button label={`${alternative.symbol} options`} onPress={() => createPaneFromTemplate("options-pane", { symbol: alternative.symbol })} />
|
|
1012
1013
|
<Button label={`OSA ${alternative.symbol}`} onPress={() => createPaneFromTemplate("options-scenario-pane", { symbol: alternative.symbol })} />
|
|
@@ -1016,7 +1017,7 @@ export function OptionsView({ width, height, focused, nestedInTabs = false, ivRa
|
|
|
1016
1017
|
}
|
|
1017
1018
|
if (error && !chain) return <EmptyState title="Options chain unavailable." message={error} />;
|
|
1018
1019
|
if (!chain || expirationDates.length === 0) {
|
|
1019
|
-
return <EmptyState title={`No options available for ${effectiveTicker}.`} />;
|
|
1020
|
+
return <EmptyState title={`No options available for ${displayTickerKey(effectiveTicker)}.`} />;
|
|
1020
1021
|
}
|
|
1021
1022
|
|
|
1022
1023
|
const positionContracts = isOpt && parsed
|
|
@@ -83,7 +83,7 @@ function summary(openInterest: OpenInterestPayload, dealer: GammaPayload | null)
|
|
|
83
83
|
{ label: "Spot", value: spot, formatted: formatPositioningSpot(spot, spotAsOf, venue, spotBasis) },
|
|
84
84
|
...(dealer && gammaTimes ? [{ label: "Gamma at", value: dealer.gammaAsOf ?? null, formatted: gammaTimes }]
|
|
85
85
|
: dealer ? [{ label: "Quotes as of", value: dealer.quotesAsOf, formatted: time(dealer.quotesAsOf) }] : []),
|
|
86
|
-
{ label: "Open interest as of", value: oiAsOf ?? openInterest.oiDate, formatted: oiAsOf ?
|
|
86
|
+
{ label: "Open interest as of", value: oiAsOf ?? openInterest.oiDate, formatted: oiAsOf ? time(oiAsOf) : openInterest.oiDate ?? MISSING_VALUE },
|
|
87
87
|
...(contract ? [{ label: "Contract", value: contract, formatted: `${contract.size} ${contract.unit}; OI counts ${contract.unit}` }] : []),
|
|
88
88
|
...(settles ? [{ label: "Expiries settle", value: settles, formatted: `${settles}, the day each expiry names` }] : []),
|
|
89
89
|
];
|
|
@@ -130,11 +130,11 @@ export const optionsPositioningHeadless = (initialTab: PositioningTab): Headless
|
|
|
130
130
|
"Open interest is about two sessions old; the Expiries heading names its date.",
|
|
131
131
|
"Dealer gamma assumes dealers are long every call and short every put.",
|
|
132
132
|
"NDX and RUT index options are not covered; use QQQ and IWM.",
|
|
133
|
-
"BTC-USD and ETH-USD are Deribit's options: open interest is
|
|
133
|
+
"BTC-USD and ETH-USD are Deribit's options: open interest is Deribit's own, dated to the minute, and counted in coins, and expiries settle at 08:00 UTC.",
|
|
134
134
|
],
|
|
135
135
|
},
|
|
136
136
|
options: [
|
|
137
|
-
{ key: "tab", type: "enum", values: POSITIONING_TABS
|
|
137
|
+
{ key: "tab", type: "enum", values: POSITIONING_TABS, defaultValue: initialTab,
|
|
138
138
|
settingKey: "tab", description: "View the pane opens on: strikes, expiries or gex" },
|
|
139
139
|
// `--expiration` too, as options and OVDV spell it.
|
|
140
140
|
{ key: "expiry", aliases: ["expiration"], type: "string", settingKey: "expiry", placeholder: OPTION_EXPIRATION_PLACEHOLDER, example: "--expiry 2027-01-15",
|
|
@@ -183,7 +183,7 @@ export const optionsPositioningHeadless = (initialTab: PositioningTab): Headless
|
|
|
183
183
|
// Each expiry's walls, from the all-expiries gamma; absent from older servers.
|
|
184
184
|
const expiryWalls = allExpiries instanceof Error ? null : wallsByExpiry(allExpiries);
|
|
185
185
|
const settles = openInterest.expiries.some((row) => settlementTime(row.expiresAt));
|
|
186
|
-
const oiStamp = openInterest.venue && openInterest.oiAsOf ?
|
|
186
|
+
const oiStamp = openInterest.venue && openInterest.oiAsOf ? time(openInterest.oiAsOf) : openInterest.oiDate ?? MISSING_VALUE;
|
|
187
187
|
const gammaShown = dealer instanceof Error || !dealer.total ? null : dealer;
|
|
188
188
|
const scope = dealer instanceof Error ? null : dealer.expiry ? expiryLabel(dealer.expiry) : "all expiries";
|
|
189
189
|
const walls = gammaShown ? gammaWalls(gammaShown.strikes) : null;
|
|
@@ -46,7 +46,9 @@ import { isPlainKey } from "../../../utils/keyboard";
|
|
|
46
46
|
import { nextHeaderSort, type SortDirection } from "../../../utils/sort-values";
|
|
47
47
|
import { useCloudAccessFooter } from "../shared/cloud-upgrade";
|
|
48
48
|
import { useCloudDisplayScope } from "../../../api-client/plan-access";
|
|
49
|
-
import {
|
|
49
|
+
import {
|
|
50
|
+
COIN_OPTIONS_HINT, isCoinWithoutOptions, optionsUnavailableHint, optionsUnavailableTitle, unservedOptionsVenue,
|
|
51
|
+
} from "../../../market-data/options-alternatives";
|
|
50
52
|
import {
|
|
51
53
|
loadGamma,
|
|
52
54
|
loadOpenInterest,
|
|
@@ -199,6 +201,8 @@ export function OptionsPositioningPane(props: PaneProps) {
|
|
|
199
201
|
const { symbol } = usePaneTickerIdentity();
|
|
200
202
|
// A coin nothing lists options on (SOL-USD) says which coins have them, before any request.
|
|
201
203
|
if (symbol && isCoinWithoutOptions(symbol)) return <EmptyState title={optionsUnavailableTitle(parsePublicTickerKey(symbol).symbol)} hint={COIN_OPTIONS_HINT} />;
|
|
204
|
+
// So does a listing whose venue lists options Gloom does not serve (0700 on HKEX), never "no listed options".
|
|
205
|
+
if (symbol && unservedOptionsVenue(symbol)) return <EmptyState title={optionsUnavailableTitle(symbol)} hint={optionsUnavailableHint(symbol)} />;
|
|
202
206
|
// A new underlying starts over rather than relabelling the last one's data.
|
|
203
207
|
return symbol ? <OptionsPositioningView key={symbol} {...props} symbol={symbol} />
|
|
204
208
|
: <EmptyState title="Choose an option underlying." />;
|
|
@@ -326,8 +330,8 @@ function OptionsPositioningView({ width, height, focused, symbol }: PaneProps &
|
|
|
326
330
|
...(savedAt != null ? [savedCopyFooterSegment("saved-copy", savedAt)] : []),
|
|
327
331
|
...(accessSegment ? [accessSegment] : []),
|
|
328
332
|
...(venue ? [{ id: "venue", parts: [{ text: venue, tone: "muted" as const }] }] : []),
|
|
329
|
-
// A venue that publishes open interest
|
|
330
|
-
...(venue && data?.oiAsOf ? [{ id: "oi-date", parts: [{ text: `OI
|
|
333
|
+
// A venue that publishes open interest by the minute (Deribit) says when it was read.
|
|
334
|
+
...(venue && data?.oiAsOf ? [{ id: "oi-date", parts: [{ text: `OI as of ${data.oiAsOf.slice(11, 16)} UTC`, tone: "muted" as const }] }]
|
|
331
335
|
: data?.oiDate ? [{ id: "oi-date", parts: [{ text: `OI as of ${shortDate(data.oiDate)}`, tone: "muted" as const }] }] : []),
|
|
332
336
|
...(changes && tab !== "gex" ? [{ id: "oi-change", parts: [{ text: `chg since ${shortDate(data!.previousOiDate!)}`, tone: "muted" as const }] }] : []),
|
|
333
337
|
], [accessSegment, changes, data?.oiAsOf, data?.oiDate, data?.previousOiDate, savedAt, tab, venue]);
|
|
@@ -18,6 +18,7 @@ import { loadModelDividendYield, type ModelDividendYield } from "../../../market
|
|
|
18
18
|
import { abortable, abortError } from "../../../utils/async-deadline";
|
|
19
19
|
import { extendedSession, modelSpotStamp, modelSpotStampVariants, type OptionModelSpot } from "../options/model-spot";
|
|
20
20
|
import { errorMessage } from "../../../utils/errors";
|
|
21
|
+
import { optionsUnavailableTitle, unservedOptionsVenue } from "../../../market-data/options-alternatives";
|
|
21
22
|
import { isTransientFailure } from "../../../api-client/errors";
|
|
22
23
|
import { isTransientSourceFailure, serviceDidNotAnswerMessage } from "../../../sources/provider-errors";
|
|
23
24
|
import { DATA_SERVICE_UNREACHABLE_MESSAGE, isNetworkFailure } from "../../../utils/network-failure";
|
|
@@ -178,8 +179,8 @@ export async function loadScenarioMarket(
|
|
|
178
179
|
}
|
|
179
180
|
// A read that failed says why: a service that did not answer is asked again, a chain none lists is not.
|
|
180
181
|
const chainUnavailable = !missingExpiry && (!chain || chainEntry?.error)
|
|
181
|
-
? chainReadFailure(symbol, chainRejection, chainEntry, chain != null) : undefined;
|
|
182
|
-
if (chainUnavailable && chainUnavailable !==
|
|
182
|
+
? chainReadFailure(symbol, request.instrument.exchange, chainRejection, chainEntry, chain != null) : undefined;
|
|
183
|
+
if (chainUnavailable && chainUnavailable !== noChainListed(symbol, request.instrument.exchange)) {
|
|
183
184
|
// The router's "No options provider available" of a read that timed out reads as no chain at all.
|
|
184
185
|
for (let index = warnings.length - 1; index >= 0; index -= 1) if (warnings[index]!.startsWith("Options chain: ")) warnings.splice(index, 1);
|
|
185
186
|
warnings.push(chainUnavailable);
|
|
@@ -215,7 +216,13 @@ export async function loadScenarioMarket(
|
|
|
215
216
|
* a chain an earlier read left, which only a failure worth retrying explains.
|
|
216
217
|
* Undefined when the read did not fail.
|
|
217
218
|
*/
|
|
218
|
-
function chainReadFailure(
|
|
219
|
+
function chainReadFailure(
|
|
220
|
+
symbol: string,
|
|
221
|
+
exchange: string | undefined,
|
|
222
|
+
rejection: unknown,
|
|
223
|
+
entry: QueryEntry<OptionsChain> | null,
|
|
224
|
+
kept: boolean,
|
|
225
|
+
): string | undefined {
|
|
219
226
|
if (rejection === undefined && !entry?.error) return undefined;
|
|
220
227
|
const what = `the ${symbol} options chain`;
|
|
221
228
|
const message = rejection !== undefined ? errorMessage(rejection) : entry!.error!.message;
|
|
@@ -226,7 +233,16 @@ function chainReadFailure(symbol: string, rejection: unknown, entry: QueryEntry<
|
|
|
226
233
|
if (/\btry again\b/i.test(message)) return message;
|
|
227
234
|
const transient = rejection !== undefined ? isTransientFailure(rejection) || isTransientSourceFailure(rejection) : entryFailedTransiently(entry);
|
|
228
235
|
if (transient) return serviceDidNotAnswerMessage(what);
|
|
229
|
-
return kept ? undefined :
|
|
236
|
+
return kept ? undefined : noChainListed(symbol, exchange);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* What a read that found no chain says: none is listed, or for a listing on a
|
|
241
|
+
* venue abroad that lists options (0700 on HKEX), that Gloom does not serve
|
|
242
|
+
* them, never that none is listed.
|
|
243
|
+
*/
|
|
244
|
+
function noChainListed(symbol: string, exchange: string | undefined): string {
|
|
245
|
+
return unservedOptionsVenue(symbol, exchange) ? optionsUnavailableTitle(symbol, exchange) : `No options chain is listed for ${symbol}.`;
|
|
230
246
|
}
|
|
231
247
|
|
|
232
248
|
/** What a strategy seed says when the market holds no current chain to seed it from. */
|
|
@@ -55,7 +55,7 @@ export const optionsScenarioHeadless: HeadlessPaneDefinition<"bundle"> = {
|
|
|
55
55
|
+ "a call against the shares they cover: net premium, floor, cap and breakevens of the hedged position.",
|
|
56
56
|
discovery: { screenshotReadiness: "ready", limitations: ["European scenario values do not model early assignment or exercise."] },
|
|
57
57
|
options: [
|
|
58
|
-
{ key: "tab", type: "enum", values: ["payoff", "grid", "
|
|
58
|
+
{ key: "tab", type: "enum", values: [{ value: "payoff" }, { value: "grid", label: "P&L grid" }, { value: "legs" }], defaultValue: "payoff",
|
|
59
59
|
description: "Initial view", pluginState: { pluginId: "ticker-research", key: "activeTabId" } },
|
|
60
60
|
{ key: "legs", type: "string", description: "Semicolon-separated side,strike,YYYY-MM-DD,signed quantity,entry price per share,IV percent[,multiplier]" },
|
|
61
61
|
{ key: "strategy", type: "enum", values: SCENARIO_STRATEGIES.map((value) => ({ value })),
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { apiClient } from "../../../api-client";
|
|
2
2
|
import { getSharedMarketDataCoordinator, MarketDataCoordinator, resolveEntryValue } from "../../../market-data/coordinator";
|
|
3
|
-
import {
|
|
4
|
-
import { dailyFxCloses, FxHistoryError, type FxCloses } from "../../../market-data/fx-closes";
|
|
3
|
+
import { dailyFxCloses, dailyFxLeg, FxHistoryError, type FxCloses } from "../../../market-data/fx-closes";
|
|
5
4
|
import type { InstrumentRef } from "../../../market-data/request-types";
|
|
6
5
|
import type { ManualChartResolution } from "../../../time-series/resolution";
|
|
7
6
|
import type { DataProvider } from "../../../types/data-provider";
|
|
@@ -29,7 +28,7 @@ export interface PeBandInputs {
|
|
|
29
28
|
historyError: string | null;
|
|
30
29
|
/** Report dates for US listings; empty for the rest and when the earnings history is unavailable. */
|
|
31
30
|
reports: ReportDate[];
|
|
32
|
-
/** Daily
|
|
31
|
+
/** Daily USD legs for the reporting and listing currencies. */
|
|
33
32
|
fx: Map<string, FxCloses>;
|
|
34
33
|
/** Why a currency's FX closes are missing; its EPS then stays unconverted. */
|
|
35
34
|
fxError: string | null;
|
|
@@ -62,14 +61,11 @@ async function loadFxCloses(financials: TickerFinancials, client: ReportClient,
|
|
|
62
61
|
Promise<{ fx: Map<string, FxCloses>; error: string | null }> {
|
|
63
62
|
const fx = new Map<string, FxCloses>();
|
|
64
63
|
const errors: string[] = [];
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
const leg = fxLegForCurrency(currency)!;
|
|
68
|
-
const oldest = rows.filter((row) => row.currency?.trim().toUpperCase() === currency && Number.isFinite(Date.parse(row.date)))
|
|
69
|
-
.reduce((min, row) => Math.min(min, Date.parse(row.date)), now.getTime());
|
|
64
|
+
await Promise.all([...epsFxCurrencies(financials, [])].map(async ([currency, since]) => {
|
|
65
|
+
const leg = dailyFxLeg(currency)!;
|
|
70
66
|
try {
|
|
71
67
|
const response = await client.getCloudHistory(leg.instrument.symbol, leg.instrument.exchange ?? "", {
|
|
72
|
-
interval: "1day", startDate: new Date(
|
|
68
|
+
interval: "1day", startDate: new Date(Date.parse(since) - FX_LEAD_DAYS * 86_400_000).toISOString().slice(0, 10),
|
|
73
69
|
endDate: now.toISOString().slice(0, 10), outputsize: FX_MAX_ROWS,
|
|
74
70
|
}, signal ? { signal } : undefined);
|
|
75
71
|
fx.set(currency, dailyFxCloses(response, leg, now, FX_MAX_ROWS));
|
|
@@ -3,7 +3,7 @@ import { MarketDataCoordinator } from "../../../market-data/coordinator";
|
|
|
3
3
|
import type { HeadlessPaneDefinition } from "../../../types/plugin";
|
|
4
4
|
import { resolveHeadlessInstrument } from "../shared/headless-market-data";
|
|
5
5
|
import { loadPeBandInputs } from "./client";
|
|
6
|
-
import {
|
|
6
|
+
import { formatEpsFx, formatPerShare, projectPeBand } from "./model";
|
|
7
7
|
import { DAILY_CLOSES } from "../shared/report-freshness";
|
|
8
8
|
|
|
9
9
|
const multiple = (value: unknown) => typeof value === "number" ? `${value.toFixed(1)}x` : MISSING_VALUE;
|
|
@@ -15,7 +15,7 @@ export const peBandHeadless: HeadlessPaneDefinition<"bundle"> = {
|
|
|
15
15
|
freshness: { ...DAILY_CLOSES, basis: "daily closes and reported EPS" },
|
|
16
16
|
describe: (args) => `PEB ${args.symbols[0] ?? ""}`,
|
|
17
17
|
discovery: { screenshotReadiness: "live-dom", limitations: [
|
|
18
|
-
"Weekly closes; each EPS figure is priced at the close of the day it became known where daily closes reach. EPS
|
|
18
|
+
"Weekly closes; each EPS figure is priced at the close of the day it became known where daily closes reach. EPS is converted to the listing currency at the period-end FX close.",
|
|
19
19
|
] },
|
|
20
20
|
options: [
|
|
21
21
|
{ key: "lookbackYears", type: "integer", minimum: 0, maximum: 30, defaultValue: 10, description: "Years of history; 0 for all on record" },
|
|
@@ -29,12 +29,10 @@ export const peBandHeadless: HeadlessPaneDefinition<"bundle"> = {
|
|
|
29
29
|
fx: inputs.fx, fxError: inputs.fxError, daily: inputs.daily });
|
|
30
30
|
const current = model.current;
|
|
31
31
|
const conversion = model.conversion;
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
return `${quote.pair} ${quote.value.toPrecision(5)}`;
|
|
35
|
-
};
|
|
32
|
+
const showFx = !!conversion || model.rows.some((row) => row.fx);
|
|
33
|
+
const pairQuote = (from: string, rate: number) => formatEpsFx(from, model.currency!, rate);
|
|
36
34
|
const reported = current?.step?.eps != null && conversion && current.step.currency === conversion.currency
|
|
37
|
-
? `, from ${conversion.currency} ${amount(current.step.eps)} at ${pairQuote(conversion.latest.rate)} (${conversion.latest.date} close)` : "";
|
|
35
|
+
? `, from ${conversion.currency} ${amount(current.step.eps)} at ${pairQuote(conversion.currency, conversion.latest.rate)} (${conversion.latest.date} close)` : "";
|
|
38
36
|
return {
|
|
39
37
|
sections: [
|
|
40
38
|
{ title: "P/E band", columns: [{ key: "label", header: "" }, { key: "value", header: "Value" }], rows: [
|
|
@@ -44,25 +42,25 @@ export const peBandHeadless: HeadlessPaneDefinition<"bundle"> = {
|
|
|
44
42
|
{ label: "P/E low, median, high", value: model.range ? `${multiple(model.range.min)}, ${multiple(model.range.median)}, ${multiple(model.range.max)}` : MISSING_VALUE },
|
|
45
43
|
{ label: "Price", value: `${amount(current?.price)} ${model.currency ?? ""}`.trim() },
|
|
46
44
|
{ label: "Trailing EPS", value: current?.step
|
|
47
|
-
? `${amount(current.eps)} (${current.step.basis === "annual" ? "FY" : "TTM"} ${current.step.periodEnd})${reported}` : MISSING_VALUE },
|
|
45
|
+
? `${amount(current.eps)}${conversion ? ` ${model.currency}` : ""} (${current.step.basis === "annual" ? "FY" : "TTM"} ${current.step.periodEnd})${reported}` : MISSING_VALUE },
|
|
48
46
|
] },
|
|
49
47
|
{ title: "Price at each multiple", columns: [{ key: "multiple", header: "Multiple", format: multiple }, { key: "price", header: "Price", format: amount }],
|
|
50
48
|
rows: model.multiples.map((value) => ({ multiple: value, price: current?.eps != null && current.eps > 0 ? value * current.eps : null })) },
|
|
51
49
|
{ title: "Trailing EPS", columns: [{ key: "periodEnd", header: "Period end" }, { key: "basis", header: "Basis" },
|
|
52
|
-
{ key: "knownAt", header: "Known" }, { key: "eps", header:
|
|
53
|
-
...(
|
|
50
|
+
{ key: "knownAt", header: "Known" }, { key: "eps", header: showFx ? "EPS reported" : "EPS", format: amount },
|
|
51
|
+
...(showFx ? [{ key: "currency", header: "Currency" }, { key: "fx", header: "FX close" }] : []),
|
|
54
52
|
{ key: "yoy", header: "YoY", format: percent }, { key: "price", header: "Price", format: amount }, { key: "pe", header: "P/E", format: multiple }],
|
|
55
53
|
rows: model.rows.map((row) => ({ periodEnd: row.periodEnd, basis: row.basis === "annual" ? "FY" : "TTM",
|
|
56
54
|
knownAt: row.dated ? row.knownAt.toISOString().slice(0, 10) : "period end", eps: row.eps,
|
|
57
|
-
...(
|
|
55
|
+
...(showFx ? { currency: row.currency, fx: row.fx && row.currency ? `${pairQuote(row.currency, row.fx.rate)} (${row.fx.date})` : MISSING_VALUE } : {}),
|
|
58
56
|
yoy: row.yoy, price: row.price, pe: row.pe })) },
|
|
59
57
|
],
|
|
60
58
|
complete: !inputs.stale && !inputs.error && !inputs.historyError && !model.error,
|
|
61
59
|
unavailableSymbols: current?.pe != null ? [] : [instrument.symbol],
|
|
62
60
|
errors: [inputs.error, inputs.historyError, model.error, model.notice].filter((value): value is string => !!value),
|
|
63
61
|
metadata: { currency: model.currency, lookbackYears,
|
|
64
|
-
epsConversion: conversion ? { from: conversion.currency, to: model.currency,
|
|
65
|
-
basis: "daily FX close on or before
|
|
62
|
+
epsConversion: conversion ? { from: conversion.currency, to: model.currency, rate: conversion.latest.rate, closeDate: conversion.latest.date,
|
|
63
|
+
basis: "daily FX close on or before the EPS period end" } : null,
|
|
66
64
|
sampleStart: model.sample?.start.toISOString().slice(0, 10) ?? null, sampleWeeks: model.sample?.weeks ?? 0, multiples: model.multiples, undatedEpsPeriods: model.undated, unavailableTtmSums: model.unavailable,
|
|
67
65
|
stale: inputs.stale, fetchedAt: inputs.fetchedAt, methodology: "docs/research-data.md#pe-band" },
|
|
68
66
|
};
|