@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
|
@@ -4,13 +4,14 @@
|
|
|
4
4
|
// once per session and arms itself again for the next one.
|
|
5
5
|
import { changeBasisLabel, quoteChangeBasis, type QuoteChangeBasis } from "../../../market-data/market/change-basis";
|
|
6
6
|
import { getActiveQuoteDisplay } from "../../../market-data/market/status";
|
|
7
|
+
import { quoteTradingDay } from "../../../market-data/quotes/day-range";
|
|
7
8
|
import type { Quote } from "../../../types/financials";
|
|
8
9
|
import type { AlertCondition, AlertRule } from "./types";
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* Move rules keep a synced list of their own: an app or a Gloom Cloud that
|
|
12
|
-
* reads `alerts` would judge `up 3` as a price above 3.
|
|
13
|
-
*
|
|
13
|
+
* reads `alerts` would judge `up 3` as a price above 3. The running app checks
|
|
14
|
+
* them, and for a signed-in account with Cloud sync, Gloom Cloud does too.
|
|
14
15
|
*/
|
|
15
16
|
export const MOVE_ALERTS_KEY = "moveAlerts";
|
|
16
17
|
|
|
@@ -25,11 +26,13 @@ export function moveCondition(word: string | undefined): AlertCondition | null {
|
|
|
25
26
|
}
|
|
26
27
|
|
|
27
28
|
/**
|
|
28
|
-
* Who hears of a move:
|
|
29
|
-
*
|
|
30
|
-
*
|
|
29
|
+
* Who hears of a move, as docs/usage.md states it: the running app checks its
|
|
30
|
+
* move rules. Signed in with Cloud sync, Gloom Cloud checks them too and, with
|
|
31
|
+
* the app closed, pushes one that goes off to a registered phone and lists it
|
|
32
|
+
* in the day's market email, unless the app already alerted on that session
|
|
33
|
+
* (`moveDay`). Said where a move alert is made, as a price alert's add says it.
|
|
31
34
|
*/
|
|
32
|
-
export const
|
|
35
|
+
export const MOVE_DELIVERY = "The app alerts while it is running; sign in with Cloud sync for a phone alert and a line in the day's market email when it is closed.";
|
|
33
36
|
|
|
34
37
|
/** The largest move a rule takes, in percent: a fall cannot pass 100%. */
|
|
35
38
|
const MAX_MOVE_PERCENT = 100;
|
|
@@ -82,6 +85,12 @@ export interface MoveReading {
|
|
|
82
85
|
* a reading can set off an armed rule, never arm one again.
|
|
83
86
|
*/
|
|
84
87
|
session: string | null;
|
|
88
|
+
/**
|
|
89
|
+
* The move's own session, as the quote dates its change (changeSessionDate,
|
|
90
|
+
* the 2026-11-06 session), the way Gloom Cloud dates the moves it judges;
|
|
91
|
+
* null when nothing dates it.
|
|
92
|
+
*/
|
|
93
|
+
day: string | null;
|
|
85
94
|
}
|
|
86
95
|
|
|
87
96
|
const utcDay = (time: number) => new Date(time).toISOString().slice(0, 10);
|
|
@@ -99,7 +108,15 @@ export function readMove(quote: Quote, now = Date.now()): MoveReading | null {
|
|
|
99
108
|
const basis = quoteChangeBasis(quote, { session: "active" });
|
|
100
109
|
if (!basis) return null;
|
|
101
110
|
const session = "date" in basis ? basis.date : basis.kind === "utc day" || basis.kind === "24h" ? utcDay(now) : null;
|
|
102
|
-
return { percent, basis, session };
|
|
111
|
+
return { percent, basis, session, day: moveDayOf(quote, basis, now) };
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/** The session a quote dates its move to: its changeSessionDate, a coin's UTC day, else its trading day. */
|
|
115
|
+
function moveDayOf(quote: Quote, basis: QuoteChangeBasis, now: number): string | null {
|
|
116
|
+
if (quote.changeSessionDate && ISO_DAY.test(quote.changeSessionDate)) return quote.changeSessionDate;
|
|
117
|
+
if (basis.kind === "utc day" || basis.kind === "24h") return utcDay(now);
|
|
118
|
+
const day = quoteTradingDay(quote);
|
|
119
|
+
return day && ISO_DAY.test(day) ? day : null;
|
|
103
120
|
}
|
|
104
121
|
|
|
105
122
|
/** A reading this recent dates an undated one after it: the same session, read by a stream and a poll that disagree. */
|
|
@@ -138,7 +155,8 @@ export function moveReached(alert: Pick<AlertRule, "condition" | "targetPrice">,
|
|
|
138
155
|
* dated session later than the one it went off in: a print after the close,
|
|
139
156
|
* a weekend quote, or a stream and a poll that date the move a day apart
|
|
140
157
|
* never arm it twice. Then it goes off when the move reaches it, once for the
|
|
141
|
-
* session
|
|
158
|
+
* session, and the rule keeps the move's session (`moveDay`, the latest) for
|
|
159
|
+
* Gloom Cloud. Returns the rule with its reading, and whether it went off now.
|
|
142
160
|
*/
|
|
143
161
|
export function judgeMove(alert: AlertRule, quote: Quote, now = Date.now()): { alert: AlertRule; fired: boolean; reading: MoveReading | null } {
|
|
144
162
|
const reading = readMove(quote, now);
|
|
@@ -150,7 +168,10 @@ export function judgeMove(alert: AlertRule, quote: Quote, now = Date.now()): { a
|
|
|
150
168
|
// A session it already went off in, as a dated reading says, never sets it off again.
|
|
151
169
|
const wentOff = !!reading.session && !!last && reading.session <= last && next.moveSession != null;
|
|
152
170
|
const fired = next.status === "active" && !wentOff && moveReached(next, reading.percent);
|
|
153
|
-
if (fired)
|
|
171
|
+
if (fired) {
|
|
172
|
+
const day = reading.day && (!alert.moveDay || reading.day > alert.moveDay) ? { moveDay: reading.day } : {};
|
|
173
|
+
next = { ...next, status: "triggered", triggeredAt: now, moveSession: firedSession(alert, reading, now), ...day };
|
|
174
|
+
}
|
|
154
175
|
return { alert: next, fired, reading };
|
|
155
176
|
}
|
|
156
177
|
|
|
@@ -116,8 +116,6 @@ function AlertDetail({ alert, scrollRef }: { alert: AlertRule; scrollRef: RefObj
|
|
|
116
116
|
{reason ? null : <KeyValueRow {...DETAIL_ROW} label={alert.move ? "Move" : "Current"} value={formatCurrentPrice(alert, 24)} />}
|
|
117
117
|
{/* What a move is measured from, as the quote's change line names it. */}
|
|
118
118
|
{!reason && alert.move ? <KeyValueRow {...DETAIL_ROW} label="From" value={moveBasisText(alert.lastMoveBasis).replace(/^vs /, "")} tone="muted" /> : null}
|
|
119
|
-
{/* Only the running app checks a move: no email or phone alert comes of it, signed in or not. */}
|
|
120
|
-
{alert.move ? <KeyValueRow {...DETAIL_ROW} label="Notifies" value="Only while the app is running; no email or phone alert, even with Cloud sync" /> : null}
|
|
121
119
|
{/* The two readings that place the quadrant, as RRG states them. */}
|
|
122
120
|
{!reason && alert.metric?.kind === "rrg" && alert.lastCheckedPrice != null && alert.lastCheckedTarget != null ? <>
|
|
123
121
|
<KeyValueRow {...DETAIL_ROW} label="Strength" value={alert.lastCheckedPrice.toFixed(2)} />
|
|
@@ -34,7 +34,9 @@ export async function saveAlerts(
|
|
|
34
34
|
// A list never written that stays empty (moves, on a profile without them) is left unwritten.
|
|
35
35
|
if (current === value || (current == null && value === "[]")) continue;
|
|
36
36
|
// Move rules that read as the ones to write are left as written, whatever the order of their fields: a check changes no rule.
|
|
37
|
-
|
|
37
|
+
// A list an older app wrote, without `syncsMoveDay`, is written once more, so Gloom Cloud may judge its rules.
|
|
38
|
+
if (key === MOVE_ALERTS_KEY && !stores.errors[key] && serializeAlerts(deserializeAlerts(current).map(moveRuleOnly)) === value
|
|
39
|
+
&& deserializeAlerts(current).every((alert) => alert.syncsMoveDay === true)) continue;
|
|
38
40
|
await ctx.configState.set(key, value);
|
|
39
41
|
}
|
|
40
42
|
}
|
|
@@ -69,7 +71,7 @@ export function readLevelAlertStores(get: (key: string) => unknown): { alerts: A
|
|
|
69
71
|
return { alerts, errors, error: Object.values(errors).filter(Boolean).join(" ") || null };
|
|
70
72
|
}
|
|
71
73
|
export function writeLevelAlertStores(alerts: AlertRule[]): Record<string, string> {
|
|
72
|
-
// A move rule is written as the rule
|
|
74
|
+
// A move rule is written as the rule and the session it last went off in: its readings are this device's (`MOVE_CHECKS_KEY`), so a check never changes the list.
|
|
73
75
|
return Object.fromEntries(LEVEL_ALERT_KEYS.map(key => [key, serializeAlerts(alerts.filter(a => levelAlertStoreKey(a) === key)
|
|
74
76
|
.map((alert) => alert.move ? moveRuleOnly(alert) : alert))]));
|
|
75
77
|
}
|
|
@@ -19,6 +19,18 @@ export interface AlertRule {
|
|
|
19
19
|
move?: boolean;
|
|
20
20
|
/** The session a move rule last went off in (the close it was measured from); it arms again in the next one. */
|
|
21
21
|
moveSession?: string;
|
|
22
|
+
/**
|
|
23
|
+
* The latest session a move rule went off in on a device, as its quote dates
|
|
24
|
+
* the move (changeSessionDate). Kept in the synced rule, so Gloom Cloud never
|
|
25
|
+
* pushes or emails a session the app already alerted on.
|
|
26
|
+
*/
|
|
27
|
+
moveDay?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Written on every synced move rule by an app that syncs `moveDay`. Gloom
|
|
30
|
+
* Cloud judges only rules that carry it: an older app alerts on its own and
|
|
31
|
+
* syncs nothing of it, and drops the field when it rewrites the list.
|
|
32
|
+
*/
|
|
33
|
+
syncsMoveDay?: true;
|
|
22
34
|
/** What the last move read was measured from, as its quote's change line names it. */
|
|
23
35
|
lastMoveBasis?: QuoteChangeBasis;
|
|
24
36
|
lastDailyClose?: string;
|
|
@@ -83,15 +83,20 @@ export interface RiskMarketSnapshot {
|
|
|
83
83
|
}
|
|
84
84
|
/**
|
|
85
85
|
* The most holdings one load requests daily history for, largest current USD
|
|
86
|
-
* value first. Each holding costs one
|
|
87
|
-
*
|
|
86
|
+
* value first. Each holding costs one read of up to 18 months of closes,
|
|
87
|
+
* sixteen to a batch request, again after every two-minute cache expiry, and the
|
|
88
88
|
* correlation view pairs every basket holding with every other. See
|
|
89
89
|
* docs/research-data.md for the measured cost behind the number.
|
|
90
90
|
*/
|
|
91
91
|
export const RISK_HISTORY_LIMIT = 150;
|
|
92
92
|
/** Holdings quoted in one load, 50 to a batch request. */
|
|
93
93
|
const RISK_QUOTE_LIMIT = 500;
|
|
94
|
-
|
|
94
|
+
/**
|
|
95
|
+
* Histories asked at once. They go out sixteen to a batch request, side by
|
|
96
|
+
* side (getCloudHistory's `batch`): a 60-holding book is four requests, where
|
|
97
|
+
* four single reads at a time took about 6 s.
|
|
98
|
+
*/
|
|
99
|
+
const HISTORY_CONCURRENCY = 64;
|
|
95
100
|
const MAX_FX_CURRENCIES = 24;
|
|
96
101
|
export const BEYOND_SIZE_REASON = `Beyond the supported size: only the ${RISK_HISTORY_LIMIT} largest holdings by value are modelled`;
|
|
97
102
|
// Listing venues as the quotes report them; MTUM and QUAL list on Cboe BZX, not Arca.
|
|
@@ -402,7 +407,8 @@ export async function fetchPortfolioRiskMarket(
|
|
|
402
407
|
const key = `${canonicalExchange(exchange)}:${normalizeSymbol(symbol)}`;
|
|
403
408
|
let loading = dailyHistories.get(key);
|
|
404
409
|
if (!loading) {
|
|
405
|
-
|
|
410
|
+
// Read over the window every holding shares, so they go out together; the signal stops the wait, not a batch others share.
|
|
411
|
+
dailyHistories.set(key, loading = client.getCloudHistory(symbol, exchange, historyParams, { batch: true, sharedWindow: true, ...(signal ? { signal } : {}) }));
|
|
406
412
|
loading.catch(() => {
|
|
407
413
|
// Intentional ignore: the failure is raised where the history is read.
|
|
408
414
|
});
|
|
@@ -72,7 +72,8 @@ export interface RiskEpisodeTarget {
|
|
|
72
72
|
const DAY_MS = 86_400_000;
|
|
73
73
|
/** A boundary close may be this many days before its date: a weekend, a holiday or a market's own closure. */
|
|
74
74
|
const BOUNDARY_DAYS = 7;
|
|
75
|
-
|
|
75
|
+
/** Reads asked at once; they go out sixteen to a batch request over the episodes' one window. */
|
|
76
|
+
const EPISODE_CONCURRENCY = 64;
|
|
76
77
|
const SPY = RISK_FACTOR_INSTRUMENTS[0]!;
|
|
77
78
|
|
|
78
79
|
/** The one window every episode fits in, with room for a start date's close a holiday before it. */
|
|
@@ -149,12 +150,12 @@ export function cloudEpisodeReader(client: EpisodeClient = apiClient): EpisodeRe
|
|
|
149
150
|
const params = { interval: "1day", ...episodeSpan(), outputsize: 1500 } as const;
|
|
150
151
|
return {
|
|
151
152
|
async instrument(instrument, signal) {
|
|
152
|
-
return episodeCloses(dailyCloses(await client.getCloudHistory(instrument.symbol, instrument.exchange, params, signal ? { signal } :
|
|
153
|
+
return episodeCloses(dailyCloses(await client.getCloudHistory(instrument.symbol, instrument.exchange, params, { batch: true, sharedWindow: true, ...(signal ? { signal } : {}) })));
|
|
153
154
|
},
|
|
154
155
|
async currency(currency, signal) {
|
|
155
156
|
const leg = riskConversion(currency)?.leg;
|
|
156
157
|
if (!leg) throw new Error(`No daily FX pair for ${currency}`);
|
|
157
|
-
const points = dailyCloses(await client.getCloudHistory(leg.instrument.symbol, leg.instrument.exchange ?? "", params, signal ? { signal } :
|
|
158
|
+
const points = dailyCloses(await client.getCloudHistory(leg.instrument.symbol, leg.instrument.exchange ?? "", params, { batch: true, sharedWindow: true, ...(signal ? { signal } : {}) }));
|
|
158
159
|
return episodeCloses(points.map((point) => ({ ...point, close: leg.invert ? 1 / point.close : point.close })));
|
|
159
160
|
},
|
|
160
161
|
};
|
|
@@ -181,7 +182,7 @@ export function onceEpisodeReader(reader: EpisodeReader): EpisodeReader {
|
|
|
181
182
|
/**
|
|
182
183
|
* The closes the episode replays read: SPY's, every target's, and the daily
|
|
183
184
|
* FX closes of each currency a target quotes in and of a non-USD account,
|
|
184
|
-
*
|
|
185
|
+
* all asked at once, sixteen to a batch request. A read that fails is named in `errors`, and the
|
|
185
186
|
* replays move that holding by proxy; the signal stops the load.
|
|
186
187
|
*/
|
|
187
188
|
export async function fetchRiskEpisodeHistory(
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { portfolioSectorReport } from "./risk-sectors";
|
|
1
2
|
import { loadPortfolioOptionBook } from "./risk-options";
|
|
2
3
|
import type { HeadlessPaneDefinition } from "../../../types/plugin";
|
|
3
4
|
import { fetchPortfolioRiskMarket, RISK_HISTORY_LIMIT } from "./risk-client";
|
|
@@ -188,8 +189,8 @@ export const portfolioRiskHeadless: HeadlessPaneDefinition<"bundle"> = {
|
|
|
188
189
|
type: "enum",
|
|
189
190
|
settingKey: "riskView",
|
|
190
191
|
// No default: left out, the report prints every view.
|
|
191
|
-
values: RISK_VIEWS.map((value) => ({ value })),
|
|
192
|
-
description: "One portfolio risk view;
|
|
192
|
+
values: [...RISK_VIEWS, "sectors"].map((value) => ({ value })),
|
|
193
|
+
description: "One portfolio risk view; sectors compares direct company sector weights, cash and unclassified holdings against SPY (S&P 500) in percentage points. Every standard risk view when left out.",
|
|
193
194
|
},
|
|
194
195
|
{
|
|
195
196
|
key: "since",
|
|
@@ -262,6 +263,7 @@ export const portfolioRiskHeadless: HeadlessPaneDefinition<"bundle"> = {
|
|
|
262
263
|
describe: (args, result) =>
|
|
263
264
|
`Portfolio risk | ${reportPortfolioName(result?.metadata) || args.rawArgument || "local portfolio"}`,
|
|
264
265
|
async load(args, ctx) {
|
|
266
|
+
if (args.options.view === "sectors") return portfolioSectorReport(args, ctx);
|
|
265
267
|
// The host reads the argument by id or name, in any case; everything after goes by the configured id.
|
|
266
268
|
const requested = args.rawArgument.trim() || ctx.config.portfolios[0]?.id;
|
|
267
269
|
if (!requested || !ctx.resolvePortfolio)
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import type { HeadlessBundleResult, HeadlessPaneContext, HeadlessPaneLoadArgs, HeadlessPaneRow } from "../../../types/headless";
|
|
2
|
+
import { canonicalTickerKey } from "../../../utils/exchanges";
|
|
3
|
+
import { formatNumber } from "../../../utils/format";
|
|
4
|
+
import { CASH_SYMBOL } from "../../../portfolio/allocation";
|
|
5
|
+
import type { FundMembersPayload } from "../../../api-client/members";
|
|
6
|
+
import { collectionHoldingsHeadless } from "../portfolio-list/headless";
|
|
7
|
+
|
|
8
|
+
const SECTOR_NAMES: Record<string, string> = {
|
|
9
|
+
technology: "Information Technology", "information technology": "Information Technology",
|
|
10
|
+
"financial services": "Financials", financials: "Financials", "health care": "Health Care", healthcare: "Health Care",
|
|
11
|
+
"consumer cyclical": "Consumer Discretionary", "consumer discretionary": "Consumer Discretionary",
|
|
12
|
+
"consumer defensive": "Consumer Staples", "consumer staples": "Consumer Staples",
|
|
13
|
+
"basic materials": "Materials", materials: "Materials", "communication services": "Communication Services", communication: "Communication Services",
|
|
14
|
+
"cash and/or derivatives": "Cash", cash: "Cash",
|
|
15
|
+
energy: "Energy", industrials: "Industrials", "real estate": "Real Estate", utilities: "Utilities",
|
|
16
|
+
};
|
|
17
|
+
const sectorName = (value: unknown) => typeof value === "string" ? SECTOR_NAMES[value.trim().toLowerCase()] ?? null : null;
|
|
18
|
+
|
|
19
|
+
/** Signed positions as a share of net liquidation, including cash. Unknowns stay in the denominator. */
|
|
20
|
+
export function comparePortfolioSectors(positions: HeadlessPaneRow[], total: number, benchmark: FundMembersPayload,
|
|
21
|
+
sectors: ReadonlyMap<string, string | null>) {
|
|
22
|
+
if (!Number.isFinite(total) || total <= 0) throw new Error("Sector comparison needs positive net liquidation.");
|
|
23
|
+
const book = new Map<string, number>(), index = new Map<string, number>();
|
|
24
|
+
const unknown: HeadlessPaneRow[] = [];
|
|
25
|
+
for (const member of benchmark.members) {
|
|
26
|
+
const sector = sectorName(member.sector) ?? "Unknown benchmark sector";
|
|
27
|
+
if (member.weight != null && Number.isFinite(member.weight)) index.set(sector, (index.get(sector) ?? 0) + member.weight * 100);
|
|
28
|
+
}
|
|
29
|
+
if (![...index.values()].some(weight => weight > 0)) throw new Error("No benchmark sector weights are available.");
|
|
30
|
+
for (const position of positions) {
|
|
31
|
+
const symbol = String(position.symbol);
|
|
32
|
+
const sector = symbol === CASH_SYMBOL ? "Cash" : sectorName(sectors.get(canonicalTickerKey(symbol, typeof position.exchange === "string" ? position.exchange : undefined))) ?? "Unclassified / funds";
|
|
33
|
+
const value = position.marketValue;
|
|
34
|
+
if (typeof value !== "number" || !Number.isFinite(value)) {
|
|
35
|
+
unknown.push({ symbol, reason: "Position has no market value", weightPercent: null });
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
const weight = 100 * value / total;
|
|
39
|
+
book.set(sector, (book.get(sector) ?? 0) + weight);
|
|
40
|
+
if (sector === "Unclassified / funds") unknown.push({ symbol, reason: "No company sector; funds are not looked through", weightPercent: weight });
|
|
41
|
+
}
|
|
42
|
+
const rows = [...new Set([...book.keys(), ...index.keys()])].map(sector => ({ sector,
|
|
43
|
+
portfolioWeightPercent: book.get(sector) ?? 0, benchmarkWeightPercent: index.get(sector) ?? 0,
|
|
44
|
+
activeWeightPp: (book.get(sector) ?? 0) - (index.get(sector) ?? 0),
|
|
45
|
+
})).sort((a, b) => b.activeWeightPp - a.activeWeightPp || a.sector.localeCompare(b.sector));
|
|
46
|
+
return { rows, unknown };
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export async function portfolioSectorReport(args: HeadlessPaneLoadArgs, ctx: HeadlessPaneContext): Promise<HeadlessBundleResult> {
|
|
50
|
+
const [holdings, benchmark] = await Promise.all([
|
|
51
|
+
collectionHoldingsHeadless.load({ ...args, options: { limit: 200, close: false } }, ctx),
|
|
52
|
+
ctx.apiClient.getFundMembers("SPY"),
|
|
53
|
+
]);
|
|
54
|
+
const rows = holdings.rows;
|
|
55
|
+
const metadata = holdings.metadata ?? {};
|
|
56
|
+
const total = (metadata.totals as { total?: number } | undefined)?.total;
|
|
57
|
+
if (typeof total !== "number") throw new Error("Sector comparison needs portfolio holdings with net liquidation.");
|
|
58
|
+
const sectors = new Map<string, string | null>();
|
|
59
|
+
const missing = rows.filter(row => row.symbol !== CASH_SYMBOL);
|
|
60
|
+
// The batch preserves exact listing keys; membership under a matching bare ticker never classifies a namesake abroad.
|
|
61
|
+
if (missing.length && ctx.marketData.getTickerFinancialsBatch) {
|
|
62
|
+
for (let offset = 0; offset < missing.length; offset += 50) {
|
|
63
|
+
const chunk = missing.slice(offset, offset + 50);
|
|
64
|
+
const loaded = await ctx.marketData.getTickerFinancialsBatch(chunk.map(row => ({ symbol: String(row.symbol), exchange: String(row.exchange ?? "") })));
|
|
65
|
+
loaded.forEach(result => {
|
|
66
|
+
const financials = result.financials;
|
|
67
|
+
const fund = /ETF|FUND|MUTUAL/i.test(financials?.quote?.instrumentType ?? "");
|
|
68
|
+
sectors.set(canonicalTickerKey(result.target.symbol, result.target.exchange), fund ? null : financials?.profile?.sector ?? null);
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
ctx.signal.throwIfAborted();
|
|
73
|
+
const comparison = comparePortfolioSectors(rows, total, benchmark, sectors);
|
|
74
|
+
const truncated = typeof metadata.positions === "number" && metadata.positions > missing.length;
|
|
75
|
+
const unknownBenchmark = comparison.rows.some(row => row.sector === "Unknown benchmark sector");
|
|
76
|
+
return {
|
|
77
|
+
sections: [
|
|
78
|
+
{ title: `Sectors vs S&P 500 (${benchmark.fund.ticker} holdings)`, columns: [
|
|
79
|
+
{ key: "sector", header: "Sector" }, { key: "portfolioWeightPercent", header: "Book %", align: "right", format: value => formatNumber(Number(value), 2) },
|
|
80
|
+
{ key: "benchmarkWeightPercent", header: `${benchmark.fund.ticker} %`, align: "right", format: value => formatNumber(Number(value), 2) }, { key: "activeWeightPp", header: "Active pp", align: "right", format: value => formatNumber(Number(value), 2) },
|
|
81
|
+
], rows: comparison.rows },
|
|
82
|
+
{ title: "Unclassified holdings", columns: [{ key: "symbol", header: "Ticker" }, { key: "weightPercent", header: "Book %" }, { key: "reason", header: "Reason" }], rows: comparison.unknown },
|
|
83
|
+
],
|
|
84
|
+
complete: holdings.complete !== false && !truncated && !benchmark.stale && comparison.unknown.length === 0 && !unknownBenchmark,
|
|
85
|
+
notes: ["Signed market values / net liquidation, cash included; active weights are percentage points. Direct company sectors; funds are not looked through. Unknown weights remain in the denominator.",
|
|
86
|
+
`Benchmark: ${benchmark.fund.ticker} holdings as of ${benchmark.asOf}.`],
|
|
87
|
+
errors: [...(holdings.errors ?? []), ...(truncated ? ["Portfolio list exceeds 200 rows; the comparison covers only those returned."] : []),
|
|
88
|
+
...(benchmark.stale ? ["Benchmark holdings are stale."] : [])],
|
|
89
|
+
metadata: { portfolio: metadata.collection, currency: metadata.currency, netLiquidation: total, benchmark: benchmark.fund.ticker, benchmarkAsOf: benchmark.asOf },
|
|
90
|
+
};
|
|
91
|
+
}
|
|
@@ -8,7 +8,7 @@ export const awardsModule: PluginModule = {
|
|
|
8
8
|
setup(ctx) { awardsCache.attach(ctx.persistence); awardDetailCache.attach(ctx.persistence); },
|
|
9
9
|
dispose() { awardsCache.reset(); awardDetailCache.reset(); },
|
|
10
10
|
panes: [{ id: "awards", name: "Government Awards", icon: "A", get component(): typeof import("./pane").AwardsPane { const { AwardsPane } = require("./pane"); return AwardsPane; }, defaultPosition: "right", defaultMode: "floating",
|
|
11
|
-
defaultFloatingSize: { width: 132, height: 34 }, tickerFollower: true, instruments: ["equity"], tableExport: true, headless: awardsHeadless,
|
|
11
|
+
defaultFloatingSize: { width: 132, height: 34 }, shareItem: { ticker: true }, tickerFollower: true, instruments: ["equity"], tableExport: true, headless: awardsHeadless,
|
|
12
12
|
quickSettings: [{ type: "toggle", key: "awardAlerts", icon: "zap", label: "New awards above 1% of annual revenue" }],
|
|
13
13
|
settings: { title: "Government awards", fields: [{ type: "toggle", key: "awardAlerts", label: "New awards above 1% of annual revenue", description: "Notify while this pane is visible. Starts with the next refresh; historical backfills are excluded." }] } }],
|
|
14
14
|
paneTemplates: [{ id: "awards-pane", paneId: "awards", label: "Government Awards", description: "Pro: government awards, company history, agency concentration and revenue exposure with source evidence.",
|
|
@@ -47,6 +47,7 @@ export const buildoutModule: PluginModule = {
|
|
|
47
47
|
defaultPosition: "right",
|
|
48
48
|
defaultMode: "floating",
|
|
49
49
|
defaultFloatingSize: { width: 120, height: 32 },
|
|
50
|
+
shareItem: { ticker: true },
|
|
50
51
|
tickerFollower: true,
|
|
51
52
|
instruments: ["equity"],
|
|
52
53
|
reportOptions: [COMPANY_TAB_OPTION],
|
|
@@ -17,8 +17,8 @@ export const catalystsModule: PluginModule = {
|
|
|
17
17
|
},
|
|
18
18
|
dispose() { catalystCache.reset(); catalystDetailCache.reset(); },
|
|
19
19
|
panes: [
|
|
20
|
-
{ id: "catalysts", name: "Catalysts", icon: "C", component: CatalystsPane, defaultPosition: "right", tickerFollower: true, instruments: ["equity"], defaultMode: "floating", defaultFloatingSize: { width: 130, height: 32 }, tableExport: true, headless: catalystsHeadless },
|
|
21
|
-
{ id: "litigation", name: "Litigation", icon: "L", component: LitigationPane, defaultPosition: "right", defaultMode: "floating", defaultFloatingSize: { width: 120, height: 30 }, tickerFollower: true,
|
|
20
|
+
{ id: "catalysts", name: "Catalysts", icon: "C", component: CatalystsPane, defaultPosition: "right", shareItem: { ticker: true }, tickerFollower: true, instruments: ["equity"], defaultMode: "floating", defaultFloatingSize: { width: 130, height: 32 }, tableExport: true, headless: catalystsHeadless },
|
|
21
|
+
{ id: "litigation", name: "Litigation", icon: "L", component: LitigationPane, defaultPosition: "right", defaultMode: "floating", defaultFloatingSize: { width: 120, height: 30 }, shareItem: { ticker: true }, tickerFollower: true,
|
|
22
22
|
// A fund's trust can be a party (a sponsor's case against the SEC); an index or a pair never is.
|
|
23
23
|
instruments: ["equity", "fund"], tableExport: true, headless: litigationHeadless },
|
|
24
24
|
],
|
|
@@ -273,6 +273,10 @@ function projectCdsHeadless({ activity, history, levels, sort, days = DAILY_DAYS
|
|
|
273
273
|
// The 5Y figures are dated by their level's day, each trade and each daily level by its own.
|
|
274
274
|
const levelDate = line ? spreadSummary(line)?.date : undefined;
|
|
275
275
|
const sections: HeadlessBundleSection[] = [
|
|
276
|
+
...(!entries.length ? [{ title: "Level coverage", columns: [
|
|
277
|
+
{ key: "issuer", header: "Issuer" }, { key: "tenor", header: "Tenor" }, { key: "status", header: "Status" }, { key: "reason", header: "Reason" },
|
|
278
|
+
], rows: [{ issuer: name, tenor: "5Y", status: history instanceof Error ? "check-failed" : unmatched ? "not-covered" : why ? "not-derivable" : "no-traded-level",
|
|
279
|
+
spreadBp: null, reason: history instanceof Error ? "The spread history check failed." : unmatched ? empty : why ?? `No traded 5Y level on file for ${name} in the last two years.` }] }] : []),
|
|
276
280
|
...(entries.length ? [{ title: name, entries, symbol: name, ...(levelDate ? { asOf: levelDate } : {}) }] : []),
|
|
277
281
|
{
|
|
278
282
|
title: "Trades",
|