gloomberb 0.20.3 → 0.20.5
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 +2 -0
- package/bin/gloom +9 -0
- package/bin/without-bun.cjs +98 -0
- package/package.json +3 -1
- package/src/account/auth-dialog.tsx +17 -0
- package/src/api-client/data.ts +144 -35
- package/src/api-client/fx-interventions.ts +64 -0
- package/src/api-client/index.ts +1 -0
- package/src/api-client/release-summaries.ts +21 -0
- package/src/api-client/types/econ.ts +12 -0
- package/src/api-client/yield-curves.ts +1 -1
- package/src/app/global-shortcuts.ts +4 -1
- package/src/app/keybindings/actions.ts +8 -2
- 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 +274 -67
- 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 +154 -21
- package/src/cli/commands/news-search.ts +60 -10
- package/src/cli/commands/overview.ts +16 -1
- package/src/cli/commands/plugins.ts +27 -5
- package/src/cli/commands/remote.ts +16 -17
- package/src/cli/commands/system.ts +20 -4
- package/src/cli/commands/ticker.ts +60 -19
- package/src/cli/fx-forward.ts +25 -7
- package/src/cli/glossary.ts +19 -5
- package/src/cli/history-rows.ts +5 -3
- package/src/cli/index.ts +8 -8
- package/src/cli/known-gaps.ts +27 -1
- package/src/cli/listing-arg.ts +11 -1
- package/src/cli/name-entries.ts +5 -1
- package/src/cli/not-a-ticker.ts +4 -0
- package/src/cli/pane-functions/function-help.ts +5 -5
- package/src/cli/report-tables.ts +18 -6
- package/src/cli/result.ts +15 -7
- package/src/cli/types.ts +2 -0
- package/src/components/chart/composite/axis-overlays.tsx +22 -0
- package/src/components/chart/composite/composite-chart.tsx +54 -13
- package/src/components/chart/composite/event-captions.ts +109 -0
- package/src/components/chart/composite/event-guides.ts +74 -0
- package/src/components/chart/composite/rasterizer.ts +2 -0
- package/src/components/chart/composite/text-renderer.ts +2 -0
- package/src/components/chart/composite/types.ts +31 -0
- package/src/components/command-bar/layout-items/focused-pane.ts +5 -5
- package/src/components/command-bar/pane-settings.ts +2 -2
- package/src/components/command-bar/routes/root/provider-search.ts +5 -4
- package/src/components/command-bar/routes/root/results.ts +6 -2
- package/src/components/command-bar/routes/ticker-search/results.ts +51 -0
- package/src/components/command-bar/routes/ticker-search/route.ts +3 -2
- package/src/components/input-search-bar.tsx +9 -2
- package/src/components/layout/detached-pane-shell.tsx +1 -1
- package/src/components/layout/floating-pane.tsx +5 -1
- package/src/components/layout/pane/footer/index.tsx +21 -14
- package/src/components/layout/pane/footer/model.ts +6 -0
- package/src/components/layout/pane/header.tsx +2 -0
- package/src/components/layout/shell/action-menu-overlay.tsx +10 -5
- package/src/components/layout/shell/active-drag.ts +149 -105
- package/src/components/layout/shell/drag/drop-zones.ts +162 -0
- package/src/components/layout/shell/drag/index.ts +47 -218
- package/src/components/layout/shell/drag/live.ts +10 -3
- package/src/components/layout/shell/drag/overlays.tsx +182 -5
- package/src/components/layout/shell/drag/runtime.ts +29 -6
- package/src/components/layout/shell/drag/shared-edges.ts +156 -0
- package/src/components/layout/shell/index.tsx +11 -6
- package/src/components/layout/shell/menu.ts +11 -2
- package/src/components/layout/shell/native/pointer-runtime.ts +25 -0
- package/src/components/layout/shell/native/window-state.ts +2 -2
- package/src/components/layout/shell/pane/capture.ts +4 -1
- package/src/components/layout/shell/pane/layers.tsx +71 -7
- package/src/components/layout/shell/terminal-pointer-runtime.ts +18 -9
- package/src/components/layout/shell/window-mode/index.ts +8 -10
- package/src/components/layout/status-bar.tsx +6 -1
- package/src/components/layout/window-edit/mode.ts +39 -7
- package/src/components/layout/window-edit/presentation.ts +1 -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 +20 -0
- package/src/components/onboarding/onboarding-wizard.tsx +16 -11
- 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/button.tsx +2 -0
- package/src/components/ui/choice-dialog.tsx +1 -0
- package/src/components/ui/data-table/index.tsx +4 -3
- package/src/components/ui/index.ts +1 -1
- package/src/components/ui/list-view.tsx +7 -12
- package/src/components/ui/loading.tsx +10 -3
- package/src/components/ui/menu.tsx +6 -2
- 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/quote.ts +14 -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/data/config/layout.ts +5 -2
- package/src/docs/snapshot.json +54 -13
- package/src/i18n/es.ts +9 -8
- package/src/i18n/ja.ts +9 -8
- package/src/i18n/ko.ts +9 -8
- package/src/i18n/zh-cn.ts +9 -8
- package/src/i18n/zh-tw.ts +9 -8
- package/src/layout/pane-manager/floating-actions.ts +17 -0
- package/src/layout/pane-manager/floating-stack.ts +187 -0
- package/src/layout/pane-manager/floating.ts +4 -2
- package/src/layout/pane-manager/gridlock.ts +5 -1
- package/src/layout/pane-manager/index.ts +11 -0
- package/src/layout/pane-manager/layout-state.ts +10 -3
- package/src/market-data/depositary-pair.ts +5 -3
- package/src/market-data/futures-board.ts +46 -1
- package/src/market-data/futures-contract.ts +12 -3
- package/src/market-data/fx-interventions.ts +270 -0
- package/src/market-data/market/dated-previous-close.ts +94 -15
- package/src/market-data/market/status.ts +17 -1
- package/src/news/news-model.ts +44 -2
- package/src/plugins/builtin/alerts/cli.ts +4 -4
- package/src/plugins/builtin/alerts/format.ts +1 -2
- package/src/plugins/builtin/alerts/headless.ts +1 -2
- package/src/plugins/builtin/alerts/move-checks.ts +12 -6
- package/src/plugins/builtin/alerts/move.ts +30 -9
- package/src/plugins/builtin/alerts/pane.tsx +0 -2
- package/src/plugins/builtin/alerts/storage.ts +4 -2
- package/src/plugins/builtin/alerts/types.ts +12 -0
- 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/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/changelog/index.tsx +292 -101
- package/src/plugins/builtin/changelog/versions.ts +293 -0
- package/src/plugins/builtin/chart-composer/headless.ts +2 -1
- package/src/plugins/builtin/chart-composer/index.tsx +1 -0
- package/src/plugins/builtin/chart-composer/intervention-events.ts +105 -0
- package/src/plugins/builtin/chart-composer/pane.tsx +21 -7
- package/src/plugins/builtin/chat/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/render-state.ts +2 -5
- 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/attached-pane.tsx +10 -5
- package/src/plugins/builtin/cloud/askg/controller.ts +141 -5
- package/src/plugins/builtin/cloud/askg/executor.ts +113 -4
- package/src/plugins/builtin/cloud/askg/manifest.ts +28 -13
- package/src/plugins/builtin/cloud/askg/model.ts +14 -4
- package/src/plugins/builtin/cloud/askg/pane.tsx +70 -46
- package/src/plugins/builtin/cloud/askg/tool-display.ts +1 -0
- package/src/plugins/builtin/cloud/askg/turn-parts.tsx +70 -0
- package/src/plugins/builtin/cloud/terminal-relay/engine.ts +50 -130
- package/src/plugins/builtin/cloud/terminal-relay/policy.ts +327 -7
- package/src/plugins/builtin/cloud/terminal-relay/prompts.tsx +2 -1
- package/src/plugins/builtin/cloud/terminal-relay/redact.ts +52 -9
- package/src/plugins/builtin/commodities-energy/index.tsx +1 -3
- package/src/plugins/builtin/commodities-energy/view-state.ts +3 -0
- package/src/plugins/builtin/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/headless.ts +14 -2
- package/src/plugins/builtin/cot/index.tsx +1 -1
- package/src/plugins/builtin/cpi/index.tsx +1 -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/index.tsx +2 -2
- 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 +74 -1
- package/src/plugins/builtin/econ/fred-catalog.ts +3 -1
- package/src/plugins/builtin/econ/index.tsx +1 -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 +1 -0
- package/src/plugins/builtin/futures/index.tsx +25 -4
- package/src/plugins/builtin/futures/model.ts +28 -32
- package/src/plugins/builtin/futures/series.ts +4 -3
- package/src/plugins/builtin/futures/table.tsx +16 -9
- package/src/plugins/builtin/futures/use-board-terms.ts +3 -3
- 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/gpu/index.tsx +1 -1
- package/src/plugins/builtin/help/functions-table.tsx +1 -1
- package/src/plugins/builtin/help/index.tsx +14 -4
- package/src/plugins/builtin/help/keybindings-editor.tsx +19 -5
- 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/layout-manager/index.tsx +8 -8
- 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/headless.ts +2 -2
- package/src/plugins/builtin/news/index.tsx +4 -3
- 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/perps/markets-section.tsx +5 -2
- package/src/plugins/builtin/plugin-marketplace/pane.tsx +11 -11
- package/src/plugins/builtin/portfolio-list/cli/portfolio-command.ts +25 -0
- package/src/plugins/builtin/portfolio-list/headless.ts +15 -6
- package/src/plugins/builtin/portfolio-list/summary/index.tsx +3 -1
- package/src/plugins/builtin/power/index.tsx +1 -1
- package/src/plugins/builtin/realized-vol/index.tsx +1 -1
- package/src/plugins/builtin/research/event-model.ts +9 -1
- package/src/plugins/builtin/research/event-sources.ts +22 -0
- package/src/plugins/builtin/research/headless.ts +11 -5
- package/src/plugins/builtin/research/index.tsx +4 -0
- 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/cloud-upgrade.ts +27 -3
- 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/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/financials/model.ts +12 -0
- package/src/plugins/builtin/ticker-detail/financials/ratio-table.tsx +3 -3
- package/src/plugins/builtin/ticker-detail/financials/tab.tsx +5 -5
- package/src/plugins/builtin/ticker-detail/headless.ts +18 -13
- package/src/plugins/builtin/ticker-detail/index.tsx +4 -0
- package/src/plugins/builtin/ticker-detail/overview/components.tsx +54 -5
- package/src/plugins/builtin/ticker-detail/overview/model.ts +6 -4
- package/src/plugins/builtin/ticker-detail/overview-tab.tsx +34 -17
- package/src/plugins/builtin/ticker-detail/pane.tsx +7 -2
- 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 +18 -3
- package/src/plugins/builtin/treasury-auctions/client.ts +33 -2
- package/src/plugins/builtin/treasury-auctions/headless.ts +109 -19
- package/src/plugins/builtin/treasury-auctions/index.tsx +14 -4
- package/src/plugins/builtin/treasury-auctions/model.ts +256 -28
- package/src/plugins/builtin/treasury-auctions/pane.tsx +139 -28
- 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/plugins/installer.ts +45 -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 +56 -19
- package/src/remote/schema.ts +22 -9
- package/src/remote/secrets.ts +12 -0
- package/src/remote/semantic-helpers.ts +29 -1
- package/src/remote/semantic-tree.tsx +44 -15
- package/src/remote/server.ts +2 -1
- package/src/remote/surface.tsx +192 -0
- package/src/remote/types.ts +5 -0
- package/src/renderers/cloudflare/worker.ts +16 -1
- package/src/renderers/dom/styles.css +40 -6
- package/src/renderers/opentui/host.tsx +6 -0
- package/src/renderers/share/layout-view.tsx +1 -1
- 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 +37 -12
- package/src/state/opening-ticker-panes.ts +47 -0
- package/src/test-support/cli-context.ts +2 -0
- package/src/test-support/preload.ts +4 -1
- package/src/tickers/instrument-kind.ts +23 -3
- package/src/tickers/renamed-listings.ts +105 -0
- package/src/tickers/search/index.ts +103 -16
- package/src/time-series/resolve.ts +2 -2
- package/src/types/config.ts +5 -0
- package/src/types/context-menu.ts +2 -0
- package/src/types/financials.ts +1 -0
- package/src/types/plugin-commands.ts +140 -0
- package/src/types/plugin-context.ts +125 -0
- package/src/types/plugin-contributions.ts +55 -0
- package/src/types/plugin-definition.ts +234 -0
- package/src/types/plugin-notifications.ts +38 -0
- package/src/types/plugin-pane-settings.ts +116 -0
- package/src/types/plugin-pane-templates.ts +160 -0
- package/src/types/plugin-panes.ts +243 -0
- package/src/types/plugin-reports.ts +35 -0
- package/src/types/plugin-shared.ts +14 -0
- package/src/types/plugin-state.ts +71 -0
- package/src/types/plugin.ts +14 -1169
- package/src/ui/index.tsx +14 -3
- package/src/updater/github-releases.ts +23 -0
- package/src/utils/central-banks.ts +86 -1
- package/src/utils/cli-output.ts +22 -9
- package/src/utils/datetime-format.ts +12 -3
- package/src/utils/depositary-receipt.ts +28 -3
- package/src/utils/fundamentals.ts +14 -0
- package/src/utils/max-drawdown.ts +97 -16
- package/src/utils/untrusted-text.ts +29 -0
|
@@ -9,7 +9,8 @@ import { useThemeColors } from "../../../../theme/theme-context";
|
|
|
9
9
|
import { type DialogApi, type PromptContext, useDialogKeyboard } from "../../../../ui/dialog";
|
|
10
10
|
import { isPlainKey } from "../../../../utils/keyboard";
|
|
11
11
|
import type { AssistantDecision } from "./grants";
|
|
12
|
-
import { CONFIRM_WINDOW_MS,
|
|
12
|
+
import { CONFIRM_WINDOW_MS, type ApprovalAnswer, type ConfirmationAnswer, type RelayCaller, type RelayPrompts } from "./engine";
|
|
13
|
+
import { RELAY_PROMPT_SCOPE } from "./policy";
|
|
13
14
|
import type { CallSummary } from "./summary";
|
|
14
15
|
import { logFailure } from "../../../../utils/log-failure";
|
|
15
16
|
|
|
@@ -2,11 +2,13 @@
|
|
|
2
2
|
* Configuration holds broker passwords, API secrets and plugin tokens, and
|
|
3
3
|
* pane settings, pane state, layouts and the UI tree are free-form maps that
|
|
4
4
|
* can carry the same (a token a plugin keeps in its settings, a password
|
|
5
|
-
* typed into a form). Everything the relay
|
|
6
|
-
* with every such value replaced, so
|
|
7
|
-
* a credential out of the terminal.
|
|
5
|
+
* typed into a form). Everything the relay and Ask Gloom send back passes
|
|
6
|
+
* through here, with every such value replaced, so an assistant steered by
|
|
7
|
+
* what it reads cannot copy a credential out of the terminal.
|
|
8
8
|
*/
|
|
9
|
-
|
|
9
|
+
|
|
10
|
+
import { SECRET_NAME } from "../../../../remote/secrets";
|
|
11
|
+
|
|
10
12
|
/** Fields of a form field or input that hold what was typed. */
|
|
11
13
|
const TYPED_VALUE_KEYS = ["value", "summary", "defaultValue", "initialValue"];
|
|
12
14
|
export const REDACTED = "[redacted]";
|
|
@@ -15,18 +17,20 @@ function isPasswordField(record: Record<string, unknown>): boolean {
|
|
|
15
17
|
return record.fieldType === "password" || record.inputType === "password" || record.type === "password";
|
|
16
18
|
}
|
|
17
19
|
|
|
18
|
-
|
|
20
|
+
/** `withheld` hears each value replaced, so the credentials themselves can be listed. */
|
|
21
|
+
function redactSecrets(value: unknown, depth = 0, withheld?: (secret: unknown) => void): unknown {
|
|
19
22
|
if (depth > 32 || value === null || typeof value !== "object") return value;
|
|
20
|
-
if (Array.isArray(value)) return value.map((entry) => redactSecrets(entry, depth + 1));
|
|
23
|
+
if (Array.isArray(value)) return value.map((entry) => redactSecrets(entry, depth + 1, withheld));
|
|
21
24
|
const record = value as Record<string, unknown>;
|
|
22
25
|
const password = isPasswordField(record);
|
|
23
26
|
const result: Record<string, unknown> = {};
|
|
24
27
|
for (const [key, entry] of Object.entries(record)) {
|
|
25
28
|
const filled = entry !== null && entry !== undefined && entry !== "" && typeof entry !== "boolean";
|
|
26
|
-
if (filled && (
|
|
29
|
+
if (filled && (SECRET_NAME.test(key) || (password && TYPED_VALUE_KEYS.includes(key)))) {
|
|
30
|
+
withheld?.(entry);
|
|
27
31
|
result[key] = REDACTED;
|
|
28
32
|
} else {
|
|
29
|
-
result[key] = redactSecrets(entry, depth + 1);
|
|
33
|
+
result[key] = redactSecrets(entry, depth + 1, withheld);
|
|
30
34
|
}
|
|
31
35
|
}
|
|
32
36
|
return result;
|
|
@@ -60,7 +64,7 @@ export function redactConfig(config: unknown): unknown {
|
|
|
60
64
|
/** Resources that carry the whole configuration, before the general pass. */
|
|
61
65
|
export function redactResource(resource: string, value: unknown): unknown {
|
|
62
66
|
if (resource === "app://config") return redactConfig(value);
|
|
63
|
-
if (resource === "app://snapshot" && value && typeof value === "object") {
|
|
67
|
+
if ((resource === "app://snapshot" || resource === "app://snapshot/full") && value && typeof value === "object") {
|
|
64
68
|
const snapshot = value as Record<string, unknown>;
|
|
65
69
|
return { ...snapshot, config: redactConfig(snapshot.config) };
|
|
66
70
|
}
|
|
@@ -71,3 +75,42 @@ export function redactResource(resource: string, value: unknown): unknown {
|
|
|
71
75
|
export function redactRelayResult<T>(result: T): T {
|
|
72
76
|
return redactSecrets(result) as T;
|
|
73
77
|
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Shorter values are left to the key-based pass: as plain text they would
|
|
81
|
+
* match ordinary words and numbers in a result.
|
|
82
|
+
*/
|
|
83
|
+
const MIN_CREDENTIAL_LENGTH = 8;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* The credentials this configuration stores, as text, longest first: every
|
|
87
|
+
* value the key-based pass withholds. Other broker profile settings (a host,
|
|
88
|
+
* an account number) are withheld from configuration too, but they are not
|
|
89
|
+
* secrets a pane's rows must lose.
|
|
90
|
+
*/
|
|
91
|
+
export function storedCredentials(config: unknown): string[] {
|
|
92
|
+
const found = new Set<string>();
|
|
93
|
+
redactSecrets(config, 0, (secret) => {
|
|
94
|
+
if (typeof secret === "string" && secret.trim().length >= MIN_CREDENTIAL_LENGTH) found.add(secret.trim());
|
|
95
|
+
});
|
|
96
|
+
return [...found].sort((left, right) => right.length - left.length);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* A result that is not configuration, such as a pane function's rows, is
|
|
101
|
+
* checked for the stored credentials themselves rather than by its keys: a
|
|
102
|
+
* column named "token" there is a crypto token, not a secret. Any text that
|
|
103
|
+
* holds one has it replaced.
|
|
104
|
+
*/
|
|
105
|
+
export function withoutStoredCredentials<T>(value: T, credentials: readonly string[]): T {
|
|
106
|
+
if (credentials.length === 0) return value;
|
|
107
|
+
const strip = (entry: unknown, depth: number): unknown => {
|
|
108
|
+
if (typeof entry === "string") {
|
|
109
|
+
return credentials.reduce((text, secret) => (text.includes(secret) ? text.split(secret).join(REDACTED) : text), entry);
|
|
110
|
+
}
|
|
111
|
+
if (depth > 32 || entry === null || typeof entry !== "object") return entry;
|
|
112
|
+
if (Array.isArray(entry)) return entry.map((item) => strip(item, depth + 1));
|
|
113
|
+
return Object.fromEntries(Object.entries(entry as Record<string, unknown>).map(([key, item]) => [key, strip(item, depth + 1)]));
|
|
114
|
+
};
|
|
115
|
+
return strip(value, 0) as T;
|
|
116
|
+
}
|
|
@@ -18,9 +18,7 @@ import { curveTitle, normalizeCurveRoot, paneCurveRoot } from "../futures-curve/
|
|
|
18
18
|
import { JodiPane } from "../jodi/pane";
|
|
19
19
|
import { jodiModule } from "../jodi";
|
|
20
20
|
import type { PluginModule } from "../plugin-module";
|
|
21
|
-
import { COMMODITIES_VIEW_STATE } from "./view-state";
|
|
22
|
-
|
|
23
|
-
const COMMODITIES_ENERGY_PANE_ID = "commodities-energy";
|
|
21
|
+
import { COMMODITIES_ENERGY_PANE_ID, COMMODITIES_VIEW_STATE } from "./view-state";
|
|
24
22
|
const COMMODITIES_ENERGY_TITLE = "Commodities & Energy";
|
|
25
23
|
const TAB_STATE_KEY = "commodities-energy:tab";
|
|
26
24
|
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
/** The Commodities & Energy workspace's pane id: FUT, CTM, COT and the others open as its tabs. */
|
|
2
|
+
export const COMMODITIES_ENERGY_PANE_ID = "commodities-energy";
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
5
|
* The pane state each Commodities & Energy tab keeps its own under, which the
|
|
3
6
|
* workspace wraps it with and a function's options write to for `shot`.
|
|
@@ -9,6 +9,7 @@ export const commodityBalancesModule: PluginModule = {
|
|
|
9
9
|
id: "commodity-balances",
|
|
10
10
|
name: "Crop Balances",
|
|
11
11
|
icon: "B",
|
|
12
|
+
shareItem: { argument: true },
|
|
12
13
|
get component(): typeof import("./pane").CommodityBalancesPane { const { CommodityBalancesPane } = require("./pane"); return CommodityBalancesPane; },
|
|
13
14
|
defaultPosition: "right",
|
|
14
15
|
defaultMode: "floating",
|
|
@@ -30,6 +30,6 @@ export const companyAttentionModule: PluginModule = {
|
|
|
30
30
|
ctx.registerTickerResearchTab({ id: "app-attention", name: "Apps", order: 39, component: AppsPane, instruments: ["equity"] });
|
|
31
31
|
},
|
|
32
32
|
dispose() { attentionCache.reset(); movesCache.reset(); signalsCache.reset(); buildingCache.reset(); appRankCache.reset(); },
|
|
33
|
-
panes: definitions.map((def) => ({ id: def.id, name: def.label, icon: def.prefix[0]!, component: def.component, defaultPosition: "right", defaultMode: "floating", defaultFloatingSize: { width: 130, height: 32 }, tickerFollower: true, instruments: ["equity"], tableExport: true, headless: attentionHeadless(def.id) })),
|
|
33
|
+
panes: definitions.map((def) => ({ id: def.id, name: def.label, icon: def.prefix[0]!, component: def.component, defaultPosition: "right", defaultMode: "floating", defaultFloatingSize: { width: 130, height: 32 }, shareItem: { ticker: true }, tickerFollower: true, instruments: ["equity"], tableExport: true, headless: attentionHeadless(def.id) })),
|
|
34
34
|
paneTemplates: templates,
|
|
35
35
|
};
|
|
@@ -29,7 +29,9 @@ function reportColumns(mode: CompanyMode, history: boolean, revisions: boolean,
|
|
|
29
29
|
...(revisions ? [{ id: "revision", label: "Revision", width: 12, align: "left" as const }] : [])];
|
|
30
30
|
return [...withoutQuietColumns(columns, rows, (row, id) => companyCellText(row, id, observations), QUIET_COLUMNS).map((column): HeadlessPaneColumn => ({
|
|
31
31
|
key: column.id === "value" && mode === "guidance" ? "rangeText" : ROW_KEYS[column.id] ?? column.id, header: column.label, align: column.align === "right" ? "right" : "left",
|
|
32
|
-
format: (_value, row) =>
|
|
32
|
+
format: (_value, row) => mode === "guidance" && column.id === "value" && typeof row.rangeText === "string" && /plus or minus|±/i.test(row.rangeText)
|
|
33
|
+
? `${row.rangeText}${row.currency ? ` ${row.currency}` : ""}`
|
|
34
|
+
: companyCellText(row as unknown as CompanyRow, column.id, observations),
|
|
33
35
|
})), { key: "asOf", header: "As of", format: (value) => typeof value === "string" ? value.slice(0, 10) : "--" }];
|
|
34
36
|
}
|
|
35
37
|
|
|
@@ -11,9 +11,9 @@ export const companyKpisModule: PluginModule = {
|
|
|
11
11
|
dispose() { companyKpisCache.reset(); },
|
|
12
12
|
panes: [
|
|
13
13
|
{ id: "company-kpis", name: "Company KPIs", icon: "K", component: CompanyKpisPane, defaultPosition: "right", defaultMode: "floating",
|
|
14
|
-
defaultFloatingSize: { width: 130, height: 30 }, tickerFollower: true, instruments: ["equity"], tableExport: true, headless: kpisHeadless },
|
|
14
|
+
defaultFloatingSize: { width: 130, height: 30 }, shareItem: { ticker: true }, tickerFollower: true, instruments: ["equity"], tableExport: true, headless: kpisHeadless },
|
|
15
15
|
{ id: "company-guidance", name: "Company Guidance", icon: "G", component: CompanyGuidancePane, defaultPosition: "right", defaultMode: "floating",
|
|
16
|
-
defaultFloatingSize: { width: 130, height: 30 }, tickerFollower: true, instruments: ["equity"], tableExport: true, headless: guidanceHeadless },
|
|
16
|
+
defaultFloatingSize: { width: 130, height: 30 }, shareItem: { ticker: true }, tickerFollower: true, instruments: ["equity"], tableExport: true, headless: guidanceHeadless },
|
|
17
17
|
],
|
|
18
18
|
paneTemplates: [
|
|
19
19
|
{ ...createTickerSurfacePaneTemplate({ id: "company-kpis-pane", paneId: "company-kpis", label: "Company KPIs", shortcut: "KPIS",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CotClass, CotClassSummary, CotContractPayload, CotHistoryPoint } from "../../../api-client/cot";
|
|
1
|
+
import type { CotClass, CotClassSummary, CotContractPayload, CotFamily, CotHistoryPoint } from "../../../api-client/cot";
|
|
2
2
|
import type { HeadlessPaneColumn, HeadlessPaneDefinition } from "../../../types/plugin";
|
|
3
3
|
import { fetchCotBoard, fetchCotContract } from "./client";
|
|
4
4
|
import { COT_CLASSES, COT_FAMILIES, COT_MAJOR_CODES, COT_POSITIONS, COT_SCOPES, cotClass, cotContractCode, cotContractUnitText, cotFamily, cotInteger, cotMarketName, cotPositions, cotPositionsText, cotProxyFor, cotProxyNote, cotReleaseTime, cotScope, cotUnknownMarketMessage } from "./model";
|
|
@@ -52,6 +52,17 @@ function cotWeeklyRows(history: readonly CotHistoryPoint[], limit: number | null
|
|
|
52
52
|
return limit == null ? newest : newest.slice(0, limit);
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
+
/**
|
|
56
|
+
* What the text board heads its net column with: the class it counts, "Net
|
|
57
|
+
* noncommercial" or "Net managed money". The same market nets +185,473 as one
|
|
58
|
+
* and +223,784 as the other, and a bare "Net" left a reader to guess which.
|
|
59
|
+
* Exports keep `Net`, the column scripts read it by.
|
|
60
|
+
*/
|
|
61
|
+
function cotBoardNetHeader(family: CotFamily, traderClass: CotClass): string {
|
|
62
|
+
const label = COT_CLASSES[family].find((row) => row.value === traderClass)?.label ?? traderClass;
|
|
63
|
+
return `Net ${label.toLowerCase()}`;
|
|
64
|
+
}
|
|
65
|
+
|
|
55
66
|
const POSITION_COLUMNS: HeadlessPaneColumn[] = [
|
|
56
67
|
{ key: "net", header: "Net", align: "right", format: signed },
|
|
57
68
|
{ key: "weeklyChange", header: "1W Δ", align: "right", format: signed },
|
|
@@ -150,7 +161,8 @@ export const cotHeadless: HeadlessPaneDefinition<"bundle"> = {
|
|
|
150
161
|
const rows = data.rows.filter((row) => scope === "all" || COT_MAJOR_CODES.has(row.contractCode));
|
|
151
162
|
const publishedAt = cotPublishedAt(data);
|
|
152
163
|
return { sections: [{ title: positions === "combined" ? `Positioning extremes · ${cotPositionsText(positions)}` : "Positioning extremes",
|
|
153
|
-
columns: [{ key: "marketName", header: "Market" }, { key: "contractCode", header: "Code" },
|
|
164
|
+
columns: [{ key: "marketName", header: "Market" }, { key: "contractCode", header: "Code" },
|
|
165
|
+
...POSITION_COLUMNS.map((column) => column.key === "net" ? { ...column, textHeader: cotBoardNetHeader(family, traderClass) } : column),
|
|
154
166
|
{ key: "openInterest", header: "Open interest", align: "right", format: count }, { key: "reportDate", header: "As of" }],
|
|
155
167
|
rows: rows.map((row) => ({ contractCode: row.contractCode, marketName: cotMarketName(row.marketName), reportDate: row.reportDate, openInterest: row.openInterest, ...cotPositionRow(row.position) })) }],
|
|
156
168
|
errors: data.gaps, metadata: { ...data, scope, publishedAt, complete: data.status === "available" }, ...cotReleased(publishedAt) };
|
|
@@ -6,7 +6,7 @@ import { COT_SERIES } from "./series";
|
|
|
6
6
|
|
|
7
7
|
export const cotModule: PluginModule = {
|
|
8
8
|
series: COT_SERIES,
|
|
9
|
-
panes: [{ id: "cot", name: "CFTC Positioning", icon: "P", get component(): typeof import("./pane").CotPane { const { CotPane } = require("./pane"); return CotPane; },
|
|
9
|
+
panes: [{ id: "cot", name: "CFTC Positioning", icon: "P", shareItem: { argument: true }, get component(): typeof import("./pane").CotPane { const { CotPane } = require("./pane"); return CotPane; },
|
|
10
10
|
defaultPosition: "right", defaultMode: "floating", defaultFloatingSize: { width: 106, height: 30 },
|
|
11
11
|
tableExport: true, headless: cotHeadless }],
|
|
12
12
|
paneTemplates: [{ id: "cot-cot", paneId: "cot", label: "CFTC Positioning",
|
|
@@ -13,7 +13,7 @@ function cpiInstance(options?: PaneTemplateCreateOptions): PaneTemplateInstanceC
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
export const cpiModule: PluginModule = {
|
|
16
|
-
panes: [{ id: "cpi", name: "US Consumer Prices", icon: "C", get component(): typeof import("./pane").CpiPane { const { CpiPane } = require("./pane"); return CpiPane; },
|
|
16
|
+
panes: [{ id: "cpi", name: "US Consumer Prices", icon: "C", shareItem: { argument: true }, get component(): typeof import("./pane").CpiPane { const { CpiPane } = require("./pane"); return CpiPane; },
|
|
17
17
|
defaultPosition: "right", defaultMode: "floating", defaultFloatingSize: { width: 100, height: 36 },
|
|
18
18
|
tableExport: true, headless: cpiHeadless }],
|
|
19
19
|
paneTemplates: [{
|
|
@@ -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: [{
|
|
@@ -115,7 +115,7 @@ export const earningsModule: PluginModule = {
|
|
|
115
115
|
id: "earnings-calendar-pane",
|
|
116
116
|
paneId: "earnings-calendar",
|
|
117
117
|
label: "Earnings Calendar",
|
|
118
|
-
description: "
|
|
118
|
+
description: "A company's report history with surprises and moves; several tickers, their next reports; none, the market board.",
|
|
119
119
|
keywords: ["earn", "earnings", "calendar", "implied move", "surprise", "eps", "revenue", "quarterly"],
|
|
120
120
|
// ERN works on the loaded security: typed alone it takes the active
|
|
121
121
|
// ticker, and with none active it opens the market's report days.
|
|
@@ -139,7 +139,7 @@ export const earningsModule: PluginModule = {
|
|
|
139
139
|
id: "earnings-board-pane",
|
|
140
140
|
paneId: "earnings-calendar",
|
|
141
141
|
label: "Earnings Days",
|
|
142
|
-
description: "The market
|
|
142
|
+
description: "The market board: report days by week or day, with implied and past moves; a ticker highlights its row.",
|
|
143
143
|
keywords: ["evts", "events", "earnings calendar", "earnings season", "reporting today"],
|
|
144
144
|
// Bloomberg's calendar: the market board always, never one company's history.
|
|
145
145
|
shortcut: { prefix: "EVTS", argPlaceholder: "ticker", argKind: "ticker", argOptional: true },
|
|
@@ -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)) {
|
|
@@ -314,9 +314,82 @@ export function eventSeriesId(event: Pick<EconEvent, "country" | "event">): stri
|
|
|
314
314
|
*/
|
|
315
315
|
export function eventSearchNames(event: Pick<EconEvent, "country" | "event" | "actual" | "forecast" | "prior">): string[] {
|
|
316
316
|
const series = resolveFredMapping(event.event, event.country)?.seriesId;
|
|
317
|
-
|
|
317
|
+
const policy = POLICY_DECISION.test(event.event) ? policyRateNames(event.country) : [];
|
|
318
|
+
return [...[event.event, econEventName(event)].map(compactName), ...series ? statNamesOf(series) : [], ...policy];
|
|
318
319
|
}
|
|
319
320
|
|
|
321
|
+
/** A central bank's decision or fixing, under the titles the calendar gives them. */
|
|
322
|
+
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;
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* The names people give a bank's policy rate and its committee, so `--search
|
|
326
|
+
* selic` finds the Copom's decision and `--search banxico` Banxico's: by the
|
|
327
|
+
* calendar's country, with the names every bank's decision answers to.
|
|
328
|
+
*/
|
|
329
|
+
const POLICY_RATE_NAMES: Readonly<Record<string, readonly string[]>> = {
|
|
330
|
+
US: ["fed funds", "federal funds", "FOMC", "Federal Reserve"],
|
|
331
|
+
EU: ["ECB", "deposit rate", "deposit facility", "refi rate"],
|
|
332
|
+
GB: ["Bank Rate", "BoE", "MPC"],
|
|
333
|
+
JP: ["BoJ", "Bank of Japan"],
|
|
334
|
+
CA: ["BoC", "overnight rate"],
|
|
335
|
+
AU: ["RBA", "cash rate"],
|
|
336
|
+
NZ: ["RBNZ", "OCR", "official cash rate"],
|
|
337
|
+
CH: ["SNB"],
|
|
338
|
+
CN: ["LPR", "loan prime rate", "PBoC"],
|
|
339
|
+
IN: ["RBI", "repo rate"],
|
|
340
|
+
ID: ["BI rate", "Bank Indonesia"],
|
|
341
|
+
KR: ["BoK", "base rate"],
|
|
342
|
+
BR: ["Selic", "Copom", "Banco Central do Brasil", "BCB"],
|
|
343
|
+
MX: ["Banxico", "Banco de Mexico", "tasa objetivo", "target rate"],
|
|
344
|
+
RU: ["key rate", "Bank of Russia", "CBR"],
|
|
345
|
+
TR: ["CBRT", "TCMB", "one-week repo"],
|
|
346
|
+
ZA: ["SARB", "repo rate"],
|
|
347
|
+
NO: ["Norges Bank", "sight deposit rate"],
|
|
348
|
+
SE: ["Riksbank"],
|
|
349
|
+
};
|
|
350
|
+
const ANY_POLICY_RATE = ["policy rate", "rate decision", "interest rate", "central bank", "monetary policy"];
|
|
351
|
+
|
|
352
|
+
function policyRateNames(country: string): string[] {
|
|
353
|
+
return [...POLICY_RATE_NAMES[country.toUpperCase()] ?? [], ...ANY_POLICY_RATE].map(compactName);
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
const nameWords = (text: string) => text.toLowerCase().split(/[^a-z0-9]+/).filter(Boolean);
|
|
357
|
+
/** Words of many banks' names that name none alone: "bank" is the BoE's, the BoJ's and three more. */
|
|
358
|
+
const SHARED_NAME_WORDS = new Set(["bank", "of", "de", "do", "rate", "central"]);
|
|
359
|
+
|
|
360
|
+
/**
|
|
361
|
+
* The decisions a search for a bank's own names means, for an empty answer to
|
|
362
|
+
* say: `selic` is Brazil's Copom decision. Every word of the query must be a
|
|
363
|
+
* whole word of one of the bank's names, or the name run together (`fedfunds`):
|
|
364
|
+
* `cbr` is the Bank of Russia's and not the CBRT's, and words many names share
|
|
365
|
+
* name none alone (`bank`, SHARED_NAME_WORDS). Only the
|
|
366
|
+
* banks of the countries the calendar lists (`countries`, as --country reads).
|
|
367
|
+
* Empty for a query no bank's names hold, and for the names every bank's
|
|
368
|
+
* decision answers to (a query of those already lists them).
|
|
369
|
+
*/
|
|
370
|
+
export function policyDecisionsNamed(query: string, countries: CountryFilter = "all"): Array<{ country: string; event: string }> {
|
|
371
|
+
const words = nameWords(query);
|
|
372
|
+
if (words.every((word) => SHARED_NAME_WORDS.has(word))) return [];
|
|
373
|
+
return Object.entries(POLICY_RATE_NAMES).flatMap(([country, names]) => {
|
|
374
|
+
const event = POLICY_DECISION_TITLES[country] ?? "Interest Rate Decision";
|
|
375
|
+
if (!matchesCountry({ country, event }, countries)) return [];
|
|
376
|
+
const named = names.some((name) => {
|
|
377
|
+
const parts = nameWords(name);
|
|
378
|
+
return words.every((word) => parts.includes(word) || word === compactName(name));
|
|
379
|
+
});
|
|
380
|
+
return named ? [{ country, event }] : [];
|
|
381
|
+
});
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
/** How the calendar titles each bank's decision (China's is its LPR fixing). */
|
|
385
|
+
const POLICY_DECISION_TITLES: Readonly<Record<string, string>> = {
|
|
386
|
+
US: "Fed Interest Rate Decision", EU: "ECB Interest Rate Decision", GB: "BoE Interest Rate Decision", JP: "BoJ Interest Rate Decision",
|
|
387
|
+
CA: "BoC Interest Rate Decision", AU: "RBA Interest Rate Decision", NZ: "RBNZ Interest Rate Decision", CH: "SNB Interest Rate Decision",
|
|
388
|
+
CN: "1-y Loan Prime Rate", IN: "RBI Interest Rate Decision", ID: "BI Interest Rate Decision", KR: "BoK Interest Rate Decision",
|
|
389
|
+
BR: "Copom Interest Rate Decision", MX: "Banxico Interest Rate Decision", RU: "Bank of Russia Interest Rate Decision",
|
|
390
|
+
TR: "CBRT Interest Rate Decision", ZA: "SARB Interest Rate Decision", NO: "Norges Bank Interest Rate Decision", SE: "Riksbank Interest Rate Decision",
|
|
391
|
+
};
|
|
392
|
+
|
|
320
393
|
/**
|
|
321
394
|
* Whether a row carries every word of `query` in one of its names or its
|
|
322
395
|
* publisher's, case, spaces and hyphens aside: `nonfarm` finds Non Farm
|
|
@@ -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
|
{
|
|
@@ -544,6 +544,7 @@ export const economicCalendarModule: PluginModule = {
|
|
|
544
544
|
id: "econ-calendar",
|
|
545
545
|
reportFreshness: { status: "not-a-feed", basis: "calendar" },
|
|
546
546
|
name: "Economic Calendar",
|
|
547
|
+
shareItem: { argument: true },
|
|
547
548
|
icon: "E",
|
|
548
549
|
component: EconCalendarPane,
|
|
549
550
|
defaultPosition: "right",
|
|
@@ -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",
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
import { handleRefreshKey } from "../../../components/data-table/table-pane";
|
|
15
15
|
import { useRemoteUiNode } from "../../../remote/semantic-tree";
|
|
16
16
|
import { usePaneVisible } from "../../../state/app/activity";
|
|
17
|
-
import { usePaneInstance } from "../../../state/app/context";
|
|
17
|
+
import { usePaneInstance, usePaneSettingValue } from "../../../state/app/context";
|
|
18
18
|
import { TICKER_RESEARCH_PANE_ID } from "../../../types/config";
|
|
19
19
|
import type { PaneProps } from "../../../types/plugin";
|
|
20
20
|
import { isPlainKey } from "../../../utils/keyboard";
|
|
@@ -68,12 +68,15 @@ import {
|
|
|
68
68
|
} from "./table";
|
|
69
69
|
import { useFuturesBoardTerms } from "./use-board-terms";
|
|
70
70
|
import { useFrontContractReturns } from "./use-front-returns";
|
|
71
|
+
import { COMMODITIES_ENERGY_PANE_ID } from "../commodities-energy/view-state";
|
|
71
72
|
|
|
72
73
|
const FUTURES_PANE_ID = "futures";
|
|
73
74
|
|
|
74
75
|
const FUTURES_SYMBOLS = FUTURES_CONTRACTS.map((contract) => contract.symbol);
|
|
75
76
|
|
|
76
77
|
const alwaysNavigable = () => true;
|
|
78
|
+
/** How long the cursor rests on a row before the workspace's Curve tab follows it. */
|
|
79
|
+
const CURVE_FOLLOW_MS = 150;
|
|
77
80
|
const NO_BOARD_QUOTES: BoardQuoteMap = new Map();
|
|
78
81
|
/** Columns whose order moves with every tick; the others keep a fixed order. */
|
|
79
82
|
const LIVE_SORT_COLUMNS = new Set<string>([
|
|
@@ -197,7 +200,7 @@ export function FuturesPane({ focused, width, height }: PaneProps) {
|
|
|
197
200
|
futuresSessionQuote(row.contract, quote)?.marketState,
|
|
198
201
|
values?.loading, ...Object.values(values?.values ?? {}),
|
|
199
202
|
contract?.loading, contract?.terms?.spec?.unit, contract?.terms?.deliveryMonth, contract?.terms?.nearest?.contract,
|
|
200
|
-
contract?.terms?.nearest?.lastTrade,
|
|
203
|
+
contract?.terms?.nearest?.lastTrade,
|
|
201
204
|
].join(":");
|
|
202
205
|
}, [returns, shownQuotes, terms]);
|
|
203
206
|
|
|
@@ -245,6 +248,21 @@ export function FuturesPane({ focused, width, height }: PaneProps) {
|
|
|
245
248
|
setSelectedId(firstNavigable ? futuresRowId(firstNavigable) : null);
|
|
246
249
|
}, [rows, selectedId]);
|
|
247
250
|
|
|
251
|
+
// In the Commodities & Energy workspace the Curve tab shows the market in view here: the row picked, or the one a
|
|
252
|
+
// search left at the top (`FUT cocoa` opened Curve on ES). The first row an unsearched board selects by itself moves
|
|
253
|
+
// nothing, so `CTM CC` keeps CC when Markets is opened beside it.
|
|
254
|
+
const [picked, setPicked] = useState(false);
|
|
255
|
+
const [, setCurveRoot] = usePaneSettingValue<string | undefined>("root", undefined);
|
|
256
|
+
const selectedRow = rows.find((row) => row.type === "row" && futuresRowId(row) === selectedId);
|
|
257
|
+
const marketInView = paneInstance?.paneId === COMMODITIES_ENERGY_PANE_ID && (picked || searchQuery.trim()) && selectedRow?.type === "row"
|
|
258
|
+
? selectedRow.contract.code : null;
|
|
259
|
+
useEffect(() => {
|
|
260
|
+
if (!marketInView) return;
|
|
261
|
+
// Arrowing down the board writes the row it stops on, not every row it passes.
|
|
262
|
+
const timer = setTimeout(() => setCurveRoot(marketInView), CURVE_FOLLOW_MS);
|
|
263
|
+
return () => clearTimeout(timer);
|
|
264
|
+
}, [marketInView, setCurveRoot]);
|
|
265
|
+
|
|
248
266
|
// The footer binds the `/` search hint.
|
|
249
267
|
const handlePaneKey = useCallback((event: DataTableKeyEvent): boolean => {
|
|
250
268
|
if (handleRefreshKey(event, refresh, { stopPropagation: true })) return true;
|
|
@@ -334,7 +352,10 @@ export function FuturesPane({ focused, width, height }: PaneProps) {
|
|
|
334
352
|
kind: "id",
|
|
335
353
|
selectedId,
|
|
336
354
|
getId: (row) => futuresRowId(row),
|
|
337
|
-
onChange: (id) =>
|
|
355
|
+
onChange: (id) => {
|
|
356
|
+
setSelectedId(id);
|
|
357
|
+
setPicked(true);
|
|
358
|
+
},
|
|
338
359
|
}}
|
|
339
360
|
isNavigable={alwaysNavigable}
|
|
340
361
|
onActivate={(row) => {
|
|
@@ -426,7 +447,7 @@ export const futuresModule: PluginModule = {
|
|
|
426
447
|
paneId: FUTURES_PANE_ID,
|
|
427
448
|
label: "Futures Board",
|
|
428
449
|
description:
|
|
429
|
-
"Each root's front futures contract (until its stated roll date)
|
|
450
|
+
"Each root's front futures contract (until its stated roll date) across equity index, equity sectors, rates, energy, metals, agriculture, livestock, and FX with last price, unit, session change, search, and collapsible sectors.",
|
|
430
451
|
keywords: [
|
|
431
452
|
"futures",
|
|
432
453
|
"commodities",
|