@gloom-sh/terminal 0.20.17 → 0.20.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -1
- package/src/account/auth-dialog.tsx +19 -1
- package/src/account/billing.ts +2 -1
- package/src/account/heard-from-question.tsx +235 -0
- package/src/account/heard-from.ts +97 -0
- package/src/api-client/cot.ts +5 -6
- package/src/api-client/data.ts +14 -3
- package/src/api-client/heard-from.ts +72 -0
- package/src/api-client/index.ts +64 -6
- package/src/api-client/mna.ts +18 -0
- package/src/api-client/request.ts +162 -40
- package/src/api-client/supply-chain.ts +9 -0
- package/src/api-client/types/billing.ts +35 -1
- package/src/api-client/types/news.ts +45 -0
- package/src/api-client/types/world-venues.ts +9 -0
- package/src/app/global-shortcuts.ts +5 -3
- package/src/app/pro-welcome/keys.ts +27 -0
- package/src/app/pro-welcome/model.ts +158 -0
- package/src/app/pro-welcome/row.tsx +176 -0
- package/src/app/pro-welcome/use-pro-welcome.ts +156 -0
- package/src/app/runtime/external-profile-changes.ts +135 -0
- package/src/app.tsx +37 -4
- package/src/architecture/core-builtin-allowlist.json +1 -1
- package/src/architecture/floating-promise-allowlist.json +1 -2
- package/src/architecture/shortcut-labels-allowlist.json +1 -0
- package/src/cli/alert-listing.ts +98 -0
- package/src/cli/commands/market.ts +191 -39
- package/src/cli/commands/overview.ts +7 -1
- package/src/cli/commands/plugins.ts +3 -2
- package/src/cli/commands/search.ts +30 -6
- package/src/cli/commands/ticker.ts +13 -6
- package/src/cli/context.ts +24 -5
- package/src/cli/csv-export.ts +2 -1
- package/src/cli/desktop-pane-shot-browser.ts +3 -1
- package/src/cli/desktop-pane-shot-view.ts +0 -1
- package/src/cli/desktop-pane-shot.ts +276 -52
- package/src/cli/errors.ts +3 -9
- package/src/cli/exit-codes.ts +1 -1
- package/src/cli/glossary.ts +65 -11
- package/src/cli/help.ts +1 -1
- package/src/cli/history-demergers.ts +117 -0
- package/src/cli/history-rows.ts +8 -4
- package/src/cli/index.ts +2 -1
- package/src/cli/known-gaps.ts +16 -0
- package/src/cli/known-us-stocks.ts +18 -0
- package/src/cli/listing-arg.ts +192 -38
- package/src/cli/pane-functions/catalog-snapshot-build.ts +83 -0
- package/src/cli/pane-functions/catalog-snapshot.json +877 -0
- package/src/cli/pane-functions/catalog-snapshot.ts +62 -0
- package/src/cli/pane-functions/catalog.ts +50 -16
- package/src/cli/pane-functions/data.ts +16 -4
- package/src/cli/pane-functions/dom.ts +54 -8
- package/src/cli/pane-functions/freshness.ts +39 -4
- package/src/cli/pane-functions/function-help.ts +3 -3
- package/src/cli/pane-functions/headless.ts +9 -1
- package/src/cli/pane-functions/index.ts +175 -50
- package/src/cli/pane-functions/report-notices.ts +10 -0
- package/src/cli/pane-functions/resolver.ts +11 -7
- package/src/cli/pane-functions/screenshot-assessment.ts +38 -10
- package/src/cli/pane-functions/screenshot-data-evidence.ts +7 -15
- package/src/cli/pane-functions/screenshot-payload.ts +36 -1
- package/src/cli/pane-functions/screenshot-render.ts +24 -9
- package/src/cli/pane-functions/screenshot-types.ts +9 -0
- package/src/cli/quote-answer.ts +33 -17
- package/src/cli/registry.ts +22 -2
- package/src/cli/result.ts +22 -4
- package/src/cli/scroll-truncation.ts +7 -2
- package/src/cli/series-search.ts +45 -6
- package/src/cli/shot-temp-dir.ts +4 -9
- package/src/cli/ticker-resolution.ts +1 -1
- package/src/cli/unreachable.ts +21 -0
- package/src/components/chart/composite/drawing-store.ts +11 -7
- package/src/components/chart/composite/format.ts +1 -0
- package/src/components/chart/composite/legend.tsx +48 -20
- package/src/components/chart/composite/panel-surface/panel-cursor.tsx +3 -3
- package/src/components/chart/composite/panel-surface/plot-gestures.ts +9 -2
- package/src/components/chart/composite/panel-surface.tsx +1 -1
- package/src/components/chart/composite/price-axis-labels.tsx +7 -5
- package/src/components/chart/composite/tools.ts +164 -39
- package/src/components/chart-table/header.tsx +11 -2
- package/src/components/chart-table/layout.ts +16 -17
- package/src/components/command-bar/pane-templates/items.ts +17 -1
- package/src/components/command-bar/routes/root/provider-search.ts +10 -1
- package/src/components/command-bar/routes/root/results.ts +34 -2
- package/src/components/command-bar/routes/root/runtime.ts +19 -4
- package/src/components/command-bar/routes/ticker-search/results.ts +5 -0
- package/src/components/command-bar/routes/ticker-search/route.ts +5 -0
- package/src/components/command-bar/selection-runtime.ts +29 -5
- package/src/components/command-bar/surface/index.tsx +4 -1
- package/src/components/command-bar/workflow/alert.ts +32 -13
- package/src/components/data-table/view.tsx +15 -2
- package/src/components/form-modal/content.tsx +9 -4
- package/src/components/index.ts +1 -1
- package/src/components/layout/header.tsx +9 -5
- package/src/components/layout/pane/capture-status.ts +6 -0
- package/src/components/layout/pane/footer/index.tsx +2 -0
- package/src/components/layout/pane/footer/model.ts +123 -17
- package/src/components/layout/pane/header.tsx +16 -2
- package/src/components/layout/pane/status-footer.ts +24 -0
- package/src/components/market-board/index.tsx +4 -2
- package/src/components/onboarding/onboarding-frame.tsx +6 -2
- package/src/components/onboarding/onboarding-keyboard.ts +7 -1
- package/src/components/onboarding/onboarding-wizard.tsx +3 -1
- package/src/components/onboarding/portfolio-step/positions-panel.tsx +24 -15
- package/src/components/onboarding/setup-cards.ts +36 -0
- package/src/components/onboarding/use-onboarding-progress.ts +22 -1
- package/src/components/onboarding/wizard-account.ts +6 -1
- package/src/components/onboarding/wizard-model.ts +32 -6
- package/src/components/onboarding/wizard-positions.ts +1 -1
- package/src/components/price-performance.tsx +26 -8
- package/src/components/reader/article-reader.tsx +12 -5
- package/src/components/sign-in-gate.tsx +3 -1
- package/src/components/toggle-list.tsx +6 -8
- package/src/components/ui/confirm-dialog.tsx +47 -7
- package/src/components/ui/data-table/opentui/index.tsx +7 -0
- package/src/components/ui/data-table/types.ts +8 -0
- package/src/components/ui/display.tsx +17 -2
- package/src/components/ui/index.ts +1 -1
- package/src/components/ui/stat-grid.tsx +4 -0
- package/src/components/ui/status.tsx +13 -1
- package/src/components/ui/table-layout.ts +34 -2
- package/src/components/use-pane-notice-footer.tsx +16 -3
- package/src/data/config/store/index.ts +31 -0
- package/src/data/config/store/node.ts +61 -11
- package/src/data/config/store/normalize.ts +4 -6
- package/src/data/config/store/shared-file.ts +309 -0
- package/src/data/profile-merge.ts +299 -0
- package/src/data/sqlite/checkpointer.ts +11 -1
- package/src/data/sqlite/database.ts +1 -1
- package/src/data/ticker-repository.ts +134 -10
- package/src/data/ticker-store.ts +67 -0
- package/src/data/ticker-writes.ts +5 -0
- package/src/i18n/es.ts +27 -0
- package/src/i18n/ja.ts +27 -0
- package/src/i18n/ko.ts +27 -0
- package/src/i18n/zh-cn.ts +27 -0
- package/src/i18n/zh-tw.ts +27 -0
- package/src/layout-marketplace/gallery-desktop.tsx +2 -2
- package/src/market-data/ah-pair.ts +122 -0
- package/src/market-data/coordinator/entries.ts +6 -4
- package/src/market-data/coordinator/index.ts +14 -3
- package/src/market-data/depositary-pair.ts +6 -2
- package/src/market-data/futures-board.ts +36 -29
- package/src/market-data/futures-contract.ts +37 -1
- package/src/market-data/hooks.tsx +33 -2
- package/src/market-data/market/change-basis.ts +11 -1
- package/src/market-data/market/header-market.ts +11 -0
- package/src/market-data/market/status.ts +40 -4
- package/src/market-data/performance.ts +127 -32
- package/src/market-data/quotes/time.ts +5 -2
- package/src/market-data/split-terms.ts +28 -0
- package/src/news/types.ts +28 -0
- package/src/notifications/app-badge.ts +2 -3
- package/src/notifications/app-notifier.ts +5 -0
- package/src/plugins/builtin/account-management/footer.ts +1 -1
- package/src/plugins/builtin/account-management/keyboard.ts +4 -0
- package/src/plugins/builtin/account-management/model.ts +1 -0
- package/src/plugins/builtin/account-management/pane.tsx +75 -7
- package/src/plugins/builtin/account-management/payment-recovery-row.tsx +12 -5
- package/src/plugins/builtin/account-management/pro-cancel.tsx +197 -0
- package/src/plugins/builtin/account-management/trial-cancel.ts +1 -1
- package/src/plugins/builtin/alerts/cli-move.ts +2 -2
- package/src/plugins/builtin/alerts/cli.ts +101 -48
- package/src/plugins/builtin/alerts/command.ts +39 -9
- package/src/plugins/builtin/alerts/constants.ts +10 -0
- package/src/plugins/builtin/alerts/earnings-listing.ts +20 -0
- package/src/plugins/builtin/alerts/event-rows.ts +9 -3
- package/src/plugins/builtin/alerts/events-pane.tsx +16 -10
- package/src/plugins/builtin/alerts/format.ts +24 -8
- package/src/plugins/builtin/alerts/headless.ts +12 -6
- package/src/plugins/builtin/alerts/index.tsx +97 -16
- package/src/plugins/builtin/alerts/move-checks.ts +7 -0
- package/src/plugins/builtin/alerts/option-contract.ts +197 -0
- package/src/plugins/builtin/alerts/pane.tsx +1 -1
- package/src/plugins/builtin/alerts/price.ts +30 -5
- package/src/plugins/builtin/alerts/pro-rules.ts +62 -0
- package/src/plugins/builtin/alerts/quotes.ts +26 -2
- package/src/plugins/builtin/alerts/research-builder.ts +5 -10
- package/src/plugins/builtin/alerts/scheduled.ts +6 -1
- package/src/plugins/builtin/alerts/types.ts +7 -0
- package/src/plugins/builtin/analytics/account-returns.ts +1 -1
- package/src/plugins/builtin/analytics/manual-value.ts +61 -0
- package/src/plugins/builtin/analytics/pane-model.ts +2 -2
- package/src/plugins/builtin/analytics/risk-book.ts +7 -7
- package/src/plugins/builtin/analytics/risk-client.ts +27 -14
- package/src/plugins/builtin/analytics/risk-headless.ts +13 -8
- package/src/plugins/builtin/analytics/risk-model.ts +92 -4
- package/src/plugins/builtin/analytics/risk-pane.tsx +85 -38
- package/src/plugins/builtin/awards/pane.tsx +1 -1
- package/src/plugins/builtin/broker-trading/orders.tsx +2 -2
- package/src/plugins/builtin/buildout/company/pane.tsx +4 -14
- package/src/plugins/builtin/catalysts/model.ts +2 -1
- package/src/plugins/builtin/central-bank-rates/model.ts +8 -2
- package/src/plugins/builtin/central-bank-rates/pane.tsx +5 -3
- package/src/plugins/builtin/chart-composer/chart-spec.ts +5 -0
- package/src/plugins/builtin/chart-composer/cli-options.ts +9 -5
- package/src/plugins/builtin/chart-composer/data-catalog-pane.tsx +2 -6
- package/src/plugins/builtin/chart-composer/headless-schema.ts +14 -10
- package/src/plugins/builtin/chart-composer/headless.ts +2 -0
- package/src/plugins/builtin/chart-composer/index.tsx +17 -5
- package/src/plugins/builtin/chart-composer/pane.tsx +19 -6
- package/src/plugins/builtin/chart-composer/viewport-labels.ts +2 -17
- package/src/plugins/builtin/chat/controller/notifications.ts +1 -0
- package/src/plugins/builtin/chat/index.tsx +0 -1
- package/src/plugins/builtin/cloud/auth-actions.tsx +11 -6
- package/src/plugins/builtin/cloud/company-picker.tsx +5 -3
- package/src/plugins/builtin/cloud/upgrade-command.ts +1 -1
- package/src/plugins/builtin/commodities-energy/index.tsx +1 -1
- package/src/plugins/builtin/company-kpis/headless.ts +10 -5
- package/src/plugins/builtin/company-kpis/latest.ts +45 -0
- package/src/plugins/builtin/company-kpis/model.ts +57 -15
- package/src/plugins/builtin/company-kpis/pane.tsx +22 -8
- package/src/plugins/builtin/composite/alt-data.ts +20 -0
- package/src/plugins/builtin/composite/application.ts +14 -0
- package/src/plugins/builtin/composite/broker.ts +12 -0
- package/src/plugins/builtin/composite/credit.ts +33 -0
- package/src/plugins/builtin/composite/crypto.ts +10 -0
- package/src/plugins/builtin/composite/earnings.ts +12 -0
- package/src/plugins/builtin/composite/filings.ts +13 -0
- package/src/plugins/builtin/composite/futures-commodities.ts +23 -0
- package/src/plugins/builtin/composite/global-markets.ts +12 -0
- package/src/plugins/builtin/composite/options-volatility.ts +23 -0
- package/src/plugins/builtin/composite/ownership.ts +23 -0
- package/src/plugins/builtin/composite/portfolio.ts +10 -0
- package/src/plugins/builtin/composite/quant.ts +15 -0
- package/src/plugins/builtin/composite/rates-macro.ts +30 -0
- package/src/plugins/builtin/composite/screeners.ts +11 -0
- package/src/plugins/builtin/composite/shared.ts +11 -0
- package/src/plugins/builtin/composite/ticker-core.ts +36 -0
- package/src/plugins/builtin/congress-trades/headless.ts +31 -3
- package/src/plugins/builtin/congress-trades/model.ts +9 -5
- package/src/plugins/builtin/correlation/index.tsx +13 -17
- package/src/plugins/builtin/correlation/matrix/model.ts +18 -0
- package/src/plugins/builtin/cot/client.ts +2 -3
- package/src/plugins/builtin/cot/headless.ts +16 -16
- package/src/plugins/builtin/cot/index.tsx +6 -6
- package/src/plugins/builtin/cot/model.ts +25 -5
- package/src/plugins/builtin/cot/pane.tsx +11 -6
- package/src/plugins/builtin/cot/series.ts +11 -8
- package/src/plugins/builtin/cpi/model.ts +15 -4
- package/src/plugins/builtin/cpi/pane.tsx +29 -7
- package/src/plugins/builtin/dividend-yield/client.ts +57 -16
- package/src/plugins/builtin/dividend-yield/headless.ts +17 -11
- package/src/plugins/builtin/dividend-yield/model.ts +4 -3
- package/src/plugins/builtin/dividend-yield/pane.tsx +22 -18
- package/src/plugins/builtin/dividend-yield/ranking.ts +1 -1
- package/src/plugins/builtin/dividend-yield/types.ts +4 -0
- package/src/plugins/builtin/dividend-yield/view.ts +23 -12
- package/src/plugins/builtin/doe/model.ts +30 -0
- package/src/plugins/builtin/doe/pane.tsx +8 -2
- package/src/plugins/builtin/earnings/board-table.ts +9 -4
- package/src/plugins/builtin/earnings/fiscal-quarter.ts +39 -0
- package/src/plugins/builtin/earnings/headless.ts +16 -6
- package/src/plugins/builtin/earnings/history-model.ts +6 -4
- package/src/plugins/builtin/earnings/history-table.ts +7 -4
- package/src/plugins/builtin/earnings-calls/calendar.tsx +4 -3
- package/src/plugins/builtin/earnings-calls/pane.tsx +8 -2
- package/src/plugins/builtin/earnings-ripple/pane.tsx +2 -2
- package/src/plugins/builtin/econ/calendar-model.ts +16 -0
- package/src/plugins/builtin/econ/index.tsx +7 -2
- package/src/plugins/builtin/equity-screener/headless.ts +4 -1
- package/src/plugins/builtin/equity-screener/model.ts +7 -6
- package/src/plugins/builtin/estimate-revisions/headless.ts +1 -1
- package/src/plugins/builtin/exposure/model.ts +10 -0
- package/src/plugins/builtin/exposure/pane.tsx +10 -3
- package/src/plugins/builtin/futures/model.ts +14 -1
- package/src/plugins/builtin/futures/series.ts +1 -8
- package/src/plugins/builtin/fx-matrix/amount.ts +15 -1
- package/src/plugins/builtin/fx-matrix/headless.ts +12 -6
- package/src/plugins/builtin/fx-matrix/index.tsx +25 -7
- package/src/plugins/builtin/fx-matrix/settings.ts +9 -4
- package/src/plugins/builtin/insider/detail.tsx +36 -7
- package/src/plugins/builtin/insider/filing-stories.ts +110 -0
- package/src/plugins/builtin/insider/headless.ts +37 -2
- package/src/plugins/builtin/insider/index.tsx +79 -10
- package/src/plugins/builtin/insider/model.ts +43 -5
- package/src/plugins/builtin/ipo-calendar/client.ts +11 -1
- package/src/plugins/builtin/ipo-calendar/model.ts +3 -7
- package/src/plugins/builtin/jobs/headless.ts +2 -1
- package/src/plugins/builtin/jobs/model.ts +6 -0
- package/src/plugins/builtin/jobs/pane.tsx +8 -3
- package/src/plugins/builtin/kelly-sizer/pane.tsx +9 -4
- package/src/plugins/builtin/market-valuation/pane.tsx +22 -10
- package/src/plugins/builtin/mna/detail.tsx +67 -6
- package/src/plugins/builtin/mna/headless.ts +128 -13
- package/src/plugins/builtin/mna/model.ts +219 -16
- package/src/plugins/builtin/mna/pane.tsx +34 -6
- package/src/plugins/builtin/money-markets/model.ts +14 -5
- package/src/plugins/builtin/money-markets/pane.tsx +4 -3
- package/src/plugins/builtin/news/wire/news/detail-view.tsx +118 -10
- package/src/plugins/builtin/news/wire/news/footer.ts +3 -8
- package/src/plugins/builtin/news/wire/news/story-evidence.ts +178 -0
- package/src/plugins/builtin/options/analytics.ts +1 -1
- package/src/plugins/builtin/options/view.tsx +18 -11
- package/src/plugins/builtin/options-positioning/model.ts +11 -0
- package/src/plugins/builtin/options-positioning/pane.tsx +22 -1
- package/src/plugins/builtin/options-scenario/client.ts +49 -8
- package/src/plugins/builtin/options-scenario/csp-screen-pane.tsx +22 -6
- package/src/plugins/builtin/options-scenario/csp-screen.ts +39 -12
- package/src/plugins/builtin/options-scenario/headless.ts +7 -3
- package/src/plugins/builtin/options-scenario/model.ts +33 -2
- package/src/plugins/builtin/options-scenario/pane.tsx +3 -4
- package/src/plugins/builtin/options-scenario/strategy-screen.ts +7 -5
- package/src/plugins/builtin/pe-band/client.ts +13 -1
- package/src/plugins/builtin/pe-band/headless.ts +2 -2
- package/src/plugins/builtin/pe-band/model.ts +63 -10
- package/src/plugins/builtin/pe-band/pane.tsx +5 -5
- package/src/plugins/builtin/perps/cascade.ts +4 -3
- package/src/plugins/builtin/perps/markets-section.tsx +5 -2
- package/src/plugins/builtin/perps/model.ts +4 -3
- package/src/plugins/builtin/portfolio-list/allocation-rows.ts +26 -7
- package/src/plugins/builtin/portfolio-list/cli/portfolio-command.ts +66 -13
- package/src/plugins/builtin/portfolio-list/cli/render.ts +76 -33
- package/src/plugins/builtin/portfolio-list/headless.ts +69 -22
- package/src/plugins/builtin/portfolio-list/pane/data.ts +3 -3
- package/src/plugins/builtin/portfolio-list/pane/index.tsx +29 -14
- package/src/plugins/builtin/portfolio-list/summary/index.tsx +2 -2
- package/src/plugins/builtin/portfolio-list/table.tsx +3 -2
- package/src/plugins/builtin/relative-rotation/pane.tsx +2 -3
- package/src/plugins/builtin/research/corporate-actions-pane.tsx +33 -14
- package/src/plugins/builtin/research/event-model.ts +43 -19
- package/src/plugins/builtin/research/headless.ts +8 -1
- package/src/plugins/builtin/research/relative-valuation-pane.tsx +19 -17
- package/src/plugins/builtin/research-search/index.tsx +3 -1
- package/src/plugins/builtin/scanner/denied.tsx +16 -4
- package/src/plugins/builtin/scanner/flow-pane.tsx +1 -1
- package/src/plugins/builtin/scanner/hilo-pane.tsx +1 -1
- package/src/plugins/builtin/sec/filing-display.tsx +14 -2
- package/src/plugins/builtin/sec/headless.ts +42 -4
- package/src/plugins/builtin/sec/index.tsx +21 -1
- package/src/plugins/builtin/sectors/index.tsx +6 -9
- package/src/plugins/builtin/sectors/sector-model.ts +1 -1
- package/src/plugins/builtin/shared/cloud-upgrade.ts +1 -1
- package/src/plugins/builtin/shared/earnings-report.ts +49 -5
- package/src/plugins/builtin/shared/options-pro-copy.ts +34 -0
- package/src/plugins/builtin/shared/report-freshness.ts +2 -3
- package/src/plugins/builtin/shared/statement-currency.ts +23 -0
- package/src/plugins/builtin/shared/ticker-surface.ts +1 -1
- package/src/plugins/builtin/supply-chain/client.ts +34 -9
- package/src/plugins/builtin/supply-chain/evidence.ts +3 -2
- package/src/plugins/builtin/supply-chain/flow.tsx +4 -3
- package/src/plugins/builtin/supply-chain/graph-model.ts +14 -7
- package/src/plugins/builtin/supply-chain/graph-pane.tsx +3 -1
- package/src/plugins/builtin/supply-chain/graph.tsx +6 -3
- package/src/plugins/builtin/supply-chain/headless.ts +19 -4
- package/src/plugins/builtin/supply-chain/model.ts +50 -6
- package/src/plugins/builtin/supply-chain/pane.tsx +79 -18
- package/src/plugins/builtin/themes/headless.ts +4 -4
- package/src/plugins/builtin/themes/model.ts +11 -8
- package/src/plugins/builtin/themes/pane.tsx +2 -2
- package/src/plugins/builtin/ticker-detail/adr-pair/ah.ts +62 -0
- package/src/plugins/builtin/ticker-detail/adr-pair/headless.ts +119 -20
- package/src/plugins/builtin/ticker-detail/adr-pair/model.ts +51 -1
- package/src/plugins/builtin/ticker-detail/adr-pair/tab.tsx +25 -14
- package/src/plugins/builtin/ticker-detail/financials/model.ts +22 -32
- package/src/plugins/builtin/ticker-detail/financials/tab.tsx +7 -9
- package/src/plugins/builtin/ticker-detail/headless-schema.ts +2 -0
- package/src/plugins/builtin/ticker-detail/headless.ts +28 -12
- package/src/plugins/builtin/ticker-detail/overview/board-lot.ts +21 -0
- package/src/plugins/builtin/ticker-detail/overview/model.ts +28 -2
- package/src/plugins/builtin/ticker-detail/overview/pane.tsx +8 -0
- package/src/plugins/builtin/ticker-detail/overview-tab.tsx +68 -13
- package/src/plugins/builtin/ticker-detail/quote-monitor/card.tsx +9 -2
- package/src/plugins/builtin/ticker-detail/quote-monitor/index.tsx +5 -2
- package/src/plugins/builtin/volatility/model.ts +17 -0
- package/src/plugins/builtin/volatility/pane.tsx +16 -7
- package/src/plugins/builtin/world-indices/index.tsx +2 -0
- package/src/plugins/builtin/world-indices/table.tsx +15 -0
- package/src/plugins/builtin/world-venue-map/evidence.ts +3 -2
- package/src/plugins/builtin/world-venue-map/headless.ts +32 -18
- package/src/plugins/builtin/world-venue-map/index.ts +19 -6
- package/src/plugins/builtin/world-venue-map/layered-pane.tsx +9 -5
- package/src/plugins/builtin/world-venue-map/layers.ts +33 -11
- package/src/plugins/builtin/world-venue-map/map.tsx +12 -0
- package/src/plugins/builtin/world-venue-map/model.ts +6 -1
- package/src/plugins/builtin/world-venue-map/pane.tsx +35 -6
- package/src/plugins/builtin/world-venue-map/place.ts +119 -0
- package/src/plugins/builtin/world-venue-map/venue-header.tsx +5 -3
- package/src/plugins/catalog-browser.ts +10 -1
- package/src/plugins/catalog-data.ts +20 -0
- package/src/plugins/catalog-lazy.ts +51 -0
- package/src/plugins/catalog-ui.ts +16 -18
- package/src/plugins/host-smoke.ts +5 -2
- package/src/portfolio/allocation.ts +79 -19
- package/src/portfolio/cash-balances.ts +76 -0
- package/src/portfolio/mutations.ts +43 -8
- package/src/public/__snapshots__/public-api.test.ts.snap +1 -0
- package/src/renderers/browser/activity.ts +16 -0
- package/src/renderers/browser/app-badge-host.ts +14 -0
- package/src/renderers/browser/main.tsx +5 -0
- package/src/renderers/browser/notifications.ts +103 -0
- package/src/renderers/browser/ui-host.tsx +4 -0
- package/src/renderers/desktop/window-layouts.ts +14 -0
- package/src/renderers/dom/data-table/index.tsx +27 -4
- package/src/renderers/dom/data-table/row.tsx +2 -0
- package/src/renderers/dom/host/tabs.tsx +57 -8
- package/src/renderers/dom/styles.css +13 -5
- package/src/renderers/electrobun/bun/desktop/backend-requests.ts +4 -0
- package/src/renderers/electrobun/bun/desktop/backend.ts +22 -1
- package/src/renderers/electrobun/bun/window/native-min-size.ts +6 -1
- package/src/renderers/electrobun/shared/protocol.ts +4 -0
- package/src/renderers/electrobun/view/cli-pane-shot-frame.tsx +50 -12
- package/src/renderers/electrobun/view/http-fetch.ts +3 -2
- package/src/renderers/electrobun/view/remote/ticker-repository.ts +10 -0
- package/src/series/standalone-catalog.ts +5 -4
- package/src/series/standalone.ts +13 -7
- package/src/sources/gloomberb-cloud/index.ts +22 -9
- package/src/sources/gloomberb-cloud/news.ts +35 -0
- package/src/sources/gloomberb-cloud/perpetuals.ts +60 -3
- package/src/sources/provider-errors.ts +34 -7
- package/src/sources/provider-router/financials.ts +20 -13
- package/src/sources/provider-router/history.ts +32 -6
- package/src/sources/provider-router/index.ts +4 -0
- package/src/sources/provider-router/search.ts +1 -0
- package/src/sync/collections-contributor.ts +3 -1
- package/src/sync/config-merge.ts +10 -1
- package/src/sync/sanitize.ts +26 -2
- package/src/tickers/company-name-listing.ts +16 -2
- package/src/tickers/listing-fate.ts +12 -8
- package/src/tickers/renamed-listings.ts +43 -10
- package/src/tickers/search/home-listing.ts +28 -0
- package/src/tickers/search/index.ts +19 -7
- package/src/tickers/terminal-codes.ts +11 -1
- package/src/time-series/base-series.ts +39 -6
- package/src/time-series/chart-seed.ts +2 -2
- package/src/time-series/history-quality.ts +4 -1
- package/src/time-series/hooks.ts +2 -0
- package/src/time-series/price-comparison.ts +17 -23
- package/src/time-series/reporting.ts +1 -1
- package/src/time-series/resolution.ts +13 -0
- package/src/time-series/resolve-context.ts +6 -0
- package/src/time-series/resolve.ts +42 -3
- package/src/time-series/spec.ts +2 -2
- package/src/time-series/types.ts +3 -2
- package/src/types/data-provider.ts +11 -0
- package/src/types/financials.ts +48 -4
- package/src/types/headless.ts +1 -0
- package/src/types/issuer-listings.ts +2 -0
- package/src/types/plugin-notifications.ts +3 -0
- package/src/types/price-history.ts +6 -4
- package/src/types/ticker.ts +10 -2
- package/src/ui/host.tsx +2 -0
- package/src/utils/cli-output.ts +1 -1
- package/src/utils/declared-dividends.ts +13 -1
- package/src/utils/dividend-cash.ts +5 -1
- package/src/utils/exchange-announcements.ts +7 -2
- package/src/utils/forward-dividend.ts +4 -3
- package/src/utils/fundamentals.ts +40 -0
- package/src/utils/network-failure.ts +2 -0
- package/src/utils/price-history-integrity.ts +9 -1
- package/src/utils/remove-folder.ts +37 -0
- package/src/utils/trailing-dividend.ts +1 -1
- package/src/plugins/builtin/composite-plugins.ts +0 -285
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { useEffect, type Dispatch } from "react";
|
|
2
|
+
import { watchExternalConfigChanges } from "../../data/config/store";
|
|
3
|
+
import { serializeJson } from "../../data/sqlite/json";
|
|
4
|
+
import { hasPendingTickerWrite, hasPendingTickerWrites } from "../../data/ticker-writes";
|
|
5
|
+
import type { AppTickerRepositoryPort } from "../../core/app-service-ports";
|
|
6
|
+
import type { PluginRegistry } from "../../plugins/registry";
|
|
7
|
+
import type { AppAction, AppState } from "../../state/app/context";
|
|
8
|
+
import type { TickerRecord } from "../../types/ticker";
|
|
9
|
+
import { logFailure } from "../../utils/log-failure";
|
|
10
|
+
|
|
11
|
+
/** How often the ticker rows are looked at for another program's write: a cheap question to SQLite. */
|
|
12
|
+
const TICKER_ROWS_LOOK_MS = 2_000;
|
|
13
|
+
|
|
14
|
+
type TickerRowsPort = AppTickerRepositoryPort & {
|
|
15
|
+
/**
|
|
16
|
+
* Changes when another program commits to the database; absent where no
|
|
17
|
+
* one can say. The desktop app's windows ask the process that holds it.
|
|
18
|
+
*/
|
|
19
|
+
changesElsewhere?(): number | null | Promise<number | null>;
|
|
20
|
+
/**
|
|
21
|
+
* The rows the repository held a copy of that a read found deleted by
|
|
22
|
+
* another program (`TickerRepository.takeRowsDeletedElsewhere`), whoever
|
|
23
|
+
* wrote them last: rows the app added itself since its last look included.
|
|
24
|
+
*/
|
|
25
|
+
takeRowsDeletedElsewhere?(): string[] | Promise<string[]>;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Takes in what a `gloom` command run beside the app writes to the profile:
|
|
30
|
+
* config.json (alerts, settings, watchlists and portfolios, layouts) as soon
|
|
31
|
+
* as the file changes, and ticker rows (watchlist members, positions) within
|
|
32
|
+
* a couple of seconds. The app shows them, an alert added from the terminal
|
|
33
|
+
* is checked, and no later save of the app's own copy writes over them.
|
|
34
|
+
*/
|
|
35
|
+
export function useExternalProfileChanges({
|
|
36
|
+
enabled,
|
|
37
|
+
dataDir,
|
|
38
|
+
dispatch,
|
|
39
|
+
stateRef,
|
|
40
|
+
pluginRegistry,
|
|
41
|
+
tickerRepository,
|
|
42
|
+
lookEveryMs = TICKER_ROWS_LOOK_MS,
|
|
43
|
+
}: {
|
|
44
|
+
enabled: boolean;
|
|
45
|
+
dataDir: string;
|
|
46
|
+
dispatch: Dispatch<AppAction>;
|
|
47
|
+
stateRef: { current: AppState };
|
|
48
|
+
pluginRegistry: Pick<PluginRegistry, "events">;
|
|
49
|
+
tickerRepository: TickerRowsPort;
|
|
50
|
+
/** How often the ticker rows are looked at; tests look sooner. */
|
|
51
|
+
lookEveryMs?: number;
|
|
52
|
+
}): void {
|
|
53
|
+
useEffect(() => {
|
|
54
|
+
if (!enabled) return;
|
|
55
|
+
return watchExternalConfigChanges(dataDir, (change) => {
|
|
56
|
+
const current = stateRef.current.config;
|
|
57
|
+
const next = change.apply(current);
|
|
58
|
+
if (next === current) return;
|
|
59
|
+
dispatch({ type: "SET_CONFIG", config: next });
|
|
60
|
+
pluginRegistry.events.emit("config:changed", { config: next });
|
|
61
|
+
});
|
|
62
|
+
}, [dataDir, dispatch, enabled, pluginRegistry, stateRef]);
|
|
63
|
+
|
|
64
|
+
useEffect(() => {
|
|
65
|
+
const changesElsewhere = tickerRepository.changesElsewhere?.bind(tickerRepository);
|
|
66
|
+
const takeDeleted = tickerRepository.takeRowsDeletedElsewhere?.bind(tickerRepository);
|
|
67
|
+
if (!enabled || !changesElsewhere) return;
|
|
68
|
+
let stopped = false;
|
|
69
|
+
// The database's version and its rows as last read. Without the repository's own account of the rows deleted
|
|
70
|
+
// elsewhere, a row gone from the last read's is one; the app's own commits move no version, so that misses a
|
|
71
|
+
// row the app added since.
|
|
72
|
+
let taken: number | null = null;
|
|
73
|
+
let stored: Set<string> | null = null;
|
|
74
|
+
let reading = false;
|
|
75
|
+
const look = async () => {
|
|
76
|
+
reading = true;
|
|
77
|
+
try {
|
|
78
|
+
const version = await changesElsewhere();
|
|
79
|
+
// The app's own writes still on their way would read as someone else's: wait for them.
|
|
80
|
+
if (stopped || version === null || (stored && version === taken) || hasPendingTickerWrites(tickerRepository)) return;
|
|
81
|
+
const rows = await tickerRepository.loadAllTickers();
|
|
82
|
+
const present = new Set(rows.map((row) => row.metadata.ticker));
|
|
83
|
+
const deleted = takeDeleted ? await takeDeleted() : [...stored ?? []].filter((symbol) => !present.has(symbol));
|
|
84
|
+
if (stopped) return;
|
|
85
|
+
// The first look is the rows as the app starts with them; only rows deleted since are taken in then.
|
|
86
|
+
takeStoredTickerRows(stored ? rows : [], deleted, tickerRepository, stateRef, dispatch);
|
|
87
|
+
stored = present;
|
|
88
|
+
taken = version;
|
|
89
|
+
} finally {
|
|
90
|
+
reading = false;
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
const lookNow = () => {
|
|
94
|
+
if (!reading) look().catch(logFailure("app.external-profile-changes", "Reading ticker rows another program wrote failed"));
|
|
95
|
+
};
|
|
96
|
+
lookNow();
|
|
97
|
+
const timer = setInterval(lookNow, lookEveryMs);
|
|
98
|
+
(timer as { unref?: () => void }).unref?.();
|
|
99
|
+
return () => {
|
|
100
|
+
stopped = true;
|
|
101
|
+
clearInterval(timer);
|
|
102
|
+
};
|
|
103
|
+
}, [dispatch, enabled, lookEveryMs, stateRef, tickerRepository]);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Replaces the app's copy of each row the database holds differently, and
|
|
108
|
+
* drops each row another program deleted (`deleted`), so no later save of
|
|
109
|
+
* the app's copy brings it back. Rows only the app holds stay, and so does
|
|
110
|
+
* one the app is saving: its save folds the other program's change in.
|
|
111
|
+
*/
|
|
112
|
+
function takeStoredTickerRows(
|
|
113
|
+
rows: readonly TickerRecord[],
|
|
114
|
+
deleted: readonly string[],
|
|
115
|
+
tickerRepository: AppTickerRepositoryPort,
|
|
116
|
+
stateRef: { current: AppState },
|
|
117
|
+
dispatch: Dispatch<AppAction>,
|
|
118
|
+
): void {
|
|
119
|
+
const current = stateRef.current.tickers;
|
|
120
|
+
let next: Map<string, TickerRecord> | null = null;
|
|
121
|
+
for (const row of rows) {
|
|
122
|
+
const symbol = row.metadata.ticker;
|
|
123
|
+
if (hasPendingTickerWrite(tickerRepository, symbol)) continue;
|
|
124
|
+
const held = current.get(symbol);
|
|
125
|
+
if (held && serializeJson(held.metadata) === serializeJson(row.metadata)) continue;
|
|
126
|
+
next ??= new Map(current);
|
|
127
|
+
next.set(symbol, row);
|
|
128
|
+
}
|
|
129
|
+
for (const symbol of deleted) {
|
|
130
|
+
if (!current.has(symbol)) continue;
|
|
131
|
+
next ??= new Map(current);
|
|
132
|
+
next.delete(symbol);
|
|
133
|
+
}
|
|
134
|
+
if (next) dispatch({ type: "SET_TICKERS", tickers: next });
|
|
135
|
+
}
|
package/src/app.tsx
CHANGED
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
useAppStateRef,
|
|
10
10
|
type AppState,
|
|
11
11
|
} from "./state/app/context";
|
|
12
|
-
import { bindAppActivity, isAppVisible, subscribeAppVisibility, useAppActive, useAppVisible } from "./state/app/activity";
|
|
12
|
+
import { bindAppActivity, isAppVisible, setAppActive, subscribeAppVisibility, useAppActive, useAppVisible } from "./state/app/activity";
|
|
13
13
|
import { Header } from "./components/layout/header";
|
|
14
14
|
import { StatusBar } from "./components/layout/status-bar";
|
|
15
15
|
import { useAppChromeShown } from "./components/layout/presentation";
|
|
@@ -20,6 +20,8 @@ import { DetachedPaneShell } from "./components/layout/detached-pane-shell";
|
|
|
20
20
|
import { TransientLayoutProvider } from "./components/layout/transient-layout";
|
|
21
21
|
import { CommandBar } from "./components/command-bar/surface";
|
|
22
22
|
import { OnboardingWizard } from "./components/onboarding/onboarding-wizard";
|
|
23
|
+
import { getOnboardingProgress } from "./components/onboarding/wizard-model";
|
|
24
|
+
import { HeardFromQuestionHost } from "./account/heard-from-question";
|
|
23
25
|
import { useRunSetupAgain } from "./components/onboarding/run-setup-again";
|
|
24
26
|
import { CompanyPickerHost } from "./plugins/builtin/cloud/company-picker";
|
|
25
27
|
import { TerminalRelayHost } from "./plugins/builtin/cloud/terminal-relay/host";
|
|
@@ -50,6 +52,7 @@ import { AppDialogBridge } from "./app/dialog-bridge";
|
|
|
50
52
|
import { KeybindingsProvider, useResolvedKeybindings } from "./app/keybindings";
|
|
51
53
|
import { useAppPaneRuntime } from "./app/pane-runtime";
|
|
52
54
|
import { bindPluginRegistryRuntimeAccess } from "./app/runtime/plugin-bindings";
|
|
55
|
+
import { useExternalProfileChanges } from "./app/runtime/external-profile-changes";
|
|
53
56
|
import { useAppStartupRuntime } from "./app/runtime/startup";
|
|
54
57
|
import { useTickerRefreshRuntime } from "./app/runtime/ticker-refresh";
|
|
55
58
|
import { useAppUpdateRuntime } from "./app/runtime/update";
|
|
@@ -79,6 +82,8 @@ import { reportTelemetryConfig } from "./telemetry/live-config";
|
|
|
79
82
|
import { AttentionCountsNotice } from "./app/attention-notice";
|
|
80
83
|
import { useSinceLastVisit } from "./app/since-last-visit/use-since-last-visit";
|
|
81
84
|
import { SinceLastVisitStrip } from "./app/since-last-visit/strip";
|
|
85
|
+
import { useProWelcome } from "./app/pro-welcome/use-pro-welcome";
|
|
86
|
+
import { ProWelcomeRow } from "./app/pro-welcome/row";
|
|
82
87
|
import { recordFunctionOpen } from "./telemetry/usage-counts";
|
|
83
88
|
import { logFailure } from "./utils/log-failure";
|
|
84
89
|
|
|
@@ -228,6 +233,10 @@ function AppInner({
|
|
|
228
233
|
const appWideWorkElsewhere = isDetachedWindow || desktopWindowBridge?.primary === false;
|
|
229
234
|
// Not while setup is already showing.
|
|
230
235
|
const runSetupAgain = useRunSetupAgain(onboardingActive ? undefined : onRunSetupAgain);
|
|
236
|
+
// A setup card holds the keyboard over the whole window; the workspace coach
|
|
237
|
+
// after the cards floats over a live workspace, whose "Ctrl+P adds more"
|
|
238
|
+
// needs the command bar's prompt (and Help) where they always are.
|
|
239
|
+
const setupCardShown = onboardingActive && getOnboardingProgress(config).stage !== "research";
|
|
231
240
|
const detachedPaneId = isDetachedWindow ? desktopWindowBridge.paneId ?? null : null;
|
|
232
241
|
const focusDetachedPane = useMemo(() => {
|
|
233
242
|
const focus = desktopWindowBridge?.kind === "main" ? desktopWindowBridge.focusDetachedPane : undefined;
|
|
@@ -271,6 +280,7 @@ function AppInner({
|
|
|
271
280
|
else toastId = toast.info(notification.body, options);
|
|
272
281
|
},
|
|
273
282
|
desktop: rendererHost.supportsNativeDesktopNotifications ? rendererHost : undefined,
|
|
283
|
+
notifyInBackground: rendererHost.notifyInBackground,
|
|
274
284
|
}), [rendererHost, toast]);
|
|
275
285
|
const notify = useCallback((body: string, options?: { type?: "info" | "success" | "error" }) => {
|
|
276
286
|
pluginRegistry.notify({ body, ...options });
|
|
@@ -423,6 +433,16 @@ function AppInner({
|
|
|
423
433
|
scheduleConfigSave(nextConfig);
|
|
424
434
|
}, []);
|
|
425
435
|
useTeamCollectionsSync({ persistConfig, tickerRepository });
|
|
436
|
+
// A `gloom` command run beside the app writes the same profile: take its
|
|
437
|
+
// changes in, so none is written over. A popped-out window leaves that to the main one.
|
|
438
|
+
useExternalProfileChanges({
|
|
439
|
+
enabled: !appWideWorkElsewhere,
|
|
440
|
+
dataDir: config.dataDir,
|
|
441
|
+
dispatch,
|
|
442
|
+
stateRef,
|
|
443
|
+
pluginRegistry,
|
|
444
|
+
tickerRepository,
|
|
445
|
+
});
|
|
426
446
|
|
|
427
447
|
useAppPaneRuntime({
|
|
428
448
|
dataProvider,
|
|
@@ -498,6 +518,15 @@ function AppInner({
|
|
|
498
518
|
notify: notifyRequest,
|
|
499
519
|
});
|
|
500
520
|
const showSinceLastVisit = !!sinceLastVisit.recap && state.config.presentationMode !== true;
|
|
521
|
+
// A new Pro payer's first two weeks: Pro functions they have not opened, on
|
|
522
|
+
// their own tickers. Its own row under the strip, never part of it.
|
|
523
|
+
const proWelcome = useProWelcome({
|
|
524
|
+
active: !appWideWorkElsewhere && !onboardingActive && !signInGateActive,
|
|
525
|
+
pluginState: pluginRegistry.persistence.pluginState,
|
|
526
|
+
pluginRegistry,
|
|
527
|
+
pluginsReady,
|
|
528
|
+
});
|
|
529
|
+
const showProWelcome = !!proWelcome.chips && state.config.presentationMode !== true;
|
|
501
530
|
|
|
502
531
|
const chrome = useAppChromeShown();
|
|
503
532
|
const keybindingHost = useUiHost().kind === "opentui" ? "terminal" : "desktop";
|
|
@@ -553,7 +582,8 @@ function AppInner({
|
|
|
553
582
|
<ThemedAppRoot>
|
|
554
583
|
{chrome.header && (
|
|
555
584
|
<Header
|
|
556
|
-
|
|
585
|
+
commandInputAvailable={!setupCardShown}
|
|
586
|
+
onOpenHelp={setupCardShown ? undefined : () => {
|
|
557
587
|
recordFunctionOpen({ shortcut: "HELP", externalPluginId: null });
|
|
558
588
|
pluginRegistry.showPane("help");
|
|
559
589
|
}}
|
|
@@ -561,6 +591,7 @@ function AppInner({
|
|
|
561
591
|
/>
|
|
562
592
|
)}
|
|
563
593
|
{showSinceLastVisit ? <SinceLastVisitStrip strip={sinceLastVisit} /> : null}
|
|
594
|
+
{showProWelcome ? <ProWelcomeRow welcome={proWelcome} /> : null}
|
|
564
595
|
<TransientLayoutProvider>
|
|
565
596
|
<Shell
|
|
566
597
|
pluginRegistry={pluginRegistry}
|
|
@@ -569,12 +600,13 @@ function AppInner({
|
|
|
569
600
|
desktopWindowBridge={desktopWindowBridge}
|
|
570
601
|
desktopDockPreview={desktopDockPreview}
|
|
571
602
|
commandBarNativeOccluder={commandBarNativeOccluder}
|
|
572
|
-
topBandRows={showSinceLastVisit ? 1 : 0}
|
|
603
|
+
topBandRows={(showSinceLastVisit ? 1 : 0) + (showProWelcome ? 1 : 0)}
|
|
573
604
|
/>
|
|
574
605
|
<StatusBar />
|
|
575
606
|
</TransientLayoutProvider>
|
|
576
607
|
{!onboardingActive ? <CompanyPickerHost pluginRegistry={pluginRegistry} /> : null}
|
|
577
608
|
{initialized && !onboardingActive && !signInGateActive ? <AttentionCountsNotice notify={notifyRequest} /> : null}
|
|
609
|
+
{initialized && !onboardingActive && !signInGateActive ? <HeardFromQuestionHost /> : null}
|
|
578
610
|
<TerminalRelayHost device={remoteControlAdapter?.terminalDevice} />
|
|
579
611
|
{onboardingActive && onOnboardingComplete ? (
|
|
580
612
|
<OnboardingWizard
|
|
@@ -650,6 +682,7 @@ export function App({
|
|
|
650
682
|
useAppLanguage();
|
|
651
683
|
const externalPlugins = providedExternalPlugins ?? EMPTY_EXTERNAL_PLUGINS;
|
|
652
684
|
const renderer = useNativeRenderer();
|
|
685
|
+
const rendererHost = useRendererHost();
|
|
653
686
|
const effectiveInitialConfig = useMemo(() => {
|
|
654
687
|
return resolveInitialAppConfig({
|
|
655
688
|
initialConfig,
|
|
@@ -691,7 +724,7 @@ export function App({
|
|
|
691
724
|
|
|
692
725
|
const showSetup = useCallback(() => setShowOnboarding(true), []);
|
|
693
726
|
|
|
694
|
-
useEffect(() => bindAppActivity(renderer), [renderer]);
|
|
727
|
+
useEffect(() => rendererHost.subscribeAppActivity?.(setAppActive) ?? bindAppActivity(renderer), [renderer, rendererHost]);
|
|
695
728
|
|
|
696
729
|
const services = useMemo(() => {
|
|
697
730
|
return measurePerf("startup.app.create-services", () => (
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"src/layout/desks.ts": ["chart-composer"],
|
|
30
30
|
"src/plugins/catalog-browser.ts": ["alerts","analytics","attention","awards","backtest","bond-calculator","catalysts","cds","central-bank-rates","changelog","chart-composer","clinical-trials","cloud","comment-letters","commodities-energy","commodity-balances","company-attention","company-kpis","connections","correlation","cot","cpi","credit-boards","credit-conditions","credit-documents","crypto-board","crypto-etf-flows","debt-maturities","dividend-yield","docs","doe","earnings","earnings-calls","earnings-ripple","econ","econ-statistics","equity-screener","estimate-revisions","executives","exposure","fear-greed","filing-events","fixed-income","futures","futures-curve","fx-matrix","gpu","help","holders","insider","ipo-calendar","iv-history","jobs","jodi","kelly-sizer","layout-manager","macro-day","market-halts","market-heatmap","market-valuation","members","mna","money-markets","news","openfda","options","options-calculator","options-positioning","options-scenario","pe-band","perps","portfolio-list","power","primary-dealers","rate-path","realized-vol","relative-rotation","research","research-search","revenue-breakdown","reverse-dcf","risk-factors","roadmap","scanner","seasonality","sec","sectors","short-interest","short-volume","social-mentions","supply-chain","thirteenf","ticker-detail","time-sales","trace-bonds","treasury-auctions","treasury-daily","vol-surface","volatility","world-indices","world-venue-map","yield-curve"],
|
|
31
31
|
"src/plugins/catalog-cli.ts": ["alerts","fear-greed","news","notes","portfolio-list"],
|
|
32
|
-
"src/plugins/catalog-ui.ts": ["alerts","clinical-trials","cloud","comment-letters","custom-view","fear-greed","ipo-calendar","market-halts","market-heatmap","members","news","notes","openfda","research-search"],
|
|
32
|
+
"src/plugins/catalog-ui.ts": ["alerts","clinical-trials","cloud","comment-letters","composite","custom-view","fear-greed","ipo-calendar","market-halts","market-heatmap","members","news","notes","openfda","research-search"],
|
|
33
33
|
"src/plugins/catalog.ts": ["debug"],
|
|
34
34
|
"src/remote/controller.ts": ["custom-view"],
|
|
35
35
|
"src/renderers/electrobun/bun/core-capabilities.ts": ["notes"],
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"src/app/star-prompt/status-line.tsx": ["void:rendererHost.openExternal()"],
|
|
20
20
|
"src/brokers/signed-in/sign-in.ts": ["void:this.run()"],
|
|
21
21
|
"src/cli/desktop-pane-shot-browser.ts": ["statement:child.stdin.write()","void:drain().then()","void:exited.then()","void:messageText().then()"],
|
|
22
|
-
"src/cli/desktop-pane-shot.ts": ["
|
|
22
|
+
"src/cli/desktop-pane-shot.ts": ["void:answerShotApiCall().then()"],
|
|
23
23
|
"src/cli/pane-functions/index.ts": ["void:cliOutputWritten().then()"],
|
|
24
24
|
"src/components/command-bar/assist/runtime.ts": ["void:function()"],
|
|
25
25
|
"src/components/command-bar/commands/collection.ts": ["void:startTickerChangeLookup().settle().then()"],
|
|
@@ -64,7 +64,6 @@
|
|
|
64
64
|
"src/components/ui/multi-select/dialog.tsx": ["void:toggleOption()"],
|
|
65
65
|
"src/components/ui/query-bar-keys.tsx": ["void:choose()","void:choose()","void:dialog.alert()"],
|
|
66
66
|
"src/components/use-external-link-footer.ts": ["void:rendererHost.openExternal()"],
|
|
67
|
-
"src/data/config/store/node.ts": ["void:settled.then()"],
|
|
68
67
|
"src/data/ticker-writes.ts": ["void:Promise.allSettled().then()"],
|
|
69
68
|
"src/layout-marketplace/linked-sync.ts": ["void:check()","void:check()","void:check()"],
|
|
70
69
|
"src/market-data/coordinator/index.ts": ["void:this.reloadTogether()","void:this.reloadTogether()"],
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"src/cli/commands/keybindings.ts": "CLI errors for `config set keybindings`: example chords in the config grammar the user types.",
|
|
3
3
|
"src/cli/commands/system.ts": "CLI help: example `config set keybindings` commands, written in the config grammar.",
|
|
4
|
+
"src/cli/known-gaps.ts": "What `gloom catalog FB` prints for the app's Send Feedback: it sends the reader to the terminal app (`gloom`), where Ctrl+P opens the command bar.",
|
|
4
5
|
"src/cli/pane-functions/dom.ts": "What `gloom fn` prints for a pane behind the sign-in wall: it sends the reader to the terminal app (`gloom`), where Ctrl+P opens the command bar.",
|
|
5
6
|
"src/plugins/builtin/alerts/cli.ts": "`gloom alerts` output, which sends the reader to the terminal app (`gloom`), where Ctrl+P opens the command bar.",
|
|
6
7
|
"src/plugins/builtin/alerts/event-rows.ts": "needsSignInNote is printed by `gloom alerts` and the headless read only: it names the terminal app's Ctrl+P.",
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { liveCompanyQuestion } from "./company-name-hint";
|
|
2
|
+
import { movedSymbolLine, parseListingArg, type ListingDeps } from "./listing-arg";
|
|
3
|
+
import { requireQuotedListing, type QuotedListing } from "./quote-answer";
|
|
4
|
+
import {
|
|
5
|
+
bareListingNote,
|
|
6
|
+
describeListingFate,
|
|
7
|
+
listingChangeLine,
|
|
8
|
+
loadListingFate,
|
|
9
|
+
noLongerTradingNote,
|
|
10
|
+
SUCCESSOR_CHANGE_WAIT_MS,
|
|
11
|
+
} from "../tickers/listing-fate";
|
|
12
|
+
import { startTickerChangeLookup } from "../tickers/ticker-changes";
|
|
13
|
+
import { logFailure } from "../utils/log-failure";
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Why an alert was refused for what was typed, with what to type instead as
|
|
17
|
+
* `details`. `reason` says it without the refusal, for a form that checks
|
|
18
|
+
* the symbol before anything is added.
|
|
19
|
+
*/
|
|
20
|
+
export class AlertListingRefusal extends Error {
|
|
21
|
+
readonly reason: string;
|
|
22
|
+
|
|
23
|
+
constructor(message: string, readonly details?: string, reason?: string) {
|
|
24
|
+
super(message);
|
|
25
|
+
this.name = "AlertListingRefusal";
|
|
26
|
+
this.reason = reason ?? message;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface AlertListingOptions {
|
|
31
|
+
/** The command that adds the alert on another symbol (`gloom alerts add XYZ above 80`); none in the app. */
|
|
32
|
+
retry?: (symbol: string) => string | null;
|
|
33
|
+
now?: number;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* The listing an alert follows, read as `quote` reads the symbol: the same
|
|
38
|
+
* resolver (a company's name such as "Singtel" is Z74:SGX), and what `quote`
|
|
39
|
+
* says of what became of it. Every place an alert is added goes through here:
|
|
40
|
+
* `gloom alerts add`, ALRT's Add Alert and SA.
|
|
41
|
+
*
|
|
42
|
+
* - A listing that no longer trades is refused, since nothing would ever
|
|
43
|
+
* check it: DBS, the silver fund delisted in 2023, asks after D05:SGX (DBS
|
|
44
|
+
* Group Holdings); SQ, which last traded before Block became XYZ, names XYZ.
|
|
45
|
+
* - A symbol its company left for another that something new trades under is
|
|
46
|
+
* kept, saying so: FB is a fund now, and Meta trades as META.
|
|
47
|
+
*
|
|
48
|
+
* Throws `AlertListingRefusal` with why.
|
|
49
|
+
*/
|
|
50
|
+
export interface AlertListing extends QuotedListing {
|
|
51
|
+
/** What became of the symbol, also among `notes`: FB's line, saying Meta trades as META. */
|
|
52
|
+
fate: string[];
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export async function resolveAlertListing(
|
|
56
|
+
typed: string,
|
|
57
|
+
exchange: string | null | undefined,
|
|
58
|
+
deps: ListingDeps,
|
|
59
|
+
options: AlertListingOptions = {},
|
|
60
|
+
): Promise<AlertListing> {
|
|
61
|
+
const fail = (message: string, details?: string): never => {
|
|
62
|
+
throw new AlertListingRefusal(message, details);
|
|
63
|
+
};
|
|
64
|
+
const quoted = await requireQuotedListing(typed, exchange, deps, { fail }, "alerts add");
|
|
65
|
+
// What became of the symbol is a note beside the alert; a lookup that fails leaves the alert as `quote` reads it.
|
|
66
|
+
const fate = await alertListingNotes(quoted, typed, exchange, deps, options).catch((error: unknown) => {
|
|
67
|
+
if (error instanceof AlertListingRefusal) throw error;
|
|
68
|
+
return logFailure("cli.alert-listing", "Read what became of an alert's symbol failed", [] as string[])(error);
|
|
69
|
+
});
|
|
70
|
+
return { ...quoted, notes: [...quoted.notes, ...fate], fate };
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
async function alertListingNotes(
|
|
74
|
+
{ listing, quote }: QuotedListing,
|
|
75
|
+
typed: string,
|
|
76
|
+
exchange: string | null | undefined,
|
|
77
|
+
deps: ListingDeps,
|
|
78
|
+
{ retry, now = Date.now() }: AlertListingOptions,
|
|
79
|
+
): Promise<string[]> {
|
|
80
|
+
// A bare symbol read on a listing abroad (Z74 -> SGX) is not the US symbol the changes are of.
|
|
81
|
+
const fate = bareListingNote(listing, quote)
|
|
82
|
+
? describeListingFate(listing, quote, null, now)
|
|
83
|
+
: await loadListingFate(listing, deps.dataProvider, {
|
|
84
|
+
quote,
|
|
85
|
+
changes: startTickerChangeLookup(deps.dataProvider, listing.symbol, listing.exchange),
|
|
86
|
+
graceMs: SUCCESSOR_CHANGE_WAIT_MS,
|
|
87
|
+
});
|
|
88
|
+
const stopped = noLongerTradingNote(`${listing.symbol}${quote.name ? ` (${quote.name})` : ""}`, quote, now);
|
|
89
|
+
if (stopped) {
|
|
90
|
+
const named = !!parseListingArg(typed, exchange).exchange;
|
|
91
|
+
const pointer = fate.moved
|
|
92
|
+
? movedSymbolLine(fate.moved, retry?.(fate.moved.tradesAs) ?? null)
|
|
93
|
+
: named ? null : await liveCompanyQuestion(typed, deps, now);
|
|
94
|
+
throw new AlertListingRefusal(`${stopped}, so no alert was added.`, pointer ?? undefined, `${stopped}.`);
|
|
95
|
+
}
|
|
96
|
+
const changed = listingChangeLine(fate);
|
|
97
|
+
return changed ? [changed] : [];
|
|
98
|
+
}
|