gloomberb 0.19.4 → 0.19.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -1
- package/patches/@opentui%2Fcore@0.3.2.patch +86 -25
- package/src/api-client/equity-screener.ts +23 -0
- package/src/app/pane-runtime/index.tsx +2 -0
- package/src/app/pane-runtime/plugin-bindings.ts +10 -1
- package/src/app.tsx +63 -16
- package/src/cli/commands/command-utils.ts +4 -0
- package/src/cli/commands/market.ts +264 -33
- package/src/cli/commands/search.ts +22 -4
- package/src/cli/commands/ticker.ts +84 -39
- package/src/cli/currency-name-hint.ts +60 -0
- package/src/cli/glossary.ts +3 -3
- package/src/cli/history-rows.ts +18 -1
- package/src/cli/known-gaps.ts +25 -2
- package/src/cli/listing-arg.ts +12 -0
- package/src/cli/not-a-ticker.ts +5 -3
- package/src/cli/pane-functions/capabilities.ts +2 -0
- package/src/cli/pane-functions/catalog.ts +31 -5
- package/src/cli/pane-functions/function-help.ts +8 -5
- package/src/cli/pane-functions/headless.ts +11 -6
- package/src/cli/pane-functions/market-session.ts +6 -7
- package/src/cli/pane-functions/resolver.ts +75 -2
- package/src/cli/quote-answer.ts +9 -0
- package/src/cli/series-search.ts +4 -5
- package/src/cli/symbol-list.ts +54 -2
- package/src/cli/symbol-rows.ts +14 -2
- package/src/cli/ticker-resolution.ts +89 -20
- package/src/components/chart/composite/axis-overlays.tsx +60 -27
- package/src/components/chart/composite/composite-chart.tsx +118 -63
- package/src/components/chart/composite/cursor-source.ts +111 -0
- package/src/components/chart/composite/format.ts +168 -6
- package/src/components/chart/composite/legend.tsx +8 -4
- package/src/components/chart/composite/panel-bitmap.ts +28 -2
- package/src/components/chart/composite/panel-labels.ts +20 -1
- package/src/components/chart/composite/panel-surface.tsx +201 -92
- package/src/components/chart/composite/price-axis-labels.tsx +92 -46
- package/src/components/chart/composite/price-series.ts +31 -8
- package/src/components/chart/composite/scene.ts +154 -59
- package/src/components/chart/composite/series-axis-tags.tsx +4 -2
- package/src/components/chart/composite/time-axis.ts +30 -7
- package/src/components/chart/composite/time-scale.ts +211 -56
- package/src/components/chart/composite/types.ts +11 -1
- package/src/components/chart/composite/use-composite-chart-keyboard.ts +32 -12
- package/src/components/chart/curve/curve-surface.tsx +5 -2
- package/src/components/chart/curve/model.ts +4 -1
- package/src/components/chart/native/use-bitmap-metrics.ts +81 -0
- package/src/components/chart/static/series.ts +3 -0
- package/src/components/command-bar/commands/collection-list.ts +81 -0
- package/src/components/command-bar/commands/direct/index.ts +6 -0
- package/src/components/command-bar/commands/registry.ts +8 -0
- package/src/components/command-bar/layout-items/current-layout.ts +22 -1
- package/src/components/command-bar/layout-items/focused-pane.ts +22 -1
- package/src/components/command-bar/pane-templates/items.ts +19 -3
- package/src/components/command-bar/pane-templates/workflow.ts +5 -0
- package/src/components/command-bar/routes/root/results.ts +23 -3
- package/src/components/command-bar/routes/root/selection.ts +4 -2
- package/src/components/command-bar/routes/root/shortcut-feedback.ts +1 -1
- package/src/components/command-bar/routes/root/shortcut-items.ts +3 -4
- package/src/components/command-bar/routes/root/shortcuts.ts +58 -14
- package/src/components/command-bar/routes/root/ticker-first.ts +32 -0
- package/src/components/command-bar/surface/environment.ts +2 -0
- package/src/components/command-bar/view-model.ts +7 -0
- package/src/components/command-bar/workflow/ops.ts +2 -1
- package/src/components/command-bar/workflow/tickers.ts +20 -0
- package/src/components/layout/shell/active-drag.ts +38 -7
- package/src/components/layout/shell/drag/magnets.ts +106 -0
- package/src/components/layout/shell/menu.ts +15 -1
- package/src/components/layout/shell/pane/actions.ts +4 -0
- package/src/components/layout/shell/ticker-link-menu.ts +12 -3
- package/src/components/layout/status-bar.tsx +20 -0
- package/src/components/layout/window-controls.tsx +96 -35
- package/src/components/layout/window-fullscreen.ts +20 -0
- package/src/components/onboarding/onboarding-keyboard.ts +5 -1
- package/src/components/onboarding/onboarding-wizard.tsx +15 -4
- package/src/components/onboarding/portfolio-step/positions-panel.tsx +8 -5
- package/src/components/onboarding/use-onboarding-progress.ts +20 -1
- package/src/components/price-sparkline/view.tsx +14 -6
- package/src/components/quote-flash.ts +36 -32
- package/src/components/ticker/badge/index.tsx +8 -4
- package/src/components/ticker/badge/list.tsx +23 -7
- package/src/components/ui/column-grid.tsx +8 -2
- package/src/components/ui/data-table/opentui/model.ts +4 -1
- package/src/components/ui/tabs.tsx +5 -2
- package/src/core/state/app/layout.ts +18 -3
- package/src/core/state/app/state.ts +2 -0
- package/src/core/state/app/types.ts +5 -0
- package/src/data/config/layout.ts +3 -0
- package/src/data/config/store/normalize.ts +39 -4
- package/src/i18n/es.ts +10 -0
- package/src/i18n/ja.ts +10 -0
- package/src/i18n/ko.ts +10 -0
- package/src/i18n/zh-cn.ts +10 -0
- package/src/i18n/zh-tw.ts +10 -0
- package/src/layout/pane-manager/floating-placement.ts +7 -4
- package/src/layout/pane-manager/floating.ts +5 -2
- package/src/market-data/bond-funds.ts +19 -0
- package/src/market-data/coordinator/events.ts +17 -1
- package/src/market-data/frame-scheduler.ts +47 -10
- package/src/market-data/frame-wake.ts +74 -0
- package/src/market-data/futures-board.ts +7 -6
- package/src/market-data/futures-contract.ts +14 -3
- package/src/market-data/hooks.tsx +12 -3
- package/src/market-data/market/freshness.ts +18 -0
- package/src/market-data/market/status.ts +15 -2
- package/src/market-data/performance.ts +78 -9
- package/src/market-data/request-types.ts +6 -3
- package/src/plugins/builtin/alerts/cli.ts +2 -1
- package/src/plugins/builtin/analytics/risk-evidence.ts +1 -0
- package/src/plugins/builtin/attention/evidence.ts +1 -1
- package/src/plugins/builtin/awards/client.ts +1 -1
- package/src/plugins/builtin/awards/evidence.ts +1 -1
- package/src/plugins/builtin/awards/pane.tsx +2 -1
- package/src/plugins/builtin/bond-calculator/headless.ts +2 -1
- package/src/plugins/builtin/bond-calculator/index.tsx +1 -1
- package/src/plugins/builtin/bond-calculator/math.ts +1 -1
- package/src/plugins/builtin/bond-calculator/model.ts +14 -5
- package/src/plugins/builtin/bond-calculator/pane.tsx +1 -1
- package/src/plugins/builtin/broker-manager/footer.ts +3 -2
- package/src/plugins/builtin/broker-manager/index.tsx +2 -1
- package/src/plugins/builtin/broker-manager/keyboard.ts +2 -1
- package/src/plugins/builtin/buildout/cells.tsx +25 -45
- package/src/plugins/builtin/buildout/detail/company.tsx +3 -3
- package/src/plugins/builtin/buildout/detail/index.tsx +1 -1
- package/src/plugins/builtin/buildout/detail/intel.tsx +4 -7
- package/src/plugins/builtin/buildout/detail/site.tsx +4 -4
- package/src/plugins/builtin/buildout/detail/ui.tsx +39 -38
- package/src/plugins/builtin/buildout/format.ts +23 -1
- package/src/plugins/builtin/buildout/model/types.ts +1 -0
- package/src/plugins/builtin/buildout/pane/index.tsx +2 -8
- package/src/plugins/builtin/buildout/table-model.ts +12 -4
- package/src/plugins/builtin/catalysts/evidence.ts +1 -1
- package/src/plugins/builtin/catalysts/pane.tsx +2 -1
- package/src/plugins/builtin/cds/headless.ts +1 -0
- package/src/plugins/builtin/cds/index.tsx +1 -1
- package/src/plugins/builtin/chart-composer/headless.ts +40 -1
- package/src/plugins/builtin/cloud/plugin.tsx +2 -0
- package/src/plugins/builtin/cloud/upgrade-status-widget.tsx +28 -3
- package/src/plugins/builtin/cloud-tweets/table.tsx +3 -2
- package/src/plugins/builtin/comment-letters/client.ts +2 -1
- package/src/plugins/builtin/company-kpis/client.ts +1 -1
- package/src/plugins/builtin/company-kpis/pane.tsx +2 -1
- package/src/plugins/builtin/company-kpis/screenshot-evidence.ts +3 -2
- package/src/plugins/builtin/correlation/headless.ts +3 -2
- package/src/plugins/builtin/cot/headless.ts +9 -3
- package/src/plugins/builtin/cot/model.ts +44 -3
- package/src/plugins/builtin/credit-documents/client.ts +1 -1
- package/src/plugins/builtin/credit-documents/evidence.ts +1 -1
- package/src/plugins/builtin/credit-documents/pane.tsx +2 -1
- package/src/plugins/builtin/crypto-board/pane.tsx +5 -4
- package/src/plugins/builtin/debt-maturities/headless.ts +11 -2
- package/src/plugins/builtin/debt-maturities/model.ts +66 -0
- package/src/plugins/builtin/debt-maturities/pane.tsx +23 -4
- package/src/plugins/builtin/earnings-calls/pane.tsx +1 -1
- package/src/plugins/builtin/earnings-ripple/index.tsx +6 -1
- package/src/plugins/builtin/earnings-ripple/pane.tsx +1 -1
- package/src/plugins/builtin/econ/calendar-model.ts +30 -6
- package/src/plugins/builtin/econ/fred-catalog.ts +5 -5
- package/src/plugins/builtin/econ/print-watch.ts +3 -1
- package/src/plugins/builtin/equity-screener/client.ts +1 -1
- package/src/plugins/builtin/equity-screener/criterion-editor.tsx +4 -16
- package/src/plugins/builtin/equity-screener/headless.ts +4 -2
- package/src/plugins/builtin/equity-screener/ideas.ts +67 -3
- package/src/plugins/builtin/equity-screener/model.ts +180 -12
- package/src/plugins/builtin/equity-screener/pane.tsx +52 -12
- package/src/plugins/builtin/equity-screener/screen-check.ts +7 -4
- package/src/plugins/builtin/equity-screener/watchlist.ts +33 -0
- package/src/plugins/builtin/futures/series.ts +16 -1
- package/src/plugins/builtin/futures-curve/client.ts +19 -0
- package/src/plugins/builtin/futures-curve/headless.ts +52 -13
- package/src/plugins/builtin/futures-curve/index.tsx +1 -1
- package/src/plugins/builtin/futures-curve/model.ts +77 -6
- package/src/plugins/builtin/futures-curve/pane.tsx +19 -3
- package/src/plugins/builtin/fx-matrix/headless.ts +4 -2
- package/src/plugins/builtin/fx-matrix/index.tsx +37 -3
- package/src/plugins/builtin/fx-matrix/pairs.ts +15 -0
- package/src/plugins/builtin/gpu/headless.ts +2 -1
- package/src/plugins/builtin/help/function-card.tsx +2 -1
- package/src/plugins/builtin/help/index.tsx +2 -1
- package/src/plugins/builtin/insider/display.ts +45 -6
- package/src/plugins/builtin/ipo-calendar/model.ts +2 -0
- package/src/plugins/builtin/iv-history/client.ts +2 -1
- package/src/plugins/builtin/iv-history/headless.ts +2 -1
- package/src/plugins/builtin/jobs/pages.ts +4 -4
- package/src/plugins/builtin/kelly-sizer/headless.ts +2 -1
- package/src/plugins/builtin/macro-day/client.ts +41 -0
- package/src/plugins/builtin/macro-day/headless.ts +19 -9
- package/src/plugins/builtin/macro-day/model.ts +3 -1
- package/src/plugins/builtin/market-heatmap/index.tsx +2 -1
- package/src/plugins/builtin/market-movers/index.tsx +4 -3
- package/src/plugins/builtin/members/client.ts +1 -1
- package/src/plugins/builtin/mna/distress/client.ts +1 -0
- package/src/plugins/builtin/mna/distress/headless.ts +1 -0
- package/src/plugins/builtin/mna/pane.tsx +4 -1
- package/src/plugins/builtin/options/market-reference.ts +1 -1
- package/src/plugins/builtin/options/open-interest-as-of.ts +3 -1
- package/src/plugins/builtin/options/view.tsx +2 -1
- package/src/plugins/builtin/options-calculator/evidence.ts +1 -1
- package/src/plugins/builtin/options-scenario/csp-screen-pane.tsx +1 -1
- package/src/plugins/builtin/options-scenario/csp-screen.ts +8 -4
- package/src/plugins/builtin/options-scenario/csp.ts +28 -9
- package/src/plugins/builtin/options-scenario/evidence.ts +5 -4
- package/src/plugins/builtin/options-scenario/pane.tsx +2 -1
- package/src/plugins/builtin/perps/client.ts +1 -1
- package/src/plugins/builtin/perps/pane.tsx +3 -1
- package/src/plugins/builtin/portfolio-list/cli/bulk-symbols.ts +17 -0
- package/src/plugins/builtin/portfolio-list/cli/portfolio-command.ts +2 -1
- package/src/plugins/builtin/portfolio-list/cli/watchlist-command.ts +4 -2
- package/src/plugins/builtin/portfolio-list/pane/index.tsx +7 -3
- package/src/plugins/builtin/portfolio-list/use-throttled-memo.ts +10 -19
- package/src/plugins/builtin/rate-path/headless.ts +24 -10
- package/src/plugins/builtin/research/analyst-model.ts +1 -0
- package/src/plugins/builtin/research/equity-diagnostic-pane.tsx +2 -1
- package/src/plugins/builtin/research/event-model.ts +10 -3
- package/src/plugins/builtin/research/events-headless.ts +20 -2
- package/src/plugins/builtin/research/index.tsx +1 -0
- package/src/plugins/builtin/research/relative-valuation-currency.ts +1 -1
- package/src/plugins/builtin/research/relative-valuation-peers.ts +2 -1
- package/src/plugins/builtin/research-search/command-bar-search.ts +3 -1
- package/src/plugins/builtin/research-search/snippet.ts +1 -0
- package/src/plugins/builtin/revenue-breakdown/client.ts +3 -2
- package/src/plugins/builtin/seasonality/headless.ts +2 -1
- package/src/plugins/builtin/sec/command-bar-search.ts +3 -2
- package/src/plugins/builtin/sec/fund-facts.ts +17 -1
- package/src/plugins/builtin/sec/index.tsx +8 -5
- package/src/plugins/builtin/sec/row-summaries.ts +28 -12
- package/src/plugins/builtin/shared/members-menu.tsx +103 -38
- package/src/plugins/builtin/short-interest/publications-model.ts +22 -1
- package/src/plugins/builtin/short-interest/publications-pane.tsx +13 -4
- package/src/plugins/builtin/short-interest/watch-client.ts +2 -1
- package/src/plugins/builtin/short-interest/watch-model.ts +1 -1
- package/src/plugins/builtin/social-mentions/client.ts +2 -1
- package/src/plugins/builtin/supply-chain/client.ts +1 -1
- package/src/plugins/builtin/supply-chain/evidence.ts +1 -1
- package/src/plugins/builtin/supply-chain/graph-pane.tsx +2 -1
- package/src/plugins/builtin/supply-chain/pane.tsx +2 -1
- package/src/plugins/builtin/ticker-detail/adr-pair/headless.ts +1 -1
- package/src/plugins/builtin/ticker-detail/adr-pair/model.ts +24 -4
- package/src/plugins/builtin/ticker-detail/adr-pair/tab.tsx +1 -1
- package/src/plugins/builtin/time-sales/client.ts +1 -0
- package/src/plugins/builtin/time-sales/pane.tsx +3 -2
- package/src/plugins/builtin/trace-bonds/client.ts +7 -4
- package/src/plugins/builtin/trace-bonds/index.tsx +1 -1
- package/src/plugins/builtin/vol-surface/client.ts +2 -1
- package/src/plugins/builtin/volatility/client.ts +6 -1
- package/src/plugins/builtin/volatility/headless.ts +0 -1
- package/src/plugins/builtin/yield-curve/curves.ts +15 -0
- package/src/plugins/builtin/yield-curve/headless.ts +9 -2
- package/src/plugins/builtin/yield-curve/index.tsx +5 -8
- package/src/plugins/host-modules.ts +22 -3
- package/src/plugins/host-smoke.ts +6 -3
- package/src/portfolio/collection-name.ts +19 -0
- package/src/portfolio/column-values.ts +76 -10
- package/src/renderers/browser/http-proxy-transport.ts +78 -8
- package/src/renderers/cloudflare/http-proxy.ts +13 -2
- package/src/renderers/cloudflare/proxy-session.ts +47 -24
- package/src/renderers/cloudflare/worker.ts +15 -2
- package/src/renderers/desktop/geometry.ts +279 -0
- package/src/renderers/desktop/screen-setup.ts +246 -0
- package/src/renderers/desktop/sequential-window-host.ts +179 -0
- package/src/renderers/desktop/test-utils.ts +71 -0
- package/src/renderers/desktop/window-controller.ts +433 -0
- package/src/renderers/desktop/window-host.ts +70 -0
- package/src/renderers/desktop/window-layouts.ts +630 -0
- package/src/renderers/dom/data-frames.ts +15 -4
- package/src/renderers/dom/host/box.tsx +204 -176
- package/src/renderers/dom/host/style.ts +49 -20
- package/src/renderers/dom/host/text.tsx +3 -2
- package/src/renderers/electrobun/bun/application-menu/click.ts +1 -0
- package/src/renderers/electrobun/bun/application-menu/index.ts +4 -1
- package/src/renderers/electrobun/bun/desktop/backend-requests.ts +19 -8
- package/src/renderers/electrobun/bun/desktop/backend.ts +322 -19
- package/src/renderers/electrobun/bun/desktop/detached-windows.ts +83 -61
- package/src/renderers/electrobun/bun/desktop/host-requests.ts +29 -15
- package/src/renderers/electrobun/bun/desktop/initialization.ts +30 -11
- package/src/renderers/electrobun/bun/desktop/relaunch.ts +9 -1
- package/src/renderers/electrobun/bun/desktop/screen-setup-file.ts +55 -0
- package/src/renderers/electrobun/bun/desktop/state-broadcaster.ts +44 -8
- package/src/renderers/electrobun/bun/desktop/windows-script.ts +9 -6
- package/src/renderers/electrobun/bun/desktop/workspace/index.ts +298 -97
- package/src/renderers/electrobun/bun/desktop/workspace/requests.ts +44 -6
- package/src/renderers/electrobun/bun/index.ts +4 -97
- package/src/renderers/electrobun/bun/window/electrobun-window-host.ts +306 -0
- package/src/renderers/electrobun/bun/window/focus.ts +0 -25
- package/src/renderers/electrobun/bun/window/remembered-frame.ts +4 -82
- package/src/renderers/electrobun/bun/window/windows-native.ts +26 -1
- package/src/renderers/electrobun/shared/protocol.ts +50 -2
- package/src/renderers/electrobun/view/backend-rpc.ts +15 -0
- package/src/renderers/electrobun/view/desktop/window/bridge.ts +63 -3
- package/src/renderers/electrobun/view/main.tsx +13 -7
- package/src/renderers/electrobun/view/ui-host.tsx +7 -0
- package/src/renderers/electrobun/view/window-fullscreen.ts +10 -3
- package/src/series/fred-argument.ts +17 -0
- package/src/sources/provider-router/financial-routes.ts +7 -1
- package/src/sources/provider-router/index.ts +7 -1
- package/src/state/app/context/index.tsx +16 -2
- package/src/state/desktop-windows.ts +63 -0
- package/src/sync/other-window-tabs.ts +62 -0
- package/src/tickers/company-name-listing.ts +23 -3
- package/src/tickers/listing-fate.ts +147 -1
- package/src/tickers/terminal-codes.ts +5 -0
- package/src/time-series/price-units.ts +11 -0
- package/src/time-series/types.ts +6 -0
- package/src/types/config.ts +10 -1
- package/src/types/desktop-window.ts +71 -2
- package/src/types/financials.ts +4 -0
- package/src/types/headless.ts +19 -0
- package/src/types/plugin.ts +6 -0
- package/src/ui/host.tsx +2 -0
- package/src/ui/index.tsx +14 -13
- package/src/ui/same-props.ts +58 -0
- package/src/utils/cli-output.ts +33 -4
- package/src/utils/currency-names.ts +20 -0
- package/src/utils/currency-pair.ts +6 -0
- package/src/utils/exchange-rate-snapshot.ts +20 -2
- package/src/utils/format.ts +7 -2
- package/src/utils/futures-generic.ts +12 -0
- package/src/utils/fx-market-hours.ts +43 -0
- package/src/utils/http-proxy-upstream.ts +6 -2
- package/src/utils/plugin-proxy-hosts.json +0 -4
- package/src/utils/plugin-proxy-hosts.ts +22 -0
- package/src/utils/sec-filings.ts +7 -1
|
@@ -25,6 +25,7 @@ import {
|
|
|
25
25
|
renderSection,
|
|
26
26
|
renderStats,
|
|
27
27
|
wrapText,
|
|
28
|
+
wrapToTerminal,
|
|
28
29
|
type CliStatEntry,
|
|
29
30
|
} from "../../utils/cli-output";
|
|
30
31
|
import {
|
|
@@ -73,7 +74,7 @@ import {
|
|
|
73
74
|
} from "../helpers";
|
|
74
75
|
import { NotesFiles } from "../../plugins/builtin/notes/files";
|
|
75
76
|
import { getFormDescription } from "../../plugins/builtin/sec/model";
|
|
76
|
-
import { rowSummary, rowSummaryTarget } from "../../plugins/builtin/sec/row-summaries";
|
|
77
|
+
import { ownerNames, rowSummary, rowSummaryTarget } from "../../plugins/builtin/sec/row-summaries";
|
|
77
78
|
import { isKnownNonUsListing, secFilingItemCodes, US_FUND_FACTS_ONLY } from "../../utils/sec";
|
|
78
79
|
import { currentReportItemsLabel, hiddenFilingsNote, loadLatestFilings, type HiddenFilings } from "../../utils/sec-filings";
|
|
79
80
|
import { canonicalExchange, exchangeLabel, isKnownExchangeCode, isUsListingExchange } from "../../utils/exchanges";
|
|
@@ -81,8 +82,8 @@ import {
|
|
|
81
82
|
coinListingNotes, failIfNotTraded, failMovedSymbol, ListingArgError, listingChoiceNotes, listingFateLoader, listingIdentity, loadBareVenues,
|
|
82
83
|
resolveCliListing, type CliListing, type ListingDataRequest,
|
|
83
84
|
} from "../listing-arg";
|
|
84
|
-
import { movedAwayChange } from "../../tickers/ticker-changes";
|
|
85
|
-
import { listingChangeLine } from "../../tickers/listing-fate";
|
|
85
|
+
import { isUsSymbolVenue, movedAwayChange } from "../../tickers/ticker-changes";
|
|
86
|
+
import { listingChangeLine, loadNoQuoteLastTraded, noQuoteLastTradeNote, otherListingProfile, otherListingProfileNote } from "../../tickers/listing-fate";
|
|
86
87
|
import { companyMemberships, loadCompanyMemberships, type CompanyMemberships, type ListMembership } from "../issuer-membership";
|
|
87
88
|
import { isNotATickerMessage } from "../not-a-ticker";
|
|
88
89
|
import { sharesOutstandingInReceipts } from "../../utils/depositary-receipt";
|
|
@@ -99,7 +100,7 @@ import { loadOfferingFilings, loadStatementFilings, resultsReleaseText, statemen
|
|
|
99
100
|
import type { BankFiguresPayload } from "../../api-client/bank-figures";
|
|
100
101
|
import { bankSection } from "../bank-section";
|
|
101
102
|
import type { FundBondFacts, FundFactsPayload } from "../../api-client/fund-facts";
|
|
102
|
-
import { bondFigures, NOT_SEC_YIELD } from "../../market-data/bond-funds";
|
|
103
|
+
import { bondFigures, durationDv01PerShare, formatDv01PerShare, NOT_SEC_YIELD } from "../../market-data/bond-funds";
|
|
103
104
|
import { readFundFacts } from "../../market-data/fund-facts";
|
|
104
105
|
import { taxEquivalentLines, type TaxEquivalentAnalysis } from "../../market-data/tax-equivalent";
|
|
105
106
|
import { isRoundTheClockCoin } from "../../utils/crypto-pair";
|
|
@@ -321,14 +322,18 @@ async function withFilingSummaries(
|
|
|
321
322
|
dataProvider: { getSecFilingContent?(filing: SecFilingItem): Promise<string | null> },
|
|
322
323
|
): Promise<RecentFiling[]> {
|
|
323
324
|
if (!dataProvider.getSecFilingContent) return [...filings];
|
|
324
|
-
|
|
325
|
+
const contents = await Promise.all(filings.map(async (filing) => {
|
|
325
326
|
const target = rowSummaryTarget(filing);
|
|
326
|
-
if (!target) return
|
|
327
|
-
|
|
327
|
+
if (!target) return null;
|
|
328
|
+
return Promise.resolve().then(() => dataProvider.getSecFilingContent!(target))
|
|
328
329
|
.catch(logFailure("cli.commands-ticker", "Read an insider filing failed", null));
|
|
329
|
-
const summary = rowSummary(filing.form, content)?.title;
|
|
330
|
-
return summary ? { ...filing, summary } : filing;
|
|
331
330
|
}));
|
|
331
|
+
// A Form 144 names its seller freely; the insider forms read beside it say which way round.
|
|
332
|
+
const knownOwners = filings.flatMap((filing, index) => ownerNames(filing.form, contents[index]));
|
|
333
|
+
return filings.map((filing, index) => {
|
|
334
|
+
const summary = rowSummary(filing.form, contents[index], knownOwners)?.title;
|
|
335
|
+
return summary ? { ...filing, summary } : filing;
|
|
336
|
+
});
|
|
332
337
|
}
|
|
333
338
|
|
|
334
339
|
/** What the form is: the filing's own description, else the form's meaning ("Insider Transaction"); none beside an 8-K's items. */
|
|
@@ -642,7 +647,11 @@ function reportedDividendYield(
|
|
|
642
647
|
* was last paid; a trailing one the twelve months it covers. A yield of no
|
|
643
648
|
* stated basis is the figure alone.
|
|
644
649
|
*/
|
|
645
|
-
function forwardYieldFigure(
|
|
650
|
+
function forwardYieldFigure(
|
|
651
|
+
fundamentals: TickerFinancials["fundamentals"],
|
|
652
|
+
distributions: DividendDistributions | null,
|
|
653
|
+
bond: FundBondFacts | null = null,
|
|
654
|
+
): MetricFigure {
|
|
646
655
|
const lapse = forwardYieldLapse(fundamentals, distributions);
|
|
647
656
|
if (lapse) return { text: noCurrentDividend(lapse), value: null };
|
|
648
657
|
const figure = percentFigure(reportedDividendYield(fundamentals, distributions), formatFractionPercentCell);
|
|
@@ -650,7 +659,9 @@ function forwardYieldFigure(fundamentals: TickerFinancials["fundamentals"], dist
|
|
|
650
659
|
const basis = fundamentals.dividendYieldBasis === "forward"
|
|
651
660
|
? forwardDividendBasis(fundamentals.exDividendDate, { declared: distributions?.rows, currency: distributions?.currency })
|
|
652
661
|
: fundamentals.dividendYieldBasis === "trailing" ? TRAILING_DIVIDEND_BASIS : null;
|
|
653
|
-
|
|
662
|
+
// A bond fund's says first that it is not the SEC yield on the next line, which its label keeps short.
|
|
663
|
+
const said = [bond ? NOT_SEC_YIELD : null, basis].filter(Boolean).join("; ");
|
|
664
|
+
return said ? { ...figure, text: `${figure.text} (${said})` } : figure;
|
|
654
665
|
}
|
|
655
666
|
|
|
656
667
|
/**
|
|
@@ -669,13 +680,12 @@ export function exportedDividendFundamentals<T extends object & Pick<NonNullable
|
|
|
669
680
|
}
|
|
670
681
|
|
|
671
682
|
/**
|
|
672
|
-
* `Dividend Yield (forward)`, or for a bond fund `Distribution Yield
|
|
673
|
-
*
|
|
674
|
-
* after it) is not.
|
|
683
|
+
* `Dividend Yield (forward)`, or for a bond fund `Distribution Yield
|
|
684
|
+
* (forward)`: the cash it paid, annualized, which its value says its SEC
|
|
685
|
+
* yield (the line after it) is not.
|
|
675
686
|
*/
|
|
676
687
|
function dividendYieldLabel(basis: string | undefined, bond: FundBondFacts | null): string {
|
|
677
|
-
|
|
678
|
-
return `Dividend Yield${basis ? ` (${basis})` : ""}`;
|
|
688
|
+
return `${bond ? "Distribution" : "Dividend"} Yield${basis ? ` (${basis})` : ""}`;
|
|
679
689
|
}
|
|
680
690
|
|
|
681
691
|
/** The labels a bond fund's sponsor figures print under, after its distribution yield. */
|
|
@@ -683,16 +693,21 @@ const BOND_METRIC_LABELS = { secYield: "30-Day SEC Yield", yieldToWorst: "Yield
|
|
|
683
693
|
|
|
684
694
|
/**
|
|
685
695
|
* A bond fund's 30-day SEC yield, yield to worst and duration as its sponsor
|
|
686
|
-
* publishes them, each dated: `4.04% (as of 2026-10-15)
|
|
696
|
+
* publishes them, each dated: `4.04% (as of 2026-10-15)`, then the DV01 per
|
|
697
|
+
* share its duration gives at the regular session price.
|
|
687
698
|
*/
|
|
688
|
-
function bondFundMetrics(bond: FundBondFacts | null): FundamentalsMetric[] {
|
|
699
|
+
function bondFundMetrics(bond: FundBondFacts | null, price: number | null): FundamentalsMetric[] {
|
|
689
700
|
if (!bond) return [];
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
701
|
+
const dv01 = durationDv01PerShare(price, bond);
|
|
702
|
+
return [
|
|
703
|
+
...bondFigures(bond).map((figure) => ({
|
|
704
|
+
label: figure.key === "duration" ? figure.label : BOND_METRIC_LABELS[figure.key],
|
|
705
|
+
text: `${figure.text}${figure.date ? ` (as of ${figure.date})` : ""}`,
|
|
706
|
+
value: figure.value,
|
|
707
|
+
unit: figure.key === "duration" ? "years" : "%",
|
|
708
|
+
})),
|
|
709
|
+
...dv01 == null ? [] : [{ label: "DV01", text: `${formatDv01PerShare(dv01)} (from duration)`, value: dv01, unit: "USD per bp" }],
|
|
710
|
+
];
|
|
696
711
|
}
|
|
697
712
|
|
|
698
713
|
/** Whether a metric is a yield line, which `valuation` keeps beside the multiples. */
|
|
@@ -753,9 +768,9 @@ function fundamentalsMetrics(
|
|
|
753
768
|
{ label: "EPS (TTM)", ...reportedMoney(fundamentals?.eps, fundamentals?.epsCurrency?.trim() || reportingCurrency, true, codes) },
|
|
754
769
|
{
|
|
755
770
|
label: dividendYieldLabel(fundamentals?.dividendYieldBasis, bond),
|
|
756
|
-
...forwardYieldFigure(fundamentals, distributions),
|
|
771
|
+
...forwardYieldFigure(fundamentals, distributions, bond),
|
|
757
772
|
},
|
|
758
|
-
...bondFundMetrics(bond),
|
|
773
|
+
...bondFundMetrics(bond, regularSessionValuationPrice(quote)),
|
|
759
774
|
{ label: "Revenue (TTM)", ...reportedMoney(fundamentals?.revenue, reportingCurrency) },
|
|
760
775
|
{ label: "Net Income (TTM)", ...reportedMoney(fundamentals?.netIncome, reportingCurrency) },
|
|
761
776
|
{ label: "Operating Cash Flow (TTM)", ...reportedMoney(fundamentals?.operatingCashFlow, reportingCurrency) },
|
|
@@ -809,6 +824,14 @@ function floatAndShortInterestMetrics(
|
|
|
809
824
|
];
|
|
810
825
|
}
|
|
811
826
|
|
|
827
|
+
/** Rows a company's earnings and accounts fill: a fund's report never shows them, whatever a provider sends for it. */
|
|
828
|
+
const STOCK_ONLY_METRICS = new Set(["Enterprise Value", "P/E (TTM)", "Forward P/E", "PEG", "EPS (TTM)", "Revenue (TTM)", "Net Income (TTM)",
|
|
829
|
+
"Operating Cash Flow (TTM)", "Free Cash Flow (TTM)", "Operating Margin", "Profit Margin", "Revenue Growth", "Last Quarter Growth"]);
|
|
830
|
+
|
|
831
|
+
function withoutStockRows<T extends { label: string }>(metrics: T[], fund: boolean): T[] {
|
|
832
|
+
return fund ? metrics.filter((metric) => !STOCK_ONLY_METRICS.has(metric.label)) : metrics;
|
|
833
|
+
}
|
|
834
|
+
|
|
812
835
|
function metricLines(metrics: readonly FundamentalsMetric[]): Array<[string, string]> {
|
|
813
836
|
return metrics.filter((metric) => !metric.exportOnly).map((metric) => [metric.label, metric.text]);
|
|
814
837
|
}
|
|
@@ -959,8 +982,9 @@ function fundamentalsReportMetrics(snapshot: FundamentalsReportData, view: "fund
|
|
|
959
982
|
const marketCap: MetricFigure = capitalization
|
|
960
983
|
? { text: `${formatCompact(capitalization.value)} ${capitalization.currency}`, value: capitalization.value, unit: capitalization.currency }
|
|
961
984
|
: { text: "—" };
|
|
962
|
-
const metrics = fundamentalsMetrics(quote, fundamentals, financials.profile, marketCap, computeTickerPriceReturns(financials),
|
|
963
|
-
undefined, snapshot.distributions ?? null, snapshot.bondFund ?? null, snapshot.currencyCodes === true)
|
|
985
|
+
const metrics = withoutStockRows(fundamentalsMetrics(quote, fundamentals, financials.profile, marketCap, computeTickerPriceReturns(financials),
|
|
986
|
+
fundamentalsCurrency(financials), undefined, snapshot.distributions ?? null, snapshot.bondFund ?? null, snapshot.currencyCodes === true),
|
|
987
|
+
resolveTickerInstrumentKind(null, financials) === "fund");
|
|
964
988
|
if (view === "fundamentals") {
|
|
965
989
|
return [...metrics, ...floatAndShortInterestMetrics(quote, fundamentals, financials.profile)]
|
|
966
990
|
.filter((metric) => metric.text !== "—");
|
|
@@ -984,10 +1008,11 @@ export function renderFundamentalsReport(
|
|
|
984
1008
|
const symbol = quote?.symbol ?? financials.symbol;
|
|
985
1009
|
const name = quote?.name && quote.name !== symbol ? ` ${cliStyles.bold(quote.name)}` : "";
|
|
986
1010
|
const lines = [`${cliStyles.accent(symbol)}${name}`];
|
|
1011
|
+
const isFund = resolveTickerInstrumentKind(null, financials) === "fund";
|
|
987
1012
|
const profileParts = [
|
|
988
1013
|
financials.exchange ? exchangeLabel(financials.exchange) : undefined,
|
|
989
|
-
profile?.sector ? `Sector ${profile.sector}` : undefined,
|
|
990
|
-
profile?.industry ? `Industry ${profile.industry}` : undefined,
|
|
1014
|
+
!isFund && profile?.sector ? `Sector ${profile.sector}` : undefined,
|
|
1015
|
+
!isFund && profile?.industry ? `Industry ${profile.industry}` : undefined,
|
|
991
1016
|
].filter((part): part is string => !!part);
|
|
992
1017
|
if (profileParts.length > 0) lines.push(cliStyles.muted(profileParts.join(METADATA_SEPARATOR)));
|
|
993
1018
|
|
|
@@ -1012,7 +1037,8 @@ export function renderFundamentalsReport(
|
|
|
1012
1037
|
}
|
|
1013
1038
|
appendDescription(lines, profile);
|
|
1014
1039
|
}
|
|
1015
|
-
|
|
1040
|
+
// A line wider than the terminal (a heading's venue and state, a note) wraps at it, as the stat blocks do.
|
|
1041
|
+
return lines.map(wrapToTerminal).join("\n");
|
|
1016
1042
|
}
|
|
1017
1043
|
|
|
1018
1044
|
/** What the Bank section reads from the rest of the report: the newest statement period, and the annual report form. */
|
|
@@ -1189,10 +1215,12 @@ export async function buildTickerReport({
|
|
|
1189
1215
|
const instrumentType = instrumentTypeLabel(quote?.instrumentType?.trim()
|
|
1190
1216
|
|| financials.quoteMetadata?.instrumentType?.trim()
|
|
1191
1217
|
|| tickerFile?.metadata.assetCategory, name, { detail: true });
|
|
1218
|
+
// A fund has no sector or industry of its own, nor the earnings rows below.
|
|
1219
|
+
const isFund = resolveTickerInstrumentKind(tickerFile, financials) === "fund";
|
|
1192
1220
|
const metadataParts = [
|
|
1193
1221
|
instrumentType ? `Type ${instrumentType}` : undefined,
|
|
1194
|
-
(tickerFile?.metadata.sector || profile?.sector) ? `Sector ${tickerFile?.metadata.sector || profile?.sector}` : undefined,
|
|
1195
|
-
(tickerFile?.metadata.industry || profile?.industry) ? `Industry ${tickerFile?.metadata.industry || profile?.industry}` : undefined,
|
|
1222
|
+
!isFund && (tickerFile?.metadata.sector || profile?.sector) ? `Sector ${tickerFile?.metadata.sector || profile?.sector}` : undefined,
|
|
1223
|
+
!isFund && (tickerFile?.metadata.industry || profile?.industry) ? `Industry ${tickerFile?.metadata.industry || profile?.industry}` : undefined,
|
|
1196
1224
|
].filter((part): part is string => !!part);
|
|
1197
1225
|
if (metadataParts.length > 0) {
|
|
1198
1226
|
lines.push(cliStyles.muted(metadataParts.join(METADATA_SEPARATOR)));
|
|
@@ -1300,8 +1328,8 @@ export async function buildTickerReport({
|
|
|
1300
1328
|
|
|
1301
1329
|
// A listing of the last year may have no statements yet: its IPO says how recent it is.
|
|
1302
1330
|
const listing = { listedSince: ipo ? ipo.deal.listingDate ?? ipo.deal.firstDay?.session ?? null : null };
|
|
1303
|
-
const metrics = fundamentalsMetrics(quote, priced.fundamentals, profile, { text: marketCapText }, priceReturns,
|
|
1304
|
-
{ text: enterpriseValueText }, distributions, bondFund, codes);
|
|
1331
|
+
const metrics = withoutStockRows(fundamentalsMetrics(quote, priced.fundamentals, profile, { text: marketCapText }, priceReturns,
|
|
1332
|
+
fundamentalsCurrency(financials, listing), { text: enterpriseValueText }, distributions, bondFund, codes), isFund);
|
|
1305
1333
|
const reportedCurrency = financials.financialCurrency?.trim();
|
|
1306
1334
|
const statements = [...financials.annualStatements, ...financials.quarterlyStatements];
|
|
1307
1335
|
const fallbackCurrency = reportedCurrency && statements.every((row) => !row.currency?.trim() || row.currency.trim() === reportedCurrency)
|
|
@@ -1380,7 +1408,8 @@ export async function buildTickerReport({
|
|
|
1380
1408
|
|
|
1381
1409
|
await appendTickerPositions(lines, tickerFile, quote, config, toBase, rates);
|
|
1382
1410
|
|
|
1383
|
-
|
|
1411
|
+
// A line wider than the terminal (a heading's venue and state, a note) wraps at it, as the stat blocks do.
|
|
1412
|
+
return lines.map(wrapToTerminal).join("\n");
|
|
1384
1413
|
}
|
|
1385
1414
|
|
|
1386
1415
|
function buildTickerStructuredData({
|
|
@@ -1527,6 +1556,11 @@ function depositaryPairJson(financials: TickerFinancials) {
|
|
|
1527
1556
|
return { depositaryPair: { ...pair, side: receipt ? "receipt" : "home", text: depositaryPairText(pair, receipt) } };
|
|
1528
1557
|
}
|
|
1529
1558
|
|
|
1559
|
+
/** The research a stopped listing shows when what came under its symbol is another listing's: its quote data alone. */
|
|
1560
|
+
function withoutResearch(financials: TickerFinancials): TickerFinancials {
|
|
1561
|
+
return { ...financials, profile: undefined, fundamentals: undefined, annualStatements: [], quarterlyStatements: [] };
|
|
1562
|
+
}
|
|
1563
|
+
|
|
1530
1564
|
const QUOTE_UNAVAILABLE = "Quote unavailable.";
|
|
1531
1565
|
|
|
1532
1566
|
/** Asks for the quote the report lacks once more, for the reason the data service gave when it had none. */
|
|
@@ -1672,7 +1706,17 @@ export async function ticker(symbol: string, dependencies: TickerCommandDependen
|
|
|
1672
1706
|
|
|
1673
1707
|
// The quote is the feed in this report; without one, the fundamentals date it.
|
|
1674
1708
|
const freshness = quote ? quotesFreshness([quote]) : fundamentalsFreshness(resolvedFinancials);
|
|
1675
|
-
|
|
1709
|
+
// A listing with no quote and no bar in over a month stopped trading: the line under its name says when.
|
|
1710
|
+
const lastTraded = quote ? null : await loadNoQuoteLastTraded({ symbol: requestSymbol, exchange }, dataProvider);
|
|
1711
|
+
// The profile under its symbol is another listing's only on evidence: another issuer's name, or one abroad.
|
|
1712
|
+
const otherProfile = lastTraded ? otherListingProfile(resolvedFinancials.profile, {
|
|
1713
|
+
usLine: isUsSymbolVenue(exchange),
|
|
1714
|
+
issuerNames: [tickerFile?.metadata.name, researchFate.change?.issuer, researchFate.formerIssuer?.name],
|
|
1715
|
+
}) : null;
|
|
1716
|
+
const quoteNote = lastTraded
|
|
1717
|
+
? [`${noQuoteLastTradeNote(requestSymbol, lastTraded)}.`, otherProfile ? otherListingProfileNote(requestSymbol, otherProfile) : null]
|
|
1718
|
+
.filter(Boolean).join("\n")
|
|
1719
|
+
: quote ? undefined : await quoteUnavailableNote(dataProvider, requestSymbol, exchange);
|
|
1676
1720
|
// A bare coin ticker read as another listing says where the coin is, as `quote` does: from the quote, else from the saved listing.
|
|
1677
1721
|
const successor = listingChangeLine(researchFate);
|
|
1678
1722
|
const choiceNotes = [
|
|
@@ -1683,8 +1727,9 @@ export async function ticker(symbol: string, dependencies: TickerCommandDependen
|
|
|
1683
1727
|
];
|
|
1684
1728
|
const listingNote = choiceNotes.join("\n") || undefined;
|
|
1685
1729
|
const memberships = await membershipsLoad;
|
|
1686
|
-
// A converted TTM block at the rate the rest of the report converts at, the one `fx` reports.
|
|
1687
|
-
|
|
1730
|
+
// A converted TTM block at the rate the rest of the report converts at, the one `fx` reports. A listing that
|
|
1731
|
+
// stopped trading shows none of the profile and figures another listing under its symbol was served with.
|
|
1732
|
+
const shownFinancials = await atReportTtmRate(otherProfile ? withoutResearch(resolvedFinancials) : resolvedFinancials, toBase);
|
|
1688
1733
|
if (dependencies.printResult) {
|
|
1689
1734
|
const newsNote = recentNews[0]?.searchedFor ? coinNewsFallbackNotice(requestSymbol, recentNews[0].searchedFor) : null;
|
|
1690
1735
|
const warnings = [...choiceNotes, quoteNote, newsNote].filter((note): note is string => !!note);
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { currenciesNamed } from "../utils/currency-names";
|
|
2
|
+
import { dollarPairListing } from "../utils/currency-pair";
|
|
3
|
+
|
|
4
|
+
/** A currency a name typed in words stands for, and its pair against the dollar as a listing. */
|
|
5
|
+
export interface NamedCurrencyPair {
|
|
6
|
+
/** The words as typed: `swiss franc`. */
|
|
7
|
+
typed: string;
|
|
8
|
+
code: string;
|
|
9
|
+
/** USDCHF=X for the franc, EURUSD=X for the euro. */
|
|
10
|
+
pair: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The one currency words name (`swiss franc` is CHF, `yen` JPY) with its
|
|
15
|
+
* pair against the dollar. Null for words that name none, several (`peso`)
|
|
16
|
+
* or the dollar itself, which has no pair of its own.
|
|
17
|
+
*/
|
|
18
|
+
export function namedCurrencyPair(typed: string): NamedCurrencyPair | null {
|
|
19
|
+
const words = typed.trim().replace(/\s+/g, " ");
|
|
20
|
+
if (!words || /[^\p{L}\s.'-]/u.test(words)) return null;
|
|
21
|
+
const named = currenciesNamed(words);
|
|
22
|
+
const code = named.length === 1 ? named[0]!.code : null;
|
|
23
|
+
return code && code !== "USD" ? { typed: words, code, pair: dollarPairListing(code) } : null;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** "swiss franc is a currency (CHF), not a ticker.", then what to run: `gloom fx CHF` for its rate, `gloom history USDCHF=X` for its pair. */
|
|
27
|
+
function currencyStop(named: NamedCurrencyPair, command: string): { message: string; details: string } {
|
|
28
|
+
return {
|
|
29
|
+
message: `${named.typed} is a currency (${named.code}), not a ticker.`,
|
|
30
|
+
details: `Its rate: gloom fx ${named.code}\nIts pair: gloom ${command} ${named.pair}`,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* The stop for a symbol command given a currency's name in several words
|
|
36
|
+
* (`history swiss franc`, `quote japanese yen`), which would otherwise read
|
|
37
|
+
* each word as a symbol (SWISS, a Copenhagen listing). One word is a ticker
|
|
38
|
+
* first (`history real` is The RealReal); `currencyNameMiss` names its
|
|
39
|
+
* currency once it fails as one. Null for anything else.
|
|
40
|
+
*/
|
|
41
|
+
export function currencyNameStop(words: readonly string[], command: string): { message: string; details: string } | null {
|
|
42
|
+
const typed = words.map((word) => word.trim()).filter(Boolean);
|
|
43
|
+
if (typed.length === 0 || typed.some((word) => word.startsWith("-"))) return null;
|
|
44
|
+
const phrase = typed.join(" ");
|
|
45
|
+
if (!/\s/.test(phrase)) return null;
|
|
46
|
+
const named = namedCurrencyPair(phrase);
|
|
47
|
+
return named ? currencyStop(named, command) : null;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/** The stop for one word that failed as a symbol and names a currency (`history yen`), else null. */
|
|
51
|
+
export function currencyNameMiss(word: string, command: string): { message: string; details: string } | null {
|
|
52
|
+
const named = namedCurrencyPair(word);
|
|
53
|
+
return named ? currencyStop(named, command) : null;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/** The hint after "Not a ticker: YEN." for a word that names a currency: "Try `gloom fx JPY` for the yen's rate, or its pair USDJPY=X." */
|
|
57
|
+
export function currencyNameHint(typed: string): string | null {
|
|
58
|
+
const named = namedCurrencyPair(typed);
|
|
59
|
+
return named ? `Try \`gloom fx ${named.code}\` for the ${named.typed}'s rate, or its pair ${named.pair}.` : null;
|
|
60
|
+
}
|
package/src/cli/glossary.ts
CHANGED
|
@@ -605,10 +605,10 @@ export const GLOSSARY: readonly GlossaryEntry[] = [
|
|
|
605
605
|
},
|
|
606
606
|
{
|
|
607
607
|
// SIW's Setup column prints these two words.
|
|
608
|
-
term: "Crowded", aliases: ["crowded short", "crowded shorts", "crowded trade", "crowded, rising", "crowded rising", "setup"], functions: ["SIW"],
|
|
609
|
-
shown: ["Crowded", "Crowded,
|
|
608
|
+
term: "Crowded", aliases: ["crowded short", "crowded shorts", "crowded trade", "crowded, rising", "crowded rising", "crowded, price rising", "px up", "setup"], functions: ["SIW"],
|
|
609
|
+
shown: ["Crowded", "Crowded, px up"],
|
|
610
610
|
definition: "SIW's flag for a heavily shorted name: at least 10% of the float short, or five or more days to cover with at least 5% of the float short "
|
|
611
|
-
+ "(days to cover alone when the float is unknown). Crowded,
|
|
611
|
+
+ "(days to cover alone when the float is unknown). Crowded, px up adds a share price up over the month (px is the price, not the short interest, which can be falling). A fixed threshold, not a squeeze forecast.",
|
|
612
612
|
},
|
|
613
613
|
{
|
|
614
614
|
term: "Squeeze", aliases: ["short squeeze", "squeezes", "short covering"], functions: ["SIW"], shown: ["Short squeeze watch"],
|
package/src/cli/history-rows.ts
CHANGED
|
@@ -511,12 +511,24 @@ export function historyVolume(
|
|
|
511
511
|
* with a volume says the same (`historyVolumeBasis`): `volume in USD per UTC day, aggregate across venues`, `volume in
|
|
512
512
|
* USD summed over 3 spot venues`.
|
|
513
513
|
*/
|
|
514
|
-
|
|
514
|
+
function historyVolumeText(volume: HistoryVolume, interval: ManualChartResolution | null, basis: string | null = null): string {
|
|
515
515
|
const text = interval === "1d" ? `volume in ${volume.unit} per UTC day` : `volume in ${volume.unit}`;
|
|
516
516
|
if (!basis) return text;
|
|
517
517
|
return basis === "aggregate" ? `${text}, aggregate across venues` : `${text} summed over ${basis}`;
|
|
518
518
|
}
|
|
519
519
|
|
|
520
|
+
/**
|
|
521
|
+
* What the status line says of a history's volume: a coin's unit and basis
|
|
522
|
+
* (historyVolumeText), or, for bars whose volume has no unit to state, what
|
|
523
|
+
* it counts when the history says (`volume basis: daily total` on an index's
|
|
524
|
+
* daily bars, `volume basis: intraday count` on its hourly ones, which sum
|
|
525
|
+
* below the day's). Null when neither is known.
|
|
526
|
+
*/
|
|
527
|
+
export function historyVolumeNote(volume: HistoryVolume | null, interval: ManualChartResolution | null, basis: string | null): string | null {
|
|
528
|
+
if (volume) return historyVolumeText(volume, interval, basis);
|
|
529
|
+
return basis ? `volume basis: ${basis}` : null;
|
|
530
|
+
}
|
|
531
|
+
|
|
520
532
|
/** What the volume of every bar that has one counts, when they all say the same; null otherwise. */
|
|
521
533
|
export function historyVolumeBasis(rows: readonly Pick<HistoryRow, "volume" | "volumeBasis">[]): string | null {
|
|
522
534
|
const bases = new Set(rows.filter((row) => row.volume != null).map((row) => row.volumeBasis ?? null));
|
|
@@ -738,6 +750,11 @@ export function historyUnit(listing: string, quote: { currency?: string; instrum
|
|
|
738
750
|
: { kind: "unknown", currency: null, unit: null };
|
|
739
751
|
}
|
|
740
752
|
|
|
753
|
+
/** The unit an export names for a history's prices: a pair's quote currency per base (`JPY per USD`), else its currency or unit. */
|
|
754
|
+
export function historyExportUnit(unit: HistoryUnit): string | null {
|
|
755
|
+
return unit.kind === "pair" ? unit.unit : unit.currency ?? unit.unit;
|
|
756
|
+
}
|
|
757
|
+
|
|
741
758
|
function historyDate(value: string): string {
|
|
742
759
|
return value.length > 10 ? formatUtcTime(value) : value;
|
|
743
760
|
}
|
package/src/cli/known-gaps.ts
CHANGED
|
@@ -5,6 +5,9 @@ import { parsePublicTickerKey } from "../utils/exchanges";
|
|
|
5
5
|
import { listingAbroadVenue } from "../utils/sec";
|
|
6
6
|
import { nimCommand } from "./bank-section";
|
|
7
7
|
import { treasuryYieldLine, treasuryYieldTenor } from "./treasury-yields";
|
|
8
|
+
import { namedCurrencyPair } from "./currency-name-hint";
|
|
9
|
+
import { dollarPairListing } from "../utils/currency-pair";
|
|
10
|
+
import { currencyCodeTyped } from "../utils/currency-names";
|
|
8
11
|
|
|
9
12
|
/**
|
|
10
13
|
* What a listing is to a sub-minute ask: a US listing, which has a tape; one
|
|
@@ -206,6 +209,14 @@ const TOPIC_POINTERS: ReadonlyArray<{
|
|
|
206
209
|
closest: ReadonlyArray<readonly [code: string, gives: string]>;
|
|
207
210
|
}> = [
|
|
208
211
|
BANK_FIGURES_TOPIC,
|
|
212
|
+
{
|
|
213
|
+
// CRPR's agency ratings are licensed by the agencies; the tape's grade of each bond is the nearest public read.
|
|
214
|
+
topic: "Agency credit ratings and rating history",
|
|
215
|
+
availability: "not carried (the agencies license them)",
|
|
216
|
+
phrases: ["crpr", "agency rating", "agency ratings", "credit rating history", "credit ratings history", "rating agency",
|
|
217
|
+
"rating agencies", "moody's rating", "moodys rating", "fitch rating"],
|
|
218
|
+
closest: [["TRACE", "each bond's grade, investment grade or high yield: gloom fn TRACE <ticker>"], ["CRD", "spreads by rating"]],
|
|
219
|
+
},
|
|
209
220
|
{
|
|
210
221
|
topic: "defense budget",
|
|
211
222
|
phrases: ["defense budget", "defence budget", "defense spending", "defence spending", "dod", "department of defense",
|
|
@@ -347,9 +358,21 @@ const COMMAND_POINTERS: ReadonlyArray<{
|
|
|
347
358
|
},
|
|
348
359
|
];
|
|
349
360
|
|
|
350
|
-
/** The command for a query that names a setting ("light theme")
|
|
361
|
+
/** The command for a query that names a setting ("light theme"), a portfolio report ("drip") or a currency ("yen"), else null. */
|
|
351
362
|
export function commandPointer(query: string): string | null {
|
|
352
|
-
return findCommandPointer(query)?.line ??
|
|
363
|
+
return findCommandPointer(query)?.line ?? currencyPointer(query);
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
/**
|
|
367
|
+
* `fx` for a query that is one currency, by its code (`jpy`, `CHF`) or its
|
|
368
|
+
* name (`yen`, `swiss franc`): its rate and its pair. A code that is also an
|
|
369
|
+
* English word counts only in capitals (`TRY`, not "try"). Null for the
|
|
370
|
+
* dollar, which has no pair of its own, and for anything else.
|
|
371
|
+
*/
|
|
372
|
+
function currencyPointer(query: string): string | null {
|
|
373
|
+
const code = currencyCodeTyped(query) ?? namedCurrencyPair(query)?.code;
|
|
374
|
+
if (!code || code === "USD") return null;
|
|
375
|
+
return `The ${code} rate: gloom fx ${code}; its pair's history: gloom history ${dollarPairListing(code)}`;
|
|
353
376
|
}
|
|
354
377
|
|
|
355
378
|
/**
|
package/src/cli/listing-arg.ts
CHANGED
|
@@ -45,6 +45,7 @@ import { bareFuturesCode, futuresContractByCode } from "../market-data/futures-b
|
|
|
45
45
|
import { classifyInstrumentType, kindFromListingSyntax } from "../tickers/instrument-kind";
|
|
46
46
|
import type { InstrumentOfKind } from "../tickers/instrument-coverage";
|
|
47
47
|
import { brokerIndexCode, brokerIndexReadAs } from "./index-roots";
|
|
48
|
+
import { continuousAliasGeneric } from "../utils/futures-generic";
|
|
48
49
|
import {
|
|
49
50
|
bloombergCodeOf,
|
|
50
51
|
bloombergMarketHint,
|
|
@@ -62,6 +63,7 @@ import { listingAbroadVenue } from "../utils/sec";
|
|
|
62
63
|
import { savedAbroadForBareSymbol, savedUsListingOf } from "../tickers/search/bare-symbol";
|
|
63
64
|
import { listingSuffixCandidate, listingSuffixVenue, tickerHasListingSuffix } from "../sources/listing-symbols";
|
|
64
65
|
import { coinElsewhereNote, notTheCoinNote } from "./commands/crypto-hints";
|
|
66
|
+
import { fredSeriesArgument, fredSeriesNotListing } from "../series/fred-argument";
|
|
65
67
|
|
|
66
68
|
/** The `--exchange` option of every command that takes a ticker. */
|
|
67
69
|
export const EXCHANGE_OPTION = {
|
|
@@ -178,6 +180,10 @@ function parseCleanListingArg(
|
|
|
178
180
|
// VIX.X and $VIX.X, a broker's code for an index, are its own symbol ^VIX; $VIX is read in `resolveCliListing`.
|
|
179
181
|
const index = option ? null : brokerIndexCode(raw);
|
|
180
182
|
if (index && !index.bare) return { symbol: index.symbol, exchange: "", key: index.symbol, readAs: brokerIndexReadAs(index) };
|
|
183
|
+
// VX=F, the continuous symbol VIX futures do not have, is the front generic VX1.
|
|
184
|
+
const generic = option ? null : continuousAliasGeneric(raw);
|
|
185
|
+
// It says so, as a name read as a bare symbol does: VX1 is not what was typed.
|
|
186
|
+
if (generic) return { symbol: generic, exchange: "", key: generic, readAs: `Read ${raw.trim().toUpperCase()} as ${generic}, the front VIX future.`, readFromName: true };
|
|
181
187
|
// A perpetual's market id (binance:BZUSDT, as PERP names it) is its listing on that venue (BZUSDT:BINANCE).
|
|
182
188
|
let typed = (typedPerpetualListing(raw)?.key ?? raw).trim().replace(/^\$/, "").toUpperCase();
|
|
183
189
|
// `SAN:` asks which listing; with --exchange it has its answer.
|
|
@@ -1208,6 +1214,12 @@ export async function resolveCliListing(
|
|
|
1208
1214
|
): Promise<CliListing> {
|
|
1209
1215
|
// "JPM US Equity" is Bloomberg's code for JPM; "Putnam US Equity", whose root is no US ticker, is a name.
|
|
1210
1216
|
const typed = stripStrayEdges(raw).text || raw;
|
|
1217
|
+
// FRED:T10Y2Y is the series the catalog prints, never the symbol FRED on a venue called T10Y2Y.
|
|
1218
|
+
const fred = exchangeOption?.trim() ? null : fredSeriesArgument(typed);
|
|
1219
|
+
if (fred) {
|
|
1220
|
+
const { message, details } = fredSeriesNotListing(fred);
|
|
1221
|
+
throw new ListingArgError(message, details);
|
|
1222
|
+
}
|
|
1211
1223
|
const read = await readTerminalCodeArg(deps.dataProvider, typed);
|
|
1212
1224
|
// A company's name, an entry of a comma list (`WHR, Whirlpool Corporation`), is the listing search names for it.
|
|
1213
1225
|
// A name before a legal form ("SAP SE", "SIEMENS AG") is looked up first: SE is also SIX Swiss's market code.
|
package/src/cli/not-a-ticker.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { notATickerSymbol } from "../sources/provider-errors";
|
|
2
2
|
import { boardCoinFor } from "./board-coins";
|
|
3
|
+
import { currencyNameHint } from "./currency-name-hint";
|
|
3
4
|
import { splitSymbolArgs, splitSymbolWords } from "./symbol-args";
|
|
4
5
|
import { treasuryYieldHint, treasuryYieldTenor } from "./treasury-yields";
|
|
5
6
|
|
|
6
7
|
// "Not a ticker: APPLE." as the router words it; the symbol ends at the sentence's own period.
|
|
7
|
-
// One that already names what to try (a search, a FRED series, a yield, the pair search offered) is left alone.
|
|
8
|
-
const NOT_A_TICKER_SENTENCE = /Not a ticker: ((?:(?!\.\s)[^\n`\x1b])+?)\.(?=\s|\x1b|$)(?! Try `gloom (?:search|fred|quote) | Did you mean )/g;
|
|
8
|
+
// One that already names what to try (a search, a FRED series, a yield, a currency's rate, the pair search offered) is left alone.
|
|
9
|
+
const NOT_A_TICKER_SENTENCE = /Not a ticker: ((?:(?!\.\s)[^\n`\x1b])+?)\.(?=\s|\x1b|$)(?! Try `gloom (?:search|fred|quote|fx) | Did you mean )/g;
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* The symbol as the user typed it on the command line (`Apple`), not as the router saw it (`APPLE`).
|
|
@@ -53,7 +54,8 @@ export function withSearchHints(text: string, args: readonly string[], isFredSer
|
|
|
53
54
|
const coin = boardCoinFor(id);
|
|
54
55
|
if (coin) return `${sentence} Did you mean ${coin.symbol}${coin.name && coin.name.toUpperCase() !== coin.symbol ? ` (${coin.name})` : ""}?`;
|
|
55
56
|
const tenor = treasuryYieldTenor(typed);
|
|
56
|
-
|
|
57
|
+
// A currency's name (`yen`) is its rate and its pair, not a ticker search could find.
|
|
58
|
+
return `${sentence} ${tenor ? treasuryYieldHint(tenor) : currencyNameHint(typed) ?? searchHint(typed)}`;
|
|
57
59
|
})
|
|
58
60
|
: named;
|
|
59
61
|
}
|
|
@@ -21,6 +21,8 @@ export interface PaneFunctionCapability {
|
|
|
21
21
|
aliases: string[];
|
|
22
22
|
/** Words that are no code but ask for this function's data: `fn` and `catalog` answer them with it. */
|
|
23
23
|
suggestFor?: string[];
|
|
24
|
+
/** Words that open the function on one argument (`VX`: CTM VIX). */
|
|
25
|
+
opens?: ReadonlyArray<{ words: readonly string[]; argument: string }>;
|
|
24
26
|
intents: string[];
|
|
25
27
|
outputKind: string;
|
|
26
28
|
reportReadiness: PaneFunctionReadiness;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { logFailure } from "../../utils/log-failure";
|
|
2
2
|
import { commands as builtInCommands, getCommandPrefixes } from "../../components/command-bar/commands/registry";
|
|
3
|
-
import type { PaneDef, PaneTemplateCreateOptions, PaneTemplateDef } from "../../types/plugin";
|
|
3
|
+
import type { HeadlessPaneDefinition, PaneDef, PaneTemplateCreateOptions, PaneTemplateDef } from "../../types/plugin";
|
|
4
4
|
import type { MarketContext } from "../types";
|
|
5
5
|
import {
|
|
6
6
|
buildCreateOptions,
|
|
@@ -289,7 +289,7 @@ async function buildTemplateCatalogEntry(
|
|
|
289
289
|
aliases: [...(template.shortcut?.aliases ?? [])],
|
|
290
290
|
argKind: argument.kind,
|
|
291
291
|
argPlaceholder: argument.placeholder,
|
|
292
|
-
...(headless
|
|
292
|
+
...argExamples(headless, context),
|
|
293
293
|
...(headless?.argument.kind === "tickers" && template.shortcut?.argKind === "ticker"
|
|
294
294
|
? { shotArgument: argumentHint({ argKind: "ticker", argPlaceholder: template.shortcut.argPlaceholder }) } : {}),
|
|
295
295
|
keywords: template.keywords ?? [],
|
|
@@ -298,6 +298,20 @@ async function buildTemplateCatalogEntry(
|
|
|
298
298
|
};
|
|
299
299
|
}
|
|
300
300
|
|
|
301
|
+
/**
|
|
302
|
+
* The arguments a function's examples show past its placeholder: its own, and
|
|
303
|
+
* for a list of more than two symbols, a watchlist's name, which stands for
|
|
304
|
+
* its symbols (the reader's first watchlist).
|
|
305
|
+
*/
|
|
306
|
+
function argExamples(headless: HeadlessPaneDefinition | undefined, context: MarketContext): { argExamples: readonly string[] } | null {
|
|
307
|
+
const own = headless?.argument.examples ?? [];
|
|
308
|
+
const argument = headless?.argument;
|
|
309
|
+
const list = (argument?.kind === "symbol-list" || argument?.kind === "tickers") && (argument.maximum == null || argument.maximum > 2);
|
|
310
|
+
const name = context.config.watchlists[0]?.name ?? "Watchlist";
|
|
311
|
+
const examples = list ? [...own, /^[\w.-]+$/.test(name) ? name : `'${name.replace(/'/g, "'\\''")}'`] : own;
|
|
312
|
+
return examples.length > 0 ? { argExamples: examples } : null;
|
|
313
|
+
}
|
|
314
|
+
|
|
301
315
|
/**
|
|
302
316
|
* The functions `gloom catalog` and search list. An unlisted one (`listed:
|
|
303
317
|
* false`) is left out, and its pane is not listed in its place; `unlisted`
|
|
@@ -333,7 +347,7 @@ export async function buildPaneCatalogEntries(
|
|
|
333
347
|
aliases,
|
|
334
348
|
argKind: argument.kind,
|
|
335
349
|
argPlaceholder: argument.placeholder,
|
|
336
|
-
...(pane.headless
|
|
350
|
+
...argExamples(pane.headless, context),
|
|
337
351
|
keywords: [],
|
|
338
352
|
defaultSettings: {},
|
|
339
353
|
capability: getPaneFunctionCapability(undefined, pane),
|
|
@@ -403,6 +417,7 @@ function nameAndDescriptionFields(entry: PaneCatalogEntry): string[] {
|
|
|
403
417
|
...entry.keywords,
|
|
404
418
|
...entry.capability.aliases,
|
|
405
419
|
...entry.capability.intents,
|
|
420
|
+
...entry.capability.opens?.flatMap((opening) => opening.words) ?? [],
|
|
406
421
|
].filter((value): value is string => !!value).map((value) => value.toLowerCase());
|
|
407
422
|
}
|
|
408
423
|
|
|
@@ -450,6 +465,7 @@ function scorePaneCatalogEntry(entry: PaneCatalogEntry, query: string): CatalogM
|
|
|
450
465
|
entry.shortcut,
|
|
451
466
|
...entry.aliases,
|
|
452
467
|
...entry.capability.suggestFor ?? [],
|
|
468
|
+
...entry.capability.opens?.flatMap((opening) => opening.words) ?? [],
|
|
453
469
|
entry.templateId,
|
|
454
470
|
entry.paneId,
|
|
455
471
|
].filter((value): value is string => !!value).map((value) => normalizeLookupToken(value));
|
|
@@ -459,7 +475,9 @@ function scorePaneCatalogEntry(entry: PaneCatalogEntry, query: string): CatalogM
|
|
|
459
475
|
const flags = flagText(entry);
|
|
460
476
|
const wholeQuery = query.toLowerCase().trim().replace(/\s+/g, " ");
|
|
461
477
|
const called = identityFields(entry);
|
|
462
|
-
|
|
478
|
+
// A word that opens one case of the function (CTM's `VX`) is typed as its code is.
|
|
479
|
+
const codes = [entry.token, entry.shortcut, ...entry.aliases, ...entry.capability.opens?.flatMap((opening) => opening.words) ?? []]
|
|
480
|
+
.filter((value): value is string => !!value).map((value) => normalizeLookupToken(value));
|
|
463
481
|
|
|
464
482
|
let score = containsPhrase(`${named} ${flags}`, wholeQuery) ? 12 : 0;
|
|
465
483
|
// A query that is one of the function's own keywords ("hedge" for OSA) beats one found inside a
|
|
@@ -647,6 +665,9 @@ export function limitationSentence(text: string): string {
|
|
|
647
665
|
return !trimmed || /[.!?]["')\]]*$/.test(trimmed) ? trimmed : `${trimmed}.`;
|
|
648
666
|
}
|
|
649
667
|
|
|
668
|
+
/** A data requirement that is an account: a sign-in (free or verified) or Gloom Pro, as `catalog` names under Requires. */
|
|
669
|
+
const ACCOUNT_REQUIREMENT = /\bsign-in\b|\baccount\b|\bPro\b/;
|
|
670
|
+
|
|
650
671
|
/**
|
|
651
672
|
* Names as lines of at most `width`, each name whole and the names apart by
|
|
652
673
|
* semicolons, since a name may hold a comma (Furnishings, Fixtures & Appliances).
|
|
@@ -688,7 +709,12 @@ function renderCatalogEntry(entry: PaneCatalogEntry): string {
|
|
|
688
709
|
const mnemonics = new Set([entry.token, ...entry.aliases].map((value) => value.toLowerCase()));
|
|
689
710
|
const keywords = capability.aliases.filter((keyword) => !mnemonics.has(keyword.toLowerCase()));
|
|
690
711
|
if (keywords.length > 0) stats.push(["Keywords", keywords.join(", ")]);
|
|
691
|
-
|
|
712
|
+
// "Requires" is what a reader must have, a sign-in or Pro; the rest says where the data comes from, which a
|
|
713
|
+
// signed-out run reads too (COT's CFTC history, CBR's rates).
|
|
714
|
+
const required = capability.dataRequirements.filter((requirement) => ACCOUNT_REQUIREMENT.test(requirement));
|
|
715
|
+
const sources = capability.dataRequirements.filter((requirement) => !ACCOUNT_REQUIREMENT.test(requirement));
|
|
716
|
+
if (required.length > 0) stats.push(["Requires", required.join(", ")]);
|
|
717
|
+
if (sources.length > 0) stats.push(["Data", sources.join(", ")]);
|
|
692
718
|
if (capability.limitations.length > 0) stats.push(["Limitations", capability.limitations.map(limitationSentence).join(" ")]);
|
|
693
719
|
lines.push(renderStats(stats));
|
|
694
720
|
|