@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
package/src/cli/glossary.ts
CHANGED
|
@@ -14,6 +14,12 @@ export interface GlossaryEntry {
|
|
|
14
14
|
short?: string;
|
|
15
15
|
/** Other names a reader may look it up by: `stop-out` for the high yield. */
|
|
16
16
|
aliases: readonly string[];
|
|
17
|
+
/**
|
|
18
|
+
* Other names for what the functions that show it cover, which find those
|
|
19
|
+
* functions as the term and its abbreviation do (`expected shortfall` for
|
|
20
|
+
* MARS and PORT); the aliases only look the term up. Looked up as aliases are.
|
|
21
|
+
*/
|
|
22
|
+
finds?: readonly string[];
|
|
17
23
|
/** The functions that show it, by the token `fn` takes. */
|
|
18
24
|
functions: readonly string[];
|
|
19
25
|
/**
|
|
@@ -454,26 +460,42 @@ export const GLOSSARY: readonly GlossaryEntry[] = [
|
|
|
454
460
|
definition: "The plain difference between two percentages. A 22% weight against a 20% target is 2pp over it, not 10%, "
|
|
455
461
|
+ "and gas storage going from 74.31% to 74.46% full is up 0.15pp.",
|
|
456
462
|
},
|
|
457
|
-
// Portfolio risk (PORT): the factor table's betas and fits, the tail loss,
|
|
463
|
+
// Portfolio risk (PORT, and MARS, which opens it on its risk view): the factor table's betas and fits, the tail loss,
|
|
464
|
+
// the drawdown, the stress scenarios, concentration.
|
|
458
465
|
{
|
|
459
|
-
term: "Beta", aliases: ["betas", "factor beta", "market beta", "beta to spy", "exposure", "factor exposure"], functions: ["PORT"],
|
|
466
|
+
term: "Beta", aliases: ["betas", "factor beta", "market beta", "beta to spy", "exposure", "factor exposure"], functions: ["PORT", "MARS"],
|
|
460
467
|
shown: ["beta", "Beta"],
|
|
461
468
|
definition: "How far a basket moves with a factor: a beta of 0.54 to SPY means it rose 0.54% on average for each 1% SPY rose. "
|
|
462
469
|
+ "PORT estimates it from the last 60 daily returns; read it with its R², since a beta from a weak fit says little about an exposure.",
|
|
463
470
|
},
|
|
464
471
|
{
|
|
465
|
-
term: "R²", aliases: ["r-squared", "r squared", "r2", "coefficient of determination", "goodness of fit", "weak fit"], functions: ["PORT"],
|
|
472
|
+
term: "R²", aliases: ["r-squared", "r squared", "r2", "coefficient of determination", "goodness of fit", "weak fit"], functions: ["PORT", "MARS"],
|
|
466
473
|
definition: "R-squared: the share of a basket's daily moves a factor explains, from 0 (none) to 1 (all), over the same 60 sessions as its beta. "
|
|
467
474
|
+ "Under 0.1 PORT marks the factor a weak fit: the beta beside it is mostly noise, not an exposure.",
|
|
468
475
|
},
|
|
469
476
|
{
|
|
470
|
-
term: "Value at risk", short: "VaR", aliases: ["
|
|
471
|
-
|
|
477
|
+
term: "Value at risk", short: "VaR", aliases: ["var 95%", "1d var", "historical var", "tail loss"],
|
|
478
|
+
finds: ["value-at-risk", "expected shortfall", "cvar", "conditional var"],
|
|
479
|
+
functions: ["PORT", "MARS"], shown: ["VaR", "expected shortfall"],
|
|
472
480
|
definition: "The loss a basket went beyond on only 5% of its last 60 trading days, as a share of its value and in money: a 1-day VaR 95% of 1.19% means "
|
|
473
481
|
+ "about one day in twenty lost more than that. Expected shortfall is the average loss on those worst days. Both read the past, not a limit on the next loss.",
|
|
474
482
|
},
|
|
475
483
|
{
|
|
476
|
-
term: "
|
|
484
|
+
term: "Max drawdown", aliases: ["drawdowns", "mdd", "peak to trough", "peak-to-trough decline"], finds: ["drawdown", "maximum drawdown"],
|
|
485
|
+
functions: ["PORT", "MARS"], shown: ["max drawdown"],
|
|
486
|
+
definition: "The largest fall from a high to a later low over the window, as a share of the high: a 60D max drawdown of -7.2% is the basket's "
|
|
487
|
+
+ "worst drop from any of its last 60 closes to a later one.",
|
|
488
|
+
},
|
|
489
|
+
{
|
|
490
|
+
term: "Stress test", aliases: ["stress", "scenario", "scenarios", "shock", "shocks", "what if", "historical scenarios", "crash replay"],
|
|
491
|
+
finds: ["stress tests", "stress testing", "scenario analysis"],
|
|
492
|
+
functions: ["PORT", "MARS"], shown: ["stress", "Stress"],
|
|
493
|
+
definition: "What the book would move by in a given shock: an index fall, a 10Y yield rise or a VIX jump read through the basket's past moves "
|
|
494
|
+
+ "with each, a currency or holding move repricing the lines it touches, and four past selloffs replayed on today's holdings at today's weights. "
|
|
495
|
+
+ "A measure of exposure, not a forecast.",
|
|
496
|
+
},
|
|
497
|
+
{
|
|
498
|
+
term: "HHI", aliases: ["herfindahl", "herfindahl index", "herfindahl-hirschman index", "concentration index", "effective holdings"], functions: ["PORT", "MARS"],
|
|
477
499
|
definition: "Herfindahl-Hirschman index: each holding's weight squared and added up, from near 0 for a book spread thin to 1 for a single holding. "
|
|
478
500
|
+ "One over it is the effective number of holdings: 0.20 reads as a book of five equal positions.",
|
|
479
501
|
},
|
|
@@ -508,9 +530,10 @@ export const GLOSSARY: readonly GlossaryEntry[] = [
|
|
|
508
530
|
+ "It is usually a fraction of a percent, and widens when the fund's holdings are hard to trade or their market is shut.",
|
|
509
531
|
},
|
|
510
532
|
{
|
|
511
|
-
term: "Tracking error", aliases: ["index tracking error"], functions: ["ETF"
|
|
533
|
+
term: "Tracking error", aliases: ["index tracking error", "active risk"], functions: ["ETF", "PORT", "MARS"],
|
|
534
|
+
shown: ["Tracking error", "tracking error"],
|
|
512
535
|
definition: "How loosely a fund follows its index: how much the gap between the fund's return and the index's swings, usually over a year. "
|
|
513
|
-
+ "Fees, cash and holdings that differ from the index widen it.",
|
|
536
|
+
+ "Fees, cash and holdings that differ from the index widen it. PORT measures a basket's against SPY from 60 daily returns, annualized.",
|
|
514
537
|
},
|
|
515
538
|
{
|
|
516
539
|
term: "Leveraged and inverse ETFs", aliases: ["leveraged", "inverse", "decay", "daily reset", "3x", "2x", "-1x", "-3x",
|
|
@@ -781,7 +804,7 @@ export const GLOSSARY: readonly GlossaryEntry[] = [
|
|
|
781
804
|
{
|
|
782
805
|
term: "Commitments of Traders", short: "COT", aliases: ["cot report", "commitment of traders", "cftc", "cftc report", "cftc positioning", "positioning"],
|
|
783
806
|
functions: ["COT"], shown: ["CFTC", "COT"],
|
|
784
|
-
definition: "
|
|
807
|
+
definition: "Weekly open contracts split by trader type, from the CFTC and ICE Futures Europe. ICE publishes Brent, gasoil and other European markets itself, separately from the CFTC's ICE WTI market. Tuesday positions are released later; ICE's usual release is Friday at 18:30 London time, subject to holidays. "
|
|
785
808
|
+ "It shows whether speculators or hedgers are net long or short, and how that moved since the week before.",
|
|
786
809
|
},
|
|
787
810
|
{
|
|
@@ -1057,7 +1080,38 @@ function words(text: string): string[] {
|
|
|
1057
1080
|
}
|
|
1058
1081
|
|
|
1059
1082
|
function names(entry: GlossaryEntry): string[] {
|
|
1060
|
-
return [entry.term, ...(entry.short ? [entry.short] : []), ...entry.aliases];
|
|
1083
|
+
return [entry.term, ...(entry.short ? [entry.short] : []), ...entry.finds ?? [], ...entry.aliases];
|
|
1084
|
+
}
|
|
1085
|
+
|
|
1086
|
+
/** The names that find the functions showing a term: the term, its abbreviation and its `finds`, never a loose alias. */
|
|
1087
|
+
function findingNames(entry: GlossaryEntry): string[] {
|
|
1088
|
+
return [entry.term, ...(entry.short ? [entry.short] : []), ...entry.finds ?? []];
|
|
1089
|
+
}
|
|
1090
|
+
|
|
1091
|
+
let keysByFunction: ReadonlyMap<string, ReadonlySet<string>> | null = null;
|
|
1092
|
+
|
|
1093
|
+
/**
|
|
1094
|
+
* Whether a query is, whole, the name of a term a function shows (its term,
|
|
1095
|
+
* abbreviation or `finds`, in any case and punctuation), by the function's
|
|
1096
|
+
* code: `VaR`, `value at risk` and `expected shortfall` name MARS and PORT
|
|
1097
|
+
* in `catalog`, `fn`'s hint and the command bar. A word of a longer query, or
|
|
1098
|
+
* a loose alias (`close`, `exposure`), names nothing, so common searches list
|
|
1099
|
+
* what they did.
|
|
1100
|
+
*/
|
|
1101
|
+
export function glossaryNamesFunction(code: string, query: string): boolean {
|
|
1102
|
+
keysByFunction ??= GLOSSARY.reduce((map, entry) => {
|
|
1103
|
+
for (const fn of entry.functions) map.set(fn, new Set([...map.get(fn) ?? [], ...findingNames(entry).map(lookupKey)]));
|
|
1104
|
+
return map;
|
|
1105
|
+
}, new Map<string, Set<string>>());
|
|
1106
|
+
const key = lookupKey(query);
|
|
1107
|
+
return !!key && !!keysByFunction.get(code.toUpperCase())?.has(key);
|
|
1108
|
+
}
|
|
1109
|
+
|
|
1110
|
+
/** The functions that show the term a query names whole (`VaR`, `value-at-risk`: PORT and MARS), in glossary order. */
|
|
1111
|
+
export function glossaryFunctionsNamed(query: string): string[] {
|
|
1112
|
+
const key = lookupKey(query);
|
|
1113
|
+
if (!key) return [];
|
|
1114
|
+
return [...new Set(GLOSSARY.filter((entry) => findingNames(entry).some((name) => lookupKey(name) === key)).flatMap((entry) => entry.functions))];
|
|
1061
1115
|
}
|
|
1062
1116
|
|
|
1063
1117
|
export interface GlossaryLookup {
|
|
@@ -1181,7 +1235,7 @@ export function glossaryRecord(entry: GlossaryEntry): Record<string, unknown> {
|
|
|
1181
1235
|
return {
|
|
1182
1236
|
term: entry.term,
|
|
1183
1237
|
...(entry.short ? { short: entry.short } : {}),
|
|
1184
|
-
aliases: entry.aliases,
|
|
1238
|
+
aliases: [...entry.finds ?? [], ...entry.aliases],
|
|
1185
1239
|
functions: entry.functions,
|
|
1186
1240
|
definition: entry.definition,
|
|
1187
1241
|
};
|
package/src/cli/help.ts
CHANGED
|
@@ -62,7 +62,7 @@ const GLOBAL_OPTIONS: Array<[string, string]> = [
|
|
|
62
62
|
const EXIT_CODES: Array<[string, string]> = [
|
|
63
63
|
[String(CLI_EXIT_CODES.ok), "Success"],
|
|
64
64
|
[String(CLI_EXIT_CODES.error), "Failed: bad input, no data found or a failed check. fn exits 0 on partial data with warnings; --json ok is false exactly when this is 1"],
|
|
65
|
-
[String(CLI_EXIT_CODES.unusableShot), "shot --strict
|
|
65
|
+
[String(CLI_EXIT_CODES.unusableShot), "shot --strict found no usable data and did not save an image"],
|
|
66
66
|
];
|
|
67
67
|
|
|
68
68
|
export interface CliHelpEntry {
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import type { DemergerAction } from "../types/financials";
|
|
2
|
+
|
|
3
|
+
/** The flag a bar takes when a business was demerged out of the listing at it. */
|
|
4
|
+
export const DEMERGER_FLAG = "demerger";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* A close this far below the one before can be a business leaving the line
|
|
8
|
+
* rather than the market: only then are the listing's corporate actions read
|
|
9
|
+
* beside its bars.
|
|
10
|
+
*/
|
|
11
|
+
const BREAK_FALL = 0.2;
|
|
12
|
+
|
|
13
|
+
interface DemergerRow {
|
|
14
|
+
date: string;
|
|
15
|
+
close?: number | null;
|
|
16
|
+
flag?: string | null;
|
|
17
|
+
interval?: string | null;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/** Whether any bar closes at least `BREAK_FALL` below the bar before it. */
|
|
21
|
+
export function hasPriceBreak(rows: readonly Pick<DemergerRow, "close">[]): boolean {
|
|
22
|
+
let previous: number | null = null;
|
|
23
|
+
for (const row of rows) {
|
|
24
|
+
if (row.close == null || !(row.close > 0)) continue;
|
|
25
|
+
if (previous != null && row.close <= previous * (1 - BREAK_FALL)) return true;
|
|
26
|
+
previous = row.close;
|
|
27
|
+
}
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** The demerger of `--json` and the note: "TMCV:NSE (Tata Motors Limited)". */
|
|
32
|
+
export function demergerSuccessor(action: Pick<DemergerAction, "successor">): string {
|
|
33
|
+
const { symbol, exchange, name } = action.successor;
|
|
34
|
+
const key = exchange ? `${symbol}:${exchange}` : symbol;
|
|
35
|
+
return name ? `${key} (${name})` : key;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* The bar a demerger's ex-date falls in: the daily bar of that session (the
|
|
40
|
+
* next one when the source has none of it), or the week's or month's bar
|
|
41
|
+
* that holds it. -1 when the bars do not reach it.
|
|
42
|
+
*/
|
|
43
|
+
function demergerBarIndex(rows: readonly DemergerRow[], exDate: string): number {
|
|
44
|
+
const day = (row: DemergerRow) => row.date.slice(0, 10);
|
|
45
|
+
const interval = rows[0]?.interval;
|
|
46
|
+
if (interval === "1wk" || interval === "1mo") {
|
|
47
|
+
const holding = rows.findLastIndex((row) => day(row) <= exDate);
|
|
48
|
+
if (holding <= 0) return -1;
|
|
49
|
+
// The last bar holds the ex-date only when its week or month runs over it.
|
|
50
|
+
const start = day(rows[holding]!);
|
|
51
|
+
const within = interval === "1mo" ? start.slice(0, 7) === exDate.slice(0, 7)
|
|
52
|
+
: Date.parse(`${exDate}T00:00:00Z`) - Date.parse(`${start}T00:00:00Z`) < 7 * 86_400_000;
|
|
53
|
+
return holding < rows.length - 1 || within ? holding : -1;
|
|
54
|
+
}
|
|
55
|
+
const first = rows.findIndex((row) => day(row) >= exDate);
|
|
56
|
+
// A bar before the ex-date is needed for the fall to be in the rows at all.
|
|
57
|
+
return first > 0 ? first : -1;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* The rows with the bar each demerger in them falls in flagged `demerger`,
|
|
62
|
+
* and the dates of those bars, oldest first: closes before them include a
|
|
63
|
+
* business the listing no longer has.
|
|
64
|
+
*/
|
|
65
|
+
export function withDemergerFlags<Row extends DemergerRow>(rows: readonly Row[], demergers: readonly DemergerAction[]): { rows: Row[]; breaks: Array<{ date: string; action: DemergerAction }> } {
|
|
66
|
+
const marked = [...rows];
|
|
67
|
+
const breaks: Array<{ date: string; action: DemergerAction }> = [];
|
|
68
|
+
for (const action of [...demergers].sort((left, right) => left.exDate.localeCompare(right.exDate))) {
|
|
69
|
+
const index = demergerBarIndex(marked, action.exDate);
|
|
70
|
+
if (index < 0) continue;
|
|
71
|
+
const row = marked[index]!;
|
|
72
|
+
const codes = (row.flag ?? "").split(",").filter(Boolean);
|
|
73
|
+
if (!codes.includes(DEMERGER_FLAG)) marked[index] = { ...row, flag: [...codes, DEMERGER_FLAG].join(",") };
|
|
74
|
+
breaks.push({ date: row.date, action });
|
|
75
|
+
}
|
|
76
|
+
return { rows: marked, breaks };
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* "On 2025-10-14 the commercial vehicles business was demerged into TMCV:NSE
|
|
81
|
+
* (Tata Motors Limited), 1 share per share, listed 2025-11-12: closes before
|
|
82
|
+
* it include that business, so the fall from 660.75 to 395.45 is no market
|
|
83
|
+
* loss (flag demerger)". Null without one in the bars.
|
|
84
|
+
*/
|
|
85
|
+
export function historyDemergerNote(
|
|
86
|
+
rows: readonly DemergerRow[],
|
|
87
|
+
breaks: ReadonlyArray<{ date: string; action: DemergerAction }>,
|
|
88
|
+
price: (value: number) => string,
|
|
89
|
+
): string | null {
|
|
90
|
+
if (breaks.length === 0) return null;
|
|
91
|
+
const parts = breaks.map(({ date, action }) => {
|
|
92
|
+
const index = rows.findIndex((row) => row.date === date);
|
|
93
|
+
const before = rows.slice(0, index).findLast((row) => row.close != null && row.close > 0)?.close;
|
|
94
|
+
const at = rows[index]?.close;
|
|
95
|
+
const what = action.business ? `the ${action.business} business was demerged` : "a business was demerged";
|
|
96
|
+
const ratio = action.ratio ? `, ${action.ratio} share per share` : "";
|
|
97
|
+
const listed = action.successor.listedOn ? `, listed ${action.successor.listedOn}` : ", not yet listed";
|
|
98
|
+
const fall = before != null && at != null ? `, so the fall from ${price(before)} to ${price(at)} is no market loss` : "";
|
|
99
|
+
return `On ${action.exDate} ${what} into ${demergerSuccessor(action)}${ratio}${listed}: closes before it include that business${fall}`;
|
|
100
|
+
});
|
|
101
|
+
return `${parts.join("; ")} (flag ${DEMERGER_FLAG})`;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* The rows split before each bar flagged `demerger`: a drawdown is measured
|
|
106
|
+
* within one run, never from a close that held the business to one that did
|
|
107
|
+
* not. Split by the bar's own flag, not its date: a weekly or monthly close
|
|
108
|
+
* is dated by its last session, not by the date its bar carries.
|
|
109
|
+
*/
|
|
110
|
+
export function demergerRuns<Row extends { flag?: string | null }>(rows: readonly Row[]): Row[][] {
|
|
111
|
+
const runs: Row[][] = [[]];
|
|
112
|
+
for (const row of rows) {
|
|
113
|
+
if ((row.flag ?? "").split(",").includes(DEMERGER_FLAG) && runs.at(-1)!.length > 0) runs.push([]);
|
|
114
|
+
runs.at(-1)!.push(row);
|
|
115
|
+
}
|
|
116
|
+
return runs;
|
|
117
|
+
}
|
package/src/cli/history-rows.ts
CHANGED
|
@@ -30,6 +30,7 @@ import { cleanFloat32Price, decimalPlaces } from "../utils/float32-price";
|
|
|
30
30
|
import { futuresBoardContract } from "../market-data/futures-board";
|
|
31
31
|
import { isFuturesInstrument } from "../market-data/futures-contract";
|
|
32
32
|
import { contractPriceUnit } from "../time-series/price-units";
|
|
33
|
+
import { DEMERGER_FLAG } from "./history-demergers";
|
|
33
34
|
|
|
34
35
|
/** A float32 price as the decimal it is, which a quote's dated close is cleaned with too (utils/float32-price). */
|
|
35
36
|
export { cleanFloat32Price };
|
|
@@ -44,8 +45,11 @@ const LATE_START_MIN_MS = 10 * DAY_MS;
|
|
|
44
45
|
const LATE_START_MIN_BARS = 3;
|
|
45
46
|
/** A close more than this many times the close before it, or less than its hundredth, follows a jump. */
|
|
46
47
|
const BREAK_JUMP_RATIO = 100;
|
|
47
|
-
/**
|
|
48
|
-
|
|
48
|
+
/**
|
|
49
|
+
* Flag codes for a break before a bar, whose prices stay as served; every other code blanks them. A demerger is one:
|
|
50
|
+
* the bar trades without a business the closes before it held.
|
|
51
|
+
*/
|
|
52
|
+
const BREAK_FLAGS: ReadonlySet<string> = new Set(["gap", "jump", DEMERGER_FLAG]);
|
|
49
53
|
const FIRST_MONDAY_MS = Date.UTC(1970, 0, 5);
|
|
50
54
|
|
|
51
55
|
export const BAR_INTERVAL_LABELS: Record<ManualChartResolution, string> = {
|
|
@@ -300,8 +304,8 @@ export function historyBarValues(point: PricePoint, monthly: boolean): ReturnTyp
|
|
|
300
304
|
|
|
301
305
|
/**
|
|
302
306
|
* What HP says of its bars whose prices contradict each other: one left
|
|
303
|
-
* blank whole as every price view says it ("1
|
|
304
|
-
*
|
|
307
|
+
* blank whole as every price view says it ("1 bar has contradictory prices;
|
|
308
|
+
* left blank."), a month that keeps its close as `history` says it
|
|
305
309
|
* (historyFlagNote, with no daily bars read). Undefined when none.
|
|
306
310
|
*/
|
|
307
311
|
export function priceTableIntegrityNotice(rows: readonly { flag?: string | null; close: number | null; integrity?: unknown }[]): string | undefined {
|
package/src/cli/index.ts
CHANGED
|
@@ -114,6 +114,7 @@ export function createCoreCliCommands(
|
|
|
114
114
|
execute: async (args, ctx) => {
|
|
115
115
|
const query = args.join(" ");
|
|
116
116
|
await search(query, {
|
|
117
|
+
limit: ctx.cliOptions.limit,
|
|
117
118
|
initMarketData: ctx.initMarketData,
|
|
118
119
|
fail: ctx.fail,
|
|
119
120
|
plugins: ctx.plugins,
|
|
@@ -227,7 +228,7 @@ export function createCoreCliCommands(
|
|
|
227
228
|
{ flags: "--scale <n>", description: "Text scale from 0.5 to 4 (default 1)" },
|
|
228
229
|
{ flags: "--watermark <label>", description: "Label drawn in the pane title bar" },
|
|
229
230
|
{ flags: "--no-status", description: "Leave out the dated status line (as-of, delay, market hours) drawn in the pane footer" },
|
|
230
|
-
{ flags: "--strict", description: `Exit ${CLI_EXIT_CODES.unusableShot} when the pane is empty, shows an error, is still loading, is access-gated, or draws a column blank in every row
|
|
231
|
+
{ flags: "--strict", description: `Exit ${CLI_EXIT_CODES.unusableShot} without saving an image when the pane is empty, shows an error, is still loading, is access-gated, or draws a column blank in every row. The Reason line names what it saw. A column cut at the table's edge is a warning` },
|
|
231
232
|
{ flags: "--<option> <value>", description: "A function setting; gloom catalog <function> lists them" },
|
|
232
233
|
EXCHANGE_OPTION,
|
|
233
234
|
],
|
package/src/cli/known-gaps.ts
CHANGED
|
@@ -479,6 +479,22 @@ export function commandPointerLeads(query: string): boolean {
|
|
|
479
479
|
return findCommandPointer(query)?.leads === true;
|
|
480
480
|
}
|
|
481
481
|
|
|
482
|
+
/** The app's Send Feedback command (FB, FEEDBACK, BUG), which no function or CLI command does. */
|
|
483
|
+
const FEEDBACK_NAMES = new Set(["fb", "feedback", "bug", "bugs", "idea", "ideas"]);
|
|
484
|
+
const FEEDBACK_WORDS = new Set(["send", "report", "file", "submit", "give", "suggest", "a", "an"]);
|
|
485
|
+
|
|
486
|
+
/**
|
|
487
|
+
* The line `catalog` prints for a command of the app's command bar that is no
|
|
488
|
+
* function: `catalog FB`, `catalog feedback` and `catalog report bug` name
|
|
489
|
+
* Send Feedback, which the command bar opens as FB. Null for any other query.
|
|
490
|
+
* `search` leaves it out: FB there is a ticker.
|
|
491
|
+
*/
|
|
492
|
+
export function appCommandPointer(query: string): string | null {
|
|
493
|
+
const asked = words(query);
|
|
494
|
+
if (!asked.some((word) => FEEDBACK_NAMES.has(word)) || !asked.every((word) => FEEDBACK_NAMES.has(word) || FEEDBACK_WORDS.has(word))) return null;
|
|
495
|
+
return "Send Feedback: open the app (gloom) and run it from the command bar (Ctrl+P, FB), or open an issue at https://github.com/gloom-sh/gloomberb/issues";
|
|
496
|
+
}
|
|
497
|
+
|
|
482
498
|
/**
|
|
483
499
|
* The line for a command word typed as `gloom export LMT`: exporting is a flag every command takes, not a
|
|
484
500
|
* command, so the example runs on the symbol typed. Null for any other word.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { TOP_COIN_NAMES } from "../utils/crypto-pair";
|
|
2
|
+
import { isUsListingExchange } from "../utils/exchanges";
|
|
3
|
+
import { classifyInstrumentKind } from "../tickers/search/ranking";
|
|
4
|
+
|
|
5
|
+
let stocks: ReadonlySet<string> | undefined;
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Whether the listings shipped with the app list the symbol as a stock on a US exchange, and no top coin is known by
|
|
9
|
+
* it (SOL is a coin before it is a company). Read from the shipped file the first time it is asked, a couple of
|
|
10
|
+
* milliseconds, so a command that never looks up a symbol does not load it.
|
|
11
|
+
*/
|
|
12
|
+
export function isKnownUsStock(symbol: string): boolean {
|
|
13
|
+
stocks ??= new Set((require("../tickers/search/major-listings.json") as { listings: ReadonlyArray<readonly unknown[]> }).listings
|
|
14
|
+
.filter(([, , exchange, type]) => isUsListingExchange(String(exchange)) && classifyInstrumentKind(String(type)) === "equity")
|
|
15
|
+
.map(([listed]) => String(listed).toUpperCase()));
|
|
16
|
+
const wanted = symbol.trim().toUpperCase();
|
|
17
|
+
return stocks.has(wanted) && !TOP_COIN_NAMES.has(wanted);
|
|
18
|
+
}
|