@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
|
@@ -4,7 +4,7 @@ import type { HeadlessPaneColumn, HeadlessPaneDefinition, HeadlessPaneEntry, Hea
|
|
|
4
4
|
import { MISSING_VALUE, formatPercentRaw } from "../../../utils/format";
|
|
5
5
|
import { DATE_OPTION_EXAMPLES } from "../../../utils/calendar-date";
|
|
6
6
|
import { loadFuturesCurve, loadCurveSpot, loadCurveSpotBars, loadCurveSpotCloses, loadFuturesCurveAsOf } from "./client";
|
|
7
|
-
import { curveReportFreshness, basisSpotSymbol, BASIS_CONVENTION, blankBasisNote, catalogueCurveUnit, curveAsOfDate, curveCache, curveSpotBars, curveBasisPercent, curveBasisRows, curveChangeText, curveContractCode, curveIncompleteDetail, curvePrice, curveReadsThirtySeconds, curveRoundedPrice, curveSpotSource, curveSpotPremium, curveSpreadLabel, curveTimestamp, curveNoTradeSince, curveSessionNote, curveSettleShown, curveStandIn, curveUnitLabel, curveRootNamed, noTradeChangeNote, normalizeCurveRoot, shortDatedBasisNote, skippedSpreadNotice, spotIndexSymbol, thinSpreadNotice, unpairedContractCount, unsupportedCurveRootMessage, type ContractBasis, type CurveSpotPremium } from "./model";
|
|
7
|
+
import { curveReportFreshness, basisSpotSymbol, BASIS_CONVENTION, blankBasisNote, catalogueCurveUnit, curveAsOfDate, curveCache, curveSpotBars, curveBasisPercent, curveInterestDate, curveBasisRows, curveChangeText, curveContractCode, curveIncompleteDetail, curvePrice, curveReadsThirtySeconds, curveRoundedPrice, curveSpotSource, curveSpotPremium, curveSpreadLabel, curveTimestamp, curveNoTradeSince, curveSessionNote, curveSettleShown, curveStandIn, curveUnitLabel, curveRootNamed, noTradeChangeNote, normalizeCurveRoot, shortDatedBasisNote, skippedSpreadNotice, spotIndexSymbol, thinSpreadNotice, unpairedContractCount, unsupportedCurveRootMessage, type ContractBasis, type CurveSpotPremium } from "./model";
|
|
8
8
|
import { COMMODITIES_VIEW_STATE } from "../commodities-energy/view-state";
|
|
9
9
|
import { knownGapMessage } from "../../../cli/known-gaps";
|
|
10
10
|
|
|
@@ -25,7 +25,8 @@ const basisValue = (value: number | null) => value == null ? null : Number(value
|
|
|
25
25
|
* `change` is `price` less `settlement`; `noTradeSince` dates the settlement
|
|
26
26
|
* a contract has not traded since, whose change is therefore blank, and
|
|
27
27
|
* `settleShown` the one it is shown and plotted at (no trade since, or none
|
|
28
|
-
* at all).
|
|
28
|
+
* at all). `openInterestAsOf` is the session the open interest counts, a day
|
|
29
|
+
* or so before the trade in `asOf`; null when the server cannot date it. A crypto
|
|
29
30
|
* root adds the basis: the spot in the minute of `price`'s trade and that
|
|
30
31
|
* minute (`spot`, `spotTime`), the fractional days from the trade to final
|
|
31
32
|
* settlement, and the premium and its yearly rate.
|
|
@@ -40,7 +41,9 @@ function contractRow(row: FuturesContract, data: FuturesCurvePayload, root: stri
|
|
|
40
41
|
noTradeSince: past ? null : curveNoTradeSince(row, data),
|
|
41
42
|
// The settlement session a live contract is shown at, when it has no trade since (or none at all): its curve point is that settlement.
|
|
42
43
|
settleShown: past ? null : curveSettleShown(row, data),
|
|
43
|
-
asOf: row.asOf, stale: row.stale, volume: row.volume, openInterest: row.openInterest,
|
|
44
|
+
asOf: row.asOf, stale: row.stale, volume: row.volume, openInterest: row.openInterest,
|
|
45
|
+
// The session the open interest counts, not the trade beside it; null when the server cannot date it.
|
|
46
|
+
openInterestAsOf: row.openInterest != null ? row.openInterestAsOf ?? null : null, percentile: rank(row.percentile),
|
|
44
47
|
samples: row.samples, historyStart: row.historyStart, historyEnd: row.historyEnd,
|
|
45
48
|
currency: row.currency, quoteUnit: curveUnitLabel(data) ?? row.quoteUnit, delayMinutes: row.delayMinutes,
|
|
46
49
|
...(basis ? { spot: price(basis.spot), spotTime: basis.spotTime, daysToExpiry: basisValue(basis.daysToExpiry),
|
|
@@ -81,6 +84,9 @@ function contractColumns(root: string, settlementDate: string | null, options: {
|
|
|
81
84
|
format: (value, row) => typeof row.settleShown === "string" ? MISSING_VALUE : typeof value === "string" ? curveTimestamp(value) : MISSING_VALUE,
|
|
82
85
|
textFormat: (value, row) => typeof row.settleShown === "string" ? `settle ${row.settleShown}` : typeof value === "string" ? curveTimestamp(value) : MISSING_VALUE },
|
|
83
86
|
{ key: "openInterest", header: "Open Int", align: "right", format: (value) => typeof value === "number" ? value.toLocaleString("en-US") : MISSING_VALUE },
|
|
87
|
+
// Its own session beside it: the text says `n/a` for a count it cannot date, an export leaves the cell empty.
|
|
88
|
+
{ key: "openInterestAsOf", header: "OI Date", shrink: false, format: date,
|
|
89
|
+
textFormat: (value, row) => curveInterestDate({ openInterest: typeof row.openInterest === "number" ? row.openInterest : null, openInterestAsOf: typeof value === "string" ? value : null }) },
|
|
84
90
|
{ key: "volume", header: "Volume", align: "right", format: (value) => typeof value === "number" ? value.toLocaleString("en-US") : MISSING_VALUE },
|
|
85
91
|
{ key: "percentile", header: "Pctl", align: "right", format: (value) => typeof value === "number" ? String(value) : MISSING_VALUE },
|
|
86
92
|
];
|
|
@@ -375,14 +375,14 @@ export function curveContractChanges(data: FuturesCurvePayload): CurveContractCh
|
|
|
375
375
|
|
|
376
376
|
const CHANGE_COLUMNS: Readonly<Record<string, CurveLookback>> = { change1w: "1W", change1m: "1M" };
|
|
377
377
|
|
|
378
|
-
type CurveSortKey = "symbol" | "expiration" | "price" | "settlement" | "firstNotice" | "change" | "openInterest" | "volume" | "percentile" | "asOf";
|
|
378
|
+
type CurveSortKey = "symbol" | "expiration" | "price" | "settlement" | "firstNotice" | "change" | "openInterest" | "openInterestAsOf" | "volume" | "percentile" | "asOf";
|
|
379
379
|
|
|
380
380
|
const BASIS_COLUMNS: Readonly<Record<string, "vsSpotPct" | "annualisedBasisPct">> = { vsSpot: "vsSpotPct", annBasis: "annualisedBasisPct" };
|
|
381
381
|
|
|
382
382
|
export function sortCurveContracts(rows: readonly FuturesContract[], id: string, direction: SortDirection,
|
|
383
383
|
changes?: CurveContractChanges, basis?: CurveBasisRows): FuturesContract[] {
|
|
384
384
|
const keys: Record<string, CurveSortKey> = { symbol: "symbol", expiry: "expiration", price: "price", settle: "settlement", notice: "firstNotice",
|
|
385
|
-
change: "change", oi: "openInterest", volume: "volume", percentile: "percentile", asOf: "asOf" };
|
|
385
|
+
change: "change", oi: "openInterest", oiDate: "openInterestAsOf", volume: "volume", percentile: "percentile", asOf: "asOf" };
|
|
386
386
|
const key = keys[id] ?? "expiration";
|
|
387
387
|
const lookback = CHANGE_COLUMNS[id];
|
|
388
388
|
const basisKey = BASIS_COLUMNS[id];
|
|
@@ -919,6 +919,16 @@ export function curveSettleShown(row: Pick<FuturesContract, "price" | "settlemen
|
|
|
919
919
|
return row.price == null ? data.settlementDate : curveNoTradeSince(row, data);
|
|
920
920
|
}
|
|
921
921
|
|
|
922
|
+
/**
|
|
923
|
+
* The session a contract's open interest counts, as its column dates it: `2026-11-20`, or `n/a` for a count the
|
|
924
|
+
* server cannot date (one carried forward from an earlier read); blank without open interest. Exchanges publish open
|
|
925
|
+
* interest once a session, so it is never dated by the last trade beside it.
|
|
926
|
+
*/
|
|
927
|
+
export function curveInterestDate(row: Pick<FuturesContract, "openInterest" | "openInterestAsOf">): string {
|
|
928
|
+
if (row.openInterest == null) return MISSING_VALUE;
|
|
929
|
+
return row.openInterestAsOf ?? "n/a";
|
|
930
|
+
}
|
|
931
|
+
|
|
922
932
|
/** The price a live contract is plotted and measured at: its settlement when it has not traded since (curveSettleShown), else its last trade. */
|
|
923
933
|
function curveShownPrice(row: Pick<FuturesContract, "price" | "settlement" | "asOf">,
|
|
924
934
|
data: Pick<FuturesCurvePayload, "source" | "settlementDate">): number | null {
|
|
@@ -983,8 +993,10 @@ export function curveIncompleteDetail(data: Pick<FuturesCurvePayload, "catalogue
|
|
|
983
993
|
|
|
984
994
|
/**
|
|
985
995
|
* The archived curve on a past date in the live curve's shape, so the pane
|
|
986
|
-
* draws it the same way. Its week- and month-back ghosts are the
|
|
987
|
-
*
|
|
996
|
+
* draws it the same way. Its week- and month-back ghosts are the archive's
|
|
997
|
+
* curves on those dates: contracts that have since expired are included from
|
|
998
|
+
* the day the archive holds them, and a curve before then lists only the
|
|
999
|
+
* months still listed on that day (a partial curve, as its gaps say). A row is dated
|
|
988
1000
|
* by its session, or by the earlier session its carried price comes from.
|
|
989
1001
|
* Percentiles and session changes are not archived, so they stay unavailable.
|
|
990
1002
|
*/
|
|
@@ -999,7 +1011,9 @@ export function archivedFuturesCurve(root: string, curve: FuturesCurveAsOfPayloa
|
|
|
999
1011
|
return [{
|
|
1000
1012
|
symbol: row.symbol, label: row.label, expiration: expiration(row)!, price: row.price, change: null, asOf: rowDate(row, stale),
|
|
1001
1013
|
currency: curve.currency ?? "USD", quoteUnit: curve.quoteUnit ?? curve.currency ?? "USD", volume: row.volume,
|
|
1002
|
-
|
|
1014
|
+
// The archive keeps each session's own open interest, never a carried one.
|
|
1015
|
+
openInterest: row.openInterest, openInterestAsOf: row.openInterest != null ? row.tradeDate : null,
|
|
1016
|
+
delayMinutes: null, stale, percentile: null, samples: 0, historyStart: null, historyEnd: null,
|
|
1003
1017
|
// Only a row the archive confirms is a settlement; an unconfirmed one is that session's last trade.
|
|
1004
1018
|
settlement: !stale && row.settled === true ? row.price : null,
|
|
1005
1019
|
lastTrade: row.lastTrade ?? row.expiration, firstNotice: row.firstNotice ?? null, inDelivery: row.inDelivery ?? false,
|
|
@@ -18,7 +18,7 @@ import { useResearchCloudSession } from "../shared/research-cloud-session";
|
|
|
18
18
|
import { useQuoteBoard } from "../shared/use-quote-board";
|
|
19
19
|
import { useRemoteUiNode } from "../../../remote/semantic-tree";
|
|
20
20
|
import { getCachedFuturesCurve, loadCurveSpotBars, loadCurveSpotCloses, loadFuturesCurve, loadFuturesCurveAsOf } from "./client";
|
|
21
|
-
import { curveFreshnessObservations, curveReportFreshness, BASIS_CONVENTION, basisSpotSymbol, blankBasisNote, curveAsOfDate, curveAxisGrid, curveAxisPrice, curveBasisPercent, curveBasisRows, curveCache, curveChangeText, curveContractChanges, curveContractCode, curvePrice, curveRank, curveSessionNote, curveSettleShown, curveSpot, curveSpotBars, curveSpotLabel, curveSpotPremium, curveSpotSource, curveSpreadBasis, curveSpreadLabel, curveTimestamp, curveStandIn, curveTitle, curveUnitLabel, DEFAULT_CURVE_HORIZON, futuresCurveSeries, newestQuote, noTradeChangeNote, normalizeCurveRoot, paneCurveRoot, shortDatedBasis, shortDatedBasisNote, skippedSpreadNotice, sortCurveContracts, spotIndexSymbol, thinSpreadNotice, unsupportedCurveRootMessage, type CurveContractChanges, type CurveSpot } from "./model";
|
|
21
|
+
import { curveFreshnessObservations, curveReportFreshness, BASIS_CONVENTION, basisSpotSymbol, blankBasisNote, curveAsOfDate, curveAxisGrid, curveAxisPrice, curveBasisPercent, curveBasisRows, curveCache, curveChangeText, curveContractChanges, curveInterestDate, curveContractCode, curvePrice, curveRank, curveSessionNote, curveSettleShown, curveSpot, curveSpotBars, curveSpotLabel, curveSpotPremium, curveSpotSource, curveSpreadBasis, curveSpreadLabel, curveTimestamp, curveStandIn, curveTitle, curveUnitLabel, DEFAULT_CURVE_HORIZON, futuresCurveSeries, newestQuote, noTradeChangeNote, normalizeCurveRoot, paneCurveRoot, shortDatedBasis, shortDatedBasisNote, skippedSpreadNotice, sortCurveContracts, spotIndexSymbol, thinSpreadNotice, unsupportedCurveRootMessage, type CurveContractChanges, type CurveSpot } from "./model";
|
|
22
22
|
|
|
23
23
|
const TABS = [{ value: "curve", label: "Curve" }, { value: "contracts", label: "Contracts" }];
|
|
24
24
|
// One column order for every root. SETTLE is the exchange settlement for the
|
|
@@ -35,12 +35,17 @@ const COLUMNS: DataTableColumn[] = [
|
|
|
35
35
|
{ id: "change", label: "CHG", width: 11, align: "right" },
|
|
36
36
|
{ id: "percentile", label: "PCTL", width: 5, align: "right" },
|
|
37
37
|
{ id: "oi", label: "OPEN INT", width: 10, align: "right" },
|
|
38
|
+
// The session the open interest counts, a day or so before the last trade.
|
|
39
|
+
{ id: "oiDate", label: "OI DATE", width: 10, align: "left" },
|
|
38
40
|
{ id: "volume", label: "VOLUME", width: 10, align: "right" },
|
|
39
41
|
{ id: "asOf", label: "AS OF UTC", width: 16, align: "left" },
|
|
40
42
|
];
|
|
43
|
+
// Open interest and the session it counts go together.
|
|
44
|
+
const INTEREST: readonly string[] = ["oi", "oiDate"];
|
|
45
|
+
type DropOrder = readonly (string | readonly string[])[];
|
|
41
46
|
// A narrow pane keeps the contract and its last trade longest; the settlement
|
|
42
47
|
// goes before the expiry, which names the contract on the curve's time axis.
|
|
43
|
-
const CONTRACTS_DROP_ORDER = ["percentile", "volume",
|
|
48
|
+
const CONTRACTS_DROP_ORDER: DropOrder = ["percentile", "volume", INTEREST, "notice", "asOf", "change", "settle", "expiry"];
|
|
44
49
|
const column = (id: string) => COLUMNS.find((entry) => entry.id === id)!;
|
|
45
50
|
// The curve's rows move with the look-back curves drawn above them; the
|
|
46
51
|
// footer carries the quote time every row would otherwise repeat. The session
|
|
@@ -49,9 +54,9 @@ const CURVE_COLUMNS: DataTableColumn[] = [
|
|
|
49
54
|
column("symbol"), column("expiry"), column("settle"), column("price"),
|
|
50
55
|
{ id: "change1w", label: "VS 1W", width: 10, align: "right" },
|
|
51
56
|
{ id: "change1m", label: "VS 1M", width: 10, align: "right" },
|
|
52
|
-
column("percentile"), column("oi"), column("volume"),
|
|
57
|
+
column("percentile"), column("oi"), column("oiDate"), column("volume"),
|
|
53
58
|
];
|
|
54
|
-
const CURVE_DROP_ORDER = ["percentile", "volume", "change1m",
|
|
59
|
+
const CURVE_DROP_ORDER: DropOrder = ["percentile", "volume", "change1m", INTEREST, "change1w", "settle", "expiry"];
|
|
55
60
|
// A crypto curve also reads against spot. Its widths are the tightest each column
|
|
56
61
|
// holds (BTCV26.CME, 128000.00), so the two new columns fit beside the rest, and
|
|
57
62
|
// a narrow pane drops the least useful ones before a number would be clipped.
|
|
@@ -61,7 +66,7 @@ const BASIS_CURVE_COLUMNS: DataTableColumn[] = [
|
|
|
61
66
|
{ id: "annBasis", label: "ANN BASIS", width: 11, align: "right" },
|
|
62
67
|
...CURVE_COLUMNS.slice(4),
|
|
63
68
|
];
|
|
64
|
-
const BASIS_DROP_ORDER = ["percentile", "volume", "change1m",
|
|
69
|
+
const BASIS_DROP_ORDER: DropOrder = ["percentile", "volume", "change1m", INTEREST, "settle", "change1w", "vsSpot", "expiry"];
|
|
65
70
|
// Inside a week of expiry Vs Spot is the figure to read, so a curve with such a contract keeps it.
|
|
66
71
|
const SHORT_DATED_DROP_ORDER = BASIS_DROP_ORDER.filter((id) => id !== "vsSpot");
|
|
67
72
|
const NO_SYMBOLS: string[] = [];
|
|
@@ -215,7 +220,7 @@ function FuturesCurveView({ width, height, focused, root, ownsTitle, standInNote
|
|
|
215
220
|
const shown = (list: DataTableColumn[]) => list.filter((entry) => !(settlesOnly && entry.id === "price") && !(noNotice && entry.id === "notice"))
|
|
216
221
|
.map((entry) => entry.id === "settle" ? { ...entry, label: settleLabel } : entry);
|
|
217
222
|
// A curve that only settles keeps its settlement: it is the price.
|
|
218
|
-
const order = (list:
|
|
223
|
+
const order = (list: DropOrder) => settlesOnly ? list.filter((id) => id !== "settle") : list;
|
|
219
224
|
return !curveTab ? fitChartTableColumns(shown(COLUMNS), width, order(CONTRACTS_DROP_ORDER))
|
|
220
225
|
: basisActive ? fitChartTableColumns(shown(BASIS_CURVE_COLUMNS), width, order(shortDated ? SHORT_DATED_DROP_ORDER : BASIS_DROP_ORDER))
|
|
221
226
|
: fitChartTableColumns(shown(CURVE_COLUMNS), width, order(CURVE_DROP_ORDER));
|
|
@@ -324,6 +329,7 @@ function FuturesCurveView({ width, height, focused, root, ownsTitle, standInNote
|
|
|
324
329
|
}
|
|
325
330
|
if (column.id === "percentile") return { text: row.samples < 2 || row.percentile == null ? MISSING_VALUE : row.percentile.toFixed(0) };
|
|
326
331
|
if (column.id === "oi") return { text: integer(row.openInterest) };
|
|
332
|
+
if (column.id === "oiDate") return { text: curveInterestDate(row), color: colors.textMuted };
|
|
327
333
|
if (column.id === "volume") return { text: integer(row.volume) };
|
|
328
334
|
// A month with no trade since the settlement it shows is dated by that settlement, as the curve marks it.
|
|
329
335
|
const settled = data && !requestedDate ? curveSettleShown(row, data) : null;
|
|
@@ -45,7 +45,7 @@ const settleColumns = [
|
|
|
45
45
|
export const gpuHeadless: HeadlessPaneDefinition<"bundle"> = {
|
|
46
46
|
// Observed rental prices; the Equities tab's quotes keep their market line.
|
|
47
47
|
shape: "bundle", freshness: { dataset: true }, argument: { kind: "free-text", optional: true, placeholder: "GPU", description: "GPU model, such as H100, h-100 or B200." },
|
|
48
|
-
options: [{ key: "tab", type: "enum", values: GPU_TABS
|
|
48
|
+
options: [{ key: "tab", type: "enum", values: [...GPU_TABS], defaultValue: "board", description: "Board, sourced history, dated changes or related equities." }],
|
|
49
49
|
discovery: { aliases: ["GPU"], dataRequirements: ["GPU rental price observations"],
|
|
50
50
|
limitations: ["List prices, provider-declared spot and asks are distinct bases.",
|
|
51
51
|
"Hyperscaler and Neocloud rows are list indexes: the median of the providers' list prices linked over time, so a provider joining or leaving causes no jump; sample.rawMedian is the raw median of today's providers and can differ slightly.",
|
|
@@ -355,7 +355,7 @@ export function gpuHistoryViewport(series: readonly ResolvedSeries[]): { start:
|
|
|
355
355
|
export const gpuProvenanceLabel = (point: Pick<GpuObservation, "provenance">, full = false) =>
|
|
356
356
|
point.provenance === "reference" ? full ? "Reference index (third party), anonymised" : "Reference"
|
|
357
357
|
: point.provenance === "archive" ? full ? "archived page, reconstructed" : "Archived"
|
|
358
|
-
: point.provenance === "official-history" ? full ? "official published history" : "Published" : full ? "
|
|
358
|
+
: point.provenance === "official-history" ? full ? "official published history" : "Published" : full ? "observed price" : "Observed";
|
|
359
359
|
|
|
360
360
|
export interface GpuPricePeriod { from: string; to: string; price: number; change: number | null; provenance: GpuObservation["provenance"] }
|
|
361
361
|
|
|
@@ -11,6 +11,8 @@ import { usageFunctionForPane } from "../../../telemetry/usage-counts";
|
|
|
11
11
|
import type { CommandDef, PaneTemplateDef } from "../../../types/plugin";
|
|
12
12
|
import type { PaneInstanceConfig } from "../../../types/config";
|
|
13
13
|
import type { PluginRegistry } from "../../registry";
|
|
14
|
+
import { glossaryNamesFunction } from "../../../cli/glossary";
|
|
15
|
+
import { functionQueryTerms, matchesFunctionPhrase, paneTemplateSearchFields } from "../../../utils/function-search";
|
|
14
16
|
|
|
15
17
|
export interface HelpFunction {
|
|
16
18
|
/** The primary mnemonic: CTM for CT. */
|
|
@@ -20,6 +22,7 @@ export interface HelpFunction {
|
|
|
20
22
|
description: string;
|
|
21
23
|
/** Other mnemonics that open it. */
|
|
22
24
|
aliases: string[];
|
|
25
|
+
searchFields: readonly string[];
|
|
23
26
|
/** The pane it opens, when it opens one. */
|
|
24
27
|
paneId?: string;
|
|
25
28
|
argPlaceholder?: string;
|
|
@@ -33,6 +36,7 @@ export interface HelpFunctionSources {
|
|
|
33
36
|
commands?: readonly Command[];
|
|
34
37
|
pluginCommands: Iterable<CommandDef>;
|
|
35
38
|
paneTemplates: Iterable<PaneTemplateDef>;
|
|
39
|
+
panes?: PluginRegistry["panes"];
|
|
36
40
|
}
|
|
37
41
|
|
|
38
42
|
/** Every mnemonic and alias, upper-cased, to the function it runs. */
|
|
@@ -73,6 +77,7 @@ export function buildHelpFunctionIndex(sources: HelpFunctionSources): HelpFuncti
|
|
|
73
77
|
name: command.label,
|
|
74
78
|
description: command.description,
|
|
75
79
|
aliases,
|
|
80
|
+
searchFields: [],
|
|
76
81
|
paneId: COMMAND_PANES[command.id],
|
|
77
82
|
argPlaceholder: command.hasArg ? command.argPlaceholder : undefined,
|
|
78
83
|
...(command.listed === false ? { unlisted: true as const } : {}),
|
|
@@ -86,6 +91,7 @@ export function buildHelpFunctionIndex(sources: HelpFunctionSources): HelpFuncti
|
|
|
86
91
|
name: command.label,
|
|
87
92
|
description: command.description ?? "",
|
|
88
93
|
aliases: [],
|
|
94
|
+
searchFields: command.keywords ?? [],
|
|
89
95
|
argPlaceholder: command.shortcutArg?.placeholder,
|
|
90
96
|
}));
|
|
91
97
|
}
|
|
@@ -97,6 +103,7 @@ export function buildHelpFunctionIndex(sources: HelpFunctionSources): HelpFuncti
|
|
|
97
103
|
name: template.label,
|
|
98
104
|
description: template.description,
|
|
99
105
|
aliases: (template.shortcut?.aliases ?? []).map(normalizeToken).filter(Boolean),
|
|
106
|
+
searchFields: paneTemplateSearchFields(template, sources.panes?.get(template.paneId)),
|
|
100
107
|
paneId: template.paneId,
|
|
101
108
|
argPlaceholder: template.shortcut?.argPlaceholder
|
|
102
109
|
?? (template.shortcut?.argKind === "ticker-list" ? "tickers" : template.shortcut?.argKind),
|
|
@@ -116,11 +123,12 @@ export function buildHelpFunctionIndex(sources: HelpFunctionSources): HelpFuncti
|
|
|
116
123
|
|
|
117
124
|
/** The index for what is registered right now, built-in and installed plugins alike. */
|
|
118
125
|
export function buildRegistryHelpIndex(
|
|
119
|
-
registry: Pick<PluginRegistry, "commands" | "paneTemplates"
|
|
126
|
+
registry: Pick<PluginRegistry, "commands" | "paneTemplates"> & Partial<Pick<PluginRegistry, "panes">>,
|
|
120
127
|
): HelpFunctionIndex {
|
|
121
128
|
return buildHelpFunctionIndex({
|
|
122
129
|
pluginCommands: registry.commands.values(),
|
|
123
130
|
paneTemplates: registry.paneTemplates.values(),
|
|
131
|
+
panes: registry.panes,
|
|
124
132
|
});
|
|
125
133
|
}
|
|
126
134
|
|
|
@@ -140,18 +148,18 @@ export type HelpRequest =
|
|
|
140
148
|
|
|
141
149
|
const MAX_SEARCH_MATCHES = 8;
|
|
142
150
|
|
|
143
|
-
function searchScore(fn: HelpFunction, terms: string[]): number {
|
|
151
|
+
function searchScore(fn: HelpFunction, terms: string[], query: string): number {
|
|
144
152
|
const name = fn.name.toLowerCase();
|
|
145
|
-
const text =
|
|
153
|
+
const text = [name, fn.description, fn.help?.summary ?? "", ...fn.aliases, ...fn.searchFields].join(" ");
|
|
146
154
|
// "options" is OMON before it is Options Flow.
|
|
147
155
|
let score = name === terms.join(" ") ? 4 : 0;
|
|
148
156
|
for (const term of terms) {
|
|
149
157
|
const upper = term.toUpperCase();
|
|
150
158
|
if (fn.code === upper || fn.aliases.includes(upper)) score += 8;
|
|
151
159
|
else if (fn.code.startsWith(upper)) score += 4;
|
|
152
|
-
else if (name
|
|
153
|
-
else if (text
|
|
154
|
-
else return 0;
|
|
160
|
+
else if (matchesFunctionPhrase(name, term)) score += 3;
|
|
161
|
+
else if (matchesFunctionPhrase(text, term)) score += 1;
|
|
162
|
+
else return glossaryNamesFunction(fn.code, query) ? 1 : 0;
|
|
155
163
|
}
|
|
156
164
|
return score;
|
|
157
165
|
}
|
|
@@ -168,10 +176,10 @@ export function parseHelpArgument(arg: string, index: HelpFunctionIndex): HelpRe
|
|
|
168
176
|
?? index.get(normalizeToken(query.split(/\s+/)[0] ?? ""));
|
|
169
177
|
if (exact) return exact.code === HELP_CODE ? { kind: "support" } : { kind: "function", fn: exact };
|
|
170
178
|
|
|
171
|
-
const terms = query
|
|
179
|
+
const terms = functionQueryTerms(query);
|
|
172
180
|
const matches = listHelpFunctions(index)
|
|
173
181
|
.filter((fn) => fn.code !== HELP_CODE && !fn.unlisted)
|
|
174
|
-
.map((fn) => ({ fn, score: searchScore(fn, terms) }))
|
|
182
|
+
.map((fn) => ({ fn, score: searchScore(fn, terms, query) }))
|
|
175
183
|
.filter(({ score }) => score > 0)
|
|
176
184
|
.sort((left, right) => right.score - left.score || left.fn.code.localeCompare(right.fn.code))
|
|
177
185
|
.slice(0, MAX_SEARCH_MATCHES)
|
|
@@ -20,6 +20,8 @@ import {
|
|
|
20
20
|
import { t } from "../../../i18n";
|
|
21
21
|
import { useThemeColors } from "../../../theme/theme-context";
|
|
22
22
|
import { useUiCapabilities } from "../../../ui";
|
|
23
|
+
import { glossaryNamesFunction } from "../../../cli/glossary";
|
|
24
|
+
import { matchesFunctionSearch } from "../../../utils/function-search";
|
|
23
25
|
import { groupShortcutEntries, type HelpShortcutEntry } from "./shortcut-model";
|
|
24
26
|
import { badgeCell, badgeColumnWidth, helpRowLines, helpTextWidth, type HelpRowLine } from "./table-cells";
|
|
25
27
|
|
|
@@ -31,6 +33,7 @@ interface FunctionEntry {
|
|
|
31
33
|
prefix: string[];
|
|
32
34
|
argument: string;
|
|
33
35
|
description: string;
|
|
36
|
+
searchFields: readonly string[];
|
|
34
37
|
/** The terminal's line of the row this row draws (helpRowLines). */
|
|
35
38
|
line?: HelpRowLine;
|
|
36
39
|
}
|
|
@@ -59,14 +62,13 @@ function toEntries(entries: HelpShortcutEntry[], namespace: string): FunctionEnt
|
|
|
59
62
|
id: `${namespace}:${entry.id}`,
|
|
60
63
|
...splitEntryBadges(entry.badges),
|
|
61
64
|
description: entry.description,
|
|
65
|
+
searchFields: entry.searchFields ?? [],
|
|
62
66
|
}));
|
|
63
67
|
}
|
|
64
68
|
|
|
65
|
-
/** Matches the typed text against FN, ARG and OPENS, as the user reads them. */
|
|
66
69
|
function matchesQuery(entry: FunctionEntry, needle: string): boolean {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
.some((text) => text.toLowerCase().includes(needle));
|
|
70
|
+
return matchesFunctionSearch(needle, [...entry.prefix, entry.argument, entry.description, t(entry.description), ...entry.searchFields])
|
|
71
|
+
|| entry.prefix.some((code) => glossaryNamesFunction(code, needle));
|
|
70
72
|
}
|
|
71
73
|
|
|
72
74
|
export function FunctionsTable({
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { CommandDef } from "../../../types/plugin";
|
|
2
|
-
import { commands as coreCommands } from "../../../components/command-bar/commands/registry";
|
|
2
|
+
import { commands as coreCommands, getCommandPrefixes } from "../../../components/command-bar/commands/registry";
|
|
3
|
+
import { paneTemplateSearchFields } from "../../../utils/function-search";
|
|
3
4
|
import { getSharedRegistry } from "../../registry";
|
|
4
5
|
|
|
5
6
|
export interface HelpShortcutEntry {
|
|
@@ -7,6 +8,7 @@ export interface HelpShortcutEntry {
|
|
|
7
8
|
badges: string[];
|
|
8
9
|
description: string;
|
|
9
10
|
category: string;
|
|
11
|
+
searchFields?: readonly string[];
|
|
10
12
|
}
|
|
11
13
|
|
|
12
14
|
type SharedRegistry = ReturnType<typeof getSharedRegistry>;
|
|
@@ -34,6 +36,7 @@ export function resolveWindowTemplates(registry: SharedRegistry): HelpShortcutEn
|
|
|
34
36
|
shortcut.argPlaceholder ? `<${shortcut.argPlaceholder}>` : null,
|
|
35
37
|
].filter((value): value is string => !!value),
|
|
36
38
|
description: template.label,
|
|
39
|
+
searchFields: paneTemplateSearchFields(template, registry.panes?.get(template.paneId)),
|
|
37
40
|
category: pluginName ?? "Core Panes",
|
|
38
41
|
};
|
|
39
42
|
})
|
|
@@ -64,7 +67,7 @@ function sortShortcutEntries(left: HelpShortcutEntry, right: HelpShortcutEntry):
|
|
|
64
67
|
|
|
65
68
|
export function resolveCommandShortcuts(registry: SharedRegistry): HelpShortcutEntry[] {
|
|
66
69
|
const coreRows: HelpShortcutEntry[] = coreCommands
|
|
67
|
-
.filter((command) => command.prefix.trim().length > 0)
|
|
70
|
+
.filter((command) => command.prefix.trim().length > 0 && command.listed !== false)
|
|
68
71
|
.map((command) => ({
|
|
69
72
|
id: `core:${command.id}`,
|
|
70
73
|
badges: [
|
|
@@ -72,6 +75,7 @@ export function resolveCommandShortcuts(registry: SharedRegistry): HelpShortcutE
|
|
|
72
75
|
formatPlaceholder(command.argPlaceholder),
|
|
73
76
|
].filter((value): value is string => !!value),
|
|
74
77
|
description: command.description,
|
|
78
|
+
searchFields: [command.label, ...getCommandPrefixes(command)],
|
|
75
79
|
category: command.category,
|
|
76
80
|
}));
|
|
77
81
|
|
|
@@ -96,6 +100,7 @@ export function resolveCommandShortcuts(registry: SharedRegistry): HelpShortcutE
|
|
|
96
100
|
formatPlaceholder(command.shortcutArg?.placeholder),
|
|
97
101
|
].filter((value): value is string => !!value),
|
|
98
102
|
description: formatShortcutDescription(command.label),
|
|
103
|
+
searchFields: [command.description ?? "", ...command.keywords ?? []],
|
|
99
104
|
category: pluginName ?? command.category,
|
|
100
105
|
};
|
|
101
106
|
})
|
|
@@ -6,6 +6,7 @@ import type {
|
|
|
6
6
|
import { loadHolderSnapshot } from "./client";
|
|
7
7
|
import { holderValueCurrency } from "./format";
|
|
8
8
|
import { logFailure } from "../../../utils/log-failure";
|
|
9
|
+
import { isPermanentClientError } from "../../../api-client/errors";
|
|
9
10
|
import type { HolderData } from "../../../types/financials";
|
|
10
11
|
import { SEC_FILING_ROWS, SEC_FILINGS } from "../shared/report-freshness";
|
|
11
12
|
import type { BeneficialOwnersPayload } from "../../../api-client/beneficial-owners";
|
|
@@ -86,6 +87,9 @@ export interface HoldersHeadlessDependencies {
|
|
|
86
87
|
): Promise<IndexedHolderList>;
|
|
87
88
|
}
|
|
88
89
|
|
|
90
|
+
/** Said when a US listing's 13F holder index could not be read, so the source's short list answers in its place. */
|
|
91
|
+
const INDEX_UNREAD_NOTE = "The 13F holder index could not be read: this is the source's short list of the largest holders, not every filer.";
|
|
92
|
+
|
|
89
93
|
const defaultDependencies: HoldersHeadlessDependencies = {
|
|
90
94
|
loadSnapshot: (symbol, _args, ctx) => loadHolderSnapshot(ctx.marketData, symbol),
|
|
91
95
|
// A listing abroad names its venue and company, so it never reads a US namesake's owners.
|
|
@@ -236,7 +240,11 @@ export function createHoldersHeadless(
|
|
|
236
240
|
throw error;
|
|
237
241
|
}),
|
|
238
242
|
indexTicker
|
|
239
|
-
? dependencies.loadIndexedHolders(indexTicker, limit, ctx).catch(
|
|
243
|
+
? dependencies.loadIndexedHolders(indexTicker, limit, ctx).catch((error: unknown) => {
|
|
244
|
+
logFailure("holders.headless", "Load 13F holder index failed")(error);
|
|
245
|
+
// An index that does not list the ticker leaves the source's list as the answer; one that could not be read is a gap.
|
|
246
|
+
return isPermanentClientError(error) ? null : "unread" as const;
|
|
247
|
+
})
|
|
240
248
|
: null,
|
|
241
249
|
]);
|
|
242
250
|
// A fund has no ownership breakdown, and a listing may have no holders on record: the report says so
|
|
@@ -251,11 +259,14 @@ export function createHoldersHeadless(
|
|
|
251
259
|
};
|
|
252
260
|
}
|
|
253
261
|
const { marketCap } = snapshot;
|
|
254
|
-
const
|
|
255
|
-
const
|
|
262
|
+
const indexes = indexHolderTicker(symbol, exchange, snapshot.data) != null;
|
|
263
|
+
const list = index === "unread" ? null : index;
|
|
264
|
+
const indexed = !!list?.rows.length && indexes;
|
|
265
|
+
const partialNote = indexed ? indexedHoldersPartialNote(list, limit)
|
|
266
|
+
: index === "unread" && indexes ? INDEX_UNREAD_NOTE : null;
|
|
256
267
|
// Pages hold 25; another order ranks the largest `limit`, not whatever the last page held past them.
|
|
257
268
|
const data = indexed
|
|
258
|
-
? withIndexedHolders(snapshot.data, indexTicker!, { ...
|
|
269
|
+
? withIndexedHolders(snapshot.data, indexTicker!, { ...list!, rows: list!.rows.slice(0, limit) }, indexedHolderUnits(snapshot.data, snapshot.price))
|
|
259
270
|
: snapshot.data;
|
|
260
271
|
const currency = data.currency ?? "USD";
|
|
261
272
|
// A London line's values can be dollars from the 13F filings; they are labelled and formatted as such.
|
|
@@ -270,7 +281,7 @@ export function createHoldersHeadless(
|
|
|
270
281
|
const { notices, valueBasis, positionsBasis, changeReported } = holderReportNotices({
|
|
271
282
|
data, requested: symbol, shown: rows, reported: sorted.length, total, sort, indexed,
|
|
272
283
|
});
|
|
273
|
-
const fallback = quarterFallbackText(indexed ?
|
|
284
|
+
const fallback = quarterFallbackText(indexed ? list : null);
|
|
274
285
|
return {
|
|
275
286
|
// A change column that is empty on every row says nothing; the notices explain it once.
|
|
276
287
|
columns: holderReportColumns(rows, valueCurrency),
|
|
@@ -15,10 +15,15 @@ import {
|
|
|
15
15
|
} from "../../../components";
|
|
16
16
|
import { ClippedText } from "../../../components/ui/display";
|
|
17
17
|
import { useCompanyDataFooter } from "../../../components/layout/pane/status-footer";
|
|
18
|
+
import { footerTimeText, type PaneFooterSegment } from "../../../components/layout/pane/footer";
|
|
19
|
+
import { usePaneCapture } from "../../../components/layout/pane/capture-status";
|
|
18
20
|
import { handleRefreshKey, loadingErrorFooterInfo } from "../../../components/data-table/table-pane";
|
|
19
21
|
import { useAsyncResource } from "../../../react/async-resource";
|
|
20
22
|
import { cachedValueForDisplay } from "../../../data/cached-query";
|
|
21
23
|
import { useCloudDisplayScope } from "../../../api-client/plan-access";
|
|
24
|
+
import { isPermanentClientError } from "../../../api-client/errors";
|
|
25
|
+
import { isNetworkFailure } from "../../../utils/network-failure";
|
|
26
|
+
import { useRemoteUiNode } from "../../../remote/semantic-tree";
|
|
22
27
|
import { useShortcut } from "../../../react/input";
|
|
23
28
|
import { colors, priceColor } from "../../../theme/colors";
|
|
24
29
|
import type { HolderData } from "../../../types/financials";
|
|
@@ -97,8 +102,30 @@ export function holderNameCell(
|
|
|
97
102
|
};
|
|
98
103
|
}
|
|
99
104
|
|
|
105
|
+
/** What the footer and a report say of the source's short list standing in for a 13F holder index that could not be read. */
|
|
106
|
+
const INDEX_UNREAD = "holder index could not be read; short list";
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* The footer's segment for the source's short list standing in for a 13F
|
|
110
|
+
* holder index that could not be read: what the rows are, and when the list
|
|
111
|
+
* was read (`readAt`). When the list is itself a saved copy, the saved copy's
|
|
112
|
+
* own segment says when, and a capture's status line says it in UTC.
|
|
113
|
+
*/
|
|
114
|
+
function indexUnreadFooter(readAt: number | null, savedCopy: boolean, now = Date.now()): PaneFooterSegment {
|
|
115
|
+
const when = !savedCopy && readAt !== null ? ` from ${footerTimeText(readAt, now)}` : "";
|
|
116
|
+
return {
|
|
117
|
+
id: "index-unread",
|
|
118
|
+
// A picture of the rows cannot say they are not every filer.
|
|
119
|
+
capture: true,
|
|
120
|
+
title: "The 13F holder index could not be read: this is the short list of the largest holders, not every filer.",
|
|
121
|
+
parts: [{ text: `${INDEX_UNREAD}${when}`, tone: "warning" }],
|
|
122
|
+
variants: [[{ text: `short list${when}`, tone: "warning" }]],
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
|
|
100
126
|
export function HoldersView({ focused, width, height }: { focused: boolean; width: number; height: number }) {
|
|
101
127
|
const { nativePaneChrome } = useUiCapabilities();
|
|
128
|
+
const capture = usePaneCapture();
|
|
102
129
|
const { symbol, ticker, financials } = usePaneTicker();
|
|
103
130
|
const dataProvider = useAssetData();
|
|
104
131
|
const scope = useCloudDisplayScope();
|
|
@@ -121,7 +148,7 @@ export function HoldersView({ focused, width, height }: { focused: boolean; widt
|
|
|
121
148
|
throw isNoHoldersAnswer(error) ? new Error(noHoldersText(symbol, exchange, savedCurrency)) : error;
|
|
122
149
|
});
|
|
123
150
|
} : null, [dataProvider, exchange, savedCurrency, symbol]);
|
|
124
|
-
const { data, loading, error, reload } = useAsyncResource<HolderData>(loadHolders, {
|
|
151
|
+
const { data, loading, error, reload, updatedAt, savedAt } = useAsyncResource<HolderData>(loadHolders, {
|
|
125
152
|
keepPreviousData: scope,
|
|
126
153
|
initialData: () => scope && symbol && dataProvider?.getCachedQuery
|
|
127
154
|
? cachedValueForDisplay(dataProvider.getCachedQuery("getHolders", [symbol, exchange]).getSnapshot().result)
|
|
@@ -143,6 +170,10 @@ export function HoldersView({ focused, width, height }: { focused: boolean; widt
|
|
|
143
170
|
const base = data && indexHolderTicker(data.symbol) === indexTicker ? data : null;
|
|
144
171
|
const indexed = index.rows.length > 0 && (!!base || !loading) && indexHolderTicker(symbol, exchange, base) != null;
|
|
145
172
|
const indexPending = !!indexTicker && index.loading && index.rows.length === 0;
|
|
173
|
+
// The index could not be read, as opposed to not listing the ticker: the source's short list stands in.
|
|
174
|
+
const indexUnread = !!indexTicker && !indexed && index.error !== null && !isPermanentClientError(index.error);
|
|
175
|
+
// Nor could the data service be reached, which every 13F name lookup would ask in turn.
|
|
176
|
+
const serviceUnreached = indexUnread && isNetworkFailure(index.error);
|
|
146
177
|
// Index rows take the source's price; the quote's only when the source gave none, sampled so ticks do not re-sort.
|
|
147
178
|
// The rows follow the units in use, so a quote that is not the price used leaves them as they are.
|
|
148
179
|
const quotePrice = useSampledValue(financials?.quote?.price, HOLDER_MARKET_CAP_SAMPLE_MS, symbol ?? "");
|
|
@@ -172,6 +203,12 @@ export function HoldersView({ focused, width, height }: { focused: boolean; widt
|
|
|
172
203
|
const sharesOutstanding = classSharesToday(financials);
|
|
173
204
|
const sharesOutstandingAsOf = classSharesAsOf(financials);
|
|
174
205
|
const rows = useMemo(() => buildRows(listData), [listData]);
|
|
206
|
+
const shortListShown = indexUnread && rows.length > 0;
|
|
207
|
+
// A report of the view says so after its date, which is the short list's.
|
|
208
|
+
useRemoteUiNode(shortListShown && viewMode !== "13dg" ? {
|
|
209
|
+
role: "report-freshness", label: "Holder list",
|
|
210
|
+
getMetadata: () => ({ note: INDEX_UNREAD, noteVariants: ["short list"] }),
|
|
211
|
+
} : null);
|
|
175
212
|
const periodsDiffer = useMemo(() => holderPeriodsDiffer(rows), [rows]);
|
|
176
213
|
const sortedRows = useMemo(() => sortRows(rows, sortPreference, marketCap), [marketCap, rows, sortPreference]);
|
|
177
214
|
// Change columns only when the source reports a change; otherwise every row would read as missing.
|
|
@@ -200,8 +237,8 @@ export function HoldersView({ focused, width, height }: { focused: boolean; widt
|
|
|
200
237
|
return;
|
|
201
238
|
}
|
|
202
239
|
setFundMatches(new Map());
|
|
203
|
-
// The source's rows are not matched while the index's may replace them.
|
|
204
|
-
if (rows.length === 0 || indexPending) {
|
|
240
|
+
// The source's rows are not matched while the index's may replace them, nor by a service that does not answer.
|
|
241
|
+
if (rows.length === 0 || indexPending || serviceUnreached) {
|
|
205
242
|
setFundMatching(false);
|
|
206
243
|
return;
|
|
207
244
|
}
|
|
@@ -226,7 +263,7 @@ export function HoldersView({ focused, width, height }: { focused: boolean; widt
|
|
|
226
263
|
fundMatchAbortRef.current = null;
|
|
227
264
|
}
|
|
228
265
|
};
|
|
229
|
-
}, [indexPending, rows]);
|
|
266
|
+
}, [indexPending, rows, serviceUnreached]);
|
|
230
267
|
|
|
231
268
|
const selectedRow = activeIdx >= 0 ? sortedRows[activeIdx] ?? null : null;
|
|
232
269
|
const selectedFundMatch = selectedRow ? fundMatches.get(selectedRow.id) ?? null : null;
|
|
@@ -367,6 +404,7 @@ export function HoldersView({ focused, width, height }: { focused: boolean; widt
|
|
|
367
404
|
? [{ id: "more-error", parts: [{ text: "more holders could not be read", tone: "warning" as const }] }]
|
|
368
405
|
: []),
|
|
369
406
|
...(fundMatching ? [{ id: "fund-matching", parts: [{ text: "13F matching", tone: "muted" as const }] }] : []),
|
|
407
|
+
...(shortListShown ? [indexUnreadFooter(capture ? null : updatedAt, savedAt !== null)] : []),
|
|
370
408
|
],
|
|
371
409
|
// The title-bar tabs (or the query bar inside Ticker Research) switch
|
|
372
410
|
// views, so the footer only carries the fund action.
|
|
@@ -375,7 +413,7 @@ export function HoldersView({ focused, width, height }: { focused: boolean; widt
|
|
|
375
413
|
...(selectedFundMatch ? [{ id: "fund", key: "o", label: "pen 13F", onPress: () => openFundDetail(selectedRow) }] : []),
|
|
376
414
|
],
|
|
377
415
|
};
|
|
378
|
-
}, [data, error, fundMatching, index.loadingMore, index.moreError, index.pages, indexed, indexPending, listData, loading, openFundDetail, periodsDiffer, selectedFundMatch, selectedRow, viewMode]);
|
|
416
|
+
}, [capture, data, error, fundMatching, index.loadingMore, index.moreError, index.pages, indexed, indexPending, listData, loading, openFundDetail, periodsDiffer, savedAt, selectedFundMatch, selectedRow, shortListShown, updatedAt, viewMode]);
|
|
379
417
|
|
|
380
418
|
const selectView = useCallback((value: string) => setViewMode(value as ViewMode), [setViewMode]);
|
|
381
419
|
// As a research tab, h/l move between research tabs; `s` switches the view.
|