gloomberb 0.15.7 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -2
- package/package.json +1 -1
- package/src/api-client/app-attention.ts +147 -0
- package/src/api-client/attention.ts +26 -0
- package/src/api-client/awards.ts +215 -0
- package/src/api-client/catalysts.ts +160 -0
- package/src/api-client/chat.ts +137 -14
- package/src/api-client/company-kpis.ts +153 -0
- package/src/api-client/cpi.ts +52 -0
- package/src/api-client/credit-documents.ts +107 -0
- package/src/api-client/data.ts +192 -3
- package/src/api-client/distress.ts +164 -0
- package/src/api-client/doe.ts +75 -0
- package/src/api-client/equity-screener.ts +11 -0
- package/src/api-client/exposure.ts +202 -0
- package/src/api-client/gpu.ts +93 -0
- package/src/api-client/hiring.ts +110 -0
- package/src/api-client/index.ts +78 -3
- package/src/api-client/normalizers.ts +31 -1
- package/src/api-client/paths.ts +3 -0
- package/src/api-client/perps.ts +127 -0
- package/src/api-client/power.ts +148 -0
- package/src/api-client/request.ts +58 -1
- package/src/api-client/research-activity.ts +172 -13
- package/src/api-client/socket.ts +75 -27
- package/src/api-client/supply-chain-graph.ts +40 -0
- package/src/api-client/supply-chain.ts +98 -0
- package/src/api-client/telemetry.ts +29 -0
- package/src/api-client/themes.ts +28 -0
- package/src/api-client/types.ts +33 -1
- package/src/api-client/wall-experiments.ts +100 -0
- package/src/api-client/wall-summary.ts +49 -0
- package/src/api-client/web-experiments.ts +136 -0
- package/src/app/pane-runtime/plugin-bindings.ts +5 -0
- package/src/app/pane-runtime/ticker-open-runtime.ts +8 -2
- package/src/app/runtime/update.ts +13 -1
- package/src/cli/commands/system.ts +2 -0
- package/src/cli/desktop-pane-shot.ts +3 -4
- package/src/cli/pane-functions/data.ts +78 -0
- package/src/cli/pane-functions/financial-ratio-shot.ts +160 -0
- package/src/cli/pane-functions/function-help.ts +220 -8
- package/src/cli/pane-functions/headless.ts +4 -0
- package/src/cli/pane-functions/screenshot-evidence.ts +21 -0
- package/src/cli/pane-functions/screenshot.ts +49 -5
- package/src/components/chart/composite/composite-chart.tsx +15 -2
- package/src/components/chart/composite/format.ts +24 -11
- package/src/components/chart/composite/rasterizer.ts +67 -16
- package/src/components/chart/composite/scene.ts +53 -2
- package/src/components/chart/composite/session-shading.ts +3 -2
- package/src/components/chart/composite/text-renderer.ts +52 -1
- package/src/components/chart/composite/time-axis.ts +100 -30
- package/src/components/chart/composite/tools.ts +2 -1
- package/src/components/chart/composite/types.ts +4 -0
- package/src/components/chart-table/index.ts +1 -0
- package/src/components/chart-table/layout.ts +15 -0
- package/src/components/command-bar/action-runtime.ts +1 -0
- package/src/components/command-bar/commands/direct/index.ts +32 -0
- package/src/components/command-bar/commands/registry.ts +7 -0
- package/src/components/command-bar/pane-templates/items.ts +11 -0
- package/src/components/command-bar/pane-templates/workflow.ts +19 -4
- package/src/components/command-bar/routes/root/command-items.ts +6 -0
- package/src/components/command-bar/routes/root/provider-search.ts +2 -0
- package/src/components/command-bar/routes/root/results.ts +64 -0
- package/src/components/command-bar/routes/root/runtime.ts +8 -0
- package/src/components/command-bar/routes/ticker-search/results.ts +89 -24
- package/src/components/command-bar/routes/ticker-search/route.ts +2 -0
- package/src/components/command-bar/surface/index.tsx +15 -0
- package/src/components/command-bar/view-model.ts +3 -0
- package/src/components/command-bar/workflow/collection-actions.ts +9 -7
- package/src/components/command-bar/workflow/ops.ts +19 -0
- package/src/components/command-bar/workflow/tickers.ts +5 -0
- package/src/components/company-logo.tsx +15 -2
- package/src/components/data-table/table-pane.ts +2 -1
- package/src/components/index.ts +1 -0
- package/src/components/layout/detached-pane-shell.tsx +12 -1
- package/src/components/layout/missing-pane.tsx +87 -23
- package/src/components/layout/pane/footer/index.tsx +64 -18
- package/src/components/layout/pane/footer/model.ts +85 -0
- package/src/components/layout/pane/sidebar.tsx +19 -1
- package/src/components/layout/shell/index.tsx +38 -28
- package/src/components/layout/shell/pane/management-shortcuts.ts +13 -1
- package/src/components/layout/status-bar.tsx +93 -28
- package/src/components/layout/status-widget-space.ts +72 -0
- package/src/components/onboarding/first-run-workspace.ts +8 -2
- package/src/components/onboarding/onboarding-wizard.tsx +35 -16
- package/src/components/onboarding/portfolio-step/positions-panel.tsx +14 -5
- package/src/components/onboarding/wizard-model.ts +13 -5
- package/src/components/onboarding/wizard-positions.ts +56 -7
- package/src/components/price-performance.tsx +31 -34
- package/src/components/ui/data-table/index.tsx +11 -8
- package/src/components/ui/display.tsx +15 -6
- package/src/components/ui/fields.tsx +5 -0
- package/src/components/ui/figure.tsx +94 -0
- package/src/components/ui/header-case.ts +25 -3
- package/src/components/ui/icon.tsx +3 -1
- package/src/components/ui/message-composer.tsx +8 -1
- package/src/components/ui/query-bar.tsx +8 -1
- package/src/components/ui/ratio-bar.tsx +84 -0
- package/src/components/ui/toggle.tsx +3 -1
- package/src/components/use-scrollbox-layout.ts +17 -0
- package/src/core/state/app/layout.ts +35 -1
- package/src/core/state/app/state.ts +15 -0
- package/src/core/state/app/types.ts +1 -0
- package/src/data/config/store/normalize.ts +24 -0
- package/src/i18n/es.ts +2 -0
- package/src/i18n/ja.ts +2 -0
- package/src/i18n/ko.ts +2 -0
- package/src/i18n/zh-cn.ts +2 -0
- package/src/i18n/zh-tw.ts +2 -0
- package/src/layout-marketplace/pane-imagery.ts +1 -0
- package/src/market-data/coordinator/entries.ts +13 -0
- package/src/market-data/coordinator/financials.ts +33 -8
- package/src/market-data/market/freshness.ts +16 -5
- package/src/market-data/market/trading-sessions.ts +65 -1
- package/src/market-data/published-cn-sessions.ts +25 -0
- package/src/market-data/published-nse-sessions.ts +20 -0
- package/src/news/aggregator.ts +4 -0
- package/src/plugins/builtin/account-management/model.ts +6 -1
- package/src/plugins/builtin/account-management/pane.tsx +36 -25
- package/src/plugins/builtin/alerts/catalysts.ts +77 -0
- package/src/plugins/builtin/alerts/events-pane.tsx +3 -0
- package/src/plugins/builtin/alerts/events.ts +10 -4
- package/src/plugins/builtin/alerts/history-pane.tsx +1 -1
- package/src/plugins/builtin/alerts/history.ts +1 -0
- package/src/plugins/builtin/alerts/index.tsx +6 -0
- package/src/plugins/builtin/alerts/research-builder.ts +10 -3
- package/src/plugins/builtin/alerts/research-rules.ts +15 -1
- package/src/plugins/builtin/analytics/risk-client.ts +15 -3
- package/src/plugins/builtin/analytics/risk-headless.ts +123 -18
- package/src/plugins/builtin/attention/client.ts +80 -0
- package/src/plugins/builtin/attention/evidence.ts +30 -0
- package/src/plugins/builtin/attention/headless.ts +33 -0
- package/src/plugins/builtin/attention/index.tsx +18 -0
- package/src/plugins/builtin/attention/model.ts +59 -0
- package/src/plugins/builtin/attention/pane.tsx +211 -0
- package/src/plugins/builtin/attention/trending.tsx +59 -0
- package/src/plugins/builtin/awards/alerts.ts +32 -0
- package/src/plugins/builtin/awards/client.ts +82 -0
- package/src/plugins/builtin/awards/detail.tsx +107 -0
- package/src/plugins/builtin/awards/evidence.ts +36 -0
- package/src/plugins/builtin/awards/headless.ts +55 -0
- package/src/plugins/builtin/awards/index.tsx +20 -0
- package/src/plugins/builtin/awards/model.ts +42 -0
- package/src/plugins/builtin/awards/pane.tsx +263 -0
- package/src/plugins/builtin/catalysts/client.ts +28 -0
- package/src/plugins/builtin/catalysts/detail.tsx +88 -0
- package/src/plugins/builtin/catalysts/evidence.ts +47 -0
- package/src/plugins/builtin/catalysts/headless.ts +42 -0
- package/src/plugins/builtin/catalysts/history.ts +26 -0
- package/src/plugins/builtin/catalysts/index.tsx +29 -0
- package/src/plugins/builtin/catalysts/model.ts +135 -0
- package/src/plugins/builtin/catalysts/pane.tsx +159 -0
- package/src/plugins/builtin/chart-composer/cli-options.ts +4 -0
- package/src/plugins/builtin/chart-composer/headless-schema.ts +6 -0
- package/src/plugins/builtin/chart-composer/index.tsx +8 -1
- package/src/plugins/builtin/chart-composer/pane.tsx +28 -1
- package/src/plugins/builtin/chat/attachments/desktop.tsx +610 -0
- package/src/plugins/builtin/chat/attachments/files.ts +45 -0
- package/src/plugins/builtin/chat/attachments/model.ts +164 -0
- package/src/plugins/builtin/chat/attachments/terminal.tsx +72 -0
- package/src/plugins/builtin/chat/attachments/transfer.ts +165 -0
- package/src/plugins/builtin/chat/content/channel-navigation.ts +13 -12
- package/src/plugins/builtin/chat/content/composer-runtime.ts +25 -4
- package/src/plugins/builtin/chat/content/composer.tsx +46 -4
- package/src/plugins/builtin/chat/content/footer.tsx +46 -8
- package/src/plugins/builtin/chat/content/index.tsx +263 -62
- package/src/plugins/builtin/chat/content/layout-metrics.ts +10 -2
- package/src/plugins/builtin/chat/content/open-targets.ts +17 -3
- package/src/plugins/builtin/chat/content/scroll.ts +7 -1
- package/src/plugins/builtin/chat/content/shortcuts.ts +36 -11
- package/src/plugins/builtin/chat/content/snapshot.ts +3 -0
- package/src/plugins/builtin/chat/content/transcript.tsx +17 -1
- package/src/plugins/builtin/chat/content/types.ts +7 -0
- package/src/plugins/builtin/chat/controller/attachments.ts +213 -0
- package/src/plugins/builtin/chat/controller/connections.ts +3 -1
- package/src/plugins/builtin/chat/controller/index.ts +114 -2
- package/src/plugins/builtin/chat/controller/lifecycle.ts +9 -0
- package/src/plugins/builtin/chat/controller/messages.ts +35 -2
- package/src/plugins/builtin/chat/controller/send.ts +128 -25
- package/src/plugins/builtin/chat/controller/state.ts +12 -1
- package/src/plugins/builtin/chat/controller/utils.ts +7 -5
- package/src/plugins/builtin/chat/controller/view.ts +2 -0
- package/src/plugins/builtin/chat/index.tsx +21 -0
- package/src/plugins/builtin/chat/layout.ts +9 -4
- package/src/plugins/builtin/chat/message/desktop.tsx +55 -20
- package/src/plugins/builtin/chat/message/header.tsx +30 -5
- package/src/plugins/builtin/chat/message/inline-tokens.tsx +9 -0
- package/src/plugins/builtin/chat/message/pending-send.ts +35 -0
- package/src/plugins/builtin/chat/message/profile-popover.tsx +5 -1
- package/src/plugins/builtin/chat/message/render-state.ts +12 -2
- package/src/plugins/builtin/chat/message/terminal.tsx +51 -4
- package/src/plugins/builtin/chat/message/types.ts +6 -1
- package/src/plugins/builtin/chat/pane-state.ts +59 -1
- package/src/plugins/builtin/chat/profile-popover.ts +50 -1
- package/src/plugins/builtin/chat/sidebar.tsx +8 -3
- package/src/plugins/builtin/chat/status-widget.tsx +29 -12
- package/src/plugins/builtin/chat/unread-inbox-pane.tsx +143 -0
- package/src/plugins/builtin/chat/unread-inbox.ts +91 -0
- package/src/plugins/builtin/clinical-trials/client.ts +237 -0
- package/src/plugins/builtin/clinical-trials/index.tsx +74 -0
- package/src/plugins/builtin/clinical-trials/pane.tsx +225 -0
- package/src/plugins/builtin/clinical-trials/types.ts +2 -0
- package/src/plugins/builtin/cloud/askg/controller.ts +37 -6
- package/src/plugins/builtin/cloud/askg/executor.ts +59 -44
- package/src/plugins/builtin/cloud/askg/host.ts +8 -1
- package/src/plugins/builtin/cloud/askg/manifest.ts +29 -2
- package/src/plugins/builtin/cloud/askg/model.ts +47 -13
- package/src/plugins/builtin/cloud/askg/notes.ts +100 -0
- package/src/plugins/builtin/cloud/askg/pane.tsx +50 -14
- package/src/plugins/builtin/cloud/askg/protocol.ts +39 -1
- package/src/plugins/builtin/cloud/askg/result-budget.ts +156 -0
- package/src/plugins/builtin/cloud/askg/user-data.ts +89 -0
- package/src/plugins/builtin/cloud/auth-actions.tsx +55 -31
- package/src/plugins/builtin/cloud/plugin.tsx +4 -1
- package/src/plugins/builtin/cloud/team/pane-sections.tsx +10 -1
- package/src/plugins/builtin/cloud/team/pane.tsx +3 -2
- package/src/plugins/builtin/cloud/thesis/board-pane.tsx +2 -2
- package/src/plugins/builtin/cloud/thesis/detail.tsx +1 -1
- package/src/plugins/builtin/cloud/thesis/ticker-tab.tsx +2 -2
- package/src/plugins/builtin/cloud/trial-offer-status-widget.tsx +202 -0
- package/src/plugins/builtin/cloud/upgrade-command.ts +1 -1
- package/src/plugins/builtin/cloud/upgrade-dialog.tsx +29 -3
- package/src/plugins/builtin/cloud/upgrade-status-widget.tsx +1 -1
- package/src/plugins/builtin/cloud-tweets/table.tsx +1 -1
- package/src/plugins/builtin/comment-letters/client.ts +342 -0
- package/src/plugins/builtin/comment-letters/index.tsx +74 -0
- package/src/plugins/builtin/comment-letters/pane.tsx +295 -0
- package/src/plugins/builtin/comment-letters/types.ts +43 -0
- package/src/plugins/builtin/company-attention/app-rank.tsx +79 -0
- package/src/plugins/builtin/company-attention/client.ts +69 -0
- package/src/plugins/builtin/company-attention/evidence.ts +45 -0
- package/src/plugins/builtin/company-attention/headless.ts +47 -0
- package/src/plugins/builtin/company-attention/index.tsx +30 -0
- package/src/plugins/builtin/company-attention/model.ts +129 -0
- package/src/plugins/builtin/company-attention/pane.tsx +183 -0
- package/src/plugins/builtin/company-kpis/client.ts +92 -0
- package/src/plugins/builtin/company-kpis/headless.ts +32 -0
- package/src/plugins/builtin/company-kpis/index.tsx +26 -0
- package/src/plugins/builtin/company-kpis/model.ts +124 -0
- package/src/plugins/builtin/company-kpis/pane.tsx +226 -0
- package/src/plugins/builtin/company-kpis/related.ts +11 -0
- package/src/plugins/builtin/company-kpis/screenshot-evidence.ts +44 -0
- package/src/plugins/builtin/composite-plugins.ts +34 -0
- package/src/plugins/builtin/correlation/history.ts +4 -1
- package/src/plugins/builtin/correlation/index.tsx +139 -80
- package/src/plugins/builtin/correlation/matrix/pair-chart.tsx +48 -0
- package/src/plugins/builtin/correlation/matrix/selection.ts +77 -0
- package/src/plugins/builtin/correlation/relationship/model.ts +2 -2
- package/src/plugins/builtin/cpi/client.ts +66 -0
- package/src/plugins/builtin/cpi/headless.ts +78 -0
- package/src/plugins/builtin/cpi/index.tsx +31 -0
- package/src/plugins/builtin/cpi/model.ts +198 -0
- package/src/plugins/builtin/cpi/pane.tsx +157 -0
- package/src/plugins/builtin/credit-documents/client.ts +99 -0
- package/src/plugins/builtin/credit-documents/detail.tsx +109 -0
- package/src/plugins/builtin/credit-documents/evidence.ts +64 -0
- package/src/plugins/builtin/credit-documents/gauge.tsx +55 -0
- package/src/plugins/builtin/credit-documents/headless.ts +40 -0
- package/src/plugins/builtin/credit-documents/index.tsx +19 -0
- package/src/plugins/builtin/credit-documents/model.ts +336 -0
- package/src/plugins/builtin/credit-documents/pane.tsx +185 -0
- package/src/plugins/builtin/custom-view/view-spec.ts +14 -2
- package/src/plugins/builtin/debt-maturities/pane.tsx +1 -0
- package/src/plugins/builtin/dividend-yield/pane.tsx +1 -1
- package/src/plugins/builtin/doe/client.ts +73 -0
- package/src/plugins/builtin/doe/headless.ts +93 -0
- package/src/plugins/builtin/doe/index.tsx +41 -0
- package/src/plugins/builtin/doe/model.ts +215 -0
- package/src/plugins/builtin/doe/pane.tsx +148 -0
- package/src/plugins/builtin/doe/range-bar.tsx +45 -0
- package/src/plugins/builtin/earnings/board.tsx +3 -0
- package/src/plugins/builtin/earnings/index.tsx +2 -0
- package/src/plugins/builtin/earnings-calls/pane.tsx +7 -1
- package/src/plugins/builtin/earnings-calls/transcript-view.tsx +7 -7
- package/src/plugins/builtin/earnings-ripple/client.ts +60 -0
- package/src/plugins/builtin/earnings-ripple/headless.ts +35 -0
- package/src/plugins/builtin/earnings-ripple/index.tsx +35 -0
- package/src/plugins/builtin/earnings-ripple/model.ts +98 -0
- package/src/plugins/builtin/earnings-ripple/pane.tsx +103 -0
- package/src/plugins/builtin/equity-screener/client.ts +1 -1
- package/src/plugins/builtin/equity-screener/criterion-editor.tsx +1 -1
- package/src/plugins/builtin/equity-screener/model.ts +74 -9
- package/src/plugins/builtin/equity-screener/pane.tsx +2 -0
- package/src/plugins/builtin/estimate-revisions/pane.tsx +3 -0
- package/src/plugins/builtin/executives/pane.tsx +7 -5
- package/src/plugins/builtin/exposure/charts.tsx +66 -0
- package/src/plugins/builtin/exposure/client.ts +53 -0
- package/src/plugins/builtin/exposure/drivers.ts +29 -0
- package/src/plugins/builtin/exposure/editor.tsx +61 -0
- package/src/plugins/builtin/exposure/evidence.ts +39 -0
- package/src/plugins/builtin/exposure/headless.ts +51 -0
- package/src/plugins/builtin/exposure/holdings.ts +56 -0
- package/src/plugins/builtin/exposure/index.tsx +13 -0
- package/src/plugins/builtin/exposure/model.ts +104 -0
- package/src/plugins/builtin/exposure/pane.tsx +247 -0
- package/src/plugins/builtin/fear-greed/charts.tsx +1 -1
- package/src/plugins/builtin/fear-greed/pane.tsx +2 -9
- package/src/plugins/builtin/filing-events/pane.tsx +2 -1
- package/src/plugins/builtin/gpu/board.tsx +163 -0
- package/src/plugins/builtin/gpu/changes.tsx +94 -0
- package/src/plugins/builtin/gpu/client.ts +130 -0
- package/src/plugins/builtin/gpu/equities.tsx +112 -0
- package/src/plugins/builtin/gpu/headless.ts +67 -0
- package/src/plugins/builtin/gpu/history.tsx +140 -0
- package/src/plugins/builtin/gpu/index.tsx +18 -0
- package/src/plugins/builtin/gpu/ladder.tsx +127 -0
- package/src/plugins/builtin/gpu/model.ts +317 -0
- package/src/plugins/builtin/gpu/pane.tsx +63 -0
- package/src/plugins/builtin/help/index.tsx +19 -2
- package/src/plugins/builtin/holders/pane.tsx +5 -9
- package/src/plugins/builtin/insider/detail.tsx +119 -0
- package/src/plugins/builtin/insider/display.ts +221 -0
- package/src/plugins/builtin/insider/headless.ts +24 -3
- package/src/plugins/builtin/insider/index.tsx +206 -108
- package/src/plugins/builtin/insider/insider-data.ts +31 -3
- package/src/plugins/builtin/insider/model.ts +53 -4
- package/src/plugins/builtin/insider/table-model.ts +226 -0
- package/src/plugins/builtin/insider/table.tsx +79 -0
- package/src/plugins/builtin/iv-history/screen-pane.tsx +1 -1
- package/src/plugins/builtin/jobs/pane.tsx +14 -7
- package/src/plugins/builtin/kelly-sizer/pane.tsx +1 -1
- package/src/plugins/builtin/macro-day/client.ts +50 -0
- package/src/plugins/builtin/macro-day/headless.ts +51 -0
- package/src/plugins/builtin/macro-day/index.tsx +21 -0
- package/src/plugins/builtin/macro-day/model.ts +137 -0
- package/src/plugins/builtin/macro-day/pane.tsx +118 -0
- package/src/plugins/builtin/macro-day/releases.ts +58 -0
- package/src/plugins/builtin/market-halts/model.ts +30 -17
- package/src/plugins/builtin/market-halts/pane.tsx +15 -21
- package/src/plugins/builtin/market-heatmap/data.ts +1 -1
- package/src/plugins/builtin/market-heatmap/index.tsx +198 -50
- package/src/plugins/builtin/market-heatmap/portfolio.ts +220 -0
- package/src/plugins/builtin/market-movers/index.tsx +1 -0
- package/src/plugins/builtin/market-movers/session-body.tsx +5 -2
- package/src/plugins/builtin/mna/distress/client.ts +326 -0
- package/src/plugins/builtin/mna/distress/detail.tsx +247 -0
- package/src/plugins/builtin/mna/distress/headless.ts +257 -0
- package/src/plugins/builtin/mna/distress/model.ts +427 -0
- package/src/plugins/builtin/mna/distress/pane.tsx +606 -0
- package/src/plugins/builtin/mna/index.tsx +15 -0
- package/src/plugins/builtin/mna/pane.tsx +42 -1
- package/src/plugins/builtin/news/index.tsx +62 -16
- package/src/plugins/builtin/news/wire/filter-articles.ts +54 -0
- package/src/plugins/builtin/news/wire/index.tsx +37 -3
- package/src/plugins/builtin/news/wire/industry-pane.tsx +29 -13
- package/src/plugins/builtin/news/wire/mutes.ts +253 -0
- package/src/plugins/builtin/news/wire/news/command-bar-search.ts +117 -0
- package/src/plugins/builtin/news/wire/news/footer.ts +4 -0
- package/src/plugins/builtin/news/wire/news/list-search.ts +34 -0
- package/src/plugins/builtin/news/wire/news/pop-out.tsx +158 -0
- package/src/plugins/builtin/news/wire/news/preset-pane.tsx +64 -19
- package/src/plugins/builtin/openfda/client.ts +300 -0
- package/src/plugins/builtin/openfda/index.tsx +71 -0
- package/src/plugins/builtin/openfda/pane.tsx +382 -0
- package/src/plugins/builtin/openfda/types.ts +76 -0
- package/src/plugins/builtin/options/footer.ts +1 -0
- package/src/plugins/builtin/options/view.tsx +1 -1
- package/src/plugins/builtin/options-calculator/pane.tsx +0 -1
- package/src/plugins/builtin/options-positioning/index.tsx +4 -2
- package/src/plugins/builtin/options-positioning/pane.tsx +1 -1
- package/src/plugins/builtin/pe-band/client.ts +61 -0
- package/src/plugins/builtin/pe-band/headless.ts +51 -0
- package/src/plugins/builtin/pe-band/index.tsx +20 -0
- package/src/plugins/builtin/pe-band/model.ts +267 -0
- package/src/plugins/builtin/pe-band/pane.tsx +159 -0
- package/src/plugins/builtin/perps/client.ts +66 -0
- package/src/plugins/builtin/perps/equity-row.tsx +28 -0
- package/src/plugins/builtin/perps/headless.ts +34 -0
- package/src/plugins/builtin/perps/index.tsx +14 -0
- package/src/plugins/builtin/perps/model.ts +58 -0
- package/src/plugins/builtin/perps/pane.tsx +185 -0
- package/src/plugins/builtin/plugin-marketplace/pane.tsx +0 -1
- package/src/plugins/builtin/portfolio-list/cli/render.ts +177 -87
- package/src/plugins/builtin/portfolio-list/cli/watchlist-command.ts +6 -20
- package/src/plugins/builtin/portfolio-list/command-bar.ts +6 -2
- package/src/plugins/builtin/portfolio-list/headless.ts +237 -0
- package/src/plugins/builtin/portfolio-list/index.tsx +2 -0
- package/src/plugins/builtin/portfolio-list/mutations.ts +70 -1
- package/src/plugins/builtin/portfolio-list/pane/data.ts +17 -0
- package/src/plugins/builtin/portfolio-list/pane/index.tsx +88 -5
- package/src/plugins/builtin/portfolio-list/pane/remove-ticker.ts +85 -0
- package/src/plugins/builtin/portfolio-list/pane/streaming.ts +18 -12
- package/src/plugins/builtin/portfolio-list/quick-add/index.tsx +6 -0
- package/src/plugins/builtin/power/client.ts +100 -0
- package/src/plugins/builtin/power/detail.tsx +82 -0
- package/src/plugins/builtin/power/evidence.ts +56 -0
- package/src/plugins/builtin/power/generation.tsx +37 -0
- package/src/plugins/builtin/power/headless.ts +43 -0
- package/src/plugins/builtin/power/index.tsx +16 -0
- package/src/plugins/builtin/power/model.ts +89 -0
- package/src/plugins/builtin/power/pane.tsx +209 -0
- package/src/plugins/builtin/power/query.ts +25 -0
- package/src/plugins/builtin/relative-rotation/pane.tsx +3 -3
- package/src/plugins/builtin/research/analyst-pane.tsx +1 -1
- package/src/plugins/builtin/research/corporate-actions-pane.tsx +13 -4
- package/src/plugins/builtin/research/equity-diagnostic-pane.tsx +11 -9
- package/src/plugins/builtin/research-search/pane.tsx +21 -7
- package/src/plugins/builtin/revenue-breakdown/pane.tsx +1 -1
- package/src/plugins/builtin/reverse-dcf/client.ts +35 -0
- package/src/plugins/builtin/reverse-dcf/headless.ts +44 -0
- package/src/plugins/builtin/reverse-dcf/index.tsx +20 -0
- package/src/plugins/builtin/reverse-dcf/model.ts +87 -0
- package/src/plugins/builtin/reverse-dcf/pane.tsx +107 -0
- package/src/plugins/builtin/risk-factors/pane.tsx +6 -5
- package/src/plugins/builtin/scanner/denied.tsx +4 -2
- package/src/plugins/builtin/scanner/feed.ts +1 -0
- package/src/plugins/builtin/scanner/flow-pane.tsx +3 -2
- package/src/plugins/builtin/scanner/hilo-pane.tsx +1 -1
- package/src/plugins/builtin/seasonality/client.ts +4 -1
- package/src/plugins/builtin/sec/command-bar-search.ts +217 -0
- package/src/plugins/builtin/sec/forms.ts +54 -0
- package/src/plugins/builtin/sec/headless.ts +31 -5
- package/src/plugins/builtin/sec/index.tsx +67 -11
- package/src/plugins/builtin/sec/model.ts +35 -5
- package/src/plugins/builtin/sectors/headless.ts +1 -0
- package/src/plugins/builtin/sectors/index.tsx +72 -26
- package/src/plugins/builtin/shared/cloud-upgrade.ts +143 -39
- package/src/plugins/builtin/shared/pro-feature-wall.tsx +8 -4
- package/src/plugins/builtin/shared/research-cells.tsx +107 -0
- package/src/plugins/builtin/shared/series-list-detail.tsx +5 -1
- package/src/plugins/builtin/shared/ticker-request.ts +1 -1
- package/src/plugins/builtin/shared/wall-teaser-catalog.ts +80 -0
- package/src/plugins/builtin/shared/wall-teaser.tsx +192 -0
- package/src/plugins/builtin/shared/wall-view-lifecycle.ts +43 -0
- package/src/plugins/builtin/short-interest/index.tsx +31 -0
- package/src/plugins/builtin/short-interest/watch-client.ts +70 -0
- package/src/plugins/builtin/short-interest/watch-headless.ts +49 -0
- package/src/plugins/builtin/short-interest/watch-model.ts +185 -0
- package/src/plugins/builtin/short-interest/watch-pane.tsx +169 -0
- package/src/plugins/builtin/short-volume/pane.tsx +1 -1
- package/src/plugins/builtin/social-mentions/pane.tsx +1 -1
- package/src/plugins/builtin/supply-chain/client.ts +104 -0
- package/src/plugins/builtin/supply-chain/disclosure-quote.tsx +17 -0
- package/src/plugins/builtin/supply-chain/evidence.ts +88 -0
- package/src/plugins/builtin/supply-chain/flow-layout.ts +133 -0
- package/src/plugins/builtin/supply-chain/flow.tsx +323 -0
- package/src/plugins/builtin/supply-chain/graph-client.ts +83 -0
- package/src/plugins/builtin/supply-chain/graph-evidence.ts +25 -0
- package/src/plugins/builtin/supply-chain/graph-model.ts +45 -0
- package/src/plugins/builtin/supply-chain/graph-pane.tsx +218 -0
- package/src/plugins/builtin/supply-chain/graph.tsx +163 -0
- package/src/plugins/builtin/supply-chain/headless.ts +105 -0
- package/src/plugins/builtin/supply-chain/index.tsx +17 -0
- package/src/plugins/builtin/supply-chain/model.ts +145 -0
- package/src/plugins/builtin/supply-chain/pane.tsx +276 -0
- package/src/plugins/builtin/supply-chain/row-evidence.tsx +96 -0
- package/src/plugins/builtin/supply-chain/trust.ts +34 -0
- package/src/plugins/builtin/themes/client.ts +39 -0
- package/src/plugins/builtin/themes/headless.ts +38 -0
- package/src/plugins/builtin/themes/model.ts +92 -0
- package/src/plugins/builtin/themes/pane.tsx +125 -0
- package/src/plugins/builtin/thirteenf/pane.tsx +6 -15
- package/src/plugins/builtin/ticker-detail/data-panes/historical-prices.tsx +5 -6
- package/src/plugins/builtin/ticker-detail/data-panes/returns-model.ts +201 -0
- package/src/plugins/builtin/ticker-detail/data-panes/returns-pane.tsx +327 -0
- package/src/plugins/builtin/ticker-detail/financials/period-end-history.ts +5 -2
- package/src/plugins/builtin/ticker-detail/financials/ratios.ts +60 -12
- package/src/plugins/builtin/ticker-detail/financials/tab.tsx +2 -1
- package/src/plugins/builtin/ticker-detail/headless.ts +7 -2
- package/src/plugins/builtin/ticker-detail/index.tsx +22 -0
- package/src/plugins/builtin/ticker-detail/overview/components.tsx +53 -30
- package/src/plugins/builtin/ticker-detail/overview/pane.tsx +2 -0
- package/src/plugins/builtin/ticker-detail/overview-tab.tsx +112 -47
- package/src/plugins/builtin/ticker-detail/pane.tsx +50 -6
- package/src/plugins/builtin/ticker-detail/quote-monitor/card.tsx +21 -42
- package/src/plugins/builtin/ticker-detail/quote-monitor/index.tsx +3 -0
- package/src/plugins/builtin/time-sales/pane.tsx +1 -1
- package/src/plugins/builtin/world-indices/indices.ts +1 -0
- package/src/plugins/catalog-browser.ts +40 -0
- package/src/plugins/catalog-manifest.ts +3 -0
- package/src/plugins/catalog-ui.ts +6 -0
- package/src/plugins/current-target.ts +0 -9
- package/src/public/__snapshots__/public-api.test.ts.snap +1 -0
- package/src/renderers/browser/cloud-transport.ts +66 -1
- package/src/renderers/browser/main.tsx +2 -0
- package/src/renderers/dom/data-table/row.tsx +2 -0
- package/src/renderers/dom/desktop/controls.tsx +38 -25
- package/src/renderers/dom/desktop/icons.tsx +8 -0
- package/src/renderers/dom/host/chart-surface.tsx +36 -2
- package/src/renderers/dom/host/focus-scope.ts +11 -1
- package/src/renderers/dom/styles.css +28 -0
- package/src/renderers/electrobun/view/backend-rpc.ts +3 -2
- package/src/renderers/electrobun/view/cli-pane-shot-entry.tsx +1 -1
- package/src/renderers/electrobun/view/http-fetch.ts +2 -0
- package/src/renderers/electrobun/view/main.tsx +3 -1
- package/src/renderers/electrobun/view/rpc-timeout.ts +59 -0
- package/src/renderers/opentui/start.tsx +3 -0
- package/src/shares/api.ts +3 -1
- package/src/sources/gloomberb-cloud/index.ts +47 -13
- package/src/sources/history-result.ts +1 -0
- package/src/sources/history-retention.ts +16 -0
- package/src/sources/provider-router/history.ts +4 -2
- package/src/sources/sec-edgar/identity.ts +36 -0
- package/src/sources/sec-edgar.ts +1 -34
- package/src/state/app/context/index.tsx +8 -0
- package/src/sync/core-contributors.ts +20 -2
- package/src/telemetry/attention-counts.ts +164 -0
- package/src/telemetry/live-config.ts +7 -0
- package/src/test-support/rpc-loopback.ts +7 -3
- package/src/test-support/shell-pane-keys.tsx +34 -0
- package/src/tickers/instrument-kind.ts +12 -6
- package/src/tickers/open-target.ts +1 -1
- package/src/tickers/search/asset-classes.ts +91 -0
- package/src/tickers/search/index.ts +62 -15
- package/src/tickers/search/ranking.ts +22 -3
- package/src/tickers/search/upsert.ts +4 -1
- package/src/time-series/live-bars.ts +8 -3
- package/src/time-series/resolve.ts +224 -17
- package/src/time-series/spec.ts +1 -0
- package/src/time-series/types.ts +9 -1
- package/src/types/config.ts +23 -1
- package/src/types/data-provider.ts +2 -0
- package/src/types/headless.ts +17 -0
- package/src/types/price-history.ts +2 -0
- package/src/ui/host.tsx +6 -0
- package/src/utils/double-escape-close.ts +20 -0
- package/src/utils/exchanges.ts +1 -0
- package/src/utils/html-entities.ts +15 -0
- package/src/utils/http-proxy-response.ts +44 -7
- package/src/utils/plugin-proxy-hosts.json +3 -0
- package/src/utils/price-history.ts +35 -1
- package/src/utils/sec.ts +21 -2
- package/src/utils/text-wrap.ts +13 -8
- package/src/utils/zoned-date-time.ts +67 -0
|
@@ -3,7 +3,7 @@ import { hasValidQuoteObservationTime } from "../market-data/quotes/freshness";
|
|
|
3
3
|
import { SnapshotHistoryUnavailableError } from "../market-data/snapshot-provider";
|
|
4
4
|
import { financialPeriodCoverage, financialPeriodCoverageWarnings, limitSeriesObservations } from "./financial-period-coverage";
|
|
5
5
|
import { HistoryCoverageError, historyCoverageNotice } from "../sources/history-coverage";
|
|
6
|
-
import { HISTORY_RETENTION_MAX_AGE_MS, canonicalHistoryInterval, isHistoryRetentionError, parseHistoryRecoveryCandidate, type HistoryRecoveryCandidate, type HistoryRetentionError } from "../sources/history-retention";
|
|
6
|
+
import { HISTORY_RETENTION_MAX_AGE_MS, canonicalHistoryInterval, historyRetentionNotice, isHistoryRetentionError, parseHistoryRecoveryCandidate, type HistoryRecoveryCandidate, type HistoryRetention, type HistoryRetentionError } from "../sources/history-retention";
|
|
7
7
|
import { getRouterEntityKey } from "../sources/provider-router/cache";
|
|
8
8
|
import { publicListingTarget } from "../sources/listing-target";
|
|
9
9
|
import { fetchHistoryResult } from "../sources/history-result";
|
|
@@ -72,10 +72,12 @@ import {
|
|
|
72
72
|
} from "./parsed-history-cache";
|
|
73
73
|
import {
|
|
74
74
|
canonicalExchange,
|
|
75
|
+
isUsListingExchange,
|
|
75
76
|
publicTickerKey,
|
|
76
77
|
resolveExchangeTimeZone,
|
|
77
78
|
} from "../utils/exchanges";
|
|
78
79
|
import { getPricePointTimestamp, isPriceHistoryStaleForCurrentWindow } from "../utils/price-history";
|
|
80
|
+
import { latestSessionStart, latestTradingSessionOpen, listingTimeZone, priorSessionClose } from "../market-data/market/trading-sessions";
|
|
79
81
|
import { futuresGenericCaption, futuresGenericListing, futuresGenericPriceBasis } from "../utils/futures-generic";
|
|
80
82
|
import { isOhlcSeriesStyle } from "./spec";
|
|
81
83
|
import type {
|
|
@@ -144,6 +146,7 @@ interface LiveTailRequest {
|
|
|
144
146
|
source: Extract<ChartSeriesSpec["source"], { kind: "security" }>;
|
|
145
147
|
resolution: ManualChartResolution;
|
|
146
148
|
accumulationKey: string;
|
|
149
|
+
historySession?: "extended";
|
|
147
150
|
}
|
|
148
151
|
|
|
149
152
|
/** Recent-window requests for the same history, shared by every chart asking at once. */
|
|
@@ -208,12 +211,16 @@ interface PriceHistoryRequest {
|
|
|
208
211
|
bounds: DateBounds;
|
|
209
212
|
visibleBounds: DateBounds;
|
|
210
213
|
explicitWindow: boolean;
|
|
214
|
+
/** Dates the chart was given, not a view the user panned or zoomed to. */
|
|
215
|
+
authoredWindow: boolean;
|
|
211
216
|
fallbackRange: TimeRange;
|
|
212
217
|
resolution: ManualChartResolution;
|
|
213
218
|
allowProviderDefaultFallback: boolean;
|
|
214
219
|
support: readonly ChartResolutionSupport[];
|
|
215
220
|
requiredWarmupPoints: number;
|
|
216
221
|
historyRequestKey?: string;
|
|
222
|
+
/** Ask for pre-market and after-hours bars. */
|
|
223
|
+
historySession?: "extended";
|
|
217
224
|
}
|
|
218
225
|
|
|
219
226
|
interface LoadedPriceHistory extends PriceHistoryResult {
|
|
@@ -222,10 +229,13 @@ interface LoadedPriceHistory extends PriceHistoryResult {
|
|
|
222
229
|
accumulationKey?: string | null;
|
|
223
230
|
recovery?: {
|
|
224
231
|
sourceKey: string;
|
|
232
|
+
/** First bar requested from the retained window. */
|
|
225
233
|
start: number;
|
|
226
234
|
end: number;
|
|
227
235
|
requiredWarmupPoints: number;
|
|
228
236
|
usableWarmupPoints: number;
|
|
237
|
+
/** The validated source evidence the recovery was requested with. */
|
|
238
|
+
retention: HistoryRetention;
|
|
229
239
|
};
|
|
230
240
|
}
|
|
231
241
|
|
|
@@ -545,6 +555,47 @@ function followLatestMarketObservation(
|
|
|
545
555
|
};
|
|
546
556
|
}
|
|
547
557
|
|
|
558
|
+
/**
|
|
559
|
+
* 1D shows the latest trading session of the chart's first market listing,
|
|
560
|
+
* from its open to the newest bar, with the close before it as a reference.
|
|
561
|
+
* Null keeps the rolling day: crypto, FX and venues without known hours.
|
|
562
|
+
* The reference is the quote's previous close when the quote is from the
|
|
563
|
+
* session shown, as the legend's change is; otherwise the last bar of the
|
|
564
|
+
* session before.
|
|
565
|
+
*/
|
|
566
|
+
function latestSessionView(
|
|
567
|
+
primary: ResolvedSeries | undefined,
|
|
568
|
+
marketSeries: readonly ResolvedSeries[],
|
|
569
|
+
extendedHours: boolean,
|
|
570
|
+
quoteReference: { close: number; time: number } | undefined,
|
|
571
|
+
): { bounds: DateBounds; priorClose: number | null } | null {
|
|
572
|
+
if (!primary?.listing) return null;
|
|
573
|
+
const bars = primary.points.flatMap((point) => {
|
|
574
|
+
const close = point.close ?? point.value;
|
|
575
|
+
const time = point.date.getTime();
|
|
576
|
+
return typeof close === "number" && Number.isFinite(close) && Number.isFinite(time) ? [{ time, close }] : [];
|
|
577
|
+
});
|
|
578
|
+
const latest = bars.at(-1)?.time;
|
|
579
|
+
if (latest === undefined) return null;
|
|
580
|
+
const { symbol, exchange } = primary.listing;
|
|
581
|
+
const open = latestSessionStart(symbol, exchange, latest, { extendedHours });
|
|
582
|
+
if (open === null) return null;
|
|
583
|
+
// The axis starts at the session's first bar, which a quiet pre-market can leave well after the open.
|
|
584
|
+
const start = bars.find((bar) => bar.time >= open)?.time ?? open;
|
|
585
|
+
// Another listing on the chart can trade later than the primary one.
|
|
586
|
+
let end = latest;
|
|
587
|
+
for (const entry of marketSeries) {
|
|
588
|
+
const last = entry.points.at(-1)?.date.getTime();
|
|
589
|
+
if (last !== undefined && Number.isFinite(last) && last > end) end = last;
|
|
590
|
+
}
|
|
591
|
+
const regularOpen = latestTradingSessionOpen(symbol, exchange, latest);
|
|
592
|
+
const quoteOpen = quoteReference ? latestTradingSessionOpen(symbol, exchange, quoteReference.time) : null;
|
|
593
|
+
const priorClose = quoteReference && regularOpen !== null && quoteOpen === regularOpen
|
|
594
|
+
? quoteReference.close
|
|
595
|
+
: priorSessionClose(bars, open, symbol, exchange);
|
|
596
|
+
return { bounds: { start, end }, priorClose };
|
|
597
|
+
}
|
|
598
|
+
|
|
548
599
|
function emptyFinancials(priceHistory: TickerFinancials["priceHistory"] = []): TickerFinancials {
|
|
549
600
|
return { annualStatements: [], quarterlyStatements: [], priceHistory };
|
|
550
601
|
}
|
|
@@ -762,7 +813,7 @@ function mergeHistory(
|
|
|
762
813
|
exchange?: string,
|
|
763
814
|
appendQuote = true,
|
|
764
815
|
assetCategory?: string,
|
|
765
|
-
live?: { bars: LiveBarAccumulator; since?: number; session?: HistorySession },
|
|
816
|
+
live?: { bars: LiveBarAccumulator; since?: number; session?: HistorySession; extendedHours?: boolean },
|
|
766
817
|
): TickerFinancials {
|
|
767
818
|
const base = financials ?? emptyFinancials();
|
|
768
819
|
const quote = latestQuote(base.quote, quoteOverride);
|
|
@@ -771,7 +822,8 @@ function mergeHistory(
|
|
|
771
822
|
// Market bars fold every observed quote into the forming bar; other series
|
|
772
823
|
// price their latest point from the current quote alone.
|
|
773
824
|
const priceHistory = live && liveBarResolution
|
|
774
|
-
? live.bars.apply(history, quote, { now, resolution: liveBarResolution, exchange, liveSince: live.since, session: live.session
|
|
825
|
+
? live.bars.apply(history, quote, { now, resolution: liveBarResolution, exchange, liveSince: live.since, session: live.session,
|
|
826
|
+
extendedHours: live.extendedHours })
|
|
775
827
|
: appendLiveQuotePoint(history, quote, liveBarResolution
|
|
776
828
|
? { now, mode: "ohlc", resolution: liveBarResolution, exchange }
|
|
777
829
|
: { now });
|
|
@@ -810,7 +862,8 @@ async function loadPriceHistory(
|
|
|
810
862
|
source: Extract<ChartSeriesSpec["source"], { kind: "security" }>,
|
|
811
863
|
request: PriceHistoryRequest,
|
|
812
864
|
): Promise<LoadedPriceHistory> {
|
|
813
|
-
const context = { ...requestContext(source), historyRequestKey: request.historyRequestKey
|
|
865
|
+
const context = { ...requestContext(source), historyRequestKey: request.historyRequestKey,
|
|
866
|
+
...(request.historySession ? { historySession: request.historySession } : {}) };
|
|
814
867
|
let coverageNotice: string | null = null;
|
|
815
868
|
let retentionError: HistoryRetentionError | null = null;
|
|
816
869
|
const observeFailure = (error: unknown) => {
|
|
@@ -868,7 +921,12 @@ async function loadPriceHistory(
|
|
|
868
921
|
const start = Math.ceil(candidate.retention.availableStart / step) * step + step;
|
|
869
922
|
const end = candidate.retention.requestedEnd;
|
|
870
923
|
const visibleEnd = request.visibleBounds.end === null ? end : Math.floor(request.visibleBounds.end / 1000) * 1000;
|
|
871
|
-
|
|
924
|
+
// At an interval the user chose, a preset range or a panned or zoomed
|
|
925
|
+
// view that reaches back past the retained bars, but still reaches them,
|
|
926
|
+
// charts what the source keeps. Auto steps to coarser bars below instead,
|
|
927
|
+
// and authored dates keep failing.
|
|
928
|
+
const retainedOnly = !request.allowProviderDefaultFallback && !request.authoredWindow && visibleEnd >= start;
|
|
929
|
+
if ((retainedOnly || request.visibleBounds.start >= start) && visibleEnd <= end && start < end) {
|
|
872
930
|
recoveryAttempted = true;
|
|
873
931
|
try {
|
|
874
932
|
const result = (await fetchHistoryResult(provider, source.instrument.symbol, source.instrument.exchange ?? "",
|
|
@@ -877,7 +935,7 @@ async function loadPriceHistory(
|
|
|
877
935
|
observeCoverage(result);
|
|
878
936
|
if (accepted(points)) return { ...result, expiresAt: retryAt,
|
|
879
937
|
recovery: { sourceKey: candidate.sourceKey, start, end, requiredWarmupPoints: request.requiredWarmupPoints,
|
|
880
|
-
usableWarmupPoints: retainedWarmup(points, request.visibleBounds.start) } };
|
|
938
|
+
usableWarmupPoints: retainedWarmup(points, request.visibleBounds.start), retention: candidate.retention } };
|
|
881
939
|
} catch (error) { observeFailure(error); }
|
|
882
940
|
}
|
|
883
941
|
}
|
|
@@ -1209,11 +1267,106 @@ function applyStudyPresentationTransforms(
|
|
|
1209
1267
|
});
|
|
1210
1268
|
}
|
|
1211
1269
|
|
|
1270
|
+
/** Fewer daily or coarser bars than this make a line or two, not a chart. */
|
|
1271
|
+
const SHORT_HISTORY_MAX_BARS = 20;
|
|
1272
|
+
|
|
1273
|
+
/**
|
|
1274
|
+
* Auto on a preset range of market series alone, at no authored period and
|
|
1275
|
+
* untouched by pan or zoom: the chart that can fall back to the range a young
|
|
1276
|
+
* listing has traded.
|
|
1277
|
+
*/
|
|
1278
|
+
function canFitShortHistory(spec: ChartSpec, options: ChartResolveOptions): boolean {
|
|
1279
|
+
const visible = spec.series.filter((entry) => entry.visible !== false);
|
|
1280
|
+
return spec.viewport.resolution === "auto" && spec.viewport.range !== "1D" && !explicitBounds(spec)
|
|
1281
|
+
&& spec.viewport.maxPoints === undefined && !runtimeAutoBounds(options) && !runtimeRequestBounds(options)
|
|
1282
|
+
&& visible.length > 0 && visible.every((entry) => entry.source.kind === "security" && isMarketFieldId(entry.source.fieldId)
|
|
1283
|
+
&& (entry.source.period ?? "auto") === "auto");
|
|
1284
|
+
}
|
|
1285
|
+
|
|
1286
|
+
function visibleMarketBars(result: ChartResolutionResult): { count: number; first: number } {
|
|
1287
|
+
let count = 0;
|
|
1288
|
+
let first = Number.POSITIVE_INFINITY;
|
|
1289
|
+
for (const series of result.series) {
|
|
1290
|
+
if (series.observationKind !== "market") continue;
|
|
1291
|
+
let bars = 0;
|
|
1292
|
+
for (const point of series.points) {
|
|
1293
|
+
const time = point.date.getTime();
|
|
1294
|
+
if (point.value === null || !Number.isFinite(point.value) || !Number.isFinite(time)) continue;
|
|
1295
|
+
bars += 1;
|
|
1296
|
+
first = Math.min(first, time);
|
|
1297
|
+
}
|
|
1298
|
+
count = Math.max(count, bars);
|
|
1299
|
+
}
|
|
1300
|
+
return { count, first };
|
|
1301
|
+
}
|
|
1302
|
+
|
|
1303
|
+
/** The earliest plotted observation of any series, or +Infinity. */
|
|
1304
|
+
function firstObservationTime(series: readonly ResolvedSeries[]): number {
|
|
1305
|
+
let first = Number.POSITIVE_INFINITY;
|
|
1306
|
+
for (const entry of series) {
|
|
1307
|
+
for (const point of entry.points) {
|
|
1308
|
+
const time = point.date.getTime();
|
|
1309
|
+
if (point.value !== null && Number.isFinite(point.value) && Number.isFinite(time) && time < first) first = time;
|
|
1310
|
+
}
|
|
1311
|
+
}
|
|
1312
|
+
return first;
|
|
1313
|
+
}
|
|
1314
|
+
|
|
1315
|
+
/** The shortest preset range that holds an observation at `first`. */
|
|
1316
|
+
function coveringRange(first: number, now: Date): TimeRange | null {
|
|
1317
|
+
return TIME_RANGES.find((range) => range !== "ALL" && subtractTimeRange(now, range).getTime() <= first) ?? null;
|
|
1318
|
+
}
|
|
1319
|
+
|
|
1212
1320
|
export async function resolveChartSpecData(
|
|
1213
1321
|
spec: ChartSpec,
|
|
1214
1322
|
sources: ChartResolveSources,
|
|
1215
1323
|
cache = new ChartResolveCache(),
|
|
1216
1324
|
options: ChartResolveOptions = {},
|
|
1325
|
+
): Promise<ChartResolutionResult> {
|
|
1326
|
+
if (!canFitShortHistory(spec, options)) return resolveChartSpecPass(spec, sources, cache, options);
|
|
1327
|
+
// Captured inputs belong to the chart that is returned.
|
|
1328
|
+
type Capture = Parameters<NonNullable<ChartResolveSources["onSecurityData"]>>;
|
|
1329
|
+
const capturing = (captured: Capture[]): ChartResolveSources => sources.onSecurityData
|
|
1330
|
+
? { ...sources, onSecurityData: (...args) => { captured.push(args); } } : sources;
|
|
1331
|
+
const now = sources.now ?? new Date();
|
|
1332
|
+
let captured: Capture[] = [];
|
|
1333
|
+
let shownSpec = spec;
|
|
1334
|
+
let result = await resolveChartSpecPass(spec, capturing(captured), cache, options);
|
|
1335
|
+
// A listing younger than the range has a bar or two at weekly or monthly
|
|
1336
|
+
// size. When its sources serve finer bars, Auto charts the shortest range
|
|
1337
|
+
// that holds them all, at that range's interval. Coarse bars are dated at
|
|
1338
|
+
// their period's start, so the finer bars can place the first trade in a
|
|
1339
|
+
// shorter range still.
|
|
1340
|
+
const coarse = !!result.resolution && !isIntradayResolution(result.resolution)
|
|
1341
|
+
&& !!result.resolutionSupport?.some((entry) => isIntradayResolution(entry.resolution));
|
|
1342
|
+
let shown = coarse ? visibleMarketBars(result) : { count: 0, first: Number.POSITIVE_INFINITY };
|
|
1343
|
+
let range = shown.count > 0 && shown.count < SHORT_HISTORY_MAX_BARS ? coveringRange(shown.first, now) : null;
|
|
1344
|
+
while (range && TIME_RANGES.indexOf(range) < TIME_RANGES.indexOf(shownSpec.viewport.range)) {
|
|
1345
|
+
const liveTails = cache.liveTails;
|
|
1346
|
+
const narrowedCaptured: Capture[] = [];
|
|
1347
|
+
const narrowedSpec = { ...shownSpec, viewport: { ...shownSpec.viewport, range } };
|
|
1348
|
+
const narrowed = await resolveChartSpecPass(narrowedSpec, capturing(narrowedCaptured), cache, options);
|
|
1349
|
+
const bars = visibleMarketBars(narrowed);
|
|
1350
|
+
if (bars.count <= shown.count) {
|
|
1351
|
+
cache.liveTails = liveTails;
|
|
1352
|
+
break;
|
|
1353
|
+
}
|
|
1354
|
+
[shownSpec, result, shown, captured] = [narrowedSpec, narrowed, bars, narrowedCaptured];
|
|
1355
|
+
range = coveringRange(bars.first, now);
|
|
1356
|
+
}
|
|
1357
|
+
// The axis opens at the first trade, as ALL does, not at an empty week.
|
|
1358
|
+
if (shownSpec !== spec && result.viewport && shown.first > result.viewport.start.getTime()) {
|
|
1359
|
+
result = { ...result, viewport: { start: new Date(shown.first), end: result.viewport.end } };
|
|
1360
|
+
}
|
|
1361
|
+
for (const args of captured) sources.onSecurityData?.(...args);
|
|
1362
|
+
return result;
|
|
1363
|
+
}
|
|
1364
|
+
|
|
1365
|
+
async function resolveChartSpecPass(
|
|
1366
|
+
spec: ChartSpec,
|
|
1367
|
+
sources: ChartResolveSources,
|
|
1368
|
+
cache: ChartResolveCache,
|
|
1369
|
+
options: ChartResolveOptions,
|
|
1217
1370
|
): Promise<ChartResolutionResult> {
|
|
1218
1371
|
const errors: string[] = [];
|
|
1219
1372
|
const warnings: string[] = spec.series.some((entry) => entry.visible !== false
|
|
@@ -1411,9 +1564,17 @@ export async function resolveChartSpecData(
|
|
|
1411
1564
|
requestVisibleBounds,
|
|
1412
1565
|
initialResolution,
|
|
1413
1566
|
);
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1567
|
+
// A view the user panned or zoomed to, as opposed to authored dates.
|
|
1568
|
+
const movedWindow = requestBounds !== null && !sameBounds(requestBounds, initialVisibleBounds);
|
|
1569
|
+
const hasExplicitWindow = explicitBounds(spec) !== null || movedWindow;
|
|
1570
|
+
|
|
1571
|
+
// Only US listings trade before and after the regular session; asking elsewhere costs a request for nothing.
|
|
1572
|
+
const extendedHoursFor = (source: Extract<ChartSeriesSpec["source"], { kind: "security" }>, resolution: ManualChartResolution) => (
|
|
1573
|
+
spec.viewport.extendedHours === true && isMarketFieldId(source.fieldId) && isIntradayResolution(resolution)
|
|
1574
|
+
&& !source.instrument.instrument && isUsListingExchange(source.instrument.exchange)
|
|
1575
|
+
);
|
|
1576
|
+
// A history starts after the visible window because its source keeps no more.
|
|
1577
|
+
let retainedHistoryOnly = false;
|
|
1417
1578
|
const loadHistory = async (
|
|
1418
1579
|
source: Extract<ChartSeriesSpec["source"], { kind: "security" }>,
|
|
1419
1580
|
all = false,
|
|
@@ -1432,21 +1593,26 @@ export async function resolveChartSpecData(
|
|
|
1432
1593
|
bounds: historyBounds,
|
|
1433
1594
|
visibleBounds: requestVisibleBounds,
|
|
1434
1595
|
explicitWindow: hasExplicitWindow,
|
|
1596
|
+
authoredWindow: hasExplicitWindow && !movedWindow,
|
|
1435
1597
|
fallbackRange,
|
|
1436
1598
|
resolution: initialResolution,
|
|
1437
1599
|
allowProviderDefaultFallback: spec.viewport.resolution === "auto",
|
|
1438
1600
|
support,
|
|
1439
1601
|
requiredWarmupPoints: maxStudyWarmupPoints(spec.studies),
|
|
1602
|
+
...(extendedHoursFor(source, initialResolution) ? { historySession: "extended" as const } : {}),
|
|
1440
1603
|
};
|
|
1441
1604
|
const key = [
|
|
1442
1605
|
instrumentKey(source),
|
|
1443
1606
|
request.resolution,
|
|
1607
|
+
...(request.historySession ? [request.historySession] : []),
|
|
1444
1608
|
request.fallbackRange,
|
|
1445
1609
|
request.allowProviderDefaultFallback ? "auto" : "manual",
|
|
1446
1610
|
isMarketFieldId(source.fieldId) ? source.period ?? "auto" : "auto",
|
|
1447
1611
|
...(request.explicitWindow
|
|
1448
1612
|
? [request.bounds.start ?? "open", request.bounds.end ?? "open"]
|
|
1449
1613
|
: []),
|
|
1614
|
+
// A moved view can chart retained bars that the same authored dates cannot.
|
|
1615
|
+
...(request.explicitWindow && !request.authoredWindow && !request.allowProviderDefaultFallback ? ["moved"] : []),
|
|
1450
1616
|
].join("|");
|
|
1451
1617
|
request.historyRequestKey = key;
|
|
1452
1618
|
const expiresAt = cache.priceHistoryExpiryByRequest.get(key);
|
|
@@ -1505,9 +1671,16 @@ export async function resolveChartSpecData(
|
|
|
1505
1671
|
const history = loaded.points;
|
|
1506
1672
|
const coverageNotice = historyCoverageNotice(loaded.coverageStart, request.visibleBounds.start);
|
|
1507
1673
|
if (coverageNotice) priorityWarnings.push(coverageNotice);
|
|
1674
|
+
// Read per request: one recovered window answers every visible window that shares its acquisition.
|
|
1675
|
+
if (loaded.recovery && request.visibleBounds.start !== null && request.visibleBounds.start < loaded.recovery.start) {
|
|
1676
|
+
priorityWarnings.push(historyRetentionNotice(loaded.recovery.retention, loaded.resolution ?? request.resolution,
|
|
1677
|
+
listingTimeZone(source.instrument.symbol, source.instrument.exchange)));
|
|
1678
|
+
retainedHistoryOnly = true;
|
|
1679
|
+
}
|
|
1508
1680
|
// Only proven equal cadences can share an accumulated observation window.
|
|
1509
1681
|
// An opaque default result stays attached to its original acquisition.
|
|
1510
|
-
const accumulationKey = loaded.resolution === null ? null
|
|
1682
|
+
const accumulationKey = loaded.resolution === null ? null
|
|
1683
|
+
: `${instrumentKey(source)}|${loaded.resolution}|${loaded.extendedHours ? "extended|" : ""}${priceHistoryAcquisitionIdentity(loaded)}`;
|
|
1511
1684
|
const previous = accumulationKey ? cache.accumulatedPriceHistory.get(accumulationKey) : undefined;
|
|
1512
1685
|
const previousHistory = previous?.points ?? [];
|
|
1513
1686
|
if (
|
|
@@ -1540,7 +1713,8 @@ export async function resolveChartSpecData(
|
|
|
1540
1713
|
const accumulated = combined.points;
|
|
1541
1714
|
if (accumulationKey && loaded.resolution && isIntradayResolution(loaded.resolution)
|
|
1542
1715
|
&& isMarketFieldId(source.fieldId) && currentWindow()) {
|
|
1543
|
-
liveTails.set(key, { source, resolution: loaded.resolution, accumulationKey
|
|
1716
|
+
liveTails.set(key, { source, resolution: loaded.resolution, accumulationKey,
|
|
1717
|
+
...(request.historySession && loaded.extendedHours ? { historySession: request.historySession } : {}) });
|
|
1544
1718
|
}
|
|
1545
1719
|
return { ...combined, requestKey: key, accumulationKey,
|
|
1546
1720
|
...(loaded.recovery ? { recovery: { ...loaded.recovery,
|
|
@@ -1561,6 +1735,10 @@ export async function resolveChartSpecData(
|
|
|
1561
1735
|
return pending;
|
|
1562
1736
|
};
|
|
1563
1737
|
|
|
1738
|
+
// The previous close each listing's quote measures its move from, and when it was quoted.
|
|
1739
|
+
const quoteReferences = new Map<string, { close: number; time: number }>();
|
|
1740
|
+
// Series whose history came with the pre-market and after-hours bars asked for.
|
|
1741
|
+
const extendedHistories = new Set<string>();
|
|
1564
1742
|
const realizedVolInputs = new Set(spec.studies.filter((study) => study.kind === "realized-vol" && study.visible !== false)
|
|
1565
1743
|
.flatMap((study) => study.inputSeriesIds));
|
|
1566
1744
|
const historicalPriceSeries = new Map<string, ResolvedSeries>();
|
|
@@ -1634,6 +1812,10 @@ export async function resolveChartSpecData(
|
|
|
1634
1812
|
]);
|
|
1635
1813
|
resolvedSource = sourceWithResolvedExchange(source, financials);
|
|
1636
1814
|
}
|
|
1815
|
+
if (history?.extendedHours) extendedHistories.add(seriesSpec.id);
|
|
1816
|
+
else if (history && marketField && seriesSpec.visible !== false && extendedHoursFor(resolvedSource, initialResolution)) {
|
|
1817
|
+
warnings.push(`${instrumentLabel(resolvedSource)}: pre-market and after-hours bars are unavailable; the chart shows the regular session.`);
|
|
1818
|
+
}
|
|
1637
1819
|
if (forwardPE && financials?.epsEstimates && !history) {
|
|
1638
1820
|
history = await loadHistory(resolvedSource, true).catch((error: unknown) => {
|
|
1639
1821
|
warnings.push(`${seriesSpec.label ?? seriesSpec.id}: ${error instanceof Error ? error.message : String(error)}`);
|
|
@@ -1675,7 +1857,8 @@ export async function resolveChartSpecData(
|
|
|
1675
1857
|
liveBarResolution ?? undefined, resolvedSource.instrument.exchange,
|
|
1676
1858
|
liveBarResolution != null && !comparedSeriesIds.has(seriesSpec.id), resolvedSource.instrument.instrument?.secType,
|
|
1677
1859
|
marketField && history.accumulationKey
|
|
1678
|
-
? { bars: cache.liveBarsFor(history.accumulationKey), since: sources.liveSince, session: history.session
|
|
1860
|
+
? { bars: cache.liveBarsFor(history.accumulationKey), since: sources.liveSince, session: history.session,
|
|
1861
|
+
extendedHours: history.extendedHours === true }
|
|
1679
1862
|
: undefined),
|
|
1680
1863
|
priceHistoryResolution: history.resolution, priceHistoryRequestKey: history.requestKey,
|
|
1681
1864
|
priceHistorySession: history.session, priceHistorySourceKey: history.sourceKey };
|
|
@@ -1697,6 +1880,13 @@ export async function resolveChartSpecData(
|
|
|
1697
1880
|
quoteMetadata,
|
|
1698
1881
|
);
|
|
1699
1882
|
if (!result) throw new Error(`Unknown field ${source.fieldId}.`);
|
|
1883
|
+
const reference = merged.quote;
|
|
1884
|
+
// A rolled generic's previous session can be another contract; its bars carry the roll.
|
|
1885
|
+
if (marketField && reference && hasValidQuoteObservationTime(reference) && reference.previousClose !== undefined
|
|
1886
|
+
&& Number.isFinite(reference.previousClose) && reference.previousClose > 0
|
|
1887
|
+
&& !futuresGenericListing(resolvedSource.instrument.symbol, resolvedSource.instrument.exchange)) {
|
|
1888
|
+
quoteReferences.set(seriesSpec.id, { close: reference.previousClose, time: reference.lastUpdated });
|
|
1889
|
+
}
|
|
1700
1890
|
if (realizedVolInputs.has(seriesSpec.id)) {
|
|
1701
1891
|
const historicalResult = baseSecuritySeries(resolvedSpec, historical, index, history?.resolution, quoteMetadata);
|
|
1702
1892
|
if (historicalResult) historicalPriceSeries.set(seriesSpec.id, historicalResult);
|
|
@@ -1730,9 +1920,20 @@ export async function resolveChartSpecData(
|
|
|
1730
1920
|
// asynchronously can be timestamped just after that reference, so advance an
|
|
1731
1921
|
// untouched market viewport by the same amount instead of clipping its tail.
|
|
1732
1922
|
// Explicit and user-created windows stay fixed through hasExplicitWindow.
|
|
1923
|
+
const primaryRaw = primaryMarketSeries ? rawSeries.find((entry) => entry.id === primaryMarketSeries.id) : undefined;
|
|
1924
|
+
// A panned day keeps its reference line; an authored date window has no latest session.
|
|
1925
|
+
const sessionView = spec.viewport.range === "1D" && !explicitBounds(spec)
|
|
1926
|
+
? latestSessionView(primaryRaw, rawSeries.filter((entry) => entry.observationKind === "market"),
|
|
1927
|
+
extendedHistories.has(primaryRaw?.id ?? ""), quoteReferences.get(primaryRaw?.id ?? ""))
|
|
1928
|
+
: null;
|
|
1733
1929
|
const bounds = hasExplicitWindow
|
|
1734
1930
|
? requestVisibleBounds
|
|
1735
|
-
: followLatestMarketObservation(initialVisibleBounds, rawSeries);
|
|
1931
|
+
: sessionView?.bounds ?? followLatestMarketObservation(initialVisibleBounds, rawSeries);
|
|
1932
|
+
if (sessionView?.priorClose != null && primaryRaw?.transform === "raw"
|
|
1933
|
+
&& primaryRaw.unitGroup.startsWith("price") && primaryRaw.unitGroup !== "price:unknown") {
|
|
1934
|
+
const index = rawSeries.indexOf(primaryRaw);
|
|
1935
|
+
rawSeries[index] = { ...primaryRaw, priorClose: sessionView.priorClose };
|
|
1936
|
+
}
|
|
1736
1937
|
const servedCadences = new Set(rawSeries.filter((entry) => entry.observationKind === "market" && entry.points.length > 0)
|
|
1737
1938
|
.map((entry) => entry.historyResolution));
|
|
1738
1939
|
const commonCadence = servedCadences.size === 1 ? [...servedCadences][0] : undefined;
|
|
@@ -1836,9 +2037,15 @@ export async function resolveChartSpecData(
|
|
|
1836
2037
|
|
|
1837
2038
|
cache.liveTails = liveTails;
|
|
1838
2039
|
const exposeViewport = hasExplicitWindow || spec.viewport.maxPoints === undefined;
|
|
1839
|
-
|
|
2040
|
+
let viewport = exposeViewport && displayBounds.start !== null && displayBounds.end !== null
|
|
1840
2041
|
? { start: new Date(displayBounds.start), end: new Date(displayBounds.end) }
|
|
1841
2042
|
: undefined;
|
|
2043
|
+
// The axis opens at the first retained bar, as a young listing's does, not
|
|
2044
|
+
// at an empty stretch the source no longer keeps.
|
|
2045
|
+
if (viewport && retainedHistoryOnly && !hasExplicitWindow) {
|
|
2046
|
+
const first = firstObservationTime(resolved);
|
|
2047
|
+
if (first > viewport.start.getTime() && first <= viewport.end.getTime()) viewport = { start: new Date(first), end: viewport.end };
|
|
2048
|
+
}
|
|
1842
2049
|
return {
|
|
1843
2050
|
series: resolved,
|
|
1844
2051
|
...(priceHistoryIntegrity.length ? { priceHistoryIntegrity } : {}),
|
|
@@ -1911,9 +2118,9 @@ export function reconcileChartTail(
|
|
|
1911
2118
|
const start = Math.floor((latest - step) / step) * step;
|
|
1912
2119
|
const end = Math.ceil(now / 60_000) * 60_000;
|
|
1913
2120
|
const { symbol, exchange } = tail.source.instrument;
|
|
1914
|
-
const context = requestContext(tail.source);
|
|
2121
|
+
const context = { ...requestContext(tail.source), ...(tail.historySession ? { historySession: tail.historySession } : {}) };
|
|
1915
2122
|
const requestKey = JSON.stringify([symbol, exchange ?? "", context.brokerId ?? null,
|
|
1916
|
-
context.brokerInstanceId ?? null, context.instrument ?? null, tail.resolution, start, end]);
|
|
2123
|
+
context.brokerInstanceId ?? null, context.instrument ?? null, tail.resolution, start, end, tail.historySession ?? null]);
|
|
1917
2124
|
const shared = tailRequestsInFlight.get(provider) ?? new Map<string, Promise<PriceHistoryResult | null>>();
|
|
1918
2125
|
tailRequestsInFlight.set(provider, shared);
|
|
1919
2126
|
let request = shared.get(requestKey);
|
|
@@ -1928,7 +2135,7 @@ export function reconcileChartTail(
|
|
|
1928
2135
|
request = fetched;
|
|
1929
2136
|
}
|
|
1930
2137
|
const result = await request;
|
|
1931
|
-
if (!result || result.resolution !== loaded.resolution
|
|
2138
|
+
if (!result || result.resolution !== loaded.resolution || !!result.extendedHours !== !!loaded.extendedHours
|
|
1932
2139
|
|| priceHistoryAcquisitionIdentity(result) !== priceHistoryAcquisitionIdentity(loaded)) return false;
|
|
1933
2140
|
const points = result.points.filter((point) => {
|
|
1934
2141
|
const time = getPricePointTimestamp(point);
|
package/src/time-series/spec.ts
CHANGED
|
@@ -320,6 +320,7 @@ export function normalizeChartSpec(value: unknown, fallback: ChartSpec = DEFAULT
|
|
|
320
320
|
&& viewport.maxPoints > 0
|
|
321
321
|
? Math.min(10_000, Math.floor(viewport.maxPoints))
|
|
322
322
|
: undefined,
|
|
323
|
+
...(viewport?.extendedHours === true ? { extendedHours: true } : {}),
|
|
323
324
|
},
|
|
324
325
|
panels,
|
|
325
326
|
series,
|
package/src/time-series/types.ts
CHANGED
|
@@ -5,7 +5,11 @@ import type { InstrumentRef } from "../market-data/request-types";
|
|
|
5
5
|
export const CHART_SPEC_VERSION = 2 as const;
|
|
6
6
|
|
|
7
7
|
export type SeriesPeriod = "auto" | "daily" | "weekly" | "monthly" | "quarterly" | "annual" | "ttm";
|
|
8
|
-
|
|
8
|
+
/**
|
|
9
|
+
* "band" draws a line through each point's value inside a shaded range from
|
|
10
|
+
* its `low` to its `high`: an average within its historical range.
|
|
11
|
+
*/
|
|
12
|
+
export type SeriesStyle = "line" | "area" | "step" | "columns" | "points" | "candles" | "ohlc" | "hlc" | "band";
|
|
9
13
|
export type SeriesTransform = "raw" | "percent" | "index100" | "yoy" | "qoq" | "log";
|
|
10
14
|
export type SeriesAxis = "auto" | "left" | "right";
|
|
11
15
|
export type SeriesInterpolation = "none" | "step-after";
|
|
@@ -88,6 +92,8 @@ export interface ChartViewportSpec {
|
|
|
88
92
|
dateWindow?: { start: string; end: string };
|
|
89
93
|
/** Optional latest-observation cap, useful for period-based financial views. */
|
|
90
94
|
maxPoints?: number;
|
|
95
|
+
/** Intraday market history includes pre-market and after-hours bars where the venue has them. */
|
|
96
|
+
extendedHours?: boolean;
|
|
91
97
|
}
|
|
92
98
|
|
|
93
99
|
export interface ChartSpec {
|
|
@@ -176,6 +182,8 @@ export interface ResolvedSeries {
|
|
|
176
182
|
observationKind?: "market";
|
|
177
183
|
/** Regular-session move supplied with the latest market quote. */
|
|
178
184
|
latestChangePercent?: number;
|
|
185
|
+
/** The previous session's close, set on a one-day chart's price series and drawn as its reference line. */
|
|
186
|
+
priorClose?: number;
|
|
179
187
|
points: TimeSeriesPoint[];
|
|
180
188
|
/** Rejected valuation price inputs, retained independently of usable observations. */
|
|
181
189
|
valuationPriceIssues?: import("./valuation-price").ValuationPriceIssue[];
|
package/src/types/config.ts
CHANGED
|
@@ -199,6 +199,18 @@ export interface TelemetryConfig {
|
|
|
199
199
|
* both off; absent means on.
|
|
200
200
|
*/
|
|
201
201
|
usage?: boolean;
|
|
202
|
+
/** Ticker-level research counts. Only an explicit true opts in; absent is OFF. */
|
|
203
|
+
attention?: boolean;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* One recent command-bar run: `id` is `pane-template:<templateId>`, `label`
|
|
208
|
+
* its name when it ran, and `arg` a ticker it ran with (never free text).
|
|
209
|
+
*/
|
|
210
|
+
export interface RecentCommand {
|
|
211
|
+
id: string;
|
|
212
|
+
label: string;
|
|
213
|
+
arg?: string;
|
|
202
214
|
}
|
|
203
215
|
|
|
204
216
|
export interface AppConfig {
|
|
@@ -232,6 +244,8 @@ export interface AppConfig {
|
|
|
232
244
|
valueFlashingEnabled: boolean;
|
|
233
245
|
fontSize: number;
|
|
234
246
|
recentTickers: string[];
|
|
247
|
+
/** Pane templates recently run from the command bar, newest first. */
|
|
248
|
+
recentCommands: RecentCommand[];
|
|
235
249
|
language?: LanguagePreference;
|
|
236
250
|
onboardingComplete?: boolean;
|
|
237
251
|
/** App version at the last launch, used to show release notes after an update. */
|
|
@@ -252,6 +266,9 @@ export function normalizePaneId(paneId: string): string {
|
|
|
252
266
|
if (paneId === "comparison-chart" || paneId === "ticker-chart" || paneId === "fundamental-graph") {
|
|
253
267
|
return CHART_COMPOSER_PANE_ID;
|
|
254
268
|
}
|
|
269
|
+
// Thematic baskets became the Themes tab of Sector Performance; the saved
|
|
270
|
+
// theme param and pane state open that tab where the pane left off.
|
|
271
|
+
if (paneId === "themes") return "sectors";
|
|
255
272
|
return paneId;
|
|
256
273
|
}
|
|
257
274
|
|
|
@@ -270,6 +287,7 @@ const TICKER_PANE_IDS = new Set([
|
|
|
270
287
|
"corporate-actions",
|
|
271
288
|
"earnings-estimates",
|
|
272
289
|
"historical-prices",
|
|
290
|
+
"returns",
|
|
273
291
|
"ibkr-trading",
|
|
274
292
|
]);
|
|
275
293
|
|
|
@@ -307,9 +325,12 @@ const DEFAULT_HOME_LAYOUT: LayoutConfig = {
|
|
|
307
325
|
first: { kind: "pane", instanceId: "portfolio-list:main" },
|
|
308
326
|
second: { kind: "pane", instanceId: "chat:main" },
|
|
309
327
|
},
|
|
310
|
-
second: { kind: "
|
|
328
|
+
second: { kind: "split", axis: "vertical", ratio: 0.76,
|
|
329
|
+
first: { kind: "pane", instanceId: "ticker-detail:main" },
|
|
330
|
+
second: { kind: "pane", instanceId: "attention-trending:home" } },
|
|
311
331
|
},
|
|
312
332
|
instances: [
|
|
333
|
+
{ instanceId: "attention-trending:home", paneId: "attention-trending", binding: { kind: "none" } },
|
|
313
334
|
{
|
|
314
335
|
instanceId: "portfolio-list:main",
|
|
315
336
|
paneId: "portfolio-list",
|
|
@@ -882,6 +903,7 @@ export function createDefaultConfig(dataDir: string): AppConfig {
|
|
|
882
903
|
valueFlashingEnabled: true,
|
|
883
904
|
fontSize: 12,
|
|
884
905
|
recentTickers: [],
|
|
906
|
+
recentCommands: [],
|
|
885
907
|
};
|
|
886
908
|
}
|
|
887
909
|
|
|
@@ -114,6 +114,8 @@ export interface MarketDataRequestContext {
|
|
|
114
114
|
historyRecovery?: import("../sources/history-retention").HistoryRecoveryCandidate;
|
|
115
115
|
/** Stable acquisition identity for capture/replay of opaque history responses. */
|
|
116
116
|
historyRequestKey?: string;
|
|
117
|
+
/** Intraday history should include pre-market and after-hours bars where the source has them. */
|
|
118
|
+
historySession?: "extended";
|
|
117
119
|
}
|
|
118
120
|
|
|
119
121
|
export interface CachedFinancialsTarget {
|
package/src/types/headless.ts
CHANGED
|
@@ -72,6 +72,8 @@ export interface HeadlessPaneContext {
|
|
|
72
72
|
capabilities?: CapabilityInvoker;
|
|
73
73
|
/** Read one local portfolio without passing holdings through a remote endpoint. */
|
|
74
74
|
resolvePortfolio?: (id: string) => Promise<{ portfolio: import("./ticker").Portfolio; tickers: import("./ticker").TickerRecord[] } | null>;
|
|
75
|
+
/** Read locally remembered watchlist membership. */
|
|
76
|
+
resolveWatchlist?: (id: string) => Promise<import("./ticker").TickerRecord[] | null>;
|
|
75
77
|
/** Resolve locally remembered exchange identities without coupling plugins to storage. */
|
|
76
78
|
resolveInstrument?: (symbol: string) => Promise<{ symbol: string; exchange?: string }>;
|
|
77
79
|
}
|
|
@@ -175,6 +177,12 @@ export interface HeadlessPaneDefinition<Shape extends HeadlessPaneShape = Headle
|
|
|
175
177
|
limitations?: string[];
|
|
176
178
|
screenshotReadiness?: "ready" | "partial" | "live-dom" | "unsupported";
|
|
177
179
|
};
|
|
180
|
+
/**
|
|
181
|
+
* What a report returns, in a sentence, for readers that only ever see the
|
|
182
|
+
* function as a data source, such as Ask Gloom. The template's description
|
|
183
|
+
* says what opening the pane does and is used when this is absent.
|
|
184
|
+
*/
|
|
185
|
+
description?: string;
|
|
178
186
|
argument: HeadlessPaneArgumentDef;
|
|
179
187
|
options: HeadlessPaneOptionDef[];
|
|
180
188
|
columns?: HeadlessPaneColumn[];
|
|
@@ -183,6 +191,15 @@ export interface HeadlessPaneDefinition<Shape extends HeadlessPaneShape = Headle
|
|
|
183
191
|
args: HeadlessPaneLoadArgs,
|
|
184
192
|
ctx: HeadlessPaneContext,
|
|
185
193
|
): HeadlessPaneResultByShape[Shape] | Promise<HeadlessPaneResultByShape[Shape]>;
|
|
194
|
+
/**
|
|
195
|
+
* A smaller form of a loaded result for readers with a tight size budget,
|
|
196
|
+
* such as Ask Gloom: only what `args` asked for, without full-precision
|
|
197
|
+
* metadata. Reports, screenshots and panes always use the full result.
|
|
198
|
+
*/
|
|
199
|
+
compact?(
|
|
200
|
+
result: HeadlessPaneResultByShape[Shape],
|
|
201
|
+
args: HeadlessPaneLoadArgs,
|
|
202
|
+
): HeadlessPaneResultByShape[Shape];
|
|
186
203
|
}
|
|
187
204
|
|
|
188
205
|
export type HeadlessPaneResult = HeadlessPaneResultByShape[HeadlessPaneShape];
|
|
@@ -26,4 +26,6 @@ export interface PriceHistoryResult {
|
|
|
26
26
|
sourceKey?: string;
|
|
27
27
|
/** First date (YYYY-MM-DD) the source vouches for; it excluded earlier prices. */
|
|
28
28
|
coverageStart?: string;
|
|
29
|
+
/** The source served the pre-market and after-hours bars the request asked for. */
|
|
30
|
+
extendedHours?: boolean;
|
|
29
31
|
}
|
package/src/ui/host.tsx
CHANGED
|
@@ -73,9 +73,15 @@ export interface ChartVectorShape {
|
|
|
73
73
|
color: string;
|
|
74
74
|
/** Closes the shape into a filled box, for range and area selections. */
|
|
75
75
|
box?: boolean;
|
|
76
|
+
/** Closes the points into a filled polygon, such as a flow ribbon, with no outline. */
|
|
77
|
+
fill?: boolean;
|
|
76
78
|
fillOpacity?: number;
|
|
77
79
|
strokeWidth?: number;
|
|
78
80
|
handles?: boolean;
|
|
81
|
+
/** Paints the fill or line left to right through these colours instead of `color`. */
|
|
82
|
+
gradient?: readonly string[];
|
|
83
|
+
/** Opacity of the whole shape, so others can recede behind a highlighted one. */
|
|
84
|
+
opacity?: number;
|
|
79
85
|
}
|
|
80
86
|
|
|
81
87
|
interface TextEditBuffer {
|
|
@@ -34,6 +34,26 @@ export function takeDoubleEscapeClose(
|
|
|
34
34
|
return matched;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
+
const escapeArmOffers = new WeakMap<object, () => void>();
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Leaving an empty text field is the one Esc a pane uses that still counts as
|
|
41
|
+
* the first half of a close, so Esc Esc from an idle composer closes the pane.
|
|
42
|
+
* The shell offers every Esc in its `before` phase, focused field or not; a
|
|
43
|
+
* pane handler that runs later takes the offer with `countEscapeTowardClose`
|
|
44
|
+
* and consumes the Esc as usual. Anything the Esc backs out of (a draft, a
|
|
45
|
+
* reply, a menu) keeps it from counting.
|
|
46
|
+
*/
|
|
47
|
+
export function offerEscapeTowardClose(event: object, arm: () => void) {
|
|
48
|
+
escapeArmOffers.set(event, arm);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export function countEscapeTowardClose(event: object) {
|
|
52
|
+
const arm = escapeArmOffers.get(event);
|
|
53
|
+
escapeArmOffers.delete(event);
|
|
54
|
+
arm?.();
|
|
55
|
+
}
|
|
56
|
+
|
|
37
57
|
export function armDoubleEscapeClose(
|
|
38
58
|
state: DoubleEscapeCloseState,
|
|
39
59
|
targetId: string | null | undefined,
|