@gloom-sh/terminal 0.20.12 → 0.20.14
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 +2 -1
- package/patches/@opentui%2Fcore@0.3.2.patch +22 -4
- package/src/account/auth-dialog.tsx +22 -4
- package/src/account/auth-form.tsx +6 -1
- package/src/account/billing.ts +3 -2
- package/src/account/checkout-handoff.tsx +7 -14
- package/src/account/device-signin-dialog.tsx +35 -24
- package/src/account/upgrade-dialog.tsx +8 -8
- package/src/api-client/crypto-markets.ts +10 -0
- package/src/api-client/errors.ts +3 -1
- package/src/api-client/index.ts +10 -2
- package/src/api-client/install-experiments.ts +146 -0
- package/src/api-client/money-markets.ts +7 -0
- package/src/api-client/request.ts +12 -2
- package/src/api-client/telemetry.ts +47 -0
- package/src/api-client/types/market.ts +4 -0
- package/src/api-client/types/news.ts +16 -0
- package/src/architecture/floating-promise-allowlist.json +17 -34
- package/src/brokers/signed-in/adapter.ts +2 -2
- package/src/brokers/signed-in/catalog.ts +13 -4
- package/src/brokers/signed-in/sign-in-dialog.tsx +38 -38
- package/src/cli/commands/market.ts +146 -55
- package/src/cli/commands/overview.ts +21 -7
- package/src/cli/commands/search.ts +103 -9
- package/src/cli/commands/ticker.ts +22 -13
- package/src/cli/earnings-calendar.ts +33 -53
- package/src/cli/errors.ts +3 -1
- package/src/cli/freshness.ts +7 -2
- package/src/cli/glossary.ts +10 -5
- package/src/cli/helpers.ts +8 -16
- package/src/cli/history-export.ts +4 -0
- package/src/cli/history-rows.ts +18 -1
- package/src/cli/known-gaps.ts +11 -2
- package/src/cli/listing-arg.ts +183 -28
- package/src/cli/not-a-ticker.ts +4 -0
- package/src/cli/pane-functions/catalog.ts +81 -12
- package/src/cli/pane-functions/dom.ts +8 -1
- package/src/cli/pane-functions/freshness.ts +2 -2
- package/src/cli/pane-functions/headless.ts +13 -10
- package/src/cli/pane-functions/index.ts +1 -1
- package/src/cli/pane-functions/options.ts +7 -0
- package/src/cli/pane-functions/report.ts +4 -1
- package/src/cli/pane-functions/resolver.ts +61 -15
- package/src/cli/perpetual-contract.ts +4 -4
- package/src/cli/quote-answer.ts +6 -2
- package/src/cli/result.ts +24 -5
- package/src/cli/symbol-args.ts +5 -3
- package/src/cli/symbol-list.ts +23 -10
- package/src/cli/symbol-rows.ts +135 -3
- package/src/cli/treasury-yields.ts +15 -1
- package/src/components/chart/composite/axis-overlays.tsx +5 -2
- package/src/components/chart/composite/composite-chart.tsx +1 -0
- package/src/components/chart/composite/format.ts +103 -16
- package/src/components/chart/composite/legend.tsx +60 -25
- package/src/components/chart/composite/panel-surface/axis-markers.ts +133 -0
- package/src/components/chart/composite/panel-surface/level-labels.tsx +78 -0
- package/src/components/chart/composite/panel-surface/overlays.ts +108 -0
- package/src/components/chart/composite/panel-surface/pan-coast.ts +54 -0
- package/src/components/chart/composite/panel-surface/panel-cursor.tsx +138 -0
- package/src/components/chart/composite/panel-surface/panel-levels.ts +47 -0
- package/src/components/chart/composite/panel-surface/plot-gestures.ts +403 -0
- package/src/components/chart/composite/panel-surface/plot-pointer.ts +65 -0
- package/src/components/chart/composite/panel-surface/plot-wheel.ts +102 -0
- package/src/components/chart/composite/panel-surface/pointer.ts +12 -0
- package/src/components/chart/composite/panel-surface/props.ts +79 -0
- package/src/components/chart/composite/panel-surface/tool-readout.ts +151 -0
- package/src/components/chart/composite/panel-surface/value-axis-gestures.ts +152 -0
- package/src/components/chart/composite/panel-surface.tsx +81 -1177
- package/src/components/chart/composite/time-axis.ts +51 -29
- package/src/components/chart/composite/toolbar.tsx +42 -6
- package/src/components/chart/curve/curve-surface.tsx +5 -5
- package/src/components/command-bar/commands/collection-list.ts +1 -0
- package/src/components/command-bar/list/badge.ts +8 -5
- package/src/components/command-bar/list/model.ts +0 -5
- package/src/components/command-bar/list/view.tsx +39 -2
- package/src/components/command-bar/routes/root/plugin-install.ts +4 -2
- package/src/components/command-bar/routes/root/provider-search.ts +23 -3
- package/src/components/command-bar/routes/root/results.ts +23 -11
- package/src/components/command-bar/routes/root/runtime.ts +3 -2
- package/src/components/command-bar/routes/root/selection.ts +3 -2
- package/src/components/command-bar/routes/root/shortcuts.ts +15 -0
- package/src/components/command-bar/routes/root/start-here.ts +1 -2
- package/src/components/command-bar/routes/ticker-search/actions.ts +2 -3
- package/src/components/command-bar/routes/ticker-search/results.ts +23 -4
- package/src/components/data-table/view.tsx +29 -6
- package/src/components/form-modal/host.tsx +1 -1
- package/src/components/layout/header.tsx +3 -2
- package/src/components/layout/market-summary.ts +3 -3
- package/src/components/layout/pane/error-boundary.tsx +2 -1
- package/src/components/layout/pane/title.ts +10 -4
- package/src/components/markdown-text.tsx +36 -0
- package/src/components/market-board/index.tsx +4 -3
- package/src/components/onboarding/first-run-workspace.ts +46 -11
- package/src/components/onboarding/onboarding-keyboard.ts +57 -5
- package/src/components/onboarding/onboarding-wizard.tsx +91 -24
- package/src/components/onboarding/portfolio-step/index.tsx +1 -0
- package/src/components/onboarding/portfolio-step/positions-panel.tsx +36 -9
- package/src/components/onboarding/portfolio-step/types.ts +2 -0
- package/src/components/onboarding/tickers-step-model.ts +140 -0
- package/src/components/onboarding/tickers-step.tsx +116 -0
- package/src/components/onboarding/use-onboarding-broker-form.ts +1 -1
- package/src/components/onboarding/use-onboarding-progress.ts +100 -11
- package/src/components/onboarding/use-onboarding-upgrade.ts +3 -2
- package/src/components/onboarding/wizard-model.ts +3 -1
- package/src/components/onboarding/wizard-tickers.ts +139 -0
- package/src/components/pane-settings-dialog/tui.tsx +6 -3
- package/src/components/pane-settings-dialog.tsx +2 -1
- package/src/components/pane-template-wizard.tsx +2 -0
- package/src/components/price-performance.tsx +2 -2
- package/src/components/speedometer-gauge/model.ts +2 -1
- package/src/components/speedometer-gauge/terminal.tsx +13 -8
- package/src/components/ui/choice-dialog.tsx +102 -33
- package/src/components/ui/confirm-dialog.tsx +3 -2
- package/src/components/ui/frame.tsx +7 -3
- package/src/components/ui/icon.tsx +4 -2
- package/src/components/ui/list-view.tsx +8 -0
- package/src/components/ui/multi-select/dialog.tsx +1 -7
- package/src/components/ui/not-meaningful.ts +16 -0
- package/src/components/ui/number-prompt-dialog.tsx +2 -1
- package/src/components/ui/query-bar.tsx +16 -4
- package/src/components/ui/stat-grid.tsx +27 -6
- package/src/components/use-pane-notice-footer.tsx +3 -1
- package/src/data/config/store/normalize.ts +2 -0
- package/src/docs/snapshot.json +3 -3
- package/src/i18n/es.ts +6 -2
- package/src/i18n/ja.ts +6 -2
- package/src/i18n/ko.ts +6 -2
- package/src/i18n/zh-cn.ts +6 -2
- package/src/i18n/zh-tw.ts +6 -2
- package/src/layout-marketplace/model.ts +2 -1
- package/src/market-data/futures-contract.ts +2 -1
- package/src/market-data/hooks.tsx +1 -1
- package/src/market-data/market/change-basis.ts +27 -5
- package/src/market-data/market/format.ts +48 -14
- package/src/market-data/quotes/contributions.ts +13 -0
- package/src/market-data/quotes/export-identity.ts +36 -1
- package/src/market-data/quotes/listing-enterprise-value.ts +3 -3
- package/src/market-data/quotes/resolution.ts +16 -0
- package/src/market-data/quotes/time.ts +17 -10
- package/src/market-data/tax-equivalent.ts +3 -2
- package/src/news/aggregator.ts +19 -8
- package/src/news/hooks.ts +1 -1
- package/src/news/news-model.ts +49 -0
- package/src/news/types.ts +9 -0
- package/src/plugins/builtin/account-management/calendar-tab.tsx +8 -3
- package/src/plugins/builtin/account-management/pane.tsx +9 -8
- package/src/plugins/builtin/account-management/password-dialog.tsx +2 -2
- package/src/plugins/builtin/alerts/calendar-events.ts +4 -5
- package/src/plugins/builtin/alerts/format.ts +6 -5
- package/src/plugins/builtin/alerts/headless.ts +3 -2
- package/src/plugins/builtin/alerts/history.ts +2 -1
- package/src/plugins/builtin/alerts/pane.tsx +2 -1
- package/src/plugins/builtin/alerts/price-text.ts +2 -1
- package/src/plugins/builtin/alerts/scheduled.ts +6 -5
- package/src/plugins/builtin/analytics/account-returns.ts +6 -7
- package/src/plugins/builtin/analytics/display.ts +2 -1
- package/src/plugins/builtin/analytics/pane-model.ts +5 -9
- package/src/plugins/builtin/analytics/risk-client.ts +12 -2
- package/src/plugins/builtin/analytics/risk-headless.ts +66 -6
- package/src/plugins/builtin/analytics/risk-math.ts +23 -6
- package/src/plugins/builtin/analytics/risk-model.ts +26 -15
- package/src/plugins/builtin/analytics/risk-pane.tsx +8 -7
- package/src/plugins/builtin/analytics/view.tsx +5 -5
- package/src/plugins/builtin/attention/model.ts +6 -5
- package/src/plugins/builtin/attention/pane.tsx +5 -4
- package/src/plugins/builtin/awards/detail.tsx +5 -4
- package/src/plugins/builtin/awards/headless.ts +8 -7
- package/src/plugins/builtin/awards/model.ts +4 -3
- package/src/plugins/builtin/awards/pane.tsx +4 -4
- package/src/plugins/builtin/backtest/format.ts +3 -2
- package/src/plugins/builtin/backtest/report.ts +3 -2
- package/src/plugins/builtin/bond-calculator/headless.ts +2 -1
- package/src/plugins/builtin/bond-calculator/pane.tsx +2 -1
- package/src/plugins/builtin/broker-manager/add-flow.tsx +1 -1
- package/src/plugins/builtin/broker-trading/orders-data.ts +3 -3
- package/src/plugins/builtin/broker-trading/orders.tsx +3 -2
- package/src/plugins/builtin/broker-trading/ticket.tsx +2 -2
- package/src/plugins/builtin/buildout/cells.tsx +2 -1
- package/src/plugins/builtin/buildout/company/pane.tsx +4 -3
- package/src/plugins/builtin/buildout/data-runtime.ts +21 -23
- package/src/plugins/builtin/buildout/detail/values.ts +2 -1
- package/src/plugins/builtin/buildout/format.ts +4 -3
- package/src/plugins/builtin/buildout/pane/index.tsx +3 -3
- package/src/plugins/builtin/catalysts/detail.tsx +2 -1
- package/src/plugins/builtin/catalysts/model.ts +6 -5
- package/src/plugins/builtin/catalysts/pane.tsx +2 -1
- package/src/plugins/builtin/cds/headless.ts +3 -2
- package/src/plugins/builtin/cds/model.ts +8 -8
- package/src/plugins/builtin/cds/pane.tsx +3 -2
- package/src/plugins/builtin/central-bank-rates/headless.ts +2 -1
- package/src/plugins/builtin/central-bank-rates/model.ts +3 -2
- package/src/plugins/builtin/central-bank-rates/pane.tsx +5 -5
- package/src/plugins/builtin/changelog/index.tsx +2 -2
- package/src/plugins/builtin/chart-composer/catalog-inventory.ts +5 -2
- package/src/plugins/builtin/chart-composer/editor.tsx +1 -0
- package/src/plugins/builtin/chart-composer/index.tsx +4 -2
- package/src/plugins/builtin/chart-composer/pane.tsx +8 -4
- package/src/plugins/builtin/chart-composer/quick-add.tsx +4 -1
- package/src/plugins/builtin/chart-composer/series-catalog.ts +17 -1
- package/src/plugins/builtin/chart-composer/use-series-catalog.ts +3 -1
- package/src/plugins/builtin/chart-composer/user-series.ts +3 -1
- package/src/plugins/builtin/chat/attachments/desktop.tsx +2 -1
- package/src/plugins/builtin/chat/controller/utils.ts +2 -1
- package/src/plugins/builtin/clinical-trials/model.ts +4 -3
- package/src/plugins/builtin/clinical-trials/sponsor-tickers.ts +4 -2
- package/src/plugins/builtin/cloud/askg/lock-note.ts +16 -4
- package/src/plugins/builtin/cloud/askg/model.ts +2 -1
- package/src/plugins/builtin/cloud/askg/pane.tsx +35 -1
- package/src/plugins/builtin/cloud/company-picker.tsx +1 -3
- package/src/plugins/builtin/cloud/plugin.tsx +2 -0
- package/src/plugins/builtin/cloud/team/pane.tsx +12 -12
- package/src/plugins/builtin/cloud/thesis/detail.tsx +13 -8
- package/src/plugins/builtin/cloud/thesis/module.tsx +2 -0
- package/src/plugins/builtin/cloud/upgrade-status-widget.tsx +6 -2
- package/src/plugins/builtin/cloud-tweets/model.ts +2 -2
- package/src/plugins/builtin/comment-letters/pane.tsx +2 -1
- package/src/plugins/builtin/commodity-balances/headless.ts +3 -2
- package/src/plugins/builtin/company-attention/app-rank.tsx +5 -4
- package/src/plugins/builtin/company-attention/building-model.ts +7 -7
- package/src/plugins/builtin/company-attention/headless.ts +6 -5
- package/src/plugins/builtin/company-attention/model.ts +4 -4
- package/src/plugins/builtin/company-attention/moves-model.ts +9 -9
- package/src/plugins/builtin/company-attention/signals-model.ts +9 -9
- package/src/plugins/builtin/company-kpis/headless.ts +2 -1
- package/src/plugins/builtin/company-kpis/model.ts +15 -10
- package/src/plugins/builtin/company-kpis/pane.tsx +2 -2
- package/src/plugins/builtin/congress-trades/detail.tsx +6 -5
- package/src/plugins/builtin/congress-trades/headless.ts +2 -1
- package/src/plugins/builtin/congress-trades/model.ts +6 -6
- package/src/plugins/builtin/congress-trades/table.tsx +7 -6
- package/src/plugins/builtin/connections/pane.tsx +5 -5
- package/src/plugins/builtin/correlation/headless.ts +2 -2
- package/src/plugins/builtin/correlation/index.tsx +4 -1
- package/src/plugins/builtin/correlation/matrix/selection.ts +2 -1
- package/src/plugins/builtin/correlation/relationship/view-model.ts +3 -3
- package/src/plugins/builtin/cot/headless.ts +3 -2
- package/src/plugins/builtin/cot/model.ts +2 -1
- package/src/plugins/builtin/cot/pane.tsx +4 -3
- package/src/plugins/builtin/cpi/headless.ts +10 -4
- package/src/plugins/builtin/cpi/model.ts +25 -7
- package/src/plugins/builtin/cpi/pane.tsx +3 -1
- package/src/plugins/builtin/credit-boards/cdx-pane.tsx +5 -4
- package/src/plugins/builtin/credit-boards/headless.ts +2 -1
- package/src/plugins/builtin/credit-boards/model.ts +5 -5
- package/src/plugins/builtin/credit-conditions/headless.ts +2 -1
- package/src/plugins/builtin/credit-conditions/index.tsx +2 -2
- package/src/plugins/builtin/credit-documents/model.ts +2 -2
- package/src/plugins/builtin/crypto-board/client.ts +6 -1
- package/src/plugins/builtin/crypto-board/defi-view.tsx +7 -7
- package/src/plugins/builtin/crypto-board/defi.ts +2 -2
- package/src/plugins/builtin/crypto-board/headless.ts +10 -2
- package/src/plugins/builtin/crypto-board/model.ts +93 -14
- package/src/plugins/builtin/crypto-board/pane.tsx +28 -13
- package/src/plugins/builtin/crypto-board/supply.ts +2 -2
- package/src/plugins/builtin/crypto-etf-flows/model.ts +4 -4
- package/src/plugins/builtin/custom-view/index.tsx +3 -1
- package/src/plugins/builtin/custom-view/pane.tsx +5 -1
- package/src/plugins/builtin/custom-view/view-spec.ts +11 -0
- package/src/plugins/builtin/debt-maturities/model.ts +3 -3
- package/src/plugins/builtin/debt-maturities/pane.tsx +2 -2
- package/src/plugins/builtin/dividend-yield/client.ts +31 -5
- package/src/plugins/builtin/dividend-yield/headless.ts +20 -13
- package/src/plugins/builtin/dividend-yield/pane.tsx +12 -10
- package/src/plugins/builtin/dividend-yield/ranking-view.tsx +4 -1
- package/src/plugins/builtin/dividend-yield/ranking.ts +21 -12
- package/src/plugins/builtin/dividend-yield/types.ts +4 -0
- package/src/plugins/builtin/dividend-yield/view.ts +8 -4
- package/src/plugins/builtin/docs/use-docs.ts +4 -2
- package/src/plugins/builtin/doe/headless.ts +2 -1
- package/src/plugins/builtin/doe/model.ts +12 -11
- package/src/plugins/builtin/earnings/board-model.ts +14 -8
- package/src/plugins/builtin/earnings/board-table.ts +13 -8
- package/src/plugins/builtin/earnings/calendar-model.ts +5 -5
- package/src/plugins/builtin/earnings/calendar.tsx +2 -1
- package/src/plugins/builtin/earnings/format.ts +16 -14
- package/src/plugins/builtin/earnings/headless.ts +57 -19
- package/src/plugins/builtin/earnings/history-model.ts +11 -7
- package/src/plugins/builtin/earnings/history-table.ts +22 -9
- package/src/plugins/builtin/earnings/history.tsx +4 -3
- package/src/plugins/builtin/earnings-calls/calendar.tsx +2 -1
- package/src/plugins/builtin/earnings-calls/format.ts +6 -5
- package/src/plugins/builtin/earnings-calls/upcoming.ts +5 -5
- package/src/plugins/builtin/earnings-ripple/headless.ts +2 -1
- package/src/plugins/builtin/earnings-ripple/index.tsx +2 -0
- package/src/plugins/builtin/earnings-ripple/model.ts +3 -2
- package/src/plugins/builtin/earnings-ripple/pane.tsx +6 -6
- package/src/plugins/builtin/econ/calendar-model.ts +19 -3
- package/src/plugins/builtin/econ/detail-view.tsx +2 -2
- package/src/plugins/builtin/econ/fred-catalog.ts +33 -4
- package/src/plugins/builtin/econ/index.tsx +7 -6
- package/src/plugins/builtin/econ-statistics/detail.tsx +2 -1
- package/src/plugins/builtin/econ-statistics/headless.ts +25 -4
- package/src/plugins/builtin/econ-statistics/pane.tsx +2 -2
- package/src/plugins/builtin/equity-screener/headless.ts +5 -5
- package/src/plugins/builtin/equity-screener/model.ts +6 -4
- package/src/plugins/builtin/equity-screener/pane.tsx +7 -7
- package/src/plugins/builtin/equity-screener/screen-check.ts +2 -1
- package/src/plugins/builtin/equity-screener/ticker-check.tsx +2 -1
- package/src/plugins/builtin/estimate-revisions/model.ts +3 -2
- package/src/plugins/builtin/estimate-revisions/pane.tsx +8 -8
- package/src/plugins/builtin/executives/format.ts +4 -4
- package/src/plugins/builtin/exposure/headless.ts +8 -8
- package/src/plugins/builtin/exposure/model.ts +4 -3
- package/src/plugins/builtin/exposure/pane.tsx +6 -5
- package/src/plugins/builtin/fear-greed/format.ts +7 -7
- package/src/plugins/builtin/fear-greed/headless.ts +2 -1
- package/src/plugins/builtin/filing-events/feed.ts +2 -1
- package/src/plugins/builtin/futures/table.tsx +8 -8
- package/src/plugins/builtin/futures-curve/headless.ts +18 -18
- package/src/plugins/builtin/futures-curve/model.ts +5 -5
- package/src/plugins/builtin/futures-curve/pane.tsx +8 -8
- package/src/plugins/builtin/fx-matrix/index.tsx +2 -2
- package/src/plugins/builtin/fx-matrix/pairs.ts +2 -1
- package/src/plugins/builtin/gpu/board.tsx +6 -5
- package/src/plugins/builtin/gpu/changes.tsx +2 -1
- package/src/plugins/builtin/gpu/equities.tsx +2 -2
- package/src/plugins/builtin/gpu/headless.ts +4 -3
- package/src/plugins/builtin/gpu/model.ts +8 -7
- package/src/plugins/builtin/help/functions-table.tsx +41 -9
- package/src/plugins/builtin/help/index.tsx +6 -3
- package/src/plugins/builtin/help/keybindings-editor.tsx +35 -7
- package/src/plugins/builtin/help/shortcut-table.tsx +19 -7
- package/src/plugins/builtin/help/table-cells.tsx +51 -0
- package/src/plugins/builtin/holders/pane.tsx +4 -1
- package/src/plugins/builtin/insider/base-values.ts +2 -2
- package/src/plugins/builtin/insider/display.ts +2 -1
- package/src/plugins/builtin/insider/headless.ts +16 -16
- package/src/plugins/builtin/insider/insider-data.ts +2 -1
- package/src/plugins/builtin/insider/signals-model.ts +3 -3
- package/src/plugins/builtin/insider/table-model.ts +27 -13
- package/src/plugins/builtin/insider/table.tsx +1 -1
- package/src/plugins/builtin/ipo-calendar/model.ts +4 -4
- package/src/plugins/builtin/iv-history/format.ts +8 -7
- package/src/plugins/builtin/iv-history/headless.ts +9 -8
- package/src/plugins/builtin/iv-history/pane.tsx +3 -2
- package/src/plugins/builtin/iv-history/screen-pane.tsx +5 -4
- package/src/plugins/builtin/jobs/headless.ts +11 -11
- package/src/plugins/builtin/jobs/model.ts +2 -2
- package/src/plugins/builtin/jobs/pane.tsx +5 -5
- package/src/plugins/builtin/jodi/model.ts +2 -2
- package/src/plugins/builtin/jodi/pane.tsx +2 -1
- package/src/plugins/builtin/kelly-sizer/headless.ts +4 -4
- package/src/plugins/builtin/kelly-sizer/model.ts +2 -1
- package/src/plugins/builtin/kelly-sizer/sections.tsx +2 -2
- package/src/plugins/builtin/macro-day/headless.ts +27 -15
- package/src/plugins/builtin/macro-day/model.ts +42 -4
- package/src/plugins/builtin/macro-day/pane.tsx +30 -12
- package/src/plugins/builtin/macro-day/releases.ts +24 -1
- package/src/plugins/builtin/market-halts/model.ts +11 -10
- package/src/plugins/builtin/market-halts/pane.tsx +2 -1
- package/src/plugins/builtin/market-heatmap/index.tsx +4 -4
- package/src/plugins/builtin/market-movers/session-table.ts +3 -3
- package/src/plugins/builtin/market-movers/session.ts +2 -1
- package/src/plugins/builtin/market-movers/table.ts +5 -5
- package/src/plugins/builtin/market-valuation/detail.tsx +2 -2
- package/src/plugins/builtin/market-valuation/headless.ts +7 -7
- package/src/plugins/builtin/market-valuation/pane.tsx +7 -7
- package/src/plugins/builtin/members/breadth-pane.tsx +5 -4
- package/src/plugins/builtin/members/headless.ts +2 -1
- package/src/plugins/builtin/members/model.ts +3 -2
- package/src/plugins/builtin/members/pane.tsx +10 -9
- package/src/plugins/builtin/mna/distress/model.ts +2 -1
- package/src/plugins/builtin/mna/model.ts +5 -5
- package/src/plugins/builtin/money-markets/client.ts +4 -1
- package/src/plugins/builtin/money-markets/headless.ts +17 -5
- package/src/plugins/builtin/money-markets/index.tsx +1 -1
- package/src/plugins/builtin/money-markets/model.ts +3 -2
- package/src/plugins/builtin/money-markets/pane.tsx +11 -5
- package/src/plugins/builtin/news/headless.ts +5 -2
- package/src/plugins/builtin/news/wire/breaking/notifications.ts +21 -19
- package/src/plugins/builtin/news/wire/news/row.ts +3 -1
- package/src/plugins/builtin/news/wire/news/table.tsx +3 -2
- package/src/plugins/builtin/news/wire/persisted-articles.ts +28 -3
- package/src/plugins/builtin/notes/headless.ts +2 -1
- package/src/plugins/builtin/notes/model.ts +2 -1
- package/src/plugins/builtin/openfda/pane.tsx +4 -3
- package/src/plugins/builtin/options/carry.ts +3 -2
- package/src/plugins/builtin/options/market-reference.ts +2 -1
- package/src/plugins/builtin/options/table.ts +48 -9
- package/src/plugins/builtin/options/view.tsx +47 -17
- package/src/plugins/builtin/options-calculator/headless.ts +3 -2
- package/src/plugins/builtin/options-calculator/pane.tsx +7 -7
- package/src/plugins/builtin/options-positioning/headless.ts +8 -7
- package/src/plugins/builtin/options-positioning/model.ts +10 -10
- package/src/plugins/builtin/options-positioning/pane.tsx +5 -5
- package/src/plugins/builtin/options-scenario/collar.ts +5 -4
- package/src/plugins/builtin/options-scenario/csp-screen-headless.ts +11 -10
- package/src/plugins/builtin/options-scenario/csp-screen-pane.tsx +15 -14
- package/src/plugins/builtin/options-scenario/csp-screen.ts +2 -1
- package/src/plugins/builtin/options-scenario/csp.ts +6 -5
- package/src/plugins/builtin/options-scenario/headless.ts +6 -5
- package/src/plugins/builtin/options-scenario/hedge.ts +3 -3
- package/src/plugins/builtin/options-scenario/pane.tsx +7 -6
- package/src/plugins/builtin/options-scenario/strategy-screen.ts +1 -1
- package/src/plugins/builtin/pe-band/headless.ts +9 -8
- package/src/plugins/builtin/pe-band/pane.tsx +7 -7
- package/src/plugins/builtin/perps/cascade.ts +3 -2
- package/src/plugins/builtin/perps/headless.ts +10 -9
- package/src/plugins/builtin/perps/model.ts +14 -14
- package/src/plugins/builtin/perps/pane.tsx +3 -2
- package/src/plugins/builtin/portfolio-list/cli/bulk-symbols.ts +4 -2
- package/src/plugins/builtin/portfolio-list/cli/period-report.ts +61 -11
- package/src/plugins/builtin/portfolio-list/cli/portfolio-command.ts +11 -3
- package/src/plugins/builtin/portfolio-list/cli/watchlist-command.ts +2 -0
- package/src/plugins/builtin/portfolio-list/header.tsx +2 -2
- package/src/plugins/builtin/portfolio-list/headless.ts +33 -6
- package/src/plugins/builtin/portfolio-list/index.tsx +3 -2
- package/src/plugins/builtin/portfolio-list/pane/futures-terms.ts +4 -2
- package/src/plugins/builtin/portfolio-list/pane/index.tsx +5 -3
- package/src/plugins/builtin/portfolio-list/pane/period-pnl.ts +26 -7
- package/src/plugins/builtin/portfolio-list/pane/purchase-date-fx.ts +4 -2
- package/src/plugins/builtin/portfolio-list/period-pnl.ts +16 -1
- package/src/plugins/builtin/portfolio-list/quick-add/index.tsx +2 -2
- package/src/plugins/builtin/portfolio-list/settings.ts +4 -1
- package/src/plugins/builtin/portfolio-list/summary/index.tsx +8 -5
- package/src/plugins/builtin/portfolio-list/summary/totals.ts +6 -4
- package/src/plugins/builtin/portfolio-list/table.tsx +25 -15
- package/src/plugins/builtin/power/detail.tsx +6 -5
- package/src/plugins/builtin/power/gas-model.ts +8 -7
- package/src/plugins/builtin/power/gas.tsx +2 -1
- package/src/plugins/builtin/power/headless.ts +7 -6
- package/src/plugins/builtin/power/model.ts +3 -2
- package/src/plugins/builtin/power/prices-headless.ts +10 -9
- package/src/plugins/builtin/power/prices-model.ts +3 -2
- package/src/plugins/builtin/power/prices.tsx +2 -1
- package/src/plugins/builtin/primary-dealers/model.ts +3 -3
- package/src/plugins/builtin/primary-dealers/pane.tsx +2 -2
- package/src/plugins/builtin/rate-path/headless.ts +8 -7
- package/src/plugins/builtin/rate-path/model.ts +6 -5
- package/src/plugins/builtin/rate-path/pane.tsx +6 -5
- package/src/plugins/builtin/realized-vol/fx-proxy.ts +2 -1
- package/src/plugins/builtin/realized-vol/headless.ts +11 -10
- package/src/plugins/builtin/realized-vol/pane.tsx +5 -4
- package/src/plugins/builtin/relative-rotation/headless.ts +2 -1
- package/src/plugins/builtin/relative-rotation/pane.tsx +6 -6
- package/src/plugins/builtin/research/analyst-headless.ts +5 -5
- package/src/plugins/builtin/research/analyst-model.ts +7 -7
- package/src/plugins/builtin/research/analyst-pane.tsx +7 -7
- package/src/plugins/builtin/research/client.ts +14 -0
- package/src/plugins/builtin/research/corporate-actions-pane.tsx +40 -30
- package/src/plugins/builtin/research/event-model.ts +55 -22
- package/src/plugins/builtin/research/event-sources.ts +26 -8
- package/src/plugins/builtin/research/relative-valuation-columns.ts +20 -12
- package/src/plugins/builtin/research/relative-valuation-currency.ts +16 -0
- package/src/plugins/builtin/research/relative-valuation-headless.ts +33 -21
- package/src/plugins/builtin/research/relative-valuation-model.ts +31 -17
- package/src/plugins/builtin/research/relative-valuation-pane.tsx +29 -14
- package/src/plugins/builtin/research-search/model.ts +2 -1
- package/src/plugins/builtin/research-search/saved-view.tsx +4 -3
- package/src/plugins/builtin/revenue-breakdown/model.ts +4 -4
- package/src/plugins/builtin/reverse-dcf/headless.ts +7 -7
- package/src/plugins/builtin/reverse-dcf/model.ts +4 -4
- package/src/plugins/builtin/reverse-dcf/pane.tsx +2 -2
- package/src/plugins/builtin/scanner/flow-model.ts +7 -4
- package/src/plugins/builtin/scanner/flow-pane.tsx +1 -1
- package/src/plugins/builtin/scanner/headless.ts +3 -2
- package/src/plugins/builtin/scanner/hilo-model.ts +2 -1
- package/src/plugins/builtin/scanner/live-headless.ts +2 -2
- package/src/plugins/builtin/scanner/live-model.ts +3 -2
- package/src/plugins/builtin/scanner/live-pane.tsx +5 -5
- package/src/plugins/builtin/seasonality/headless.ts +2 -1
- package/src/plugins/builtin/seasonality/pane.tsx +4 -3
- package/src/plugins/builtin/sec/filing-display.tsx +12 -15
- package/src/plugins/builtin/sec/fund-facts.ts +2 -2
- package/src/plugins/builtin/sec/headless.ts +2 -1
- package/src/plugins/builtin/sec/index.tsx +6 -2
- package/src/plugins/builtin/sectors/headless.ts +4 -4
- package/src/plugins/builtin/sectors/index.tsx +7 -7
- package/src/plugins/builtin/shared/cloud-upgrade.ts +4 -2
- package/src/plugins/builtin/shared/cpi-year-gap.ts +67 -0
- package/src/plugins/builtin/shared/earnings-calendar.ts +90 -6
- package/src/plugins/builtin/shared/earnings-report.ts +13 -6
- package/src/plugins/builtin/shared/research-cells.tsx +2 -2
- package/src/plugins/builtin/shared/source-footer.ts +2 -1
- package/src/plugins/builtin/shared/trend.ts +2 -2
- package/src/plugins/builtin/shared/use-quote-board.ts +9 -8
- package/src/plugins/builtin/short-interest/headless.ts +6 -6
- package/src/plugins/builtin/short-interest/model.ts +9 -9
- package/src/plugins/builtin/short-interest/publications-model.ts +5 -5
- package/src/plugins/builtin/short-interest/publications-pane.tsx +3 -2
- package/src/plugins/builtin/short-interest/watch-headless.ts +5 -5
- package/src/plugins/builtin/short-interest/watch-pane.tsx +6 -6
- package/src/plugins/builtin/short-volume/model.ts +5 -5
- package/src/plugins/builtin/short-volume/pane.tsx +4 -4
- package/src/plugins/builtin/social-mentions/headless.ts +2 -1
- package/src/plugins/builtin/social-mentions/model.ts +4 -4
- package/src/plugins/builtin/supply-chain/graph-model.ts +2 -1
- package/src/plugins/builtin/supply-chain/graph-pane.tsx +2 -2
- package/src/plugins/builtin/supply-chain/headless.ts +3 -2
- package/src/plugins/builtin/supply-chain/model.ts +4 -4
- package/src/plugins/builtin/supply-chain/pane.tsx +2 -2
- package/src/plugins/builtin/supply-chain/row-evidence.tsx +2 -1
- package/src/plugins/builtin/themes/headless.ts +2 -1
- package/src/plugins/builtin/themes/model.ts +3 -2
- package/src/plugins/builtin/themes/pane.tsx +3 -2
- package/src/plugins/builtin/thirteenf/format.ts +9 -9
- package/src/plugins/builtin/thirteenf/headless.ts +3 -2
- package/src/plugins/builtin/thirteenf/model.ts +2 -1
- package/src/plugins/builtin/thirteenf/overlap-pane.tsx +2 -1
- package/src/plugins/builtin/thirteenf/pane.tsx +5 -4
- package/src/plugins/builtin/thirteenf/report-notes.ts +2 -1
- package/src/plugins/builtin/thirteenf/signals-pane.tsx +3 -2
- package/src/plugins/builtin/thirteenf/table.ts +6 -5
- package/src/plugins/builtin/ticker-detail/adr-pair/headless.ts +45 -2
- package/src/plugins/builtin/ticker-detail/adr-pair/model.ts +4 -3
- package/src/plugins/builtin/ticker-detail/data-panes/historical-prices.tsx +4 -4
- package/src/plugins/builtin/ticker-detail/data-panes/returns-pane.tsx +3 -3
- package/src/plugins/builtin/ticker-detail/financials/model.ts +83 -35
- package/src/plugins/builtin/ticker-detail/financials/ratio-table.tsx +3 -1
- package/src/plugins/builtin/ticker-detail/financials/ratios.ts +2 -2
- package/src/plugins/builtin/ticker-detail/financials/schema.ts +14 -18
- package/src/plugins/builtin/ticker-detail/financials/tab.tsx +8 -13
- package/src/plugins/builtin/ticker-detail/headless.ts +33 -6
- package/src/plugins/builtin/ticker-detail/overview/chart-scale.ts +52 -0
- package/src/plugins/builtin/ticker-detail/overview/components.tsx +8 -9
- package/src/plugins/builtin/ticker-detail/overview/model.ts +28 -14
- package/src/plugins/builtin/ticker-detail/overview/pane.tsx +6 -0
- package/src/plugins/builtin/ticker-detail/overview/tax-equivalent.ts +2 -1
- package/src/plugins/builtin/ticker-detail/overview-tab.tsx +43 -9
- package/src/plugins/builtin/ticker-detail/quote-monitor/card.tsx +7 -5
- package/src/plugins/builtin/ticker-detail/quote-monitor/rows.ts +4 -4
- package/src/plugins/builtin/ticker-detail/settings.ts +17 -0
- package/src/plugins/builtin/time-sales/headless.ts +3 -2
- package/src/plugins/builtin/time-sales/model.ts +7 -5
- package/src/plugins/builtin/time-sales/pane.tsx +7 -6
- package/src/plugins/builtin/trace-bonds/model.ts +3 -2
- package/src/plugins/builtin/trace-bonds/pane.tsx +3 -2
- package/src/plugins/builtin/treasury-auctions/client.ts +2 -1
- package/src/plugins/builtin/treasury-auctions/headless.ts +6 -6
- package/src/plugins/builtin/treasury-auctions/hk-headless.ts +3 -2
- package/src/plugins/builtin/treasury-auctions/hk-view.tsx +10 -9
- package/src/plugins/builtin/treasury-auctions/hk.ts +5 -5
- package/src/plugins/builtin/treasury-auctions/model.ts +4 -4
- package/src/plugins/builtin/treasury-auctions/pane.tsx +18 -18
- package/src/plugins/builtin/treasury-auctions/treasury-direct.ts +2 -1
- package/src/plugins/builtin/treasury-daily/model.ts +2 -2
- package/src/plugins/builtin/vol-surface/events.ts +5 -4
- package/src/plugins/builtin/vol-surface/headless.ts +19 -18
- package/src/plugins/builtin/vol-surface/heat-grid.tsx +2 -1
- package/src/plugins/builtin/vol-surface/pane.tsx +8 -7
- package/src/plugins/builtin/vol-surface/stored.ts +2 -1
- package/src/plugins/builtin/vol-surface/tables.ts +4 -3
- package/src/plugins/builtin/volatility/headless.ts +5 -4
- package/src/plugins/builtin/volatility/pane.tsx +6 -6
- package/src/plugins/builtin/world-indices/headless.ts +7 -7
- package/src/plugins/builtin/world-indices/index.tsx +3 -1
- package/src/plugins/builtin/world-venue-map/headless.ts +2 -1
- package/src/plugins/builtin/world-venue-map/layered-pane.tsx +2 -1
- package/src/plugins/builtin/world-venue-map/layers.ts +3 -2
- package/src/plugins/builtin/world-venue-map/use-geo.ts +4 -2
- package/src/plugins/builtin/yield-curve/curves.ts +3 -3
- package/src/plugins/builtin/yield-curve/headless.ts +7 -6
- package/src/plugins/builtin/yield-curve/index.tsx +5 -4
- package/src/plugins/builtin/yield-curve/swaps.tsx +2 -1
- package/src/portfolio/allocation.ts +5 -5
- package/src/portfolio/collection-name.ts +2 -1
- package/src/portfolio/column-values.ts +61 -45
- package/src/portfolio/futures-positions.ts +2 -1
- package/src/portfolio/listed-symbol.ts +4 -2
- package/src/portfolio/period-pnl.ts +51 -1
- package/src/renderers/dom/dialog-host.tsx +5 -5
- package/src/renderers/electrobun/bun/desktop/backend-requests.ts +7 -1
- package/src/renderers/electrobun/view/remote/capability-invoker.ts +1 -1
- package/src/renderers/opentui/dialog-host.tsx +3 -4
- package/src/renderers/opentui/ui-host.tsx +32 -2
- package/src/renderers/share/layout-view.tsx +2 -1
- package/src/sources/gloomberb-cloud/news.ts +9 -0
- package/src/sources/gloomberb-cloud/normalizers.ts +7 -0
- package/src/sources/provider-router/history.ts +5 -2
- package/src/sources/provider-router/search.ts +15 -10
- package/src/state/hooks/inline-tickers.ts +3 -2
- package/src/state/hooks/quote-streaming.ts +9 -10
- package/src/team/collections-sync.ts +8 -3
- package/src/telemetry/usage-counts.ts +26 -0
- package/src/test-support/plugin-persistence.ts +12 -0
- package/src/tickers/company-name-listing.ts +6 -5
- package/src/tickers/company-name.ts +36 -2
- package/src/tickers/instrument-coverage.ts +27 -0
- package/src/tickers/listing-venues.ts +26 -1
- package/src/tickers/renamed-listings.ts +2 -1
- package/src/tickers/search/home-listing.ts +38 -1
- package/src/tickers/search/index.ts +22 -2
- package/src/tickers/search/ranking.ts +21 -2
- package/src/tickers/starter-symbols.ts +7 -0
- package/src/time-series/base-series.ts +4 -0
- package/src/time-series/fundamentals/statement-fields.ts +11 -14
- package/src/time-series/history-acquisition.ts +1 -1
- package/src/time-series/log-scale.ts +9 -0
- package/src/time-series/reporting.ts +3 -3
- package/src/time-series/resolve.ts +6 -4
- package/src/time-series/transforms.ts +10 -5
- package/src/time-series/types.ts +5 -2
- package/src/types/config.ts +9 -0
- package/src/types/data-provider.ts +3 -2
- package/src/types/financials.ts +28 -0
- package/src/types/headless.ts +2 -0
- package/src/types/instrument.ts +6 -0
- package/src/types/plugin-panes.ts +1 -1
- package/src/types/plugin-reports.ts +8 -0
- package/src/ui/dialog-stack.ts +17 -0
- package/src/ui/dialog.tsx +6 -2
- package/src/utils/crypto-pair.ts +9 -0
- package/src/utils/datetime-format.ts +74 -33
- package/src/utils/exchanges.ts +13 -0
- package/src/utils/financial-statements.ts +98 -17
- package/src/utils/format.ts +4 -9
- package/src/utils/fundamentals.ts +38 -16
- package/src/utils/futures-generic.ts +14 -0
- package/src/utils/growth.ts +67 -0
- package/src/utils/keyboard.ts +6 -0
- package/src/utils/options.ts +1 -1
- package/src/utils/report-timing.ts +2 -2
- package/src/utils/served-rates.ts +45 -0
- package/src/utils/text-wrap.ts +84 -3
- package/src/utils/trailing-dividend.ts +13 -3
- package/src/utils/zoned-date-time.ts +47 -22
|
@@ -36,7 +36,8 @@ import { isTitleCaseWord, readBrokerIndexCode } from "../listing-arg";
|
|
|
36
36
|
import { knownGapMessage, commandPointer } from "../known-gaps";
|
|
37
37
|
import { instrumentTypeLabel } from "../../tickers/instrument-kind";
|
|
38
38
|
import { canonicalExchange, isKnownExchangeCode, isUsListingExchange } from "../../utils/exchanges";
|
|
39
|
-
import { addedCompanyWords, companyLines, companyNameExtraWords, groupByCompany, namedByService, sameCompany } from "../../tickers/company-name";
|
|
39
|
+
import { addedCompanyWords, companyLines, companyNameExtraWords, groupByCompany, namedByService, sameCompany, sameCompanyName } from "../../tickers/company-name";
|
|
40
|
+
import { isDebtLine } from "../../tickers/company-name-listing";
|
|
40
41
|
import { isLowQualityTickerName } from "../../tickers/search/result";
|
|
41
42
|
import { findCatalogSeries, renderSeriesMatches, type SeriesMatch } from "../series-search";
|
|
42
43
|
import { centralBankAskedAbout, centralBankCiting, type CentralBank } from "../../utils/central-banks";
|
|
@@ -139,7 +140,7 @@ export async function searchCandidatesForCli({
|
|
|
139
140
|
// A word written as a name (`Aeon`) whose company search leads with keeps it first, as `quote Aeon` reads it.
|
|
140
141
|
const named = leadsWithNamedCompany(trimmedQuery, candidates, quote);
|
|
141
142
|
const ordered = withQuotedNames(symbol, withUsLineOfPrimary(withHomeListingPrimary(trimmedQuery, withPrimaryListingFirst(symbol, candidates, named ? null : quote))), quote);
|
|
142
|
-
return withOtherCompaniesApart(ordered, named ? trimmedQuery : null)
|
|
143
|
+
return cutKeepingCompanies(withOtherCompaniesApart(ordered, named ? trimmedQuery : null), totalLimit, symbol);
|
|
143
144
|
} catch (error) {
|
|
144
145
|
// Not "No matches found": a script or a reader would take that for a name nothing lists.
|
|
145
146
|
if (isProviderBusy(error)) failRetryable(SEARCH_BUSY_MESSAGE, SEARCH_BUSY_CODE);
|
|
@@ -272,6 +273,43 @@ function formerIssuerNotes(candidates: readonly TickerSearchCandidate[], fate: S
|
|
|
272
273
|
/** A query that is a bare symbol (CAR, BRK.B), not a name or a phrase. */
|
|
273
274
|
const BARE_SYMBOL = /^[A-Z0-9][A-Z0-9.\-]{0,11}$/;
|
|
274
275
|
|
|
276
|
+
/**
|
|
277
|
+
* Whether two lines are one company's: by the data service's company ids when
|
|
278
|
+
* both carry one (DHL Group AG on Xetra and Deutsche Post AG in Vienna), else
|
|
279
|
+
* by their names, or by a name one's company is known by besides its own.
|
|
280
|
+
*/
|
|
281
|
+
function sameSearchCompany(left: TickerSearchCandidate, right: TickerSearchCandidate): boolean {
|
|
282
|
+
const ids = [left.result?.companyId, right.result?.companyId];
|
|
283
|
+
if (ids[0] && ids[1]) return ids[0] === ids[1];
|
|
284
|
+
if (sameCompany(resolveSearchName(left), resolveSearchName(right))) return true;
|
|
285
|
+
// A line with no id named as the other's company is known besides (a former name the service sends on its rows).
|
|
286
|
+
const knownAs = (known: TickerSearchCandidate, line: TickerSearchCandidate) => !!known.result?.companyId
|
|
287
|
+
&& [...known.nameAliases ?? [], known.result.formerName].some((name) => sameCompanyName(name, resolveSearchName(line)));
|
|
288
|
+
return knownAs(left, right) || knownAs(right, left);
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* The companies whose lines `candidates` are, each in search order: lines
|
|
293
|
+
* with one company id together, then each line without one with the company
|
|
294
|
+
* of a line it is named like (Deutsche Post AG in Hanover with DHL Group's
|
|
295
|
+
* Vienna line of that name), else a company of its own. A line named nothing
|
|
296
|
+
* is no company's.
|
|
297
|
+
*/
|
|
298
|
+
function searchCompanies(candidates: readonly TickerSearchCandidate[]): TickerSearchCandidate[][] {
|
|
299
|
+
const groups: TickerSearchCandidate[][] = [];
|
|
300
|
+
const place = (candidate: TickerSearchCandidate) => {
|
|
301
|
+
const group = groups.find((members) => members.some((member) => sameSearchCompany(member, candidate)));
|
|
302
|
+
if (group) group.push(candidate);
|
|
303
|
+
else groups.push([candidate]);
|
|
304
|
+
};
|
|
305
|
+
const identified = candidates.filter((candidate) => candidate.result?.companyId);
|
|
306
|
+
identified.forEach(place);
|
|
307
|
+
groupByCompany(candidates.filter((candidate) => !identified.includes(candidate)), resolveSearchName).flat().forEach(place);
|
|
308
|
+
const order = (candidate: TickerSearchCandidate) => candidates.indexOf(candidate);
|
|
309
|
+
return groups.map((group) => group.sort((left, right) => order(left) - order(right)))
|
|
310
|
+
.sort((left, right) => order(left[0]!) - order(right[0]!));
|
|
311
|
+
}
|
|
312
|
+
|
|
275
313
|
/**
|
|
276
314
|
* For a bare symbol several companies list (CAR: Avis, Carrefour, CAR Group),
|
|
277
315
|
* the company of the listing `quote CAR` reads goes first, under its home
|
|
@@ -289,10 +327,16 @@ function withPrimaryListingFirst(
|
|
|
289
327
|
const exact = candidates.filter((candidate) => candidate.symbol.toUpperCase() === symbol);
|
|
290
328
|
if (exact.some((candidate) => candidate.kind === "ticker" || candidate.saved)) return candidates;
|
|
291
329
|
const listed = exact.filter((candidate) => candidate.kind === "search" && (candidate.instrumentClass === "equity" || candidate.instrumentClass === "other"));
|
|
292
|
-
const companies =
|
|
293
|
-
if (companies.length < 2) return candidates;
|
|
294
|
-
const
|
|
295
|
-
if (!
|
|
330
|
+
const companies = searchCompanies(listed);
|
|
331
|
+
if (companies.length < 2) return withHomeLineFirst(candidates, listed);
|
|
332
|
+
const read = quotedCandidate(listed, quote);
|
|
333
|
+
if (!read) return candidates;
|
|
334
|
+
// A debt or preferred line never leads where another company's common share has its home line under the symbol, as
|
|
335
|
+
// the bare symbol reads: DTG is Daimler Truck on Xetra, not DTE Energy's debentures in New York.
|
|
336
|
+
// An equity line alone: a fund, whatever its name, is no debt line (TIP, the iShares TIPS Bond ETF).
|
|
337
|
+
const debt = (candidate: TickerSearchCandidate) => candidate.instrumentClass === "equity"
|
|
338
|
+
&& isDebtLine(candidate.result?.type ?? "", candidate.result?.name);
|
|
339
|
+
const quoted = debt(read) ? listed.find((candidate) => candidate.result?.homeListing === true && !debt(candidate)) ?? read : read;
|
|
296
340
|
// That company leads with its home line where it lists one under the symbol too (TD on TSX before NYSE).
|
|
297
341
|
const primary = companies.find((group) => group.includes(quoted))?.find((candidate) => candidate.result?.homeListing === true) ?? quoted;
|
|
298
342
|
const firsts = companies.filter((group) => !group.includes(primary)).map((group) => group[0]!);
|
|
@@ -306,6 +350,20 @@ function withPrimaryListingFirst(
|
|
|
306
350
|
));
|
|
307
351
|
}
|
|
308
352
|
|
|
353
|
+
/**
|
|
354
|
+
* One company's lines of a symbol lead with the one the service marks as its
|
|
355
|
+
* home, never a thin secondary line search ranked first: DHL is DHL Group's
|
|
356
|
+
* Xetra line, not the Vienna one.
|
|
357
|
+
*/
|
|
358
|
+
function withHomeLineFirst(candidates: TickerSearchCandidate[], listed: readonly TickerSearchCandidate[]): TickerSearchCandidate[] {
|
|
359
|
+
const home = listed.find((candidate) => candidate.result?.homeListing === true);
|
|
360
|
+
const lead = candidates.find((candidate) => candidate.category === "Primary Listing");
|
|
361
|
+
if (!home || !lead || home === lead || !listed.includes(lead)) return candidates;
|
|
362
|
+
const rest = candidates.filter((candidate) => candidate !== home);
|
|
363
|
+
const at = rest.indexOf(lead);
|
|
364
|
+
return [...rest.slice(0, at), { ...home, category: "Primary Listing" as const }, { ...lead, category: "Other Listings" as const }, ...rest.slice(at + 1)];
|
|
365
|
+
}
|
|
366
|
+
|
|
309
367
|
/**
|
|
310
368
|
* Whether a word written as a company's name (`Aeon`) leads search with the
|
|
311
369
|
* home line of the company named that word (Aeon Co., Ltd.'s 8267 on JPX)
|
|
@@ -398,7 +456,7 @@ function withQuotedNames(symbol: string, candidates: TickerSearchCandidate[], qu
|
|
|
398
456
|
const onVenue = quotedCandidate(exact, quote);
|
|
399
457
|
const name = onVenue ? quotedListingName(candidateExchange(onVenue), quote) : null;
|
|
400
458
|
if (!onVenue || !name) return candidates;
|
|
401
|
-
const company =
|
|
459
|
+
const company = searchCompanies(exact).find((group) => group.includes(onVenue)) ?? [onVenue];
|
|
402
460
|
return candidates.map((candidate) => {
|
|
403
461
|
if (!company.includes(candidate) || resolveSearchName(candidate) === name) return candidate;
|
|
404
462
|
const [, ...rest] = candidate.detail.split(" | ");
|
|
@@ -428,7 +486,12 @@ function withOtherCompaniesApart(candidates: TickerSearchCandidate[], namedWord:
|
|
|
428
486
|
?? (lead?.category === "Saved" && lead.instrumentClass === "equity" ? lead : undefined);
|
|
429
487
|
// A primary line search names no company for gives nothing to tell its company's lines by.
|
|
430
488
|
if (!primary || nameless(primary)) return candidates;
|
|
431
|
-
|
|
489
|
+
// The company ids decide where the primary and a line both carry one; the names of the primary's identified lines
|
|
490
|
+
// (Deutsche Post AG, its Vienna line) are its names for a line without one.
|
|
491
|
+
const id = primary.result?.companyId;
|
|
492
|
+
const sameId = (candidate: TickerSearchCandidate) => !!id && candidate.result?.companyId === id;
|
|
493
|
+
const names = [resolveSearchName(primary), primary.result?.formerName, ...primary.nameAliases ?? [],
|
|
494
|
+
...candidates.filter(sameId).map(resolveSearchName)];
|
|
432
495
|
// A name with more words that another business goes by is not the primary's (`companyLines`): Mitsubishi UFJ
|
|
433
496
|
// Financial Group, which lists in Tokyo beside Mitsubishi Corporation, is not one of its lines.
|
|
434
497
|
const lines = new Set(companyLines(primary, candidates.filter((candidate) => candidate === primary || (candidate.kind === "search"
|
|
@@ -444,7 +507,8 @@ function withOtherCompaniesApart(candidates: TickerSearchCandidate[], namedWord:
|
|
|
444
507
|
const otherLeads = new Set(elsewhere.map((candidate) => addedCompanyWords(resolveSearchName(candidate), primaryName)[0]).filter(Boolean));
|
|
445
508
|
const anotherBusiness = (candidate: TickerSearchCandidate) => elsewhere.includes(candidate)
|
|
446
509
|
|| otherLeads.has(addedCompanyWords(resolveSearchName(candidate), primaryName)[0] ?? "");
|
|
447
|
-
const ownLine = (candidate: TickerSearchCandidate) =>
|
|
510
|
+
const ownLine = (candidate: TickerSearchCandidate) => id && candidate.result?.companyId ? sameId(candidate)
|
|
511
|
+
: nameless(candidate)
|
|
448
512
|
? baseSymbol(candidate.symbol) === baseSymbol(primary.symbol)
|
|
449
513
|
: names.some((company) => sameCompany(resolveSearchName(candidate), company))
|
|
450
514
|
&& !anotherBusiness(candidate)
|
|
@@ -457,6 +521,33 @@ function withOtherCompaniesApart(candidates: TickerSearchCandidate[], namedWord:
|
|
|
457
521
|
return [...kept.slice(0, at), ...apart, ...kept.slice(at)];
|
|
458
522
|
}
|
|
459
523
|
|
|
524
|
+
/**
|
|
525
|
+
* The first `limit` rows, with each other company's first line of the symbol
|
|
526
|
+
* kept in place of the primary company's last venues: `search DTG` lists
|
|
527
|
+
* Daimler Truck's lines and still DTE Energy's debenture. Only a line of
|
|
528
|
+
* another company (`searchCompanies`, by id where both carry one) takes a
|
|
529
|
+
* venue's place: never one of the primary company's own lines named as it
|
|
530
|
+
* was (Deutsche Post AG for DHL Group).
|
|
531
|
+
*/
|
|
532
|
+
function cutKeepingCompanies(candidates: TickerSearchCandidate[], limit: number, symbol: string): TickerSearchCandidate[] {
|
|
533
|
+
const head = candidates.slice(0, limit);
|
|
534
|
+
if (candidates.length <= limit || !BARE_SYMBOL.test(symbol)) return head;
|
|
535
|
+
// Each company of the symbol shown above the cut, its own lines and its lines named as it was among them.
|
|
536
|
+
const companies = searchCompanies(candidates.filter((candidate) => candidate.symbol.toUpperCase() === symbol));
|
|
537
|
+
const shown = new Set(head.flatMap((candidate) => companies.filter((group) => group.includes(candidate))));
|
|
538
|
+
const missing = companies.filter((group) => !shown.has(group))
|
|
539
|
+
.flatMap((group) => group.find((candidate) => candidate.category === "Other Matches") ?? []);
|
|
540
|
+
const venues = head.filter((candidate) => candidate.category === "Other Listings");
|
|
541
|
+
// The primary company keeps at least one other venue.
|
|
542
|
+
const room = Math.min(missing.length, Math.max(0, venues.length - 1));
|
|
543
|
+
if (room === 0) return head;
|
|
544
|
+
const dropped = new Set(venues.slice(-room));
|
|
545
|
+
const kept = head.filter((candidate) => !dropped.has(candidate));
|
|
546
|
+
const at = kept.findLastIndex((candidate) => candidate.category === "Other Listings" || candidate.category === "Other Matches"
|
|
547
|
+
|| candidate.category === "Primary Listing") + 1;
|
|
548
|
+
return [...kept.slice(0, at), ...missing.slice(0, room), ...kept.slice(at)];
|
|
549
|
+
}
|
|
550
|
+
|
|
460
551
|
/** "Saved", or the broker a row came from; never the data service's internal id. */
|
|
461
552
|
function searchSourceLabel(candidate: TickerSearchCandidate): string {
|
|
462
553
|
return isSavedCandidate(candidate) ? "Saved" : candidate.result?.brokerLabel || "";
|
|
@@ -522,6 +613,9 @@ function searchCandidateRows(candidates: TickerSearchCandidate[]) {
|
|
|
522
613
|
source: searchSourceLabel(candidate),
|
|
523
614
|
providerId: candidate.result?.providerId ?? "",
|
|
524
615
|
saved: isSavedCandidate(candidate),
|
|
616
|
+
// The company the data service identifies the line as one of: lines with one id are one company, whatever each venue names it.
|
|
617
|
+
...typeof candidate.result?.companyId === "string" && candidate.result.companyId
|
|
618
|
+
? { companyId: candidate.result.companyId } : {},
|
|
525
619
|
// The company that merged into this one, whose old name the query is.
|
|
526
620
|
...candidate.result?.formerIssuer ? { formerIssuer: candidate.result.formerIssuer } : {},
|
|
527
621
|
// The name a renamed company had, which the query is.
|
|
@@ -3,13 +3,15 @@ import { ebitdaLacksDepreciation } from "../../utils/ebitda";
|
|
|
3
3
|
import { formatShortDate, parseDisplayDate } from "../../utils/datetime-format";
|
|
4
4
|
import { formatReportedMoney, REPORTING_CURRENCY_NOT_SOURCED } from "../../utils/reported-money";
|
|
5
5
|
import {
|
|
6
|
-
appTtmRate,
|
|
6
|
+
appTtmRate, computedEnterpriseValueNote, convertedPriceEarningsNote, enterpriseValueLabel,
|
|
7
7
|
enterpriseValueReconciliationNote,
|
|
8
|
-
epsConversionNote, fundamentalsCurrency,
|
|
9
|
-
|
|
8
|
+
epsConversionNote, financialEnterpriseValue, fundamentalsCurrency, isFinancialEnterpriseValueReason, reportedEnterpriseValue, trailingEpsFiscalYear, trailingEpsSourceNote, ttmAtAppRate, ttmConversionNote,
|
|
9
|
+
withFinancialEnterpriseValue,
|
|
10
10
|
} from "../../utils/fundamentals";
|
|
11
11
|
import { latestFinancialPeriod } from "../../utils/latest-financial-period";
|
|
12
12
|
import { halfYearGrowthPeriod } from "../../utils/financial-statements";
|
|
13
|
+
import { servedRatesNotMeaningful, type ServedRate } from "../../utils/served-rates";
|
|
14
|
+
import { NOT_MEANINGFUL_TEXT } from "../../utils/growth";
|
|
13
15
|
import { burnsCash, cashRunway, SHORT_RUNWAY_HISTORY, formatRunwayMonths, offeringNote, offeringsAfter, runwayMethod, type CashRunway, type OfferingFiling, type RunwayEstimate } from "../../utils/cash-runway";
|
|
14
16
|
import { exportedFundamentals, formatPriceEarnings, forwardFiscalYear, NOT_MEANINGFUL, priceEarningsOnEarnings } from "../../utils/price-earnings";
|
|
15
17
|
import { describeFundamentalMarketCap, marketCapBasisNote, selectMarketCapitalization, viewMarketCapitalization, withheldMarketCap } from "../../utils/market-capitalization";
|
|
@@ -645,8 +647,9 @@ function unsourcedCurrencyNote(metrics: readonly FundamentalsMetric[]): string |
|
|
|
645
647
|
* a loss is.
|
|
646
648
|
*/
|
|
647
649
|
function enterpriseValueFigure(figure: MetricFigure, fundamentals: TickerFinancials["fundamentals"]): MetricFigure {
|
|
648
|
-
// A bank's: its deposits are funding, not debt.
|
|
649
|
-
|
|
650
|
+
// A bank's, an insurer's or a broker's: its deposits, float or repos are funding, not debt.
|
|
651
|
+
const financial = financialEnterpriseValue(fundamentals);
|
|
652
|
+
if (financial) return { text: financial, value: "N/M", unit: figure.unit };
|
|
650
653
|
const label = enterpriseValueLabel(fundamentals);
|
|
651
654
|
if (label === "not-meaningful") return { ...multipleFigure(NOT_MEANINGFUL), unit: figure.unit };
|
|
652
655
|
// A withdrawn EV the bridge stands in for shows the bridge (listingEnterpriseView).
|
|
@@ -871,13 +874,19 @@ function fundamentalsMetrics(
|
|
|
871
874
|
epsYear?: string,
|
|
872
875
|
/** A half-year reporter's latest period growth compares halves, not quarters: "H1 2026 vs H1 2025" (halfYearGrowthPeriod). */
|
|
873
876
|
growthPeriod?: string | null,
|
|
877
|
+
/** Why a served margin or revenue growth is N/M (servedRatesNotMeaningful), as DES and RV read it. */
|
|
878
|
+
notMeaningful: Partial<Record<ServedRate, string>> = {},
|
|
874
879
|
): FundamentalsMetric[] {
|
|
875
880
|
const signed = (value: number) => colorBySign(formatPercent(value), value);
|
|
881
|
+
// N/M where the source's figure is a number that says nothing: a margin over revenue at or below zero, growth off it.
|
|
882
|
+
// The value is null, as an export's column of figures holds only numbers; the text says N/M.
|
|
883
|
+
const rate = (key: ServedRate, format: (value: number) => string): MetricFigure => notMeaningful[key] && fundamentals?.[key] != null
|
|
884
|
+
? { text: NOT_MEANINGFUL_TEXT, value: null, unit: "%" } : percentFigure(fundamentals?.[key], format);
|
|
876
885
|
const receipt = fundamentals?.sharesOutstanding != null && sharesOutstandingInReceipts(quote, fundamentals, profile?.description);
|
|
877
886
|
const withdrawn = fundamentals?.notMeaningful ?? {};
|
|
878
887
|
return [
|
|
879
888
|
{ label: "Market Cap", ...marketCap },
|
|
880
|
-
{ label: "Enterprise Value", ...enterpriseValueFigure(enterpriseValue,
|
|
889
|
+
{ label: "Enterprise Value", ...enterpriseValueFigure(enterpriseValue, withFinancialEnterpriseValue(fundamentals, profile)) },
|
|
881
890
|
// A multiple over a loss is N/M, even beside a positive one the source served from an older period, and so is one
|
|
882
891
|
// withdrawn as no multiple of the share (a warrant's, an EPS that is not net income over the shares; share-multiples).
|
|
883
892
|
{ label: epsYear ? `P/E ${epsYear}` : "P/E (TTM)", ...multipleFigure(withdrawn.trailingPE ? NOT_MEANINGFUL : priceEarningsOnEarnings(fundamentals?.trailingPE, fundamentals?.eps)) },
|
|
@@ -900,10 +909,10 @@ function fundamentalsMetrics(
|
|
|
900
909
|
{ label: "Operating Cash Flow (TTM)", ...reportedMoney(fundamentals?.operatingCashFlow, reportingCurrency) },
|
|
901
910
|
{ label: "Free Cash Flow (TTM)", ...reportedMoney(fundamentals?.freeCashFlow, reportingCurrency) },
|
|
902
911
|
// Levels, not changes, so they carry no sign.
|
|
903
|
-
{ label: "Operating Margin", ...
|
|
904
|
-
{ label: "Profit Margin", ...
|
|
905
|
-
{ label: "Revenue Growth", ...
|
|
906
|
-
{ label: growthPeriod ? `Revenue ${growthPeriod}` : "Last Quarter Growth", ...
|
|
912
|
+
{ label: "Operating Margin", ...rate("operatingMargin", formatFractionPercentCell) },
|
|
913
|
+
{ label: "Profit Margin", ...rate("profitMargin", formatFractionPercentCell) },
|
|
914
|
+
{ label: "Revenue Growth", ...rate("revenueGrowth", signed) },
|
|
915
|
+
{ label: growthPeriod ? `Revenue ${growthPeriod}` : "Last Quarter Growth", ...rate("lastQuarterGrowth", signed) },
|
|
907
916
|
{ label: "1Y Return", ...percentFigure(priceReturns.return1Y, signed) },
|
|
908
917
|
{ label: "3Y Return", ...percentFigure(priceReturns.return3Y, signed) },
|
|
909
918
|
{
|
|
@@ -1003,7 +1012,7 @@ function fundamentalsNotes(
|
|
|
1003
1012
|
// A bank's EV line says why it is n/m.
|
|
1004
1013
|
const bridged = metrics.some((metric) => metric.label === "Enterprise Value" && typeof metric.value === "number")
|
|
1005
1014
|
&& enterpriseValueLabel(fundamentals) === "unavailable";
|
|
1006
|
-
const enterpriseValue = shown("Enterprise Value") && !metrics.some((metric) => metric.text
|
|
1015
|
+
const enterpriseValue = shown("Enterprise Value") && !metrics.some((metric) => isFinancialEnterpriseValueReason(metric.text))
|
|
1007
1016
|
? bridged ? listingNote : [enterpriseValueReconciliationNote(fundamentals, enterpriseValueCurrency(priced.quote, fundamentals), priced)
|
|
1008
1017
|
?? computedEnterpriseValueNote(fundamentals), listingNote].filter(Boolean).join(" ") || undefined
|
|
1009
1018
|
: undefined;
|
|
@@ -1156,7 +1165,7 @@ function fundamentalsReportMetrics(snapshot: FundamentalsReportData, view: "fund
|
|
|
1156
1165
|
: { text: "—" };
|
|
1157
1166
|
const metrics = withoutStockRows(fundamentalsMetrics(quote, fundamentals, financials.profile, marketCap, computeTickerPriceReturns(financials),
|
|
1158
1167
|
fundamentalsCurrency(financials), listingEnterpriseView(snapshot).figure, snapshot.distributions ?? null, snapshot.bondFund ?? null, snapshot.currencyCodes === true,
|
|
1159
|
-
trailingEpsFiscalYear(financials), halfYearGrowthPeriod(financials)),
|
|
1168
|
+
trailingEpsFiscalYear(financials), halfYearGrowthPeriod(financials), servedRatesNotMeaningful(fundamentals, financials)),
|
|
1160
1169
|
resolveTickerInstrumentKind(null, financials) === "fund");
|
|
1161
1170
|
if (view === "fundamentals") {
|
|
1162
1171
|
return [...metrics, ...floatAndShortInterestMetrics(quote, fundamentals, financials.profile)]
|
|
@@ -1517,7 +1526,7 @@ export async function buildTickerReport({
|
|
|
1517
1526
|
const listing = { listedSince: ipo ? ipo.deal.listingDate ?? ipo.deal.firstDay?.session ?? null : null };
|
|
1518
1527
|
const metrics = withoutStockRows(fundamentalsMetrics(quote, priced.fundamentals, profile, { text: marketCapText }, priceReturns,
|
|
1519
1528
|
fundamentalsCurrency(financials, listing), { text: enterpriseValueText, ...listingEv.value != null ? { value: listingEv.value } : {} }, distributions, bondFund, codes, trailingEpsFiscalYear(financials),
|
|
1520
|
-
halfYearGrowthPeriod(financials)), isFund);
|
|
1529
|
+
halfYearGrowthPeriod(financials), servedRatesNotMeaningful(priced.fundamentals, financials)), isFund);
|
|
1521
1530
|
const reportedCurrency = financials.financialCurrency?.trim();
|
|
1522
1531
|
const statements = [...financials.annualStatements, ...financials.quarterlyStatements];
|
|
1523
1532
|
const fallbackCurrency = reportedCurrency && statements.every((row) => !row.currency?.trim() || row.currency.trim() === reportedCurrency)
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { logFailure } from "../utils/log-failure";
|
|
2
|
-
import type {
|
|
2
|
+
import type { EarningsEvent } from "../types/data-provider";
|
|
3
3
|
import type { EarningsDateStatus } from "../types/financials";
|
|
4
4
|
import { isUsListingExchange } from "../utils/exchanges";
|
|
5
5
|
import { listingChoiceNote, loadListingQuote, usLineOfListing, type CliListing, type ListingDeps, type ListingVenue } from "./listing-arg";
|
|
6
6
|
import { sameCompany } from "../tickers/company-name";
|
|
7
|
+
import { lastReportOnRecord, listingDay, noNextReportText } from "../plugins/builtin/shared/earnings-calendar";
|
|
8
|
+
import { commandWord } from "../utils/shell-word";
|
|
7
9
|
|
|
8
10
|
const DAY_MS = 86_400_000;
|
|
9
11
|
|
|
@@ -13,73 +15,51 @@ export function earningsDateLabel(status: EarningsDateStatus | null): string {
|
|
|
13
15
|
}
|
|
14
16
|
|
|
15
17
|
/** Whether the listing trades abroad, where the calendar is the listing's own exchange's rather than the US one. */
|
|
16
|
-
|
|
18
|
+
function isListingAbroad(listing: Pick<CliListing, "exchange">): boolean {
|
|
17
19
|
return !!listing.exchange && !isUsListingExchange(listing.exchange);
|
|
18
20
|
}
|
|
19
21
|
|
|
20
22
|
const isoDate = (date: Date) => date.toISOString().slice(0, 10);
|
|
21
23
|
|
|
22
24
|
/**
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
25
|
+
* What a listing the calendar has no date for says, once, under the table:
|
|
26
|
+
* "VOW3:XETRA: no next report date on record; last reported 2026-10-29
|
|
27
|
+
* (quarter ended 2026-09-30). Headlines: gloom news VOW3:XETRA". A listing
|
|
28
|
+
* abroad whose company's US line, under the same symbol, has a date borrows it
|
|
29
|
+
* as an estimate ("BHP:ASX: no next report date on record; ADR date 2026-11-04
|
|
30
|
+
* (estimate)"); a US line that is another company (SAN:EPA is Sanofi, SAN in
|
|
31
|
+
* New York is Banco Santander) lends nothing. With `lookup` false (a long
|
|
32
|
+
* list) nothing is read and the line is the lead alone.
|
|
28
33
|
*/
|
|
29
|
-
export async function
|
|
34
|
+
export async function undatedListingNote(
|
|
30
35
|
listing: Pick<CliListing, "symbol" | "exchange" | "key" | "request" | "saved">,
|
|
31
36
|
deps: ListingDeps,
|
|
32
|
-
now = Date.now(),
|
|
37
|
+
{ now = Date.now(), lookup = true }: { now?: number; lookup?: boolean } = {},
|
|
33
38
|
): Promise<string> {
|
|
34
|
-
const lead = `${listing.key}: no
|
|
39
|
+
const lead = `${listing.key}: no next report date on record`;
|
|
40
|
+
if (!lookup) return `${lead}.`;
|
|
41
|
+
if (isListingAbroad(listing)) {
|
|
42
|
+
const borrowed = await usLineDate(listing, deps, now);
|
|
43
|
+
if (borrowed) return `${lead}; ADR date ${borrowed} (estimate)`;
|
|
44
|
+
}
|
|
45
|
+
const last = await lastReportOnRecord(deps.dataProvider, listing.request, listingDay(listing.request.exchange || listing.exchange, now));
|
|
46
|
+
return `${listing.key}: ${noNextReportText(last)}. Headlines: gloom news ${commandWord(listing.key)}`;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** The date of the same company's US line under the same symbol, YYYY-MM-DD, when the calendar has one to come. */
|
|
50
|
+
async function usLineDate(
|
|
51
|
+
listing: Pick<CliListing, "symbol" | "exchange" | "key" | "request" | "saved">,
|
|
52
|
+
deps: ListingDeps,
|
|
53
|
+
now: number,
|
|
54
|
+
): Promise<string | null> {
|
|
35
55
|
const quote = await loadListingQuote(deps.dataProvider, listing);
|
|
36
56
|
const company = quote?.name?.trim() || listing.saved?.metadata.name?.trim() || null;
|
|
37
57
|
const usLine = await usLineOfListing(listing, company, deps);
|
|
38
|
-
if (!usLine || !deps.dataProvider.getEarningsCalendar) return
|
|
58
|
+
if (!usLine || !deps.dataProvider.getEarningsCalendar) return null;
|
|
39
59
|
const events = await deps.dataProvider.getEarningsCalendar([listing.symbol]).catch(logFailure("cli.earnings-calendar", "Read earnings calendar failed", []));
|
|
40
60
|
const event = events.find((entry) => entry.symbol.toUpperCase() === listing.symbol.toUpperCase());
|
|
41
|
-
if (!event || event.earningsDate.getTime() < now - DAY_MS) return
|
|
42
|
-
return
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* The day a listing last reported, `YYYY-MM-DD`, from the company's quarters
|
|
47
|
-
* on record: the newest announcement on or before `today` with a reported
|
|
48
|
-
* figure. Null when none is on record or they cannot be read.
|
|
49
|
-
*/
|
|
50
|
-
export async function lastReportedDay(
|
|
51
|
-
provider: Pick<DataProvider, "getCorporateActions">,
|
|
52
|
-
listing: Pick<CliListing, "request">,
|
|
53
|
-
today: string,
|
|
54
|
-
): Promise<string | null> {
|
|
55
|
-
if (!provider.getCorporateActions) return null;
|
|
56
|
-
const actions = await provider.getCorporateActions(listing.request.symbol, listing.request.exchange)
|
|
57
|
-
.catch(logFailure("cli.earnings-calendar", "Read a listing's reported quarters failed", null));
|
|
58
|
-
const reported = (actions?.earnings ?? [])
|
|
59
|
-
.filter((row) => row.dateType !== "fiscal-period-end" && row.epsActual != null && row.date.slice(0, 10) <= today)
|
|
60
|
-
.map((row) => row.date.slice(0, 10))
|
|
61
|
-
.sort();
|
|
62
|
-
return reported.at(-1) ?? null;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* The listings at home a calendar came back without, each named once, with
|
|
67
|
-
* when each last reported: "KO: no upcoming earnings date found; last
|
|
68
|
-
* reported 2026-10-27." Those with no report on record share one line ("BG,
|
|
69
|
-
* FPI: no earnings date found."). Null when the calendar dated them all.
|
|
70
|
-
*/
|
|
71
|
-
export function undatedListingsNote(
|
|
72
|
-
listings: readonly Pick<CliListing, "key">[],
|
|
73
|
-
lastReported: ReadonlyMap<string, string | null> = new Map(),
|
|
74
|
-
): string | null {
|
|
75
|
-
const keys = [...new Set(listings.map((listing) => listing.key))];
|
|
76
|
-
const reported = keys.filter((key) => lastReported.get(key));
|
|
77
|
-
const unknown = keys.filter((key) => !lastReported.get(key));
|
|
78
|
-
const lines = [
|
|
79
|
-
...reported.map((key) => `${key}: no upcoming earnings date found; last reported ${lastReported.get(key)}.`),
|
|
80
|
-
...unknown.length > 0 ? [`${unknown.join(", ")}: no earnings date found.`] : [],
|
|
81
|
-
];
|
|
82
|
-
return lines.length > 0 ? lines.join("\n") : null;
|
|
61
|
+
if (!event || event.earningsDate.getTime() < now - DAY_MS) return null;
|
|
62
|
+
return isoDate(event.earningsDate);
|
|
83
63
|
}
|
|
84
64
|
|
|
85
65
|
/**
|
package/src/cli/errors.ts
CHANGED
|
@@ -135,7 +135,9 @@ function cliErrorObject(error: unknown): CliErrorObject {
|
|
|
135
135
|
}
|
|
136
136
|
// A source failed (a timeout, a rate limit) where none had the data to answer: asked again it may.
|
|
137
137
|
if (isSourceFailure(error) || isSourceUnavailableAnswer(error)) {
|
|
138
|
-
|
|
138
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
139
|
+
// It failed, it is not missing: says to ask again unless the message already says when.
|
|
140
|
+
return { code: SOURCE_UNAVAILABLE_CODE, message, ...(/\btry again\b/i.test(message) ? {} : { details: "Try again in a moment." }), retryable: true };
|
|
139
141
|
}
|
|
140
142
|
// A listing read the data service failed to answer twice: said in Gloom's words. Any other 5xx keeps the server's.
|
|
141
143
|
if (wasAskedTwice(error)) {
|
package/src/cli/freshness.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type { HeadlessPaneFreshness, HeadlessPaneRow } from "../types/headless";
|
|
|
3
3
|
import { deriveHeadlessFreshness, type ReportFreshness } from "./pane-functions/freshness";
|
|
4
4
|
import { quoteObservation, REPORTED_DATA } from "../plugins/builtin/shared/report-freshness";
|
|
5
5
|
import { latestReportedPeriod } from "../utils/latest-financial-period";
|
|
6
|
+
import { quoteSourceName } from "../market-data/quotes/export-identity";
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* The source, as-of and status line of a plain CLI command, derived exactly as
|
|
@@ -33,8 +34,12 @@ export function quotesFreshness(
|
|
|
33
34
|
declared?: HeadlessPaneFreshness,
|
|
34
35
|
now = Date.now(),
|
|
35
36
|
): ReportFreshness | undefined {
|
|
36
|
-
const
|
|
37
|
-
|
|
37
|
+
const shown = [...quotes].filter((quote): quote is Quote => quote != null);
|
|
38
|
+
const rows = shown.map((quote) => quoteObservation(quote, now));
|
|
39
|
+
// A coin priced by an exchange's own trade names the exchange, as its pane footer does: `Coinbase and Kraken`.
|
|
40
|
+
const names = shown.some((quote) => quote.priceVenue) ? [...new Set(shown.map((quote) => quoteSourceName(quote)))] : [];
|
|
41
|
+
const source = !declared?.source && names.length > 0 && names.every(Boolean) ? names.join(" and ") : undefined;
|
|
42
|
+
return rows.length > 0 ? rowsFreshness(rows, source ? { ...declared, source } : declared, undefined, now) : undefined;
|
|
38
43
|
}
|
|
39
44
|
|
|
40
45
|
/**
|
package/src/cli/glossary.ts
CHANGED
|
@@ -126,7 +126,7 @@ export const GLOSSARY: readonly GlossaryEntry[] = [
|
|
|
126
126
|
definition: "The nine-character code that identifies a US security. A reopening repeats the original issue's CUSIP.",
|
|
127
127
|
},
|
|
128
128
|
{
|
|
129
|
-
term: "Bill", aliases: ["t-bill", "treasury bill", "bills"], functions: ["AUCT", "BTMM"], shown: ["Bill", "bill"],
|
|
129
|
+
term: "Bill", aliases: ["t-bill", "t-bills", "tbill", "tbills", "treasury bill", "bills"], functions: ["AUCT", "BTMM"], shown: ["Bill", "bill"],
|
|
130
130
|
definition: "Treasury debt of a year or less, sold below face value with no coupon; the climb back to face value is the interest.",
|
|
131
131
|
},
|
|
132
132
|
{
|
|
@@ -870,11 +870,16 @@ export const GLOSSARY: readonly GlossaryEntry[] = [
|
|
|
870
870
|
+ "(10 bp is about ±5 points at 7 days), so CTM greys it there and Vs Spot is the figure to read.",
|
|
871
871
|
},
|
|
872
872
|
{
|
|
873
|
-
term: "Crypto composite price", aliases: ["CCC", "crypto composite", "composite price", "composite crypto price"], functions: ["CTM"],
|
|
873
|
+
term: "Crypto composite price", aliases: ["CCC", "crypto composite", "composite price", "composite crypto price"], functions: ["CTM", "CRYP"],
|
|
874
874
|
shown: ["crypto composite price"],
|
|
875
|
-
definition: "A coin's dollar price blended from trading on
|
|
876
|
-
+ "
|
|
877
|
-
+ "
|
|
875
|
+
definition: "A coin's dollar price blended from trading on many crypto exchanges, Binance, Coinbase, Kraken and Bitstamp among them, "
|
|
876
|
+
+ "quoted around the clock under the code CCC. "
|
|
877
|
+
+ "Its 5-minute low or high can be one exchange's brief wick: CRYP reads Coinbase's, Kraken's and Bitstamp's own candles "
|
|
878
|
+
+ "around it and says Coinbase only when one alone reached it, other exchange when none of them did. "
|
|
879
|
+
+ "An exchange's price outside the composite's 24-hour range widens it, and the extreme says so (+ Kraken). "
|
|
880
|
+
+ "A price named after an exchange (Coinbase · 15:55 UTC) is that exchange's own price at that time, not the composite. "
|
|
881
|
+
+ "An intraday bar's volume counts the spot venues the bar names (1 spot venue), not every exchange. "
|
|
882
|
+
+ "CTM reads CME crypto futures against the composite, while the futures settle to CME's own reference rate, so a small gap at expiry is expected.",
|
|
878
883
|
},
|
|
879
884
|
{
|
|
880
885
|
term: "Contango", aliases: ["contango curve", "upward curve"], functions: ["CTM", "FUT"], shown: ["contango", "Contango"],
|
package/src/cli/helpers.ts
CHANGED
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
formatNumber,
|
|
6
6
|
formatPercentRaw,
|
|
7
7
|
} from "../utils/format";
|
|
8
|
-
import { formatMarketChangeWithCurrency, formatMarketPriceWithCurrency, type MarketFormatOptions } from "../market-data/market/format";
|
|
8
|
+
import { formatMarketChangeWithCurrency, formatMarketPriceRange, formatMarketPriceWithCurrency, type MarketFormatOptions } from "../market-data/market/format";
|
|
9
9
|
import { changeBasisLabel, changeBasisNote, printPredatesChangeBasis, quoteChangeBasis } from "../market-data/market/change-basis";
|
|
10
10
|
import type { FuturesContractTermsPayload } from "../api-client/futures-curve";
|
|
11
11
|
import type { ActiveQuoteDisplay } from "../market-data/market/status";
|
|
@@ -100,12 +100,8 @@ export function dryRunNote(dryRun: boolean): string {
|
|
|
100
100
|
return dryRun ? cliStyles.muted(" (dry run, nothing saved)") : "";
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
/** Low and high of a range. A sub-unit quote (pence shown in pounds) varies in decimals,
|
|
108
|
-
* so its pair shares one count: £35.1000 - £35.4871, not £35.10 - £35.4871. */
|
|
103
|
+
/** Low and high of a range, both to one number of decimals (formatMarketPriceRange): £35.1000 - £35.4871 for pence
|
|
104
|
+
* shown in pounds, not £35.10 - £35.4871, and a coin's at its price's decimals. */
|
|
109
105
|
export function formatPriceRange(
|
|
110
106
|
low: number | undefined,
|
|
111
107
|
high: number | undefined,
|
|
@@ -113,15 +109,11 @@ export function formatPriceRange(
|
|
|
113
109
|
options: MarketFormatOptions,
|
|
114
110
|
separator = " - ",
|
|
115
111
|
): string {
|
|
116
|
-
|
|
117
|
-
value == null ? "—" : formatMarketPriceWithCurrency(value, currency,
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
if (!options.quotedUnitDivisor || low == null || high == null) return `${lowText}${separator}${highText}`;
|
|
122
|
-
const digits = Math.max(fractionDigits(lowText), fractionDigits(highText));
|
|
123
|
-
if (fractionDigits(lowText) === digits && fractionDigits(highText) === digits) return `${lowText}${separator}${highText}`;
|
|
124
|
-
return `${format(low, { fixedFractionDigits: digits })}${separator}${format(high, { fixedFractionDigits: digits })}`;
|
|
112
|
+
if (low == null || high == null) {
|
|
113
|
+
const format = (value: number | undefined) => value == null ? "—" : formatMarketPriceWithCurrency(value, currency, options);
|
|
114
|
+
return `${format(low)}${separator}${format(high)}`;
|
|
115
|
+
}
|
|
116
|
+
return formatMarketPriceRange(low, high, options, currency).join(separator);
|
|
125
117
|
}
|
|
126
118
|
|
|
127
119
|
/** A timestamp in CLI text: UTC with the zone named, the same on every machine. */
|
|
@@ -16,6 +16,10 @@ export interface HistoryListRow extends HistoryRow {
|
|
|
16
16
|
symbol: string;
|
|
17
17
|
/** Why the symbol has no bars, as its warning says it; only on a symbol's one row with no bar. */
|
|
18
18
|
status?: string;
|
|
19
|
+
/** In a list read from a file or standard input, the line the row is for, as typed. */
|
|
20
|
+
input?: string;
|
|
21
|
+
/** In such a list, the earlier line that is the same listing. */
|
|
22
|
+
duplicateOf?: string;
|
|
19
23
|
}
|
|
20
24
|
|
|
21
25
|
type ExportedRow = Record<string, unknown>;
|
package/src/cli/history-rows.ts
CHANGED
|
@@ -84,6 +84,10 @@ export interface HistoryRow {
|
|
|
84
84
|
filled?: true;
|
|
85
85
|
/** A future's session has closed but its settlement is not confirmed yet: the close is the last trade. */
|
|
86
86
|
unsettled?: true;
|
|
87
|
+
/** An index session's closing print, its daily close, as its last intraday bar. */
|
|
88
|
+
sessionClose?: true;
|
|
89
|
+
/** An index session's last intraday bar, ending before its close, whose print was not at hand. */
|
|
90
|
+
beforeClose?: true;
|
|
87
91
|
/** What the volume counts, when the history says: a coin's is traded value in its quote currency (`USD`). */
|
|
88
92
|
volumeUnit?: string;
|
|
89
93
|
/** Why a coin's bar has no volume: `day in progress`, `rebuilt from hourly bars`, `latest trade` (not a bar), `not reported`. */
|
|
@@ -450,6 +454,8 @@ export function historyRows(
|
|
|
450
454
|
...(point.partial ? { partial: true as const } : {}),
|
|
451
455
|
...(point.filled ? { filled: true as const } : {}),
|
|
452
456
|
...(point.unsettled ? { unsettled: true as const } : {}),
|
|
457
|
+
...(point.sessionClose ? { sessionClose: true as const } : {}),
|
|
458
|
+
...(point.beforeClose ? { beforeClose: true as const } : {}),
|
|
453
459
|
...(volume ? { volumeUnit: volume.unit } : {}),
|
|
454
460
|
...(values.volume == null && point.venueVolume
|
|
455
461
|
? { venueVolume: point.venueVolume.volume, volumeVenue: point.venueVolume.venue }
|
|
@@ -711,7 +717,7 @@ export function venueTradingDay(venue: string | undefined, now: number): string
|
|
|
711
717
|
* partial bar is then still forming.
|
|
712
718
|
*/
|
|
713
719
|
export function historyBarStatusNote(
|
|
714
|
-
rows: readonly Pick<HistoryRow, "date" | "partial" | "filled" | "unsettled" | "volume" | "interval">[],
|
|
720
|
+
rows: readonly Pick<HistoryRow, "date" | "partial" | "filled" | "unsettled" | "sessionClose" | "beforeClose" | "volume" | "interval">[],
|
|
715
721
|
options: { tradingDay?: string | null } = {},
|
|
716
722
|
): string | null {
|
|
717
723
|
// A day's bar the data service still marks partial once its session has closed: its own daily bar is not in yet.
|
|
@@ -722,6 +728,8 @@ export function historyBarStatusNote(
|
|
|
722
728
|
const latest = rows[latestTradeIndex(rows.map((row) => Date.parse(row.date)))];
|
|
723
729
|
const filled = rows.filter((row) => row.filled);
|
|
724
730
|
const unsettled = rows.filter((row) => row.unsettled);
|
|
731
|
+
const closes = rows.filter((row) => row.sessionClose);
|
|
732
|
+
const beforeClose = rows.filter((row) => row.beforeClose);
|
|
725
733
|
const notes = [
|
|
726
734
|
partial.length > 0
|
|
727
735
|
? `${listDates(partial.map((row) => row.date))} ${partial.length === 1 ? "is" : "are"} still forming (partial)`
|
|
@@ -739,6 +747,15 @@ export function historyBarStatusNote(
|
|
|
739
747
|
? `${listDates(unsettled.map((row) => row.date))} ${unsettled.length === 1 ? "closes" : "close"} on the last trade until the`
|
|
740
748
|
+ ` settlement is confirmed (unsettled)`
|
|
741
749
|
: null,
|
|
750
|
+
// The data service adds a past session's closing print to its intraday bars, as the source sends only the latest one.
|
|
751
|
+
closes.length > 0
|
|
752
|
+
? `${listDates(closes.map((row) => row.date))} ${closes.length === 1 ? "is its session's" : "are their sessions'"} closing print,`
|
|
753
|
+
+ ` the day's close (close)`
|
|
754
|
+
: null,
|
|
755
|
+
beforeClose.length > 0
|
|
756
|
+
? `${listDates(beforeClose.map((row) => row.date))} ${beforeClose.length === 1 ? "ends" : "end"} before the closing auction:`
|
|
757
|
+
+ ` the day's close is on its daily bar (before close)`
|
|
758
|
+
: null,
|
|
742
759
|
// Its blank volume beside bars that have one, said once rather than counted as a bar without volume.
|
|
743
760
|
latest && latest.volume == null && historyReportsVolume(rows)
|
|
744
761
|
? `${latest.date} is the latest trade, inside the bar before it, with no volume of its own`
|
package/src/cli/known-gaps.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { parsePublicTickerKey } from "../utils/exchanges";
|
|
|
5
5
|
import { commandWord } from "../utils/shell-word";
|
|
6
6
|
import { listingAbroadVenue } from "../utils/sec";
|
|
7
7
|
import { nimCommand } from "./bank-section";
|
|
8
|
-
import { treasuryYieldLine, treasuryYieldTenor } from "./treasury-yields";
|
|
8
|
+
import { treasuryBillLine, treasuryYieldLine, treasuryYieldTenor } from "./treasury-yields";
|
|
9
9
|
import { namedCurrencyPair } from "./currency-name-hint";
|
|
10
10
|
import { dollarPairListing } from "../utils/currency-pair";
|
|
11
11
|
import { currencyCodeTyped } from "../utils/currency-names";
|
|
@@ -408,6 +408,15 @@ const COMMAND_POINTERS: ReadonlyArray<{
|
|
|
408
408
|
"change", "ranking", "rankings", "dashboard", "lending", "staking"],
|
|
409
409
|
line: "DeFi TVL, top protocols and chains with 7D and 30D change: gloom fn CRYP --list defi (by chain: --by chain)",
|
|
410
410
|
},
|
|
411
|
+
{
|
|
412
|
+
// A morning on the German and European markets: `catalog dax` found no function. The index quotes, beside WEI, GC
|
|
413
|
+
// and CMP, which the same words find by their keywords. Each symbol is one `quote` answers (2026-11-13).
|
|
414
|
+
names: ["dax", "xetra", "stoxx", "eurostoxx", "germany", "german", "european"],
|
|
415
|
+
words: ["index", "indices", "indexes", "euro", "50", "600", "europe", "equity", "equities", "stock", "stocks", "market", "markets",
|
|
416
|
+
"quote", "quotes", "level", "levels", "close", "today", "yesterday", "morning", "dax", "xetra", "stoxx", "germany", "german"],
|
|
417
|
+
line: "European index quotes: gloom quote ^GDAXI ^STOXX50E ^STOXX ^FTSE ^FCHI (DAX, EURO STOXX 50, STOXX Europe 600, FTSE 100, CAC 40); "
|
|
418
|
+
+ "the world board: gloom fn WEI; the Bund curve: gloom fn GC bund; the DAX beside its members: gloom fn CMP ^GDAXI SIE:XETRA VOW3:XETRA",
|
|
419
|
+
},
|
|
411
420
|
{
|
|
412
421
|
// Ahead of DIST, which "difficulty" finds by its description; the four series are listed after it.
|
|
413
422
|
names: ["hashrate", "hash rate", "hashprice", "hash price", "difficulty", "retarget", "mining", "miner", "miners"],
|
|
@@ -580,7 +589,7 @@ export function knownGapMessage(query: string): string | null {
|
|
|
580
589
|
const index = uncarriedIndexFor(query);
|
|
581
590
|
if (index) return uncarriedIndexLine(index);
|
|
582
591
|
return KNOWN_GAPS.find((gap) => namesKnownGap(gap, query))?.message
|
|
583
|
-
?? (tenor ? treasuryYieldLine(tenor) : null)
|
|
592
|
+
?? (tenor ? treasuryBillLine(query, tenor) ?? treasuryYieldLine(tenor) : null)
|
|
584
593
|
?? topicPointer(query)?.message
|
|
585
594
|
?? macroReleaseTopic(query)?.line ?? null;
|
|
586
595
|
}
|