gloomberb 0.20.2 → 0.20.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/README.zh-CN.md +1 -1
- package/package.json +2 -1
- package/src/account/auth-dialog.tsx +17 -0
- package/src/account/auth-form.tsx +13 -8
- package/src/account/upgrade-dialog.tsx +1 -1
- package/src/api-client/central-bank-rates.ts +5 -0
- package/src/api-client/data.ts +23 -4
- package/src/api-client/debt-maturities.ts +45 -2
- package/src/api-client/earnings.ts +4 -2
- package/src/api-client/errors.ts +21 -11
- package/src/api-client/fx-interventions.ts +64 -0
- package/src/api-client/index.ts +2 -0
- package/src/api-client/paths.ts +9 -1
- package/src/api-client/release-summaries.ts +21 -0
- package/src/api-client/social-mentions.ts +47 -0
- package/src/api-client/types/econ.ts +4 -0
- package/src/app/keybindings/actions.ts +2 -2
- package/src/app/pane-runtime/ticker-open-runtime.ts +245 -66
- package/src/app.tsx +11 -1
- package/src/cli/command-options.ts +2 -1
- package/src/cli/commands/market.ts +188 -30
- package/src/cli/commands/news-search.ts +1 -3
- package/src/cli/commands/options-chain.ts +23 -6
- package/src/cli/commands/overview.ts +13 -5
- package/src/cli/commands/plugins.ts +76 -23
- package/src/cli/commands/search.ts +25 -6
- package/src/cli/commands/system.ts +19 -3
- package/src/cli/commands/ticker.ts +64 -21
- package/src/cli/fx-quote-rate.ts +49 -1
- package/src/cli/glossary.ts +95 -15
- package/src/cli/history-rows.ts +9 -25
- package/src/cli/index.ts +14 -46
- package/src/cli/known-gaps.ts +3 -3
- package/src/cli/listing-arg.ts +78 -18
- package/src/cli/name-entries.ts +3 -2
- package/src/cli/not-a-ticker.ts +6 -2
- package/src/cli/pane-functions/capabilities.ts +12 -1
- package/src/cli/pane-functions/function-help.ts +26 -14
- package/src/cli/pane-functions/headless.ts +3 -1
- package/src/cli/pane-functions/index.ts +32 -4
- package/src/cli/pane-functions/market-session.ts +8 -3
- package/src/cli/pane-functions/resolver.ts +18 -11
- package/src/cli/pane-functions/screenshot-payload.ts +36 -6
- package/src/cli/pane-functions/screenshot-render.ts +4 -0
- package/src/cli/quote-answer.ts +10 -0
- package/src/cli/report-tables.ts +40 -8
- package/src/cli/result.ts +21 -9
- package/src/cli/spreadsheet-hint.ts +43 -0
- package/src/cli/symbol-list.ts +58 -4
- package/src/cli/symbol-rows.ts +49 -2
- package/src/cli/ticker-resolution.ts +98 -5
- package/src/cli/types.ts +2 -0
- package/src/cli/unknown-command.ts +88 -0
- package/src/components/chart/composite/axis-overlays.tsx +22 -0
- package/src/components/chart/composite/composite-chart.tsx +54 -13
- package/src/components/chart/composite/event-captions.ts +109 -0
- package/src/components/chart/composite/event-guides.ts +74 -0
- package/src/components/chart/composite/rasterizer.ts +2 -0
- package/src/components/chart/composite/text-renderer.ts +2 -0
- package/src/components/chart/composite/types.ts +31 -0
- package/src/components/command-bar/assist/model.ts +6 -1
- package/src/components/command-bar/commands/direct/index.ts +9 -1
- package/src/components/command-bar/commands/registry.ts +18 -0
- package/src/components/command-bar/layout-items/focused-pane.ts +5 -5
- package/src/components/command-bar/pane-actions.ts +30 -13
- package/src/components/command-bar/panel/index.tsx +6 -3
- package/src/components/command-bar/panel/prompt-binding.ts +4 -0
- package/src/components/command-bar/panel/types.ts +3 -0
- package/src/components/command-bar/routes/header-market.ts +108 -0
- package/src/components/command-bar/routes/root/command-items.ts +5 -0
- package/src/components/command-bar/routes/root/provider-search.ts +192 -33
- package/src/components/command-bar/routes/root/results.ts +3 -0
- package/src/components/command-bar/routes/root/runtime.ts +28 -5
- package/src/components/command-bar/routes/ticker-search/results.ts +104 -6
- package/src/components/command-bar/routes/ticker-search/route.ts +3 -2
- package/src/components/command-bar/routing/list-state.ts +38 -0
- package/src/components/command-bar/selection-hint.ts +28 -0
- package/src/components/command-bar/surface/index.tsx +41 -3
- package/src/components/command-bar/view-model.ts +15 -0
- package/src/components/command-bar/workflow/tickers.ts +3 -2
- package/src/components/company-logo.tsx +20 -2
- package/src/components/data-table/export.ts +13 -8
- package/src/components/feedback-dialog.tsx +2 -1
- package/src/components/form-modal/field-row.tsx +2 -1
- package/src/components/input-search-bar.tsx +2 -2
- package/src/components/layout/detached-pane-shell.tsx +1 -1
- package/src/components/layout/double-escape-close.ts +8 -5
- package/src/components/layout/floating-pane.tsx +5 -1
- package/src/components/layout/header.tsx +75 -44
- package/src/components/layout/market-summary.ts +322 -116
- package/src/components/layout/pane/footer/index.tsx +44 -19
- package/src/components/layout/pane/footer/model.ts +52 -20
- package/src/components/layout/pane/header.tsx +3 -2
- package/src/components/layout/shell/action-menu-overlay.tsx +10 -5
- package/src/components/layout/shell/active-drag.ts +149 -105
- package/src/components/layout/shell/chrome.ts +15 -15
- package/src/components/layout/shell/drag/drop-zones.ts +162 -0
- package/src/components/layout/shell/drag/index.ts +47 -218
- package/src/components/layout/shell/drag/live.ts +10 -3
- package/src/components/layout/shell/drag/overlays.tsx +182 -5
- package/src/components/layout/shell/drag/runtime.ts +29 -6
- package/src/components/layout/shell/drag/shared-edges.ts +156 -0
- package/src/components/layout/shell/index.tsx +11 -6
- package/src/components/layout/shell/menu.ts +11 -2
- package/src/components/layout/shell/native/pointer-runtime.ts +25 -0
- package/src/components/layout/shell/native/window-state.ts +2 -2
- package/src/components/layout/shell/pane/layers.tsx +71 -7
- package/src/components/layout/shell/terminal-pointer-runtime.ts +18 -9
- package/src/components/layout/shell/window-mode/index.ts +8 -10
- package/src/components/layout/status-bar.tsx +8 -7
- package/src/components/layout/status-widget-space.ts +8 -0
- package/src/components/layout/window-edit/mode.ts +39 -7
- package/src/components/layout/window-edit/presentation.ts +1 -1
- package/src/components/markdown-editor.tsx +2 -2
- package/src/components/onboarding/account-step/form-panel.tsx +0 -3
- package/src/components/onboarding/onboarding-keyboard.ts +19 -6
- package/src/components/onboarding/onboarding-wizard.tsx +69 -14
- package/src/components/onboarding/portfolio-step/broker-fields-panel.tsx +0 -1
- package/src/components/onboarding/portfolio-step/positions-panel.tsx +0 -2
- package/src/components/price-sparkline/model.ts +26 -10
- package/src/components/ticker/list-table-view.tsx +29 -4
- package/src/components/ui/button.tsx +15 -2
- package/src/components/ui/choice-dialog.tsx +1 -0
- package/src/components/ui/column-grid.tsx +18 -9
- package/src/components/ui/data-table/index.tsx +5 -4
- package/src/components/ui/data-table/opentui/index.tsx +2 -1
- package/src/components/ui/data-table/types.ts +18 -0
- package/src/components/ui/delayed-mark.tsx +3 -2
- package/src/components/ui/field-grid.tsx +0 -2
- package/src/components/ui/fields.tsx +7 -4
- package/src/components/ui/inline-quick-add.tsx +2 -2
- package/src/components/ui/key-hint-words.ts +153 -0
- package/src/components/ui/key-hints.tsx +73 -0
- package/src/components/ui/list-view.tsx +7 -12
- package/src/components/ui/loading.tsx +10 -3
- package/src/components/ui/menu.tsx +9 -3
- package/src/components/ui/message-composer.tsx +2 -2
- package/src/components/ui/quote.ts +14 -1
- package/src/components/ui/shortcut-hint.tsx +28 -3
- package/src/components/ui/tabs.tsx +7 -0
- package/src/components/ui/text-prompt-dialog.tsx +2 -1
- package/src/core/state/app/command-bar-launch.ts +3 -0
- package/src/data/config/layout.ts +5 -2
- package/src/data/config/store/normalize.ts +6 -0
- package/src/docs/snapshot.json +149 -74
- package/src/i18n/es.ts +33 -9
- package/src/i18n/ja.ts +33 -9
- package/src/i18n/ko.ts +33 -9
- package/src/i18n/zh-cn.ts +33 -9
- package/src/i18n/zh-tw.ts +33 -9
- package/src/layout/pane-manager/floating-actions.ts +17 -0
- package/src/layout/pane-manager/floating-stack.ts +187 -0
- package/src/layout/pane-manager/floating.ts +4 -2
- package/src/layout/pane-manager/gridlock.ts +16 -1
- package/src/layout/pane-manager/index.ts +11 -0
- package/src/layout/pane-manager/layout-state.ts +10 -3
- package/src/market-data/bars-per-year.ts +27 -9
- package/src/market-data/coordinator/quotes.ts +22 -3
- package/src/market-data/futures-board.ts +126 -1
- package/src/market-data/futures-contract.ts +21 -6
- package/src/market-data/fx-interventions.ts +270 -0
- package/src/market-data/market/change-basis.ts +2 -2
- package/src/market-data/market/dated-previous-close.ts +163 -47
- package/src/market-data/market/format.ts +14 -3
- package/src/market-data/market/freshness.ts +24 -7
- package/src/market-data/market/header-market.ts +154 -0
- package/src/market-data/market/index-level.ts +29 -0
- package/src/market-data/market/index-session-venues.ts +44 -0
- package/src/market-data/market/status.ts +7 -2
- package/src/market-data/market/venue-session.ts +72 -0
- package/src/market-data/model-dividend-yield.ts +23 -8
- package/src/market-data/options-alternatives.ts +39 -4
- package/src/market-data/published-apac-sessions.ts +40 -2
- package/src/market-data/quotes/export-identity.ts +76 -0
- package/src/market-data/quotes/freshness.ts +22 -0
- package/src/market-data/quotes/time.ts +42 -1
- package/src/market-data/realized-volatility.ts +11 -7
- package/src/market-data/tax-equivalent.ts +145 -27
- package/src/news/news-model.ts +44 -2
- package/src/plugins/builtin/account-management/pane.tsx +2 -2
- package/src/plugins/builtin/alerts/alert-engine.ts +12 -6
- package/src/plugins/builtin/alerts/alert-log.ts +6 -2
- package/src/plugins/builtin/alerts/calendar-events.ts +74 -12
- package/src/plugins/builtin/alerts/cli-forms.ts +11 -1
- package/src/plugins/builtin/alerts/cli-move.ts +234 -0
- package/src/plugins/builtin/alerts/cli.ts +223 -32
- package/src/plugins/builtin/alerts/command.ts +33 -6
- package/src/plugins/builtin/alerts/event-rows.ts +18 -4
- package/src/plugins/builtin/alerts/events-pane.tsx +6 -2
- package/src/plugins/builtin/alerts/events.ts +9 -0
- package/src/plugins/builtin/alerts/format.ts +39 -15
- package/src/plugins/builtin/alerts/headless.ts +30 -18
- package/src/plugins/builtin/alerts/history.ts +1 -0
- package/src/plugins/builtin/alerts/index.tsx +86 -12
- package/src/plugins/builtin/alerts/live.ts +2 -1
- package/src/plugins/builtin/alerts/move-checks.ts +161 -0
- package/src/plugins/builtin/alerts/move.ts +181 -0
- package/src/plugins/builtin/alerts/pane.tsx +50 -22
- package/src/plugins/builtin/alerts/price-text.ts +62 -0
- package/src/plugins/builtin/alerts/price.ts +17 -0
- package/src/plugins/builtin/alerts/quotes.ts +84 -3
- package/src/plugins/builtin/alerts/scheduled-check.ts +7 -1
- package/src/plugins/builtin/alerts/storage.ts +22 -7
- package/src/plugins/builtin/alerts/types.ts +25 -0
- package/src/plugins/builtin/analytics/risk-client.ts +60 -39
- package/src/plugins/builtin/analytics/risk-episodes.ts +18 -0
- package/src/plugins/builtin/analytics/risk-headless.ts +20 -4
- package/src/plugins/builtin/analytics/risk-model.ts +68 -1
- package/src/plugins/builtin/analytics/risk-pane.tsx +15 -3
- package/src/plugins/builtin/backtest/engine.ts +4 -2
- package/src/plugins/builtin/backtest/window.ts +3 -1
- package/src/plugins/builtin/broker-manager/sign-in-end.ts +1 -1
- package/src/plugins/builtin/central-bank-rates/client.ts +4 -0
- package/src/plugins/builtin/central-bank-rates/headless.ts +1 -1
- package/src/plugins/builtin/central-bank-rates/model.ts +18 -8
- package/src/plugins/builtin/central-bank-rates/pane.tsx +6 -3
- package/src/plugins/builtin/changelog/index.tsx +292 -101
- package/src/plugins/builtin/changelog/versions.ts +293 -0
- package/src/plugins/builtin/chart-composer/cli-options.ts +5 -0
- package/src/plugins/builtin/chart-composer/headless-schema.ts +17 -1
- package/src/plugins/builtin/chart-composer/headless.ts +2 -0
- package/src/plugins/builtin/chart-composer/intervention-events.ts +105 -0
- package/src/plugins/builtin/chart-composer/pane.tsx +21 -7
- package/src/plugins/builtin/chat/message/render-state.ts +2 -5
- package/src/plugins/builtin/cloud/askg/attached-pane.tsx +10 -5
- package/src/plugins/builtin/cloud/askg/controller.ts +141 -5
- package/src/plugins/builtin/cloud/askg/executor.ts +113 -4
- package/src/plugins/builtin/cloud/askg/manifest.ts +28 -13
- package/src/plugins/builtin/cloud/askg/model.ts +14 -4
- package/src/plugins/builtin/cloud/askg/pane.tsx +70 -46
- package/src/plugins/builtin/cloud/askg/turn-parts.tsx +70 -0
- package/src/plugins/builtin/cloud/terminal-relay/engine.ts +50 -130
- package/src/plugins/builtin/cloud/terminal-relay/policy.ts +327 -7
- package/src/plugins/builtin/cloud/terminal-relay/prompts.tsx +2 -1
- package/src/plugins/builtin/cloud/terminal-relay/redact.ts +47 -6
- package/src/plugins/builtin/cloud/upgrade-status-widget.tsx +9 -2
- package/src/plugins/builtin/commodities-energy/index.tsx +1 -3
- package/src/plugins/builtin/commodities-energy/view-state.ts +3 -0
- package/src/plugins/builtin/cot/headless.ts +14 -2
- package/src/plugins/builtin/crypto-board/headless.ts +82 -17
- package/src/plugins/builtin/crypto-board/index.tsx +24 -2
- package/src/plugins/builtin/crypto-board/model.ts +5 -2
- package/src/plugins/builtin/crypto-board/pane.tsx +4 -1
- package/src/plugins/builtin/debt-maturities/client.ts +111 -6
- package/src/plugins/builtin/debt-maturities/headless.ts +84 -1
- package/src/plugins/builtin/debt-maturities/model.ts +97 -14
- package/src/plugins/builtin/debt-maturities/pane.tsx +165 -15
- package/src/plugins/builtin/debt-maturities/series.ts +3 -1
- package/src/plugins/builtin/dividend-yield/client.ts +22 -6
- package/src/plugins/builtin/dividend-yield/headless.ts +113 -46
- package/src/plugins/builtin/dividend-yield/model.ts +5 -2
- package/src/plugins/builtin/dividend-yield/pane.tsx +6 -3
- package/src/plugins/builtin/dividend-yield/ranking-reads.ts +11 -4
- package/src/plugins/builtin/dividend-yield/ranking.ts +113 -18
- package/src/plugins/builtin/dividend-yield/types.ts +2 -0
- package/src/plugins/builtin/dividend-yield/view.ts +3 -0
- package/src/plugins/builtin/earnings/index.tsx +2 -2
- package/src/plugins/builtin/econ/calendar-model.ts +21 -3
- package/src/plugins/builtin/econ/detail-view.tsx +5 -3
- package/src/plugins/builtin/econ/figures.ts +13 -0
- package/src/plugins/builtin/econ/fred-catalog.ts +6 -3
- package/src/plugins/builtin/econ/index.tsx +5 -3
- package/src/plugins/builtin/econ/types.ts +5 -0
- package/src/plugins/builtin/equity-screener/footer.ts +45 -0
- package/src/plugins/builtin/equity-screener/pane.tsx +4 -18
- package/src/plugins/builtin/equity-screener/ticker-check.tsx +2 -1
- package/src/plugins/builtin/fixed-income/model.ts +1 -0
- package/src/plugins/builtin/futures/index.tsx +25 -4
- package/src/plugins/builtin/futures/model.ts +28 -32
- package/src/plugins/builtin/futures/series.ts +4 -3
- package/src/plugins/builtin/futures/table.tsx +17 -10
- package/src/plugins/builtin/futures/use-board-terms.ts +3 -3
- package/src/plugins/builtin/futures-curve/model.ts +3 -10
- package/src/plugins/builtin/help/function-card.tsx +2 -1
- package/src/plugins/builtin/help/function-index.ts +1 -0
- package/src/plugins/builtin/help/index.tsx +3 -3
- package/src/plugins/builtin/help/keybindings-editor.tsx +18 -4
- package/src/plugins/builtin/insider/client.ts +31 -14
- package/src/plugins/builtin/insider/signals-model.ts +2 -7
- package/src/plugins/builtin/iv-history/headless.ts +1 -2
- package/src/plugins/builtin/iv-history/model.ts +33 -23
- package/src/plugins/builtin/iv-history/screen-pane.tsx +0 -3
- package/src/plugins/builtin/kelly-sizer/headless.ts +64 -16
- package/src/plugins/builtin/kelly-sizer/history.ts +37 -28
- package/src/plugins/builtin/kelly-sizer/pane.tsx +43 -10
- package/src/plugins/builtin/kelly-sizer/sections.tsx +7 -2
- package/src/plugins/builtin/kelly-sizer/units.ts +29 -0
- package/src/plugins/builtin/layout-manager/index.tsx +8 -8
- package/src/plugins/builtin/news/headless.ts +2 -2
- package/src/plugins/builtin/news/index.tsx +10 -16
- package/src/plugins/builtin/news/overview-headlines.tsx +117 -0
- package/src/plugins/builtin/news/ticker-news.ts +35 -0
- package/src/plugins/builtin/news/wire/news/detail-view.tsx +8 -6
- package/src/plugins/builtin/news/wire/news/row.ts +49 -0
- package/src/plugins/builtin/news/wire/news/table.tsx +9 -20
- package/src/plugins/builtin/options/analytics.ts +7 -2
- package/src/plugins/builtin/options/live-quotes.ts +6 -1
- package/src/plugins/builtin/options/table.ts +3 -2
- package/src/plugins/builtin/options/view.tsx +11 -9
- package/src/plugins/builtin/options-scenario/client.ts +3 -0
- package/src/plugins/builtin/options-scenario/headless.ts +1 -1
- package/src/plugins/builtin/perps/client.ts +5 -4
- package/src/plugins/builtin/perps/headless.ts +134 -124
- package/src/plugins/builtin/perps/markets-section.tsx +7 -4
- package/src/plugins/builtin/perps/model.ts +8 -4
- package/src/plugins/builtin/perps/open-market.ts +4 -4
- package/src/plugins/builtin/perps/venue-markets.ts +3 -6
- package/src/plugins/builtin/plugin-marketplace/pane.tsx +11 -11
- package/src/plugins/builtin/portfolio-list/cell-version.ts +1 -0
- package/src/plugins/builtin/portfolio-list/cli/bulk-symbols.ts +34 -10
- package/src/plugins/builtin/portfolio-list/cli/period-report.ts +28 -2
- package/src/plugins/builtin/portfolio-list/cli/portfolio-command.ts +7 -3
- package/src/plugins/builtin/portfolio-list/cli/render.ts +66 -22
- package/src/plugins/builtin/portfolio-list/grid.tsx +5 -3
- package/src/plugins/builtin/portfolio-list/pane/data.ts +34 -1
- package/src/plugins/builtin/portfolio-list/pane/index.tsx +6 -0
- package/src/plugins/builtin/portfolio-list/pane/streaming.ts +15 -6
- package/src/plugins/builtin/portfolio-list/quick-add/resolution.ts +19 -7
- package/src/plugins/builtin/portfolio-list/summary/index.tsx +3 -1
- package/src/plugins/builtin/portfolio-list/table.tsx +30 -4
- package/src/plugins/builtin/realized-vol/evidence.ts +33 -6
- package/src/plugins/builtin/realized-vol/fx-proxy.ts +135 -0
- package/src/plugins/builtin/realized-vol/headless.ts +44 -8
- package/src/plugins/builtin/realized-vol/model.ts +9 -5
- package/src/plugins/builtin/realized-vol/pane.tsx +49 -15
- package/src/plugins/builtin/research/event-model.ts +9 -1
- package/src/plugins/builtin/research/event-sources.ts +22 -0
- package/src/plugins/builtin/research/headless.ts +3 -3
- package/src/plugins/builtin/sec/headless.ts +48 -6
- package/src/plugins/builtin/sec/index.tsx +6 -4
- package/src/plugins/builtin/sec/model.ts +4 -1
- package/src/plugins/builtin/shared/cloud-upgrade.ts +27 -3
- package/src/plugins/builtin/shared/earnings-calendar.ts +2 -0
- package/src/plugins/builtin/shared/market-cap-bands.ts +12 -0
- package/src/plugins/builtin/shared/report-freshness.ts +3 -1
- package/src/plugins/builtin/shared/use-quote-board.ts +5 -3
- package/src/plugins/builtin/shared/volatility/options.ts +63 -2
- package/src/plugins/builtin/social-mentions/headless.ts +72 -3
- package/src/plugins/builtin/social-mentions/index.tsx +8 -4
- package/src/plugins/builtin/social-mentions/lock-note.ts +6 -2
- package/src/plugins/builtin/social-mentions/outliers-client.ts +101 -0
- package/src/plugins/builtin/social-mentions/outliers-model.ts +162 -0
- package/src/plugins/builtin/social-mentions/outliers-names.ts +51 -0
- package/src/plugins/builtin/social-mentions/outliers.tsx +276 -0
- package/src/plugins/builtin/social-mentions/pane.tsx +32 -3
- package/src/plugins/builtin/supply-chain/graph-pane.tsx +2 -2
- package/src/plugins/builtin/thirteenf/api.ts +36 -2
- package/src/plugins/builtin/thirteenf/data.ts +4 -1
- package/src/plugins/builtin/thirteenf/headless.ts +14 -6
- package/src/plugins/builtin/thirteenf/model.ts +56 -1
- package/src/plugins/builtin/thirteenf/pane.tsx +8 -8
- package/src/plugins/builtin/thirteenf/report-notes.ts +11 -0
- package/src/plugins/builtin/thirteenf/table.ts +2 -1
- package/src/plugins/builtin/thirteenf/types.ts +6 -0
- package/src/plugins/builtin/ticker-detail/data-panes/historical-prices.tsx +23 -3
- package/src/plugins/builtin/ticker-detail/financials/model.ts +5 -0
- package/src/plugins/builtin/ticker-detail/headless-schema.ts +2 -1
- package/src/plugins/builtin/ticker-detail/headless.ts +21 -66
- package/src/plugins/builtin/ticker-detail/index.tsx +5 -0
- package/src/plugins/builtin/ticker-detail/overview/components.tsx +67 -6
- package/src/plugins/builtin/ticker-detail/overview/model.ts +6 -4
- package/src/plugins/builtin/ticker-detail/overview/pane.tsx +15 -0
- package/src/plugins/builtin/ticker-detail/overview/tax-equivalent.ts +69 -0
- package/src/plugins/builtin/ticker-detail/overview-tab.tsx +69 -19
- package/src/plugins/builtin/ticker-detail/pane.tsx +7 -2
- package/src/plugins/builtin/ticker-detail/quote-monitor/card.tsx +47 -24
- package/src/plugins/builtin/ticker-detail/quote-monitor/export.ts +46 -0
- package/src/plugins/builtin/ticker-detail/quote-monitor/index.tsx +20 -1
- package/src/plugins/builtin/ticker-detail/quote-monitor/rows.ts +120 -0
- package/src/plugins/builtin/ticker-detail/research-tabs.ts +1 -5
- package/src/plugins/builtin/ticker-detail/settings.ts +6 -6
- package/src/plugins/builtin/treasury-auctions/cache.ts +85 -19
- package/src/plugins/builtin/treasury-auctions/index.tsx +22 -11
- package/src/plugins/builtin/treasury-auctions/model.ts +23 -0
- package/src/plugins/builtin/treasury-auctions/treasury-direct.ts +128 -0
- package/src/plugins/builtin/world-indices/client.ts +2 -0
- package/src/plugins/compat.ts +15 -0
- package/src/plugins/host-link.ts +6 -1
- package/src/plugins/installer.ts +53 -3
- package/src/portfolio/column-values.ts +14 -4
- package/src/portfolio/listed-symbol.ts +78 -0
- package/src/portfolio/real-return.ts +172 -0
- package/src/public/__snapshots__/public-api.test.ts.snap +1 -0
- package/src/remote/resources.ts +12 -1
- package/src/remote/schema.ts +1 -0
- package/src/remote/semantic-helpers.ts +29 -1
- package/src/remote/semantic-tree.tsx +32 -15
- package/src/renderers/browser/config-host.ts +56 -15
- package/src/renderers/browser/main.tsx +3 -1
- package/src/renderers/browser/ui-host.tsx +1 -0
- package/src/renderers/cloudflare/http-proxy.ts +1 -0
- package/src/renderers/cloudflare/worker.ts +16 -1
- package/src/renderers/dom/boot-frame.ts +2 -2
- package/src/renderers/dom/data-table/row.tsx +4 -1
- package/src/renderers/dom/desktop/controls.tsx +4 -4
- package/src/renderers/dom/desktop/dialog-actions.tsx +60 -41
- package/src/renderers/dom/dom-ui-host.tsx +3 -1
- package/src/renderers/dom/host/input.tsx +4 -1
- package/src/renderers/dom/host/tabs.tsx +10 -1
- package/src/renderers/dom/styles.css +73 -19
- package/src/renderers/electrobun/bun/desktop/app-name.ts +1 -1
- package/src/renderers/opentui/host.tsx +2 -1
- package/src/renderers/share/layout-view.tsx +1 -1
- package/src/sources/gloomberb-cloud/fred-series.ts +12 -0
- package/src/sources/gloomberb-cloud/index.ts +31 -2
- package/src/sources/gloomberb-cloud/news.ts +35 -12
- package/src/sources/gloomberb-cloud/normalizers.ts +29 -3
- package/src/sources/provider-router/cached-routes.ts +19 -7
- package/src/state/opening-ticker-panes.ts +47 -0
- package/src/state/pane-table-export-registry.ts +19 -6
- package/src/test-support/cli-context.ts +2 -0
- package/src/test-support/preload.ts +8 -1
- package/src/theme/colors.ts +9 -1
- package/src/theme/themes.ts +62 -15
- package/src/theme/tone-contrast.ts +40 -0
- package/src/theme/ui-tokens.ts +23 -3
- package/src/tickers/batched-lookups.ts +57 -8
- package/src/tickers/company-name-listing.ts +156 -14
- package/src/tickers/company-name.ts +30 -6
- package/src/tickers/instrument-kind.ts +23 -3
- package/src/tickers/list.ts +7 -0
- package/src/tickers/search/home-listing.ts +31 -9
- package/src/tickers/search/index.ts +13 -3
- package/src/tickers/search/listing-index.ts +558 -0
- package/src/tickers/search/major-listings.chunk.ts +10 -0
- package/src/tickers/search/major-listings.json +3346 -0
- package/src/tickers/search/ranking.ts +68 -1
- package/src/tickers/search/types.ts +4 -0
- package/src/tickers/terminal-codes.ts +26 -1
- package/src/time-series/calendar-month-returns.ts +47 -0
- package/src/time-series/currency-conversion.ts +130 -0
- package/src/time-series/hooks.ts +2 -0
- package/src/time-series/price-comparison.ts +34 -11
- package/src/time-series/resolve-context.ts +3 -0
- package/src/time-series/resolve.ts +14 -2
- package/src/time-series/spec.ts +1 -0
- package/src/time-series/studies/indicators.ts +4 -1
- package/src/time-series/types.ts +8 -0
- package/src/types/config.ts +13 -0
- package/src/types/context-menu.ts +2 -0
- package/src/types/data-provider.ts +28 -0
- package/src/types/financials.ts +20 -2
- package/src/types/headless.ts +12 -0
- package/src/types/plugin-commands.ts +140 -0
- package/src/types/plugin-context.ts +125 -0
- package/src/types/plugin-contributions.ts +55 -0
- package/src/types/plugin-definition.ts +234 -0
- package/src/types/plugin-notifications.ts +38 -0
- package/src/types/plugin-pane-settings.ts +114 -0
- package/src/types/plugin-pane-templates.ts +160 -0
- package/src/types/plugin-panes.ts +221 -0
- package/src/types/plugin-reports.ts +35 -0
- package/src/types/plugin-shared.ts +14 -0
- package/src/types/plugin-state.ts +71 -0
- package/src/types/plugin.ts +14 -1169
- package/src/ui/host.tsx +8 -0
- package/src/ui/index.tsx +14 -3
- package/src/updater/github-releases.ts +23 -0
- package/src/utils/cli-output.ts +22 -9
- package/src/utils/datetime-format.ts +17 -3
- package/src/utils/display-number.ts +15 -0
- package/src/utils/double-escape-close.ts +61 -16
- package/src/utils/float32-price.ts +24 -0
- package/src/utils/forward-dividend.ts +81 -16
- package/src/utils/fx-market-hours.ts +11 -0
- package/src/utils/plugin-proxy-hosts.json +2 -1
- package/src/utils/price-history.ts +7 -6
- package/src/utils/report-timing.ts +62 -0
- package/src/utils/sec-filings.ts +32 -0
- package/src/utils/utc-time.ts +5 -0
package/src/cli/listing-arg.ts
CHANGED
|
@@ -15,12 +15,14 @@ import {
|
|
|
15
15
|
type ListingVenue,
|
|
16
16
|
} from "../tickers/listing-venues";
|
|
17
17
|
import { findUsListingOfCompany, type UsListing } from "../tickers/us-listing";
|
|
18
|
-
import {
|
|
18
|
+
import {
|
|
19
|
+
findListingOfCompanyName, isCompanyNameInput, marksAnotherListing, readTerminalCodeArg, serviceMarkedListing, serviceMarkedOtherListing, type CompanyNameListing,
|
|
20
|
+
} from "../tickers/company-name-listing";
|
|
19
21
|
import { movedAwayChange, startTickerChangeLookup, type MovedTickerChange } from "../tickers/ticker-changes";
|
|
20
22
|
import { lineMayHaveMoved, listingChangeLine, loadListingFate, MovedSymbolError, SUCCESSOR_CHANGE_WAIT_MS, type ListingFate } from "../tickers/listing-fate";
|
|
21
23
|
import { quotedListingName } from "../tickers/listing-name";
|
|
22
24
|
import { cliStyles } from "../utils/cli-output";
|
|
23
|
-
import { groupByCompany, namesDepositaryReceipt, sameCompany, sameListedName, shortCompanyName } from "../tickers/company-name";
|
|
25
|
+
import { companyNameExtraWords, groupByCompany, namesDepositaryReceipt, sameCompany, sameListedName, shortCompanyName } from "../tickers/company-name";
|
|
24
26
|
import {
|
|
25
27
|
canonicalExchange,
|
|
26
28
|
exchangeCodeVenues,
|
|
@@ -42,7 +44,7 @@ import { dashedCoinPair, exchangeLineCoinListing, isSpotCommodityOrCurrencyPair,
|
|
|
42
44
|
import { boardCoinFor, primeBoardCoins } from "./board-coins";
|
|
43
45
|
import { knownGapMessage } from "./known-gaps";
|
|
44
46
|
import { currencyPairSpelling } from "../utils/currency-pair";
|
|
45
|
-
import { bareFuturesCode, futuresContractByCode } from "../market-data/futures-board";
|
|
47
|
+
import { bareFuturesCode, futuresContractByCode, futuresContractByWord, listedFuturesSymbol } from "../market-data/futures-board";
|
|
46
48
|
import { classifyInstrumentType, kindFromListingSyntax } from "../tickers/instrument-kind";
|
|
47
49
|
import type { InstrumentOfKind } from "../tickers/instrument-coverage";
|
|
48
50
|
import { brokerIndexCode, brokerIndexReadAs } from "./index-roots";
|
|
@@ -54,6 +56,7 @@ import {
|
|
|
54
56
|
isSearchOnlyVenue,
|
|
55
57
|
readLondonDottedSymbol,
|
|
56
58
|
readNearMissListing,
|
|
59
|
+
readVenueFirstListing,
|
|
57
60
|
readTerminalListingCode,
|
|
58
61
|
terminalCodeReadAs,
|
|
59
62
|
unknownBloombergMarket,
|
|
@@ -63,6 +66,7 @@ import {
|
|
|
63
66
|
import { listingAbroadVenue } from "../utils/sec";
|
|
64
67
|
import { savedAbroadForBareSymbol, savedUsListingOf } from "../tickers/search/bare-symbol";
|
|
65
68
|
import { listingSuffixCandidate, listingSuffixVenue, tickerHasListingSuffix } from "../sources/listing-symbols";
|
|
69
|
+
import { isCurrencyPairListing } from "../utils/fx-market-hours";
|
|
66
70
|
import { coinElsewhereNote, notTheCoinNote } from "./commands/crypto-hints";
|
|
67
71
|
import { fredSeriesArgument, fredSeriesNotListing } from "../series/fred-argument";
|
|
68
72
|
|
|
@@ -165,10 +169,11 @@ export function parseListingArg(
|
|
|
165
169
|
// A pasted ticker can bring the separator or quote marks that sat beside it (`UPST;`); search would ask for them.
|
|
166
170
|
const stripped = stripStrayEdges(rawArg);
|
|
167
171
|
const raw = stripped.text || rawArg;
|
|
168
|
-
// A terminal's code (WFC.N, "VOD LN", "JPM US Equity") is that listing (WFC:NYSE, VOD:LSE, JPM),
|
|
169
|
-
// written nearly as one is (700.HK, 6758.JP, BRK/B) its working form (0700.HK, 6758.T, BRK-B)
|
|
172
|
+
// A terminal's code (WFC.N, "VOD LN", "JPM US Equity") is that listing (WFC:NYSE, VOD:LSE, JPM), a symbol
|
|
173
|
+
// written nearly as one is (700.HK, 6758.JP, BRK/B) its working form (0700.HK, 6758.T, BRK-B), and one written
|
|
174
|
+
// venue first, as spreadsheets write it (TYO:7203, LON:LSEG), the symbol on that venue (7203:JPX, LSEG:LSE).
|
|
170
175
|
const terminal = terminalCode === undefined ? readTerminalListingCode(raw) : terminalCode;
|
|
171
|
-
const nearMiss = terminal ? null : readNearMissListing(raw);
|
|
176
|
+
const nearMiss = terminal ? null : readNearMissListing(raw) ?? (typedPerpetualListing(raw) ? null : readVenueFirstListing(raw));
|
|
172
177
|
const reading = terminal ?? (nearMiss ? { typed: nearMiss.typed, key: nearMiss.symbol } : null);
|
|
173
178
|
const parsed = parseCleanListingArg(reading?.key ?? raw, exchangeOption, { ownExchangeWins });
|
|
174
179
|
const listing = listingSuffix ? readListingSuffix(parsed) ?? parsed : parsed;
|
|
@@ -221,6 +226,9 @@ function parseCleanListingArg(
|
|
|
221
226
|
if (pair && !pair.ambiguous) return { symbol: pair.symbol, exchange: "", key: pair.symbol };
|
|
222
227
|
const shared = isSharedExchangeCode(code) ? { sharedCode: code } : {};
|
|
223
228
|
if (exchange) return { symbol: parsed.symbol, exchange, key: `${parsed.symbol}:${exchange}`, ...shared };
|
|
229
|
+
// A contract as CTM prints it is its listing: ETHX26 is ETHX26.CME, CLZ26 is CLZ26.NYM.
|
|
230
|
+
const listed = listedFuturesSymbol(parsed.symbol);
|
|
231
|
+
if (listed) return { symbol: listed, exchange: "", key: listed };
|
|
224
232
|
// A futures board code no security uses is its future: TTF is TTF=F.
|
|
225
233
|
const symbol = bareFuturesCode(parsed.symbol)?.symbol ?? parsed.symbol;
|
|
226
234
|
return { symbol, exchange, key: symbol };
|
|
@@ -265,10 +273,11 @@ async function settleSharedCode(listing: ListingArg, deps: ListingDeps): Promise
|
|
|
265
273
|
}
|
|
266
274
|
const { exchange } = reading;
|
|
267
275
|
const key = `${symbol}:${exchange}`;
|
|
268
|
-
const
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
276
|
+
const why = exchange === meanings[0] ? "." : `: ${code} is ${venueChoices(meanings)}, and ${symbol} trades on ${exchange}.`;
|
|
277
|
+
// Written venue first (TSE:7203), one reading says where it went: "Read TSE:7203 as 7203:JPX: ...".
|
|
278
|
+
const typedAs = ` as ${symbol}:${code}.`;
|
|
279
|
+
const readAs = listing.readAs?.endsWith(typedAs) ? `${listing.readAs.slice(0, -typedAs.length)} as ${key}${why}`
|
|
280
|
+
: [listing.readAs, why === "." ? null : `Read ${symbol}:${code} as ${key}${why}`].filter(Boolean).join(" ");
|
|
272
281
|
return { symbol, exchange, key, ...readAs ? { readAs } : {} };
|
|
273
282
|
}
|
|
274
283
|
|
|
@@ -511,9 +520,16 @@ export async function listingChoiceNotes(
|
|
|
511
520
|
// A bare symbol read on a company's own US line (JPM on NYSE) is what it means: companies abroad sharing the
|
|
512
521
|
// letters are not named. A US receipt (SAN, Banco Santander's) may still be meant for another (Sanofi's SAN:EPA).
|
|
513
522
|
if (!exchange || (isUsListingExchange(exchange) && quote.isDepositaryReceipt !== true)) return coin;
|
|
514
|
-
const listed = await (
|
|
523
|
+
const [listed, marked] = await Promise.all([
|
|
524
|
+
venues ?? loadBareVenues(listing, deps) ?? [],
|
|
525
|
+
// A primary listing the service names by the word, off the venue picked: NTT is NTT, Inc. (9432 on JPX), not Warsaw's NTT.
|
|
526
|
+
serviceMarkedOtherListing(deps.dataProvider, listing.symbol, exchange).catch(logFailure("cli.listing-arg", "Read the listing a word names failed", null)),
|
|
527
|
+
]);
|
|
515
528
|
const note = listingChoiceNote(listing.symbol, { exchange, name: quote.name }, listed);
|
|
516
|
-
|
|
529
|
+
const also = marked ? `also ${marked.symbol}:${marked.exchange} ${marked.name}` : null;
|
|
530
|
+
const named = quote.name?.trim() ? `${shortCompanyName(quote.name)}, ` : "";
|
|
531
|
+
const choice = also ? `${note ?? `${listing.symbol} = ${named}${exchangeName(exchange)}`}; ${also}` : note;
|
|
532
|
+
return [...choice ? [choice] : [], ...coin];
|
|
517
533
|
}
|
|
518
534
|
|
|
519
535
|
/**
|
|
@@ -581,8 +597,17 @@ export async function usListingsOnlyMessage(
|
|
|
581
597
|
): Promise<{ message: string; details: string }> {
|
|
582
598
|
const quote = await loadListingQuote(deps.dataProvider, listing);
|
|
583
599
|
const company = listingIdentity(listing, quote).name;
|
|
584
|
-
|
|
585
|
-
const
|
|
600
|
+
// A listing read from its vendor suffix (7203.T) or its quote has no venue typed: it is the one its quote is from.
|
|
601
|
+
const venue = canonicalExchange(listing.exchange || quote?.listingExchangeName || quote?.exchangeName || "");
|
|
602
|
+
const suffix = listing.exchange ? null : listingSuffixCandidate(listing.symbol);
|
|
603
|
+
const local = { symbol: suffix && canonicalExchange(suffix.exchange) === venue ? suffix.symbol : listing.symbol, exchange: venue };
|
|
604
|
+
// A currency pair has no listing anywhere: say what it is, never "GBP/USD on ." or the code of a venue.
|
|
605
|
+
if (isCurrencyPairListing(listing.symbol, venue)) {
|
|
606
|
+
return { message: `${what} covers US listings only, and ${listing.key} is a currency pair.`, details: "A currency pair trades over the counter, with no exchange volume to follow." };
|
|
607
|
+
}
|
|
608
|
+
const where = venue ? exchangeLabel(venue) : "";
|
|
609
|
+
const named = company ? `${shortCompanyName(company)}${where ? ` on ${where}` : ""}` : where || "not a US listing";
|
|
610
|
+
const us = await usListingOfCompany(local, company, deps);
|
|
586
611
|
const owner = company ? shortCompanyName(company) : listing.key;
|
|
587
612
|
const command = us ? retry(us.symbol) : null;
|
|
588
613
|
return {
|
|
@@ -638,8 +663,9 @@ function retryCommand(request: Pick<ListingDataRequest, "command" | "retry">, ke
|
|
|
638
663
|
* code a security keeps (GC, NG) when that security has no data: the future is
|
|
639
664
|
* the other thing the code names. Null for any other symbol.
|
|
640
665
|
*/
|
|
641
|
-
export function futuresTryLine(symbol: string, request: ListingDataRequest): string | null {
|
|
642
|
-
|
|
666
|
+
export function futuresTryLine(symbol: string, request: ListingDataRequest, { words = false }: { words?: boolean } = {}): string | null {
|
|
667
|
+
// With `words`, a commodity's word (BRENT, GOLD) names its future too, beside the securities that share it.
|
|
668
|
+
const future = futuresContractByCode(symbol) ?? (words ? futuresContractByWord(symbol) : null);
|
|
643
669
|
if (!future) return null;
|
|
644
670
|
const retry = retryCommand(request, future.symbol);
|
|
645
671
|
return `${future.symbol} ${future.name} future${retry ? ` (try: ${retry})` : ""}`;
|
|
@@ -657,7 +683,8 @@ function describeOtherListings(
|
|
|
657
683
|
/** Listings just asked that had none: named as having none, never offered to try. */
|
|
658
684
|
without: readonly ListingVenue[] = [],
|
|
659
685
|
): OtherListingsMessage | null {
|
|
660
|
-
|
|
686
|
+
// BRENT's listings are two ETPs: Brent crude itself is the future BZ=F, offered beside them.
|
|
687
|
+
const future = futuresTryLine(listing.symbol, request, { words: true });
|
|
661
688
|
const offered = others.filter((venue) => !without.includes(venue));
|
|
662
689
|
if (offered.length === 0 && !future && without.length === 0) return null;
|
|
663
690
|
const name = resolved?.name || listing.saved?.metadata.name?.trim() || "";
|
|
@@ -684,7 +711,7 @@ function describeOtherListings(
|
|
|
684
711
|
: `${listing.symbol} resolved to ${name ? `${name} (${exchange})` : exchange}, which has no ${request.noun}.`,
|
|
685
712
|
details,
|
|
686
713
|
heading,
|
|
687
|
-
listings: [...named.map((venue) => venueKey(listing.symbol, venue)), ...future ? [futuresContractByCode(listing.symbol)!.symbol] : []],
|
|
714
|
+
listings: [...named.map((venue) => venueKey(listing.symbol, venue)), ...future ? [(futuresContractByCode(listing.symbol) ?? futuresContractByWord(listing.symbol))!.symbol] : []],
|
|
688
715
|
choices: offered.slice(0, MAX_OTHER_LISTINGS).map((venue) => ({ key: venueKey(listing.symbol, venue), name: venue.name || null })),
|
|
689
716
|
choose,
|
|
690
717
|
};
|
|
@@ -1447,6 +1474,39 @@ export async function serviceNamedCompany(typed: string, deps: Pick<ListingDeps,
|
|
|
1447
1474
|
return companyListingArg(typed, found);
|
|
1448
1475
|
}
|
|
1449
1476
|
|
|
1477
|
+
/** A word written as a company's name is (`Aeon`, `Panasonic`): a capital, then small letters, never a ticker's capitals. */
|
|
1478
|
+
const TITLE_CASE_WORD = /^\p{Lu}\p{Ll}[\p{L}&'’.-]*$/u;
|
|
1479
|
+
|
|
1480
|
+
/** Whether a word is written as a company's name is (`Aeon`), never as a ticker is (`AEON`, `aeon`). */
|
|
1481
|
+
export function isTitleCaseWord(text: string): boolean {
|
|
1482
|
+
return TITLE_CASE_WORD.test(text.trim());
|
|
1483
|
+
}
|
|
1484
|
+
|
|
1485
|
+
/**
|
|
1486
|
+
* A word written as a company's name (`Aeon`, not `AEON` or `aeon`) that is
|
|
1487
|
+
* also a ticker, read as the company named exactly that word whose home line
|
|
1488
|
+
* the service marks, when the ticker's company is named more than the word:
|
|
1489
|
+
* "Aeon" in a pasted book is Aeon Co., Ltd. (8267:JPX), not AEON Biopharma,
|
|
1490
|
+
* whose ticker it is ("Read "Aeon" as 8267:JPX (Aeon Co., Ltd.); the ticker
|
|
1491
|
+
* AEON is AEON Biopharma, Inc."). A word in capitals stays the ticker, and
|
|
1492
|
+
* so does one whose ticker's company bears the name (`Snap` is Snap Inc.).
|
|
1493
|
+
* Null otherwise, and when search names no such company or is too busy to say.
|
|
1494
|
+
*/
|
|
1495
|
+
export async function titleCaseCompanyName(
|
|
1496
|
+
typed: string,
|
|
1497
|
+
ticker: { symbol: string; name: string | null | undefined },
|
|
1498
|
+
deps: Pick<ListingDeps, "dataProvider">,
|
|
1499
|
+
): Promise<ListingArg | null> {
|
|
1500
|
+
const word = typed.trim();
|
|
1501
|
+
if (!TITLE_CASE_WORD.test(word) || companyNameExtraWords(word, ticker.name) === 0) return null;
|
|
1502
|
+
const found = await findOneWordCompany(word, deps);
|
|
1503
|
+
if (!found?.home || found.moved || companyNameExtraWords(word, found.name) !== 0) return null;
|
|
1504
|
+
const listing = companyListingArg(word, found);
|
|
1505
|
+
if (listing.key.toUpperCase() === ticker.symbol.toUpperCase()) return null;
|
|
1506
|
+
const owner = ticker.name?.trim().replace(/\.$/, "") || "another company";
|
|
1507
|
+
return { ...listing, readAs: `${listing.readAs!.replace(/\.$/, "")}; the ticker ${ticker.symbol.toUpperCase()} is ${owner}.` };
|
|
1508
|
+
}
|
|
1509
|
+
|
|
1450
1510
|
/** The company `oneWordCompanyName` reads a word as, before it is read as a listing. */
|
|
1451
1511
|
async function findOneWordCompany(typed: string, deps: Pick<ListingDeps, "dataProvider">): Promise<CompanyNameListing | null> {
|
|
1452
1512
|
const word = typed.trim();
|
package/src/cli/name-entries.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { logFailure } from "../utils/log-failure";
|
|
2
2
|
import type { DataProvider } from "../types/data-provider";
|
|
3
|
-
import { companyNameQueries, findListingOfCompanyName, isCompanyNameInput, readTerminalCodeArg } from "../tickers/company-name-listing";
|
|
3
|
+
import { companyNameQueries, findListingOfCompanyName, isCompanyNameInput, readTerminalCodeArg, settledTerminalCode } from "../tickers/company-name-listing";
|
|
4
4
|
import { batchedListLookups } from "../tickers/batched-lookups";
|
|
5
5
|
import { mapWithConcurrency } from "../utils/concurrency";
|
|
6
6
|
import { isNotATickerMessage } from "./not-a-ticker";
|
|
@@ -38,7 +38,8 @@ export async function readNameEntryGroups(
|
|
|
38
38
|
): Promise<string[][]> {
|
|
39
39
|
// A pasted list's names are searched in batches and their quotes asked together, a few entries at a time: a list
|
|
40
40
|
// of hundreds of names is a few requests, never hundreds at once.
|
|
41
|
-
|
|
41
|
+
// A terminal's code abroad (`VOD LN`) is its listing as written: nothing searches for it as a name.
|
|
42
|
+
const names = entries.filter((entry) => isCompanyNameInput(entry) && !unknownBloombergMarket(entry) && !settledTerminalCode(entry));
|
|
42
43
|
const full = source as DataProvider;
|
|
43
44
|
const dataProvider = names.length > 1 && full.searchBatch
|
|
44
45
|
? (await batchedListLookups(full, names.map((name) => ({ searches: companyNameQueries(name), changes: null })))).dataProvider
|
package/src/cli/not-a-ticker.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { futuresContractByWord } from "../market-data/futures-board";
|
|
1
2
|
import { notATickerSymbol } from "../sources/provider-errors";
|
|
2
3
|
import { boardCoinFor } from "./board-coins";
|
|
3
4
|
import { currencyNameHint } from "./currency-name-hint";
|
|
@@ -54,8 +55,11 @@ export function withSearchHints(text: string, args: readonly string[], isFredSer
|
|
|
54
55
|
const coin = boardCoinFor(id);
|
|
55
56
|
if (coin) return `${sentence} Did you mean ${coin.symbol}${coin.name && coin.name.toUpperCase() !== coin.symbol ? ` (${coin.name})` : ""}?`;
|
|
56
57
|
const tenor = treasuryYieldTenor(typed);
|
|
57
|
-
// A currency's name (`yen`) is its rate and its pair, not a ticker search could find
|
|
58
|
-
|
|
58
|
+
// A currency's name (`yen`) is its rate and its pair, not a ticker search could find; a commodity's word
|
|
59
|
+
// (`oil`, `brent`) is its future, which no search for the word finds first.
|
|
60
|
+
const future = futuresContractByWord(id);
|
|
61
|
+
const commodity = future ? `For ${future.name}, quote the future ${future.symbol}.` : null;
|
|
62
|
+
return `${sentence} ${tenor ? treasuryYieldHint(tenor) : currencyNameHint(typed) ?? commodity ?? searchHint(typed)}`;
|
|
59
63
|
})
|
|
60
64
|
: named;
|
|
61
65
|
}
|
|
@@ -6,6 +6,7 @@ import type {
|
|
|
6
6
|
PaneDef,
|
|
7
7
|
PaneTemplateDef,
|
|
8
8
|
} from "../../types/plugin";
|
|
9
|
+
import { spreadsheetOptionHint } from "../spreadsheet-hint";
|
|
9
10
|
|
|
10
11
|
export type PaneFunctionReadiness = "ready" | "partial" | "live-dom" | "unsupported";
|
|
11
12
|
type PaneFunctionScreenshotReadiness = PaneFunctionReadiness;
|
|
@@ -294,6 +295,14 @@ function normalizeOptionValue(
|
|
|
294
295
|
return rawValue;
|
|
295
296
|
}
|
|
296
297
|
|
|
298
|
+
/** A function's argument and options as they were typed (`^HSI,^TNX --range 1Y`), for a pointer to name the command. */
|
|
299
|
+
function typedFunctionArgs(argument: string | null | undefined, options: Record<string, string | true>): string[] {
|
|
300
|
+
return [
|
|
301
|
+
...argument?.trim() ? [argument.trim()] : [],
|
|
302
|
+
...Object.entries(options).flatMap(([key, value]) => value === true ? [optionFlag(key)] : [optionFlag(key), value]),
|
|
303
|
+
];
|
|
304
|
+
}
|
|
305
|
+
|
|
297
306
|
export function normalizeCapabilityOptions(
|
|
298
307
|
capability: PaneFunctionCapability,
|
|
299
308
|
options: Record<string, string | true>,
|
|
@@ -327,7 +336,9 @@ export function normalizeCapabilityOptions(
|
|
|
327
336
|
}
|
|
328
337
|
const supported = capability.options.map(({ key }) => optionFlag(key)).join(", ");
|
|
329
338
|
throw new Error(
|
|
330
|
-
`${settings.code ?? capability.id} does not support ${optionFlag(rawKey)}.${supported ? ` Supported options: ${supported}.` : " It has no options."}`,
|
|
339
|
+
[`${settings.code ?? capability.id} does not support ${optionFlag(rawKey)}.${supported ? ` Supported options: ${supported}.` : " It has no options."}`,
|
|
340
|
+
spreadsheetOptionHint(optionFlag(rawKey), `fn ${settings.code ?? capability.id}`, typedFunctionArgs(settings.argument, options))]
|
|
341
|
+
.filter(Boolean).join(" "),
|
|
331
342
|
);
|
|
332
343
|
}
|
|
333
344
|
normalized[option.key] = normalizeOptionValue(option, rawValue, settings.argument);
|
|
@@ -19,6 +19,8 @@ const FUNCTION_DOCS_URL = "https://gloom.sh/docs/functions";
|
|
|
19
19
|
export interface FunctionHelpKey {
|
|
20
20
|
key: string;
|
|
21
21
|
label: string;
|
|
22
|
+
/** The action's name, as its footer hint gives it, when the label is a whole word after a letter key. */
|
|
23
|
+
title?: string;
|
|
22
24
|
}
|
|
23
25
|
|
|
24
26
|
/** A function Free cannot fully open: Pro only, or a limited preview on Free. */
|
|
@@ -58,7 +60,7 @@ export function functionDocsUrl(code: string): string {
|
|
|
58
60
|
return anchor ? `${FUNCTION_DOCS_URL}#${anchor}` : FUNCTION_DOCS_URL;
|
|
59
61
|
}
|
|
60
62
|
|
|
61
|
-
const key = (hotkey: string, label: string): FunctionHelpKey => ({ key: hotkey, label });
|
|
63
|
+
const key = (hotkey: string, label: string, title?: string): FunctionHelpKey => (title ? { key: hotkey, label, title } : { key: hotkey, label });
|
|
62
64
|
const same = (value: string): FunctionFreshness => ({ free: value, pro: value });
|
|
63
65
|
|
|
64
66
|
const DELAYED = "15 minutes delayed";
|
|
@@ -98,8 +100,9 @@ const CHART_KEYS = [key("s", "eries"), key("i", "ndicators"), key("b", "ars"), k
|
|
|
98
100
|
export const FUNCTION_HELP: Readonly<Record<string, FunctionHelp>> = {
|
|
99
101
|
// Research companies
|
|
100
102
|
DES: {
|
|
101
|
-
summary: "The starting point for any ticker: live quote, day and 52-week range, price chart, fundamentals, and tabs into every other research pane."
|
|
102
|
-
|
|
103
|
+
summary: "The starting point for any ticker: live quote, day and 52-week range, price chart, fundamentals, and tabs into every other research pane. "
|
|
104
|
+
+ "A bond fund shows its SEC yield, yield to worst and duration beside its distribution yield; --tax-rate 40.8 adds a muni fund's tax-equivalent yield and muni/Treasury ratio.",
|
|
105
|
+
usage: ["DES NVDA", "DES MUB --tax-rate 40.8"],
|
|
103
106
|
keys: [TABS, key(".", " go to tab")],
|
|
104
107
|
data: QUOTES,
|
|
105
108
|
bloomberg: ["DES"],
|
|
@@ -242,7 +245,7 @@ export const FUNCTION_HELP: Readonly<Record<string, FunctionHelp>> = {
|
|
|
242
245
|
+ "Grades: Value, Growth, Profitability, Momentum and Revisions, F to A+, each ranked within the sector, and their equal-weighted 1-5 composite labelled Top, Strong, Neutral, Weak or Bottom. "
|
|
243
246
|
+ "Ideas holds ready technical screens, Value, Quality and GARP, screens on the classic scores and Top grades. The pane menu saves the matches to a watchlist.",
|
|
244
247
|
usage: ["EQS", "gloom fn EQS --preset golden-cross", "gloom fn EQS --preset quality", "gloom fn EQS --preset magic-formula", "gloom fn EQS --preset top-grades"],
|
|
245
|
-
keys: [key("a", "dd criterion"), key("m", "etric"), key("t", "check ticker"), key("s", "ave screen"), key("o", "pen research")],
|
|
248
|
+
keys: [key("a", "dd criterion"), key("m", "etric"), key("t", "check ticker", "Check ticker"), key("s", "ave screen"), key("o", "pen research")],
|
|
246
249
|
data: same("Daily snapshot, statements as filed"),
|
|
247
250
|
bloomberg: ["EQS"],
|
|
248
251
|
},
|
|
@@ -405,7 +408,7 @@ export const FUNCTION_HELP: Readonly<Record<string, FunctionHelp>> = {
|
|
|
405
408
|
bloomberg: ["CACS"],
|
|
406
409
|
},
|
|
407
410
|
EVTS: {
|
|
408
|
-
summary: "The market
|
|
411
|
+
summary: "The market board: report days with implied and past moves, or a past or coming week or day of them; a ticker highlights its row.",
|
|
409
412
|
usage: ["EVTS", "EVTS NVDA", "gloom fn EVTS --week last", "gloom fn EVTS --date 2026-10-15"],
|
|
410
413
|
keys: [key("t", "icker"), key("e", "stimates"), key("c", "alls"), key("a", "nalysts")],
|
|
411
414
|
data: EARNINGS_DAYS,
|
|
@@ -413,7 +416,7 @@ export const FUNCTION_HELP: Readonly<Record<string, FunctionHelp>> = {
|
|
|
413
416
|
docs: "ERN",
|
|
414
417
|
},
|
|
415
418
|
ERN: {
|
|
416
|
-
summary: "
|
|
419
|
+
summary: "A company's report history with its surprises and moves, or several tickers' next reports. Alone it is the market board EVTS shows.",
|
|
417
420
|
usage: ["ERN", "ERN NVDA, AAPL, MSFT"],
|
|
418
421
|
keys: [key("t", "icker"), key("e", "stimates"), key("c", "alls"), key("a", "nalysts")],
|
|
419
422
|
data: EARNINGS_DAYS,
|
|
@@ -423,8 +426,9 @@ export const FUNCTION_HELP: Readonly<Record<string, FunctionHelp>> = {
|
|
|
423
426
|
summary: "Cash distributions, trailing yield, the forward yield fundamentals show (the latest distribution annualized, or the declared one once announced), and payout growth. Future payments are not forecast. "
|
|
424
427
|
+ "For a bond fund these are distribution yields, not its SEC yield, which follows them with its date, yield to worst and duration. "
|
|
425
428
|
+ "--tax-rate 40.8 adds a muni fund's tax-equivalent yield, yield / (1 - (federal + state rate)) on the SEC yield (else the distribution yield), "
|
|
426
|
-
+ "and its muni/Treasury ratio against the GC tenor nearest its duration; --state-rate 13.3 --state CA counts only for a CA fund."
|
|
427
|
-
|
|
429
|
+
+ "and its muni/Treasury ratio against the GC tenor nearest its duration; --state-rate 13.3 --state CA counts only for a CA fund. "
|
|
430
|
+
+ "Several tickers rank in one table; with --tax-rate it adds yield to worst, duration, the tax-equivalent yield and the ratio.",
|
|
431
|
+
usage: ["DVD KO", "DVD MUB --tax-rate 40.8", "DVD CMF --tax-rate 40.8 --state-rate 13.3 --state CA", "DVD MUB VTEB SUB LQD --tax-rate 40.8"],
|
|
428
432
|
keys: [STEP],
|
|
429
433
|
data: same("Daily"),
|
|
430
434
|
bloomberg: ["DVD"],
|
|
@@ -639,8 +643,8 @@ export const FUNCTION_HELP: Readonly<Record<string, FunctionHelp>> = {
|
|
|
639
643
|
bloomberg: ["QR"],
|
|
640
644
|
},
|
|
641
645
|
BUZZ: {
|
|
642
|
-
summary: "Daily posts on X naming the ticker's cashtag, the day's top posts and their stance.",
|
|
643
|
-
usage: ["BUZZ TSLA"],
|
|
646
|
+
summary: "Daily posts on X naming the ticker's cashtag, the day's top posts and their stance. Alone it ranks the tickers by how far their posts jump above their own 30-day median, on the latest closed day or today so far, with stance and price move, filtered by posts and market cap.",
|
|
647
|
+
usage: ["BUZZ TSLA", "BUZZ"],
|
|
644
648
|
keys: [OPEN, OPEN_SOURCE],
|
|
645
649
|
data: same("Through the day"),
|
|
646
650
|
bloomberg: [],
|
|
@@ -1082,8 +1086,9 @@ export const FUNCTION_HELP: Readonly<Record<string, FunctionHelp>> = {
|
|
|
1082
1086
|
bloomberg: ["CF"],
|
|
1083
1087
|
},
|
|
1084
1088
|
ETF: {
|
|
1085
|
-
summary: "A US-listed fund's facts, a leveraged or inverse fund's daily objective among them, then its own SEC filings: registration statements and prospectus updates, shareholder reports, N-CEN and N-PORT reports. Open any of them inline."
|
|
1086
|
-
|
|
1089
|
+
summary: "A US-listed fund's facts, a leveraged or inverse fund's daily objective and a bond fund's SEC yield, yield to worst and duration among them, then its own SEC filings: registration statements and prospectus updates, shareholder reports, N-CEN and N-PORT reports. Open any of them inline. "
|
|
1090
|
+
+ "--tax-rate 40.8 adds a muni fund's tax-equivalent yield and muni/Treasury ratio, as DVD does.",
|
|
1091
|
+
usage: ["ETF SPY", "ETF MUB --tax-rate 40.8"],
|
|
1087
1092
|
keys: [OPEN, OPEN_SOURCE],
|
|
1088
1093
|
data: AS_FILED,
|
|
1089
1094
|
bloomberg: [],
|
|
@@ -1165,7 +1170,7 @@ export const FUNCTION_HELP: Readonly<Record<string, FunctionHelp>> = {
|
|
|
1165
1170
|
ALRT: {
|
|
1166
1171
|
summary: "Your price alerts with current price, distance to target and trigger state, plus alerts on earnings, CPI and FOMC dates, filings and 13F, news keywords, analyst changes, 52-week highs and lows, unusual volume, short interest, insider and congress trades, catalysts, IV spikes, options flow and perps.",
|
|
1167
1172
|
usage: ["ALRT"],
|
|
1168
|
-
keys: [key("a", "dd alert"), key("e", "dit"), key("d", "elete"), key("m", "re-arm")],
|
|
1173
|
+
keys: [key("a", "dd alert"), key("e", "dit"), key("d", "elete"), key("m", "re-arm", "Re-arm")],
|
|
1169
1174
|
data: QUOTES,
|
|
1170
1175
|
bloomberg: ["ALRT"],
|
|
1171
1176
|
},
|
|
@@ -1346,7 +1351,7 @@ export const FUNCTION_HELP: Readonly<Record<string, FunctionHelp>> = {
|
|
|
1346
1351
|
bloomberg: [],
|
|
1347
1352
|
},
|
|
1348
1353
|
LMA: {
|
|
1349
|
-
summary: "Float
|
|
1354
|
+
summary: "Float panes or return them to the layout, swap, remove and save panes and layouts.",
|
|
1350
1355
|
usage: ["LMA", "LMA float"],
|
|
1351
1356
|
keys: [],
|
|
1352
1357
|
data: null,
|
|
@@ -1465,4 +1470,11 @@ export const FUNCTION_HELP: Readonly<Record<string, FunctionHelp>> = {
|
|
|
1465
1470
|
data: null,
|
|
1466
1471
|
bloomberg: [],
|
|
1467
1472
|
},
|
|
1473
|
+
QUIT: {
|
|
1474
|
+
summary: "Quit Gloom from the command bar. EXIT does too; the browser app, which cannot close its tab, does not list it.",
|
|
1475
|
+
usage: ["QUIT"],
|
|
1476
|
+
keys: [],
|
|
1477
|
+
data: null,
|
|
1478
|
+
bloomberg: [],
|
|
1479
|
+
},
|
|
1468
1480
|
};
|
|
@@ -815,7 +815,9 @@ export function headlessReportTables(
|
|
|
815
815
|
// A line of its own period or release (a previous reading) names them rather than the section's.
|
|
816
816
|
const own = (entry: HeadlessPaneEntry): ExportIdentity | undefined => {
|
|
817
817
|
const identity = {
|
|
818
|
-
|
|
818
|
+
// An export unit names a number's unit: a figure missing with its reason has none.
|
|
819
|
+
...(entry.unit?.trim() ? { currencyOrUnit: entry.unit.trim() }
|
|
820
|
+
: entry.exportUnit?.trim() && typeof entry.value === "number" && Number.isFinite(entry.value) ? { currencyOrUnit: entry.exportUnit.trim() } : {}),
|
|
819
821
|
...(entry.period !== undefined ? { period: entry.period } : {}),
|
|
820
822
|
...(entry.released !== undefined ? { released: entry.released } : {}),
|
|
821
823
|
...(entry.asOf !== undefined ? { asOf: entry.asOf } : {}),
|
|
@@ -40,7 +40,7 @@ import { CLI_ERROR_CODE, failUnreachable, failWithError, isCliFailure, unreachab
|
|
|
40
40
|
import { DATA_SERVICE_UNREACHABLE_MESSAGE, isNetworkFailure } from "../../utils/network-failure";
|
|
41
41
|
import { isTickerLinkPeer } from "../../layout/ticker-navigation";
|
|
42
42
|
import { knownGapMessage, commandPointer, commandPointerLeads, topicPointer } from "../known-gaps";
|
|
43
|
-
import { selectReportTables, type CliReportTables } from "../report-tables";
|
|
43
|
+
import { selectReportTables, splitCsvFooter, type CliReportTables } from "../report-tables";
|
|
44
44
|
import { cliOutputWritten, printCliResult, serializeCliResult, type CliErrorObject } from "../result";
|
|
45
45
|
import { checkOutputPath, resolveOutputPath, writeOutputFile } from "../output-file";
|
|
46
46
|
import type { CatalogCommandHit } from "../unknown-command";
|
|
@@ -319,6 +319,8 @@ export async function runPaneFunction(args: string[], ctx: CliCommandContext) {
|
|
|
319
319
|
// A report that fails or comes back empty for an exchange the symbol is not listed on says so.
|
|
320
320
|
// A report written to a file is drawn for it as it is built: no colour and no terminal width, as a redirect gets it.
|
|
321
321
|
const buildReport = () => buildFunctionReport(resolved, context, parsed.arg);
|
|
322
|
+
// A report still loading after a few seconds (a chain the server reads cold) says so, so it never looks stuck.
|
|
323
|
+
const progress = progressNotice(ctx, [resolved.token, parsed.arg].filter(Boolean).join(" "), FN_PROGRESS_AFTER_MS);
|
|
322
324
|
const report = await refuseMovedListing(fate, moved, () => withPersistedCloudSession(
|
|
323
325
|
context,
|
|
324
326
|
() => loadForListing(
|
|
@@ -328,7 +330,7 @@ export async function runPaneFunction(args: string[], ctx: CliCommandContext) {
|
|
|
328
330
|
outputPath ? () => buildForFile(buildReport) : buildReport,
|
|
329
331
|
(built) => built.data.empty || !built.data.complete,
|
|
330
332
|
),
|
|
331
|
-
));
|
|
333
|
+
)).finally(progress.stop);
|
|
332
334
|
// A company's name typed where its ticker goes (`fn RDCF Palantir`) found nothing: the answer is `quote`'s,
|
|
333
335
|
// "Not a ticker: PALANTIR. Did you mean PLTR (Palantir Technologies Inc.)?", not an empty report. A source that
|
|
334
336
|
// could not answer for the word (a timeout) says nothing of it, but when search finds the company it is that.
|
|
@@ -374,7 +376,11 @@ export async function runPaneFunction(args: string[], ctx: CliCommandContext) {
|
|
|
374
376
|
// A report with no data writes no file: a header alone would read as a screen that matched nothing. It fails
|
|
375
377
|
// as plain --json fails, with its code and whether to retry.
|
|
376
378
|
if (failure) failWithError({ ...failure, details: `Nothing was written to ${outputPath}.` });
|
|
377
|
-
|
|
379
|
+
// A CSV file holds its rows alone; its closing source and note lines go to stderr, as printed CSV's do.
|
|
380
|
+
const written = renderForFile(() => serializeCliResult(result, ctx.cliOptions, render));
|
|
381
|
+
const { csv, footer } = ctx.cliOptions.format === "csv" ? splitCsvFooter(written) : { csv: written, footer: [] };
|
|
382
|
+
await writeOutputFile(outputPath, `${csv}\n`);
|
|
383
|
+
if (!ctx.cliOptions.quiet) for (const line of footer) console.error(line);
|
|
378
384
|
// What was written and where; warnings go to stderr as they would beside printed rows, and JSON keeps its envelope.
|
|
379
385
|
const saved = { output: outputPath, format: ctx.cliOptions.format, rows: report.data.rowCount };
|
|
380
386
|
printCliResult({ data: saved, ...(warnings.length > 0 ? { warnings } : {}) },
|
|
@@ -426,6 +432,26 @@ export function emptySeriesExport(
|
|
|
426
432
|
/** How long a capture's process may stay up after its output, for a report it stopped waiting for. */
|
|
427
433
|
const STALLED_REPORT_EXIT_MS = 1_000;
|
|
428
434
|
|
|
435
|
+
/** A capture still going after this long says what it is doing, so it never looks stuck. */
|
|
436
|
+
const SHOT_PROGRESS_AFTER_MS = 3_000;
|
|
437
|
+
/** A report, which most often prints within this, says so only past it. */
|
|
438
|
+
const FN_PROGRESS_AFTER_MS = 5_000;
|
|
439
|
+
|
|
440
|
+
/**
|
|
441
|
+
* One line on standard error when a capture or report is slow: "Still loading
|
|
442
|
+
* the data for PORT izmir." while its data is read, "Still drawing PORT
|
|
443
|
+
* izmir." once a capture's page draws it. Nothing for a quick one, or with --quiet.
|
|
444
|
+
*/
|
|
445
|
+
function progressNotice(ctx: Pick<CliCommandContext, "cliOptions">, label: string, afterMs = SHOT_PROGRESS_AFTER_MS): { drawing(): void; stop(): void } {
|
|
446
|
+
if (ctx.cliOptions.quiet) return { drawing: () => {}, stop: () => {} };
|
|
447
|
+
let drawing = false;
|
|
448
|
+
const timer = setTimeout(() => {
|
|
449
|
+
console.error(cliStyles.muted(drawing ? `Still drawing ${label}.` : `Still loading the data for ${label}.`));
|
|
450
|
+
}, afterMs);
|
|
451
|
+
(timer as { unref?: () => void }).unref?.();
|
|
452
|
+
return { drawing: () => { drawing = true; }, stop: () => clearTimeout(timer) };
|
|
453
|
+
}
|
|
454
|
+
|
|
429
455
|
export async function runPaneScreenshot(args: string[], ctx: CliCommandContext) {
|
|
430
456
|
let stalledReport = false;
|
|
431
457
|
try {
|
|
@@ -455,6 +481,7 @@ async function capturePaneScreenshot(args: string[], ctx: CliCommandContext, onS
|
|
|
455
481
|
const outputPath = parsed.outputPath
|
|
456
482
|
? resolve(process.cwd(), ensurePngExtension(parsed.outputPath))
|
|
457
483
|
: defaultScreenshotPath(resolved, parsed.arg);
|
|
484
|
+
const progress = progressNotice(ctx, [resolved.token, parsed.arg].filter(Boolean).join(" "));
|
|
458
485
|
const result = await renderDesktopShot({
|
|
459
486
|
resolved,
|
|
460
487
|
context,
|
|
@@ -469,7 +496,8 @@ async function capturePaneScreenshot(args: string[], ctx: CliCommandContext, onS
|
|
|
469
496
|
fitRows: parsed.heightGiven !== true,
|
|
470
497
|
options: parsed.options,
|
|
471
498
|
onStalledReport,
|
|
472
|
-
|
|
499
|
+
onDrawing: progress.drawing,
|
|
500
|
+
}).finally(progress.stop).catch(async (error: unknown) => {
|
|
473
501
|
// A company's name typed where its ticker goes fails as `fn` words it, with the company search finds.
|
|
474
502
|
const { quote, error: quoteError } = parsed.listing ? await loadListingQuoteAnswer(context.dataProvider, parsed.listing) : { quote: null, error: undefined };
|
|
475
503
|
const stop = parsed.listing && !quote ? await notATickerStop(quoteError, parsed.listing, context) : null;
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
nextRegularSessionOpen,
|
|
9
9
|
} from "../../market-data/market/freshness";
|
|
10
10
|
import { futuresWeekendClosure } from "../../market-data/market/futures-week";
|
|
11
|
-
import { currentFxClosureStart,
|
|
11
|
+
import { currentFxClosureStart, isFxWeekClosePrint, nextFxWeekOpen } from "../../utils/fx-market-hours";
|
|
12
12
|
import { zonedDateKey } from "../../utils/zoned-date-time";
|
|
13
13
|
import type { ReportTime } from "../../utils/utc-time";
|
|
14
14
|
import type { QuoteIndexSession } from "../../types/financials";
|
|
@@ -63,9 +63,14 @@ const US_EXCHANGE_TIME_ZONE = "America/New_York";
|
|
|
63
63
|
function venueSession(exchange: string, marketState: string | undefined, now: number, calendar?: QuoteIndexSession): VenueSession | null {
|
|
64
64
|
if (isAlwaysOpenExchange(exchange)) return { state: "always" };
|
|
65
65
|
// Spot FX trades its week, Sunday 17:00 to Friday 17:00 New York, by the clock as an exchange rate's line has it.
|
|
66
|
-
// A source's own state is not its week:
|
|
66
|
+
// A source's own state is not its week: a quote source stamps a pair CLOSED from that open to London's midnight, which read
|
|
67
67
|
// `markets closed` beside `fx`'s `markets open` for the same pair.
|
|
68
|
-
|
|
68
|
+
// Shut, it says when it reopens, as a futures venue's weekend does: the week's first trade, Sunday 17:00 New York.
|
|
69
|
+
if (exchange === FX_VENUE) {
|
|
70
|
+
const reopens = nextFxWeekOpen(now);
|
|
71
|
+
return reopens == null ? { state: "open" } : { state: "closed", timeZone: US_EXCHANGE_TIME_ZONE,
|
|
72
|
+
next: { date: zonedDateKey(reopens, US_EXCHANGE_TIME_ZONE), open: reopens, firstTrade: true } };
|
|
73
|
+
}
|
|
69
74
|
const next = nextRegularSessionOpen(exchange, now);
|
|
70
75
|
if (next) {
|
|
71
76
|
const { timeZone } = next;
|
|
@@ -144,7 +144,7 @@ export function parsePaneFunctionArgsFor(
|
|
|
144
144
|
args: string[],
|
|
145
145
|
globalOptions: { limit?: number; tail?: number } = {},
|
|
146
146
|
): ParsedPaneFunctionArgs {
|
|
147
|
-
const parsed =
|
|
147
|
+
const parsed = withKeywordNote(registry, withOpeningWord(registry, parsePaneFunctionArgs(args, globalOptions)));
|
|
148
148
|
const found = parsed.target ? findPaneFunction(registry, parsed.target) : null;
|
|
149
149
|
if (!found?.pane) return parsed;
|
|
150
150
|
const capability = getPaneFunctionCapability(found.template, found.pane);
|
|
@@ -156,13 +156,15 @@ export function parsePaneFunctionArgsFor(
|
|
|
156
156
|
}
|
|
157
157
|
|
|
158
158
|
/**
|
|
159
|
-
* A word that opens no function by its code but names one case of a
|
|
160
|
-
* (`discovery.opens`: `VX`, `vix futures`) runs that function on the
|
|
161
|
-
* argument, and says so: `fn VX` is `fn CTM VIX
|
|
162
|
-
*
|
|
159
|
+
* A word that opens no function by its code or name but names one case of a
|
|
160
|
+
* function (`discovery.opens`: `VX`, `vix futures`) runs that function on the
|
|
161
|
+
* case's argument, and says so: `fn VX` is `fn CTM VIX`, and `fn TVL` is
|
|
162
|
+
* `fn CRYP defi` though TVL is also one of CRYP's keywords. A word typed with
|
|
163
|
+
* an argument of its own keeps it.
|
|
163
164
|
*/
|
|
164
165
|
function withOpeningWord(registry: PaneFunctionCatalog, parsed: ParsedPaneFunctionArgs): ParsedPaneFunctionArgs {
|
|
165
|
-
|
|
166
|
+
const found = parsed.target ? findPaneFunction(registry, parsed.target) : null;
|
|
167
|
+
if (!parsed.target || (found?.pane && namesFunction(found.template, found.pane, parsed.target))) return parsed;
|
|
166
168
|
const wanted = normalizeLookupToken(parsed.target);
|
|
167
169
|
for (const template of registry.paneTemplates.values()) {
|
|
168
170
|
const pane = registry.panes.get(template.paneId);
|
|
@@ -185,15 +187,20 @@ function withKeywordNote(registry: PaneFunctionCatalog, parsed: ParsedPaneFuncti
|
|
|
185
187
|
const found = parsed.target ? findPaneFunction(registry, parsed.target) : null;
|
|
186
188
|
if (!found?.pane || !found.template) return parsed;
|
|
187
189
|
const { template, pane } = found;
|
|
188
|
-
|
|
189
|
-
const headless = getHeadlessPaneDefinition(template, pane);
|
|
190
|
-
const names = [template.shortcut?.prefix, ...template.shortcut?.aliases ?? [], template.id, template.label, pane.id, pane.name,
|
|
191
|
-
headless?.discovery?.id, ...headless?.discovery?.aliases ?? []];
|
|
192
|
-
if (names.some((name) => name && normalizeLookupToken(name) === wanted)) return parsed;
|
|
190
|
+
if (namesFunction(template, pane, parsed.target)) return parsed;
|
|
193
191
|
const code = paneFunctionCode(template, pane);
|
|
194
192
|
return { ...parsed, listingNotes: [...parsed.listingNotes ?? [], `${parsed.target} opened ${code}, ${template.label}.`] };
|
|
195
193
|
}
|
|
196
194
|
|
|
195
|
+
/** Whether a word is the function's code, an alias or a name, rather than one of its keywords. */
|
|
196
|
+
function namesFunction(template: PaneTemplateDef | undefined, pane: PaneDef, word: string): boolean {
|
|
197
|
+
const wanted = normalizeLookupToken(word);
|
|
198
|
+
const headless = getHeadlessPaneDefinition(template, pane);
|
|
199
|
+
const names = [template?.shortcut?.prefix, ...template?.shortcut?.aliases ?? [], template?.id, template?.label, pane.id, pane.name,
|
|
200
|
+
headless?.discovery?.id, ...headless?.discovery?.aliases ?? []];
|
|
201
|
+
return names.some((name) => name && normalizeLookupToken(name) === wanted);
|
|
202
|
+
}
|
|
203
|
+
|
|
197
204
|
/**
|
|
198
205
|
* `fn ANR SAN --exchange EPA` is `fn ANR SAN:EPA`: a function that takes
|
|
199
206
|
* tickers gets each listing as `quote` reads it (`resolveCliListing`), so
|