gloomberb 0.20.7 → 0.20.8
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.ja.md +74 -0
- package/README.md +2 -0
- package/README.zh-CN.md +2 -0
- package/package.json +6 -1
- package/src/account/auth-model.ts +22 -0
- package/src/api-client/auth.ts +7 -2
- package/src/api-client/awards.ts +5 -0
- package/src/api-client/bond-trades.ts +22 -0
- package/src/api-client/catalysts.ts +11 -1
- package/src/api-client/data.ts +30 -6
- package/src/api-client/debt-maturities.ts +7 -0
- package/src/api-client/equity-screener.ts +17 -0
- package/src/api-client/errors.ts +2 -0
- package/src/api-client/exchange-announcements.ts +14 -7
- package/src/api-client/fund-facts.ts +21 -3
- package/src/api-client/futures-curve.ts +14 -1
- package/src/api-client/geo.ts +10 -0
- package/src/api-client/hiring.ts +2 -0
- package/src/api-client/index.ts +3 -0
- package/src/api-client/insider-signals.ts +14 -0
- package/src/api-client/members.ts +30 -2
- package/src/api-client/money-markets.ts +11 -1
- package/src/api-client/paths.ts +6 -1
- package/src/api-client/perps.ts +2 -0
- package/src/api-client/request.ts +2 -1
- package/src/api-client/socket.ts +7 -0
- package/src/api-client/types/econ.ts +2 -1
- package/src/api-client/types/filings-and-calls.ts +6 -0
- package/src/api-client/types/market.ts +4 -0
- package/src/api-client/web-experiments.ts +5 -6
- package/src/app/runtime/update.ts +2 -1
- package/src/architecture/floating-promise-allowlist.json +33 -106
- package/src/capabilities/asset-data-inputs.ts +183 -0
- package/src/capabilities/factories.ts +8 -2
- package/src/cli/base-converter.ts +36 -2
- package/src/cli/commands/api.ts +2 -2
- package/src/cli/commands/command-utils.ts +18 -0
- package/src/cli/commands/hong-kong-movers.ts +50 -0
- package/src/cli/commands/market.ts +539 -130
- package/src/cli/commands/options-chain.ts +7 -1
- package/src/cli/commands/overview.ts +74 -14
- package/src/cli/commands/plugins.ts +7 -6
- package/src/cli/commands/search.ts +52 -9
- package/src/cli/commands/system.ts +15 -10
- package/src/cli/commands/ticker.ts +97 -44
- package/src/cli/content-figures.ts +45 -0
- package/src/cli/context.ts +5 -0
- package/src/cli/desktop-pane-shot-routes.ts +13 -4
- package/src/cli/desktop-pane-shot.ts +86 -12
- package/src/cli/earnings-calendar.ts +36 -5
- package/src/cli/export-source.ts +17 -3
- package/src/cli/fx-pair.ts +111 -11
- package/src/cli/glossary.ts +36 -2
- package/src/cli/help.ts +1 -1
- package/src/cli/history-export.ts +29 -11
- package/src/cli/history-rows.ts +130 -21
- package/src/cli/index.ts +8 -5
- package/src/cli/known-gaps.ts +45 -1
- package/src/cli/listing-arg.ts +366 -19
- package/src/cli/pane-functions/capabilities.ts +2 -2
- package/src/cli/pane-functions/catalog.ts +105 -9
- package/src/cli/pane-functions/discovery.ts +2 -0
- package/src/cli/pane-functions/dom.ts +46 -9
- package/src/cli/pane-functions/freshness.ts +7 -3
- package/src/cli/pane-functions/function-help.ts +9 -6
- package/src/cli/pane-functions/headless.ts +77 -6
- package/src/cli/pane-functions/index.ts +141 -23
- package/src/cli/pane-functions/options.ts +1 -3
- package/src/cli/pane-functions/plugin-code.ts +169 -0
- package/src/cli/pane-functions/report.ts +10 -0
- package/src/cli/pane-functions/resolver.ts +69 -21
- package/src/cli/pane-functions/screenshot-assessment.ts +82 -3
- package/src/cli/pane-functions/screenshot-data-evidence.ts +3 -1
- package/src/cli/pane-functions/screenshot-types.ts +6 -0
- package/src/cli/quote-answer.ts +49 -2
- package/src/cli/registry.ts +42 -4
- package/src/cli/report-tables.ts +26 -6
- package/src/cli/result.ts +13 -2
- package/src/cli/series-search.ts +17 -7
- package/src/cli/statement-filings.ts +22 -8
- package/src/cli/symbol-args.ts +9 -0
- package/src/cli/ticker-resolution.ts +3 -2
- package/src/cli/unknown-command.ts +111 -14
- package/src/components/chart/composite/format.ts +15 -1
- package/src/components/chart/composite/legend.tsx +101 -47
- package/src/components/chart/composite/panel-labels.ts +4 -4
- package/src/components/chart/composite/panel-surface.tsx +4 -6
- package/src/components/chart/composite/scene/build.ts +180 -0
- package/src/components/chart/composite/scene/cursor.ts +226 -0
- package/src/components/chart/composite/scene/domain.ts +170 -0
- package/src/components/chart/composite/scene/markers.ts +115 -0
- package/src/components/chart/composite/scene/panels.ts +85 -0
- package/src/components/chart/composite/scene/points.ts +169 -0
- package/src/components/chart/composite/scene/projection.ts +105 -0
- package/src/components/chart/composite/scene/timeline.ts +71 -0
- package/src/components/chart/composite/scene.ts +12 -1066
- package/src/components/chart/composite/types.ts +4 -2
- package/src/components/chart/curve/model.ts +2 -2
- package/src/components/chart-table/axis.ts +18 -6
- package/src/components/command-bar/layout-items/focused-pane.ts +3 -0
- package/src/components/command-bar/list/model.ts +9 -0
- package/src/components/command-bar/pane-templates/items.ts +61 -15
- package/src/components/command-bar/pane-templates/workflow.ts +16 -5
- package/src/components/command-bar/routes/root/plugin-install.ts +7 -46
- package/src/components/command-bar/routes/root/provider-search.ts +8 -5
- package/src/components/command-bar/routes/root/results.ts +6 -1
- package/src/components/command-bar/routes/root/runtime.ts +1 -0
- package/src/components/command-bar/routes/root/shortcut-feedback.ts +4 -1
- package/src/components/command-bar/routes/ticker-search/actions.ts +7 -5
- package/src/components/command-bar/routes/ticker-search/results.ts +51 -3
- package/src/components/command-bar/view-model.ts +12 -0
- package/src/components/command-bar/workflow/ops.ts +21 -4
- package/src/components/command-bar/workflow/ticker-listing-picker.ts +3 -1
- package/src/components/command-bar/workflow/tickers.ts +6 -2
- package/src/components/data-table/view.tsx +46 -1
- package/src/components/form-modal/confirm.tsx +3 -2
- package/src/components/form-modal/content.tsx +3 -2
- package/src/components/form-modal/field-row.tsx +2 -0
- package/src/components/form-modal/host.tsx +18 -3
- package/src/components/form-modal/remote-reads.test-helpers.ts +34 -0
- package/src/components/index.ts +1 -1
- package/src/components/layout/pane/title.ts +21 -5
- package/src/components/layout/shell/pane/layers.tsx +20 -14
- package/src/components/layout/shell/pane-occlusion.ts +21 -0
- package/src/components/onboarding/desks-step.tsx +7 -1
- package/src/components/onboarding/onboarding-keyboard.ts +48 -6
- package/src/components/onboarding/onboarding-wizard.tsx +47 -8
- package/src/components/onboarding/portfolio-step/positions-panel.tsx +17 -3
- package/src/components/onboarding/use-onboarding-progress.ts +57 -14
- package/src/components/onboarding/wizard-positions.ts +2 -0
- package/src/components/paged-rows.ts +11 -5
- package/src/components/ticker/list-table-view.tsx +24 -5
- package/src/components/toggle-list.tsx +44 -1
- package/src/components/ui/data-table/opentui/index.tsx +7 -6
- package/src/components/ui/data-table/opentui/model.ts +7 -3
- package/src/components/ui/data-table/types.ts +13 -2
- package/src/components/ui/fields.tsx +16 -4
- package/src/components/ui/query-bar.tsx +43 -9
- package/src/components/ui/table-layout.ts +56 -2
- package/src/core/app-services.ts +7 -2
- package/src/core/connection-health.ts +26 -0
- package/src/core/state/app/layout.ts +12 -4
- package/src/data/config/layout.ts +3 -1
- package/src/data/config/store/node.ts +4 -2
- package/src/docs/snapshot.json +756 -216
- package/src/i18n/es.ts +4 -1
- package/src/i18n/ja.ts +4 -1
- package/src/i18n/ko.ts +4 -1
- package/src/i18n/zh-cn.ts +4 -1
- package/src/i18n/zh-tw.ts +4 -1
- package/src/layout/pane-follow.ts +1 -1
- package/src/layout/pane-manager/gridlock.ts +18 -5
- package/src/layout/pane-manager/index.ts +1 -0
- package/src/layout/pane-manager/transient.ts +56 -0
- package/src/layout-marketplace/gallery.tsx +2 -1
- package/src/layout-marketplace/model.ts +4 -10
- package/src/market-data/commodity-names.ts +24 -0
- package/src/market-data/connection-follow.ts +9 -7
- package/src/market-data/coordinator/auxiliary.ts +4 -3
- package/src/market-data/coordinator/entries.ts +22 -1
- package/src/market-data/coordinator/financials.ts +2 -3
- package/src/market-data/coordinator/index.ts +67 -12
- package/src/market-data/coordinator/quotes.ts +2 -3
- package/src/market-data/fund-facts.ts +7 -1
- package/src/market-data/futures-board.ts +38 -4
- package/src/market-data/futures-contract.ts +5 -2
- package/src/market-data/fx-closes.ts +4 -1
- package/src/market-data/market/bar-period.ts +15 -0
- package/src/market-data/market/format.ts +4 -2
- package/src/market-data/market/freshness.ts +4 -0
- package/src/market-data/market/status.ts +23 -3
- package/src/market-data/options-alternatives.ts +21 -9
- package/src/market-data/published-futures-sessions.ts +9 -0
- package/src/market-data/quotes/balance-sheet-rate.ts +34 -0
- package/src/market-data/quotes/delisting.ts +26 -2
- package/src/market-data/quotes/freshness.ts +62 -0
- package/src/market-data/quotes/listing-enterprise-value.ts +250 -19
- package/src/market-data/quotes/regular-session-valuation.ts +8 -0
- package/src/market-data/realized-volatility.ts +3 -1
- package/src/market-data/request-types.ts +2 -0
- package/src/market-data/selectors.ts +1 -0
- package/src/news/aggregator.ts +3 -3
- package/src/plugins/builtin/account-management/delete-account.ts +78 -0
- package/src/plugins/builtin/account-management/pane.tsx +22 -19
- package/src/plugins/builtin/account-management/password-dialog.tsx +75 -0
- package/src/plugins/builtin/alerts/alert-log.ts +3 -2
- package/src/plugins/builtin/alerts/cli-forms.ts +1 -1
- package/src/plugins/builtin/alerts/cli.ts +72 -4
- package/src/plugins/builtin/alerts/format.ts +8 -2
- package/src/plugins/builtin/alerts/index.tsx +8 -5
- package/src/plugins/builtin/alerts/pane.tsx +5 -3
- package/src/plugins/builtin/alerts/research-builder.ts +12 -0
- package/src/plugins/builtin/analytics/index.tsx +3 -3
- package/src/plugins/builtin/analytics/risk-client.ts +14 -3
- package/src/plugins/builtin/analytics/risk-pane.tsx +3 -3
- package/src/plugins/builtin/attention/pane.tsx +1 -1
- package/src/plugins/builtin/attention/trending.tsx +1 -1
- package/src/plugins/builtin/awards/detail.tsx +4 -1
- package/src/plugins/builtin/awards/headless.ts +7 -3
- package/src/plugins/builtin/awards/model.ts +11 -0
- package/src/plugins/builtin/awards/pane.tsx +12 -5
- package/src/plugins/builtin/backtest/client.ts +7 -2
- package/src/plugins/builtin/backtest/headless.ts +2 -1
- package/src/plugins/builtin/backtest/pane.tsx +4 -2
- package/src/plugins/builtin/bond-calculator/pane.tsx +1 -1
- package/src/plugins/builtin/broker-manager/sign-in-end.ts +1 -1
- package/src/plugins/builtin/broker-trading/orders.tsx +2 -2
- package/src/plugins/builtin/buildout/company/pane.tsx +1 -1
- package/src/plugins/builtin/buildout/model/index.ts +2 -2
- package/src/plugins/builtin/catalysts/headless.ts +9 -6
- package/src/plugins/builtin/catalysts/model.ts +72 -10
- package/src/plugins/builtin/catalysts/pane.tsx +10 -7
- package/src/plugins/builtin/cds/pane.tsx +5 -3
- package/src/plugins/builtin/central-bank-rates/pane.tsx +3 -2
- package/src/plugins/builtin/chart-composer/catalog-series.ts +59 -0
- package/src/plugins/builtin/chart-composer/headless-schema.ts +2 -1
- package/src/plugins/builtin/chart-composer/headless.ts +104 -23
- package/src/plugins/builtin/chart-composer/index.tsx +6 -3
- package/src/plugins/builtin/chart-composer/legend-names.ts +19 -0
- package/src/plugins/builtin/chart-composer/pane.tsx +37 -10
- package/src/plugins/builtin/chart-composer/presets.ts +63 -6
- package/src/plugins/builtin/chart-composer/roll-events.ts +38 -0
- package/src/plugins/builtin/chart-composer/series-catalog.ts +12 -5
- package/src/plugins/builtin/chart-composer/series-expression.ts +8 -4
- package/src/plugins/builtin/chart-composer/series-listings.ts +33 -9
- package/src/plugins/builtin/chart-composer/use-series-catalog.ts +2 -2
- package/src/plugins/builtin/clinical-trials/client.ts +13 -0
- package/src/plugins/builtin/clinical-trials/index.tsx +1 -1
- package/src/plugins/builtin/clinical-trials/pane.tsx +77 -27
- package/src/plugins/builtin/clinical-trials/search.ts +117 -0
- package/src/plugins/builtin/cloud/askg/conversation-store.ts +17 -6
- package/src/plugins/builtin/cloud/askg/lock-note.ts +4 -2
- package/src/plugins/builtin/cloud/askg/manifest.ts +3 -2
- package/src/plugins/builtin/cloud/askg/pane.tsx +2 -2
- package/src/plugins/builtin/cloud/askg/sources.ts +3 -3
- package/src/plugins/builtin/cloud/one-tap/one-tap-prompt.tsx +7 -3
- package/src/plugins/builtin/cloud/team/acm-tab.tsx +1 -1
- package/src/plugins/builtin/cloud/team/pane.tsx +17 -10
- package/src/plugins/builtin/cloud/team/views.ts +15 -3
- package/src/plugins/builtin/cloud/terminal-relay/redact.ts +105 -16
- package/src/plugins/builtin/cloud/thesis/board-pane.tsx +17 -2
- package/src/plugins/builtin/cloud/thesis/module.tsx +3 -2
- package/src/plugins/builtin/cloud/thesis/store.ts +17 -3
- package/src/plugins/builtin/commodities-energy/index.tsx +35 -3
- package/src/plugins/builtin/commodity-balances/index.tsx +1 -1
- package/src/plugins/builtin/company-attention/app-rank.tsx +1 -1
- package/src/plugins/builtin/company-attention/building.tsx +1 -1
- package/src/plugins/builtin/company-attention/model.ts +2 -1
- package/src/plugins/builtin/company-attention/moves.tsx +1 -1
- package/src/plugins/builtin/company-attention/pane.tsx +1 -1
- package/src/plugins/builtin/company-attention/signals.tsx +1 -1
- package/src/plugins/builtin/company-kpis/pane.tsx +1 -1
- package/src/plugins/builtin/correlation/headless.ts +7 -5
- package/src/plugins/builtin/correlation/history.ts +17 -6
- package/src/plugins/builtin/correlation/index.tsx +1 -1
- package/src/plugins/builtin/correlation/relationship/history.ts +1 -1
- package/src/plugins/builtin/correlation/relationship/pane.tsx +1 -1
- package/src/plugins/builtin/cot/headless.ts +10 -3
- package/src/plugins/builtin/cot/pane.tsx +2 -2
- package/src/plugins/builtin/cpi/pane.tsx +1 -1
- package/src/plugins/builtin/credit-boards/model.ts +1 -1
- package/src/plugins/builtin/credit-documents/pane.tsx +1 -1
- package/src/plugins/builtin/crypto-board/defi-view.tsx +2 -2
- package/src/plugins/builtin/crypto-board/defi.ts +9 -3
- package/src/plugins/builtin/crypto-board/headless.ts +19 -10
- package/src/plugins/builtin/crypto-board/model.ts +8 -0
- package/src/plugins/builtin/crypto-board/pane.tsx +11 -5
- package/src/plugins/builtin/crypto-board/series.ts +17 -3
- package/src/plugins/builtin/crypto-board/supply.ts +26 -3
- package/src/plugins/builtin/crypto-etf-flows/headless.ts +3 -2
- package/src/plugins/builtin/crypto-etf-flows/model.ts +13 -3
- package/src/plugins/builtin/crypto-etf-flows/pane.tsx +6 -3
- package/src/plugins/builtin/custom-view/pane.tsx +5 -5
- package/src/plugins/builtin/debt-maturities/client.ts +5 -0
- package/src/plugins/builtin/debt-maturities/headless.ts +3 -1
- package/src/plugins/builtin/debt-maturities/model.ts +1 -0
- package/src/plugins/builtin/debt-maturities/pane.tsx +1 -1
- package/src/plugins/builtin/dividend-yield/pane.tsx +1 -1
- package/src/plugins/builtin/doe/model.ts +1 -1
- package/src/plugins/builtin/doe/pane.tsx +1 -1
- package/src/plugins/builtin/earnings/board.tsx +2 -2
- package/src/plugins/builtin/earnings/history.tsx +1 -1
- package/src/plugins/builtin/earnings-calls/calendar.tsx +1 -1
- package/src/plugins/builtin/earnings-calls/data.ts +2 -1
- package/src/plugins/builtin/earnings-calls/headless.ts +15 -0
- package/src/plugins/builtin/earnings-calls/model.ts +68 -8
- package/src/plugins/builtin/earnings-calls/pane.tsx +29 -8
- package/src/plugins/builtin/earnings-calls/transcript-view.tsx +32 -2
- package/src/plugins/builtin/earnings-ripple/pane.tsx +1 -1
- package/src/plugins/builtin/econ/calendar-model.ts +94 -2
- package/src/plugins/builtin/econ/detail-view.tsx +15 -11
- package/src/plugins/builtin/econ/index.tsx +25 -9
- package/src/plugins/builtin/econ/types.ts +4 -1
- package/src/plugins/builtin/equity-screener/headless.ts +23 -7
- package/src/plugins/builtin/equity-screener/index.tsx +3 -0
- package/src/plugins/builtin/equity-screener/live.ts +39 -12
- package/src/plugins/builtin/equity-screener/model.ts +86 -5
- package/src/plugins/builtin/equity-screener/pane.tsx +20 -21
- package/src/plugins/builtin/equity-screener/results.ts +12 -3
- package/src/plugins/builtin/equity-screener/ticker-check.tsx +2 -2
- package/src/plugins/builtin/estimate-revisions/pane.tsx +2 -2
- package/src/plugins/builtin/executives/pane.tsx +2 -2
- package/src/plugins/builtin/exposure/pane.tsx +1 -1
- package/src/plugins/builtin/fear-greed/data.ts +3 -1
- package/src/plugins/builtin/fear-greed/headless.ts +8 -2
- package/src/plugins/builtin/fear-greed/pane.tsx +8 -4
- package/src/plugins/builtin/filing-events/pane.tsx +1 -1
- package/src/plugins/builtin/futures/index.tsx +5 -4
- package/src/plugins/builtin/futures/model.ts +17 -9
- package/src/plugins/builtin/futures/returns.ts +2 -0
- package/src/plugins/builtin/futures/series.ts +44 -8
- package/src/plugins/builtin/futures/table.tsx +3 -3
- package/src/plugins/builtin/futures-curve/client.ts +1 -0
- package/src/plugins/builtin/futures-curve/headless.ts +14 -12
- package/src/plugins/builtin/futures-curve/index.tsx +7 -4
- package/src/plugins/builtin/futures-curve/model.ts +93 -7
- package/src/plugins/builtin/futures-curve/pane.tsx +18 -7
- package/src/plugins/builtin/fx-matrix/amount.ts +2 -1
- package/src/plugins/builtin/fx-matrix/index.tsx +9 -0
- package/src/plugins/builtin/gpu/changes.tsx +1 -1
- package/src/plugins/builtin/gpu/equities.tsx +1 -1
- package/src/plugins/builtin/gpu/pane.tsx +2 -2
- package/src/plugins/builtin/help/function-card.tsx +4 -2
- package/src/plugins/builtin/help/function-index.ts +12 -6
- package/src/plugins/builtin/help/index.tsx +1 -1
- package/src/plugins/builtin/holders/beneficial-view.tsx +1 -1
- package/src/plugins/builtin/holders/pane.tsx +1 -1
- package/src/plugins/builtin/insider/base-values.ts +55 -0
- package/src/plugins/builtin/insider/headless.ts +307 -83
- package/src/plugins/builtin/insider/index.tsx +65 -23
- package/src/plugins/builtin/insider/insiders.tsx +26 -16
- package/src/plugins/builtin/insider/model.ts +2 -2
- package/src/plugins/builtin/insider/signals-cells.tsx +4 -1
- package/src/plugins/builtin/insider/signals-model.ts +13 -5
- package/src/plugins/builtin/insider/signals.tsx +5 -3
- package/src/plugins/builtin/insider/tickers.tsx +466 -0
- package/src/plugins/builtin/ipo-calendar/pane.tsx +1 -1
- package/src/plugins/builtin/iv-history/client.ts +35 -4
- package/src/plugins/builtin/iv-history/headless.ts +10 -4
- package/src/plugins/builtin/iv-history/model.ts +85 -16
- package/src/plugins/builtin/iv-history/pane.tsx +2 -2
- package/src/plugins/builtin/iv-history/screen-pane.tsx +6 -3
- package/src/plugins/builtin/jobs/pane.tsx +5 -5
- package/src/plugins/builtin/macro-day/pane.tsx +1 -1
- package/src/plugins/builtin/macro-day/release-table.ts +5 -5
- package/src/plugins/builtin/macro-day/releases.ts +11 -9
- package/src/plugins/builtin/market-movers/headless.ts +6 -2
- package/src/plugins/builtin/market-movers/screener.ts +18 -4
- package/src/plugins/builtin/members/breadth-pane.tsx +3 -3
- package/src/plugins/builtin/members/client.ts +24 -2
- package/src/plugins/builtin/members/headless.ts +66 -9
- package/src/plugins/builtin/members/index.tsx +7 -6
- package/src/plugins/builtin/members/model.ts +89 -5
- package/src/plugins/builtin/members/pane.tsx +70 -21
- package/src/plugins/builtin/mna/distress/pane.tsx +2 -1
- package/src/plugins/builtin/mna/pane.tsx +1 -1
- package/src/plugins/builtin/money-markets/client.ts +43 -15
- package/src/plugins/builtin/money-markets/headless.ts +18 -11
- package/src/plugins/builtin/money-markets/index.tsx +7 -6
- package/src/plugins/builtin/money-markets/model.ts +20 -5
- package/src/plugins/builtin/money-markets/pane.tsx +28 -17
- package/src/plugins/builtin/news/wire/news/footer.ts +11 -1
- package/src/plugins/builtin/news/wire/news/table.tsx +15 -5
- package/src/plugins/builtin/notes/headless.ts +94 -0
- package/src/plugins/builtin/notes/index.tsx +3 -1
- package/src/plugins/builtin/notes/store.ts +10 -3
- package/src/plugins/builtin/options/footer.ts +8 -2
- package/src/plugins/builtin/options/open-interest-as-of.ts +12 -3
- package/src/plugins/builtin/options/view.tsx +10 -1
- package/src/plugins/builtin/options-calculator/pane.tsx +1 -1
- package/src/plugins/builtin/options-positioning/client.ts +35 -8
- package/src/plugins/builtin/options-positioning/headless.ts +17 -7
- package/src/plugins/builtin/options-positioning/index.tsx +10 -0
- package/src/plugins/builtin/options-positioning/pane.tsx +16 -7
- package/src/plugins/builtin/options-scenario/csp-screen-pane.tsx +1 -1
- package/src/plugins/builtin/options-scenario/pane.tsx +1 -1
- package/src/plugins/builtin/pe-band/pane.tsx +2 -2
- package/src/plugins/builtin/perps/cascade-tabs.tsx +2 -2
- package/src/plugins/builtin/perps/client.ts +54 -15
- package/src/plugins/builtin/perps/headless.ts +39 -13
- package/src/plugins/builtin/perps/index.tsx +2 -1
- package/src/plugins/builtin/perps/model.ts +43 -1
- package/src/plugins/builtin/perps/pane.tsx +35 -18
- package/src/plugins/builtin/portfolio-list/allocation-rows.ts +74 -0
- package/src/plugins/builtin/portfolio-list/cell-version.ts +1 -0
- package/src/plugins/builtin/portfolio-list/cli/period-report.ts +7 -3
- package/src/plugins/builtin/portfolio-list/cli/portfolio-command.ts +33 -3
- package/src/plugins/builtin/portfolio-list/cli/render.ts +149 -24
- package/src/plugins/builtin/portfolio-list/headless.ts +30 -9
- package/src/plugins/builtin/portfolio-list/income.ts +17 -8
- package/src/plugins/builtin/portfolio-list/index.tsx +4 -4
- package/src/plugins/builtin/portfolio-list/pane/fx-day-moves.ts +52 -0
- package/src/plugins/builtin/portfolio-list/pane/index.tsx +76 -9
- package/src/plugins/builtin/portfolio-list/pane/target-weights.tsx +178 -0
- package/src/plugins/builtin/portfolio-list/period-pnl.ts +44 -5
- package/src/plugins/builtin/portfolio-list/settings.ts +12 -6
- package/src/plugins/builtin/portfolio-list/summary/index.tsx +9 -4
- package/src/plugins/builtin/portfolio-list/summary/totals.ts +21 -2
- package/src/plugins/builtin/portfolio-list/table.tsx +33 -25
- package/src/plugins/builtin/power/gas.tsx +2 -2
- package/src/plugins/builtin/power/prices.tsx +2 -2
- package/src/plugins/builtin/primary-dealers/pane.tsx +10 -11
- package/src/plugins/builtin/rate-path/model.ts +9 -0
- package/src/plugins/builtin/rate-path/pane.tsx +6 -5
- package/src/plugins/builtin/realized-vol/fx-proxy.ts +27 -0
- package/src/plugins/builtin/realized-vol/headless.ts +8 -6
- package/src/plugins/builtin/realized-vol/pane.tsx +13 -7
- package/src/plugins/builtin/relative-rotation/pane.tsx +1 -1
- package/src/plugins/builtin/research/analyst-headless.ts +5 -1
- package/src/plugins/builtin/research/analyst-model.ts +7 -1
- package/src/plugins/builtin/research/analyst-pane.tsx +1 -1
- package/src/plugins/builtin/research/relative-valuation-basis.ts +44 -4
- package/src/plugins/builtin/research/relative-valuation-headless.ts +59 -14
- package/src/plugins/builtin/research/relative-valuation-model.ts +65 -26
- package/src/plugins/builtin/research/relative-valuation-pane.tsx +42 -17
- package/src/plugins/builtin/revenue-breakdown/pane.tsx +1 -1
- package/src/plugins/builtin/reverse-dcf/client.ts +34 -4
- package/src/plugins/builtin/reverse-dcf/headless.ts +30 -15
- package/src/plugins/builtin/reverse-dcf/model.ts +190 -29
- package/src/plugins/builtin/reverse-dcf/pane.tsx +35 -13
- package/src/plugins/builtin/risk-factors/pane.tsx +2 -2
- package/src/plugins/builtin/roadmap/pane.tsx +2 -2
- package/src/plugins/builtin/scanner/flow-pane.tsx +4 -4
- package/src/plugins/builtin/scanner/headless.ts +15 -1
- package/src/plugins/builtin/seasonality/pane.tsx +1 -1
- package/src/plugins/builtin/sec/fund-facts-view.tsx +5 -2
- package/src/plugins/builtin/sec/fund-facts.ts +41 -1
- package/src/plugins/builtin/sec/headless.ts +8 -4
- package/src/plugins/builtin/sec/index.tsx +41 -13
- package/src/plugins/builtin/shared/ticker-company.ts +111 -0
- package/src/plugins/builtin/shared/use-quote-board.ts +37 -2
- package/src/plugins/builtin/shared/volatility/live-session.ts +23 -0
- package/src/plugins/builtin/shared/volatility-indices.ts +2 -0
- package/src/plugins/builtin/short-interest/publications-pane.tsx +1 -1
- package/src/plugins/builtin/short-volume/pane.tsx +1 -1
- package/src/plugins/builtin/social-mentions/outliers.tsx +3 -3
- package/src/plugins/builtin/social-mentions/pane.tsx +2 -2
- package/src/plugins/builtin/supply-chain/graph-pane.tsx +1 -1
- package/src/plugins/builtin/supply-chain/pane.tsx +1 -1
- package/src/plugins/builtin/themes/pane.tsx +4 -4
- package/src/plugins/builtin/thirteenf/api.ts +1 -0
- package/src/plugins/builtin/thirteenf/format.ts +5 -0
- package/src/plugins/builtin/thirteenf/headless.ts +2 -2
- package/src/plugins/builtin/thirteenf/model.ts +128 -5
- package/src/plugins/builtin/thirteenf/overlap-pane.tsx +1 -1
- package/src/plugins/builtin/thirteenf/report-notes.ts +10 -3
- package/src/plugins/builtin/thirteenf/signals-pane.tsx +1 -1
- package/src/plugins/builtin/thirteenf/table.ts +2 -2
- package/src/plugins/builtin/thirteenf/types.ts +12 -0
- package/src/plugins/builtin/ticker-detail/data-panes/historical-prices.tsx +27 -14
- package/src/plugins/builtin/ticker-detail/data-panes/returns-history.ts +6 -3
- package/src/plugins/builtin/ticker-detail/data-panes/returns-model.ts +14 -0
- package/src/plugins/builtin/ticker-detail/data-panes/returns-pane.tsx +4 -1
- package/src/plugins/builtin/ticker-detail/financials/aggregation.ts +87 -19
- package/src/plugins/builtin/ticker-detail/financials/exchange-results.ts +54 -0
- package/src/plugins/builtin/ticker-detail/financials/model.ts +114 -9
- package/src/plugins/builtin/ticker-detail/financials/ratios.ts +37 -20
- package/src/plugins/builtin/ticker-detail/financials/tab.tsx +42 -19
- package/src/plugins/builtin/ticker-detail/headless-schema.ts +3 -2
- package/src/plugins/builtin/ticker-detail/headless.ts +90 -31
- package/src/plugins/builtin/ticker-detail/overview/model.ts +22 -15
- package/src/plugins/builtin/ticker-detail/overview-tab.tsx +5 -2
- package/src/plugins/builtin/ticker-detail/quote-monitor/card.tsx +12 -7
- package/src/plugins/builtin/ticker-detail/quote-monitor/index.tsx +21 -0
- package/src/plugins/builtin/trace-bonds/client.ts +107 -10
- package/src/plugins/builtin/trace-bonds/detail.tsx +1 -1
- package/src/plugins/builtin/trace-bonds/headless.ts +20 -5
- package/src/plugins/builtin/trace-bonds/pane.tsx +15 -4
- package/src/plugins/builtin/treasury-auctions/hk-view.tsx +1 -1
- package/src/plugins/builtin/treasury-auctions/pane.tsx +1 -1
- package/src/plugins/builtin/treasury-daily/pane.tsx +2 -2
- package/src/plugins/builtin/vol-surface/charts.tsx +30 -5
- package/src/plugins/builtin/vol-surface/client.ts +40 -12
- package/src/plugins/builtin/vol-surface/events.ts +213 -0
- package/src/plugins/builtin/vol-surface/headless.ts +82 -13
- package/src/plugins/builtin/vol-surface/index.tsx +5 -1
- package/src/plugins/builtin/vol-surface/model.ts +42 -6
- package/src/plugins/builtin/vol-surface/pane.tsx +95 -23
- package/src/plugins/builtin/volatility/dvol.ts +14 -2
- package/src/plugins/builtin/volatility/headless.ts +3 -2
- package/src/plugins/builtin/volatility/index.tsx +1 -1
- package/src/plugins/builtin/volatility/pane.tsx +1 -1
- package/src/plugins/builtin/volatility/series.ts +7 -3
- package/src/plugins/builtin/world-venue-map/activity-series.ts +89 -0
- package/src/plugins/builtin/world-venue-map/chokepoint-report.ts +123 -0
- package/src/plugins/builtin/world-venue-map/evidence.ts +2 -0
- package/src/plugins/builtin/world-venue-map/geo-series.ts +35 -1
- package/src/plugins/builtin/world-venue-map/headless.ts +58 -9
- package/src/plugins/builtin/world-venue-map/index.ts +6 -3
- package/src/plugins/builtin/world-venue-map/layered-pane.tsx +6 -1
- package/src/plugins/builtin/world-venue-map/pane.tsx +4 -3
- package/src/plugins/builtin/yield-curve/index.tsx +12 -10
- package/src/plugins/builtin/yield-curve/swaps.tsx +1 -1
- package/src/plugins/extracted-plugins.ts +14 -10
- package/src/plugins/installer.ts +17 -1
- package/src/plugins/marketplace/feed.ts +14 -0
- package/src/plugins/marketplace/install-offer.ts +64 -0
- package/src/plugins/registry/contributions.ts +46 -8
- package/src/plugins/registry/index.ts +5 -0
- package/src/portfolio/collection-name.ts +38 -4
- package/src/portfolio/column-values.ts +32 -4
- package/src/portfolio/period-pnl.ts +4 -2
- package/src/react/async-resource.ts +24 -8
- package/src/remote/endpoint.ts +38 -12
- package/src/remote/secrets.ts +22 -6
- package/src/remote/server.ts +20 -4
- package/src/renderers/dom/data-table/index.tsx +2 -1
- package/src/renderers/dom/data-table/row.tsx +49 -7
- package/src/renderers/dom/desktop/controls.tsx +2 -0
- package/src/renderers/dom/desktop/query-bar.tsx +57 -7
- package/src/renderers/dom/host/surface-3d.tsx +46 -5
- package/src/renderers/dom/styles.css +17 -0
- package/src/renderers/electrobun/view/backend-rpc.ts +15 -21
- package/src/renderers/electrobun/view/cli-pane-shot-entry.tsx +16 -61
- package/src/renderers/electrobun/view/cli-pane-shot-socket.ts +134 -0
- package/src/renderers/electrobun/view/host-route.ts +119 -0
- package/src/renderers/electrobun/view/rpc-timeout.ts +6 -5
- package/src/renderers/opentui/toast-host.tsx +6 -3
- package/src/renderers/opentui/ui-host.tsx +29 -5
- package/src/series/registry.ts +1 -0
- package/src/series/standalone-catalog.ts +40 -0
- package/src/series/types.ts +10 -0
- package/src/series/validate.ts +5 -0
- package/src/shares/portable-layout.ts +2 -7
- package/src/sources/gloomberb-cloud/dated-chunks.ts +133 -0
- package/src/sources/gloomberb-cloud/index.ts +46 -5
- package/src/sources/gloomberb-cloud/news.ts +15 -9
- package/src/sources/gloomberb-cloud/normalizers.ts +17 -0
- package/src/sources/history-coverage.ts +13 -0
- package/src/sources/history-result.ts +1 -0
- package/src/sources/provider-errors.ts +9 -0
- package/src/sources/provider-router/batches.ts +7 -3
- package/src/sources/provider-router/financial-routes.ts +3 -1
- package/src/sources/provider-router/history.ts +6 -4
- package/src/sources/provider-router/index.ts +5 -1
- package/src/sources/provider-router/primary.ts +4 -3
- package/src/sources/provider-router/retrieved-at.ts +12 -0
- package/src/team/store.ts +17 -4
- package/src/telemetry/crash-reports.ts +3 -1
- package/src/test-support/cli-context.ts +3 -2
- package/src/test-support/test-env.ts +7 -0
- package/src/theme/themes.ts +16 -9
- package/src/theme/tone-contrast.ts +29 -5
- package/src/tickers/company-name-listing.ts +31 -3
- package/src/tickers/company-name.ts +9 -0
- package/src/tickers/index-roots.ts +56 -4
- package/src/tickers/listing-name.ts +7 -2
- package/src/tickers/listing-venues.ts +17 -2
- package/src/tickers/search/home-listing.ts +2 -0
- package/src/tickers/search/index.ts +64 -11
- package/src/tickers/search/major-listings.json +595 -592
- package/src/tickers/search/ranking.ts +19 -1
- package/src/tickers/terminal-codes.ts +5 -3
- package/src/time-series/bar-aggregation.ts +3 -2
- package/src/time-series/base-series.ts +18 -1
- package/src/time-series/chart-data.ts +9 -6
- package/src/time-series/chart-seed.ts +11 -3
- package/src/time-series/currency-conversion.ts +1 -0
- package/src/time-series/date-window.ts +8 -0
- package/src/time-series/formula-months.ts +57 -0
- package/src/time-series/fundamentals/period-points.ts +3 -3
- package/src/time-series/fundamentals/source-statements.ts +5 -4
- package/src/time-series/leverage.ts +12 -4
- package/src/time-series/live-bars.ts +12 -7
- package/src/time-series/live-quotes.ts +6 -2
- package/src/time-series/market.ts +10 -3
- package/src/time-series/price-comparison.ts +106 -0
- package/src/time-series/range.ts +10 -0
- package/src/time-series/resolve-context.ts +7 -2
- package/src/time-series/resolve.ts +61 -5
- package/src/time-series/series-name.ts +2 -2
- package/src/time-series/series-presentation.ts +91 -2
- package/src/time-series/session-bar.ts +13 -7
- package/src/time-series/spec.ts +21 -2
- package/src/time-series/studies/formula.ts +262 -36
- package/src/time-series/studies/leverage.ts +9 -3
- package/src/time-series/studies/resolve.ts +7 -2
- package/src/time-series/types.ts +34 -0
- package/src/time-series/use-chart-resolution.ts +18 -1
- package/src/types/data-provider.ts +7 -0
- package/src/types/financials.ts +103 -1
- package/src/types/headless.ts +64 -3
- package/src/types/instrument.ts +6 -0
- package/src/types/plugin-context.ts +9 -0
- package/src/types/plugin-pane-templates.ts +6 -0
- package/src/types/plugin-panes.ts +7 -0
- package/src/types/price-history.ts +6 -0
- package/src/ui/host.tsx +3 -1
- package/src/ui/index.tsx +7 -2
- package/src/utils/cli-output.ts +21 -1
- package/src/utils/currency-units.ts +14 -0
- package/src/utils/datetime-format.ts +11 -0
- package/src/utils/exchange-announcements.ts +26 -3
- package/src/utils/exchange-notation.generated.ts +3 -4
- package/src/utils/exchange-results.ts +144 -0
- package/src/utils/exchanges.ts +10 -0
- package/src/utils/financial-statements.ts +212 -22
- package/src/utils/fire-and-forget.ts +1 -1
- package/src/utils/fiscal-period.ts +41 -3
- package/src/utils/format.ts +10 -6
- package/src/utils/fundamentals.ts +179 -12
- package/src/utils/futures-generic.ts +26 -0
- package/src/utils/lease-liabilities.ts +15 -5
- package/src/utils/lookup-token.ts +22 -0
- package/src/utils/max-drawdown.ts +25 -4
- package/src/utils/price-history-integrity.ts +56 -8
- package/src/utils/price-history.ts +6 -2
- package/src/utils/price-window.ts +38 -2
- package/src/utils/replace-file.ts +47 -0
- package/src/utils/rpc-timeout-error.ts +16 -2
- package/src/utils/untrusted-text.ts +14 -0
|
@@ -3,12 +3,13 @@ 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, BANK_ENTERPRISE_VALUE, computedEnterpriseValueNote, convertedPriceEarningsNote,
|
|
6
|
+
appTtmRate, BANK_ENTERPRISE_VALUE, computedEnterpriseValueNote, convertedPriceEarningsNote, enterpriseValueLabel,
|
|
7
7
|
enterpriseValueReconciliationNote,
|
|
8
|
-
epsConversionNote, fundamentalsCurrency, isBankEnterpriseValue, reportedEnterpriseValue, trailingEpsSourceNote, ttmAtAppRate, ttmConversionNote,
|
|
8
|
+
epsConversionNote, fundamentalsCurrency, isBankEnterpriseValue, reportedEnterpriseValue, trailingEpsFiscalYear, trailingEpsSourceNote, ttmAtAppRate, ttmConversionNote,
|
|
9
9
|
withBankEnterpriseValue,
|
|
10
10
|
} from "../../utils/fundamentals";
|
|
11
11
|
import { latestFinancialPeriod } from "../../utils/latest-financial-period";
|
|
12
|
+
import { halfYearGrowthPeriod } from "../../utils/financial-statements";
|
|
12
13
|
import { burnsCash, cashRunway, SHORT_RUNWAY_HISTORY, formatRunwayMonths, offeringNote, offeringsAfter, runwayMethod, type CashRunway, type OfferingFiling, type RunwayEstimate } from "../../utils/cash-runway";
|
|
13
14
|
import { exportedFundamentals, formatPriceEarnings, forwardFiscalYear, NOT_MEANINGFUL, priceEarningsOnEarnings } from "../../utils/price-earnings";
|
|
14
15
|
import { describeFundamentalMarketCap, marketCapBasisNote, selectMarketCapitalization, viewMarketCapitalization, withheldMarketCap } from "../../utils/market-capitalization";
|
|
@@ -21,7 +22,7 @@ import {
|
|
|
21
22
|
formatPercentRaw,
|
|
22
23
|
MISSING_VALUE,
|
|
23
24
|
} from "../../utils/format";
|
|
24
|
-
import { formatMarketCostWithCurrency, formatMarketPriceWithCurrency, formatMarketQuantity, nearParCoinPriceDigits, quoteFormatOptions, withCurrencyMinorDigits, type MarketFormatOptions } from "../../market-data/market/format";
|
|
25
|
+
import { formatMarketCostWithCurrency, formatMarketPriceWithCurrency, formatMarketQuantity, nearParCoinPriceDigits, quoteFormatOptions, withCurrencyMinorDigits, withStablePriceDigits, type MarketFormatOptions } from "../../market-data/market/format";
|
|
25
26
|
import {
|
|
26
27
|
cliStyles,
|
|
27
28
|
cliTerminalWidth,
|
|
@@ -50,7 +51,11 @@ import {
|
|
|
50
51
|
import { currencyCodeLabel, heldCurrencyUnit } from "../../utils/currency-units";
|
|
51
52
|
import { quotedFxPair } from "../../utils/currency-pair";
|
|
52
53
|
import type { AppConfig } from "../../types/config";
|
|
54
|
+
import { cleanFloat32Price, decimalPlaces } from "../../utils/float32-price";
|
|
53
55
|
import type { CompanyProfile, DeclaredDividendAction, FinancialStatement, Quote, TickerFinancials } from "../../types/financials";
|
|
56
|
+
import { apiClient } from "../../api-client";
|
|
57
|
+
import { withBalanceSheetRate } from "../../market-data/quotes/balance-sheet-rate";
|
|
58
|
+
import { enterpriseValueBridgeNote, listingEnterpriseValue } from "../../market-data/quotes/listing-enterprise-value";
|
|
54
59
|
import { atRegularSessionPrice, regularSessionValuationPrice } from "../../market-data/quotes/regular-session-valuation";
|
|
55
60
|
import { computeTickerPriceReturns } from "../../market-data/ticker-price-returns";
|
|
56
61
|
import { instrumentTypeLabel, resolveTickerInstrumentKind } from "../../tickers/instrument-kind";
|
|
@@ -83,8 +88,9 @@ import { ownerNames, rowSummary, rowSummaryTarget } from "../../plugins/builtin/
|
|
|
83
88
|
import { fundFactsAbroadKey, hasFundFactsAbroad, isKnownNonUsListing, secFilingItemCodes, US_FUND_FACTS_ONLY } from "../../utils/sec";
|
|
84
89
|
import { currentReportItemsLabel, hiddenFilingsNote, loadLatestFilings, type HiddenFilings } from "../../utils/sec-filings";
|
|
85
90
|
import { canonicalExchange, exchangeLabel, isKnownExchangeCode, isUsListingExchange } from "../../utils/exchanges";
|
|
91
|
+
import { exchangeResultsNotes } from "../../utils/exchange-results";
|
|
86
92
|
import {
|
|
87
|
-
coinListingNotes, failIfNotTraded, failMovedSymbol, ListingArgError, listingChoiceNotes, listingFateLoader, listingIdentity, loadBareVenues,
|
|
93
|
+
coinListingNotes, failIfNotTraded, failMovedSymbol, failUnchosenListing, ListingArgError, listingChoiceNotes, listingFateLoader, listingIdentity, loadBareVenues,
|
|
88
94
|
resolveCliListing, type CliListing, type ListingDataRequest,
|
|
89
95
|
} from "../listing-arg";
|
|
90
96
|
import { isUsSymbolVenue, movedAwayChange } from "../../tickers/ticker-changes";
|
|
@@ -177,6 +183,23 @@ function appendMetricSection(lines: string[], title: string, metrics: Array<[str
|
|
|
177
183
|
* Last and the extended print, or a closed market's last quote with its day (ITA's $202.00 against $208.74
|
|
178
184
|
* around a $206.65 close is no open book).
|
|
179
185
|
*/
|
|
186
|
+
/**
|
|
187
|
+
* The decimals a 52-week range prints at: the ones its own prices need once
|
|
188
|
+
* read as the float32 they come from (CL=F's 54.97999954 is 54.98), padded to
|
|
189
|
+
* the currency's minor unit and never past the instrument's stable decimals.
|
|
190
|
+
* A JSE line served in cents read 650.5600 at the four decimals cents allow;
|
|
191
|
+
* it reads 650.56, as Last and the day's range do, and a pence line's
|
|
192
|
+
* 25.5377 keeps its four.
|
|
193
|
+
*/
|
|
194
|
+
function yearRangeOptions(quote: Quote, options: MarketFormatOptions): MarketFormatOptions {
|
|
195
|
+
if (options.fixedFractionDigits !== undefined) return options;
|
|
196
|
+
const stable = withStablePriceDigits(options, quote.currency, quote);
|
|
197
|
+
if (stable.fixedFractionDigits === undefined) return stable;
|
|
198
|
+
const written = [quote.low52w, quote.high52w].flatMap((price) => price != null && Number.isFinite(price) ? [decimalPlaces(cleanFloat32Price(price))] : []);
|
|
199
|
+
const digits = Math.max(options.minimumFractionDigits ?? 0, ...written);
|
|
200
|
+
return { ...stable, fixedFractionDigits: Math.min(stable.fixedFractionDigits, digits) };
|
|
201
|
+
}
|
|
202
|
+
|
|
180
203
|
function bidAskText(quote: Quote, options: MarketFormatOptions): string {
|
|
181
204
|
const text = formatBidAsk(quote.bid, quote.ask, quote.bidSize, quote.askSize, quote.currency, options);
|
|
182
205
|
const label = text === "—" ? null : quoteBookSessionLabel(quote);
|
|
@@ -597,7 +620,7 @@ function consolidatedRangeBasis(quote: Quote): string | null {
|
|
|
597
620
|
|
|
598
621
|
/** `Reporting currency not sourced for EPS (TTM) and Revenue (TTM).`: the trailing amounts shown bare. */
|
|
599
622
|
function unsourcedCurrencyNote(metrics: readonly FundamentalsMetric[]): string | undefined {
|
|
600
|
-
const bare = metrics.filter((metric) => TRAILING_MONEY_METRICS.has(metric.label) && metric.text !== "—" && !metric.unit)
|
|
623
|
+
const bare = metrics.filter((metric) => TRAILING_MONEY_METRICS.has(metricName(metric.label)) && metric.text !== "—" && !metric.unit)
|
|
601
624
|
.map((metric) => metric.label);
|
|
602
625
|
if (bare.length === 0) return undefined;
|
|
603
626
|
const list = bare.length === 1 ? bare[0]! : `${bare.slice(0, -1).join(", ")} and ${bare.at(-1)}`;
|
|
@@ -605,31 +628,32 @@ function unsourcedCurrencyNote(metrics: readonly FundamentalsMetric[]): string |
|
|
|
605
628
|
}
|
|
606
629
|
|
|
607
630
|
/**
|
|
608
|
-
* The EV line:
|
|
609
|
-
* withdrawn, N/M at or below zero as a P/E over
|
|
631
|
+
* The EV line: the one every view shows (reportedEnterpriseValue, market cap + debt - cash where the provider's is
|
|
632
|
+
* more than 5% from it, with its inputs in a note), "unavailable" when withdrawn, N/M at or below zero as a P/E over
|
|
633
|
+
* a loss is.
|
|
610
634
|
*/
|
|
611
635
|
function enterpriseValueFigure(figure: MetricFigure, fundamentals: TickerFinancials["fundamentals"]): MetricFigure {
|
|
612
636
|
// A bank's: its deposits are funding, not debt.
|
|
613
637
|
if (isBankEnterpriseValue(fundamentals)) return { text: BANK_ENTERPRISE_VALUE, value: "N/M", unit: figure.unit };
|
|
614
638
|
const label = enterpriseValueLabel(fundamentals);
|
|
615
639
|
if (label === "not-meaningful") return { ...multipleFigure(NOT_MEANINGFUL), unit: figure.unit };
|
|
616
|
-
|
|
617
|
-
|
|
640
|
+
// A withdrawn EV the bridge stands in for shows the bridge (listingEnterpriseView).
|
|
641
|
+
if (label === "unavailable" && typeof figure.value !== "number") return { text: "unavailable", value: null, unit: figure.unit };
|
|
642
|
+
return figure;
|
|
618
643
|
}
|
|
619
644
|
|
|
620
645
|
/**
|
|
621
|
-
* The fundamentals `
|
|
622
|
-
* the
|
|
623
|
-
* `valuation` keep both, and JSON keeps the provider's beside its check).
|
|
646
|
+
* The EV `fundamentals`, `valuation`, RV and the reverse DCF read (listingEnterpriseValue), where it is not the one
|
|
647
|
+
* served: the bridge in place of a withdrawn figure, with the note that gives its inputs, or what a bridge lacks.
|
|
624
648
|
*/
|
|
625
|
-
function
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
):
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
649
|
+
function listingEnterpriseView(financials: Parameters<typeof listingEnterpriseValue>[0]): { figure?: MetricFigure; value?: number; currency?: string; note?: string } {
|
|
650
|
+
const listing = listingEnterpriseValue(financials);
|
|
651
|
+
if (listing.kind === "value" && listing.basis === "computed") {
|
|
652
|
+
return { figure: { text: formatReportedMoney(listing.value, listing.currency), value: listing.value, unit: listing.currency },
|
|
653
|
+
value: listing.value, currency: listing.currency, note: enterpriseValueBridgeNote(listing) ?? undefined };
|
|
654
|
+
}
|
|
655
|
+
return listing.kind === "unavailable" && listing.needs
|
|
656
|
+
? { note: `Market cap + total debt - cash in place of the withdrawn EV needs ${listing.needs}.` } : {};
|
|
633
657
|
}
|
|
634
658
|
|
|
635
659
|
function percentFigure(fraction: number | null | undefined, format: (value: number) => string): MetricFigure {
|
|
@@ -824,10 +848,17 @@ function fundamentalsMetrics(
|
|
|
824
848
|
marketCap: MetricFigure,
|
|
825
849
|
priceReturns: { return1Y?: number | null; return3Y?: number | null },
|
|
826
850
|
reportingCurrency: string | undefined,
|
|
827
|
-
enterpriseValue = reportedMoney(
|
|
851
|
+
enterpriseValue = reportedMoney(
|
|
852
|
+
reportedEnterpriseValue(fundamentals, enterpriseValueCurrency(quote, fundamentals)),
|
|
853
|
+
enterpriseValueCurrency(quote, fundamentals),
|
|
854
|
+
),
|
|
828
855
|
distributions: DividendDistributions | null = null,
|
|
829
856
|
bond: FundBondFacts | null = null,
|
|
830
857
|
codes = false,
|
|
858
|
+
/** The fiscal year the trailing EPS is (trailingEpsFiscalYear), named on the EPS and P/E lines in place of TTM. */
|
|
859
|
+
epsYear?: string,
|
|
860
|
+
/** A half-year reporter's latest period growth compares halves, not quarters: "H1 2026 vs H1 2025" (halfYearGrowthPeriod). */
|
|
861
|
+
growthPeriod?: string | null,
|
|
831
862
|
): FundamentalsMetric[] {
|
|
832
863
|
const signed = (value: number) => colorBySign(formatPercent(value), value);
|
|
833
864
|
const receipt = fundamentals?.sharesOutstanding != null && sharesOutstandingInReceipts(quote, fundamentals, profile?.description);
|
|
@@ -835,7 +866,7 @@ function fundamentalsMetrics(
|
|
|
835
866
|
{ label: "Market Cap", ...marketCap },
|
|
836
867
|
{ label: "Enterprise Value", ...enterpriseValueFigure(enterpriseValue, withBankEnterpriseValue(fundamentals, profile)) },
|
|
837
868
|
// A multiple over a loss is N/M, even beside a positive one the source served from an older period.
|
|
838
|
-
{ label: "P/E (TTM)", ...multipleFigure(priceEarningsOnEarnings(fundamentals?.trailingPE, fundamentals?.eps)) },
|
|
869
|
+
{ label: epsYear ? `P/E ${epsYear}` : "P/E (TTM)", ...multipleFigure(priceEarningsOnEarnings(fundamentals?.trailingPE, fundamentals?.eps)) },
|
|
839
870
|
// Next fiscal year's consensus, named by its year: `Forward P/E FY27`.
|
|
840
871
|
{
|
|
841
872
|
label: forwardLabel(fundamentals),
|
|
@@ -844,7 +875,7 @@ function fundamentalsMetrics(
|
|
|
844
875
|
{ label: "PEG", ...multipleFigure(fundamentals?.pegRatio) },
|
|
845
876
|
// EPS (TTM) is the last four filed quarters' (filed-trailing-eps), so its twelve months can end before those of
|
|
846
877
|
// the flows below, Gloom Cloud's trailing block; Gloom Cloud's EPS standing in is noted (trailingEpsSourceNote).
|
|
847
|
-
{ label: "EPS (TTM)", ...reportedMoney(fundamentals?.eps, fundamentals?.epsCurrency?.trim() || reportingCurrency, true, codes) },
|
|
878
|
+
{ label: epsYear ? `EPS ${epsYear}` : "EPS (TTM)", ...reportedMoney(fundamentals?.eps, fundamentals?.epsCurrency?.trim() || reportingCurrency, true, codes) },
|
|
848
879
|
{
|
|
849
880
|
label: dividendYieldLabel(fundamentals?.dividendYieldBasis, bond),
|
|
850
881
|
...forwardYieldFigure(fundamentals, distributions, bond),
|
|
@@ -858,7 +889,7 @@ function fundamentalsMetrics(
|
|
|
858
889
|
{ label: "Operating Margin", ...percentFigure(fundamentals?.operatingMargin, formatFractionPercentCell) },
|
|
859
890
|
{ label: "Profit Margin", ...percentFigure(fundamentals?.profitMargin, formatFractionPercentCell) },
|
|
860
891
|
{ label: "Revenue Growth", ...percentFigure(fundamentals?.revenueGrowth, signed) },
|
|
861
|
-
{ label: "Last Quarter Growth", ...percentFigure(fundamentals?.lastQuarterGrowth, signed) },
|
|
892
|
+
{ label: growthPeriod ? `Revenue ${growthPeriod}` : "Last Quarter Growth", ...percentFigure(fundamentals?.lastQuarterGrowth, signed) },
|
|
862
893
|
{ label: "1Y Return", ...percentFigure(priceReturns.return1Y, signed) },
|
|
863
894
|
{ label: "3Y Return", ...percentFigure(priceReturns.return3Y, signed) },
|
|
864
895
|
{
|
|
@@ -913,7 +944,9 @@ function forwardLabel(fundamentals: TickerFinancials["fundamentals"]): string {
|
|
|
913
944
|
}
|
|
914
945
|
|
|
915
946
|
/** A line's name without the fiscal year a forward figure names: `Forward P/E FY27` is Forward P/E. */
|
|
916
|
-
|
|
947
|
+
/** A metric's name whatever period its label names: `Forward P/E FY28` is Forward P/E, `EPS FY Mar-26` is EPS (TTM), `Revenue H1 2026 vs H1 2025` the latest period's growth. */
|
|
948
|
+
const metricName = (label: string) => label.replace(/ FY\d{2}$/, "").replace(/^(EPS|P\/E) FY [A-Z][a-z]{2}-\d{2}$/, "$1 (TTM)")
|
|
949
|
+
.replace(/^Revenue H[12] .+ vs H[12] .+$/, "Last Quarter Growth");
|
|
917
950
|
|
|
918
951
|
function withoutStockRows<T extends { label: string }>(metrics: T[], fund: boolean): T[] {
|
|
919
952
|
return fund ? metrics.filter((metric) => !STOCK_ONLY_METRICS.has(metricName(metric.label))) : metrics;
|
|
@@ -932,9 +965,12 @@ const TRAILING_MONEY_METRICS = new Set(["EPS (TTM)", "Revenue (TTM)", "Net Incom
|
|
|
932
965
|
* the regular session price (atRegularSessionPrice), the figures the lines show, so each note reads those.
|
|
933
966
|
*/
|
|
934
967
|
function fundamentalsNotes(
|
|
935
|
-
|
|
968
|
+
/** With the statements where the report has them: the balance sheet says what a bridge's cash holds. */
|
|
969
|
+
priced: Pick<TickerFinancials, "quote" | "fundamentals"> & Partial<Pick<TickerFinancials, "annualStatements" | "quarterlyStatements">>,
|
|
936
970
|
metrics: readonly FundamentalsMetric[],
|
|
937
971
|
quoteCurrency: string | undefined,
|
|
972
|
+
/** The bridge's inputs, or what it lacks, where the EV is not the one served (listingEnterpriseView). */
|
|
973
|
+
listingNote?: string,
|
|
938
974
|
): string[] {
|
|
939
975
|
const fundamentals = priced.fundamentals;
|
|
940
976
|
const shown = (label: string) => metrics.some((metric) => metric.label === label && metric.text !== "—");
|
|
@@ -943,15 +979,18 @@ function fundamentalsNotes(
|
|
|
943
979
|
? marketCapBasisNote(viewMarketCapitalization(priced.quote, fundamentals, regularSessionValuationPrice(priced.quote)))
|
|
944
980
|
: undefined;
|
|
945
981
|
const conversion = [...TRAILING_MONEY_METRICS].some(shown) ? ttmConversionNote(fundamentals) : undefined;
|
|
946
|
-
const eps =
|
|
982
|
+
const eps = metrics.some((metric) => metricName(metric.label) === "EPS (TTM)" && metric.text !== "—") ? epsConversionNote(fundamentals) : undefined;
|
|
947
983
|
const epsSource = trailingEpsSourceNote(fundamentals, { eps: shown("EPS (TTM)"), pe: shown("P/E (TTM)") });
|
|
948
|
-
const priceEarnings = metrics.some((metric) => metric.label === "P/E (TTM)" && typeof metric.value === "number")
|
|
984
|
+
const priceEarnings = metrics.some((metric) => metricName(metric.label) === "P/E (TTM)" && typeof metric.value === "number")
|
|
949
985
|
? convertedPriceEarningsNote(fundamentals, quoteCurrency)
|
|
950
986
|
: undefined;
|
|
951
987
|
// Why the EV is labelled, withdrawn or N/M; for an insurer's, what Gloom Cloud computed it from.
|
|
952
988
|
// A bank's EV line says why it is n/m.
|
|
989
|
+
const bridged = metrics.some((metric) => metric.label === "Enterprise Value" && typeof metric.value === "number")
|
|
990
|
+
&& enterpriseValueLabel(fundamentals) === "unavailable";
|
|
953
991
|
const enterpriseValue = shown("Enterprise Value") && !metrics.some((metric) => metric.text === BANK_ENTERPRISE_VALUE)
|
|
954
|
-
? enterpriseValueReconciliationNote(fundamentals
|
|
992
|
+
? bridged ? listingNote : [enterpriseValueReconciliationNote(fundamentals, enterpriseValueCurrency(priced.quote, fundamentals), priced)
|
|
993
|
+
?? computedEnterpriseValueNote(fundamentals), listingNote].filter(Boolean).join(" ") || undefined
|
|
955
994
|
: undefined;
|
|
956
995
|
// A cap Gloom Cloud withheld says why, as RV and EQS do.
|
|
957
996
|
const withheld = withheldMarketCap(fundamentals)?.note;
|
|
@@ -989,6 +1028,7 @@ function statementFilingsNotes(report: StatementFilingsReport | null | undefined
|
|
|
989
1028
|
return [
|
|
990
1029
|
...latest ? [`Latest ${report.latestQuarter ? "quarter" : "annual period"} ${statementPeriodText(latest.date, latest)}.`] : [],
|
|
991
1030
|
...report.resultsRelease ? [resultsReleaseText(report.resultsRelease)] : [],
|
|
1031
|
+
...report.exchangeResults ? exchangeResultsNotes(report.exchangeResults) : [],
|
|
992
1032
|
];
|
|
993
1033
|
}
|
|
994
1034
|
|
|
@@ -1078,7 +1118,8 @@ function fundamentalsReportMetrics(snapshot: FundamentalsReportData, view: "fund
|
|
|
1078
1118
|
? { text: `${formatCompact(capitalization.value)} ${capitalization.currency}`, value: capitalization.value, unit: capitalization.currency }
|
|
1079
1119
|
: { text: "—" };
|
|
1080
1120
|
const metrics = withoutStockRows(fundamentalsMetrics(quote, fundamentals, financials.profile, marketCap, computeTickerPriceReturns(financials),
|
|
1081
|
-
fundamentalsCurrency(financials),
|
|
1121
|
+
fundamentalsCurrency(financials), listingEnterpriseView(snapshot).figure, snapshot.distributions ?? null, snapshot.bondFund ?? null, snapshot.currencyCodes === true,
|
|
1122
|
+
trailingEpsFiscalYear(financials), halfYearGrowthPeriod(financials)),
|
|
1082
1123
|
resolveTickerInstrumentKind(null, financials) === "fund");
|
|
1083
1124
|
if (view === "fundamentals") {
|
|
1084
1125
|
return [...metrics, ...floatAndShortInterestMetrics(quote, fundamentals, financials.profile)]
|
|
@@ -1117,7 +1158,9 @@ export function renderFundamentalsReport(
|
|
|
1117
1158
|
const fund = fundFactsNote(symbol, financials.exchange || quote?.exchangeName, financials, null, financials.fundFacts);
|
|
1118
1159
|
if (lines.length === before) lines.push("", cliStyles.muted([`No ${view} reported for ${financials.symbol}.`, fund].filter(Boolean).join(" ")));
|
|
1119
1160
|
else if (fund) lines.push(cliStyles.muted(fund));
|
|
1120
|
-
for (const note of fundamentalsNotes(atRegularSessionPrice(financials), metrics, quote?.currency
|
|
1161
|
+
for (const note of fundamentalsNotes(atRegularSessionPrice(financials), metrics, quote?.currency, listingEnterpriseView(financials).note)) {
|
|
1162
|
+
lines.push(cliStyles.muted(note));
|
|
1163
|
+
}
|
|
1121
1164
|
if (view === "fundamentals") {
|
|
1122
1165
|
if (financials.taxEquivalent) {
|
|
1123
1166
|
appendMetricSection(lines, "Tax-Equivalent Yield", taxEquivalentLines(financials.taxEquivalent).map((line) => [line.label, line.text]));
|
|
@@ -1192,7 +1235,7 @@ export function fundamentalsReportTables(
|
|
|
1192
1235
|
notes: [
|
|
1193
1236
|
...metrics.length === 0
|
|
1194
1237
|
? [`No ${view} reported for ${financials.symbol}.`]
|
|
1195
|
-
: fundamentalsNotes(atRegularSessionPrice(financials), metrics, financials.quote?.currency),
|
|
1238
|
+
: fundamentalsNotes(atRegularSessionPrice(financials), metrics, financials.quote?.currency, listingEnterpriseView(financials).note),
|
|
1196
1239
|
...fund ? [fund] : [],
|
|
1197
1240
|
...view === "fundamentals" ? statementFilingsNotes(financials.statementFilings) : [],
|
|
1198
1241
|
...bank?.notes ?? [],
|
|
@@ -1371,10 +1414,13 @@ export async function buildTickerReport({
|
|
|
1371
1414
|
: "—";
|
|
1372
1415
|
// Shown in the same currency as the market cap, so the two can be compared.
|
|
1373
1416
|
const evCurrency = enterpriseValueCurrency(quote, fundamentals);
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
const
|
|
1377
|
-
|
|
1417
|
+
// Not across currencies: a check in another currency than the EV shown describes another figure.
|
|
1418
|
+
// A withdrawn EV gives way to the bridge `fundamentals` shows (listingEnterpriseView).
|
|
1419
|
+
const listingEv = listingEnterpriseView(financials);
|
|
1420
|
+
const enterpriseValue = listingEv.value ?? reportedEnterpriseValue(priced.fundamentals, evCurrency);
|
|
1421
|
+
const enterpriseValueCode = listingEv.currency ?? evCurrency;
|
|
1422
|
+
const enterpriseValueText = `${formatReportedMoney(enterpriseValue, enterpriseValueCode)}${enterpriseValue != null && enterpriseValueCode
|
|
1423
|
+
? await inBase(enterpriseValue, enterpriseValueCode) : ""}`;
|
|
1378
1424
|
|
|
1379
1425
|
if (quote) {
|
|
1380
1426
|
// As the Overview reads it: the regular session, then the extended-hours print against its close.
|
|
@@ -1406,8 +1452,10 @@ export async function buildTickerReport({
|
|
|
1406
1452
|
[quote.delisting ? "Last Session" : "Day Range", quote.low != null || quote.high != null
|
|
1407
1453
|
? `${formatPriceRange(quote.low, quote.high, quote.currency, quoteOptions)}${consolidatedRangeBasis(quote) ? ` (${consolidatedRangeBasis(quote)})` : ""}`
|
|
1408
1454
|
: "—"],
|
|
1455
|
+
// The year's high and low come from bars (a continuous future's are float32, 54.97999954): they print at
|
|
1456
|
+
// the instrument's own decimals, as the Overview's ranges do, never at every digit the bars carry.
|
|
1409
1457
|
["52W Range", quote.low52w != null || quote.high52w != null
|
|
1410
|
-
? formatPriceRange(quote.low52w, quote.high52w, quote.currency, quoteOptions)
|
|
1458
|
+
? formatPriceRange(quote.low52w, quote.high52w, quote.currency, yearRangeOptions(quote, quoteOptions))
|
|
1411
1459
|
: "—"],
|
|
1412
1460
|
["Bid / Ask", bidAskText(quote, quoteOptions)],
|
|
1413
1461
|
// An index's and a perpetual's 0 means none is counted, not no trades: no Volume row.
|
|
@@ -1431,8 +1479,9 @@ export async function buildTickerReport({
|
|
|
1431
1479
|
|
|
1432
1480
|
// A listing of the last year may have no statements yet: its IPO says how recent it is.
|
|
1433
1481
|
const listing = { listedSince: ipo ? ipo.deal.listingDate ?? ipo.deal.firstDay?.session ?? null : null };
|
|
1434
|
-
const metrics = withoutStockRows(fundamentalsMetrics(quote,
|
|
1435
|
-
fundamentalsCurrency(financials, listing), { text: enterpriseValueText }, distributions, bondFund, codes
|
|
1482
|
+
const metrics = withoutStockRows(fundamentalsMetrics(quote, priced.fundamentals, profile, { text: marketCapText }, priceReturns,
|
|
1483
|
+
fundamentalsCurrency(financials, listing), { text: enterpriseValueText, ...listingEv.value != null ? { value: listingEv.value } : {} }, distributions, bondFund, codes, trailingEpsFiscalYear(financials),
|
|
1484
|
+
halfYearGrowthPeriod(financials)), isFund);
|
|
1436
1485
|
const reportedCurrency = financials.financialCurrency?.trim();
|
|
1437
1486
|
const statements = [...financials.annualStatements, ...financials.quarterlyStatements];
|
|
1438
1487
|
const fallbackCurrency = reportedCurrency && statements.every((row) => !row.currency?.trim() || row.currency.trim() === reportedCurrency)
|
|
@@ -1443,9 +1492,9 @@ export async function buildTickerReport({
|
|
|
1443
1492
|
|
|
1444
1493
|
const beforeFundamentals = lines.length;
|
|
1445
1494
|
appendMetricSection(lines, "Fundamentals", metricLines(metrics));
|
|
1446
|
-
for (const note of fundamentalsNotes(
|
|
1495
|
+
for (const note of fundamentalsNotes(priced, metrics, quote?.currency, listingEv.note)) lines.push(cliStyles.muted(note));
|
|
1447
1496
|
// The trailing block beside statements in another currency, when no conversion says why.
|
|
1448
|
-
const split = metrics.some((metric) => TRAILING_MONEY_METRICS.has(metric.label) && metric.text !== "—")
|
|
1497
|
+
const split = metrics.some((metric) => TRAILING_MONEY_METRICS.has(metricName(metric.label)) && metric.text !== "—")
|
|
1449
1498
|
? ttmCurrencySplitNote(priced.fundamentals, [latestAnnual, latestQuarter].flatMap((row) => row ? [statementCurrency(row)] : []))
|
|
1450
1499
|
: undefined;
|
|
1451
1500
|
if (split) lines.push(cliStyles.muted(split));
|
|
@@ -1686,7 +1735,7 @@ async function quoteUnavailableNote(dataProvider: MarketContext["dataProvider"],
|
|
|
1686
1735
|
export async function ticker(symbol: string, dependencies: TickerCommandDependencies = {}) {
|
|
1687
1736
|
const initMarketDataFn = dependencies.initMarketData ?? initMarketData;
|
|
1688
1737
|
const failCommand = dependencies.fail ?? fail;
|
|
1689
|
-
await withMarketData(initMarketDataFn, async ({ config, store, dataProvider, dataDir, statementSources }) => {
|
|
1738
|
+
await withMarketData(initMarketDataFn, async ({ config, store, dataProvider, dataDir, statementSources, fxHistory }) => {
|
|
1690
1739
|
let listing: CliListing;
|
|
1691
1740
|
try {
|
|
1692
1741
|
listing = await resolveCliListing(symbol, dependencies.exchange, { store, dataProvider });
|
|
@@ -1721,6 +1770,8 @@ export async function ticker(symbol: string, dependencies: TickerCommandDependen
|
|
|
1721
1770
|
// A known exchange the symbol is not listed on: say where it is.
|
|
1722
1771
|
await failIfNotTraded(listing, { store, dataProvider }, { fail: failCommand });
|
|
1723
1772
|
await failIfMovedAway();
|
|
1773
|
+
// A bare code several companies list (3988 is Bank of China in Hong Kong and Sys Holdings in Tokyo) asks which, as `quote` does.
|
|
1774
|
+
await failUnchosenListing(listing, { store, dataProvider }, { fail: failCommand }, request, error);
|
|
1724
1775
|
const reason = error instanceof Error ? error.message : String(error);
|
|
1725
1776
|
// A symbol no listing carries is not a failed fetch, and the message already names it.
|
|
1726
1777
|
if (isNotATickerMessage(reason)) failCommand(reason);
|
|
@@ -1838,8 +1889,10 @@ export async function ticker(symbol: string, dependencies: TickerCommandDependen
|
|
|
1838
1889
|
const listingNote = choiceNotes.join("\n") || undefined;
|
|
1839
1890
|
const memberships = await membershipsLoad;
|
|
1840
1891
|
// A converted TTM block at the rate the rest of the report converts at, the one `fx` reports. A listing that
|
|
1841
|
-
// stopped trading shows none of the profile and figures another listing under its symbol was served with.
|
|
1842
|
-
|
|
1892
|
+
// stopped trading shows none of the profile and figures another listing under its symbol was served with. A
|
|
1893
|
+
// withdrawn EV's bridge converts a balance sheet in another currency at our close on its date, as `fundamentals` does.
|
|
1894
|
+
const shownFinancials = await withBalanceSheetRate(
|
|
1895
|
+
await atReportTtmRate(otherProfile ? withoutResearch(resolvedFinancials) : resolvedFinancials, toBase), fxHistory ?? apiClient);
|
|
1843
1896
|
if (dependencies.printResult) {
|
|
1844
1897
|
const newsNote = recentNews[0]?.searchedFor ? newsFallbackNotice(requestSymbol, recentNews[0].searchedFor) : null;
|
|
1845
1898
|
const warnings = [...choiceNotes, quoteNote, newsNote].filter((note): note is string => !!note);
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The blocks of text with a figure in them that a pane's body shows, outside
|
|
3
|
+
* its controls, chrome, states and charts, and outside the labels of its
|
|
4
|
+
* tables and labelled values: what a capture of a pane that marks no rows
|
|
5
|
+
* (DIAG's prose, CORR's matrix) is read by.
|
|
6
|
+
*
|
|
7
|
+
* A block is the element a run of text lays out in: the inline pieces of one
|
|
8
|
+
* line (`Page {a} of {b}`, which React writes as several text nodes, or a
|
|
9
|
+
* figure in a span) count once. A label is not data: "52W High" or "10Y" over
|
|
10
|
+
* a "-" is an empty grid, as `filledKeyValueCount` reads it.
|
|
11
|
+
*
|
|
12
|
+
* Self-contained so the screenshot runner can evaluate it in the browser.
|
|
13
|
+
*/
|
|
14
|
+
export function countContentFigures(root: HTMLElement, isVisible: (element: Element) => boolean): number {
|
|
15
|
+
const view = root.ownerDocument.defaultView!;
|
|
16
|
+
const body = root.querySelector<HTMLElement>('[data-gloom-role="pane-body"]') ?? root;
|
|
17
|
+
// Controls, chrome and states say nothing of data, and a chart counts what it plots: "1M" on a tab is not a figure.
|
|
18
|
+
const outside = [
|
|
19
|
+
"button", '[role="button"]', '[role="tab"]', '[role="tablist"]', "input", "textarea", "select", "svg", "canvas",
|
|
20
|
+
'[data-gloom-role="query-bar"]', '[data-gloom-role="pane-header"]', '[data-gloom-role="pane-footer"]', '[data-gloom-role="tab-list"]',
|
|
21
|
+
'[data-gloom-role="page-stack-header"]', '[data-gloom-role="shot-watermark"]', '[data-gloom-role*="chart"]',
|
|
22
|
+
'[data-gloom-ui="empty-state"]', '[data-gloom-ui="notice"]', '[data-gloom-ui="pane-status"]', '[data-gloom-ui="sign-in-wall"]',
|
|
23
|
+
'[data-gloom-ui="pro-lock"]',
|
|
24
|
+
// A table's header names its columns.
|
|
25
|
+
"th", "thead", '[role="columnheader"]', '[role="rowheader"]', '[data-gloom-role="data-table-header-row"]',
|
|
26
|
+
'[data-gloom-role="data-table-header-cell"]',
|
|
27
|
+
].join(", ");
|
|
28
|
+
const labelled = '[data-gloom-ui="key-value-row"], [data-gloom-role="stat-grid-cell"]';
|
|
29
|
+
const blocks = new Set<Element>();
|
|
30
|
+
// 4 is NodeFilter.SHOW_TEXT, named by number so the function carries no global it might not find.
|
|
31
|
+
const walker = root.ownerDocument.createTreeWalker(body, 4);
|
|
32
|
+
for (let node = walker.nextNode(); node; node = walker.nextNode()) {
|
|
33
|
+
const parent = node.parentElement;
|
|
34
|
+
if (!parent || !/\d/.test(node.textContent ?? "") || parent.closest(outside) || !isVisible(parent)) continue;
|
|
35
|
+
// A labelled value's label is its first child: its value is the figure, if it has one.
|
|
36
|
+
if (parent.closest(labelled)?.firstElementChild?.contains(parent)) continue;
|
|
37
|
+
// An element that lays out inline (or names no display) is part of its parent's line.
|
|
38
|
+
let block: Element = parent;
|
|
39
|
+
while (block !== body && block.parentElement && /^(inline|contents|$)/.test(view.getComputedStyle(block).display)) {
|
|
40
|
+
block = block.parentElement;
|
|
41
|
+
}
|
|
42
|
+
blocks.add(block);
|
|
43
|
+
}
|
|
44
|
+
return blocks.size;
|
|
45
|
+
}
|
package/src/cli/context.ts
CHANGED
|
@@ -10,6 +10,7 @@ import type { PluginCapability } from "../capabilities";
|
|
|
10
10
|
import type { AppConfig } from "../types/config";
|
|
11
11
|
import type { GloomPlugin } from "../types/plugin";
|
|
12
12
|
import { standaloneSeriesCatalog, standaloneSeriesInvoker, standaloneSeriesNamed } from "../series/standalone";
|
|
13
|
+
import { setStandaloneSeriesCatalog } from "../series/standalone-catalog";
|
|
13
14
|
import type { PluginRegistry } from "../plugins/registry";
|
|
14
15
|
import type { LoadedExternalPlugin } from "../plugins/loader";
|
|
15
16
|
import { apiClient } from "../api-client";
|
|
@@ -127,6 +128,8 @@ export async function initMarketData(options: CliContextOptions = {}): Promise<M
|
|
|
127
128
|
const seriesCapabilities = standaloneSeriesInvoker(plugins, context.dataDir, context.config.disabledPlugins);
|
|
128
129
|
const findCatalogSeries = standaloneSeriesCatalog(plugins, context.config.disabledPlugins);
|
|
129
130
|
const findCatalogSeriesNamed = standaloneSeriesNamed(plugins, context.config.disabledPlugins);
|
|
131
|
+
// A chart typed as a catalog series' id or name (`fn G fut:crack-321`) reads it from the plugins' declared series.
|
|
132
|
+
setStandaloneSeriesCatalog(plugins, context.config.disabledPlugins);
|
|
130
133
|
return { ...context, dataProvider, seriesCapabilities, findCatalogSeries, findCatalogSeriesNamed, statementSources: cloudStatementReportSources };
|
|
131
134
|
}
|
|
132
135
|
|
|
@@ -138,6 +141,8 @@ export async function initCliServices(options: CliServicesOptions = {}) {
|
|
|
138
141
|
plugins: getLoadablePlugins(options.externalPlugins ?? []),
|
|
139
142
|
externalPlugins: options.externalPlugins ?? [],
|
|
140
143
|
interactive: false,
|
|
144
|
+
// The command exits once it has answered: no alert poller or stream starts for it.
|
|
145
|
+
runtime: "command",
|
|
141
146
|
});
|
|
142
147
|
services.providerRouter.setConfigAccessor(() => config);
|
|
143
148
|
services.providerRouter.setBackgroundRevalidation(false);
|
|
@@ -8,9 +8,10 @@ export const SHOT_API_PROXY_PREFIX = "/__gloom_cli_api__";
|
|
|
8
8
|
export const SHOT_MARKET_BRIDGE_PATH = "/__gloom_cli_market__";
|
|
9
9
|
export const SHOT_HTTP_BRIDGE_PATH = "/__gloom_cli_http__";
|
|
10
10
|
/**
|
|
11
|
-
* The page's Cloud API reads, over one socket: a
|
|
12
|
-
* connections to its origin, so a board's seventy
|
|
13
|
-
* queued behind each other for seconds
|
|
11
|
+
* The page's Cloud API reads and asset-data operations, over one socket: a
|
|
12
|
+
* page's fetches share six connections to its origin, so a board's seventy
|
|
13
|
+
* contract histories and terms queued behind each other for seconds, and the
|
|
14
|
+
* quotes it then asks for one at a time took four connections at once.
|
|
14
15
|
*/
|
|
15
16
|
export const SHOT_API_SOCKET_PATH = "/__gloom_cli_api_socket__";
|
|
16
17
|
|
|
@@ -20,12 +21,20 @@ export function shotRouteUrl(route: string, pageUrl: string): URL {
|
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
/** A read the page sends over the socket: an API path with its query, and the request's headers. */
|
|
23
|
-
export interface
|
|
24
|
+
export interface ShotApiSocketRead {
|
|
24
25
|
id: number;
|
|
25
26
|
path: string;
|
|
26
27
|
headers: Array<[string, string]>;
|
|
27
28
|
}
|
|
28
29
|
|
|
30
|
+
/** An asset-data operation the page sends over the socket, answered as `SHOT_MARKET_BRIDGE_PATH` answers its body. */
|
|
31
|
+
export interface ShotMarketSocketCall {
|
|
32
|
+
id: number;
|
|
33
|
+
market: { operation: string; args: unknown[] };
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export type ShotApiSocketCall = ShotApiSocketRead | ShotMarketSocketCall;
|
|
37
|
+
|
|
29
38
|
/** The server's answer to a call: the response with its body in base64, or why it could not be made. */
|
|
30
39
|
export type ShotApiSocketReply =
|
|
31
40
|
| { id: number; status: number; statusText: string; headers: Array<[string, string]>; body: string }
|
|
@@ -20,6 +20,7 @@ import type { DatedObservation } from "../plugins/builtin/market-valuation/serie
|
|
|
20
20
|
import type { DesktopExternalPluginBundle } from "../renderers/electrobun/shared/protocol";
|
|
21
21
|
import type { HttpProxyRequestEnvelope, HttpProxyResponseEnvelope } from "../utils/http-proxy-response";
|
|
22
22
|
import type { PaneAccessGate } from "./pane-functions/access-gate";
|
|
23
|
+
import { countContentFigures } from "./content-figures";
|
|
23
24
|
import { readVisibleKeyValues } from "./visible-key-values";
|
|
24
25
|
import { scrollTruncationReasons } from "./scroll-truncation";
|
|
25
26
|
import {
|
|
@@ -27,8 +28,9 @@ import {
|
|
|
27
28
|
SHOT_API_SOCKET_PATH,
|
|
28
29
|
SHOT_HTTP_BRIDGE_PATH,
|
|
29
30
|
SHOT_MARKET_BRIDGE_PATH,
|
|
30
|
-
type
|
|
31
|
+
type ShotApiSocketRead,
|
|
31
32
|
type ShotApiSocketReply,
|
|
33
|
+
type ShotMarketSocketCall,
|
|
32
34
|
} from "./desktop-pane-shot-routes";
|
|
33
35
|
import { SHOT_REQUEST_REFUSED } from "../api-client/errors";
|
|
34
36
|
import { SESSION_COOKIE_NAMES } from "../api-client/session-cookie";
|
|
@@ -186,8 +188,22 @@ export interface DesktopPaneShotRenderResult {
|
|
|
186
188
|
errorStateMarkers: string[];
|
|
187
189
|
emptyStateDetected: boolean;
|
|
188
190
|
emptyStateMarkers: string[];
|
|
191
|
+
/**
|
|
192
|
+
* The words of the one empty or failed state a pane body shows with
|
|
193
|
+
* nothing else but its chrome (query bar, tabs, a table's header): its
|
|
194
|
+
* title, message and hint, a line each, without its buttons. Absent when
|
|
195
|
+
* the body shows anything more.
|
|
196
|
+
*/
|
|
197
|
+
emptyStateText?: string[];
|
|
189
198
|
/** A wall that needs an account, or a Pro lock on part of the pane. */
|
|
190
199
|
accessGate?: PaneAccessGate | null;
|
|
200
|
+
/**
|
|
201
|
+
* The blocks of text with a figure in them that the pane's body shows
|
|
202
|
+
* outside its controls, chrome, notices, charts and labels
|
|
203
|
+
* (`countContentFigures`): what a pane that marks no rows (DIAG's prose,
|
|
204
|
+
* CORR's matrix) is read by. Absent in a capture that did not count them.
|
|
205
|
+
*/
|
|
206
|
+
contentFigures?: number;
|
|
191
207
|
semanticUi: RemoteUiNodeSnapshot[];
|
|
192
208
|
/** The status line drawn in the capture's footer, as it fit the width. */
|
|
193
209
|
statusLine?: string | null;
|
|
@@ -374,7 +390,7 @@ export function serveShotPage(
|
|
|
374
390
|
},
|
|
375
391
|
websocket: {
|
|
376
392
|
message(socket, message) {
|
|
377
|
-
void answerShotApiCall(String(message), apiProxy).then((reply) => socket
|
|
393
|
+
void answerShotApiCall(String(message), apiProxy, bridge).then((reply) => replyOverShotSocket(socket, reply));
|
|
378
394
|
},
|
|
379
395
|
},
|
|
380
396
|
});
|
|
@@ -385,19 +401,39 @@ export function serveShotPage(
|
|
|
385
401
|
}
|
|
386
402
|
|
|
387
403
|
/**
|
|
388
|
-
*
|
|
389
|
-
*
|
|
390
|
-
*
|
|
404
|
+
* Sends a call's reply to the page. A socket that drops it (Bun's send gives
|
|
405
|
+
* 0: the socket closed, or its buffer is past the limit) is closed, so the
|
|
406
|
+
* read waiting for it, and every read after it, is made over HTTP instead of
|
|
407
|
+
* holding the capture until it times out.
|
|
408
|
+
*/
|
|
409
|
+
export function replyOverShotSocket(socket: { send(data: string): number; close(): void }, reply: string): void {
|
|
410
|
+
if (socket.send(reply) === 0) socket.close();
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
/**
|
|
414
|
+
* One call the page sent over its API socket (`SHOT_API_SOCKET_PATH`): a read
|
|
415
|
+
* made as the proxy makes it, with the session the page never holds, or an
|
|
416
|
+
* asset-data operation answered as the market bridge answers it. The reply's
|
|
417
|
+
* JSON, its body in base64. A call that is neither answers why.
|
|
391
418
|
*/
|
|
392
|
-
export async function answerShotApiCall(
|
|
419
|
+
export async function answerShotApiCall(
|
|
420
|
+
message: string,
|
|
421
|
+
apiProxy: DesktopPaneShotApiProxy,
|
|
422
|
+
bridge: DesktopPaneShotBridge | null = null,
|
|
423
|
+
): Promise<string> {
|
|
393
424
|
let id = 0;
|
|
394
425
|
try {
|
|
395
|
-
const call = JSON.parse(message) as Partial<
|
|
426
|
+
const call = JSON.parse(message) as Partial<ShotApiSocketRead & ShotMarketSocketCall>;
|
|
396
427
|
id = typeof call.id === "number" ? call.id : 0;
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
428
|
+
let response: Response;
|
|
429
|
+
if (call.market && typeof call.market === "object") {
|
|
430
|
+
response = await answerShotMarketCall(call.market, bridge);
|
|
431
|
+
} else {
|
|
432
|
+
if (typeof call.path !== "string" || !call.path.startsWith("/") || call.path.startsWith("//")) throw new Error("Not an API path.");
|
|
433
|
+
const url = new URL(`${SHOT_API_PROXY_PREFIX}${call.path}`, "http://127.0.0.1");
|
|
434
|
+
const sent = new Headers(Array.isArray(call.headers) ? call.headers : []);
|
|
435
|
+
response = await proxyShotApiRequest(new Request(url, { headers: sent }), url, apiProxy);
|
|
436
|
+
}
|
|
401
437
|
const body = Buffer.from(await response.arrayBuffer()).toString("base64");
|
|
402
438
|
const headers: Array<[string, string]> = [];
|
|
403
439
|
response.headers.forEach((value, name) => headers.push([name, value]));
|
|
@@ -412,10 +448,24 @@ export async function answerShotApiCall(message: string, apiProxy: DesktopPaneSh
|
|
|
412
448
|
async function runShotMarketBridge(
|
|
413
449
|
request: Request,
|
|
414
450
|
bridge: DesktopPaneShotBridge | null,
|
|
451
|
+
): Promise<Response> {
|
|
452
|
+
if (!bridge) return Response.json({ ok: false, error: "No market bridge" }, { status: 404 });
|
|
453
|
+
let payload: { operation?: unknown; args?: unknown };
|
|
454
|
+
try {
|
|
455
|
+
payload = await request.json() as typeof payload;
|
|
456
|
+
} catch (error) {
|
|
457
|
+
return Response.json({ ok: false, error: errorMessage(error) });
|
|
458
|
+
}
|
|
459
|
+
return answerShotMarketCall(payload, bridge);
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
/** One asset-data operation run through the bridge, posted (`SHOT_MARKET_BRIDGE_PATH`) or sent over the socket. */
|
|
463
|
+
async function answerShotMarketCall(
|
|
464
|
+
payload: { operation?: unknown; args?: unknown },
|
|
465
|
+
bridge: DesktopPaneShotBridge | null,
|
|
415
466
|
): Promise<Response> {
|
|
416
467
|
if (!bridge) return Response.json({ ok: false, error: "No market bridge" }, { status: 404 });
|
|
417
468
|
try {
|
|
418
|
-
const payload = await request.json() as { operation?: unknown; args?: unknown };
|
|
419
469
|
const operation = typeof payload.operation === "string" ? payload.operation : "";
|
|
420
470
|
const args = Array.isArray(payload.args) ? payload.args : [];
|
|
421
471
|
const data = await bridge.marketData(operation, args);
|
|
@@ -911,6 +961,25 @@ async function readRenderedPaneState(session: CdpPage): Promise<DesktopPaneShotR
|
|
|
911
961
|
// An empty sub-section off screen, such as a ticker's news list below
|
|
912
962
|
// the fold, does not make the captured view empty.
|
|
913
963
|
emptyStateDetected: [...root.querySelectorAll('[data-gloom-status="empty"]')].some(isVisible),
|
|
964
|
+
// A body that shows one empty or failed state and only its chrome
|
|
965
|
+
// beside it reads as the state's words, not as its filters' labels.
|
|
966
|
+
emptyStateText: (() => {
|
|
967
|
+
const body = root.querySelector('[data-gloom-role="pane-body"]') || root;
|
|
968
|
+
const states = [...body.querySelectorAll('[data-gloom-ui="empty-state"]')].filter(isVisible);
|
|
969
|
+
if (states.length !== 1) return [];
|
|
970
|
+
const chrome = '[data-gloom-role="query-bar"], [data-gloom-role="data-table-header-row"], [data-gloom-role="tab-list"], [data-gloom-role="page-stack-header"], [data-gloom-role="pane-footer"], [data-gloom-ui="empty-state"]';
|
|
971
|
+
const walker = document.createTreeWalker(body, NodeFilter.SHOW_TEXT);
|
|
972
|
+
for (let node = walker.nextNode(); node; node = walker.nextNode()) {
|
|
973
|
+
const parent = node.parentElement;
|
|
974
|
+
if (!normalize(node.textContent) || !parent || parent.closest(chrome) || !isVisible(parent)) continue;
|
|
975
|
+
return [];
|
|
976
|
+
}
|
|
977
|
+
return [...states[0].children]
|
|
978
|
+
.filter((child) => isVisible(child) && !child.querySelector('button, [role="button"]'))
|
|
979
|
+
.map((child) => normalize(child.innerText || child.textContent))
|
|
980
|
+
.filter(Boolean);
|
|
981
|
+
})(),
|
|
982
|
+
contentFigures: (${countContentFigures.toString()})(root, isVisible),
|
|
914
983
|
// The shared sign-in wall and the Pro lock prompt every gated pane draws.
|
|
915
984
|
accessGate: [...root.querySelectorAll('[data-gloom-ui="sign-in-wall"]')].some(isVisible) ? "sign-in"
|
|
916
985
|
: [...root.querySelectorAll('[data-gloom-ui="pro-lock"]')].some(isVisible) ? "pro" : "",
|
|
@@ -937,6 +1006,8 @@ async function readRenderedPaneState(session: CdpPage): Promise<DesktopPaneShotR
|
|
|
937
1006
|
loadingStateDetected?: boolean;
|
|
938
1007
|
errorStateDetected?: boolean;
|
|
939
1008
|
emptyStateDetected?: boolean;
|
|
1009
|
+
emptyStateText?: string[];
|
|
1010
|
+
contentFigures?: number;
|
|
940
1011
|
accessGate?: string;
|
|
941
1012
|
rows?: DesktopPaneShotRenderedRow[];
|
|
942
1013
|
truncated?: boolean;
|
|
@@ -988,7 +1059,10 @@ async function readRenderedPaneState(session: CdpPage): Promise<DesktopPaneShotR
|
|
|
988
1059
|
errorStateMarkers,
|
|
989
1060
|
emptyStateDetected: value?.emptyStateDetected === true || emptyStateMarkers.length > 0,
|
|
990
1061
|
emptyStateMarkers,
|
|
1062
|
+
...(Array.isArray(value?.emptyStateText) && value.emptyStateText.length > 0
|
|
1063
|
+
? { emptyStateText: value.emptyStateText.filter((line): line is string => typeof line === "string" && line.length > 0) } : {}),
|
|
991
1064
|
accessGate,
|
|
1065
|
+
...(typeof value?.contentFigures === "number" ? { contentFigures: value.contentFigures } : {}),
|
|
992
1066
|
semanticUi: Array.isArray(value?.semanticUi) ? value.semanticUi : [],
|
|
993
1067
|
};
|
|
994
1068
|
}
|