@gloom-sh/terminal 0.20.20 → 0.20.22
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 +6 -3
- package/patches/electrobun-devkit@2.0.5.patch +169 -3
- package/src/api-client/buybacks.ts +108 -0
- package/src/api-client/data.ts +214 -2
- package/src/api-client/dilution.ts +183 -0
- package/src/api-client/earnings.ts +2 -2
- package/src/api-client/equity-screener.ts +24 -0
- package/src/api-client/exchange-announcements.ts +16 -5
- package/src/api-client/exchange-short-balances.ts +24 -0
- package/src/api-client/futures-curve.ts +5 -0
- package/src/api-client/hk-cbbc.ts +134 -0
- package/src/api-client/hk-ccass.ts +233 -0
- package/src/api-client/index.ts +55 -3
- package/src/api-client/jpx-short-positions.ts +24 -0
- package/src/api-client/market-discovery.ts +42 -6
- package/src/api-client/members.ts +7 -0
- package/src/api-client/ownership-disclosures.ts +35 -0
- package/src/api-client/paths.ts +5 -2
- package/src/api-client/perps.ts +20 -0
- package/src/api-client/request.ts +92 -17
- package/src/api-client/revenue-breakdown.ts +6 -2
- package/src/api-client/sfc-short-positions.ts +19 -0
- package/src/api-client/supply-chain.ts +22 -0
- package/src/api-client/taiwan-revenue.ts +134 -0
- package/src/api-client/types/filings-and-calls.ts +2 -0
- package/src/api-client/types/jobs.ts +1 -0
- package/src/api-client/types/world-venues.ts +1 -0
- package/src/app/language-observer.tsx +6 -1
- package/src/app/pane-runtime/plugin-bindings.ts +15 -8
- package/src/app/pro-welcome/model.ts +15 -11
- package/src/app/pro-welcome/row.tsx +3 -3
- package/src/app/pro-welcome/use-pro-welcome.ts +2 -2
- package/src/app/runtime/plugin-bindings.ts +20 -2
- package/src/app/runtime/startup.ts +3 -2
- package/src/app.tsx +3 -2
- package/src/architecture/core-builtin-allowlist.json +2 -2
- package/src/architecture/dom-text-cuts-allowlist.json +2 -2
- package/src/architecture/floating-promise-allowlist.json +2 -2
- package/src/architecture/pane-tabs-allowlist.json +3 -0
- package/src/brokers/account-cache.ts +2 -1
- package/src/brokers/account-choice.ts +121 -0
- package/src/brokers/broker-portfolio-sync.ts +30 -5
- package/src/brokers/profile-form.ts +3 -0
- package/src/brokers/signed-in/adapter.ts +16 -5
- package/src/brokers/sync-broker-instance.ts +27 -3
- package/src/capabilities/asset-data-inputs.ts +13 -0
- package/src/capabilities/factories.ts +12 -3
- package/src/capabilities/registry.ts +1 -0
- package/src/capabilities/types.ts +1 -0
- package/src/cli/commands/market.ts +199 -103
- package/src/cli/commands/news-search.ts +12 -0
- package/src/cli/commands/options-chain.ts +11 -5
- package/src/cli/commands/options-leaps.ts +55 -30
- package/src/cli/commands/overview.ts +24 -24
- package/src/cli/commands/search.ts +2 -1
- package/src/cli/commands/ticker.ts +30 -16
- package/src/cli/csv-export.ts +9 -5
- package/src/cli/desktop-pane-shot-browser.ts +143 -53
- package/src/cli/desktop-pane-shot.ts +61 -67
- package/src/cli/export-source.ts +40 -2
- package/src/cli/glossary.ts +3 -2
- package/src/cli/helpers.ts +2 -1
- package/src/cli/history-demergers.ts +171 -17
- package/src/cli/history-rows.ts +47 -5
- package/src/cli/known-gaps.ts +21 -7
- package/src/cli/listing-arg.ts +22 -11
- package/src/cli/pane-functions/capabilities.ts +4 -9
- package/src/cli/pane-functions/catalog-snapshot.json +48 -44
- package/src/cli/pane-functions/catalog.ts +7 -20
- package/src/cli/pane-functions/data.ts +8 -4
- package/src/cli/pane-functions/dom.ts +8 -5
- package/src/cli/pane-functions/financial-ratio-shot.ts +20 -5
- package/src/cli/pane-functions/freshness.ts +57 -12
- package/src/cli/pane-functions/function-help.ts +36 -4
- package/src/cli/pane-functions/headless.ts +85 -27
- package/src/cli/pane-functions/index.ts +13 -5
- package/src/cli/pane-functions/market-session.ts +26 -1
- package/src/cli/pane-functions/report-notices.ts +10 -0
- package/src/cli/pane-functions/resolver.ts +79 -4
- package/src/cli/pane-functions/screenshot-assessment.ts +26 -10
- package/src/cli/pane-functions/screenshot-bridge.ts +5 -1
- package/src/cli/pane-functions/screenshot-data-evidence.ts +12 -5
- package/src/cli/pane-functions/screenshot-payload.ts +55 -6
- package/src/cli/pane-functions/screenshot-render.ts +22 -7
- package/src/cli/pane-functions/ticker-question.ts +52 -47
- package/src/cli/perpetual-contract.ts +14 -1
- package/src/cli/rendered-table-rows.ts +75 -0
- package/src/cli/report-tables.ts +18 -3
- package/src/cli/result.ts +14 -2
- package/src/cli/visible-key-values.ts +3 -2
- package/src/components/chart/composite/format.ts +14 -1
- package/src/components/chart/composite/panel-surface/panel-cursor.tsx +37 -14
- package/src/components/chart/composite/panel-surface.tsx +1 -0
- package/src/components/chart/composite/text-renderer.ts +104 -44
- package/src/components/chart/curve/model.ts +4 -1
- package/src/components/chart-table/layout.ts +8 -4
- package/src/components/command-bar/list/model.ts +2 -0
- package/src/components/command-bar/pane-templates/items.ts +5 -25
- package/src/components/command-bar/panel/index.tsx +7 -4
- package/src/components/command-bar/routes/root/provider-search.ts +4 -4
- package/src/components/command-bar/routes/root/results.ts +6 -2
- package/src/components/command-bar/routes/root/start-here.ts +1 -1
- package/src/components/command-bar/routes/ticker-search/results.ts +21 -1
- package/src/components/command-bar/routes/ticker-search/route.ts +3 -3
- package/src/components/command-bar/routes/ticker-search/title.ts +23 -0
- package/src/components/command-bar/routing/list-state.ts +17 -5
- package/src/components/command-bar/selection-runtime.ts +3 -2
- package/src/components/command-bar/surface/index.tsx +2 -0
- package/src/components/command-bar/workflow/alert.ts +6 -4
- package/src/components/command-bar/workflow/collection-actions.ts +2 -1
- package/src/components/data-table/export.ts +3 -1
- package/src/components/data-table/sections.ts +12 -1
- package/src/components/data-table/view.tsx +50 -8
- package/src/components/feed-data-table/stack-view.tsx +3 -0
- package/src/components/index.ts +3 -3
- package/src/components/layout/floating-pane.tsx +5 -2
- package/src/components/layout/pane/footer/index.tsx +1 -0
- package/src/components/layout/pane/footer/model.ts +20 -7
- package/src/components/layout/pane/header.tsx +21 -2
- package/src/components/layout/pane/index.tsx +6 -2
- package/src/components/layout/pane/link-note.ts +12 -0
- package/src/components/layout/pane/title.ts +12 -5
- package/src/components/market-board/index.tsx +8 -11
- package/src/components/price-selector-dialog.tsx +8 -4
- package/src/components/reader/reader-text.tsx +25 -2
- package/src/components/ticker/badge/list.tsx +4 -3
- package/src/components/ticker/list-table-view.tsx +16 -1
- package/src/components/ui/data-table/column-fit.ts +129 -0
- package/src/components/ui/data-table/display-columns.ts +28 -9
- package/src/components/ui/data-table/index.tsx +57 -15
- package/src/components/ui/data-table/opentui/index.tsx +5 -0
- package/src/components/ui/data-table/types.ts +96 -5
- package/src/components/ui/data-table/visible-range.ts +9 -1
- package/src/components/ui/day-cell.ts +30 -0
- package/src/components/ui/index.ts +3 -1
- package/src/components/ui/prose.tsx +3 -1
- package/src/components/ui/query-bar.tsx +20 -14
- package/src/components/ui/table-layout.ts +188 -6
- package/src/core/state/app/layout.ts +7 -2
- package/src/core/state/app/state.ts +6 -2
- package/src/data/cached-query.ts +20 -4
- package/src/data/config/store/legacy-tabs.ts +51 -0
- package/src/data/config/store/node.ts +2 -2
- package/src/data/config/store/normalize.ts +11 -5
- package/src/data/config/store/shared-file.ts +8 -7
- package/src/data/config/store/shared-layout.ts +146 -0
- package/src/data/news-pane-snapshots.ts +2 -1
- package/src/data/plugin-cache.ts +5 -1
- package/src/data/saved-copies.ts +68 -2
- package/src/data/sqlite/access.ts +76 -11
- package/src/data/sqlite/checkpointer.ts +73 -10
- package/src/data/sqlite/database.ts +14 -1
- package/src/data/sqlite/retry.ts +1 -1
- package/src/docs/load.ts +5 -2
- package/src/docs/snapshot.json +1665 -4362
- package/src/docs/topics.ts +11 -9
- package/src/i18n/es.ts +109 -0
- package/src/i18n/index.ts +74 -4
- package/src/i18n/ja.ts +109 -0
- package/src/i18n/ko.ts +109 -0
- package/src/i18n/react.ts +10 -2
- package/src/i18n/zh-cn.ts +109 -0
- package/src/i18n/zh-tw.ts +109 -0
- package/src/layout/pane-manager/dock-normalization.ts +61 -0
- package/src/market-data/ah-pair.ts +7 -2
- package/src/market-data/coordinator/index.ts +25 -5
- package/src/market-data/depositary-pair.ts +27 -10
- package/src/market-data/fund-actions.ts +21 -0
- package/src/market-data/futures-roll-returns.ts +54 -7
- package/src/market-data/fx-closes.ts +14 -0
- package/src/market-data/market/freshness.ts +37 -33
- package/src/market-data/market/futures-product-hours.ts +113 -0
- package/src/market-data/market/futures-week.ts +2 -0
- package/src/market-data/market/globex-day.ts +9 -2
- package/src/market-data/market/split-price-basis.ts +55 -0
- package/src/market-data/market/status.ts +30 -25
- package/src/market-data/market/venue-session.ts +18 -0
- package/src/market-data/options-alternatives.ts +49 -7
- package/src/market-data/perpetual-open-interest.ts +41 -0
- package/src/market-data/price-adjustments.ts +115 -0
- package/src/market-data/quotes/balance-sheet-rate.ts +6 -2
- package/src/market-data/quotes/contributions.ts +4 -2
- package/src/market-data/quotes/day-range.ts +24 -9
- package/src/market-data/quotes/export-identity.ts +11 -3
- package/src/market-data/quotes/freshness.ts +7 -5
- package/src/market-data/quotes/regular-session-valuation.ts +6 -0
- package/src/market-data/quotes/resolution.ts +20 -24
- package/src/market-data/quotes/tick-range.ts +22 -1
- package/src/market-data/quotes/time.ts +161 -7
- package/src/market-data/split-terms.ts +3 -2
- package/src/news/aggregator.ts +1 -0
- package/src/news/news-model.ts +12 -2
- package/src/news/query-presets.ts +6 -4
- package/src/news/types.ts +15 -0
- package/src/plugins/builtin/alerts/alert-engine.ts +2 -0
- package/src/plugins/builtin/alerts/cli-forms.ts +6 -2
- package/src/plugins/builtin/alerts/cli-move.ts +5 -2
- package/src/plugins/builtin/alerts/cli.ts +67 -30
- package/src/plugins/builtin/alerts/command.ts +51 -3
- package/src/plugins/builtin/alerts/event-rows.ts +1 -1
- package/src/plugins/builtin/alerts/events-pane.tsx +2 -1
- package/src/plugins/builtin/alerts/format.ts +87 -16
- package/src/plugins/builtin/alerts/headless.ts +29 -10
- package/src/plugins/builtin/alerts/history-pane.tsx +74 -33
- package/src/plugins/builtin/alerts/history-rows.ts +24 -1
- package/src/plugins/builtin/alerts/index.tsx +34 -35
- package/src/plugins/builtin/alerts/metric-data.ts +24 -6
- package/src/plugins/builtin/alerts/move-checks.ts +1 -0
- package/src/plugins/builtin/alerts/pane.tsx +24 -6
- package/src/plugins/builtin/alerts/pro-rules.ts +10 -4
- package/src/plugins/builtin/alerts/quotes.ts +10 -5
- package/src/plugins/builtin/alerts/research-builder.ts +6 -2
- package/src/plugins/builtin/alerts/research-rules.ts +12 -0
- package/src/plugins/builtin/alerts/session.ts +28 -0
- package/src/plugins/builtin/alerts/types.ts +2 -0
- package/src/plugins/builtin/analytics/pane-model.ts +2 -1
- package/src/plugins/builtin/analytics/risk-model.ts +2 -2
- package/src/plugins/builtin/attention/headless.ts +2 -2
- package/src/plugins/builtin/attention/model.ts +7 -2
- package/src/plugins/builtin/attention/pane.tsx +2 -1
- package/src/plugins/builtin/awards/detail.tsx +5 -4
- package/src/plugins/builtin/awards/headless.ts +14 -5
- package/src/plugins/builtin/awards/model.ts +36 -1
- package/src/plugins/builtin/awards/pane.tsx +29 -9
- package/src/plugins/builtin/backtest/pane.tsx +4 -2
- package/src/plugins/builtin/bond-calculator/pane.tsx +2 -1
- package/src/plugins/builtin/broker-manager/detail.tsx +67 -4
- package/src/plugins/builtin/broker-manager/index.tsx +35 -4
- package/src/plugins/builtin/broker-manager/keyboard.ts +10 -0
- package/src/plugins/builtin/broker-manager/pane-actions.tsx +35 -2
- package/src/plugins/builtin/broker-trading/orders.tsx +10 -3
- package/src/plugins/builtin/broker-trading/ticket.tsx +14 -5
- package/src/plugins/builtin/buildout/detail/company.tsx +0 -1
- package/src/plugins/builtin/buildout/detail/ui.tsx +7 -5
- package/src/plugins/builtin/buildout/format.ts +3 -1
- package/src/plugins/builtin/buildout/model/normalizers.ts +0 -1
- package/src/plugins/builtin/buildout/model/types.ts +0 -1
- package/src/plugins/builtin/buildout/pane/index.tsx +9 -0
- package/src/plugins/builtin/buildout/pane/status.tsx +11 -0
- package/src/plugins/builtin/buybacks/client.ts +48 -0
- package/src/plugins/builtin/buybacks/index.tsx +22 -0
- package/src/plugins/builtin/buybacks/model.ts +151 -0
- package/src/plugins/builtin/buybacks/pane.tsx +140 -0
- package/src/plugins/builtin/buybacks/series.ts +36 -0
- package/src/plugins/builtin/catalysts/detail.tsx +14 -8
- package/src/plugins/builtin/catalysts/evidence.ts +11 -3
- package/src/plugins/builtin/catalysts/headless.ts +52 -9
- package/src/plugins/builtin/catalysts/kinds.ts +413 -0
- package/src/plugins/builtin/catalysts/model.ts +61 -18
- package/src/plugins/builtin/catalysts/pane.tsx +85 -19
- package/src/plugins/builtin/cds/client.ts +9 -2
- package/src/plugins/builtin/cds/headless.ts +25 -10
- package/src/plugins/builtin/cds/model.ts +37 -12
- package/src/plugins/builtin/cds/pane.tsx +18 -10
- package/src/plugins/builtin/chart-composer/chart-spec-edit.ts +68 -7
- package/src/plugins/builtin/chart-composer/chart-title.ts +114 -0
- package/src/plugins/builtin/chart-composer/cli-options.ts +1 -1
- package/src/plugins/builtin/chart-composer/headless.ts +27 -7
- package/src/plugins/builtin/chart-composer/index.tsx +2 -68
- package/src/plugins/builtin/chart-composer/leverage-overlay.ts +2 -4
- package/src/plugins/builtin/chart-composer/pane.tsx +13 -4
- package/src/plugins/builtin/chart-composer/presets.ts +1 -1
- package/src/plugins/builtin/chart-composer/session-history.ts +14 -2
- package/src/plugins/builtin/chat/controller/draft-sync.ts +13 -7
- package/src/plugins/builtin/chat/controller/index.ts +5 -3
- package/src/plugins/builtin/chat/controller/session-runtime.ts +18 -8
- package/src/plugins/builtin/chat/controller/state.ts +4 -0
- package/src/plugins/builtin/chat/index.tsx +1 -1
- package/src/plugins/builtin/chat/pane-requests.ts +8 -4
- package/src/plugins/builtin/clinical-trials/model.ts +2 -2
- package/src/plugins/builtin/clinical-trials/pane.tsx +3 -3
- package/src/plugins/builtin/cloud/askg/pane.tsx +60 -50
- package/src/plugins/builtin/cloud/auth-actions.tsx +6 -3
- package/src/plugins/builtin/cloud/mcp-connect/dialog.tsx +4 -1
- package/src/plugins/builtin/cloud/thesis/ticker-tab.tsx +2 -1
- package/src/plugins/builtin/comment-letters/pane.tsx +4 -2
- package/src/plugins/builtin/commodity-balances/headless.ts +2 -1
- package/src/plugins/builtin/company-attention/building-model.ts +3 -4
- package/src/plugins/builtin/company-attention/building.tsx +2 -0
- package/src/plugins/builtin/company-attention/headless.ts +4 -3
- package/src/plugins/builtin/company-attention/model.ts +2 -0
- package/src/plugins/builtin/company-attention/moves-model.ts +2 -1
- package/src/plugins/builtin/company-attention/moves.tsx +2 -0
- package/src/plugins/builtin/company-attention/pane.tsx +17 -3
- package/src/plugins/builtin/company-attention/signals-model.ts +3 -4
- package/src/plugins/builtin/company-attention/signals.tsx +5 -0
- package/src/plugins/builtin/company-kpis/headless.ts +27 -11
- package/src/plugins/builtin/company-kpis/model.ts +47 -7
- package/src/plugins/builtin/company-kpis/pane.tsx +36 -19
- package/src/plugins/builtin/company-kpis/taiwan-monthly-model.ts +99 -0
- package/src/plugins/builtin/company-kpis/taiwan-monthly-view.tsx +327 -0
- package/src/plugins/builtin/composite/ownership-browser.ts +28 -0
- package/src/plugins/builtin/composite/ownership.ts +5 -1
- package/src/plugins/builtin/congress-trades/detail.tsx +44 -8
- package/src/plugins/builtin/congress-trades/headless.ts +15 -11
- package/src/plugins/builtin/congress-trades/model.ts +104 -11
- package/src/plugins/builtin/congress-trades/pane.tsx +11 -6
- package/src/plugins/builtin/congress-trades/table.tsx +17 -10
- package/src/plugins/builtin/congress-trades/use-feed.ts +13 -2
- package/src/plugins/builtin/correlation/headless.ts +5 -5
- package/src/plugins/builtin/correlation/history.ts +1 -0
- package/src/plugins/builtin/correlation/index.tsx +7 -5
- package/src/plugins/builtin/correlation/matrix/selection.ts +21 -3
- package/src/plugins/builtin/correlation/relationship/model.ts +5 -0
- package/src/plugins/builtin/correlation/relationship/pane.tsx +14 -10
- package/src/plugins/builtin/correlation/relationship/view-model.ts +4 -21
- package/src/plugins/builtin/cot/headless.ts +1 -1
- package/src/plugins/builtin/cot/pane.tsx +7 -2
- package/src/plugins/builtin/cpi/headless.ts +2 -1
- package/src/plugins/builtin/credit-conditions/headless.ts +2 -1
- package/src/plugins/builtin/credit-documents/detail.tsx +2 -1
- package/src/plugins/builtin/credit-documents/export.ts +18 -12
- package/src/plugins/builtin/credit-documents/headless.ts +1 -1
- package/src/plugins/builtin/credit-documents/model.ts +106 -25
- package/src/plugins/builtin/credit-documents/pane.tsx +9 -5
- package/src/plugins/builtin/crypto-board/defi-view.tsx +2 -1
- package/src/plugins/builtin/crypto-board/defi.ts +5 -4
- package/src/plugins/builtin/crypto-board/headless.ts +7 -2
- package/src/plugins/builtin/crypto-board/model.ts +6 -4
- package/src/plugins/builtin/crypto-board/pane.tsx +2 -1
- package/src/plugins/builtin/crypto-board/supply.ts +4 -3
- package/src/plugins/builtin/crypto-etf-flows/headless.ts +15 -8
- package/src/plugins/builtin/crypto-etf-flows/pane.tsx +6 -5
- package/src/plugins/builtin/debt-maturities/headless.ts +56 -38
- package/src/plugins/builtin/debt-maturities/model.ts +2 -1
- package/src/plugins/builtin/debt-maturities/pane.tsx +24 -22
- package/src/plugins/builtin/dilution/index.tsx +74 -0
- package/src/plugins/builtin/dilution/model.ts +159 -0
- package/src/plugins/builtin/dilution/pane.tsx +592 -0
- package/src/plugins/builtin/dividend-yield/client.ts +81 -10
- package/src/plugins/builtin/dividend-yield/headless.ts +44 -24
- package/src/plugins/builtin/dividend-yield/index.tsx +2 -1
- package/src/plugins/builtin/dividend-yield/model.ts +9 -6
- package/src/plugins/builtin/dividend-yield/pane.tsx +28 -15
- package/src/plugins/builtin/dividend-yield/ranking-view.tsx +6 -2
- package/src/plugins/builtin/dividend-yield/ranking.ts +22 -8
- package/src/plugins/builtin/dividend-yield/reference-price.ts +3 -0
- package/src/plugins/builtin/dividend-yield/types.ts +12 -0
- package/src/plugins/builtin/dividend-yield/view.ts +61 -12
- package/src/plugins/builtin/docs/index.tsx +1 -1
- package/src/plugins/builtin/docs/pane.tsx +7 -3
- package/src/plugins/builtin/docs/use-docs.ts +2 -1
- package/src/plugins/builtin/doe/headless.ts +1 -1
- package/src/plugins/builtin/doe/pane.tsx +16 -7
- package/src/plugins/builtin/earnings/board-model.ts +19 -6
- package/src/plugins/builtin/earnings/board-table.ts +64 -48
- package/src/plugins/builtin/earnings/board.tsx +93 -51
- package/src/plugins/builtin/earnings/headless.ts +71 -12
- package/src/plugins/builtin/earnings/history-model.ts +28 -15
- package/src/plugins/builtin/earnings/history.tsx +1 -1
- package/src/plugins/builtin/earnings-calls/calendar.tsx +23 -10
- package/src/plugins/builtin/earnings-calls/data.ts +8 -5
- package/src/plugins/builtin/earnings-calls/format.ts +34 -0
- package/src/plugins/builtin/earnings-calls/headless.ts +5 -4
- package/src/plugins/builtin/earnings-calls/pane.tsx +22 -17
- package/src/plugins/builtin/earnings-calls/transcript-view.tsx +14 -12
- package/src/plugins/builtin/earnings-ripple/headless.ts +1 -1
- package/src/plugins/builtin/earnings-ripple/pane.tsx +4 -3
- package/src/plugins/builtin/econ/calendar-model.ts +73 -4
- package/src/plugins/builtin/econ/index.tsx +32 -36
- package/src/plugins/builtin/econ-statistics/detail.tsx +2 -2
- package/src/plugins/builtin/econ-statistics/headless.ts +10 -5
- package/src/plugins/builtin/econ-statistics/pane.tsx +6 -3
- package/src/plugins/builtin/econ-statistics/view.ts +15 -4
- package/src/plugins/builtin/equity-screener/client.ts +1 -1
- package/src/plugins/builtin/equity-screener/headless.ts +149 -31
- package/src/plugins/builtin/equity-screener/live.ts +23 -5
- package/src/plugins/builtin/equity-screener/model.ts +38 -14
- package/src/plugins/builtin/equity-screener/pane.tsx +5 -5
- package/src/plugins/builtin/estimate-revisions/headless.ts +23 -2
- package/src/plugins/builtin/estimate-revisions/model.ts +63 -13
- package/src/plugins/builtin/estimate-revisions/pane.tsx +228 -225
- package/src/plugins/builtin/estimate-revisions/sorting.ts +8 -16
- package/src/plugins/builtin/exposure/drivers.ts +5 -2
- package/src/plugins/builtin/exposure/headless.ts +7 -4
- package/src/plugins/builtin/exposure/holdings.ts +2 -2
- package/src/plugins/builtin/exposure/model.ts +2 -1
- package/src/plugins/builtin/exposure/pane.tsx +16 -7
- package/src/plugins/builtin/fear-greed/format.ts +7 -7
- package/src/plugins/builtin/fear-greed/pane.tsx +21 -7
- package/src/plugins/builtin/futures/index.tsx +29 -1
- package/src/plugins/builtin/futures/model.ts +93 -10
- package/src/plugins/builtin/futures/returns.ts +54 -1
- package/src/plugins/builtin/futures/table.tsx +14 -2
- package/src/plugins/builtin/futures/use-front-returns.ts +20 -3
- package/src/plugins/builtin/futures-curve/client.ts +1 -1
- package/src/plugins/builtin/futures-curve/headless.ts +21 -10
- package/src/plugins/builtin/futures-curve/model.ts +31 -9
- package/src/plugins/builtin/futures-curve/pane.tsx +26 -17
- package/src/plugins/builtin/fx-matrix/headless.ts +3 -2
- package/src/plugins/builtin/gpu/headless.ts +11 -5
- package/src/plugins/builtin/gpu/model.ts +1 -1
- package/src/plugins/builtin/help/function-index.ts +16 -8
- package/src/plugins/builtin/help/functions-table.tsx +6 -4
- package/src/plugins/builtin/help/shortcut-model.ts +7 -2
- package/src/plugins/builtin/holders/beneficial-model.ts +1 -1
- package/src/plugins/builtin/holders/beneficial-view.tsx +3 -2
- package/src/plugins/builtin/holders/ccass-market-pane.tsx +363 -0
- package/src/plugins/builtin/holders/ccass-view.tsx +323 -0
- package/src/plugins/builtin/holders/disclosures-view.tsx +63 -0
- package/src/plugins/builtin/holders/disclosures.ts +33 -0
- package/src/plugins/builtin/holders/headless.ts +25 -7
- package/src/plugins/builtin/holders/index.tsx +75 -1
- package/src/plugins/builtin/holders/pane.tsx +79 -14
- package/src/plugins/builtin/holders/report-rows.ts +2 -0
- package/src/plugins/builtin/holders/table-model.ts +14 -6
- package/src/plugins/builtin/holders/types.ts +2 -2
- package/src/plugins/builtin/insider/activity-chart.ts +141 -0
- package/src/plugins/builtin/insider/client.ts +118 -11
- package/src/plugins/builtin/insider/filing-stories.ts +36 -20
- package/src/plugins/builtin/insider/headless.ts +2 -1
- package/src/plugins/builtin/insider/index.tsx +74 -12
- package/src/plugins/builtin/insider/issuer.ts +5 -2
- package/src/plugins/builtin/insider/signals-cells.tsx +15 -8
- package/src/plugins/builtin/insider/signals.tsx +6 -5
- package/src/plugins/builtin/insider/table-model.ts +17 -17
- package/src/plugins/builtin/insider/table.tsx +18 -10
- package/src/plugins/builtin/ipo-calendar/headless.ts +55 -11
- package/src/plugins/builtin/ipo-calendar/listing-ipo.ts +31 -4
- package/src/plugins/builtin/ipo-calendar/model.ts +208 -47
- package/src/plugins/builtin/ipo-calendar/pane.tsx +87 -25
- package/src/plugins/builtin/iv-history/client.ts +17 -8
- package/src/plugins/builtin/iv-history/format.ts +23 -12
- package/src/plugins/builtin/iv-history/headless.ts +11 -5
- package/src/plugins/builtin/iv-history/model.ts +15 -13
- package/src/plugins/builtin/iv-history/pane.tsx +5 -2
- package/src/plugins/builtin/iv-history/screen-pane.tsx +46 -24
- package/src/plugins/builtin/jobs/headless.ts +4 -3
- package/src/plugins/builtin/jobs/pane.tsx +6 -5
- package/src/plugins/builtin/jodi/headless.ts +15 -2
- package/src/plugins/builtin/jodi/model.ts +46 -5
- package/src/plugins/builtin/jodi/pane.tsx +17 -13
- package/src/plugins/builtin/kelly-sizer/headless.ts +3 -1
- package/src/plugins/builtin/kelly-sizer/sections.tsx +2 -1
- package/src/plugins/builtin/macro-day/client.ts +2 -3
- package/src/plugins/builtin/macro-day/comparison.ts +58 -0
- package/src/plugins/builtin/macro-day/headless.ts +47 -3
- package/src/plugins/builtin/macro-day/index.tsx +32 -9
- package/src/plugins/builtin/macro-day/model.ts +1 -1
- package/src/plugins/builtin/macro-day/pane.tsx +109 -15
- package/src/plugins/builtin/market-halts/model.ts +10 -8
- package/src/plugins/builtin/market-halts/pane.tsx +1 -1
- package/src/plugins/builtin/market-heatmap/data.ts +17 -2
- package/src/plugins/builtin/market-heatmap/headless.ts +56 -6
- package/src/plugins/builtin/market-heatmap/index.tsx +57 -3
- package/src/plugins/builtin/market-heatmap/model.ts +27 -1
- package/src/plugins/builtin/market-movers/footer.ts +29 -3
- package/src/plugins/builtin/market-movers/headless.ts +12 -5
- package/src/plugins/builtin/market-movers/index.tsx +3 -3
- package/src/plugins/builtin/market-movers/model.ts +7 -1
- package/src/plugins/builtin/market-movers/session-body.tsx +6 -3
- package/src/plugins/builtin/market-movers/session-table.ts +1 -0
- package/src/plugins/builtin/market-movers/session.ts +1 -1
- package/src/plugins/builtin/market-movers/table.ts +1 -1
- package/src/plugins/builtin/market-valuation/detail.tsx +3 -3
- package/src/plugins/builtin/market-valuation/headless.ts +6 -6
- package/src/plugins/builtin/market-valuation/pane.tsx +2 -3
- package/src/plugins/builtin/market-valuation/view.ts +6 -8
- package/src/plugins/builtin/members/client.ts +9 -2
- package/src/plugins/builtin/members/headless.ts +20 -14
- package/src/plugins/builtin/members/model.ts +64 -18
- package/src/plugins/builtin/members/pane.tsx +21 -15
- package/src/plugins/builtin/mna/distress/detail.tsx +7 -6
- package/src/plugins/builtin/mna/distress/model.ts +7 -7
- package/src/plugins/builtin/mna/distress/pane.tsx +8 -7
- package/src/plugins/builtin/mna/headless.ts +40 -7
- package/src/plugins/builtin/mna/model.ts +66 -6
- package/src/plugins/builtin/mna/pane.tsx +118 -60
- package/src/plugins/builtin/money-markets/headless.ts +1 -1
- package/src/plugins/builtin/news/headless.ts +4 -0
- package/src/plugins/builtin/news/index.tsx +3 -1
- package/src/plugins/builtin/news/wire/industry-pane.tsx +3 -1
- package/src/plugins/builtin/news/wire/news/preset-pane.tsx +1 -1
- package/src/plugins/builtin/news/wire/news/table.tsx +15 -4
- package/src/plugins/builtin/news/wire/persisted-articles.ts +8 -4
- package/src/plugins/builtin/notes/headless.ts +7 -0
- package/src/plugins/builtin/notes/index.tsx +3 -2
- package/src/plugins/builtin/notes/quick-notes-pane.tsx +18 -2
- package/src/plugins/builtin/openfda/model.ts +1 -1
- package/src/plugins/builtin/openfda/pane.tsx +37 -9
- package/src/plugins/builtin/options/analytics.ts +30 -6
- package/src/plugins/builtin/options/calc-seed.ts +38 -3
- package/src/plugins/builtin/options/footer.ts +18 -1
- package/src/plugins/builtin/options/live-quotes.ts +21 -6
- package/src/plugins/builtin/options/open-interest-as-of.ts +5 -0
- package/src/plugins/builtin/options/quote-context.tsx +21 -8
- package/src/plugins/builtin/options/table.ts +17 -2
- package/src/plugins/builtin/options/view.tsx +104 -52
- package/src/plugins/builtin/options-calculator/model.ts +65 -3
- package/src/plugins/builtin/options-calculator/pane.tsx +11 -3
- package/src/plugins/builtin/options-calculator/valuation.ts +33 -0
- package/src/plugins/builtin/options-positioning/cbbc-model.ts +160 -0
- package/src/plugins/builtin/options-positioning/cbbc-view.tsx +453 -0
- package/src/plugins/builtin/options-positioning/headless.ts +4 -4
- package/src/plugins/builtin/options-positioning/index.tsx +22 -1
- package/src/plugins/builtin/options-positioning/pane.tsx +23 -4
- package/src/plugins/builtin/options-scenario/charts.tsx +2 -1
- package/src/plugins/builtin/options-scenario/client.ts +20 -4
- package/src/plugins/builtin/options-scenario/csp-screen-headless.ts +5 -5
- package/src/plugins/builtin/options-scenario/csp-screen-pane.tsx +11 -14
- package/src/plugins/builtin/options-scenario/csp-screen.ts +9 -1
- package/src/plugins/builtin/options-scenario/headless.ts +4 -4
- package/src/plugins/builtin/options-scenario/index.tsx +1 -1
- package/src/plugins/builtin/options-scenario/model.ts +7 -0
- package/src/plugins/builtin/options-scenario/pane.tsx +24 -14
- package/src/plugins/builtin/pe-band/client.ts +5 -9
- package/src/plugins/builtin/pe-band/headless.ts +11 -13
- package/src/plugins/builtin/pe-band/model.ts +39 -60
- package/src/plugins/builtin/pe-band/pane.tsx +16 -16
- package/src/plugins/builtin/perps/cascade-tabs.tsx +2 -1
- package/src/plugins/builtin/perps/cascade.ts +4 -3
- package/src/plugins/builtin/perps/equity-row.tsx +3 -1
- package/src/plugins/builtin/perps/freshness.ts +16 -9
- package/src/plugins/builtin/perps/headless.ts +21 -11
- package/src/plugins/builtin/perps/markets-section.tsx +16 -10
- package/src/plugins/builtin/perps/model.ts +37 -5
- package/src/plugins/builtin/perps/pane.tsx +3 -2
- package/src/plugins/builtin/perps/status-line.ts +12 -3
- package/src/plugins/builtin/perps/venue-markets.ts +38 -0
- package/src/plugins/builtin/plugin-marketplace/pane.tsx +4 -3
- package/src/plugins/builtin/portfolio-list/cached-account.ts +3 -1
- package/src/plugins/builtin/portfolio-list/cell-version.ts +1 -1
- package/src/plugins/builtin/portfolio-list/cli/render.ts +46 -7
- package/src/plugins/builtin/portfolio-list/headless.ts +31 -8
- package/src/plugins/builtin/portfolio-list/settings.ts +4 -0
- package/src/plugins/builtin/portfolio-list/table.tsx +26 -3
- package/src/plugins/builtin/power/client.ts +2 -2
- package/src/plugins/builtin/power/detail.tsx +11 -8
- package/src/plugins/builtin/power/gas-model.ts +2 -1
- package/src/plugins/builtin/power/gas.tsx +3 -2
- package/src/plugins/builtin/power/headless.ts +5 -2
- package/src/plugins/builtin/power/model.ts +19 -0
- package/src/plugins/builtin/power/pane.tsx +5 -4
- package/src/plugins/builtin/power/prices-headless.ts +4 -3
- package/src/plugins/builtin/power/prices.tsx +7 -6
- package/src/plugins/builtin/primary-dealers/headless.ts +1 -1
- package/src/plugins/builtin/primary-dealers/model.ts +2 -1
- package/src/plugins/builtin/rate-path/headless.ts +5 -2
- package/src/plugins/builtin/rate-path/pane.tsx +13 -10
- package/src/plugins/builtin/realized-vol/fx-proxy.ts +7 -8
- package/src/plugins/builtin/realized-vol/headless.ts +4 -5
- package/src/plugins/builtin/realized-vol/pane.tsx +5 -4
- package/src/plugins/builtin/relative-rotation/headless.ts +2 -1
- package/src/plugins/builtin/research/analyst-model.ts +1 -1
- package/src/plugins/builtin/research/analyst-pane.tsx +2 -1
- package/src/plugins/builtin/research/earnings-estimates-pane.tsx +262 -0
- package/src/plugins/builtin/research/event-charts.ts +322 -0
- package/src/plugins/builtin/research/event-data.ts +138 -0
- package/src/plugins/builtin/research/event-detail.tsx +442 -0
- package/src/plugins/builtin/research/event-model.ts +328 -31
- package/src/plugins/builtin/research/event-sources.ts +58 -8
- package/src/plugins/builtin/research/event-views.tsx +397 -0
- package/src/plugins/builtin/research/events-headless.ts +60 -4
- package/src/plugins/builtin/research/headless-schema.ts +2 -2
- package/src/plugins/builtin/research/headless.ts +84 -7
- package/src/plugins/builtin/research/index.tsx +19 -17
- package/src/plugins/builtin/research/relative-valuation-columns.ts +20 -8
- package/src/plugins/builtin/research/relative-valuation-headless.ts +8 -4
- package/src/plugins/builtin/research/relative-valuation-model.ts +23 -8
- package/src/plugins/builtin/research/relative-valuation-pane.tsx +10 -0
- package/src/plugins/builtin/revenue-breakdown/client.ts +9 -4
- package/src/plugins/builtin/revenue-breakdown/headless.ts +1 -1
- package/src/plugins/builtin/revenue-breakdown/index.tsx +2 -1
- package/src/plugins/builtin/revenue-breakdown/model.ts +2 -0
- package/src/plugins/builtin/revenue-breakdown/pane.tsx +10 -0
- package/src/plugins/builtin/risk-factors/pane.tsx +14 -9
- package/src/plugins/builtin/scanner/feed.ts +7 -4
- package/src/plugins/builtin/scanner/flow-pane.tsx +8 -4
- package/src/plugins/builtin/scanner/headless.ts +59 -26
- package/src/plugins/builtin/scanner/hilo-pane.tsx +6 -3
- package/src/plugins/builtin/scanner/lock-note.ts +7 -10
- package/src/plugins/builtin/scanner/us-session.ts +9 -0
- package/src/plugins/builtin/seasonality/client.ts +46 -10
- package/src/plugins/builtin/seasonality/headless.ts +29 -11
- package/src/plugins/builtin/seasonality/model.ts +101 -24
- package/src/plugins/builtin/seasonality/pane.tsx +10 -6
- package/src/plugins/builtin/sec/exchange-filings.ts +44 -0
- package/src/plugins/builtin/sec/filing-content.ts +13 -0
- package/src/plugins/builtin/sec/fund-facts.ts +10 -8
- package/src/plugins/builtin/sec/headless.ts +60 -8
- package/src/plugins/builtin/sec/index.tsx +144 -71
- package/src/plugins/builtin/sec/model.ts +10 -4
- package/src/plugins/builtin/sec/row-summaries.ts +1 -0
- package/src/plugins/builtin/sectors/client.ts +27 -5
- package/src/plugins/builtin/sectors/headless.ts +2 -1
- package/src/plugins/builtin/sectors/index.tsx +22 -10
- package/src/plugins/builtin/series-inventory.ts +4 -0
- package/src/plugins/builtin/shared/beat-miss-chart.ts +66 -0
- package/src/plugins/builtin/shared/cloud-resource.ts +3 -3
- package/src/plugins/builtin/shared/day-entries.ts +41 -0
- package/src/plugins/builtin/shared/earnings-calendar.ts +80 -53
- package/src/plugins/builtin/shared/earnings-report.ts +53 -15
- package/src/plugins/builtin/shared/extended-print.ts +38 -0
- package/src/plugins/builtin/shared/history-span.ts +2 -1
- package/src/plugins/builtin/shared/locked-rows.tsx +1 -1
- package/src/plugins/builtin/shared/pro-feature-wall.tsx +1 -1
- package/src/plugins/builtin/shared/pro-lock-note.ts +8 -12
- package/src/plugins/builtin/shared/report-freshness.ts +7 -3
- package/src/plugins/builtin/shared/scanner-capture.ts +16 -3
- package/src/plugins/builtin/shared/ticker-company.ts +17 -8
- package/src/plugins/builtin/shared/ticker-request.ts +4 -2
- package/src/plugins/builtin/shared/use-quote-board.ts +11 -4
- package/src/plugins/builtin/shared/volatility/live-session.ts +6 -7
- package/src/plugins/builtin/shared/volatility/option-snapshot.ts +30 -0
- package/src/plugins/builtin/shared/volatility/quote-session.ts +49 -0
- package/src/plugins/builtin/short-interest/exchange-balances.ts +76 -0
- package/src/plugins/builtin/short-interest/exchange-positions-pane.tsx +55 -0
- package/src/plugins/builtin/short-interest/headless.ts +15 -2
- package/src/plugins/builtin/short-interest/index.tsx +7 -3
- package/src/plugins/builtin/short-interest/jpx.ts +38 -0
- package/src/plugins/builtin/short-interest/model.ts +3 -2
- package/src/plugins/builtin/short-interest/pane.tsx +4 -3
- package/src/plugins/builtin/short-interest/publications-model.ts +73 -2
- package/src/plugins/builtin/short-interest/publications-pane.tsx +16 -4
- package/src/plugins/builtin/short-interest/sfc.ts +40 -0
- package/src/plugins/builtin/short-interest/surface.tsx +16 -2
- package/src/plugins/builtin/short-volume/headless.ts +18 -3
- package/src/plugins/builtin/short-volume/model.ts +6 -1
- package/src/plugins/builtin/short-volume/pane.tsx +8 -7
- package/src/plugins/builtin/short-volume/sgx.ts +23 -0
- package/src/plugins/builtin/social-mentions/client.ts +7 -3
- package/src/plugins/builtin/social-mentions/outliers-model.ts +2 -1
- package/src/plugins/builtin/social-mentions/outliers.tsx +9 -2
- package/src/plugins/builtin/social-mentions/pane.tsx +10 -8
- package/src/plugins/builtin/supply-chain/client.ts +10 -2
- package/src/plugins/builtin/supply-chain/directories.ts +18 -0
- package/src/plugins/builtin/supply-chain/evidence.ts +12 -4
- package/src/plugins/builtin/supply-chain/headless.ts +20 -7
- package/src/plugins/builtin/supply-chain/pane.tsx +40 -11
- package/src/plugins/builtin/thirteenf/api.ts +323 -34
- package/src/plugins/builtin/thirteenf/data.ts +147 -40
- package/src/plugins/builtin/thirteenf/format.ts +4 -6
- package/src/plugins/builtin/thirteenf/headless.ts +75 -32
- package/src/plugins/builtin/thirteenf/model.ts +24 -11
- package/src/plugins/builtin/thirteenf/overlap-pane.tsx +16 -8
- package/src/plugins/builtin/thirteenf/pane.tsx +45 -22
- package/src/plugins/builtin/thirteenf/report-notes.ts +52 -2
- package/src/plugins/builtin/thirteenf/session-scope.ts +57 -0
- package/src/plugins/builtin/thirteenf/signals-pane.tsx +27 -7
- package/src/plugins/builtin/thirteenf/signals.ts +22 -1
- package/src/plugins/builtin/thirteenf/split-history.ts +119 -0
- package/src/plugins/builtin/thirteenf/table.ts +6 -6
- package/src/plugins/builtin/thirteenf/types.ts +17 -1
- package/src/plugins/builtin/ticker-detail/adr-pair/model.ts +4 -2
- package/src/plugins/builtin/ticker-detail/adr-pair/tab.tsx +11 -0
- package/src/plugins/builtin/ticker-detail/data-panes/historical-prices.tsx +12 -8
- package/src/plugins/builtin/ticker-detail/data-panes/history-bars.ts +5 -4
- package/src/plugins/builtin/ticker-detail/data-panes/returns-model.ts +7 -0
- package/src/plugins/builtin/ticker-detail/data-panes/returns-pane.tsx +12 -5
- package/src/plugins/builtin/ticker-detail/financials/aggregation.ts +36 -5
- package/src/plugins/builtin/ticker-detail/financials/model.ts +179 -39
- package/src/plugins/builtin/ticker-detail/financials/ratio-table.tsx +77 -14
- package/src/plugins/builtin/ticker-detail/financials/ratios.ts +69 -14
- package/src/plugins/builtin/ticker-detail/financials/tab.tsx +81 -37
- package/src/plugins/builtin/ticker-detail/headless.ts +65 -38
- package/src/plugins/builtin/ticker-detail/index.tsx +1 -1
- package/src/plugins/builtin/ticker-detail/overview/components.tsx +80 -14
- package/src/plugins/builtin/ticker-detail/overview/model.ts +54 -25
- package/src/plugins/builtin/ticker-detail/overview/pane.tsx +28 -9
- package/src/plugins/builtin/ticker-detail/overview/types.ts +2 -0
- package/src/plugins/builtin/ticker-detail/overview-tab.tsx +52 -23
- package/src/plugins/builtin/ticker-detail/pane.tsx +19 -10
- package/src/plugins/builtin/ticker-detail/quote-monitor/card.tsx +41 -23
- package/src/plugins/builtin/ticker-detail/quote-monitor/rows.ts +30 -13
- package/src/plugins/builtin/ticker-detail/research-groups.ts +15 -2
- package/src/plugins/builtin/ticker-detail/research-tabs.ts +2 -1
- package/src/plugins/builtin/ticker-detail/settings.ts +9 -2
- package/src/plugins/builtin/time-sales/headless.ts +52 -16
- package/src/plugins/builtin/time-sales/model.ts +2 -2
- package/src/plugins/builtin/time-sales/window.ts +84 -10
- package/src/plugins/builtin/trace-bonds/pane.tsx +3 -2
- package/src/plugins/builtin/treasury-auctions/cache.ts +44 -19
- package/src/plugins/builtin/treasury-auctions/client.ts +9 -4
- package/src/plugins/builtin/vol-surface/charts.tsx +7 -3
- package/src/plugins/builtin/vol-surface/events.ts +20 -10
- package/src/plugins/builtin/vol-surface/evidence.ts +2 -2
- package/src/plugins/builtin/vol-surface/headless.ts +47 -29
- package/src/plugins/builtin/vol-surface/heat-grid.tsx +2 -1
- package/src/plugins/builtin/vol-surface/model.ts +34 -9
- package/src/plugins/builtin/vol-surface/pane.tsx +50 -74
- package/src/plugins/builtin/vol-surface/quote-coverage.ts +68 -0
- package/src/plugins/builtin/vol-surface/tables.ts +57 -6
- package/src/plugins/builtin/volatility/charts.tsx +7 -3
- package/src/plugins/builtin/volatility/headless.ts +5 -5
- package/src/plugins/builtin/volatility/pane.tsx +8 -5
- package/src/plugins/builtin/world-indices/footer.ts +1 -1
- package/src/plugins/builtin/world-indices/headless.ts +5 -3
- package/src/plugins/builtin/world-venue-map/chokepoint-report.ts +3 -1
- package/src/plugins/builtin/world-venue-map/headless.ts +42 -14
- package/src/plugins/builtin/world-venue-map/layered-pane.tsx +5 -3
- package/src/plugins/builtin/world-venue-map/pane.tsx +4 -3
- package/src/plugins/builtin/world-venue-map/venue-exceptions.ts +72 -0
- package/src/plugins/builtin/world-venue-map/venue-header.tsx +20 -11
- package/src/plugins/builtin/yield-curve/client.ts +3 -1
- package/src/plugins/builtin/yield-curve/headless.ts +4 -2
- package/src/plugins/builtin/yield-curve/index.tsx +4 -3
- package/src/plugins/catalog-browser.ts +3 -34
- package/src/plugins/duplicates.ts +60 -0
- package/src/plugins/loader.ts +12 -3
- package/src/plugins/marketplace/feed.ts +3 -2
- package/src/plugins/marketplace/model.ts +10 -1
- package/src/plugins/registry/contributions.ts +37 -10
- package/src/plugins/registry/index.ts +2 -1
- package/src/portfolio/column-values.ts +51 -5
- package/src/public/__snapshots__/public-api.test.ts.snap +5 -0
- package/src/public/i18n.ts +3 -2
- package/src/react/async-resource.ts +8 -7
- package/src/renderers/browser/bundled-plugins.ts +2 -1
- package/src/renderers/dom/build-assets.ts +20 -0
- package/src/renderers/dom/css.d.ts +1 -0
- package/src/renderers/dom/data-table/index.tsx +96 -10
- package/src/renderers/dom/data-table/row.tsx +1 -1
- package/src/renderers/dom/es2023-array-methods.ts +57 -0
- package/src/renderers/dom/host/surface-fit.ts +64 -13
- package/src/renderers/dom/styles.css +6 -1
- package/src/renderers/electrobun/bun/desktop/backend.ts +12 -1
- package/src/renderers/electrobun/bun/external-plugins.ts +16 -6
- package/src/renderers/electrobun/shared/protocol.ts +2 -0
- package/src/renderers/electrobun/view/cli-pane-shot-entry.tsx +38 -8
- package/src/renderers/electrobun/view/cli-pane-shot-frame.tsx +15 -8
- package/src/renderers/electrobun/view/external-plugins.ts +1 -0
- package/src/renderers/electrobun/view/remote/asset-data-client.ts +3 -0
- package/src/series/types.ts +1 -0
- package/src/sources/gloomberb-cloud/batched-lookups.ts +12 -1
- package/src/sources/gloomberb-cloud/fred-attribution.ts +6 -5
- package/src/sources/gloomberb-cloud/index.ts +78 -8
- package/src/sources/gloomberb-cloud/news.ts +15 -2
- package/src/sources/gloomberb-cloud/normalizers.ts +10 -0
- package/src/sources/history-result.ts +2 -1
- package/src/sources/history-retention.ts +14 -2
- package/src/sources/listing-symbols.ts +1 -1
- package/src/sources/provider-router/cache.ts +32 -3
- package/src/sources/provider-router/cached-routes.ts +25 -0
- package/src/sources/provider-router/connection-health.ts +1 -0
- package/src/sources/provider-router/financials.ts +4 -4
- package/src/sources/provider-router/history.ts +2 -2
- package/src/sources/provider-router/index.ts +23 -1
- package/src/sources/provider-router/sec-filings-page.ts +25 -0
- package/src/sources/sec-edgar/content.ts +67 -36
- package/src/state/app/context/index.tsx +12 -4
- package/src/sync/broker-instances.ts +63 -11
- package/src/sync/config-merge.ts +1 -1
- package/src/sync/sanitize.ts +2 -0
- package/src/test-support/cloud-api.ts +34 -0
- package/src/test-support/strict-table-capture.tsx +83 -0
- package/src/tickers/listing-fate.ts +28 -0
- package/src/tickers/search/home-listing.ts +3 -0
- package/src/tickers/search/index-root-lead.ts +40 -0
- package/src/tickers/search/index.ts +23 -7
- package/src/tickers/terminal-codes.ts +7 -4
- package/src/time-series/alignment.ts +14 -4
- package/src/time-series/base-series.ts +20 -10
- package/src/time-series/chart-data.ts +2 -0
- package/src/time-series/chart-seed.ts +3 -1
- package/src/time-series/fundamentals/current-valuation.ts +22 -5
- package/src/time-series/fundamentals/historical-valuation.ts +2 -2
- package/src/time-series/fundamentals/history-link.ts +25 -0
- package/src/time-series/fundamentals/quarterly-ttm.ts +50 -5
- package/src/time-series/fundamentals/series.ts +15 -12
- package/src/time-series/history-acquisition.ts +2 -0
- package/src/time-series/market.ts +33 -5
- package/src/time-series/price-comparison.ts +42 -61
- package/src/time-series/resolve-context.ts +8 -0
- package/src/time-series/resolve.ts +67 -20
- package/src/time-series/spec.ts +2 -1
- package/src/time-series/studies/formula.ts +4 -2
- package/src/time-series/studies/indicators.ts +2 -0
- package/src/time-series/studies/pair.ts +4 -2
- package/src/time-series/studies/shared.ts +1 -0
- package/src/time-series/types.ts +3 -1
- package/src/time-series/use-chart-resolution.ts +34 -16
- package/src/time-series/valuation-currency.ts +40 -12
- package/src/types/config.ts +13 -61
- package/src/types/data-provider.ts +38 -1
- package/src/types/financials.ts +72 -6
- package/src/types/headless.ts +53 -0
- package/src/types/instrument.ts +1 -0
- package/src/types/plugin-context.ts +8 -1
- package/src/utils/crypto-pair.ts +26 -0
- package/src/utils/day-format.ts +104 -0
- package/src/utils/exchange-announcements.ts +36 -12
- package/src/utils/exchange-notation.generated.ts +58 -1
- package/src/utils/exchanges.ts +43 -1
- package/src/utils/financial-statements.ts +40 -46
- package/src/utils/format.ts +74 -12
- package/src/utils/forward-dividend.ts +2 -1
- package/src/utils/function-search.ts +38 -0
- package/src/utils/fuzzy-search.ts +10 -6
- package/src/utils/option-choice.ts +15 -0
- package/src/utils/price-history.ts +15 -1
- package/src/utils/reason-codes.ts +6 -3
- package/src/utils/trailing-dividend.ts +288 -28
- package/src/plugins/builtin/research/corporate-actions-pane.tsx +0 -757
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
import { closeBasis, isDailyMetric, isRelativeMetric, metricDescription, metricName,
|
|
1
|
+
import { closeBasis, isDailyMetric, isRelativeMetric, metricDescription, metricName, validMetricRule } from "./metric-model";
|
|
2
2
|
import { logFailure } from "../../../utils/log-failure";
|
|
3
3
|
import { benchmarkKey, namesTwoListings, parseMetricAlert, type MetricAlertInput } from "./metric-command";
|
|
4
|
-
import { firstDailyCheck, metricAvailabilityError, metricReadings } from "./metric-data";
|
|
4
|
+
import { firstDailyCheck, metricAvailabilityError, metricReadingFields, metricReadings } from "./metric-data";
|
|
5
5
|
import { ALERT_ADD_FORMS, ALERT_KINDS_TEXT, parseRuleAddArgs, RULE_US_DATA, ruleDelivery, type RuleAddRequest } from "./cli-forms";
|
|
6
6
|
import { alertChangeEntry, appendAlertLog, type AlertLogAction } from "./fired-log";
|
|
7
7
|
import { alertLogRule } from "./alert-log";
|
|
8
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
alertBenchmarkListing, alertComparatorReadingText, alertListing, alertReadingAt, alertReadingCurrency, alertReadingFeed, alertReadingText, isoUtc, listingWithCurrency,
|
|
10
|
+
formatMetricReading, measureLabel, NOT_CHECKED_YET, readingSessionWords,
|
|
11
|
+
} from "./format";
|
|
9
12
|
import { isQuoteStaleForCurrentSession } from "../../../market-data/quotes/freshness";
|
|
10
|
-
import { quoteAlertFields } from "./quotes";
|
|
13
|
+
import { alertQuoteListingFields, quoteAlertFields } from "./quotes";
|
|
11
14
|
import { createEventAlert } from "./events";
|
|
12
15
|
import { isResearchAlertKind, readResearchRule } from "./research-rules";
|
|
13
16
|
import { withConfigData, withMarketData } from "../../../cli/scoped-context";
|
|
@@ -16,6 +19,7 @@ import { resolvePersistedCloudSessionToken } from "../../../cli/pane-functions/c
|
|
|
16
19
|
import type { ConfigContext } from "../../../cli/types";
|
|
17
20
|
import { checkedWhenSignedIn, NEEDS_SIGN_IN, needsSignInNote } from "./event-rows";
|
|
18
21
|
import { checkedOnlyWithPro, checksProRules, NEEDS_PRO, needsProNote, savedWithoutProNote } from "./pro-rules";
|
|
22
|
+
import { acceptsAlertSession, alertSessionLabel } from "./session";
|
|
19
23
|
import { OCC_CONTRACT, occContractExample, occFormText, parseLooseOptionContract, resolveLooseOptionContract, type LooseOptionContract } from "./option-contract";
|
|
20
24
|
import { CLI_COMMAND_GROUPS } from "../../../cli/help";
|
|
21
25
|
import { dryRunNote } from "../../../cli/helpers";
|
|
@@ -27,7 +31,7 @@ import { saveConfig } from "../../../data/config/store";
|
|
|
27
31
|
import { resumeStateKey } from "../../registry/plugin-state";
|
|
28
32
|
import type { CliCommandDef } from "../../../types/plugin";
|
|
29
33
|
import type { Quote } from "../../../types/financials";
|
|
30
|
-
import {
|
|
34
|
+
import { getActiveQuoteDisplay } from "../../../market-data/market/status";
|
|
31
35
|
import { cliStyles } from "../../../utils/cli-output";
|
|
32
36
|
import { canonicalExchange, isUsListingExchange, parsePublicTickerKey } from "../../../utils/exchanges";
|
|
33
37
|
import { isRoundTheClockCoin } from "../../../utils/crypto-pair";
|
|
@@ -414,7 +418,7 @@ function researchFormValues(request: ResearchAddRequest, exchange: string): { ki
|
|
|
414
418
|
*/
|
|
415
419
|
function researchDelivery(kind: ResearchAddRequest["kind"]): string {
|
|
416
420
|
if (kind === "iv_level") return "the app checks it every 15 minutes while it is running, on the same option fits as OVDV";
|
|
417
|
-
const plan = kind === "
|
|
421
|
+
const plan = checkedOnlyWithPro({ kind: kind === "flow" ? "options_flow" : kind }) ? " on Gloom Pro" : "";
|
|
418
422
|
// Said apart from the app, which checks IV levels and price alerts: this one goes on with the app closed, and only signed in.
|
|
419
423
|
return `Gloom Cloud checks it, not the app, for a signed-in account with Cloud sync${plan} and sends it to your phone`;
|
|
420
424
|
}
|
|
@@ -538,7 +542,7 @@ function metricReadingNote(alert: AlertRule): string {
|
|
|
538
542
|
const metric = alert.metric!;
|
|
539
543
|
// "Ratio to SPY was 0.2434 on the 2026-10-26 close", "RRG vs SPY was Leading (strength 110.06, momentum 108.88) on the 2026-10-23 weekly close".
|
|
540
544
|
if (isRelativeMetric(metric)) {
|
|
541
|
-
const reading =
|
|
545
|
+
const reading = formatMetricReading(metric, { value: alert.lastCheckedPrice ?? Number.NaN, target: alert.lastCheckedTarget ?? Number.NaN });
|
|
542
546
|
return `${metricName(metric)} was ${reading} on the ${alert.lastDailyClose} ${closeBasis(metric) === "weekly close" ? "weekly close" : "close"}`;
|
|
543
547
|
}
|
|
544
548
|
const value = (alert.lastCheckedPrice ?? Number.NaN).toFixed(2);
|
|
@@ -563,16 +567,29 @@ type AlertListRow = Record<string, unknown> & {
|
|
|
563
567
|
status: string;
|
|
564
568
|
};
|
|
565
569
|
|
|
570
|
+
const AUDIT_COLUMNS = ["lastReadingFeed", "numeratorValue", "numeratorAsOf", "denominatorValue", "denominatorAsOf"] as const;
|
|
571
|
+
|
|
566
572
|
function priceRow(alert: AlertRule): AlertListRow {
|
|
573
|
+
const inputs = alert.metric?.kind === "rs_ratio" && !alert.lastCheckError ? alert.lastRatioInputs : undefined;
|
|
567
574
|
return {
|
|
568
575
|
...alert, kind: alert.metric?.kind ?? (alert.move ? "move" : "price"), rule: alert.metric ? metricDescription(alert) : undefined,
|
|
576
|
+
session: alertSessionLabel(alert),
|
|
569
577
|
// A move's rule in the words it was added with: `up 3.00%`, `moves 0.50%`.
|
|
570
578
|
...alert.move ? { rule: `${moveRuleWords(alert)} from the previous close`, appOnly: true } : {},
|
|
571
579
|
// The listing as it was kept: 7203:JPX, never 7203:JPX:JPX.
|
|
572
580
|
target: alertListing({ symbol: alert.symbol, exchange: alert.exchange }),
|
|
573
|
-
// The listing it is checked on,
|
|
574
|
-
|
|
581
|
+
// The listing it is checked on, the currency its readings are in (none for a ratio, RSI or a multiple), and its
|
|
582
|
+
// last reading in words with when it is from.
|
|
583
|
+
listing: alertListing(alert), currency: alertReadingCurrency(alert),
|
|
575
584
|
lastReading: alertReadingText(alert), lastReadingAt: isoUtc(alertReadingAt(alert)) || null,
|
|
585
|
+
// What the reading is measured against: the slow average of a crossover, or the listing a ratio divides by.
|
|
586
|
+
comparatorReading: alertComparatorReadingText(alert) || null,
|
|
587
|
+
benchmarkListing: alertBenchmarkListing(alert) || null,
|
|
588
|
+
lastReadingFeed: alertReadingFeed(alert),
|
|
589
|
+
numeratorValue: inputs?.numerator ?? null,
|
|
590
|
+
numeratorAsOf: isoUtc(inputs?.numeratorAt) || null,
|
|
591
|
+
denominatorValue: inputs?.denominator ?? null,
|
|
592
|
+
denominatorAsOf: isoUtc(inputs?.denominatorAt) || null,
|
|
576
593
|
};
|
|
577
594
|
}
|
|
578
595
|
|
|
@@ -593,9 +610,11 @@ function eventRow(
|
|
|
593
610
|
const reading = rule.kind === "iv_level" ? {
|
|
594
611
|
lastReading: ivLevelCheckText(rule, check),
|
|
595
612
|
lastReadingAt: check?.value != null ? isoUtc(check.quoteAt ? Date.parse(check.quoteAt) : check.checkedAt) || null : null,
|
|
613
|
+
lastReadingFeed: check?.value != null ? check.source ?? "feed not recorded" : null,
|
|
596
614
|
} : state ? {
|
|
597
615
|
lastReading: ruleStateText(state),
|
|
598
616
|
lastReadingAt: state.asOf ? isoUtc(Date.parse(state.asOf)) || null : null,
|
|
617
|
+
lastReadingFeed: state.value != null && state.asOf ? "feed not recorded" : null,
|
|
599
618
|
} : cloud?.failed ? {} : { lastReading: NOT_CHECKED_YET };
|
|
600
619
|
return { id: rule.id, kind: rule.kind, target: eventAlertTarget(rule), status, createdAt: rule.createdAt,
|
|
601
620
|
listing: eventRuleListing(rule), ...reading,
|
|
@@ -667,8 +686,10 @@ const plural = (count: number, word: string) => `${count} ${word}${count === 1 ?
|
|
|
667
686
|
|
|
668
687
|
/**
|
|
669
688
|
* One row as text and CSV give it. CSV keeps the columns it has always had in
|
|
670
|
-
* their order, then Created (ISO UTC), the listing, its currency and the last
|
|
671
|
-
* reading, in words and dated
|
|
689
|
+
* their order, Triggered in ISO UTC, then Created (ISO UTC), the listing, its currency and the last
|
|
690
|
+
* reading, in words and dated, the session it is read in, and what that
|
|
691
|
+
* reading is measured against: the comparator's own reading and the
|
|
692
|
+
* benchmark listing of a ratio or RRG rule.
|
|
672
693
|
*/
|
|
673
694
|
function textRow(row: AlertListRow): Record<string, unknown> {
|
|
674
695
|
const price = row.kind === "price";
|
|
@@ -683,15 +704,20 @@ function textRow(row: AlertListRow): Record<string, unknown> {
|
|
|
683
704
|
: typeof row.leadDays === "number"
|
|
684
705
|
? scheduledTriggerText({ leadDays: row.leadDays, trigger: row.when === "results" ? "results" : "date", prints: row.onRelease === true })
|
|
685
706
|
: ""),
|
|
686
|
-
eventDate: typeof row.leadDays === "number" ? row.eventDate ?? "not known" : "",
|
|
707
|
+
eventDate: typeof row.leadDays === "number" ? row.eventDate ?? (row.kind === "earnings_date" ? "waiting for next date" : "not known") : "",
|
|
687
708
|
status: row.status,
|
|
688
709
|
lastCheckedPrice: row.lastCheckedPrice,
|
|
689
|
-
|
|
710
|
+
// ISO 8601 in UTC, as createdAt: a spreadsheet reads an epoch count as a number.
|
|
711
|
+
triggeredAt: isoUtc(typeof row.triggeredAt === "number" ? row.triggeredAt : null),
|
|
690
712
|
createdAt: isoUtc(typeof row.createdAt === "number" ? row.createdAt : null),
|
|
691
713
|
listing: row.listing ?? "",
|
|
692
714
|
currency: row.currency ?? "",
|
|
693
715
|
lastReading: row.lastReading ?? "",
|
|
694
716
|
lastReadingAt: row.lastReadingAt ?? "",
|
|
717
|
+
session: row.session ?? "",
|
|
718
|
+
comparatorReading: row.comparatorReading ?? "",
|
|
719
|
+
benchmarkListing: row.benchmarkListing ?? "",
|
|
720
|
+
...Object.fromEntries(AUDIT_COLUMNS.map((key) => [key, row[key] ?? ""])),
|
|
695
721
|
};
|
|
696
722
|
}
|
|
697
723
|
|
|
@@ -822,10 +848,10 @@ async function requireEventDate(
|
|
|
822
848
|
sources: ScheduledEventSources,
|
|
823
849
|
today: string,
|
|
824
850
|
fail: (message: string) => never,
|
|
825
|
-
): Promise<string> {
|
|
851
|
+
): Promise<string | null> {
|
|
826
852
|
const lookup = (await lookupScheduledDates([target], sources, today)).get(scheduledTargetKey(target));
|
|
827
853
|
if (!lookup || "error" in lookup) fail(eventDateUnavailableMessage(target, lookup?.error ?? "no answer"));
|
|
828
|
-
if (!lookup.date) fail(noUpcomingEventMessage(target));
|
|
854
|
+
if (!lookup.date && target.kind !== "earnings") fail(noUpcomingEventMessage(target));
|
|
829
855
|
return lookup.date;
|
|
830
856
|
}
|
|
831
857
|
|
|
@@ -848,6 +874,7 @@ export const alertsCliCommand: CliCommandDef = {
|
|
|
848
874
|
{ flags: "--country <code>", description: "The country of a calendar event, as econ --country takes it (CN, US, DE); a code before the name does the same (alerts add CN PMI)" },
|
|
849
875
|
{ flags: "--benchmark <symbol>", description: "The listing an RRG alert is measured against; SPY by default, as in RRG" },
|
|
850
876
|
{ flags: "--watchlist <name>", description: `A move alert on each listing of the watchlist, up to ${MAX_BULK_ALERTS} (alerts add --watchlist Book up 3%)` },
|
|
877
|
+
{ flags: "--session <regular|extended>", description: "Watch regular hours only, or regular and extended hours (default); price and move alerts" },
|
|
851
878
|
],
|
|
852
879
|
examples: [
|
|
853
880
|
"alerts",
|
|
@@ -901,6 +928,10 @@ export const alertsCliCommand: CliCommandDef = {
|
|
|
901
928
|
const benchmark = benchmarkFlag && benchmarkValue === undefined ? null : benchmarkValue;
|
|
902
929
|
const watchlistFlag = rawArgs.some((arg) => arg === "--watchlist" || arg.startsWith("--watchlist="));
|
|
903
930
|
const watchlistName = takeOption(args, "--watchlist");
|
|
931
|
+
const sessionFlag = rawArgs.some((arg) => arg === "--session" || arg.startsWith("--session="));
|
|
932
|
+
const sessionMode = takeOption(args, "--session")?.toLowerCase();
|
|
933
|
+
if (sessionFlag && sessionMode !== "regular" && sessionMode !== "extended") ctx.fail("Use --session regular or --session extended (regular and extended hours).");
|
|
934
|
+
const sessionRule = sessionMode === "regular" ? { regularHoursOnly: true as const } : {};
|
|
904
935
|
if (watchlistFlag && !watchlistName?.trim()) ctx.fail("--watchlist takes a watchlist's name: alerts add --watchlist Book up 3%.");
|
|
905
936
|
const action = args[0] ?? "list";
|
|
906
937
|
if (watchlistFlag && action !== "add") ctx.fail("--watchlist is for alerts add: alerts add --watchlist Book up 3%.");
|
|
@@ -908,7 +939,7 @@ export const alertsCliCommand: CliCommandDef = {
|
|
|
908
939
|
const today = newYorkToday(new Date(now));
|
|
909
940
|
const failWith = (error: unknown): never => ctx.fail(error instanceof Error ? error.message : String(error));
|
|
910
941
|
// A symbol whose company moved names the same add on its new symbol.
|
|
911
|
-
const alertRetry = (symbol: string) => `gloom alerts add ${symbol} ${args.slice(2).join(" ")}`;
|
|
942
|
+
const alertRetry = (symbol: string) => `gloom alerts add ${symbol} ${args.slice(2).join(" ")}${sessionMode ? ` --session ${sessionMode}` : ""}`;
|
|
912
943
|
// The listing an alert follows, read as `quote` reads it and held to one that trades (`resolveAlertListing`).
|
|
913
944
|
const requireAlertListing = (typed: string, market: ListingDeps, exchange: string | null | undefined = exchangeOption) =>
|
|
914
945
|
resolveAlertListing(typed, exchange, market, { retry: alertRetry }).catch((error: unknown) => {
|
|
@@ -924,6 +955,7 @@ export const alertsCliCommand: CliCommandDef = {
|
|
|
924
955
|
}
|
|
925
956
|
};
|
|
926
957
|
const typedRequest = action === "add" ? parseAdd() : null;
|
|
958
|
+
if (sessionFlag && typedRequest?.kind !== "price" && typedRequest?.kind !== "move") ctx.fail("--session is only for price and move alerts.");
|
|
927
959
|
// A move's listings, each read as `quote` reads it, or a watchlist's as it keeps them, with what was dropped.
|
|
928
960
|
let moves: { listings: MoveListing[]; repeats: number; leftOut: number; watchlist?: string } | null = null;
|
|
929
961
|
if (typedRequest?.kind === "move") {
|
|
@@ -1030,8 +1062,7 @@ export const alertsCliCommand: CliCommandDef = {
|
|
|
1030
1062
|
if (unavailable) ctx.fail(unavailable);
|
|
1031
1063
|
try {
|
|
1032
1064
|
const value = await withMarketData(ctx, market => metricReadings(market.dataProvider, now)(preview));
|
|
1033
|
-
reading =
|
|
1034
|
-
...value.day ? { lastDailyClose: value.day } : {} };
|
|
1065
|
+
reading = metricReadingFields(value, now);
|
|
1035
1066
|
} catch (error) {
|
|
1036
1067
|
const message = error instanceof Error ? error.message : String(error);
|
|
1037
1068
|
// A valuation the inputs cannot give is refused; a daily close not yet final, or history not there yet, is read once it is.
|
|
@@ -1058,10 +1089,12 @@ export const alertsCliCommand: CliCommandDef = {
|
|
|
1058
1089
|
failWith(error);
|
|
1059
1090
|
}
|
|
1060
1091
|
}
|
|
1061
|
-
if (request?.kind === "price" && priced && !isQuoteStaleForCurrentSession(priced.quote)) {
|
|
1092
|
+
if (request?.kind === "price" && priced && acceptsAlertSession(sessionRule, priced.quote) && !isQuoteStaleForCurrentSession(priced.quote)) {
|
|
1062
1093
|
// The price it is added at is its first reading and the baseline a crossing is measured from, as Add Alert keeps it.
|
|
1063
1094
|
const price = lastPrice(priced.quote);
|
|
1064
1095
|
if (price != null) reading = quoteAlertFields({ ...priced.quote, price }, now);
|
|
1096
|
+
} else if (request?.kind === "price" && priced && sessionRule.regularHoursOnly) {
|
|
1097
|
+
reading = alertQuoteListingFields(priced.quote);
|
|
1065
1098
|
}
|
|
1066
1099
|
if (request?.kind === "price" && request.thousandsDot && priced) {
|
|
1067
1100
|
const question = thousandsDotMessage(request, priced.listing.key, lastPrice(priced.quote), exchangeOption);
|
|
@@ -1069,8 +1102,8 @@ export const alertsCliCommand: CliCommandDef = {
|
|
|
1069
1102
|
}
|
|
1070
1103
|
if (request?.kind === "price" && priced) {
|
|
1071
1104
|
// A target ten times away is a slip or another instrument's price, such as bitcoin's on the BTC fund.
|
|
1072
|
-
|
|
1073
|
-
const far = farTargetMessage(priced.listing.key, request.price,
|
|
1105
|
+
const referencePrice = sessionRule.regularHoursOnly ? priced.quote.price : lastPrice(priced.quote);
|
|
1106
|
+
const far = farTargetMessage(priced.listing.key, request.price, referencePrice, coinNote ?? futureNote, isPenceQuotedLine(priced.quote));
|
|
1074
1107
|
if (far) ctx.fail(far);
|
|
1075
1108
|
}
|
|
1076
1109
|
// What a typed listing was read as (7203:TSE as 7203:JPX, MXN as MXN:FWB2), said beside what was added.
|
|
@@ -1224,6 +1257,7 @@ export const alertsCliCommand: CliCommandDef = {
|
|
|
1224
1257
|
...proRules.length ? [needsProNote(proRules, rows.filter((row) => row.status === NEEDS_PRO).length)] : []];
|
|
1225
1258
|
ctx.printResult({ data: rows, ...(allWarnings.length ? { warnings: allWarnings } : {}) }, {
|
|
1226
1259
|
rows: (data) => data.map(textRow),
|
|
1260
|
+
csvTrailingColumns: AUDIT_COLUMNS,
|
|
1227
1261
|
textColumns: [
|
|
1228
1262
|
{ key: "id", header: "ID", shrink: false },
|
|
1229
1263
|
{ key: "kind", header: "Kind" },
|
|
@@ -1233,9 +1267,13 @@ export const alertsCliCommand: CliCommandDef = {
|
|
|
1233
1267
|
{ key: "eventDate", header: "Event Date" },
|
|
1234
1268
|
{ key: "status", header: "Status" },
|
|
1235
1269
|
{ key: "lastReading", header: "Last Reading" },
|
|
1270
|
+
{ key: "lastReadingFeed", header: "Feed", optional: true },
|
|
1236
1271
|
// ISO 8601 in UTC, as CSV writes it.
|
|
1237
1272
|
{ key: "createdAt", header: "Created", format: (value) => String(value ?? "") },
|
|
1238
|
-
{ key: "triggeredAt", header: "Triggered", optional: true },
|
|
1273
|
+
{ key: "triggeredAt", header: "Triggered", optional: true, format: (value) => String(value ?? "") },
|
|
1274
|
+
{ key: "session", header: "Session", optional: true },
|
|
1275
|
+
{ key: "comparatorReading", header: "Against", optional: true },
|
|
1276
|
+
{ key: "benchmarkListing", header: "Benchmark", optional: true },
|
|
1239
1277
|
],
|
|
1240
1278
|
empty: "No alerts. Add one with gloom alerts add AAPL above 400, alerts add CRWV earnings --days 3, alerts add CPI --days 1, or alerts add CN PMI.",
|
|
1241
1279
|
});
|
|
@@ -1295,7 +1333,7 @@ export const alertsCliCommand: CliCommandDef = {
|
|
|
1295
1333
|
};
|
|
1296
1334
|
|
|
1297
1335
|
if (request?.kind === "move" && moves) {
|
|
1298
|
-
const plan = planMoveAlerts(request, moves.listings, alerts, now);
|
|
1336
|
+
const plan = planMoveAlerts({ ...request, ...sessionRule }, moves.listings, alerts, now);
|
|
1299
1337
|
const single = moves.listings.length === 1 && !moves.watchlist;
|
|
1300
1338
|
const rule = moveRuleWords({ condition: request.condition, targetPrice: request.percent });
|
|
1301
1339
|
if (single && plan.existing[0]) {
|
|
@@ -1320,7 +1358,7 @@ export const alertsCliCommand: CliCommandDef = {
|
|
|
1320
1358
|
const alert = plan.added[0]!;
|
|
1321
1359
|
const nowText = moveNowText(alert, now);
|
|
1322
1360
|
ctx.printResult({ data: { changed: !ctx.cliOptions.dryRun, dryRun: ctx.cliOptions.dryRun, alert }, ...(notes.length ? { warnings: notes } : {}) }, {
|
|
1323
|
-
text: (data) => `Added alert ${data.alert.id}: ${formatAlertDescription(data.alert)} (${MOVE_REARM}).${nowText ? ` ${capitalize(nowText)}.` : ""}${dryRunNote(data.dryRun)}\n${MOVE_DELIVERY}`,
|
|
1361
|
+
text: (data) => `Added alert ${data.alert.id}: ${formatAlertDescription(data.alert)} (${MOVE_REARM}).${nowText ? ` ${capitalize(nowText)}.` : alert.regularHoursOnly ? " Waiting for a regular-hours quote." : ""}${dryRunNote(data.dryRun)}\n${MOVE_DELIVERY}`,
|
|
1324
1362
|
});
|
|
1325
1363
|
return;
|
|
1326
1364
|
}
|
|
@@ -1343,7 +1381,7 @@ export const alertsCliCommand: CliCommandDef = {
|
|
|
1343
1381
|
if (request?.kind === "price" || request?.kind === "metric") {
|
|
1344
1382
|
const { condition } = request;
|
|
1345
1383
|
const symbol = requireArg(priceListing?.key, ADD_USAGE, ctx);
|
|
1346
|
-
const alert: AlertRule = { ...createAlert(symbol, condition, request.price, priceListing?.exchange), ...(request.kind === "metric" ? { metric: request.metric } : {}),
|
|
1384
|
+
const alert: AlertRule = { ...createAlert(symbol, condition, request.price, priceListing?.exchange), ...sessionRule, ...(request.kind === "metric" ? { metric: request.metric } : {}),
|
|
1347
1385
|
// A London line's level is shown in pence from the first, before any check has read its quote.
|
|
1348
1386
|
...request.kind === "price" && priced ? {
|
|
1349
1387
|
lastQuoteCurrency: priced.quote.currency || undefined, lastQuotePence: isPenceQuotedLine(priced.quote) || undefined,
|
|
@@ -1361,8 +1399,7 @@ export const alertsCliCommand: CliCommandDef = {
|
|
|
1361
1399
|
const weekly = alert.metric?.kind === "rrg";
|
|
1362
1400
|
const daily = !!alert.metric && isDailyMetric(alert.metric);
|
|
1363
1401
|
const firstCheck = daily ? firstDailyCheck(alert.exchange, now, weekly) : null;
|
|
1364
|
-
|
|
1365
|
-
const checkedPrice = !alert.metric && priced && Number.isFinite(priced.quote.price) && priced.quote.price !== 0 ? priced.quote.price : null;
|
|
1402
|
+
const checkedPrice = alert.lastCheckedPrice;
|
|
1366
1403
|
// An above or below rule that already holds goes off at its first check, not on the next cross: said with the reading.
|
|
1367
1404
|
const alreadyMet = alert.metric
|
|
1368
1405
|
? levelAlreadyMet(alert.condition, alert.lastCheckedPrice, alert.lastCheckedTarget)
|
|
@@ -1372,7 +1409,7 @@ export const alertsCliCommand: CliCommandDef = {
|
|
|
1372
1409
|
const goesOffThen = daily && alreadyMet ? ` It goes off then if it is still ${alert.condition}.` : "";
|
|
1373
1410
|
const notes = [
|
|
1374
1411
|
alert.metric ? unread ? `Not read yet: ${unread.replace(/\.$/, "")}.` : `${metricReadingNote(alert)}${met}.`
|
|
1375
|
-
: checkedPrice != null ? `Last price ${alertPriceWithCurrency(alert, checkedPrice)}${readingSessionWords(
|
|
1412
|
+
: checkedPrice != null ? `Last price ${alertPriceWithCurrency(alert, checkedPrice)}${readingSessionWords(alert)} · ${alertQuoteTime(alert.lastQuoteUpdatedAt)}${met}.` : alert.regularHoursOnly ? "Waiting for a regular-hours quote." : null,
|
|
1376
1413
|
firstCheck ? `First checked on the ${firstCheck.day} ${weekly ? "weekly close" : "close"}, from ${isoUtc(firstCheck.at).slice(11, 16)} UTC.${goesOffThen}`
|
|
1377
1414
|
: goesOffThen ? `It goes off on the first close it is checked on if it is still ${alert.condition}.` : null,
|
|
1378
1415
|
].filter(Boolean).join(" ");
|
|
@@ -1431,7 +1468,7 @@ export const alertsCliCommand: CliCommandDef = {
|
|
|
1431
1468
|
const delivery = release ? ", only while it is running" : " while it is running, or on your phone with Cloud sync";
|
|
1432
1469
|
const when = !eventDate ? null : newRelease?.next ? releaseWhen(newRelease.next) : `on ${eventDate}`;
|
|
1433
1470
|
const reminder = !eventDate
|
|
1434
|
-
? "the app alerts once the calendar lists its next date, about two weeks ahead"
|
|
1471
|
+
? scheduled.target.kind === "earnings" ? "waiting for the next earnings date to be published" : "the app alerts once the calendar lists its next date, about two weeks ahead"
|
|
1435
1472
|
: macroOutAt != null ? `it came out today at ${new Date(macroOutAt).toISOString().slice(11, 16)} UTC, so the app alerts before the next one`
|
|
1436
1473
|
: due ? "already reached, so the app alerts at its next check" : `the app alerts on ${leadStartDate(eventDate, scheduled.leadDays)}`;
|
|
1437
1474
|
ctx.printResult({ data: { changed: !ctx.cliOptions.dryRun, dryRun: ctx.cliOptions.dryRun, alert: rule,
|
|
@@ -1439,7 +1476,7 @@ export const alertsCliCommand: CliCommandDef = {
|
|
|
1439
1476
|
// Delivery, as docs/usage.md states it: CPI, FOMC and calendar releases notify in the running app only; earnings also reach the phone,
|
|
1440
1477
|
// which Gloom Cloud alerts with the same results once the actual EPS is stored for a results alert.
|
|
1441
1478
|
text: (data) => scheduled.trigger === "results"
|
|
1442
|
-
? `Added alert ${data.alert.id}: ${name} on ${eventDate}, when results are out (the app alerts once the actual EPS is in while it is running, and with Cloud sync your phone gets the same alert).${dryRunNote(data.dryRun)}`
|
|
1479
|
+
? `Added alert ${data.alert.id}: ${name}${eventDate ? ` on ${eventDate}` : ""}, when results are out (the app alerts once the actual EPS is in while it is running, and with Cloud sync your phone gets the same alert).${eventDate ? "" : " Waiting for the next earnings date to be published."}${dryRunNote(data.dryRun)}`
|
|
1443
1480
|
: `Added alert ${data.alert.id}: ${name}${when ? ` ${when}` : ""}, ${plural(scheduled.leadDays, "day")} before${prints ? " and when it prints" : ""} (${reminder}${
|
|
1444
1481
|
prints ? ", and with the actual, forecast and prior once out" : ""}${delivery}).${dryRunNote(data.dryRun)}`,
|
|
1445
1482
|
});
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { metricFormInput, metricShortcut, parseMetricAlert } from "./metric-command";
|
|
1
|
+
import { metricFormInput, metricShortcut, namesTwoListings, parseMetricAlert } from "./metric-command";
|
|
2
2
|
import { isRelativeMetric, type AlertMetric } from "./metric-model";
|
|
3
3
|
import type { AlertCondition } from "./types";
|
|
4
4
|
import { hasAlertCurrency, isPenceLevel, parseAlertPrice, readAlertLevel } from "./price";
|
|
5
5
|
import { normalizeAlertSymbol } from "./quotes";
|
|
6
6
|
import { moveCondition, parseMovePercent } from "./move";
|
|
7
7
|
import type { WizardStep } from "../../../types/plugin";
|
|
8
|
+
import { parseListingArg } from "../../../cli/listing-arg";
|
|
9
|
+
import { isSpotCommodityOrCurrencyPair } from "../../../utils/crypto-pair";
|
|
8
10
|
|
|
9
11
|
/** Add Alert's kind for a move from the previous close, beside a price level. */
|
|
10
12
|
export const MOVE_KIND_CHOICE = { value: "move", label: "Move from previous close" };
|
|
@@ -25,6 +27,7 @@ export interface AlertCommandInput {
|
|
|
25
27
|
price: number;
|
|
26
28
|
/** A move from the previous close (`QQQ moves 5%`): `condition` is either way (crosses), up (above) or down (below). */
|
|
27
29
|
move?: true;
|
|
30
|
+
regularHoursOnly?: true;
|
|
28
31
|
/** Typed in pence (`70p`): `price` is in pounds, for a London line quoted in pence. */
|
|
29
32
|
pence?: true;
|
|
30
33
|
currency?: string;
|
|
@@ -53,6 +56,49 @@ function parseAlertCondition(value: string | undefined): AlertCondition | null {
|
|
|
53
56
|
}
|
|
54
57
|
}
|
|
55
58
|
|
|
59
|
+
/** BTC/USD, BRK/B and EUR/USD are one listing written with a slash, as `alerts add` reads them; XLK/SPY is not. */
|
|
60
|
+
export function slashSpellsListing(symbol: string): boolean {
|
|
61
|
+
try {
|
|
62
|
+
return parseListingArg(symbol).key !== symbol.toUpperCase();
|
|
63
|
+
} catch {
|
|
64
|
+
// Intentional ignore: text the listing reader refuses is no pair to divide, so the quote's own error stands.
|
|
65
|
+
return true;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Whether SA can open `A/B` as the ratio of two listings before anything is quoted: no listing is written that
|
|
71
|
+
* way. One that is stays a listing's price, and Add Alert asks the service first, as `alerts add` does: a pair
|
|
72
|
+
* the listing reader respells (BRK/B is BRK-B, EUR/USD is EURUSD=X, BTC/USD is BTC-USD), a spot commodity
|
|
73
|
+
* (XAU/USD), and one or two letters after the slash, a share class or series (BF/B, BAC/PL).
|
|
74
|
+
*/
|
|
75
|
+
function slashNamesTwoListings(symbol: string): boolean {
|
|
76
|
+
if (namesTwoListings(symbol)) return true;
|
|
77
|
+
const pair = /^([^/\s:]+)\/([^/\s:]+)$/.exec(symbol);
|
|
78
|
+
if (!pair || pair[2]!.length <= 2) return false;
|
|
79
|
+
return !slashSpellsListing(symbol) && !isSpotCommodityOrCurrencyPair(symbol);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* `EWJ/ACWI above 0.60` typed after SA: the ratio of two listings (slashNamesTwoListings), as `alerts add` saves
|
|
84
|
+
* it, so Add Alert opens on Ratio to benchmark with both listings, the direction and the level filled in.
|
|
85
|
+
*/
|
|
86
|
+
function shortcutRatio(parts: readonly string[]): Record<string, string> | null {
|
|
87
|
+
const pair = /^([^/\s]+)\/([^/\s]+)$/.exec(parts[0] ?? "");
|
|
88
|
+
if (!pair || !slashNamesTwoListings(parts[0]!)) return null;
|
|
89
|
+
const condition = parseAlertCondition(parts[1]);
|
|
90
|
+
if (condition && parts.length === 3) {
|
|
91
|
+
const ratio = parseMetricAlert(`${parts[0]} ratio ${condition} ${parts[2]}`);
|
|
92
|
+
if (ratio) return metricShortcut(ratio);
|
|
93
|
+
}
|
|
94
|
+
// The pair alone, or with its direction: the ratio form opens on both listings for the rest to be typed.
|
|
95
|
+
if (parts.length > 2 || (parts[1] && !condition)) return null;
|
|
96
|
+
return {
|
|
97
|
+
symbol: normalizeAlertSymbol(pair[1]), kind: "rs_ratio", "rs_ratio:benchmark": pair[2]!.toUpperCase(),
|
|
98
|
+
...condition ? { "rs_ratio:condition": condition } : {},
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
|
|
56
102
|
export function parseAlertShortcutValues(
|
|
57
103
|
input: string,
|
|
58
104
|
context?: { activeTicker: string | null },
|
|
@@ -64,6 +110,8 @@ export function parseAlertShortcutValues(
|
|
|
64
110
|
const activeTicker = normalizeAlertSymbol(context?.activeTicker);
|
|
65
111
|
return activeTicker ? { symbol: activeTicker } : {};
|
|
66
112
|
}
|
|
113
|
+
const ratio = shortcutRatio(parts);
|
|
114
|
+
if (ratio) return ratio;
|
|
67
115
|
// The price is the rest of the line, as one: `$ 757.75`, `1 000.50` and `757.75 USD` read as `alerts add` reads them quoted.
|
|
68
116
|
const priceText = parts.slice(2).join(" ");
|
|
69
117
|
if (parts.length > 3 && !isPenceLevel(priceText) && !hasAlertCurrency(priceText) && parseAlertPrice(priceText).kind === "invalid") {
|
|
@@ -118,7 +166,7 @@ export function parseAlertCommandValues(
|
|
|
118
166
|
if (!symbol || !typed) return null;
|
|
119
167
|
const percent = parseMovePercent(typed);
|
|
120
168
|
if (percent == null) throw new Error(`${MOVE_PERCENT_RULE}, not "${typed}".`);
|
|
121
|
-
return { symbol, condition, price: percent, move: true };
|
|
169
|
+
return { symbol, condition, price: percent, move: true, ...values["move:session"] === "regular" ? { regularHoursOnly: true } : {} };
|
|
122
170
|
}
|
|
123
171
|
const metric = values ? metricFormInput(values) : null;
|
|
124
172
|
if (metric) return metric;
|
|
@@ -126,7 +174,7 @@ export function parseAlertCommandValues(
|
|
|
126
174
|
const condition = parseAlertCondition(values?.condition);
|
|
127
175
|
const priceStr = values?.price?.trim();
|
|
128
176
|
if (!symbol || !condition || !priceStr) return null;
|
|
129
|
-
return { symbol, condition, ...readAlertLevel(priceStr) };
|
|
177
|
+
return { symbol, condition, ...readAlertLevel(priceStr), ...values?.["price:session"] === "regular" ? { regularHoursOnly: true } : {} };
|
|
130
178
|
}
|
|
131
179
|
|
|
132
180
|
/** A move rule's edit read: `GBPUSD=X moves 0.5%`, `HSBA:LSE down 3`, as `alerts add` takes it. Null for another form. */
|
|
@@ -11,7 +11,7 @@ import { checkedOnlyWithPro } from "./pro-rules";
|
|
|
11
11
|
export function ruleTarget(rule: EventAlertRule, zone: string | null = null): string {
|
|
12
12
|
const target = eventAlertTarget(rule);
|
|
13
13
|
if (!readScheduledRule(rule)) return target;
|
|
14
|
-
return `${target} · ${rule.eventDate ? eventWhen(rule, zone) : "date not known yet"}`;
|
|
14
|
+
return `${target} · ${rule.eventDate ? eventWhen(rule, zone) : rule.kind === "earnings_date" ? "waiting for next date" : "date not known yet"}`;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
/** `2026-11-06 13:30 UTC, 08:30 New York`, or the day alone without a print time. */
|
|
@@ -170,9 +170,9 @@ export function EventAlertsPane({ focused, width, height }: PaneProps) {
|
|
|
170
170
|
}, [dialog, selectedRule, setAlertLog, updateRules]);
|
|
171
171
|
const status =
|
|
172
172
|
error ??
|
|
173
|
-
(selectedRule?.kind === "catalyst" ? catalystStatus : null) ??
|
|
174
173
|
// A Pro rule nothing checks says so while it is selected, and what is free beside it.
|
|
175
174
|
(selectedRule && ruleState(selectedRule, now, signedIn, pro) === "Needs Pro" ? proRuleStatus(selectedRule) : null) ??
|
|
175
|
+
(selectedRule?.kind === "catalyst" ? catalystStatus : null) ??
|
|
176
176
|
sync.error ??
|
|
177
177
|
(sync.phase === "disabled"
|
|
178
178
|
? "Cloud sync disabled"
|
|
@@ -237,6 +237,7 @@ export function EventAlertsPane({ focused, width, height }: PaneProps) {
|
|
|
237
237
|
// A rule nothing checks while signed out, or without Pro, says so in its State, in the warning tone.
|
|
238
238
|
const waits = (state === "Needs sign-in" || state === "Needs Pro") && column.id === "status";
|
|
239
239
|
return {
|
|
240
|
+
...(column.id === "last" && rule.kind !== "iv_level" && !isResearchAlertKind(rule.kind) ? { mayBeBlank: true } : {}),
|
|
240
241
|
text:
|
|
241
242
|
column.id === "kind"
|
|
242
243
|
? alertKindLabel(rule.kind)
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { MISSING_VALUE } from "../../../utils/format";
|
|
2
|
-
import { closeBasis, metricName, metricReadingText, rotationQuadrant } from "./metric-model";
|
|
1
|
+
import { MISSING_VALUE, formatSignificant } from "../../../utils/format";
|
|
2
|
+
import { closeBasis, metricName, metricReadingText, rotationQuadrant, type AlertMetric, type MetricReading } from "./metric-model";
|
|
3
3
|
import { moveBasisText, movePercentText, moveTargetText, moveTriggerLabel } from "./move";
|
|
4
4
|
import { formatMarketPrice } from "../../../market-data/market/format";
|
|
5
5
|
import { EXTENDED_PRINT_WORDS } from "../../../market-data/market/change-basis";
|
|
6
6
|
import { EXTENDED_SESSION_MARKS } from "../../../market-data/market/status";
|
|
7
7
|
import { formatShortDate } from "../../../utils/datetime-format";
|
|
8
|
-
import { formatQuoteAgeWithSource } from "../../../market-data/quotes/time";
|
|
9
8
|
import { alertListingKey, alertPriceText } from "./price-text";
|
|
10
9
|
import { parsePublicTickerKey } from "../../../utils/exchanges";
|
|
11
10
|
import { isRoundTheClockCoin } from "../../../utils/crypto-pair";
|
|
12
11
|
import type { AlertCondition, AlertRule } from "./types";
|
|
12
|
+
import { quoteSourceWords } from "./fired-log";
|
|
13
13
|
|
|
14
14
|
/** What a list says of an alert no check has read yet. */
|
|
15
15
|
export const NOT_CHECKED_YET = "not checked yet";
|
|
@@ -26,8 +26,15 @@ export function relativeTime(ts: number): string {
|
|
|
26
26
|
return `${days}d ago`;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
export function formatMetricReading(metric: AlertMetric, reading: Pick<MetricReading, "value" | "target">): string {
|
|
30
|
+
return metric.kind === "rs_ratio" ? formatSignificant(reading.value) : metricReadingText(metric, reading);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function formatAlertHistoryValue(value: number | null, kind: string, unit: string): string | null {
|
|
34
|
+
if (value == null || !Number.isFinite(value)) return null;
|
|
35
|
+
const figure = kind === "rs_ratio" ? formatSignificant(value) : String(Number(value.toFixed(4)));
|
|
36
|
+
return `${figure}${unit === "%" ? "%" : unit ? ` ${unit}` : ""}`;
|
|
37
|
+
}
|
|
31
38
|
|
|
32
39
|
/**
|
|
33
40
|
* The current reading in a cell: an after-hours, pre-market or overnight
|
|
@@ -40,7 +47,7 @@ export function formatCurrentPrice(alert: AlertRule, maxWidth = 9, { words = fal
|
|
|
40
47
|
: /missing|bars|history|weekly closes/i.test(alert.lastCheckError) ? "Bar gap" : "No data";
|
|
41
48
|
// The quadrant the latest weekly strength and momentum place it in.
|
|
42
49
|
if (alert.metric?.kind === "rrg") return rotationQuadrant(alert.lastCheckedPrice, alert.lastCheckedTarget) ?? MISSING_VALUE;
|
|
43
|
-
if (alert.metric?.kind === "rs_ratio"
|
|
50
|
+
if (alert.metric?.kind === "rs_ratio") return formatSignificant(alert.lastCheckedPrice);
|
|
44
51
|
if (alert.lastCheckedPrice == null) return MISSING_VALUE;
|
|
45
52
|
const session = alert.metric ? undefined : alert.lastQuoteSession;
|
|
46
53
|
const mark = session && !words ? `${EXTENDED_SESSION_MARKS[session]} ` : "";
|
|
@@ -61,7 +68,7 @@ export function formatAlertTargetPrice(alert: AlertRule, maxWidth = 9): string {
|
|
|
61
68
|
if (alert.metric?.kind === "ma_cross") return `${alert.metric.slowPeriod}-day MA`;
|
|
62
69
|
if (alert.metric?.kind === "close_ma") return `${alert.metric.period}-day MA`;
|
|
63
70
|
if (alert.metric?.kind === "rrg") return `${alert.metric.quadrant[0]!.toUpperCase()}${alert.metric.quadrant.slice(1)}`;
|
|
64
|
-
if (alert.metric?.kind === "rs_ratio") return
|
|
71
|
+
if (alert.metric?.kind === "rs_ratio") return formatSignificant(alert.targetPrice);
|
|
65
72
|
if (alert.move) return moveTargetText(alert);
|
|
66
73
|
return alert.metric ? formatMarketPrice(alert.targetPrice, { maxWidth, minimumFractionDigits: 2 }) : alertPriceText(alert, alert.targetPrice, maxWidth);
|
|
67
74
|
}
|
|
@@ -81,7 +88,21 @@ export function formatAlertDistance(alert: AlertRule): string {
|
|
|
81
88
|
return `${/[1-9]/.test(fixed) ? (percent > 0 ? "+" : "-") : ""}${fixed}%`;
|
|
82
89
|
}
|
|
83
90
|
|
|
84
|
-
/**
|
|
91
|
+
/**
|
|
92
|
+
* An instant in a cell, to the minute in UTC as the History tab writes its
|
|
93
|
+
* times under a "(UTC)" heading: `2026-11-20 23:20`.
|
|
94
|
+
*/
|
|
95
|
+
export function alertMinuteUtc(time: number | null | undefined): string {
|
|
96
|
+
const iso = isoUtc(time);
|
|
97
|
+
return iso ? iso.slice(0, 16).replace("T", " ") : MISSING_VALUE;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* The Quote cell: when the quote it was checked on is from, to the minute in
|
|
102
|
+
* UTC and marked ◷ when the feed was delayed (◷2026-11-20 23:20), a settled
|
|
103
|
+
* close by its session, or, on the row of an alert that got none, why (a
|
|
104
|
+
* stale quote, or none).
|
|
105
|
+
*/
|
|
85
106
|
export function formatQuoteChecked(alert: AlertRule): string {
|
|
86
107
|
const basis = alert.metric ? closeBasis(alert.metric) : null;
|
|
87
108
|
// A settled close reads as the session it is from: Oct 26 close, Oct 23 weekly.
|
|
@@ -90,16 +111,28 @@ export function formatQuoteChecked(alert: AlertRule): string {
|
|
|
90
111
|
}
|
|
91
112
|
if (basis) return `on ${basis}`;
|
|
92
113
|
if (alert.lastCheckError) return /\bstale\b/i.test(alert.lastCheckError) ? "Stale" : "No quote";
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
lastUpdated: alert.lastQuoteUpdatedAt,
|
|
96
|
-
dataSource: alert.lastQuoteSource,
|
|
97
|
-
});
|
|
98
|
-
}
|
|
114
|
+
// The quote's own time, never its age: a compliance record reads the instant the level was judged on.
|
|
115
|
+
if (alert.lastQuoteUpdatedAt) return `${alert.lastQuoteSource === "delayed" ? "◷" : ""}${alertMinuteUtc(alert.lastQuoteUpdatedAt)}`;
|
|
99
116
|
if (alert.lastCheckedAt) return relativeTime(alert.lastCheckedAt);
|
|
100
117
|
return NOT_CHECKED_YET;
|
|
101
118
|
}
|
|
102
119
|
|
|
120
|
+
/**
|
|
121
|
+
* The detail's Quote line: the quote's own instant to the second with its feed
|
|
122
|
+
* (2026-11-20T23:20:59Z · delayed), or the close a daily rule read
|
|
123
|
+
* (2026-11-20 close); the row's cell otherwise.
|
|
124
|
+
*/
|
|
125
|
+
export function quoteAsOfText(alert: AlertRule): string {
|
|
126
|
+
const basis = alert.metric ? closeBasis(alert.metric) : null;
|
|
127
|
+
if (alert.lastCheckError) return formatQuoteChecked(alert);
|
|
128
|
+
if (basis && alert.lastDailyClose) return `${alert.lastDailyClose} ${basis === "weekly close" ? "weekly close" : "close"}`;
|
|
129
|
+
if (!basis && alert.lastQuoteUpdatedAt) {
|
|
130
|
+
const feed = quoteSourceWords(alert.lastQuoteSource);
|
|
131
|
+
return `${isoUtc(alert.lastQuoteUpdatedAt)}${feed ? ` · ${feed}` : ""}`;
|
|
132
|
+
}
|
|
133
|
+
return formatQuoteChecked(alert);
|
|
134
|
+
}
|
|
135
|
+
|
|
103
136
|
/** A time as lists and exports give it: ISO 8601 in UTC, to the second (2026-10-27T06:35:12Z); empty for none. */
|
|
104
137
|
export function isoUtc(value: number | null | undefined): string {
|
|
105
138
|
return value != null && Number.isFinite(value) && value > 0 ? new Date(value).toISOString().replace(/\.\d{3}Z$/, "Z") : "";
|
|
@@ -133,12 +166,50 @@ function readingUnit(alert: AlertRule): string {
|
|
|
133
166
|
return alert.lastQuoteCurrency ?? "";
|
|
134
167
|
}
|
|
135
168
|
|
|
169
|
+
/**
|
|
170
|
+
* The currency an alert's readings are in: the listing's for a price, a move
|
|
171
|
+
* or a moving average; none for a multiple, RSI, a ratio of two listings or an
|
|
172
|
+
* RRG quadrant, which carry no currency.
|
|
173
|
+
*/
|
|
174
|
+
export function alertReadingCurrency(alert: AlertRule): string | null {
|
|
175
|
+
const unit = readingUnit(alert);
|
|
176
|
+
return unit && unit !== "x" ? unit : null;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* The reading a daily rule is measured against, as the last reading is
|
|
181
|
+
* written: the slow average of an MA crossover or the average a close is held
|
|
182
|
+
* to (`59.73 USD on the 2026-11-20 close`). Empty for a rule judged against a
|
|
183
|
+
* fixed level, and before a check has read one.
|
|
184
|
+
*/
|
|
185
|
+
export function alertComparatorReadingText(alert: AlertRule): string {
|
|
186
|
+
const kind = alert.metric?.kind;
|
|
187
|
+
if (kind !== "ma_cross" && kind !== "close_ma") return "";
|
|
188
|
+
const value = alert.lastCheckedTarget;
|
|
189
|
+
if (alert.lastCheckError || value == null || !Number.isFinite(value)) return "";
|
|
190
|
+
const unit = readingUnit(alert);
|
|
191
|
+
const figure = `${value.toFixed(2)}${unit ? ` ${unit}` : ""}`;
|
|
192
|
+
return alert.lastDailyClose ? `${figure} on the ${alert.lastDailyClose} close` : figure;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/** The listing a ratio or RRG rule divides by, as it was confirmed (`ACWI:NASDAQ`); empty for any other rule. */
|
|
196
|
+
export function alertBenchmarkListing(alert: Pick<AlertRule, "metric">): string {
|
|
197
|
+
const metric = alert.metric;
|
|
198
|
+
if (metric?.kind !== "rs_ratio" && metric?.kind !== "rrg") return "";
|
|
199
|
+
return metric.benchmarkExchange ? `${metric.benchmark}:${metric.benchmarkExchange}` : metric.benchmark;
|
|
200
|
+
}
|
|
201
|
+
|
|
136
202
|
/** When the last reading is from: the quote's own time, or the daily close's; null with none. */
|
|
137
203
|
export function alertReadingAt(alert: AlertRule): number | null {
|
|
138
204
|
if (alert.lastCheckError || alert.lastCheckedPrice == null) return null;
|
|
139
205
|
return alert.lastQuoteUpdatedAt ?? alert.lastCheckedAt ?? null;
|
|
140
206
|
}
|
|
141
207
|
|
|
208
|
+
export function alertReadingFeed(alert: AlertRule): string | null {
|
|
209
|
+
if (alert.lastCheckError || !Number.isFinite(alert.lastCheckedPrice)) return null;
|
|
210
|
+
return (alert.metric && closeBasis(alert.metric)) || quoteSourceWords(alert.lastQuoteSource) || "feed not recorded";
|
|
211
|
+
}
|
|
212
|
+
|
|
142
213
|
/**
|
|
143
214
|
* The last reading an alert was checked on, with its unit and when it is
|
|
144
215
|
* from: `37.12 USD as of 2026-10-27T14:31Z`, `61.23 on the 2026-10-26 close`
|
|
@@ -158,8 +229,8 @@ export function alertReadingText(alert: AlertRule): string {
|
|
|
158
229
|
// A price at its instrument's precision and with thousands separators, as the Trigger beside it (74,481.45 USD);
|
|
159
230
|
// a London line's in pence, which says its unit itself.
|
|
160
231
|
const price = !alert.metric ? alertPriceText(alert, value) : null;
|
|
161
|
-
const figure = alert.metric?.kind === "rrg"
|
|
162
|
-
|
|
232
|
+
const figure = alert.metric?.kind === "rrg" || alert.metric?.kind === "rs_ratio"
|
|
233
|
+
? formatMetricReading(alert.metric, { value, target: alert.lastCheckedTarget ?? Number.NaN })
|
|
163
234
|
: price?.endsWith("p") ? `${price}${readingSessionWords(alert)}`
|
|
164
235
|
: `${price ?? value.toFixed(2)}${unit === "x" ? "x" : unit ? ` ${unit}` : ""}${readingSessionWords(alert)}`;
|
|
165
236
|
const basis = alert.metric ? closeBasis(alert.metric) : null;
|