@gloom-sh/terminal 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
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { normalizeSearchText } from "./search/ranking";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A listing abroad whose company renamed itself and moved to a new symbol:
|
|
5
|
+
* the change history the data service keeps is of US listings, so `quote
|
|
6
|
+
* ELET3.SA` found nothing and its hint searched for the dead symbol again.
|
|
7
|
+
*/
|
|
8
|
+
export interface RenamedListing {
|
|
9
|
+
/** The symbol it left, as the venue writes it. */
|
|
10
|
+
from: string;
|
|
11
|
+
/** The symbol it trades as now. */
|
|
12
|
+
to: string;
|
|
13
|
+
/** The venue's symbol suffix, as `quote` takes it (`.SA`). */
|
|
14
|
+
suffix: string;
|
|
15
|
+
exchange: string;
|
|
16
|
+
/** Its name now. */
|
|
17
|
+
name: string;
|
|
18
|
+
/** The names people still search for, the one it went by first: its brand, then its legal name. */
|
|
19
|
+
formerNames: readonly [string, ...string[]];
|
|
20
|
+
/** The day a class that no longer trades was converted into the `to` line (YYYY-MM-DD). */
|
|
21
|
+
convertedOn?: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** The name it went by: "Eletrobras". */
|
|
25
|
+
function renamedListingFormerName(listing: RenamedListing): string {
|
|
26
|
+
return listing.formerNames[0];
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Checked in, each from the issuer's own notice. Eletrobras (Centrais
|
|
31
|
+
* Elétricas Brasileiras S.A.) renamed itself AXIA Energia in November 2025,
|
|
32
|
+
* and each of its B3 lines took the new code: ELET3 AXIA3, the class B
|
|
33
|
+
* preferred ELET6 AXIA6, the class A preferred ELET5 AXIA5. On 5 Jun 2026,
|
|
34
|
+
* moving to the Novo Mercado, AXIA converted both preferred classes into its
|
|
35
|
+
* common shares, which trade as AXIA3 (AXIA's release of 9 Jun 2026), so
|
|
36
|
+
* the preferred codes, old and new, lead there. Its ADSs' change (EBR to
|
|
37
|
+
* AXIA) is in the US history already. A name leads to the common shares,
|
|
38
|
+
* listed first.
|
|
39
|
+
*/
|
|
40
|
+
const ELETROBRAS = ["Eletrobras", "Centrais Elétricas Brasileiras"] as const;
|
|
41
|
+
const AXIA_PREFERRED_CONVERTED = "2026-06-05";
|
|
42
|
+
const RENAMED_LISTINGS: readonly RenamedListing[] = [
|
|
43
|
+
{ from: "ELET3", to: "AXIA3", suffix: ".SA", exchange: "B3", name: "AXIA Energia", formerNames: ELETROBRAS },
|
|
44
|
+
...["ELET6", "AXIA6", "ELET5", "AXIA5"].map((from): RenamedListing => ({ from, to: "AXIA3", suffix: ".SA", exchange: "B3",
|
|
45
|
+
name: "AXIA Energia", formerNames: ELETROBRAS, convertedOn: AXIA_PREFERRED_CONVERTED })),
|
|
46
|
+
];
|
|
47
|
+
|
|
48
|
+
/** "5 Jun 2026". */
|
|
49
|
+
function conversionDay(date: string): string {
|
|
50
|
+
return new Date(`${date}T00:00:00Z`).toLocaleDateString("en-GB", { day: "numeric", month: "short", year: "numeric", timeZone: "UTC" });
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** `AXIA3.SA`: the new listing as `quote` takes it. */
|
|
54
|
+
export function renamedListingSymbol(listing: RenamedListing): string {
|
|
55
|
+
return `${listing.to}${listing.suffix}`;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* The renamed listing a symbol (`ELET3`, `ELET3.SA`, `ELET3:B3`) or a name
|
|
60
|
+
* (`eletrobras`) means, else null.
|
|
61
|
+
*/
|
|
62
|
+
export function renamedListingFor(query: string): RenamedListing | null {
|
|
63
|
+
const typed = query.trim().toUpperCase();
|
|
64
|
+
if (!typed) return null;
|
|
65
|
+
const bySymbol = RENAMED_LISTINGS.find((listing) =>
|
|
66
|
+
typed === listing.from || typed === `${listing.from}${listing.suffix}` || typed === `${listing.from}:${listing.exchange}`);
|
|
67
|
+
if (bySymbol) return bySymbol;
|
|
68
|
+
const words = normalizeSearchText(query);
|
|
69
|
+
return words ? RENAMED_LISTINGS.find((listing) => listing.formerNames.some((name) => normalizeSearchText(name) === words)) ?? null : null;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* "It is now AXIA3.SA (AXIA Energia, formerly Eletrobras): `gloom quote
|
|
74
|
+
* AXIA3.SA`.", after the line naming the old symbol; for a converted class,
|
|
75
|
+
* "It was converted into AXIA3.SA on 5 Jun 2026 ...".
|
|
76
|
+
*/
|
|
77
|
+
export function renamedListingHint(listing: RenamedListing): string {
|
|
78
|
+
const now = renamedListingSymbol(listing);
|
|
79
|
+
const named = `${now} (${listing.name}, formerly ${renamedListingFormerName(listing)})`;
|
|
80
|
+
return listing.convertedOn
|
|
81
|
+
? `It was converted into ${named} on ${conversionDay(listing.convertedOn)}: \`gloom quote ${now}\`.`
|
|
82
|
+
: `It is now ${named}: \`gloom quote ${now}\`.`;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/** What search says the new line was: "Eletrobras (ELET3)", or "Eletrobras (ELET6, converted 5 Jun 2026)". */
|
|
86
|
+
export function renamedListingFormerLine(listing: RenamedListing): string {
|
|
87
|
+
const converted = listing.convertedOn ? `, converted ${conversionDay(listing.convertedOn)}` : "";
|
|
88
|
+
return `${renamedListingFormerName(listing)} (${listing.from}${converted})`;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* "Read ELET3.SA as AXIA3.SA: Eletrobras is AXIA Energia now.", or "Read
|
|
93
|
+
* "eletrobras" as ..." for its name; for a converted class, "Read ELET6 as
|
|
94
|
+
* AXIA3.SA: those preferred shares were converted into AXIA Energia's common
|
|
95
|
+
* shares on 5 Jun 2026."
|
|
96
|
+
*/
|
|
97
|
+
export function renamedListingReadAs(typed: string, listing: RenamedListing): string {
|
|
98
|
+
const word = typed.trim();
|
|
99
|
+
// A name is quoted, as every name read as a listing is; the CLI puts it back in the user's spelling.
|
|
100
|
+
const shown = listing.formerNames.some((name) => normalizeSearchText(word) === normalizeSearchText(name)) ? `"${word}"` : word;
|
|
101
|
+
const now = renamedListingSymbol(listing);
|
|
102
|
+
return listing.convertedOn
|
|
103
|
+
? `Read ${shown} as ${now}: those preferred shares were converted into ${listing.name}'s common shares on ${conversionDay(listing.convertedOn)}.`
|
|
104
|
+
: `Read ${shown} as ${now}: ${renamedListingFormerName(listing)} is ${listing.name} now.`;
|
|
105
|
+
}
|
|
@@ -35,6 +35,7 @@ import {
|
|
|
35
35
|
} from "./result";
|
|
36
36
|
|
|
37
37
|
import { typedPerpetualListing } from "../perpetual-listing";
|
|
38
|
+
import { renamedListingFor, renamedListingFormerLine, type RenamedListing } from "../renamed-listings";
|
|
38
39
|
import { endsInLegalForm, readNearMissListing, readVenueFirstListing, readTerminalListingCode } from "../terminal-codes";
|
|
39
40
|
import { isProviderBusy, ProviderBusyError, SEARCH_BUSY_MESSAGE } from "../../sources/provider-errors";
|
|
40
41
|
import { settleWithin } from "../../utils/async-deadline";
|
|
@@ -268,13 +269,19 @@ export async function searchTickerCandidates({
|
|
|
268
269
|
// A search that hides contracts still shows them when asked: "AAPL OPT".
|
|
269
270
|
includeOptionContracts: includeOptionContracts || parseAssetClassQuery(query)?.code === "OPT",
|
|
270
271
|
});
|
|
271
|
-
const
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
272
|
+
const renamed = renamedListingFor(rawQuery);
|
|
273
|
+
const [searched, renamedRow] = await Promise.all([
|
|
274
|
+
searchProviderResults(
|
|
275
|
+
dataProvider,
|
|
276
|
+
query,
|
|
277
|
+
searchContext,
|
|
278
|
+
onPartial ? (found) => onPartial(assemble(found)) : undefined,
|
|
279
|
+
true,
|
|
280
|
+
),
|
|
281
|
+
renamed ? renamedListingRow(dataProvider, renamed, searchContext) : null,
|
|
282
|
+
]);
|
|
283
|
+
const { busy, unreachable } = searched;
|
|
284
|
+
const results = renamedRow ? withRenamedListingRow(searched.results, renamedRow) : searched.results;
|
|
278
285
|
// The symbol's lines are named at once the next time it is typed. An answer that may have
|
|
279
286
|
// been cut short and found none of the lines leaves the ones search named before standing,
|
|
280
287
|
// as the bar showed them, unless the search was a broker account's own.
|
|
@@ -319,7 +326,36 @@ export function buildTickerSearchCandidates({
|
|
|
319
326
|
);
|
|
320
327
|
const providerItems = createProviderTickerSearchCandidates(filteredProviderResults, tickers, candidateOptions);
|
|
321
328
|
const ranked = withHomeListingLead(withSuccessorFirst(rankTickerSearchItems([...localItems, ...providerItems], query), query), query);
|
|
322
|
-
return limitTickerSearchCandidates(assignTickerSearchCategories(ranked, query), totalLimit, localLimit);
|
|
329
|
+
return limitTickerSearchCandidates(companyListingsFirst(assignTickerSearchCategories(ranked, query), query), totalLimit, localLimit);
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
/**
|
|
333
|
+
* The row of the listing a renamed one moved to (AXIA3 for ELET3 or
|
|
334
|
+
* "eletrobras"), as search lists it under its new symbol, carrying the old
|
|
335
|
+
* name and symbol so it answers to them and says what it was. Null when
|
|
336
|
+
* search does not list it.
|
|
337
|
+
*/
|
|
338
|
+
async function renamedListingRow(
|
|
339
|
+
dataProvider: DataProvider,
|
|
340
|
+
renamed: RenamedListing,
|
|
341
|
+
searchContext?: SearchRequestContext,
|
|
342
|
+
): Promise<InstrumentSearchResult | null> {
|
|
343
|
+
const found = await searchProviderResults(dataProvider, renamed.to, searchContext)
|
|
344
|
+
.catch(logFailure("tickers.search", "Search for a renamed listing's new symbol failed", null));
|
|
345
|
+
const row = found?.results.find((result) => result.symbol.toUpperCase() === renamed.to
|
|
346
|
+
&& canonicalExchange(result.exchange) === canonicalExchange(renamed.exchange));
|
|
347
|
+
return row ? {
|
|
348
|
+
...row,
|
|
349
|
+
searchAliases: [...new Set([...(row.searchAliases ?? []), ...renamed.formerNames, renamed.from, `${renamed.from}${renamed.suffix}`])],
|
|
350
|
+
formerName: renamedListingFormerLine(renamed),
|
|
351
|
+
} : null;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
/** Search's rows with the renamed listing's row first, in place of the row it already had of it and of its old symbol on the venue. */
|
|
355
|
+
function withRenamedListingRow(results: InstrumentSearchResult[], row: InstrumentSearchResult): InstrumentSearchResult[] {
|
|
356
|
+
const venue = canonicalExchange(row.exchange);
|
|
357
|
+
return [row, ...results.filter((result) => canonicalExchange(result.exchange) !== venue
|
|
358
|
+
|| (result.symbol.toUpperCase() !== row.symbol.toUpperCase() && !row.searchAliases?.includes(result.symbol.toUpperCase())))];
|
|
323
359
|
}
|
|
324
360
|
|
|
325
361
|
/** Whether a query is the start of a merged company's name, as the service matched it ("Golden Ocean"). */
|
|
@@ -386,22 +422,47 @@ export function symbolSearchQuery(query: string): string {
|
|
|
386
422
|
return trimmed.slice(0, -1).toUpperCase();
|
|
387
423
|
}
|
|
388
424
|
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
if (!requested) return Promise.resolve(null);
|
|
425
|
+
/** The symbol `resolveTickerSearch` looks a normalized query up as first, and the spellings it reads it in. */
|
|
426
|
+
function lookupSpelling(requested: string, tickers: ReadonlyMap<string, TickerRecord>) {
|
|
392
427
|
// `NET:` lists NET's venues instead of settling on one.
|
|
393
428
|
const pickListing = isListingPickerQuery(requested);
|
|
394
429
|
const typed = symbolSearchQuery(requested);
|
|
395
430
|
// A futures board code no security uses is its future (TTF is TTF=F), unless a saved ticker holds it.
|
|
396
|
-
const future = pickListing ||
|
|
431
|
+
const future = pickListing || tickers.has(typed) ? null : bareFuturesCode(typed);
|
|
397
432
|
// A currency pair is the one listing the service has for it, however it is written: EUR/USD and
|
|
398
433
|
// JPY=X are EURUSD=X and USDJPY=X. USD-NGN and USDNGN, which a security could also be written as
|
|
399
434
|
// (MNT-USD is a coin), are the pair only when nothing is listed under those letters.
|
|
400
435
|
const pair = pickListing || future ? null : currencyPairSpelling(typed);
|
|
401
436
|
// A coin pair written as crypto exchanges write it (BTC/GBP, or BTC/GBP:KRAKEN) is the crypto venue's BTC-GBP,
|
|
402
437
|
// and what was typed when the venue has no such coin.
|
|
403
|
-
const coin = pickListing || future || pair ||
|
|
438
|
+
const coin = pickListing || future || pair || tickers.has(typed) ? null : typedCoinPairListing(typed);
|
|
404
439
|
const symbol = future?.symbol ?? coin?.symbol ?? (pair && !pair.ambiguous ? pair.symbol : typed);
|
|
440
|
+
return { pickListing, typed, pair, coin, symbol };
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
/** The saved ticker a symbol names, as written or as a saved listing reads it. */
|
|
444
|
+
function savedTickerFor(symbol: string, tickers: ReadonlyMap<string, TickerRecord>): TickerRecord | null {
|
|
445
|
+
return tickers.get(symbol)
|
|
446
|
+
?? findExactTickerSearchMatch(createLocalTickerSearchCandidates(tickers.values()), symbol)?.ticker
|
|
447
|
+
?? null;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
/**
|
|
451
|
+
* The saved ticker a query names as `resolveTickerSearch` reads it, with no
|
|
452
|
+
* source asked: `JPM US Equity` is JPM, `BRK/B` BRK-B, `TTF` its future TTF=F.
|
|
453
|
+
* Null when none is saved, or for `NET:`, which asks for a choice of listings.
|
|
454
|
+
*/
|
|
455
|
+
export function savedTickerForQuery(query: string, tickers: ReadonlyMap<string, TickerRecord>): TickerRecord | null {
|
|
456
|
+
const requested = normalizeTickerInput(null, query);
|
|
457
|
+
if (!requested) return null;
|
|
458
|
+
const { pickListing, symbol } = lookupSpelling(requested, tickers);
|
|
459
|
+
return pickListing ? null : savedTickerFor(symbol, tickers);
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
export function resolveTickerSearch(options: ResolveTickerSearchOptions): Promise<ResolvedTickerSearch | null> {
|
|
463
|
+
const requested = normalizeTickerInput(options.activeTicker, options.query);
|
|
464
|
+
if (!requested) return Promise.resolve(null);
|
|
465
|
+
const { pickListing, typed, pair, coin, symbol } = lookupSpelling(requested, options.tickers);
|
|
405
466
|
const literal = resolveTickerSymbol(symbol, options, pickListing ? requested : null);
|
|
406
467
|
const alternatives = pickListing ? [] : [...dottedVenueQueries(symbol), ...pair?.ambiguous ? [pair.symbol] : [], ...coin ? [typed] : []];
|
|
407
468
|
// A listing suffix search does not carry (CEZ.PR) is read from its own quote, as `quote` reads it.
|
|
@@ -473,9 +534,7 @@ async function resolveTickerSymbol(
|
|
|
473
534
|
/** The `NET:` text that asked for every venue, or null to settle on one. */
|
|
474
535
|
pickerQuery: string | null,
|
|
475
536
|
): Promise<ResolvedTickerSearch | null> {
|
|
476
|
-
const local =
|
|
477
|
-
?? findExactTickerSearchMatch(createLocalTickerSearchCandidates(tickers.values()), symbol)?.ticker
|
|
478
|
-
?? null;
|
|
537
|
+
const local = savedTickerFor(symbol, tickers);
|
|
479
538
|
if (local) {
|
|
480
539
|
const contracts = new Map((local.metadata.broker_contracts ?? []).flatMap((brokerContract) => {
|
|
481
540
|
const key = searchContractKey({ brokerContract, type: local.metadata.assetCategory || "" });
|
|
@@ -925,6 +984,34 @@ function assignTickerSearchCategories<T extends TickerSearchCandidate>(items: T[
|
|
|
925
984
|
}) as T[];
|
|
926
985
|
}
|
|
927
986
|
|
|
987
|
+
/**
|
|
988
|
+
* A query that names a company lists the company's listings before the
|
|
989
|
+
* mutual funds that carry its name: "banorte" is GFNORTEO (Grupo Financiero
|
|
990
|
+
* Banorte) and its other lines first, then the four Banorte Siefore pension
|
|
991
|
+
* funds search ranked above it. Only when the primary listing's name holds
|
|
992
|
+
* every word of the query and every fund ranked above it is a mutual fund: a
|
|
993
|
+
* future or an ETF the query names keeps its lead (GC=F for "gold", LIT for
|
|
994
|
+
* "lithium", Fidelity's ETFs for "fidelity"). Only the primary listing and
|
|
995
|
+
* the lines under its own name move: another company's listing keeps its
|
|
996
|
+
* place behind the funds.
|
|
997
|
+
*/
|
|
998
|
+
function companyListingsFirst<T extends TickerSearchCandidate>(items: T[], query: string): T[] {
|
|
999
|
+
const primary = items.findIndex((item) => item.category === "Primary Listing");
|
|
1000
|
+
const firstFund = items.findIndex((item) => item.category === "Funds & Derivatives");
|
|
1001
|
+
if (primary < 0 || firstFund < 0 || firstFund > primary) return items;
|
|
1002
|
+
const ahead = items.slice(0, primary).filter((item) => item.category === "Funds & Derivatives");
|
|
1003
|
+
if (!ahead.every((item) => /mutual\s*fund/i.test(item.instrumentType ?? item.result?.type ?? ""))) return items;
|
|
1004
|
+
const wanted = normalizeSearchText(query).split(" ").filter(Boolean);
|
|
1005
|
+
const lead = items[primary]!;
|
|
1006
|
+
const leadName = normalizeSearchText(lead.result?.name ?? lead.ticker?.metadata.name ?? lead.detail ?? "");
|
|
1007
|
+
if (!wanted.length || !wanted.every((word) => ` ${leadName} `.includes(` ${word} `))) return items;
|
|
1008
|
+
const listings = items.filter((item) => item === lead || (item.category === "Other Listings"
|
|
1009
|
+
&& normalizeSearchText(item.result?.name ?? item.ticker?.metadata.name ?? item.detail ?? "") === leadName));
|
|
1010
|
+
const before = items.slice(0, firstFund).filter((item) => !listings.includes(item));
|
|
1011
|
+
const rest = items.slice(firstFund).filter((item) => !listings.includes(item));
|
|
1012
|
+
return [...before, ...listings, ...rest];
|
|
1013
|
+
}
|
|
1014
|
+
|
|
928
1015
|
function limitTickerSearchCandidates<T extends TickerSearchCandidate>(
|
|
929
1016
|
items: T[],
|
|
930
1017
|
totalLimit: number,
|
|
@@ -60,7 +60,7 @@ import {
|
|
|
60
60
|
} from "./price-comparison";
|
|
61
61
|
import { chartQuoteOverrideKeyForSource } from "./live-quotes";
|
|
62
62
|
import { coinLegsAtSessionClose } from "./coin-session-close";
|
|
63
|
-
import { chartSeriesSourceKey } from "../capabilities/chart-series";
|
|
63
|
+
import { chartSeriesSourceKey, uncoveredCapabilityMessage } from "../capabilities/chart-series";
|
|
64
64
|
import { rememberSeedListingFacts } from "./parsed-history-cache";
|
|
65
65
|
import {
|
|
66
66
|
canonicalExchange,
|
|
@@ -822,7 +822,7 @@ async function resolveChartSpecPass(
|
|
|
822
822
|
try {
|
|
823
823
|
if (seriesSpec.source.kind === "capability") {
|
|
824
824
|
if (!sources.resolveCapabilitySeries) {
|
|
825
|
-
throw new Error(
|
|
825
|
+
throw new Error(uncoveredCapabilityMessage(seriesSpec.source.capabilityId, seriesSpec.source.seriesId));
|
|
826
826
|
}
|
|
827
827
|
const capabilityBounds = capabilityRequestBounds(requestVisibleBounds, initialVisibleBounds, movedWindow);
|
|
828
828
|
const capabilityViewport: ChartSpec["viewport"] = {
|
package/src/types/config.ts
CHANGED
|
@@ -132,6 +132,11 @@ export interface FloatingPaneEntry {
|
|
|
132
132
|
width: number;
|
|
133
133
|
height: number;
|
|
134
134
|
zIndex?: number;
|
|
135
|
+
/**
|
|
136
|
+
* Floating windows stacked as tabs share this key and one rect; the one
|
|
137
|
+
* in front (highest z) is shown (layout/pane-manager/floating-stack.ts).
|
|
138
|
+
*/
|
|
139
|
+
stack?: string;
|
|
135
140
|
}
|
|
136
141
|
|
|
137
142
|
interface DetachedPaneEntry {
|
|
@@ -27,6 +27,8 @@ export interface ContextMenuActionItem extends ContextMenuItemBase {
|
|
|
27
27
|
label: string;
|
|
28
28
|
onSelect?: () => void | Promise<void>;
|
|
29
29
|
submenu?: ContextMenuItem[];
|
|
30
|
+
/** The prompt the item answers (a pane's Approve), as `metadata.scope` on the menu drawn in the app. */
|
|
31
|
+
remoteScope?: string;
|
|
30
32
|
}
|
|
31
33
|
|
|
32
34
|
export interface ContextMenuRoleItem extends ContextMenuItemBase {
|
package/src/types/financials.ts
CHANGED
|
@@ -546,6 +546,7 @@ export interface AnalystRatingRecord {
|
|
|
546
546
|
}
|
|
547
547
|
|
|
548
548
|
export interface AnalystEstimateRecord {
|
|
549
|
+
epsBasis?: "gaap" | "adjusted" | "unknown";
|
|
549
550
|
date: string;
|
|
550
551
|
period: string;
|
|
551
552
|
/** Explicit currency for these estimates; independent of the listing currency. */
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import type { AppConfig, LayoutConfig } from "./config";
|
|
2
|
+
import type { WizardStep } from "./plugin-shared";
|
|
3
|
+
|
|
4
|
+
export interface CommandShortcutArgContext {
|
|
5
|
+
activeTicker: string | null;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
interface CommandShortcutArgDef {
|
|
9
|
+
placeholder?: string;
|
|
10
|
+
kind?: "text" | "ticker" | "ticker-list";
|
|
11
|
+
parse?: (
|
|
12
|
+
arg: string,
|
|
13
|
+
context: CommandShortcutArgContext,
|
|
14
|
+
) => Record<string, string>;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface CommandResultDef {
|
|
18
|
+
id: string;
|
|
19
|
+
label: string;
|
|
20
|
+
detail?: string;
|
|
21
|
+
category?: string;
|
|
22
|
+
/** Short tag drawn left of the label, as on a search provider's row. Six characters at most. */
|
|
23
|
+
badge?: string;
|
|
24
|
+
/** Drawn muted after the label, e.g. a person's full name after their @username. */
|
|
25
|
+
name?: string;
|
|
26
|
+
right?: string;
|
|
27
|
+
keywords?: string[];
|
|
28
|
+
current?: boolean;
|
|
29
|
+
disabled?: boolean;
|
|
30
|
+
execute: () => void | Promise<void>;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface CommandBarResultLineSegment {
|
|
34
|
+
text: string;
|
|
35
|
+
emphasis?: "match" | "muted";
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface CommandBarResultLine {
|
|
39
|
+
segments: CommandBarResultLineSegment[];
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface CommandBarResultDef {
|
|
43
|
+
id: string;
|
|
44
|
+
label: string;
|
|
45
|
+
detail?: string;
|
|
46
|
+
/** Rendered under the label. Each entry is one additional row. */
|
|
47
|
+
lines?: CommandBarResultLine[];
|
|
48
|
+
category?: string;
|
|
49
|
+
/** Short tag drawn left of the label, e.g. a document type. Six characters at most. */
|
|
50
|
+
badge?: string;
|
|
51
|
+
/** Drawn muted after the label, e.g. a person's full name after their @username. */
|
|
52
|
+
name?: string;
|
|
53
|
+
right?: string;
|
|
54
|
+
keywords?: string[];
|
|
55
|
+
disabled?: boolean;
|
|
56
|
+
execute: () => void | Promise<void>;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export interface CommandBarSearchContext {
|
|
60
|
+
activeTicker: string | null;
|
|
61
|
+
activeCollectionId: string | null;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export interface CommandBarSearchProvider {
|
|
65
|
+
id: string;
|
|
66
|
+
/** Section heading for these rows, e.g. "Documents". */
|
|
67
|
+
category: string;
|
|
68
|
+
/** Sort position of the section. Higher sinks. Navigation sections are negative; use a positive value to sit below them. */
|
|
69
|
+
priority?: number;
|
|
70
|
+
/** Skip the provider below this length. Default 3. */
|
|
71
|
+
minQueryLength?: number;
|
|
72
|
+
/** Default 300. Ignored by `match`. */
|
|
73
|
+
debounceMs?: number;
|
|
74
|
+
/**
|
|
75
|
+
* How long `provide` may take once it starts, in ms. Default 8000. Past it
|
|
76
|
+
* the bar aborts `signal`, drops a late answer and stops showing Searching.
|
|
77
|
+
* Ignored by `match`.
|
|
78
|
+
*/
|
|
79
|
+
timeoutMs?: number;
|
|
80
|
+
/**
|
|
81
|
+
* Codes (`CHAT`) after which the provider is still asked, typed alone or
|
|
82
|
+
* with text after them, with the whole query. Every other provider stays
|
|
83
|
+
* quiet once a code claims the text.
|
|
84
|
+
*/
|
|
85
|
+
shortcuts?: readonly string[];
|
|
86
|
+
provide(
|
|
87
|
+
query: string,
|
|
88
|
+
context: CommandBarSearchContext,
|
|
89
|
+
signal: AbortSignal,
|
|
90
|
+
): Promise<CommandBarResultDef[]>;
|
|
91
|
+
/**
|
|
92
|
+
* Rows from what the app already holds in memory. When set, the bar calls
|
|
93
|
+
* this instead of `provide`, as it renders and on every keystroke, so it
|
|
94
|
+
* must be cheap: no request, no waiting. Its rows are ranked with the bar's
|
|
95
|
+
* own matches as they are typed and sit under Suggested in the empty bar.
|
|
96
|
+
* Keep `provide` answering the same rows for older versions of the app.
|
|
97
|
+
*/
|
|
98
|
+
match?(query: string, context: CommandBarSearchContext): CommandBarResultDef[];
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export interface CommandDef {
|
|
102
|
+
id: string;
|
|
103
|
+
label: string;
|
|
104
|
+
keywords: string[];
|
|
105
|
+
shortcut?: string;
|
|
106
|
+
shortcutArg?: CommandShortcutArgDef;
|
|
107
|
+
buildResults?: (arg: string) => CommandResultDef[];
|
|
108
|
+
execute: (values?: Record<string, string>) => void | Promise<void>;
|
|
109
|
+
category: "navigation" | "data" | "portfolio" | "config";
|
|
110
|
+
description?: string;
|
|
111
|
+
wizard?: WizardStep[];
|
|
112
|
+
confirm?: CommandConfirmDef | ((context: CommandConfirmContext) => CommandConfirmDef | null);
|
|
113
|
+
/** @deprecated Ignored: a wizard always opens as one form with every step at once. */
|
|
114
|
+
wizardLayout?: "steps" | "form";
|
|
115
|
+
hidden?: () => boolean;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
interface CommandConfirmContext {
|
|
119
|
+
config: AppConfig;
|
|
120
|
+
layout: LayoutConfig;
|
|
121
|
+
activeTicker: string | null;
|
|
122
|
+
activeCollectionId: string | null;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
interface CommandConfirmDef {
|
|
126
|
+
title: string;
|
|
127
|
+
body: string[];
|
|
128
|
+
confirmLabel?: string;
|
|
129
|
+
cancelLabel?: string;
|
|
130
|
+
tone?: "default" | "danger";
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export interface KeyboardShortcut {
|
|
134
|
+
id: string;
|
|
135
|
+
key: string;
|
|
136
|
+
ctrl?: boolean;
|
|
137
|
+
shift?: boolean;
|
|
138
|
+
description: string;
|
|
139
|
+
execute: () => void;
|
|
140
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import type { PluginCapability } from "../capabilities";
|
|
2
|
+
import type { AppTickerRepositoryPort } from "../core/app-service-ports";
|
|
3
|
+
import type { ConnectionHealthRegistry } from "../core/connection-health";
|
|
4
|
+
import type { PluginEvents } from "../plugins/event-bus";
|
|
5
|
+
import type { SeriesDefinition } from "../series/types";
|
|
6
|
+
import type { SyncContributor, SyncTransport } from "../sync/types";
|
|
7
|
+
import type { PluginLogger } from "../utils/debug-log";
|
|
8
|
+
import type { BrokerAdapter } from "./broker";
|
|
9
|
+
import type { BrokerInstanceConfig } from "./config";
|
|
10
|
+
import type { DataProvider } from "./data-provider";
|
|
11
|
+
import type { TickerFinancials } from "./financials";
|
|
12
|
+
import type { BrokerContractRef, TickerListingRef } from "./instrument";
|
|
13
|
+
import type { CommandBarSearchProvider, CommandDef, KeyboardShortcut } from "./plugin-commands";
|
|
14
|
+
import type {
|
|
15
|
+
ContextMenuProviderDef,
|
|
16
|
+
CustomColumnDef,
|
|
17
|
+
TickerAction,
|
|
18
|
+
TickerResearchTabDef,
|
|
19
|
+
} from "./plugin-contributions";
|
|
20
|
+
import type { AppNotificationDelivery, AppNotificationRequest } from "./plugin-notifications";
|
|
21
|
+
import type { PaneTemplateCreateOptions, PaneTemplateDef } from "./plugin-pane-templates";
|
|
22
|
+
import type { PaneDef } from "./plugin-panes";
|
|
23
|
+
import type {
|
|
24
|
+
PluginConfigState,
|
|
25
|
+
PluginPaneSettingsState,
|
|
26
|
+
PluginPersistence,
|
|
27
|
+
PluginResumeState,
|
|
28
|
+
PluginTeamState,
|
|
29
|
+
} from "./plugin-state";
|
|
30
|
+
import type { TickerRecord } from "./ticker";
|
|
31
|
+
|
|
32
|
+
export interface BrokerInstanceUpdateOptions {
|
|
33
|
+
label?: string;
|
|
34
|
+
enabled?: boolean;
|
|
35
|
+
replaceConfig?: boolean;
|
|
36
|
+
/** Keep this connection's data on this device, out of Gloom Cloud sync (`BrokerInstanceConfig.localOnly`). */
|
|
37
|
+
localOnly?: boolean;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface BrokerInstanceCreateOptions {
|
|
41
|
+
/** Keep the new connection's data on this device from the start, before its first import. */
|
|
42
|
+
localOnly?: boolean;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface PinTickerOptions {
|
|
46
|
+
floating?: boolean;
|
|
47
|
+
paneType?: string;
|
|
48
|
+
forceNewPane?: boolean;
|
|
49
|
+
/** Preserve a contract explicitly selected from instrument search. */
|
|
50
|
+
instrument?: BrokerContractRef | null;
|
|
51
|
+
listing?: TickerListingRef;
|
|
52
|
+
/** Select this research tab once the requested ticker has resolved. */
|
|
53
|
+
tabId?: string;
|
|
54
|
+
/** Merge this state into the resolved research pane when selecting `tabId`. */
|
|
55
|
+
tabState?: Record<string, unknown>;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export interface GloomPluginContext {
|
|
59
|
+
registerPane(pane: PaneDef): void;
|
|
60
|
+
/** Returns a disposer; templates added after setup (team views) use it. */
|
|
61
|
+
registerPaneTemplate(template: PaneTemplateDef): () => void;
|
|
62
|
+
registerCommand(command: CommandDef): void;
|
|
63
|
+
registerCommandBarSearchProvider(provider: CommandBarSearchProvider): () => void;
|
|
64
|
+
registerColumn(column: CustomColumnDef): void;
|
|
65
|
+
registerBroker(broker: BrokerAdapter): void;
|
|
66
|
+
registerCapability(capability: PluginCapability): void;
|
|
67
|
+
registerTickerResearchTab(tab: TickerResearchTabDef): void;
|
|
68
|
+
registerShortcut(shortcut: KeyboardShortcut): void;
|
|
69
|
+
registerTickerAction(action: TickerAction): void;
|
|
70
|
+
registerContextMenuProvider(provider: ContextMenuProviderDef): void;
|
|
71
|
+
/**
|
|
72
|
+
* Adds a series to the data catalog and the chart composer, at any time
|
|
73
|
+
* after setup starts (after loading a list, say). Throws when the definition
|
|
74
|
+
* is invalid or its id is taken; the returned function removes it again.
|
|
75
|
+
*/
|
|
76
|
+
registerSeries(series: SeriesDefinition): () => void;
|
|
77
|
+
registerSyncContributor(contributor: SyncContributor): () => void;
|
|
78
|
+
registerSyncTransport(transport: SyncTransport): () => void;
|
|
79
|
+
watchNewsQuery?(
|
|
80
|
+
query: import("./news-source").NewsQuery,
|
|
81
|
+
listener: (state: import("./news-source").NewsQueryState) => void,
|
|
82
|
+
): () => void;
|
|
83
|
+
|
|
84
|
+
getData(ticker: string): TickerFinancials | null;
|
|
85
|
+
getTicker(ticker: string): TickerRecord | null;
|
|
86
|
+
getConfig(): import("./config").AppConfig;
|
|
87
|
+
/** Resolve a broker registered by another plugin, without connecting it. */
|
|
88
|
+
getBrokerAdapter?(brokerType: string): BrokerAdapter | null;
|
|
89
|
+
getPaneDef(paneId: string): PaneDef | undefined;
|
|
90
|
+
|
|
91
|
+
readonly marketData: DataProvider;
|
|
92
|
+
readonly connectionHealth: ConnectionHealthRegistry;
|
|
93
|
+
readonly tickerRepository: AppTickerRepositoryPort;
|
|
94
|
+
readonly persistence: PluginPersistence;
|
|
95
|
+
readonly log: PluginLogger;
|
|
96
|
+
readonly resume: PluginResumeState;
|
|
97
|
+
readonly configState: PluginConfigState;
|
|
98
|
+
readonly paneSettings: PluginPaneSettingsState;
|
|
99
|
+
readonly teamState: PluginTeamState;
|
|
100
|
+
|
|
101
|
+
createBrokerInstance(brokerType: string, label: string, values: Record<string, unknown>, options?: BrokerInstanceCreateOptions): Promise<BrokerInstanceConfig>;
|
|
102
|
+
updateBrokerInstance(instanceId: string, values: Record<string, unknown>, options?: BrokerInstanceUpdateOptions): Promise<void>;
|
|
103
|
+
syncBrokerInstance(instanceId: string): Promise<void>;
|
|
104
|
+
removeBrokerInstance(instanceId: string): Promise<void>;
|
|
105
|
+
|
|
106
|
+
selectTicker(symbol: string, paneId?: string): void;
|
|
107
|
+
/** Focus the leftmost or rightmost docked pane. */
|
|
108
|
+
switchPanel(panel: "left" | "right"): void;
|
|
109
|
+
switchTab(tabId: string, paneId?: string): void;
|
|
110
|
+
openCommandBar(query?: string): void;
|
|
111
|
+
showPane(paneId: string): void;
|
|
112
|
+
createPaneFromTemplate(templateId: string, options?: PaneTemplateCreateOptions): void;
|
|
113
|
+
hidePane(paneId: string): void;
|
|
114
|
+
focusPane(paneId: string): void;
|
|
115
|
+
pinTicker(symbol: string, options?: PinTickerOptions): void;
|
|
116
|
+
navigateTicker(symbol: string, options?: { sourcePaneId?: string | null }): void;
|
|
117
|
+
openPaneSettings(paneId?: string): void;
|
|
118
|
+
/** Shares a pane instance (the focused pane when omitted): copies a live link to it. */
|
|
119
|
+
sharePane(paneId?: string): void;
|
|
120
|
+
|
|
121
|
+
on<K extends keyof PluginEvents>(event: K, handler: (payload: PluginEvents[K]) => void): () => void;
|
|
122
|
+
emit<K extends keyof PluginEvents>(event: K, payload: PluginEvents[K]): void;
|
|
123
|
+
|
|
124
|
+
notify(notification: AppNotificationRequest): AppNotificationDelivery | void;
|
|
125
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { AppConfig, ColumnConfig } from "./config";
|
|
3
|
+
import type { ContextMenuContext, ContextMenuItem } from "./context-menu";
|
|
4
|
+
import type { TickerFinancials } from "./financials";
|
|
5
|
+
import type { TickerInstrumentKind } from "./instrument";
|
|
6
|
+
import type { TickerRecord } from "./ticker";
|
|
7
|
+
|
|
8
|
+
export interface CustomColumnDef extends ColumnConfig {
|
|
9
|
+
render: (ticker: TickerRecord, financials: TickerFinancials | null) => string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface TickerResearchTabProps {
|
|
13
|
+
width: number;
|
|
14
|
+
height: number;
|
|
15
|
+
focused: boolean;
|
|
16
|
+
onCapture: (capturing: boolean) => void;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
interface TickerResearchTabVisibilityContext {
|
|
20
|
+
config: AppConfig;
|
|
21
|
+
ticker: TickerRecord | null;
|
|
22
|
+
financials: TickerFinancials | null | undefined;
|
|
23
|
+
hasOptionsChain: boolean;
|
|
24
|
+
/** Resolved from the quote, broker contract and saved type; `equity` when nothing says otherwise. */
|
|
25
|
+
instrumentKind: TickerInstrumentKind;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface TickerResearchTabDef {
|
|
29
|
+
id: string;
|
|
30
|
+
name: string;
|
|
31
|
+
order: number;
|
|
32
|
+
component: (props: TickerResearchTabProps) => ReactNode;
|
|
33
|
+
/**
|
|
34
|
+
* Instrument kinds this tab has data for, such as `["equity"]` for company
|
|
35
|
+
* filings. Omit when every ticker has it (chart, news, notes).
|
|
36
|
+
*/
|
|
37
|
+
instruments?: readonly TickerInstrumentKind[];
|
|
38
|
+
/** Narrower checks than `instruments`: a US listing, an options chain, a connected broker. */
|
|
39
|
+
isVisible?: (context: TickerResearchTabVisibilityContext) => boolean;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface TickerAction {
|
|
43
|
+
id: string;
|
|
44
|
+
label: string;
|
|
45
|
+
keywords: string[];
|
|
46
|
+
filter?: (ticker: TickerRecord) => boolean;
|
|
47
|
+
execute: (ticker: TickerRecord, financials: TickerFinancials | null) => void | Promise<void>;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface ContextMenuProviderDef {
|
|
51
|
+
id: string;
|
|
52
|
+
order?: number;
|
|
53
|
+
contexts?: ContextMenuContext["kind"][];
|
|
54
|
+
getItems(context: ContextMenuContext): ContextMenuItem[] | null | undefined;
|
|
55
|
+
}
|