gloomberb 0.20.4 → 0.20.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/README.md +3 -1
- package/README.zh-CN.md +1 -1
- package/bin/gloom +9 -0
- package/bin/without-bun.cjs +98 -0
- package/package.json +4 -1
- package/src/api-client/data.ts +148 -37
- package/src/api-client/hk-tenders.ts +59 -0
- package/src/api-client/index.ts +1 -0
- package/src/api-client/types/econ.ts +30 -0
- package/src/api-client/yield-curves.ts +1 -1
- package/src/app/global-shortcuts.ts +4 -1
- package/src/app/keybindings/actions.ts +6 -0
- package/src/app/keybindings/config.ts +2 -1
- package/src/app/keybindings/index.ts +1 -0
- package/src/app/keybindings/labels.ts +6 -1
- package/src/app/keybindings/resolve.ts +23 -4
- package/src/app/keybindings/terminal-keys.ts +35 -0
- package/src/app/pane-runtime/index.tsx +2 -2
- package/src/app/pane-runtime/ticker-open-runtime.ts +68 -40
- package/src/app.tsx +18 -13
- package/src/architecture/floating-promise-allowlist.json +313 -0
- package/src/architecture/ui-literals-allowlist.json +1 -1
- package/src/capabilities/chart-series.ts +27 -1
- package/src/cli/commands/keybindings.ts +5 -5
- package/src/cli/commands/market.ts +238 -57
- package/src/cli/commands/news-search.ts +81 -14
- package/src/cli/commands/overview.ts +27 -6
- package/src/cli/commands/remote.ts +16 -17
- package/src/cli/commands/system.ts +1 -1
- package/src/cli/commands/ticker.ts +3 -1
- package/src/cli/early-command.ts +2 -0
- package/src/cli/errors.ts +10 -1
- package/src/cli/fx-forward.ts +89 -7
- package/src/cli/fx-pair.ts +1 -1
- package/src/cli/fx-quote-rate.ts +23 -0
- package/src/cli/glossary.ts +19 -5
- package/src/cli/help.ts +1 -0
- package/src/cli/history-rows.ts +5 -3
- package/src/cli/index-roots.ts +5 -4
- package/src/cli/index.ts +40 -3
- package/src/cli/known-gaps.ts +38 -9
- package/src/cli/listing-arg.ts +17 -5
- package/src/cli/name-entries.ts +5 -1
- package/src/cli/not-a-ticker.ts +4 -0
- package/src/cli/options.ts +52 -3
- package/src/cli/output-file.ts +5 -3
- package/src/cli/pane-functions/catalog.ts +15 -0
- package/src/cli/pane-functions/function-help.ts +4 -4
- package/src/cli/pane-functions/headless.ts +9 -4
- package/src/cli/pane-functions/index.ts +6 -4
- package/src/cli/pane-functions/resolver.ts +2 -2
- package/src/cli/result.ts +21 -2
- package/src/cli/spreadsheet-hint.ts +7 -3
- package/src/cli/treasury-yields.ts +5 -3
- package/src/components/chart/composite/legend.tsx +40 -2
- package/src/components/command-bar/pane-settings.ts +2 -2
- package/src/components/command-bar/routes/root/results.ts +6 -2
- package/src/components/command-bar/workflow/tickers.ts +2 -2
- package/src/components/data-table/view.tsx +9 -2
- package/src/components/input-search-bar.tsx +9 -2
- package/src/components/layout/pane/header.tsx +2 -0
- package/src/components/layout/shell/pane/capture.ts +4 -1
- package/src/components/layout/status-bar.tsx +6 -1
- package/src/components/onboarding/first-run-workspace.ts +44 -2
- package/src/components/onboarding/onboarding-frame.tsx +11 -2
- package/src/components/onboarding/onboarding-keyboard.ts +16 -0
- package/src/components/onboarding/onboarding-wizard.tsx +8 -8
- package/src/components/onboarding/portfolio-step/positions-panel.tsx +62 -1
- package/src/components/onboarding/use-onboarding-progress.ts +12 -4
- package/src/components/pane-settings-dialog/desktop.tsx +2 -2
- package/src/components/pane-settings-dialog/tui.tsx +2 -2
- package/src/components/pane-settings-dialog/value.ts +6 -0
- package/src/components/pane-settings-dialog.tsx +3 -3
- package/src/components/reader/detail-reader.tsx +4 -0
- package/src/components/ui/data-table/opentui/index.tsx +11 -4
- package/src/components/ui/data-table/opentui/model.ts +8 -6
- package/src/components/ui/data-table/types.ts +6 -1
- package/src/components/ui/index.ts +1 -1
- package/src/components/ui/page-stack-view.tsx +3 -0
- package/src/components/ui/pane-link-chip.tsx +269 -54
- package/src/components/ui/query-bar.tsx +2 -1
- package/src/components/ui/table-layout.ts +38 -1
- package/src/components/ui/tabs.tsx +97 -19
- package/src/core/state/app/layout-reducer.ts +7 -0
- package/src/core/state/app/layout.ts +44 -7
- package/src/core/state/app/state.ts +1 -1
- package/src/core/state/app/types.ts +22 -2
- package/src/docs/snapshot.json +30 -13
- package/src/market-data/depositary-pair.ts +5 -3
- package/src/market-data/market/change-basis.ts +9 -5
- package/src/market-data/market/dated-previous-close.ts +147 -17
- package/src/market-data/market/status.ts +17 -1
- package/src/market-data/quotes/contributions.ts +2 -0
- package/src/market-data/quotes/listing-enterprise-value.ts +50 -0
- package/src/plugins/builtin/alerts/metric-data.ts +15 -2
- package/src/plugins/builtin/analytics/risk-client.ts +10 -4
- package/src/plugins/builtin/analytics/risk-episodes.ts +5 -4
- package/src/plugins/builtin/analytics/risk-headless.ts +4 -2
- package/src/plugins/builtin/analytics/risk-sectors.ts +91 -0
- package/src/plugins/builtin/awards/index.tsx +1 -1
- package/src/plugins/builtin/backtest/headless.ts +1 -1
- package/src/plugins/builtin/buildout/index.tsx +1 -0
- package/src/plugins/builtin/catalysts/index.tsx +2 -2
- package/src/plugins/builtin/cds/headless.ts +4 -0
- package/src/plugins/builtin/cds/model.ts +0 -6
- package/src/plugins/builtin/chart-composer/formula.ts +16 -3
- package/src/plugins/builtin/chart-composer/headless-schema.ts +2 -0
- package/src/plugins/builtin/chart-composer/headless.ts +4 -2
- package/src/plugins/builtin/chart-composer/index.tsx +1 -0
- package/src/plugins/builtin/chart-composer/presets.ts +1 -0
- package/src/plugins/builtin/chat/content/composer.tsx +5 -4
- package/src/plugins/builtin/chat/content/index.tsx +12 -2
- package/src/plugins/builtin/chat/content/layout-metrics.ts +3 -3
- package/src/plugins/builtin/chat/content/open-targets.ts +3 -3
- package/src/plugins/builtin/chat/layout.ts +5 -2
- package/src/plugins/builtin/chat/message/pane-chip.tsx +61 -40
- package/src/plugins/builtin/chat/message/terminal.tsx +13 -15
- package/src/plugins/builtin/chat/pane-links/previews.ts +51 -5
- package/src/plugins/builtin/chat/pane-links/share-card.ts +36 -0
- package/src/plugins/builtin/cloud/askg/pane.tsx +55 -13
- package/src/plugins/builtin/cloud/askg/tool-display.ts +1 -0
- package/src/plugins/builtin/cloud/terminal-relay/redact.ts +5 -3
- package/src/plugins/builtin/commodity-balances/index.tsx +1 -0
- package/src/plugins/builtin/company-attention/index.tsx +1 -1
- package/src/plugins/builtin/company-kpis/headless.ts +3 -1
- package/src/plugins/builtin/company-kpis/index.tsx +2 -2
- package/src/plugins/builtin/cot/index.tsx +1 -1
- package/src/plugins/builtin/cpi/index.tsx +1 -1
- package/src/plugins/builtin/credit-boards/cdx-pane.tsx +20 -7
- package/src/plugins/builtin/credit-boards/client.ts +8 -0
- package/src/plugins/builtin/credit-boards/headless.ts +4 -1
- package/src/plugins/builtin/credit-boards/model.ts +58 -4
- package/src/plugins/builtin/credit-boards/series.ts +63 -6
- package/src/plugins/builtin/credit-boards/sovr-pane.tsx +3 -2
- package/src/plugins/builtin/credit-conditions/headless.ts +24 -6
- package/src/plugins/builtin/credit-conditions/index.tsx +1 -1
- package/src/plugins/builtin/credit-conditions/model.ts +12 -6
- package/src/plugins/builtin/credit-conditions/series.ts +2 -1
- package/src/plugins/builtin/crypto-board/index.tsx +1 -0
- package/src/plugins/builtin/dividend-yield/index.tsx +1 -0
- package/src/plugins/builtin/doe/index.tsx +1 -1
- package/src/plugins/builtin/earnings-calls/headless.ts +5 -1
- package/src/plugins/builtin/earnings-calls/index.tsx +1 -0
- package/src/plugins/builtin/econ/calendar-model.ts +115 -8
- package/src/plugins/builtin/econ/calendar-source.ts +7 -1
- package/src/plugins/builtin/econ/fred-catalog.ts +3 -1
- package/src/plugins/builtin/econ/index.tsx +42 -8
- package/src/plugins/builtin/econ/types.ts +3 -0
- package/src/plugins/builtin/econ-statistics/index.tsx +1 -0
- package/src/plugins/builtin/econ-statistics/pane.tsx +6 -0
- package/src/plugins/builtin/estimate-revisions/index.tsx +1 -0
- package/src/plugins/builtin/executives/index.tsx +1 -0
- package/src/plugins/builtin/filing-events/index.tsx +1 -0
- package/src/plugins/builtin/fixed-income/index.tsx +3 -0
- package/src/plugins/builtin/futures-curve/headless.ts +3 -3
- package/src/plugins/builtin/futures-curve/index.tsx +1 -1
- package/src/plugins/builtin/futures-curve/model.ts +18 -0
- package/src/plugins/builtin/fx-matrix/index.tsx +44 -14
- package/src/plugins/builtin/gpu/index.tsx +1 -1
- package/src/plugins/builtin/help/functions-table.tsx +1 -1
- package/src/plugins/builtin/help/index.tsx +11 -1
- package/src/plugins/builtin/help/keybindings-editor.tsx +7 -3
- package/src/plugins/builtin/holders/index.tsx +1 -0
- package/src/plugins/builtin/holders/report-header.ts +2 -2
- package/src/plugins/builtin/insider/index.tsx +1 -0
- package/src/plugins/builtin/iv-history/index.tsx +1 -1
- package/src/plugins/builtin/jobs/index.tsx +1 -0
- package/src/plugins/builtin/macro-day/headless.ts +27 -8
- package/src/plugins/builtin/macro-day/index.tsx +1 -1
- package/src/plugins/builtin/macro-day/model.ts +19 -3
- package/src/plugins/builtin/macro-day/pane.tsx +14 -9
- package/src/plugins/builtin/macro-day/releases.ts +25 -7
- package/src/plugins/builtin/market-valuation/index.tsx +1 -0
- package/src/plugins/builtin/market-valuation/pane.tsx +8 -0
- package/src/plugins/builtin/members/index.tsx +1 -1
- package/src/plugins/builtin/mna/index.tsx +1 -0
- package/src/plugins/builtin/news/index.tsx +1 -0
- package/src/plugins/builtin/news/wire/index.tsx +5 -1
- package/src/plugins/builtin/news/wire/news/detail-view.tsx +4 -0
- package/src/plugins/builtin/news/wire/news/list-search.ts +5 -2
- package/src/plugins/builtin/options/index.tsx +1 -0
- package/src/plugins/builtin/options-positioning/index.tsx +1 -0
- package/src/plugins/builtin/pe-band/index.tsx +1 -1
- package/src/plugins/builtin/portfolio-list/cli/portfolio-command.ts +25 -0
- package/src/plugins/builtin/portfolio-list/cli/render.ts +20 -3
- package/src/plugins/builtin/portfolio-list/cli/watchlist-command.ts +5 -1
- package/src/plugins/builtin/portfolio-list/headless.ts +15 -6
- package/src/plugins/builtin/power/index.tsx +1 -1
- package/src/plugins/builtin/realized-vol/index.tsx +1 -1
- package/src/plugins/builtin/research/headless-schema.ts +4 -3
- package/src/plugins/builtin/research/headless.ts +10 -4
- package/src/plugins/builtin/research/index.tsx +4 -0
- package/src/plugins/builtin/research/relative-valuation-columns.ts +145 -47
- package/src/plugins/builtin/research/relative-valuation-currency.ts +31 -0
- package/src/plugins/builtin/research/relative-valuation-headless.ts +25 -8
- package/src/plugins/builtin/research/relative-valuation-model.ts +40 -9
- package/src/plugins/builtin/research/relative-valuation-pane.tsx +3 -2
- package/src/plugins/builtin/research/relative-valuation-peers.ts +2 -2
- package/src/plugins/builtin/research-search/index.tsx +1 -0
- package/src/plugins/builtin/research-search/pane.tsx +8 -0
- package/src/plugins/builtin/revenue-breakdown/index.tsx +1 -0
- package/src/plugins/builtin/reverse-dcf/index.tsx +1 -1
- package/src/plugins/builtin/risk-factors/index.tsx +1 -0
- package/src/plugins/builtin/scanner/headless.ts +52 -13
- package/src/plugins/builtin/seasonality/index.tsx +1 -1
- package/src/plugins/builtin/sec/index.tsx +1 -0
- package/src/plugins/builtin/series-inventory.ts +1 -1
- package/src/plugins/builtin/shared/scanner-capture.ts +11 -3
- package/src/plugins/builtin/shared/series-list-detail.tsx +5 -0
- package/src/plugins/builtin/short-interest/index.tsx +1 -0
- package/src/plugins/builtin/social-mentions/index.tsx +1 -1
- package/src/plugins/builtin/supply-chain/index.tsx +1 -0
- package/src/plugins/builtin/thirteenf/api.ts +47 -4
- package/src/plugins/builtin/thirteenf/data.ts +43 -10
- package/src/plugins/builtin/thirteenf/headless.ts +55 -11
- package/src/plugins/builtin/thirteenf/model.ts +25 -9
- package/src/plugins/builtin/thirteenf/report-notes.ts +27 -6
- package/src/plugins/builtin/thirteenf/types.ts +2 -0
- package/src/plugins/builtin/ticker-detail/adr-pair/model.ts +1 -1
- package/src/plugins/builtin/ticker-detail/data-panes/historical-prices.tsx +8 -7
- package/src/plugins/builtin/ticker-detail/data-panes/history-bars.ts +8 -5
- package/src/plugins/builtin/ticker-detail/financials/model.ts +18 -2
- package/src/plugins/builtin/ticker-detail/financials/ratio-table.tsx +3 -3
- package/src/plugins/builtin/ticker-detail/financials/tab.tsx +6 -6
- package/src/plugins/builtin/ticker-detail/headless.ts +24 -17
- package/src/plugins/builtin/ticker-detail/index.tsx +4 -0
- package/src/plugins/builtin/ticker-detail/overview/model.ts +6 -4
- package/src/plugins/builtin/ticker-detail/overview-tab.tsx +6 -4
- package/src/plugins/builtin/time-sales/client.ts +9 -11
- package/src/plugins/builtin/time-sales/index.tsx +1 -1
- package/src/plugins/builtin/treasury-auctions/after.ts +267 -0
- package/src/plugins/builtin/treasury-auctions/cache.ts +54 -5
- package/src/plugins/builtin/treasury-auctions/client.ts +33 -2
- package/src/plugins/builtin/treasury-auctions/headless.ts +150 -22
- package/src/plugins/builtin/treasury-auctions/hk-headless.ts +126 -0
- package/src/plugins/builtin/treasury-auctions/hk-view.tsx +347 -0
- package/src/plugins/builtin/treasury-auctions/hk.ts +363 -0
- package/src/plugins/builtin/treasury-auctions/index.tsx +27 -4
- package/src/plugins/builtin/treasury-auctions/model.ts +264 -28
- package/src/plugins/builtin/treasury-auctions/pane.tsx +176 -41
- package/src/plugins/builtin/treasury-auctions/treasury-direct.ts +5 -2
- package/src/plugins/builtin/treasury-auctions/types.ts +7 -1
- package/src/plugins/builtin/vol-surface/index.tsx +1 -1
- package/src/plugins/builtin/world-venue-map/index.ts +1 -0
- package/src/plugins/builtin/yield-curve/curves.ts +10 -4
- package/src/plugins/builtin/yield-curve/headless.ts +6 -2
- package/src/plugins/builtin/yield-curve/index.tsx +3 -3
- package/src/plugins/builtin/yield-curve/series.ts +10 -0
- package/src/plugins/builtin/yield-curve/world.ts +3 -1
- package/src/portfolio/collection-name.ts +22 -0
- package/src/portfolio/column-values.ts +2 -1
- package/src/public/__snapshots__/public-api.test.ts.snap +4 -0
- package/src/public/remote.ts +7 -1
- package/src/remote/client.ts +191 -11
- package/src/remote/controller-utils.ts +13 -1
- package/src/remote/controller.ts +88 -26
- package/src/remote/endpoint.ts +24 -0
- package/src/remote/form.ts +59 -4
- package/src/remote/resources.ts +44 -18
- package/src/remote/schema.ts +21 -9
- package/src/remote/secrets.ts +12 -0
- package/src/remote/semantic-tree.tsx +14 -2
- package/src/remote/server.ts +2 -1
- package/src/remote/surface.tsx +192 -0
- package/src/remote/types.ts +5 -0
- package/src/renderers/dom/data-table/frozen-column.ts +3 -1
- package/src/renderers/dom/data-table/index.tsx +27 -9
- package/src/renderers/dom/data-table/row.tsx +2 -0
- package/src/renderers/electrobun/bun/desktop/backend.ts +27 -24
- package/src/renderers/electrobun/bun/desktop/detached-windows.ts +3 -3
- package/src/renderers/electrobun/bun/desktop/snapshot-commit.ts +77 -0
- package/src/renderers/electrobun/shared/protocol.ts +4 -0
- package/src/renderers/electrobun/view/backend-rpc.ts +3 -0
- package/src/renderers/electrobun/view/desktop/window/bridge.ts +3 -0
- package/src/renderers/opentui/host.tsx +6 -0
- package/src/series/standalone.ts +2 -2
- package/src/shares/api.ts +21 -4
- package/src/shares/item.ts +73 -0
- package/src/shares/pane-item.ts +205 -0
- package/src/shares/pane.ts +4 -0
- package/src/shares/payload.ts +9 -5
- package/src/sources/gloomberb-cloud/news.ts +2 -0
- package/src/sources/gloomberb-cloud/normalizers.ts +9 -5
- package/src/sources/provider-router/cache.ts +3 -1
- package/src/sync/controller.ts +17 -2
- package/src/sync/other-window-tabs.ts +32 -1
- package/src/sync/react.ts +4 -4
- package/src/tickers/renamed-listings.ts +105 -0
- package/src/tickers/search/index.ts +103 -16
- package/src/time-series/bar-spacing.ts +33 -0
- package/src/time-series/base-series.ts +21 -3
- package/src/time-series/chart-bounds.ts +31 -0
- package/src/time-series/field-catalog.ts +17 -0
- package/src/time-series/fundamentals.ts +143 -11
- package/src/time-series/ice-credit.ts +32 -6
- package/src/time-series/resolve.ts +11 -7
- package/src/time-series/session-bar.ts +78 -9
- package/src/time-series/studies/formula.ts +53 -10
- package/src/time-series/studies/pair.ts +18 -7
- package/src/time-series/studies/units.ts +49 -2
- package/src/time-series/types.ts +12 -0
- package/src/types/desktop-window.ts +2 -0
- package/src/types/financials.ts +7 -0
- package/src/types/headless.ts +8 -0
- package/src/types/plugin-pane-settings.ts +2 -0
- package/src/types/plugin-panes.ts +22 -0
- package/src/utils/central-banks.ts +86 -1
- package/src/utils/cli-output.ts +6 -3
- package/src/utils/datetime-format.ts +12 -3
- package/src/utils/depositary-receipt.ts +28 -3
- package/src/utils/ebitda.ts +128 -0
- package/src/utils/format.ts +1 -1
- package/src/utils/fundamentals.ts +14 -0
- package/src/utils/max-drawdown.ts +97 -16
- package/src/utils/shell-word.ts +13 -0
- package/src/utils/untrusted-text.ts +29 -0
|
@@ -5,19 +5,25 @@ import { ICE_SPREAD_SERIES, type IceCreditSeries } from "../../../time-series/ic
|
|
|
5
5
|
|
|
6
6
|
export type CreditSeriesDefinition = Pick<IceCreditSeries, "seriesId" | "label" | "region">;
|
|
7
7
|
|
|
8
|
-
/** US investment grade and high yield by rating,
|
|
8
|
+
/** US investment grade and high yield by rating, euro high yield, then emerging markets corporates by grade and region. */
|
|
9
9
|
export const CREDIT_SERIES: readonly CreditSeriesDefinition[] = ICE_SPREAD_SERIES
|
|
10
10
|
.map(({ seriesId, label, region }) => ({ seriesId, label, region }));
|
|
11
11
|
|
|
12
|
-
const CREDIT_REGIONS = ["all", "us", "euro"] as const;
|
|
12
|
+
const CREDIT_REGIONS = ["all", "us", "euro", "em", "asia"] as const;
|
|
13
13
|
type CreditRegion = typeof CREDIT_REGIONS[number];
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
/** The regions to list, from a setting or `--region` (one, or a comma list such as `asia,us`); every one when none is known. */
|
|
16
|
+
export function creditRegion(value: unknown): readonly CreditRegion[] {
|
|
17
|
+
const regions = typeof value === "string"
|
|
18
|
+
? [...new Set(value.split(",").map((part) => part.trim().toLowerCase()))].filter((part): part is CreditRegion => CREDIT_REGIONS.includes(part as CreditRegion))
|
|
19
|
+
: [];
|
|
20
|
+
return regions.length === 0 || regions.includes("all") ? ["all"] : regions;
|
|
17
21
|
}
|
|
18
22
|
|
|
19
|
-
|
|
20
|
-
|
|
23
|
+
/** The series in the regions, in the board's order: emerging markets take in Asia, its biggest region. */
|
|
24
|
+
export function creditSeriesIn(regions: readonly CreditRegion[]): readonly CreditSeriesDefinition[] {
|
|
25
|
+
if (regions.includes("all")) return CREDIT_SERIES;
|
|
26
|
+
return CREDIT_SERIES.filter((series) => regions.includes(series.region) || (series.region === "asia" && regions.includes("em")));
|
|
21
27
|
}
|
|
22
28
|
|
|
23
29
|
export interface CreditConditionRow {
|
|
@@ -6,7 +6,8 @@ import { ICE_CREDIT_SERIES, ICE_HISTORY_LIMIT_NOTICE } from "../../../time-serie
|
|
|
6
6
|
export const CREDIT_SPREAD_SERIES: readonly SeriesDefinition[] = ICE_CREDIT_SERIES.map((series) => ({
|
|
7
7
|
id: `fred:${series.seriesId}`,
|
|
8
8
|
name: series.name,
|
|
9
|
-
|
|
9
|
+
// Spreads in bp, as G draws them; yields in percent.
|
|
10
|
+
unit: series.measure === "spread" ? "bp" : "%",
|
|
10
11
|
frequency: "daily",
|
|
11
12
|
group: "Credit",
|
|
12
13
|
tags: [series.measure, ...series.tags, "corporate bonds"],
|
|
@@ -14,6 +14,7 @@ export const cryptoBoardModule: PluginModule = {
|
|
|
14
14
|
id: "crypto-board",
|
|
15
15
|
name: "Crypto",
|
|
16
16
|
icon: "C",
|
|
17
|
+
shareItem: { argument: true },
|
|
17
18
|
get component(): typeof import("./pane").CryptoBoardPane { const { CryptoBoardPane } = require("./pane"); return CryptoBoardPane; },
|
|
18
19
|
defaultPosition: "right",
|
|
19
20
|
defaultMode: "floating",
|
|
@@ -24,7 +24,7 @@ const shortcut = (prefix: string, tab: DoeTab | null) => ({
|
|
|
24
24
|
|
|
25
25
|
export const doeModule: PluginModule = {
|
|
26
26
|
series: DOE_CATALOG_SERIES,
|
|
27
|
-
panes: [{ id: "doe", name: "Oil and Gas Inventories", icon: "D", get component(): typeof import("./pane").DoePane { const { DoePane } = require("./pane"); return DoePane; },
|
|
27
|
+
panes: [{ id: "doe", name: "Oil and Gas Inventories", icon: "D", shareItem: { argument: true }, get component(): typeof import("./pane").DoePane { const { DoePane } = require("./pane"); return DoePane; },
|
|
28
28
|
defaultPosition: "right", defaultMode: "floating", defaultFloatingSize: { width: 96, height: 34 },
|
|
29
29
|
tableExport: true, headless: doeHeadless("all") }],
|
|
30
30
|
paneTemplates: [{
|
|
@@ -447,8 +447,12 @@ export function createEarningsCallsHeadless(
|
|
|
447
447
|
return projectEarningsCallsHeadless(calls, { ...args, options: { ...args.options, limit: args.options.limit ?? 50 } }, now);
|
|
448
448
|
}
|
|
449
449
|
const quarter = String(args.options.quarter || "latest");
|
|
450
|
-
|
|
450
|
+
// A call still to come has no transcript to read, and asking for one would ask the server to produce it before
|
|
451
|
+
// the call is held: the latest is the latest held, and a quarter whose call is ahead says when it is.
|
|
452
|
+
const selected = findCallForQuarter(calls.calls.filter((call) => !isUpcomingCall(call, now)), quarter);
|
|
451
453
|
if (!selected) {
|
|
454
|
+
const ahead = findCallForQuarter(calls.calls, quarter);
|
|
455
|
+
if (ahead) throw new Error(`${ticker}'s ${quarter} call is still to come. ${nextCallNotice(ahead, now)}`);
|
|
452
456
|
if (calls.unknownTicker) throw new Error(`${ticker} is not a known listed company.`);
|
|
453
457
|
if (calls.pending) throw new Error(`Earnings call discovery for ${ticker} is still pending.`);
|
|
454
458
|
if (calls.sourceLimitReached ?? calls.calls.length >= (calls.sourceLimit ?? 200)) {
|
|
@@ -123,15 +123,41 @@ export function dayLabel(d: Date, today: Date): string {
|
|
|
123
123
|
const MIN_DAYS_LISTED_AHEAD = 7;
|
|
124
124
|
|
|
125
125
|
/**
|
|
126
|
-
*
|
|
127
|
-
*
|
|
126
|
+
* The last UTC day the calendar lists releases for, YYYY-MM-DD, as Gloom Cloud
|
|
127
|
+
* says it: on the calendar from a day (`served`), or on each central bank's
|
|
128
|
+
* next decision it lists past the end (`listedThrough`). From a server that
|
|
129
|
+
* says neither, which lists nothing past the end, the day of the last event.
|
|
130
|
+
* Null when it lists nothing.
|
|
128
131
|
*/
|
|
129
|
-
export function
|
|
132
|
+
export function listingEnd(
|
|
133
|
+
events: readonly Pick<EconEvent, "date" | "listedThrough">[],
|
|
134
|
+
served?: string | null,
|
|
135
|
+
): string | null {
|
|
136
|
+
const said = served ?? events.find((event) => event.listedThrough)?.listedThrough;
|
|
137
|
+
if (said && /^\d{4}-\d{2}-\d{2}$/.test(said)) return said;
|
|
130
138
|
let last: Date | null = null;
|
|
131
139
|
for (const event of events) {
|
|
132
140
|
if (!last || event.date.getTime() > last.getTime()) last = event.date;
|
|
133
141
|
}
|
|
134
|
-
return last
|
|
142
|
+
return last ? dateKey(last) : null;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* When the listing (`listingEnd`) stops short of a week past `windowStart`,
|
|
147
|
+
* its last day; null when it reaches that far or lists nothing.
|
|
148
|
+
*/
|
|
149
|
+
export function shortCalendarEnd(
|
|
150
|
+
events: readonly Pick<EconEvent, "date" | "listedThrough">[],
|
|
151
|
+
windowStart: number,
|
|
152
|
+
served?: string | null,
|
|
153
|
+
): string | null {
|
|
154
|
+
const end = listingEnd(events, served);
|
|
155
|
+
return end && Date.parse(`${end}T00:00:00Z`) + 86_400_000 <= windowStart + MIN_DAYS_LISTED_AHEAD * 86_400_000 ? end : null;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/** Whether a row is a central bank's next decision Gloom Cloud lists past the end of the listing. */
|
|
159
|
+
export function pastReleaseListing(event: Pick<EconEvent, "pastListing">): boolean {
|
|
160
|
+
return event.pastListing === true;
|
|
135
161
|
}
|
|
136
162
|
|
|
137
163
|
/**
|
|
@@ -314,9 +340,82 @@ export function eventSeriesId(event: Pick<EconEvent, "country" | "event">): stri
|
|
|
314
340
|
*/
|
|
315
341
|
export function eventSearchNames(event: Pick<EconEvent, "country" | "event" | "actual" | "forecast" | "prior">): string[] {
|
|
316
342
|
const series = resolveFredMapping(event.event, event.country)?.seriesId;
|
|
317
|
-
|
|
343
|
+
const policy = POLICY_DECISION.test(event.event) ? policyRateNames(event.country) : [];
|
|
344
|
+
return [...[event.event, econEventName(event)].map(compactName), ...series ? statNamesOf(series) : [], ...policy];
|
|
318
345
|
}
|
|
319
346
|
|
|
347
|
+
/** A central bank's decision or fixing, under the titles the calendar gives them. */
|
|
348
|
+
const POLICY_DECISION = /interest rate decision|rate decision|loan prime rate|policy rate|cash rate|bank rate|funds rate|deposit facility rate|selic|repo rate|key rate/i;
|
|
349
|
+
|
|
350
|
+
/**
|
|
351
|
+
* The names people give a bank's policy rate and its committee, so `--search
|
|
352
|
+
* selic` finds the Copom's decision and `--search banxico` Banxico's: by the
|
|
353
|
+
* calendar's country, with the names every bank's decision answers to.
|
|
354
|
+
*/
|
|
355
|
+
const POLICY_RATE_NAMES: Readonly<Record<string, readonly string[]>> = {
|
|
356
|
+
US: ["fed funds", "federal funds", "FOMC", "Federal Reserve"],
|
|
357
|
+
EU: ["ECB", "deposit rate", "deposit facility", "refi rate"],
|
|
358
|
+
GB: ["Bank Rate", "BoE", "MPC"],
|
|
359
|
+
JP: ["BoJ", "Bank of Japan"],
|
|
360
|
+
CA: ["BoC", "overnight rate"],
|
|
361
|
+
AU: ["RBA", "cash rate"],
|
|
362
|
+
NZ: ["RBNZ", "OCR", "official cash rate"],
|
|
363
|
+
CH: ["SNB"],
|
|
364
|
+
CN: ["LPR", "loan prime rate", "PBoC"],
|
|
365
|
+
IN: ["RBI", "repo rate"],
|
|
366
|
+
ID: ["BI rate", "Bank Indonesia"],
|
|
367
|
+
KR: ["BoK", "base rate"],
|
|
368
|
+
BR: ["Selic", "Copom", "Banco Central do Brasil", "BCB"],
|
|
369
|
+
MX: ["Banxico", "Banco de Mexico", "tasa objetivo", "target rate"],
|
|
370
|
+
RU: ["key rate", "Bank of Russia", "CBR"],
|
|
371
|
+
TR: ["CBRT", "TCMB", "one-week repo"],
|
|
372
|
+
ZA: ["SARB", "repo rate"],
|
|
373
|
+
NO: ["Norges Bank", "sight deposit rate"],
|
|
374
|
+
SE: ["Riksbank"],
|
|
375
|
+
};
|
|
376
|
+
const ANY_POLICY_RATE = ["policy rate", "rate decision", "interest rate", "central bank", "monetary policy"];
|
|
377
|
+
|
|
378
|
+
function policyRateNames(country: string): string[] {
|
|
379
|
+
return [...POLICY_RATE_NAMES[country.toUpperCase()] ?? [], ...ANY_POLICY_RATE].map(compactName);
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
const nameWords = (text: string) => text.toLowerCase().split(/[^a-z0-9]+/).filter(Boolean);
|
|
383
|
+
/** Words of many banks' names that name none alone: "bank" is the BoE's, the BoJ's and three more. */
|
|
384
|
+
const SHARED_NAME_WORDS = new Set(["bank", "of", "de", "do", "rate", "central"]);
|
|
385
|
+
|
|
386
|
+
/**
|
|
387
|
+
* The decisions a search for a bank's own names means, for an empty answer to
|
|
388
|
+
* say: `selic` is Brazil's Copom decision. Every word of the query must be a
|
|
389
|
+
* whole word of one of the bank's names, or the name run together (`fedfunds`):
|
|
390
|
+
* `cbr` is the Bank of Russia's and not the CBRT's, and words many names share
|
|
391
|
+
* name none alone (`bank`, SHARED_NAME_WORDS). Only the
|
|
392
|
+
* banks of the countries the calendar lists (`countries`, as --country reads).
|
|
393
|
+
* Empty for a query no bank's names hold, and for the names every bank's
|
|
394
|
+
* decision answers to (a query of those already lists them).
|
|
395
|
+
*/
|
|
396
|
+
export function policyDecisionsNamed(query: string, countries: CountryFilter = "all"): Array<{ country: string; event: string }> {
|
|
397
|
+
const words = nameWords(query);
|
|
398
|
+
if (words.every((word) => SHARED_NAME_WORDS.has(word))) return [];
|
|
399
|
+
return Object.entries(POLICY_RATE_NAMES).flatMap(([country, names]) => {
|
|
400
|
+
const event = POLICY_DECISION_TITLES[country] ?? "Interest Rate Decision";
|
|
401
|
+
if (!matchesCountry({ country, event }, countries)) return [];
|
|
402
|
+
const named = names.some((name) => {
|
|
403
|
+
const parts = nameWords(name);
|
|
404
|
+
return words.every((word) => parts.includes(word) || word === compactName(name));
|
|
405
|
+
});
|
|
406
|
+
return named ? [{ country, event }] : [];
|
|
407
|
+
});
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
/** How the calendar titles each bank's decision (China's is its LPR fixing). */
|
|
411
|
+
const POLICY_DECISION_TITLES: Readonly<Record<string, string>> = {
|
|
412
|
+
US: "Fed Interest Rate Decision", EU: "ECB Interest Rate Decision", GB: "BoE Interest Rate Decision", JP: "BoJ Interest Rate Decision",
|
|
413
|
+
CA: "BoC Interest Rate Decision", AU: "RBA Interest Rate Decision", NZ: "RBNZ Interest Rate Decision", CH: "SNB Interest Rate Decision",
|
|
414
|
+
CN: "1-y Loan Prime Rate", IN: "RBI Interest Rate Decision", ID: "BI Interest Rate Decision", KR: "BoK Interest Rate Decision",
|
|
415
|
+
BR: "Copom Interest Rate Decision", MX: "Banxico Interest Rate Decision", RU: "Bank of Russia Interest Rate Decision",
|
|
416
|
+
TR: "CBRT Interest Rate Decision", ZA: "SARB Interest Rate Decision", NO: "Norges Bank Interest Rate Decision", SE: "Riksbank Interest Rate Decision",
|
|
417
|
+
};
|
|
418
|
+
|
|
320
419
|
/**
|
|
321
420
|
* Whether a row carries every word of `query` in one of its names or its
|
|
322
421
|
* publisher's, case, spaces and hyphens aside: `nonfarm` finds Non Farm
|
|
@@ -343,6 +442,11 @@ export function awaitsConsensus(event: Pick<EconEvent, "actual" | "forecast" | "
|
|
|
343
442
|
/** What a dash under Forecast means on a row still to come. */
|
|
344
443
|
export const NO_CONSENSUS_NOTE = `${MISSING_VALUE} forecast = no consensus yet`;
|
|
345
444
|
|
|
445
|
+
/** What the dash under Time means on a bank's decision whose calendar gives the day and not the time, from its note. */
|
|
446
|
+
export function noTimeNote(timeNote: string): string {
|
|
447
|
+
return `${MISSING_VALUE} time = ${timeNote.charAt(0).toLowerCase()}${timeNote.slice(1).replace(/\.$/, "")}`;
|
|
448
|
+
}
|
|
449
|
+
|
|
346
450
|
/** A national euro-area release matches EU (and G7, as EU) and its own member's code. */
|
|
347
451
|
export function matchesCountry(event: Pick<EconEvent, "country" | "event">, filter: CountryFilter): boolean {
|
|
348
452
|
const member = euroAreaMember(event);
|
|
@@ -409,10 +513,13 @@ export function countriesWithoutEvents(filter: CountryFilter, events: ReadonlyAr
|
|
|
409
513
|
return filterCountries(filter).filter((country) => !listed.has(country));
|
|
410
514
|
}
|
|
411
515
|
|
|
412
|
-
/**
|
|
413
|
-
|
|
516
|
+
/**
|
|
517
|
+
* "No scheduled releases for MX in this window", or for MX or ZA; with the
|
|
518
|
+
* day the listing ends, where it does ("; releases are listed through 2026-11-20").
|
|
519
|
+
*/
|
|
520
|
+
export function noScheduledReleasesMessage(countries: readonly string[], listedThrough?: string | null): string {
|
|
414
521
|
const named = countries.length > 1 ? `${countries.slice(0, -1).join(", ")} or ${countries.at(-1)}` : countries.join("");
|
|
415
|
-
return `No scheduled releases for ${named} in this window.`;
|
|
522
|
+
return `No scheduled releases for ${named} in this window${listedThrough ? `; releases are listed through ${listedThrough}` : ""}.`;
|
|
416
523
|
}
|
|
417
524
|
|
|
418
525
|
/**
|
|
@@ -22,6 +22,8 @@ export type EconCalendarFrom =
|
|
|
22
22
|
events: EconEvent[];
|
|
23
23
|
/** The first UTC day the stored calendar holds; null when it holds nothing. */
|
|
24
24
|
storedFrom: string | null;
|
|
25
|
+
/** The last UTC day the calendar lists releases for; null from a server that does not say. */
|
|
26
|
+
listedThrough: string | null;
|
|
25
27
|
}
|
|
26
28
|
| {
|
|
27
29
|
events: null;
|
|
@@ -42,7 +44,11 @@ export async function fetchEconCalendarFrom(from: string): Promise<EconCalendarF
|
|
|
42
44
|
if (!payload || !Array.isArray(payload.events) || !(payload.storedFrom === null || /^\d{4}-\d{2}-\d{2}$/.test(String(payload.storedFrom)))) {
|
|
43
45
|
return { events: null, failure: "the server returned an unreadable calendar" };
|
|
44
46
|
}
|
|
45
|
-
return {
|
|
47
|
+
return {
|
|
48
|
+
events: withPercentUnits(payload.events.map(toEconEvent)),
|
|
49
|
+
storedFrom: payload.storedFrom,
|
|
50
|
+
listedThrough: typeof payload.listedThrough === "string" && /^\d{4}-\d{2}-\d{2}$/.test(payload.listedThrough) ? payload.listedThrough : null,
|
|
51
|
+
};
|
|
46
52
|
} catch (error) {
|
|
47
53
|
if (error instanceof ApiRequestError && error.status === 404) return { events: null, failure: null };
|
|
48
54
|
if (isPermanentClientError(error)) throw error;
|
|
@@ -184,11 +184,13 @@ const GROUPS: ReadonlyArray<{ group: string; rows: readonly FredRow[] }> = [
|
|
|
184
184
|
],
|
|
185
185
|
},
|
|
186
186
|
{
|
|
187
|
-
// The IMF's monthly world prices: the closest public series to LME copper and aluminium, which FUT does not list
|
|
187
|
+
// The IMF's monthly world prices: the closest public series to LME copper and aluminium, which FUT does not list,
|
|
188
|
+
// and to iron ore, whose futures are licensed.
|
|
188
189
|
group: "Commodities",
|
|
189
190
|
rows: [
|
|
190
191
|
["PCOPPUSDM", "Global price of copper", "USD/ton", "monthly", ["copper", "metals", "LME"]],
|
|
191
192
|
["PALUMUSDM", "Global price of aluminum", "USD/ton", "monthly", ["aluminum", "aluminium", "metals", "LME"]],
|
|
193
|
+
["PIORECRUSDM", "Global price of iron ore (dry metric ton)", "USD/ton", "monthly", ["iron ore", "iron", "steel", "metals"]],
|
|
192
194
|
],
|
|
193
195
|
},
|
|
194
196
|
{
|
|
@@ -39,7 +39,6 @@ import {
|
|
|
39
39
|
awaitsConsensus,
|
|
40
40
|
calendarDisplayRows,
|
|
41
41
|
CALENDAR_TIME_ZONE_LABEL,
|
|
42
|
-
dateKey,
|
|
43
42
|
dayLabel,
|
|
44
43
|
econEventName,
|
|
45
44
|
filteredEmptyTitle,
|
|
@@ -54,7 +53,10 @@ import {
|
|
|
54
53
|
matchesImpact,
|
|
55
54
|
NO_CONSENSUS_NOTE,
|
|
56
55
|
noScheduledReleasesMessage,
|
|
56
|
+
noTimeNote as noTimeNoteText,
|
|
57
57
|
parseCountryFilter,
|
|
58
|
+
listingEnd,
|
|
59
|
+
pastReleaseListing,
|
|
58
60
|
resetEconCalendarPersistence,
|
|
59
61
|
shortCalendarEnd,
|
|
60
62
|
shortDayLabel,
|
|
@@ -67,6 +69,7 @@ import {
|
|
|
67
69
|
type ImpactFilter,
|
|
68
70
|
} from "./calendar-model";
|
|
69
71
|
import { figureWithCurrency } from "./figures";
|
|
72
|
+
import { MISSING_VALUE } from "../../../utils/format";
|
|
70
73
|
import { usePaneStatusFooter } from "../../../components/layout/pane/status-footer";
|
|
71
74
|
import { handleRefreshKey } from "../../../components/data-table/table-pane";
|
|
72
75
|
import { tableColumnWidth } from "../../../components/ui/table-layout";
|
|
@@ -80,6 +83,8 @@ const IMPACT_LABELS: Record<ImpactFilter, string> = {
|
|
|
80
83
|
};
|
|
81
84
|
|
|
82
85
|
const NO_EVENTS: EconEvent[] = [];
|
|
86
|
+
/** The start (UTC) of a YYYY-MM-DD day, to label it. */
|
|
87
|
+
const dayStart = (day: string) => new Date(`${day}T00:00:00Z`);
|
|
83
88
|
const SPELLED_IMPACT = "IMPACT";
|
|
84
89
|
const SPELLED_COUNTRY = "COUNTRY";
|
|
85
90
|
/** Event names this wide still read; past it the headers spell themselves out. */
|
|
@@ -163,7 +168,11 @@ function EconCalendarPane({ focused, width, height }: PaneProps) {
|
|
|
163
168
|
const todayStart = Math.floor(now / 86_400_000) * 86_400_000;
|
|
164
169
|
// A calendar that stops short of a week ahead says where it stops.
|
|
165
170
|
const listedEnd = shortCalendarEnd(events, todayStart);
|
|
166
|
-
const listedAfter = listedEnd ? `No events listed after ${shortDayLabel(listedEnd)}` : null;
|
|
171
|
+
const listedAfter = listedEnd ? `No events listed after ${shortDayLabel(dayStart(listedEnd))}` : null;
|
|
172
|
+
// Past the listing's end Gloom Cloud lists each central bank's next decision: where the rows shown run past it, the
|
|
173
|
+
// footer says where the releases end, as the CLI does under its table.
|
|
174
|
+
const releasesThrough = useMemo(() => listingEnd(events), [events]);
|
|
175
|
+
const showsPastListing = filtered.some(pastReleaseListing);
|
|
167
176
|
|
|
168
177
|
// Map from eventIdx to flat row index (for scroll tracking)
|
|
169
178
|
const eventIdxToRowIdx = new Map<number, number>();
|
|
@@ -309,7 +318,8 @@ function EconCalendarPane({ focused, width, height }: PaneProps) {
|
|
|
309
318
|
// Countries named one by one with nothing in the calendar: a quiet window there, said plainly.
|
|
310
319
|
const unscheduled = useMemo(() => countriesWithoutEvents(countryFilter, events), [countryFilter, events]);
|
|
311
320
|
const filterEmptyTitle = events.length === 0 ? null
|
|
312
|
-
: unscheduled.length > 0 && unscheduled.length === countryFilter.split(",").length
|
|
321
|
+
: unscheduled.length > 0 && unscheduled.length === countryFilter.split(",").length
|
|
322
|
+
? noScheduledReleasesMessage(unscheduled, releasesThrough ? shortDayLabel(dayStart(releasesThrough)) : null).replace(/\.$/, "")
|
|
313
323
|
: filteredEmptyTitle(impactFilter, countryFilter);
|
|
314
324
|
const emptyStateHint = !loading && !error
|
|
315
325
|
? [
|
|
@@ -338,6 +348,10 @@ function EconCalendarPane({ focused, width, height }: PaneProps) {
|
|
|
338
348
|
// The dash under Forecast on the row in hand, while its consensus is not in yet.
|
|
339
349
|
const focusedEvent = detailEvent ?? filtered[selectedIdx];
|
|
340
350
|
const noConsensus = !!focusedEvent && awaitsConsensus(focusedEvent);
|
|
351
|
+
// The blank time on the row in hand, with why: a bank whose calendar gives the day and not the time.
|
|
352
|
+
const noTimeNote = focusedEvent && hasNoStatedTime(focusedEvent) ? noTimeNoteText(focusedEvent.timeNote!) : null;
|
|
353
|
+
const pastListingStatus = showsPastListing && releasesThrough && !detailEvent && !listedAfterStatus
|
|
354
|
+
? `releases listed through ${shortDayLabel(dayStart(releasesThrough))}, then each bank's next decision` : null;
|
|
341
355
|
const calendarStatus = useMemo<PaneFooterSegment[]>(() => [
|
|
342
356
|
...(hiddenStatus ? [{
|
|
343
357
|
id: "hidden-impact",
|
|
@@ -348,19 +362,33 @@ function EconCalendarPane({ focused, width, height }: PaneProps) {
|
|
|
348
362
|
}] : []),
|
|
349
363
|
...(nextText && !detailEvent ? [{ id: "next", parts: [{ text: nextText, tone: "muted" as const }] }] : []),
|
|
350
364
|
...(listedAfterStatus ? [{ id: "listed-after", parts: [{ text: listedAfterStatus, tone: "warning" as const }] }] : []),
|
|
365
|
+
...(pastListingStatus ? [{ id: "listed-through", parts: [{ text: pastListingStatus, tone: "muted" as const }],
|
|
366
|
+
variants: [[{ text: `releases through ${shortDayLabel(dayStart(releasesThrough!))}`, tone: "muted" as const }]] }] : []),
|
|
351
367
|
...(showStale ? [{ id: "stale", parts: [{ text: "STALE", tone: "warning" as const }] }] : []),
|
|
352
368
|
// Behind the warnings, so a narrow footer gives it up before them, and ahead of the update time, which goes first.
|
|
369
|
+
// The blank time first: of the row in hand's notes it is the one the row cannot say itself.
|
|
370
|
+
...(noTimeNote ? [{ id: "no-time", parts: [{ text: noTimeNote, tone: "muted" as const }],
|
|
371
|
+
variants: [[{ text: "no time stated", tone: "muted" as const }]] }] : []),
|
|
353
372
|
...(noConsensus ? [{ id: "no-consensus", parts: [{ text: NO_CONSENSUS_NOTE, tone: "muted" as const }],
|
|
354
373
|
variants: [[{ text: "no consensus yet", tone: "muted" as const }]] }] : []),
|
|
355
374
|
...(staleness ? [{ id: "updated", parts: [{ text: staleness, tone: "muted" as const }] }] : []),
|
|
356
|
-
], [allImpactKey, detailEvent, hiddenStatus, listedAfterStatus, nextText, noConsensus, showStale, staleness]);
|
|
375
|
+
], [allImpactKey, detailEvent, hiddenStatus, listedAfterStatus, nextText, noConsensus, noTimeNote, pastListingStatus, releasesThrough, showStale, staleness]);
|
|
357
376
|
// A report of the pane (`gloom fn ECO`) says it too.
|
|
358
|
-
const listedThrough = listedEnd
|
|
377
|
+
const listedThrough = listedEnd;
|
|
359
378
|
useRemoteUiNode(listedAfter && listedThrough ? {
|
|
360
379
|
role: "report-notice",
|
|
361
380
|
label: "Listed through",
|
|
362
381
|
getMetadata: () => ({ text: listedAfter, key: "listedThrough", value: listedThrough }),
|
|
363
382
|
} : null);
|
|
383
|
+
useRemoteUiNode(pastListingStatus && releasesThrough ? {
|
|
384
|
+
role: "report-notice",
|
|
385
|
+
label: "Releases listed through",
|
|
386
|
+
getMetadata: () => ({
|
|
387
|
+
text: `No releases listed after ${releasesThrough}; the rows after it are each central bank's next decision.`,
|
|
388
|
+
key: "releasesListedThrough",
|
|
389
|
+
value: releasesThrough,
|
|
390
|
+
}),
|
|
391
|
+
} : null);
|
|
364
392
|
useRemoteUiNode(hiddenCount > 0 ? {
|
|
365
393
|
role: "report-notice",
|
|
366
394
|
label: "Lower-impact hidden",
|
|
@@ -424,10 +452,15 @@ function EconCalendarPane({ focused, width, height }: PaneProps) {
|
|
|
424
452
|
const ev = row.event;
|
|
425
453
|
switch (column.id) {
|
|
426
454
|
case "time":
|
|
427
|
-
// A bank that states no time has
|
|
428
|
-
|
|
455
|
+
// A bank that states no time has a dash here, and the footer and its detail say why; an all-day event (a plenum,
|
|
456
|
+
// an election) says so.
|
|
457
|
+
return { text: hasNoStatedTime(ev) ? MISSING_VALUE : isAllDayEvent(ev) ? "All day" : timeLabel(ev.date), color: colors.textMuted };
|
|
429
458
|
case "readerTime":
|
|
430
|
-
|
|
459
|
+
// The reader's clock has no time to give a bank that states none: the same dash as its time.
|
|
460
|
+
return {
|
|
461
|
+
text: !readerZone ? "" : hasNoStatedTime(ev) ? MISSING_VALUE : hasNoReleaseTime(ev) ? "" : zonedClock(ev.date.getTime(), readerZone).label,
|
|
462
|
+
color: colors.textMuted,
|
|
463
|
+
};
|
|
431
464
|
case "impact": {
|
|
432
465
|
const indicator = impactIndicator(ev.impact);
|
|
433
466
|
return {
|
|
@@ -544,6 +577,7 @@ export const economicCalendarModule: PluginModule = {
|
|
|
544
577
|
id: "econ-calendar",
|
|
545
578
|
reportFreshness: { status: "not-a-feed", basis: "calendar" },
|
|
546
579
|
name: "Economic Calendar",
|
|
580
|
+
shareItem: { argument: true },
|
|
547
581
|
icon: "E",
|
|
548
582
|
component: EconCalendarPane,
|
|
549
583
|
defaultPosition: "right",
|
|
@@ -36,6 +36,9 @@ export interface EconEvent {
|
|
|
36
36
|
indicatorId?: string | null;
|
|
37
37
|
/** Which feed the forecast was read from (`week-feed`, `release-calendar`) and when that feed was read. */
|
|
38
38
|
consensus?: { source: string; readAt: string } | null;
|
|
39
|
+
/** A central bank's next decision Gloom Cloud lists past the end of the listing, which ends on `listedThrough` (UTC). */
|
|
40
|
+
pastListing?: boolean;
|
|
41
|
+
listedThrough?: string;
|
|
39
42
|
}
|
|
40
43
|
|
|
41
44
|
/** Whether a row's time is blank because its publisher states none (a bank whose calendar gives the day only). */
|
|
@@ -12,6 +12,7 @@ export const econStatisticsModule: PluginModule = {
|
|
|
12
12
|
id: ECON_STATISTICS_PANE_ID,
|
|
13
13
|
name: "Economic Statistics",
|
|
14
14
|
icon: "E",
|
|
15
|
+
shareItem: { open: true, argument: true },
|
|
15
16
|
get component(): typeof import("./pane").EconStatisticsPane { const { EconStatisticsPane } = require("./pane"); return EconStatisticsPane; },
|
|
16
17
|
defaultPosition: "right",
|
|
17
18
|
defaultMode: "floating",
|
|
@@ -88,6 +88,11 @@ function buildColumns(width: number, stacked: boolean): Column[] {
|
|
|
88
88
|
];
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
+
/** A link to the pane names the statistic its chart shows, with its latest print. */
|
|
92
|
+
function statShareItem(view: StatViewModel) {
|
|
93
|
+
return { title: view.stat.label, excerpt: [view.stat.formatValue(view.latest.value), view.period].filter(Boolean).join(" · ") };
|
|
94
|
+
}
|
|
95
|
+
|
|
91
96
|
/**
|
|
92
97
|
* The previous print rather than the difference. For a statistic that is already a
|
|
93
98
|
* change, like payrolls, a delta would be a second derivative and mean very little.
|
|
@@ -142,6 +147,7 @@ export function EconStatisticsPane({ focused, width, height }: PaneProps) {
|
|
|
142
147
|
onSelect: setStatId,
|
|
143
148
|
reload,
|
|
144
149
|
range: { value: range, options: RANGE_OPTIONS, onChange: setRange, chartRange: true },
|
|
150
|
+
shareItem: statShareItem,
|
|
145
151
|
});
|
|
146
152
|
const { selected, searchFocused } = list;
|
|
147
153
|
const rows = useMemo(() => withCategoryHeaders(list.visible), [list.visible]);
|
|
@@ -13,6 +13,7 @@ export const estimateRevisionsModule: PluginModule = {
|
|
|
13
13
|
icon: "E",
|
|
14
14
|
get component(): typeof import("./pane").EstimateRevisionsPane { const { EstimateRevisionsPane } = require("./pane"); return EstimateRevisionsPane; },
|
|
15
15
|
defaultPosition: "right",
|
|
16
|
+
shareItem: { ticker: true },
|
|
16
17
|
tickerFollower: true,
|
|
17
18
|
instruments: ["equity"],
|
|
18
19
|
defaultMode: "floating",
|
|
@@ -11,6 +11,7 @@ export const fixedIncomeModule: PluginModule = {
|
|
|
11
11
|
defaultPosition: "right",
|
|
12
12
|
defaultMode: "floating",
|
|
13
13
|
defaultFloatingSize: { width: 116, height: 32 },
|
|
14
|
+
shareItem: { ticker: true },
|
|
14
15
|
tickerFollower: true,
|
|
15
16
|
tableExport: true,
|
|
16
17
|
settings: {
|
|
@@ -24,6 +25,8 @@ export const fixedIncomeModule: PluginModule = {
|
|
|
24
25
|
{ value: "all", label: "All" },
|
|
25
26
|
{ value: "us", label: "US" },
|
|
26
27
|
{ value: "euro", label: "Euro" },
|
|
28
|
+
{ value: "em", label: "Emerging markets" },
|
|
29
|
+
{ value: "asia", label: "Asia" },
|
|
27
30
|
],
|
|
28
31
|
},
|
|
29
32
|
...treasuryAuctionsSettings().fields,
|
|
@@ -5,7 +5,7 @@ import { formatPercentRaw } from "../../../utils/format";
|
|
|
5
5
|
import { DATE_OPTION_EXAMPLES } from "../../../utils/calendar-date";
|
|
6
6
|
import { newestReportTime, oldestReportTime } from "../../../utils/utc-time";
|
|
7
7
|
import { fetchFuturesCurve, loadCurveSpot, loadCurveSpotBars, loadCurveSpotCloses, loadFuturesCurveAsOf } from "./client";
|
|
8
|
-
import { basisSpotSymbol, BASIS_CONVENTION, blankBasisNote, catalogueCurveUnit, curveAsOfDate, curveCache, curveSpotBars, curveBasisPercent, curveBasisRows, curveChangeText, curveContractCode, curvePrice, curveReadsThirtySeconds, curveRoundedPrice, curveSpotSource, curveSpotPremium, curveSpreadLabel, curveTimestamp, curveNoTradeSince, curveSettleShown, curveUnitLabel, noTradeChangeNote, normalizeCurveRoot, shortDatedBasisNote, skippedSpreadNotice, spotIndexSymbol, thinSpreadNotice, unpairedContractCount, unsupportedCurveRootMessage, type ContractBasis, type CurveSpotPremium } from "./model";
|
|
8
|
+
import { basisSpotSymbol, BASIS_CONVENTION, blankBasisNote, catalogueCurveUnit, curveAsOfDate, curveCache, curveSpotBars, curveBasisPercent, curveBasisRows, curveChangeText, curveContractCode, curvePrice, curveReadsThirtySeconds, curveRoundedPrice, curveSpotSource, curveSpotPremium, curveSpreadLabel, curveTimestamp, curveNoTradeSince, curveSettleShown, curveUnitLabel, curveRootNamed, noTradeChangeNote, normalizeCurveRoot, shortDatedBasisNote, skippedSpreadNotice, spotIndexSymbol, thinSpreadNotice, unpairedContractCount, unsupportedCurveRootMessage, type ContractBasis, type CurveSpotPremium } from "./model";
|
|
9
9
|
import { COMMODITIES_VIEW_STATE } from "../commodities-energy/view-state";
|
|
10
10
|
import { knownGapMessage } from "../../../cli/known-gaps";
|
|
11
11
|
|
|
@@ -171,7 +171,7 @@ export const futuresCurveHeadless: HeadlessPaneDefinition<"bundle"> = {
|
|
|
171
171
|
"Ann Basis is simple actual/365, each last trade against spot in the same minute, and noisy under 7 days to expiry."],
|
|
172
172
|
intents: ["futures basis trade", "cash and carry", "basis against spot"],
|
|
173
173
|
opens: [{ words: ["VX", "vix futures", "vix futures curve"], argument: "VIX" }] },
|
|
174
|
-
shape: "bundle", argument: { kind: "free-text", optional: true, placeholder: "root", description: "FUT root such as CL, ES, ZN or VX,
|
|
174
|
+
shape: "bundle", argument: { kind: "free-text", optional: true, placeholder: "root", description: "FUT root such as CL, ES, ZN or VX, a CME crypto root (BTC, ETH, SOL, XRP), or a root's name (gold, natural gas, crude oil). Defaults to ES.",
|
|
175
175
|
examples: ["VIX", "CL", "BTC"] },
|
|
176
176
|
// Only the pane reads the tab; the report always carries both.
|
|
177
177
|
options: [{ key: "tab", description: "Curve or the full contract table.", type: "enum",
|
|
@@ -181,7 +181,7 @@ export const futuresCurveHeadless: HeadlessPaneDefinition<"bundle"> = {
|
|
|
181
181
|
describe: (args) => `Futures curve ${args.argument || DEFAULT_ROOT}`,
|
|
182
182
|
async load(args, ctx) {
|
|
183
183
|
const input = args.argument || DEFAULT_ROOT;
|
|
184
|
-
const root = normalizeCurveRoot(input);
|
|
184
|
+
const root = normalizeCurveRoot(input) ?? curveRootNamed(input);
|
|
185
185
|
if (!root) {
|
|
186
186
|
// A subject no source carries (`fn CTM BDI`, the Baltic Dry Index) is said with its proxies, as search says it.
|
|
187
187
|
const gap = typeof input === "string" ? knownGapMessage(input) : null;
|
|
@@ -4,7 +4,7 @@ import { futuresCurveHeadless } from "./headless";
|
|
|
4
4
|
import { BASIS_FORMULA, CURVE_HORIZONS, CURVE_ROOTS, curveRootForTicker, curveTitle, DEFAULT_CURVE_HORIZON, normalizeCurveRoot } from "./model";
|
|
5
5
|
|
|
6
6
|
export const futuresCurveModule: PluginModule = {
|
|
7
|
-
panes: [{ id: "futures-curve", name: "Futures Curve", icon: "F", get component(): typeof import("./pane").FuturesCurvePane { const { FuturesCurvePane } = require("./pane"); return FuturesCurvePane; },
|
|
7
|
+
panes: [{ id: "futures-curve", name: "Futures Curve", icon: "F", shareItem: { argument: true }, get component(): typeof import("./pane").FuturesCurvePane { const { FuturesCurvePane } = require("./pane"); return FuturesCurvePane; },
|
|
8
8
|
defaultPosition: "right", defaultMode: "floating", defaultFloatingSize: { width: 98, height: 30 },
|
|
9
9
|
tableExport: true, headless: futuresCurveHeadless,
|
|
10
10
|
settings: (context) => ({ title: "Futures Curve Settings",
|
|
@@ -32,6 +32,24 @@ export function normalizeCurveRoot(value: unknown): string | null {
|
|
|
32
32
|
return CURVE_ROOTS.some((row) => row.value === root) ? root : null;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
+
/** What a commodity is called rather than coded: the WTI and Brent crude curves by the words they are asked for in. */
|
|
36
|
+
const CURVE_ROOT_WORDS: Readonly<Record<string, string>> = { "CRUDE": "CL", "CRUDE OIL": "CL", "OIL": "CL", "WTI": "CL", "BRENT": "BZ" };
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* A root named in words, as a typed argument or a question asks for it
|
|
40
|
+
* ("gold", "Natural Gas futures", "crude oil"): a listed root's name, or a
|
|
41
|
+
* crude benchmark's. Not for the ticker under the cursor, where GOLD is a
|
|
42
|
+
* security, so only CTM's typed argument reads it.
|
|
43
|
+
*/
|
|
44
|
+
export function curveRootNamed(value: unknown): string | null {
|
|
45
|
+
if (typeof value !== "string") return null;
|
|
46
|
+
const words = value.trim().toUpperCase().replace(/\s+/g, " ").replace(/( (FUTURES?|CURVE))+$/, "");
|
|
47
|
+
if (!words) return null;
|
|
48
|
+
return CURVE_ROOT_WORDS[words]
|
|
49
|
+
?? CURVE_ROOTS.find((row) => row.label.toUpperCase() === `${row.value} ${words}`)?.value
|
|
50
|
+
?? null;
|
|
51
|
+
}
|
|
52
|
+
|
|
35
53
|
/**
|
|
36
54
|
* A curve's window title, its root ("Curve · BZ"), so two curves open at once
|
|
37
55
|
* are told apart in their windows and in the layout list.
|