gloomberb 0.15.2 → 0.15.3
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 +31 -2
- package/README.zh-CN.md +12 -2
- package/package.json +20 -21
- package/src/api-client/auth.ts +7 -1
- package/src/api-client/chat.ts +1 -2
- package/src/api-client/collections.ts +1 -13
- package/src/api-client/credit-boards.ts +67 -0
- package/src/api-client/data.ts +93 -57
- package/src/api-client/earnings.ts +80 -0
- package/src/api-client/equity-screener.ts +25 -0
- package/src/api-client/errors.ts +42 -0
- package/src/api-client/feedback.ts +1 -2
- package/src/api-client/futures-curve.ts +30 -0
- package/src/api-client/index.ts +108 -100
- package/src/api-client/ipo.ts +99 -0
- package/src/api-client/market-movers.ts +60 -0
- package/src/api-client/mna.ts +118 -0
- package/src/api-client/normalizers.ts +0 -7
- package/src/api-client/notes.ts +20 -34
- package/src/api-client/paths.ts +21 -19
- package/src/api-client/plan-access.ts +27 -0
- package/src/api-client/plan-rules.ts +87 -0
- package/src/api-client/request.ts +40 -4
- package/src/api-client/research-activity.ts +17 -1
- package/src/api-client/revenue-breakdown.ts +36 -0
- package/src/api-client/session-cookie.ts +6 -0
- package/src/api-client/social-mentions.ts +63 -0
- package/src/api-client/teams.ts +1 -26
- package/src/api-client/telemetry.ts +180 -0
- package/src/api-client/theses.ts +9 -36
- package/src/api-client/types.ts +66 -61
- package/src/api-client/views.ts +22 -49
- package/src/app/app-bootstrap-state.ts +3 -14
- package/src/app/pane-runtime/plugin-bindings.ts +21 -1
- package/src/app/runtime/broker-import.ts +5 -1
- package/src/app/runtime/desktop-menu.ts +23 -12
- package/src/app/runtime/layout-warmup.ts +2 -2
- package/src/app/runtime/plugin-bindings.ts +27 -7
- package/src/app/runtime/startup.ts +55 -1
- package/src/app/runtime/ticker-refresh.ts +6 -6
- package/src/app/runtime/update.ts +4 -2
- package/src/app.tsx +15 -1
- package/src/assets/gloomberb-logo-windows.ico +0 -0
- package/src/assets/gloomberb-logo-windows.png +0 -0
- package/src/assets/gloomberb-logo.svg +1 -73
- package/src/assets/gloomberb-mark.ico +0 -0
- package/src/assets/gloomberb-mark.svg +1 -0
- package/src/brokers/broker-portfolio-sync.ts +75 -6
- package/src/brokers/broker-ticker-sync.ts +3 -1
- package/src/brokers/cloud-broker-link.ts +26 -0
- package/src/brokers/directory.ts +56 -0
- package/src/brokers/remote-broker-adapter.ts +4 -1
- package/src/brokers/signed-in/adapter.ts +259 -0
- package/src/brokers/signed-in/catalog.ts +129 -0
- package/src/brokers/signed-in/client.ts +54 -0
- package/src/brokers/signed-in/connect.ts +69 -0
- package/src/brokers/signed-in/profile.ts +18 -0
- package/src/brokers/signed-in/sign-in-dialog.tsx +187 -0
- package/src/brokers/signed-in/sign-in.ts +178 -0
- package/src/brokers/sync-broker-instance.ts +42 -24
- package/src/capabilities/index.ts +42 -6
- package/src/cli/commands/broker.ts +49 -0
- package/src/cli/commands/market.ts +5 -0
- package/src/cli/commands/overview.ts +2 -5
- package/src/cli/commands/plugins.ts +112 -428
- package/src/cli/commands/system.ts +26 -354
- package/src/cli/commands/ticker.ts +11 -34
- package/src/cli/desktop-pane-shot-routes.ts +7 -0
- package/src/cli/desktop-pane-shot.ts +7 -27
- package/src/cli/entry.ts +20 -23
- package/src/cli/helpers.ts +5 -19
- package/src/cli/index.ts +17 -23
- package/src/cli/pane-functions/capabilities.ts +0 -4
- package/src/cli/pane-functions/catalog.ts +30 -4
- package/src/cli/pane-functions/headless.ts +1 -4
- package/src/cli/pane-functions/index.ts +0 -23
- package/src/cli/pane-functions/options.ts +8 -5
- package/src/cli/pane-functions/screenshot-evidence.ts +106 -0
- package/src/cli/pane-functions/screenshot.ts +48 -291
- package/src/cli/restore-plugins.ts +10 -2
- package/src/components/chart/composite/axis-overlays.tsx +87 -22
- package/src/components/chart/composite/composite-chart.tsx +5 -6
- package/src/components/chart/composite/downsample.ts +4 -7
- package/src/components/chart/composite/format.ts +39 -3
- package/src/components/chart/composite/interactions.ts +1 -29
- package/src/components/chart/composite/price-axis-labels.tsx +1 -4
- package/src/components/chart/composite/rasterizer.ts +1 -19
- package/src/components/chart/composite/scene.ts +7 -10
- package/src/components/chart/composite/text-renderer.ts +5 -21
- package/src/components/chart/composite/time-axis.ts +1 -4
- package/src/components/chart/composite/tools.ts +2 -1
- package/src/components/chart/core/pointer.ts +1 -4
- package/src/components/chart/curve/curve-surface.tsx +180 -48
- package/src/components/chart/curve/index.ts +3 -2
- package/src/components/chart/curve/model.ts +200 -31
- package/src/components/chart/native/chart-rasterizer.ts +1 -0
- package/src/components/chart/native/kitty/protocol.ts +1 -1
- package/src/components/chart/native/raster/crosshair.ts +1 -2
- package/src/components/chart/native/raster/placement.ts +6 -0
- package/src/components/chart/native/raster/primitives.ts +5 -9
- package/src/components/chart/native/raster/types.ts +0 -7
- package/src/components/chart/native/renderer-selection.ts +4 -4
- package/src/components/chart/native/surface/manager.ts +7 -12
- package/src/components/chart/static/chart-surface.tsx +4 -7
- package/src/components/chart/static/index.ts +0 -1
- package/src/components/chart/static/trail-chart-surface.tsx +393 -66
- package/src/components/chart/surface3d/model.ts +2 -2
- package/src/components/chart/surface3d/software.ts +2 -1
- package/src/components/chart-table/axis.ts +29 -0
- package/src/components/chart-table/header.tsx +264 -0
- package/src/components/chart-table/index.ts +14 -0
- package/src/components/chart-table/layout.ts +139 -0
- package/src/components/chart-table/selection.ts +145 -0
- package/src/components/command-bar/action-runtime.ts +1 -2
- package/src/components/command-bar/assist/inventory.ts +83 -30
- package/src/components/command-bar/assist/model.ts +4 -0
- package/src/components/command-bar/assist/runtime.ts +79 -26
- package/src/components/command-bar/commands/collection.ts +1 -6
- package/src/components/command-bar/commands/direct/index.ts +26 -2
- package/src/components/command-bar/commands/direct/runtime.ts +1 -1
- package/src/components/command-bar/commands/plugin/actions.ts +2 -1
- package/src/components/command-bar/commands/plugin/items.ts +10 -0
- package/src/components/command-bar/commands/registry.ts +23 -0
- package/src/components/command-bar/helpers.ts +0 -1
- package/src/components/command-bar/layout-items/current-layout.ts +11 -9
- package/src/components/command-bar/layout-items/types.ts +0 -1
- package/src/components/command-bar/layout-items.ts +0 -3
- package/src/components/command-bar/list/model.ts +5 -0
- package/src/components/command-bar/list/navigation.ts +2 -5
- package/src/components/command-bar/list/view.tsx +7 -7
- package/src/components/command-bar/pane-actions.ts +3 -8
- package/src/components/command-bar/pane-templates/workflow.ts +5 -1
- package/src/components/command-bar/panel/index.tsx +5 -5
- package/src/components/command-bar/panel/runtime.ts +4 -1
- package/src/components/command-bar/picker-activation.ts +14 -4
- package/src/components/command-bar/routes/root/command-items.ts +19 -1
- package/src/components/command-bar/routes/root/plugin-install.ts +304 -0
- package/src/components/command-bar/routes/root/results.ts +10 -1
- package/src/components/command-bar/routes/root/runtime.ts +12 -8
- package/src/components/command-bar/routes/root/search-report.ts +246 -0
- package/src/components/command-bar/routes/root/selection.ts +14 -5
- package/src/components/command-bar/routes/root/shortcut-items.ts +2 -0
- package/src/components/command-bar/routing/actions.ts +2 -8
- package/src/components/command-bar/routing/confirm.ts +6 -1
- package/src/components/command-bar/routing/launch-request.ts +7 -0
- package/src/components/command-bar/routing/navigation-state.ts +24 -0
- package/src/components/command-bar/selection-runtime.ts +110 -65
- package/src/components/command-bar/surface/index.tsx +116 -19
- package/src/components/command-bar/theme-picker.tsx +11 -10
- package/src/components/command-bar/view-model.ts +10 -6
- package/src/components/command-bar/workflow/body.tsx +6 -5
- package/src/components/command-bar/workflow/broker.ts +113 -76
- package/src/components/command-bar/workflow/collection-actions.ts +39 -8
- package/src/components/command-bar/workflow/coordinator.ts +19 -10
- package/src/components/command-bar/workflow/field-row.tsx +3 -3
- package/src/components/command-bar/workflow/fields.ts +14 -5
- package/src/components/command-bar/workflow/ops.ts +14 -1
- package/src/components/command-bar/workflow/submit.ts +23 -9
- package/src/components/command-bar/workflow/types.ts +3 -0
- package/src/components/data-table/export.ts +103 -6
- package/src/components/data-table/stack-view.tsx +22 -2
- package/src/components/data-table/table-pane.ts +45 -0
- package/src/components/data-table/view.tsx +24 -10
- package/src/components/feed-data-table/stack-view.tsx +47 -130
- package/src/components/index.ts +49 -5
- package/src/components/layout/header.tsx +5 -12
- package/src/components/layout/market-summary.ts +1 -2
- package/src/components/layout/missing-pane.tsx +2 -7
- package/src/components/layout/pane/header-tabs.tsx +2 -1
- package/src/components/layout/pane/header.tsx +2 -6
- package/src/components/layout/pane/pane-tabs.tsx +41 -0
- package/src/components/layout/pane/status-footer.ts +92 -0
- package/src/components/layout/shell/action-menu-overlay.tsx +3 -3
- package/src/components/layout/shell/index.tsx +6 -10
- package/src/components/layout/shell/menu.ts +1 -5
- package/src/components/layout/shell/native/surfaces.ts +3 -4
- package/src/components/layout/shell/pane/actions.ts +8 -9
- package/src/components/layout/shell/shortcuts.ts +4 -1
- package/src/components/layout/shell/window-mode/overlays.tsx +3 -2
- package/src/components/layout/status-bar.tsx +34 -47
- package/src/components/layout/titlebar-overlay.ts +3 -14
- package/src/components/layout/window-edit/status.tsx +3 -9
- package/src/components/markdown-text.tsx +306 -2
- package/src/components/market-board/index.tsx +60 -16
- package/src/components/onboarding/account-step/form-panel.tsx +2 -2
- package/src/components/onboarding/account-step/qr-panel.tsx +13 -30
- package/src/components/onboarding/account-step/signed-in-panel.tsx +2 -2
- package/src/components/onboarding/first-run-workspace.ts +8 -6
- package/src/components/onboarding/onboarding-frame.tsx +11 -15
- package/src/components/onboarding/onboarding-wizard.tsx +51 -30
- package/src/components/onboarding/portfolio-step/broker-fields-panel.tsx +2 -2
- package/src/components/onboarding/portfolio-step/broker-setup-panel.tsx +2 -2
- package/src/components/onboarding/portfolio-step/broker-sync-panel.tsx +2 -2
- package/src/components/onboarding/portfolio-step/choose-panel.tsx +2 -2
- package/src/components/onboarding/portfolio-step/positions-panel.tsx +2 -2
- package/src/components/onboarding/wizard-broker-sync.ts +122 -51
- package/src/components/onboarding/wizard-model.ts +20 -7
- package/src/components/onboarding/wizard-positions.ts +1 -1
- package/src/components/paged-rows.ts +217 -0
- package/src/components/pane-settings-dialog/field-dialogs.tsx +2 -2
- package/src/components/pane-settings-dialog.tsx +2 -2
- package/src/components/price-sparkline/model.ts +11 -8
- package/src/components/price-sparkline/view.tsx +10 -7
- package/src/components/sign-in-code-panel.tsx +128 -0
- package/src/components/sign-in-gate.tsx +8 -22
- package/src/components/speedometer-gauge/index.tsx +2 -2
- package/src/components/speedometer-gauge/model.ts +1 -4
- package/src/components/table-view-shared.tsx +0 -44
- package/src/components/ticker/badge/format.ts +0 -4
- package/src/components/ticker/list-table-view.tsx +6 -37
- package/src/components/toggle-list.tsx +2 -2
- package/src/components/ui/choice-dialog.tsx +4 -8
- package/src/components/ui/confirm-dialog.tsx +21 -1
- package/src/components/ui/data-table/hooks.ts +46 -0
- package/src/components/ui/data-table/opentui/index.tsx +21 -30
- package/src/components/ui/data-table/opentui/model.ts +0 -21
- package/src/components/ui/data-table/types.ts +20 -0
- package/src/components/ui/data-table/visible-range.ts +26 -2
- package/src/components/ui/detail-scroll-body.tsx +48 -0
- package/src/components/ui/disclosure-marker.tsx +2 -2
- package/src/components/ui/display.tsx +8 -4
- package/src/components/ui/field-grid.tsx +26 -2
- package/src/components/ui/field-ring.ts +125 -0
- package/src/components/ui/fields.tsx +65 -3
- package/src/components/ui/index.ts +18 -7
- package/src/components/ui/multi-select/dialog.tsx +3 -3
- package/src/components/ui/page-stack-view.tsx +2 -0
- package/src/components/ui/prose.tsx +52 -0
- package/src/components/ui/query-bar.tsx +37 -9
- package/src/components/ui/reveal-in-scroll-box.ts +34 -0
- package/src/components/ui/select-button.tsx +2 -2
- package/src/components/ui/split-bar.tsx +69 -0
- package/src/components/ui/stat-grid.tsx +38 -14
- package/src/components/ui/status.tsx +2 -0
- package/src/components/ui/text-prompt-dialog.tsx +128 -0
- package/src/core/app-runtime.ts +5 -0
- package/src/core/connection-health.ts +2 -4
- package/src/core/state/app/layout.ts +13 -0
- package/src/core/state/app/types.ts +16 -0
- package/src/core/state/session-persistence.ts +8 -14
- package/src/data/cached-query.ts +5 -0
- package/src/data/config/chart-settings.ts +14 -21
- package/src/data/config/layout.ts +0 -8
- package/src/data/config/store/migrations.ts +74 -141
- package/src/data/config/store/node.ts +29 -3
- package/src/data/config/store/normalize.ts +35 -63
- package/src/data/config/store/pane-state.ts +47 -0
- package/src/data/fred-series.ts +7 -18
- package/src/data/json-persistence.ts +1 -4
- package/src/data/json-ticker-repository.ts +1 -4
- package/src/i18n/es.ts +26 -5
- package/src/i18n/ja.ts +26 -5
- package/src/i18n/ko.ts +26 -5
- package/src/i18n/languages.ts +18 -0
- package/src/i18n/zh-cn.ts +26 -5
- package/src/i18n/zh-tw.ts +26 -5
- package/src/layout-marketplace/cloud.ts +11 -54
- package/src/layout-marketplace/gallery.tsx +32 -46
- package/src/layout-marketplace/linked-sync.ts +1 -2
- package/src/layout-marketplace/payload.ts +16 -19
- package/src/market-data/coordinator/chart.ts +5 -4
- package/src/market-data/coordinator/events.ts +15 -2
- package/src/market-data/coordinator/index.ts +37 -9
- package/src/market-data/coordinator/quotes.ts +2 -9
- package/src/market-data/history-session.ts +2 -9
- package/src/market-data/hooks.tsx +3 -3
- package/src/market-data/market/format.ts +26 -0
- package/src/market-data/market/freshness.ts +5 -34
- package/src/market-data/market/price-basis.ts +1 -1
- package/src/market-data/market/status.ts +1 -1
- package/src/market-data/query-store.ts +37 -31
- package/src/market-data/quotes/day-range.ts +2 -8
- package/src/market-data/quotes/freshness.ts +2 -4
- package/src/market-data/quotes/screener-live-quotes.ts +162 -0
- package/src/market-data/realized-volatility.ts +292 -0
- package/src/market-data/selectors.ts +27 -10
- package/src/market-data/snapshot-provider.ts +3 -2
- package/src/news/aggregator.ts +0 -35
- package/src/news/source-label.ts +22 -0
- package/src/news/types.ts +1 -0
- package/src/pane-settings.ts +0 -8
- package/src/plugins/absorbed.ts +33 -0
- package/src/plugins/auto-update-node.ts +113 -0
- package/src/plugins/auto-update.ts +281 -0
- package/src/plugins/builtin/account-management/form-components.tsx +8 -83
- package/src/plugins/builtin/account-management/index.tsx +26 -0
- package/src/plugins/builtin/account-management/keyboard.ts +50 -98
- package/src/plugins/builtin/account-management/model.ts +19 -53
- package/src/plugins/builtin/account-management/navigation.ts +6 -21
- package/src/plugins/builtin/account-management/pane.tsx +76 -187
- package/src/plugins/builtin/account-management/password-dialog.tsx +10 -8
- package/src/plugins/builtin/alerts/cli.ts +96 -0
- package/src/plugins/builtin/alerts/events-pane.tsx +22 -50
- package/src/plugins/builtin/alerts/history-pane.tsx +20 -59
- package/src/plugins/builtin/alerts/history.ts +1 -1
- package/src/plugins/builtin/alerts/index.tsx +2 -0
- package/src/plugins/builtin/alerts/pane.tsx +27 -65
- package/src/plugins/builtin/alerts/research-rules.ts +8 -3
- package/src/plugins/builtin/analytics/account-returns.ts +109 -0
- package/src/plugins/builtin/analytics/broker-performance.ts +4 -2
- package/src/plugins/builtin/analytics/display.ts +0 -32
- package/src/plugins/builtin/analytics/index.tsx +119 -88
- package/src/plugins/builtin/analytics/metrics.ts +0 -26
- package/src/plugins/builtin/analytics/pane-model.ts +25 -17
- package/src/plugins/builtin/analytics/risk-client.ts +11 -14
- package/src/plugins/builtin/analytics/risk-evidence.ts +45 -15
- package/src/plugins/builtin/analytics/risk-pane.tsx +134 -139
- package/src/plugins/builtin/analytics/sector-model.ts +0 -11
- package/src/plugins/builtin/analytics/view.tsx +92 -111
- package/src/plugins/builtin/backtest/client.ts +5 -6
- package/src/plugins/builtin/backtest/pane.tsx +35 -41
- package/src/plugins/builtin/backtest/rules.ts +0 -8
- package/src/plugins/builtin/bond-calculator/model.ts +0 -1
- package/src/plugins/builtin/bond-calculator/pane.tsx +8 -15
- package/src/plugins/builtin/broker-manager/detail.tsx +39 -76
- package/src/plugins/builtin/broker-manager/footer.ts +3 -3
- package/src/plugins/builtin/broker-manager/index.tsx +24 -4
- package/src/plugins/builtin/broker-manager/keyboard.ts +7 -30
- package/src/plugins/builtin/broker-manager/model.ts +4 -7
- package/src/plugins/builtin/broker-manager/pane-actions.tsx +74 -34
- package/src/plugins/builtin/broker-manager/table.ts +3 -12
- package/src/plugins/builtin/buildout/cells.tsx +34 -36
- package/src/plugins/builtin/buildout/detail/company.tsx +5 -4
- package/src/plugins/builtin/buildout/detail/site.tsx +6 -5
- package/src/plugins/builtin/buildout/detail/ui.tsx +10 -9
- package/src/plugins/builtin/buildout/format.ts +3 -8
- package/src/plugins/builtin/buildout/index.tsx +23 -0
- package/src/plugins/builtin/buildout/model/types.ts +0 -1
- package/src/plugins/builtin/buildout/pane/index.tsx +18 -40
- package/src/plugins/builtin/buildout/table-model.ts +1 -1
- package/src/plugins/builtin/builtin-plugin-meta.ts +51 -0
- package/src/plugins/builtin/cds/client.ts +33 -1
- package/src/plugins/builtin/cds/index.tsx +4 -4
- package/src/plugins/builtin/cds/model.ts +56 -10
- package/src/plugins/builtin/cds/pane.tsx +139 -49
- package/src/plugins/builtin/central-bank-rates/client.ts +5 -17
- package/src/plugins/builtin/central-bank-rates/headless.ts +1 -1
- package/src/plugins/builtin/central-bank-rates/index.tsx +1 -1
- package/src/plugins/builtin/central-bank-rates/pane.tsx +15 -20
- package/src/plugins/builtin/changelog/index.tsx +23 -105
- package/src/plugins/builtin/changelog/model.ts +2 -12
- package/src/plugins/builtin/chart-composer/catalog-inventory.ts +3 -2
- package/src/plugins/builtin/chart-composer/chart-spec.ts +1 -4
- package/src/plugins/builtin/chart-composer/data-catalog-pane.tsx +20 -71
- package/src/plugins/builtin/chart-composer/editor/controller.ts +8 -12
- package/src/plugins/builtin/chart-composer/editor.tsx +2 -2
- package/src/plugins/builtin/chart-composer/follow-binding.ts +6 -1
- package/src/plugins/builtin/chart-composer/index.tsx +6 -9
- package/src/plugins/builtin/chart-composer/pane.tsx +50 -3
- package/src/plugins/builtin/chart-composer/presets.ts +34 -0
- package/src/plugins/builtin/chart-composer/quick-add.tsx +17 -23
- package/src/plugins/builtin/chart-composer/semantic.ts +1 -0
- package/src/plugins/builtin/chart-composer/settings.ts +1 -1
- package/src/plugins/builtin/chat/channels.ts +0 -2
- package/src/plugins/builtin/chat/content/index.tsx +1 -1
- package/src/plugins/builtin/chat/content/layout-metrics.ts +3 -6
- package/src/plugins/builtin/chat/controller/fetch.ts +1 -14
- package/src/plugins/builtin/chat/controller/state.ts +4 -2
- package/src/plugins/builtin/chat/controller/utils.ts +0 -14
- package/src/plugins/builtin/chat/index.tsx +105 -0
- package/src/plugins/builtin/chat/message/desktop.tsx +22 -94
- package/src/plugins/builtin/chat/message/header.tsx +83 -0
- package/src/plugins/builtin/chat/message/profile-popover.tsx +1 -1
- package/src/plugins/builtin/chat/message/render-state.ts +10 -2
- package/src/plugins/builtin/chat/message/terminal.tsx +22 -78
- package/src/plugins/builtin/chat/pane.tsx +112 -124
- package/src/plugins/builtin/chat/sidebar.tsx +2 -18
- package/src/plugins/builtin/chat/status-widget.tsx +0 -3
- package/src/plugins/builtin/cloud/askg/executor.ts +14 -39
- package/src/plugins/builtin/cloud/askg/json.ts +31 -0
- package/src/plugins/builtin/cloud/askg/manifest.ts +1 -1
- package/src/plugins/builtin/cloud/askg/pane.tsx +10 -16
- package/src/plugins/builtin/cloud/askg/pending-question.ts +5 -27
- package/src/plugins/builtin/cloud/askg/protocol.ts +1 -15
- package/src/plugins/builtin/cloud/askg/undo.ts +4 -29
- package/src/plugins/builtin/cloud/auth-actions.tsx +28 -1
- package/src/plugins/builtin/cloud/browser.tsx +1 -7
- package/src/plugins/builtin/cloud/device-signin-dialog.tsx +64 -147
- package/src/plugins/builtin/cloud/index.tsx +2 -11
- package/src/plugins/builtin/cloud/plugin.tsx +13 -151
- package/src/plugins/builtin/cloud/team/collections-sync.ts +4 -2
- package/src/plugins/builtin/cloud/team/collections.ts +0 -4
- package/src/plugins/builtin/cloud/team/model.ts +0 -4
- package/src/plugins/builtin/cloud/team/module.tsx +0 -3
- package/src/plugins/builtin/cloud/team/pane-model.ts +0 -7
- package/src/plugins/builtin/cloud/team/pane-request.ts +5 -22
- package/src/plugins/builtin/cloud/team/pane-sections.tsx +1 -1
- package/src/plugins/builtin/cloud/team/pane-ui.tsx +15 -24
- package/src/plugins/builtin/cloud/team/pane.tsx +21 -58
- package/src/plugins/builtin/cloud/thesis/board-pane.tsx +31 -50
- package/src/plugins/builtin/cloud/thesis/detail.tsx +1 -1
- package/src/plugins/builtin/cloud/thesis/exposure.ts +1 -4
- package/src/plugins/builtin/cloud/thesis/flows.ts +8 -7
- package/src/plugins/builtin/cloud/thesis/model.ts +0 -7
- package/src/plugins/builtin/cloud/thesis/pane-request.ts +5 -22
- package/src/plugins/builtin/cloud/thesis/prompts.tsx +13 -125
- package/src/plugins/builtin/cloud/thesis/ticker-tab.tsx +1 -1
- package/src/plugins/builtin/cloud/upgrade-command.ts +1 -1
- package/src/plugins/builtin/cloud/upgrade-dialog.tsx +231 -0
- package/src/plugins/builtin/cloud/upgrade-status-widget.tsx +2 -4
- package/src/plugins/builtin/cloud/verification-status-widget.tsx +2 -4
- package/src/plugins/builtin/cloud-tweets/footer.ts +2 -2
- package/src/plugins/builtin/cloud-tweets/index.ts +6 -0
- package/src/plugins/builtin/cloud-tweets/keyboard.ts +1 -32
- package/src/plugins/builtin/cloud-tweets/model.ts +1 -5
- package/src/plugins/builtin/cloud-tweets/pane.tsx +10 -43
- package/src/plugins/builtin/cloud-tweets/registration.ts +5 -8
- package/src/plugins/builtin/cloud-tweets/search-bar.tsx +5 -20
- package/src/plugins/builtin/cloud-tweets/table.tsx +16 -23
- package/src/plugins/builtin/composite-plugins.ts +77 -37
- package/src/plugins/builtin/congress-trades/detail.tsx +28 -81
- package/src/plugins/builtin/congress-trades/footer.ts +1 -1
- package/src/plugins/builtin/congress-trades/headless.ts +22 -45
- package/src/plugins/builtin/congress-trades/keyboard.ts +9 -78
- package/src/plugins/builtin/congress-trades/model.ts +4 -27
- package/src/plugins/builtin/congress-trades/pane.tsx +17 -38
- package/src/plugins/builtin/congress-trades/table.tsx +29 -34
- package/src/plugins/builtin/connections/pane.tsx +5 -12
- package/src/plugins/builtin/correlation/index.tsx +3 -5
- package/src/plugins/builtin/correlation/relationship/pane.tsx +6 -7
- package/src/plugins/builtin/correlation/relationship/view-model.ts +7 -18
- package/src/plugins/builtin/cot/client.ts +14 -18
- package/src/plugins/builtin/cot/index.tsx +3 -2
- package/src/plugins/builtin/cot/model.ts +13 -10
- package/src/plugins/builtin/cot/pane.tsx +70 -45
- package/src/plugins/builtin/credit-boards/cdx-pane.tsx +140 -0
- package/src/plugins/builtin/credit-boards/client.ts +108 -0
- package/src/plugins/builtin/credit-boards/headless.ts +73 -0
- package/src/plugins/builtin/credit-boards/index.tsx +62 -0
- package/src/plugins/builtin/credit-boards/model.ts +221 -0
- package/src/plugins/builtin/credit-boards/sovr-pane.tsx +144 -0
- package/src/plugins/builtin/credit-conditions/index.tsx +33 -33
- package/src/plugins/builtin/crypto-board/client.ts +11 -34
- package/src/plugins/builtin/crypto-board/index.tsx +1 -1
- package/src/plugins/builtin/crypto-board/model.ts +14 -16
- package/src/plugins/builtin/crypto-board/pane.tsx +24 -50
- package/src/plugins/builtin/custom-view/index.tsx +1 -1
- package/src/plugins/builtin/custom-view/pane.tsx +1 -1
- package/src/plugins/builtin/custom-view/view-spec.ts +9 -12
- package/src/plugins/builtin/debt-maturities/client.ts +15 -42
- package/src/plugins/builtin/debt-maturities/model.ts +96 -31
- package/src/plugins/builtin/debt-maturities/pane.tsx +196 -223
- package/src/plugins/builtin/debt-maturities/wall-bar.tsx +63 -0
- package/src/plugins/builtin/debug/index.tsx +17 -46
- package/src/plugins/builtin/dividend-yield/client.ts +13 -33
- package/src/plugins/builtin/dividend-yield/model.ts +10 -22
- package/src/plugins/builtin/dividend-yield/pane.tsx +97 -143
- package/src/plugins/builtin/dividend-yield/trailing-cash.ts +3 -3
- package/src/plugins/builtin/dividend-yield/view.ts +2 -2
- package/src/plugins/builtin/earnings/board-model.ts +197 -0
- package/src/plugins/builtin/earnings/board-table.ts +84 -0
- package/src/plugins/builtin/earnings/board.tsx +236 -0
- package/src/plugins/builtin/earnings/client.ts +97 -0
- package/src/plugins/builtin/earnings/format.ts +62 -0
- package/src/plugins/builtin/earnings/headless.ts +134 -138
- package/src/plugins/builtin/earnings/history-model.ts +174 -0
- package/src/plugins/builtin/earnings/history-table.ts +84 -0
- package/src/plugins/builtin/earnings/history.tsx +107 -0
- package/src/plugins/builtin/earnings/index.tsx +70 -270
- package/src/plugins/builtin/earnings/model.ts +0 -99
- package/src/plugins/builtin/earnings-calls/data.ts +0 -5
- package/src/plugins/builtin/earnings-calls/format.ts +2 -8
- package/src/plugins/builtin/earnings-calls/index.tsx +0 -1
- package/src/plugins/builtin/earnings-calls/pane.tsx +16 -63
- package/src/plugins/builtin/earnings-calls/transcript-view.tsx +18 -61
- package/src/plugins/builtin/econ/calendar-model.ts +34 -1
- package/src/plugins/builtin/econ/detail-view.tsx +124 -139
- package/src/plugins/builtin/econ/fred-series-map.ts +1 -5
- package/src/plugins/builtin/econ/index.tsx +51 -90
- package/src/plugins/builtin/econ-statistics/client.ts +5 -4
- package/src/plugins/builtin/econ-statistics/defs.ts +1 -1
- package/src/plugins/builtin/econ-statistics/detail.tsx +32 -104
- package/src/plugins/builtin/econ-statistics/headless.ts +28 -50
- package/src/plugins/builtin/econ-statistics/index.tsx +1 -1
- package/src/plugins/builtin/econ-statistics/pane.tsx +36 -152
- package/src/plugins/builtin/econ-statistics/stats.ts +0 -5
- package/src/plugins/builtin/econ-statistics/view.ts +2 -4
- package/src/plugins/builtin/equity-screener/client.ts +2 -2
- package/src/plugins/builtin/equity-screener/live.ts +7 -9
- package/src/plugins/builtin/equity-screener/model.ts +67 -9
- package/src/plugins/builtin/equity-screener/pane.tsx +39 -58
- package/src/plugins/builtin/equity-screener/results.ts +2 -4
- package/src/plugins/builtin/estimate-revisions/client.ts +20 -49
- package/src/plugins/builtin/estimate-revisions/pane.tsx +71 -104
- package/src/plugins/builtin/executives/data.ts +3 -8
- package/src/plugins/builtin/executives/format.ts +3 -17
- package/src/plugins/builtin/executives/pane.tsx +33 -186
- package/src/plugins/builtin/fear-greed/cache.ts +100 -0
- package/src/plugins/builtin/fear-greed/charts.tsx +258 -0
- package/src/plugins/builtin/fear-greed/data.ts +376 -0
- package/src/plugins/builtin/fear-greed/format.ts +87 -0
- package/src/plugins/builtin/fear-greed/headless.ts +85 -0
- package/src/plugins/builtin/fear-greed/index.tsx +89 -0
- package/src/plugins/builtin/fear-greed/pane.tsx +112 -0
- package/src/plugins/builtin/filing-events/feed.ts +4 -14
- package/src/plugins/builtin/filing-events/pane.tsx +7 -21
- package/src/plugins/builtin/futures/contracts.ts +55 -33
- package/src/plugins/builtin/futures/index.tsx +61 -47
- package/src/plugins/builtin/futures/model.ts +39 -17
- package/src/plugins/builtin/futures/returns.ts +132 -0
- package/src/plugins/builtin/futures/table.tsx +72 -63
- package/src/plugins/builtin/futures/use-front-returns.ts +119 -0
- package/src/plugins/builtin/futures-curve/client.ts +30 -15
- package/src/plugins/builtin/futures-curve/headless.ts +10 -4
- package/src/plugins/builtin/futures-curve/index.tsx +2 -1
- package/src/plugins/builtin/futures-curve/model.ts +133 -18
- package/src/plugins/builtin/futures-curve/pane.tsx +141 -45
- package/src/plugins/builtin/fx-matrix/index.tsx +9 -17
- package/src/plugins/builtin/help/functions-table.tsx +2 -19
- package/src/plugins/builtin/help/index.tsx +6 -26
- package/src/plugins/builtin/help/shortcut-model.ts +7 -1
- package/src/plugins/builtin/holders/headless.ts +2 -2
- package/src/plugins/builtin/holders/index.tsx +0 -1
- package/src/plugins/builtin/holders/pane.tsx +43 -83
- package/src/plugins/builtin/holders/table-model.ts +1 -15
- package/src/plugins/builtin/holders/thirteenf-match.ts +4 -3
- package/src/plugins/builtin/holders/types.ts +1 -1
- package/src/plugins/builtin/insider/index.tsx +0 -1
- package/src/plugins/builtin/ipo-calendar/client.ts +93 -0
- package/src/plugins/builtin/ipo-calendar/headless.ts +159 -0
- package/src/plugins/builtin/ipo-calendar/index.tsx +47 -0
- package/src/plugins/builtin/ipo-calendar/model.ts +341 -0
- package/src/plugins/builtin/ipo-calendar/pane.tsx +233 -0
- package/src/plugins/builtin/iv-history/index.tsx +0 -1
- package/src/plugins/builtin/iv-history/pane.tsx +7 -4
- package/src/plugins/builtin/iv-history/rank.ts +0 -7
- package/src/plugins/builtin/iv-history/screen-pane.tsx +7 -12
- package/src/plugins/builtin/jobs/headless.ts +58 -76
- package/src/plugins/builtin/jobs/index.tsx +0 -1
- package/src/plugins/builtin/jobs/model.ts +7 -15
- package/src/plugins/builtin/jobs/pane.tsx +190 -154
- package/src/plugins/builtin/jobs/share-bars.tsx +2 -2
- package/src/plugins/builtin/kelly-sizer/fields.ts +1 -1
- package/src/plugins/builtin/kelly-sizer/model.ts +1 -26
- package/src/plugins/builtin/kelly-sizer/pane.tsx +22 -67
- package/src/plugins/builtin/kelly-sizer/sections.tsx +1 -1
- package/src/plugins/builtin/kelly-sizer/state.ts +2 -2
- package/src/plugins/builtin/kelly-sizer/test-support.tsx +18 -27
- package/src/plugins/builtin/layout-manager/index.tsx +13 -50
- package/src/plugins/builtin/macro-resources.ts +15 -0
- package/src/plugins/builtin/market-halts/client.ts +114 -0
- package/src/plugins/builtin/market-halts/index.tsx +41 -0
- package/src/plugins/builtin/market-halts/model.ts +323 -0
- package/src/plugins/builtin/market-halts/pane.tsx +239 -0
- package/src/plugins/builtin/market-heatmap/data.ts +305 -0
- package/src/plugins/builtin/market-heatmap/index.tsx +447 -0
- package/src/plugins/builtin/market-movers/client.ts +30 -3
- package/src/plugins/builtin/market-movers/footer.ts +19 -0
- package/src/plugins/builtin/market-movers/headless.ts +71 -5
- package/src/plugins/builtin/market-movers/index.tsx +135 -101
- package/src/plugins/builtin/market-movers/model.ts +11 -17
- package/src/plugins/builtin/market-movers/screener.ts +2 -8
- package/src/plugins/builtin/market-movers/session-body.tsx +237 -0
- package/src/plugins/builtin/market-movers/session-table.ts +96 -0
- package/src/plugins/builtin/market-movers/session.ts +233 -0
- package/src/plugins/builtin/market-movers/table.ts +15 -15
- package/src/plugins/builtin/market-valuation/cache.ts +2 -39
- package/src/plugins/builtin/market-valuation/chart-projection.ts +11 -34
- package/src/plugins/builtin/market-valuation/client.ts +4 -5
- package/src/plugins/builtin/market-valuation/defs.ts +0 -9
- package/src/plugins/builtin/market-valuation/detail.tsx +32 -89
- package/src/plugins/builtin/market-valuation/headless.ts +31 -51
- package/src/plugins/builtin/market-valuation/index.tsx +11 -1
- package/src/plugins/builtin/market-valuation/pane.tsx +37 -179
- package/src/plugins/builtin/market-valuation/view.ts +6 -7
- package/src/plugins/builtin/market-valuation/zone-scale/index.tsx +2 -2
- package/src/plugins/builtin/mna/client.ts +143 -0
- package/src/plugins/builtin/mna/detail.tsx +297 -0
- package/src/plugins/builtin/mna/headless.ts +82 -0
- package/src/plugins/builtin/mna/index.tsx +55 -0
- package/src/plugins/builtin/mna/model.ts +208 -0
- package/src/plugins/builtin/mna/pane.tsx +432 -0
- package/src/plugins/builtin/money-markets/client.ts +5 -17
- package/src/plugins/builtin/money-markets/model.ts +20 -0
- package/src/plugins/builtin/money-markets/pane.tsx +79 -46
- package/src/plugins/builtin/news/index.tsx +13 -14
- package/src/plugins/builtin/news/wire/categories.ts +35 -12
- package/src/plugins/builtin/news/wire/feed-config.ts +4 -13
- package/src/plugins/builtin/news/wire/index.tsx +43 -27
- package/src/plugins/builtin/news/wire/industry-pane.tsx +110 -105
- package/src/plugins/builtin/news/wire/news/detail-view.tsx +8 -25
- package/src/plugins/builtin/news/wire/news/footer.ts +2 -2
- package/src/plugins/builtin/news/wire/news/preset-pane.tsx +111 -61
- package/src/plugins/builtin/news/wire/news/query-presets.ts +66 -1
- package/src/plugins/builtin/news/wire/news/table.tsx +19 -62
- package/src/plugins/builtin/news/wire/read-state.ts +3 -17
- package/src/plugins/builtin/news/wire/rss/cli.ts +47 -0
- package/src/plugins/builtin/news/wire/rss/parser.ts +0 -4
- package/src/plugins/builtin/news/wire/rss/source.ts +2 -2
- package/src/plugins/builtin/notes/cli.ts +95 -0
- package/src/plugins/builtin/notes/files.ts +145 -88
- package/src/plugins/builtin/notes/index.tsx +4 -2
- package/src/plugins/builtin/notes/migration.ts +3 -1
- package/src/plugins/builtin/notes/quick-notes-pane.tsx +24 -40
- package/src/plugins/builtin/notes/ticker-notes-tab.tsx +4 -1
- package/src/plugins/builtin/options/analytics.ts +5 -7
- package/src/plugins/builtin/options/calc-seed.ts +2 -1
- package/src/plugins/builtin/options/enrichment-client.ts +10 -19
- package/src/plugins/builtin/options/enrichment-model.ts +1 -2
- package/src/plugins/builtin/options/footer.ts +2 -2
- package/src/plugins/builtin/options/index.tsx +1 -1
- package/src/plugins/builtin/options/live-quotes.ts +1 -4
- package/src/plugins/builtin/options/table.ts +15 -15
- package/src/plugins/builtin/options/types.ts +1 -1
- package/src/plugins/builtin/options/view.tsx +31 -9
- package/src/plugins/builtin/options-calculator/binomial.ts +17 -16
- package/src/plugins/builtin/options-calculator/evidence.ts +90 -24
- package/src/plugins/builtin/options-calculator/headless.ts +2 -1
- package/src/plugins/builtin/options-calculator/model.ts +2 -207
- package/src/plugins/builtin/options-calculator/pane.tsx +11 -39
- package/src/plugins/builtin/options-calculator/surface.ts +11 -21
- package/src/plugins/builtin/options-scenario/client.ts +9 -20
- package/src/plugins/builtin/options-scenario/evidence.ts +64 -8
- package/src/plugins/builtin/options-scenario/live.ts +2 -2
- package/src/plugins/builtin/options-scenario/model.ts +18 -28
- package/src/plugins/builtin/options-scenario/pane.tsx +18 -19
- package/src/plugins/builtin/plugin-marketplace/activation.ts +70 -0
- package/src/plugins/builtin/plugin-marketplace/feed.ts +12 -0
- package/src/plugins/builtin/plugin-marketplace/index.tsx +16 -4
- package/src/plugins/builtin/plugin-marketplace/model.ts +67 -9
- package/src/plugins/builtin/plugin-marketplace/pane.tsx +67 -101
- package/src/plugins/builtin/plugin-marketplace/store.ts +19 -1
- package/src/plugins/builtin/plugin-module.ts +4 -11
- package/src/plugins/builtin/portfolio-list/account-metrics.ts +17 -15
- package/src/plugins/builtin/portfolio-list/cli/render.ts +3 -4
- package/src/plugins/builtin/portfolio-list/cli/watchlist-command.ts +2 -1
- package/src/plugins/builtin/portfolio-list/column-values.ts +23 -34
- package/src/plugins/builtin/portfolio-list/index.tsx +1 -1
- package/src/plugins/builtin/portfolio-list/pane/index.tsx +19 -38
- package/src/plugins/builtin/portfolio-list/position-metrics.ts +0 -8
- package/src/plugins/builtin/portfolio-list/summary/index.tsx +20 -16
- package/src/plugins/builtin/rate-path/client.ts +7 -16
- package/src/plugins/builtin/rate-path/headless.ts +13 -9
- package/src/plugins/builtin/rate-path/model.ts +74 -17
- package/src/plugins/builtin/rate-path/pane.tsx +128 -63
- package/src/plugins/builtin/realized-vol/client.ts +13 -23
- package/src/plugins/builtin/realized-vol/evidence.ts +43 -20
- package/src/plugins/builtin/realized-vol/pane.tsx +13 -19
- package/src/plugins/builtin/relative-rotation/client.ts +9 -35
- package/src/plugins/builtin/relative-rotation/pane.tsx +46 -65
- package/src/plugins/builtin/research/analyst-model.ts +35 -32
- package/src/plugins/builtin/research/analyst-pane.tsx +124 -128
- package/src/plugins/builtin/research/corporate-actions-pane.tsx +23 -70
- package/src/plugins/builtin/research/equity-diagnostic-pane.tsx +7 -11
- package/src/plugins/builtin/research/event-sources.ts +64 -0
- package/src/plugins/builtin/research/events-headless.ts +7 -32
- package/src/plugins/builtin/research/headless.ts +11 -51
- package/src/plugins/builtin/research/index.tsx +0 -3
- package/src/plugins/builtin/research/relative-valuation-model.ts +0 -1
- package/src/plugins/builtin/research/relative-valuation-pane.tsx +50 -86
- package/src/plugins/builtin/research-search/data.ts +0 -4
- package/src/plugins/builtin/research-search/document-view.tsx +3 -9
- package/src/plugins/builtin/research-search/index.tsx +1 -0
- package/src/plugins/builtin/research-search/model.ts +4 -20
- package/src/plugins/builtin/research-search/pane.tsx +44 -131
- package/src/plugins/builtin/research-search/saved-view.tsx +10 -13
- package/src/plugins/builtin/revenue-breakdown/bars.tsx +113 -0
- package/src/plugins/builtin/revenue-breakdown/client.ts +114 -0
- package/src/plugins/builtin/revenue-breakdown/headless.ts +72 -0
- package/src/plugins/builtin/revenue-breakdown/index.tsx +58 -0
- package/src/plugins/builtin/revenue-breakdown/model.ts +157 -0
- package/src/plugins/builtin/revenue-breakdown/pane.tsx +290 -0
- package/src/plugins/builtin/risk-factors/data.ts +3 -8
- package/src/plugins/builtin/risk-factors/index.tsx +0 -1
- package/src/plugins/builtin/risk-factors/pane.tsx +29 -107
- package/src/plugins/builtin/scanner/denied.tsx +4 -16
- package/src/plugins/builtin/scanner/feed.ts +2 -2
- package/src/plugins/builtin/scanner/flow-pane.tsx +11 -18
- package/src/plugins/builtin/scanner/hilo-bars.tsx +31 -16
- package/src/plugins/builtin/scanner/hilo-model.ts +33 -0
- package/src/plugins/builtin/scanner/hilo-pane.tsx +8 -11
- package/src/plugins/builtin/scanner/index.ts +2 -3
- package/src/plugins/builtin/sec/filing-display.tsx +2 -6
- package/src/plugins/builtin/sec/index.tsx +2 -1
- package/src/plugins/builtin/sec/model.ts +8 -4
- package/src/plugins/builtin/sectors/index.tsx +19 -40
- package/src/plugins/builtin/sectors/move-bar.tsx +2 -2
- package/src/plugins/builtin/sectors/sector-model.ts +0 -5
- package/src/plugins/builtin/shared/cloud-resource.ts +56 -0
- package/src/plugins/builtin/shared/cloud-upgrade.ts +46 -11
- package/src/plugins/builtin/shared/filing-year-reader.tsx +123 -0
- package/src/plugins/builtin/shared/locked-rows.tsx +56 -0
- package/src/plugins/builtin/shared/pane-request.ts +35 -0
- package/src/plugins/builtin/shared/research-cloud-session.ts +1 -1
- package/src/plugins/builtin/shared/series-detail-chart.tsx +168 -0
- package/src/plugins/builtin/shared/series-list-detail.tsx +208 -0
- package/src/plugins/builtin/shared/stat-transform.ts +94 -0
- package/src/plugins/builtin/shared/ticker-request.ts +0 -6
- package/src/plugins/builtin/shared/trend.ts +81 -0
- package/src/plugins/builtin/shared/use-quote-board.ts +130 -4
- package/src/plugins/builtin/shared/volatility/index.ts +2 -1
- package/src/plugins/builtin/shared/volatility/options.ts +3 -3
- package/src/plugins/builtin/shared/volatility/pricing.ts +211 -0
- package/src/plugins/builtin/short-interest/client.ts +3 -12
- package/src/plugins/builtin/short-interest/index.tsx +0 -1
- package/src/plugins/builtin/short-interest/model.ts +51 -18
- package/src/plugins/builtin/short-interest/pane.tsx +64 -108
- package/src/plugins/builtin/short-interest/surface.tsx +9 -9
- package/src/plugins/builtin/short-interest/types.ts +0 -2
- package/src/plugins/builtin/short-volume/client.ts +8 -17
- package/src/plugins/builtin/short-volume/pane.tsx +28 -29
- package/src/plugins/builtin/social-mentions/client.ts +85 -0
- package/src/plugins/builtin/social-mentions/headless.ts +28 -0
- package/src/plugins/builtin/social-mentions/index.tsx +21 -0
- package/src/plugins/builtin/social-mentions/model.ts +92 -0
- package/src/plugins/builtin/social-mentions/pane.tsx +156 -0
- package/src/plugins/builtin/thirteenf/api.ts +13 -23
- package/src/plugins/builtin/thirteenf/data.ts +6 -8
- package/src/plugins/builtin/thirteenf/format.ts +3 -10
- package/src/plugins/builtin/thirteenf/headless.ts +9 -8
- package/src/plugins/builtin/thirteenf/index.tsx +0 -1
- package/src/plugins/builtin/thirteenf/model.ts +0 -31
- package/src/plugins/builtin/thirteenf/overlap-pane.tsx +12 -16
- package/src/plugins/builtin/thirteenf/pane.tsx +65 -255
- package/src/plugins/builtin/thirteenf/signals-pane.tsx +23 -44
- package/src/plugins/builtin/thirteenf/table.ts +58 -73
- package/src/plugins/builtin/thirteenf/types.ts +1 -1
- package/src/plugins/builtin/ticker-detail/data-panes/historical-prices.tsx +25 -17
- package/src/plugins/builtin/ticker-detail/financials/aggregation.ts +3 -7
- package/src/plugins/builtin/ticker-detail/financials/model.ts +121 -25
- package/src/plugins/builtin/ticker-detail/financials/period-end-history.ts +41 -0
- package/src/plugins/builtin/ticker-detail/financials/ratio-table.tsx +175 -0
- package/src/plugins/builtin/ticker-detail/financials/ratios.ts +669 -0
- package/src/plugins/builtin/ticker-detail/financials/tab.tsx +198 -111
- package/src/plugins/builtin/ticker-detail/headless-schema.ts +7 -2
- package/src/plugins/builtin/ticker-detail/headless.ts +86 -9
- package/src/plugins/builtin/ticker-detail/index.tsx +1 -1
- package/src/plugins/builtin/ticker-detail/overview/components.tsx +2 -2
- package/src/plugins/builtin/ticker-detail/overview-tab.tsx +2 -5
- package/src/plugins/builtin/ticker-detail/pane.tsx +45 -15
- package/src/plugins/builtin/ticker-detail/quote-monitor/card.tsx +3 -1
- package/src/plugins/builtin/ticker-detail/quote-monitor/index.tsx +1 -1
- package/src/plugins/builtin/time-sales/client.ts +5 -5
- package/src/plugins/builtin/time-sales/model.ts +52 -0
- package/src/plugins/builtin/time-sales/pane.tsx +24 -19
- package/src/plugins/builtin/treasury-auctions/index.tsx +0 -1
- package/src/plugins/builtin/treasury-auctions/model.ts +3 -10
- package/src/plugins/builtin/treasury-auctions/pane.tsx +42 -101
- package/src/plugins/builtin/treasury-auctions/types.ts +0 -2
- package/src/plugins/builtin/vol-surface/client.ts +8 -22
- package/src/plugins/builtin/vol-surface/evidence.ts +45 -17
- package/src/plugins/builtin/vol-surface/model.ts +5 -8
- package/src/plugins/builtin/vol-surface/pane.tsx +24 -23
- package/src/plugins/builtin/vol-surface/raster.ts +1 -9
- package/src/plugins/builtin/vol-surface/stored.ts +3 -4
- package/src/plugins/builtin/vol-surface/surface.tsx +4 -3
- package/src/plugins/builtin/volatility/chart-model.ts +36 -0
- package/src/plugins/builtin/volatility/charts.tsx +3 -20
- package/src/plugins/builtin/volatility/client.ts +8 -16
- package/src/plugins/builtin/volatility/evidence.ts +37 -21
- package/src/plugins/builtin/volatility/index.tsx +0 -2
- package/src/plugins/builtin/volatility/model.ts +55 -0
- package/src/plugins/builtin/volatility/pane.tsx +71 -37
- package/src/plugins/builtin/world-indices/client.ts +1 -4
- package/src/plugins/builtin/world-indices/footer.ts +3 -26
- package/src/plugins/builtin/world-indices/index.tsx +8 -9
- package/src/plugins/builtin/world-indices/model.ts +0 -14
- package/src/plugins/builtin/world-indices/table.tsx +15 -73
- package/src/plugins/builtin/world-venue-map/map.tsx +2 -2
- package/src/plugins/builtin/world-venue-map/model.ts +1 -4
- package/src/plugins/builtin/world-venue-map/pane.tsx +21 -87
- package/src/plugins/builtin/yahoo/index.ts +4 -38
- package/src/plugins/builtin/yield-curve/chart.ts +100 -1
- package/src/plugins/builtin/yield-curve/headless.ts +2 -0
- package/src/plugins/builtin/yield-curve/history.ts +86 -12
- package/src/plugins/builtin/yield-curve/index.tsx +102 -27
- package/src/plugins/builtin/yield-curve/treasury-data.ts +12 -12
- package/src/plugins/bundle.ts +41 -41
- package/src/plugins/catalog-backend.ts +4 -1
- package/src/plugins/catalog-browser.ts +34 -53
- package/src/plugins/catalog-manifest.ts +10 -0
- package/src/plugins/catalog-ui.ts +9 -5
- package/src/plugins/compat.ts +216 -0
- package/src/plugins/current-target.ts +3 -9
- package/src/plugins/event-bus.ts +8 -3
- package/src/plugins/external-runtime.ts +0 -21
- package/src/plugins/host-link.ts +78 -45
- package/src/plugins/host-modules.ts +117 -3
- package/src/plugins/host-resolver.ts +1 -6
- package/src/plugins/installer.ts +566 -0
- package/src/plugins/loader.ts +120 -16
- package/src/plugins/manager-node.ts +28 -28
- package/src/plugins/ownership.ts +11 -12
- package/src/plugins/pane-manager/gridlock.ts +25 -8
- package/src/plugins/pane-manager.ts +1 -0
- package/src/plugins/plugin-export.ts +24 -0
- package/src/plugins/registry/contributions.ts +10 -4
- package/src/plugins/registry/index.ts +13 -12
- package/src/plugins/registry/pane-settings.ts +6 -3
- package/src/plugins/registry/shared.ts +0 -4
- package/src/plugins/registry/slots.ts +10 -13
- package/src/plugins/runtime/context.tsx +12 -34
- package/src/plugins/runtime/index.tsx +9 -9
- package/src/plugins/seed.ts +3 -7
- package/src/plugins/web-bundled.ts +3 -12
- package/src/public/__snapshots__/public-api.test.ts.snap +519 -0
- package/src/public/broker.ts +14 -9
- package/src/public/index.ts +3 -0
- package/src/public/market-data.ts +19 -2
- package/src/public/quotes.ts +4 -4
- package/src/public/react.ts +11 -6
- package/src/public/test-support.ts +10 -2
- package/src/public/time-series.ts +30 -3
- package/src/public/utils.ts +3 -4
- package/src/react/assign-ref.ts +10 -0
- package/src/react/async-resource.ts +16 -5
- package/src/react/auto-refresh.ts +97 -0
- package/src/react/plugins/plugin-slot.tsx +4 -1
- package/src/react/read-state.ts +104 -0
- package/src/react/ticker-source.ts +32 -0
- package/src/remote/controller-utils.ts +0 -4
- package/src/remote/controller.ts +18 -14
- package/src/remote/layout-helpers.ts +4 -9
- package/src/remote/resources.ts +34 -0
- package/src/remote/revision.ts +2 -15
- package/src/remote/schema.ts +1 -0
- package/src/renderers/browser/app-services.ts +1 -1
- package/src/renderers/browser/bundled-plugins.ts +8 -7
- package/src/renderers/browser/cloud-transport.ts +3 -11
- package/src/renderers/browser/config-host.ts +13 -8
- package/src/renderers/browser/http-proxy-transport.ts +17 -45
- package/src/renderers/browser/main.tsx +52 -25
- package/src/renderers/cloudflare/http-proxy.ts +14 -54
- package/src/renderers/cloudflare/worker.ts +25 -6
- package/src/renderers/electrobun/bun/application-menu/click.ts +8 -20
- package/src/renderers/electrobun/bun/application-menu/index.ts +3 -4
- package/src/renderers/electrobun/bun/context-menu/click.ts +7 -26
- package/src/renderers/electrobun/bun/context-menu/normalize.ts +4 -9
- package/src/renderers/electrobun/bun/core-capabilities.ts +16 -64
- package/src/renderers/electrobun/bun/desktop/detached-windows.ts +6 -35
- package/src/renderers/electrobun/bun/desktop/host-requests.ts +0 -9
- package/src/renderers/electrobun/bun/desktop/http-fetch.ts +15 -63
- package/src/renderers/electrobun/bun/desktop/http-stream.ts +6 -19
- package/src/renderers/electrobun/bun/desktop/initialization.ts +9 -0
- package/src/renderers/electrobun/bun/desktop/macos-dock-icon.ts +91 -0
- package/src/renderers/electrobun/bun/desktop/plugin-state.ts +0 -7
- package/src/renderers/electrobun/bun/external-plugins.ts +35 -95
- package/src/renderers/electrobun/bun/index.ts +57 -45
- package/src/renderers/electrobun/bun/menu-event.ts +17 -0
- package/src/renderers/electrobun/bun/window/controls.ts +69 -0
- package/src/renderers/electrobun/bun/window/create.ts +84 -0
- package/src/renderers/electrobun/bun/window/events.ts +49 -0
- package/src/renderers/electrobun/bun/window/windows-custom-chrome.ts +43 -0
- package/src/renderers/electrobun/bun/window/windows-icons.ts +55 -0
- package/src/renderers/electrobun/bun/window/windows-native.ts +96 -0
- package/src/renderers/electrobun/shared/protocol.ts +35 -48
- package/src/renderers/electrobun/shared/quote-event-batch.ts +3 -3
- package/src/renderers/electrobun/view/app-services.ts +1 -1
- package/src/renderers/electrobun/view/backend-rpc.ts +74 -141
- package/src/renderers/electrobun/view/broker-remote-client.ts +32 -46
- package/src/renderers/electrobun/view/build-assets.ts +61 -49
- package/src/renderers/electrobun/view/capability-stream-client.ts +5 -25
- package/src/renderers/electrobun/view/capability-subscription.ts +50 -0
- package/src/renderers/electrobun/view/cli-pane-shot-entry.tsx +35 -93
- package/src/renderers/electrobun/view/context-menu.ts +6 -7
- package/src/renderers/electrobun/view/data-table/dom.ts +1 -2
- package/src/renderers/electrobun/view/data-table/index.tsx +17 -35
- package/src/renderers/electrobun/view/data-table/row.tsx +6 -2
- package/src/renderers/electrobun/view/desktop/controls.tsx +1 -1
- package/src/renderers/electrobun/view/desktop/popover.tsx +23 -0
- package/src/renderers/electrobun/view/desktop/window/bridge.ts +4 -4
- package/src/renderers/electrobun/view/dialog-host.tsx +21 -58
- package/src/renderers/electrobun/view/dom-host-providers.tsx +64 -0
- package/src/renderers/electrobun/view/dom-ui-host.tsx +5 -21
- package/src/renderers/electrobun/view/external-plugins.ts +17 -5
- package/src/renderers/electrobun/view/fatal-screen.tsx +1 -42
- package/src/renderers/electrobun/view/host/ascii-text.ts +6 -29
- package/src/renderers/electrobun/view/host/block-glyph-canvas.tsx +1 -1
- package/src/renderers/electrobun/view/host/focus-scope.ts +1 -1
- package/src/renderers/electrobun/view/host/input.tsx +95 -163
- package/src/renderers/electrobun/view/host/mouse.ts +1 -1
- package/src/renderers/electrobun/view/host/native.ts +2 -2
- package/src/renderers/electrobun/view/host/scroll-box.tsx +1 -1
- package/src/renderers/electrobun/view/host/style.ts +1 -1
- package/src/renderers/electrobun/view/host/surface-3d.tsx +2 -2
- package/src/renderers/electrobun/view/host/tabs.tsx +1 -1
- package/src/renderers/electrobun/view/host/text.tsx +1 -1
- package/src/renderers/electrobun/view/http-fetch.ts +13 -64
- package/src/renderers/electrobun/view/input-host.tsx +20 -35
- package/src/renderers/electrobun/view/key-event.ts +7 -5
- package/src/renderers/electrobun/view/main.tsx +76 -34
- package/src/renderers/electrobun/view/native-renderer.ts +6 -1
- package/src/renderers/electrobun/view/native-stubs/backend-rpc.ts +3 -58
- package/src/renderers/electrobun/view/remote/asset-data-client.ts +3 -6
- package/src/renderers/electrobun/view/remote/backend-quote-subscription.ts +34 -38
- package/src/renderers/electrobun/view/remote/connection-health.ts +14 -32
- package/src/renderers/electrobun/view/remote/persistence.ts +32 -63
- package/src/renderers/electrobun/view/remote/quote-subscription-registry.ts +2 -5
- package/src/renderers/electrobun/view/rpc-codec.ts +18 -20
- package/src/renderers/electrobun/view/screenshot-watermark.ts +1 -1
- package/src/renderers/electrobun/view/test-utils.tsx +4 -11
- package/src/renderers/electrobun/view/toast-host.tsx +29 -87
- package/src/renderers/electrobun/view/ui-host.tsx +8 -1
- package/src/renderers/electrobun/view/update-host.ts +2 -2
- package/src/renderers/opentui/chart-surface.tsx +11 -124
- package/src/renderers/opentui/dialog-host.tsx +45 -130
- package/src/renderers/opentui/host.tsx +3 -2
- package/src/renderers/opentui/image/surface.tsx +15 -174
- package/src/renderers/opentui/kitty-services.ts +15 -0
- package/src/renderers/opentui/native-surface.ts +176 -0
- package/src/renderers/opentui/start.tsx +57 -42
- package/src/renderers/opentui/test-utils.tsx +4 -20
- package/src/renderers/opentui/toast-host.tsx +7 -95
- package/src/renderers/opentui/ui-host.tsx +87 -2
- package/src/renderers/share/chart.ts +1 -1
- package/src/renderers/share/layout-view.tsx +2 -2
- package/src/shares/api.ts +0 -5
- package/src/shares/payload.ts +13 -16
- package/src/sources/gloomberb-cloud/index.ts +14 -15
- package/src/sources/gloomberb-cloud/news.ts +8 -4
- package/src/sources/gloomberb-cloud/normalizers.ts +34 -76
- package/src/sources/history-coverage.ts +25 -84
- package/src/sources/history-result.ts +2 -0
- package/src/sources/history-retention.ts +9 -11
- package/src/sources/provider-router/batches.ts +0 -4
- package/src/sources/provider-router/brokers.ts +2 -13
- package/src/sources/provider-router/cache.ts +38 -159
- package/src/sources/provider-router/cached-routes.ts +26 -1
- package/src/sources/provider-router/financial-routes.ts +3 -10
- package/src/sources/provider-router/financials.ts +2 -3
- package/src/sources/provider-router/history.ts +20 -70
- package/src/sources/provider-router/index.ts +8 -2
- package/src/sources/provider-router/news.ts +2 -1
- package/src/sources/provider-router/primary.ts +0 -8
- package/src/sources/provider-router/quote-route.ts +2 -2
- package/src/sources/provider-router/realtime-access.ts +10 -29
- package/src/sources/provider-router/search.ts +3 -12
- package/src/sources/provider-router/test-support.ts +0 -89
- package/src/sources/sec-edgar/acceptance-time.ts +11 -0
- package/src/sources/sec-edgar/fourth-quarter.ts +179 -0
- package/src/sources/sec-edgar.ts +47 -228
- package/src/sources/yahoo-finance/financials.ts +35 -13
- package/src/sources/yahoo-finance/history.ts +22 -58
- package/src/sources/yahoo-finance/http.ts +17 -25
- package/src/sources/yahoo-finance/mappers.ts +0 -23
- package/src/sources/yahoo-finance/options.ts +36 -44
- package/src/sources/yahoo-finance/quote-summary.ts +90 -141
- package/src/sources/yahoo-finance/requests.ts +22 -12
- package/src/sources/yahoo-finance/snapshots.ts +4 -6
- package/src/sources/yahoo-finance/symbols.ts +25 -0
- package/src/sources/yahoo-finance/yahoo-chart-interval.ts +1 -1
- package/src/sources/yahoo-finance.ts +80 -188
- package/src/state/app/bootstrap.ts +5 -5
- package/src/state/app/context/index.tsx +10 -13
- package/src/state/hooks/live-streaming.ts +60 -0
- package/src/state/hooks/quote-streaming.ts +16 -57
- package/src/state/hooks/session-snapshot.ts +0 -1
- package/src/state/pane-scroll-registry.tsx +9 -0
- package/src/sync/controller.ts +3 -1
- package/src/sync/core-contributors.ts +69 -37
- package/src/sync/profile-analytics.ts +5 -2
- package/src/telemetry/crash-reports-dom.ts +74 -0
- package/src/telemetry/crash-reports-node.ts +170 -0
- package/src/telemetry/crash-reports.ts +353 -0
- package/src/telemetry/live-config.ts +19 -0
- package/src/telemetry/usage-counts-dom.ts +22 -0
- package/src/telemetry/usage-counts.ts +391 -0
- package/src/test-support/app-store.ts +21 -0
- package/src/test-support/broker.ts +80 -0
- package/src/test-support/cli-context.ts +28 -0
- package/src/test-support/cloud-api.ts +85 -0
- package/src/test-support/console.ts +40 -0
- package/src/test-support/data-provider.ts +30 -0
- package/src/test-support/headless.ts +32 -0
- package/src/test-support/network-guard.ts +35 -0
- package/src/test-support/news.ts +21 -0
- package/src/test-support/pane.tsx +42 -22
- package/src/test-support/quote-store.ts +49 -0
- package/src/test-support/renderer-host.ts +10 -0
- package/src/test-support/rpc-loopback.ts +22 -0
- package/src/test-support/temp-db.ts +19 -0
- package/src/test-support/ticker.ts +15 -0
- package/src/test-support/time-series.ts +27 -0
- package/src/theme/app-icon.ts +127 -0
- package/src/theme/color-utils.ts +2 -1
- package/src/theme/themes.ts +3 -1
- package/src/time-series/alignment.ts +4 -7
- package/src/time-series/chart-data.ts +2 -3
- package/src/time-series/forward-valuation.ts +6 -9
- package/src/time-series/fundamentals.ts +34 -96
- package/src/time-series/live-bars.ts +12 -15
- package/src/time-series/live-quotes.ts +4 -26
- package/src/time-series/market.ts +6 -9
- package/src/time-series/parsed-history-cache.ts +0 -4
- package/src/time-series/resolution.ts +35 -1
- package/src/time-series/resolve.ts +28 -20
- package/src/time-series/session-history.ts +4 -23
- package/src/time-series/spec.ts +11 -16
- package/src/time-series/studies.ts +26 -15
- package/src/time-series/transforms.ts +6 -9
- package/src/time-series/types.ts +6 -3
- package/src/types/broker.ts +10 -0
- package/src/types/config.ts +24 -2
- package/src/types/data-provider.ts +13 -1
- package/src/types/desktop-menu.ts +3 -1
- package/src/types/financials.ts +71 -20
- package/src/types/instrument.ts +2 -1
- package/src/types/plugin.ts +30 -0
- package/src/types/price-history.ts +2 -0
- package/src/types/trading.ts +21 -2
- package/src/ui/dialog-stack.ts +80 -0
- package/src/ui/dialog.tsx +33 -2
- package/src/ui/host.tsx +17 -0
- package/src/ui/index.tsx +3 -10
- package/src/ui/toast.tsx +95 -0
- package/src/updater/index.ts +472 -0
- package/src/utils/async-deadline.ts +34 -0
- package/src/utils/calendar-date.ts +20 -0
- package/src/utils/csv.ts +19 -2
- package/src/utils/datetime-format.ts +103 -6
- package/src/utils/double-escape-close.ts +1 -23
- package/src/utils/errors.ts +4 -0
- package/src/utils/exchanges.ts +10 -0
- package/src/utils/financial-statements.ts +6 -25
- package/src/utils/format.ts +6 -17
- package/src/utils/futures-generic.ts +159 -0
- package/src/utils/guards.ts +37 -0
- package/src/utils/hash.ts +17 -2
- package/src/utils/http-proxy-response.ts +122 -4
- package/src/utils/math.ts +12 -0
- package/src/utils/platform.ts +34 -0
- package/src/utils/plugin-proxy-hosts.json +1 -2
- package/src/utils/plugin-proxy-hosts.ts +3 -0
- package/src/utils/price-history-integrity.ts +5 -8
- package/src/utils/price-history.ts +36 -11
- package/src/utils/sec.ts +3 -8
- package/src/utils/semver.ts +15 -0
- package/src/utils/shortcut-labels.ts +4 -29
- package/src/utils/sort-values.ts +28 -0
- package/src/utils/statement-gaps.ts +94 -0
- package/src/utils/zoned-date-time.ts +12 -0
- package/src/api-client/askg.test.ts +0 -256
- package/src/api-client/errors.test.ts +0 -11
- package/src/api-client/index.test.ts +0 -1591
- package/src/api-client/paths.test.ts +0 -32
- package/src/api-client/request.test.ts +0 -153
- package/src/api-client/research-activity.test.ts +0 -316
- package/src/api-client/session-request-lifetime.test.ts +0 -184
- package/src/api-client/socket-health.test.ts +0 -86
- package/src/api-client/socket-lifetime.test.ts +0 -76
- package/src/api-client/socket-protocol.test.ts +0 -90
- package/src/api-client/tape-socket.test.ts +0 -44
- package/src/api-client/teams.test.ts +0 -270
- package/src/app/app-bootstrap-state.test.ts +0 -157
- package/src/app/global-shortcuts.test.tsx +0 -468
- package/src/app/keybindings/chord.test.ts +0 -131
- package/src/app/keybindings/resolve.test.ts +0 -103
- package/src/app/language-observer.test.tsx +0 -82
- package/src/app/pane-runtime/layout-placement.test.ts +0 -27
- package/src/app/pane-runtime/plugin-bindings.test.ts +0 -117
- package/src/app/pane-runtime/ticker-navigation-runtime.test.ts +0 -144
- package/src/app/pane-runtime/ticker-open-runtime.test.tsx +0 -170
- package/src/app/pane-template-dialog-wizard.test.tsx +0 -36
- package/src/app/runtime/broker-import.test.tsx +0 -89
- package/src/app/runtime/desktop-deeplink.test.ts +0 -169
- package/src/app/runtime/layout-warmup.test.ts +0 -73
- package/src/app/runtime/ticker-refresh.test.tsx +0 -115
- package/src/architecture/browser-entry-graph.test.ts +0 -97
- package/src/architecture/import-boundaries.test.ts +0 -136
- package/src/assets/gloomberb-logo.ico +0 -0
- package/src/assets/gloomberb-logo.png +0 -0
- package/src/brokers/bond-price-basis.test.ts +0 -35
- package/src/brokers/legacy-contract.test.ts +0 -51
- package/src/brokers/profile-form.test.ts +0 -71
- package/src/brokers/sync-broker-instance.test.ts +0 -599
- package/src/brokers/test-broker.ts +0 -68
- package/src/capabilities/registry.test.ts +0 -297
- package/src/cli/base-converter.test.ts +0 -16
- package/src/cli/commands/automation.ts +0 -98
- package/src/cli/commands/futures-price-precision.test.tsx +0 -65
- package/src/cli/commands/keybindings.test.ts +0 -48
- package/src/cli/commands/market-fx.test.ts +0 -77
- package/src/cli/commands/market-options.test.ts +0 -44
- package/src/cli/commands/plugins.test.ts +0 -29
- package/src/cli/commands/quote-price-basis.test.ts +0 -88
- package/src/cli/commands/ticker-financial-units.test.ts +0 -78
- package/src/cli/commands/ticker-period.test.ts +0 -62
- package/src/cli/context.test.ts +0 -63
- package/src/cli/entry.test.ts +0 -58
- package/src/cli/history-rows.test.ts +0 -47
- package/src/cli/options.test.ts +0 -45
- package/src/cli/pane-functions/cloud-session.test.ts +0 -77
- package/src/cli/pane-functions/data.test.ts +0 -17
- package/src/cli/pane-functions/discovery.test.ts +0 -36
- package/src/cli/pane-functions/dom.test.ts +0 -69
- package/src/cli/pane-functions/headless.test.ts +0 -314
- package/src/cli/pane-functions/index.test.ts +0 -266
- package/src/cli/pane-functions/intraday-shot.test.ts +0 -399
- package/src/cli/pane-functions/report.test.ts +0 -107
- package/src/cli/pane-functions/screenshot.test.ts +0 -927
- package/src/cli/registry.test.ts +0 -256
- package/src/cli/result.test.ts +0 -133
- package/src/cli/ticker-resolution.test.ts +0 -39
- package/src/cli/visible-key-values.test.ts +0 -23
- package/src/cli.test.ts +0 -437
- package/src/components/chart/composite/axis-overlays.test.tsx +0 -80
- package/src/components/chart/composite/composite-chart.test.tsx +0 -2019
- package/src/components/chart/composite/downsample.test.ts +0 -136
- package/src/components/chart/composite/format.test.ts +0 -258
- package/src/components/chart/composite/fx-precision.test.ts +0 -111
- package/src/components/chart/composite/interactions.test.ts +0 -231
- package/src/components/chart/composite/panel-series.test.ts +0 -66
- package/src/components/chart/composite/price-axis-labels.test.ts +0 -50
- package/src/components/chart/composite/price-series.test.ts +0 -39
- package/src/components/chart/composite/renderers.test.ts +0 -823
- package/src/components/chart/composite/scene-market-cursor.test.ts +0 -148
- package/src/components/chart/composite/scene.test.ts +0 -845
- package/src/components/chart/composite/scroll-surface.test.tsx +0 -153
- package/src/components/chart/composite/time-axis.test.ts +0 -281
- package/src/components/chart/composite/time-scale.test.ts +0 -88
- package/src/components/chart/composite/tools.test.ts +0 -371
- package/src/components/chart/curve/curve-surface.test.tsx +0 -53
- package/src/components/chart/curve/model.test.ts +0 -115
- package/src/components/chart/native/bitmap-support.test.ts +0 -27
- package/src/components/chart/native/kitty/index.test.ts +0 -537
- package/src/components/chart/static/chart-surface.test.tsx +0 -159
- package/src/components/chart/static/multi-line-chart-surface.tsx +0 -105
- package/src/components/chart/static/scatter-chart-surface.test.ts +0 -30
- package/src/components/chart/static/trail-chart-model.test.ts +0 -36
- package/src/components/chart/surface3d/model.test.ts +0 -117
- package/src/components/chart/surface3d/software.test.ts +0 -32
- package/src/components/command-bar/assist/inventory.test.ts +0 -93
- package/src/components/command-bar/assist/model.test.ts +0 -185
- package/src/components/command-bar/helpers.test.ts +0 -162
- package/src/components/command-bar/layout-items/current-layout.test.ts +0 -165
- package/src/components/command-bar/list/badge.test.ts +0 -54
- package/src/components/command-bar/list/model.test.ts +0 -129
- package/src/components/command-bar/list/view.test.tsx +0 -113
- package/src/components/command-bar/pane-settings.test.ts +0 -141
- package/src/components/command-bar/panel/layout.test.ts +0 -171
- package/src/components/command-bar/routes/root/results.test.ts +0 -161
- package/src/components/command-bar/routes/root/search-providers.test.tsx +0 -224
- package/src/components/command-bar/routes/root/selection.test.ts +0 -54
- package/src/components/command-bar/routes/root/shortcuts.test.ts +0 -193
- package/src/components/command-bar/routes/ticker-search/results.test.ts +0 -128
- package/src/components/command-bar/surface/assist.test.tsx +0 -341
- package/src/components/command-bar/surface/index.test.tsx +0 -1208
- package/src/components/command-bar/surface/listing-selection.test.tsx +0 -84
- package/src/components/command-bar/surface/pane.test.tsx +0 -937
- package/src/components/command-bar/surface/portfolio.test.tsx +0 -453
- package/src/components/command-bar/surface/test-harness.tsx +0 -353
- package/src/components/command-bar/view-model.test.ts +0 -228
- package/src/components/command-bar/workflow/broker.test.ts +0 -22
- package/src/components/command-bar/workflow/collection-actions.test.ts +0 -105
- package/src/components/command-bar/workflow/collection-identity.test.ts +0 -180
- package/src/components/command-bar/workflow/ops.test.ts +0 -804
- package/src/components/command-bar/workflow/route-actions.test.ts +0 -34
- package/src/components/command-bar/workflow/ticker-listing-picker.test.ts +0 -41
- package/src/components/company-logo.test.ts +0 -19
- package/src/components/data-table/export.test.ts +0 -21
- package/src/components/data-table/frozen-column.test.tsx +0 -114
- package/src/components/data-table/horizontal-navigation.test.tsx +0 -181
- package/src/components/data-table/stack-view.test.tsx +0 -226
- package/src/components/data-table/view.test.tsx +0 -343
- package/src/components/feed-data-table/stack-view.test.tsx +0 -46
- package/src/components/input-search-bar.test.tsx +0 -137
- package/src/components/layout/header.test.tsx +0 -82
- package/src/components/layout/market-summary.test.ts +0 -81
- package/src/components/layout/pane/content.test.tsx +0 -103
- package/src/components/layout/pane/cycle-order.test.ts +0 -29
- package/src/components/layout/pane/footer/current-actions.test.tsx +0 -108
- package/src/components/layout/pane/footer/index.test.tsx +0 -199
- package/src/components/layout/pane/footer/keyboard.test.ts +0 -57
- package/src/components/layout/pane/footer/notice.desktop.test.tsx +0 -57
- package/src/components/layout/pane/keyboard-scroll.test.tsx +0 -146
- package/src/components/layout/pane/sidebar.test.tsx +0 -187
- package/src/components/layout/pane/sizing.test.ts +0 -46
- package/src/components/layout/shell/index.test.tsx +0 -1377
- package/src/components/layout/shell/layout-state.test.ts +0 -33
- package/src/components/layout/shell/menu.test.ts +0 -89
- package/src/components/layout/shell/pane-occlusion.test.ts +0 -52
- package/src/components/layout/shell/ticker-link-menu.test.ts +0 -82
- package/src/components/layout/status-bar-groups.test.ts +0 -92
- package/src/components/layout/status-bar.test.tsx +0 -306
- package/src/components/layout/window-edit/mode.test.ts +0 -167
- package/src/components/metric-treemap/layout.test.ts +0 -77
- package/src/components/metric-treemap/surface.test.tsx +0 -62
- package/src/components/onboarding/first-run-workspace.test.ts +0 -81
- package/src/components/onboarding/onboarding-wizard.test.tsx +0 -1097
- package/src/components/onboarding/wizard-model.test.ts +0 -67
- package/src/components/pane-settings-dialog.test.tsx +0 -278
- package/src/components/pane-template-wizard.test.tsx +0 -51
- package/src/components/price-sparkline/model.test.ts +0 -27
- package/src/components/quote-flash.test.ts +0 -30
- package/src/components/sign-in-gate.test.tsx +0 -60
- package/src/components/table-view-shared.test.ts +0 -11
- package/src/components/ticker/badge/format.test.ts +0 -66
- package/src/components/ticker/badge/list.test.tsx +0 -84
- package/src/components/ticker/badge/text.test.tsx +0 -223
- package/src/components/ticker/list-table.test.tsx +0 -281
- package/src/components/ui/data-table/opentui/model.test.ts +0 -47
- package/src/components/ui/data-table/visible-range.test.ts +0 -29
- package/src/components/ui/display.desktop.test.tsx +0 -55
- package/src/components/ui/display.test.tsx +0 -36
- package/src/components/ui/external-link.test.tsx +0 -54
- package/src/components/ui/message-composer.test.tsx +0 -81
- package/src/components/ui/page-stack-view.test.tsx +0 -126
- package/src/components/ui/prose.desktop.test.tsx +0 -50
- package/src/components/ui/prose.test.ts +0 -22
- package/src/components/ui/row-value-cache.test.ts +0 -17
- package/src/components/ui/table-layout.test.ts +0 -108
- package/src/components/ui/tabs.test.tsx +0 -114
- package/src/components/ui/ui.test.tsx +0 -984
- package/src/components/use-pane-notice-footer.test.tsx +0 -116
- package/src/core/app-runtime.test.ts +0 -144
- package/src/core/app-services.test.ts +0 -66
- package/src/core/connection-health.test.ts +0 -143
- package/src/data/cached-query.test.ts +0 -95
- package/src/data/config/home.test.ts +0 -70
- package/src/data/config/store/index.test.ts +0 -1241
- package/src/data/memory-resource-store.test.ts +0 -24
- package/src/data/plugin-cache.test.ts +0 -46
- package/src/data/sqlite/cache.test.ts +0 -330
- package/src/data/sqlite/retry.test.ts +0 -84
- package/src/feedback/diagnostics.test.ts +0 -30
- package/src/feedback/redact.test.ts +0 -50
- package/src/feedback/screenshot.test.ts +0 -22
- package/src/i18n/index.test.ts +0 -134
- package/src/i18n/languages.test.ts +0 -34
- package/src/index.tsx +0 -6
- package/src/layout-marketplace/api.test.ts +0 -54
- package/src/layout-marketplace/cloud.test.ts +0 -154
- package/src/layout-marketplace/gallery-desktop.test.tsx +0 -216
- package/src/layout-marketplace/gallery.test.tsx +0 -149
- package/src/layout-marketplace/geometry.test.ts +0 -47
- package/src/layout-marketplace/mini-workspace.test.tsx +0 -69
- package/src/layout-marketplace/model.test.ts +0 -118
- package/src/layout-marketplace/name-dialog.tsx +0 -60
- package/src/layout-marketplace/payload.test.ts +0 -419
- package/src/market-data/coordinator/chart-session.test.ts +0 -152
- package/src/market-data/coordinator/events.test.ts +0 -68
- package/src/market-data/coordinator/fx-refresh.test.ts +0 -199
- package/src/market-data/coordinator/index.test.ts +0 -1174
- package/src/market-data/coordinator/options-sharing.test.ts +0 -79
- package/src/market-data/coordinator/subscriptions.test.ts +0 -652
- package/src/market-data/frame-scheduler.test.ts +0 -82
- package/src/market-data/history-session.test.ts +0 -151
- package/src/market-data/hooks.test.tsx +0 -263
- package/src/market-data/legacy-contract-hooks.test.tsx +0 -49
- package/src/market-data/legacy-contract.test.ts +0 -99
- package/src/market-data/market/format.test.ts +0 -284
- package/src/market-data/market/status.test.ts +0 -26
- package/src/market-data/performance.test.ts +0 -83
- package/src/market-data/portfolio-instrument.test.ts +0 -80
- package/src/market-data/published-us-sessions.test.ts +0 -65
- package/src/market-data/query-store.test.ts +0 -87
- package/src/market-data/quote-subscription-target.test.ts +0 -56
- package/src/market-data/quotes/day-range.test.ts +0 -84
- package/src/market-data/quotes/freshness.test.ts +0 -277
- package/src/market-data/quotes/observation-time.test.ts +0 -98
- package/src/market-data/quotes/price-basis.test.ts +0 -44
- package/src/market-data/quotes/resolution.test.ts +0 -612
- package/src/market-data/quotes/time.test.ts +0 -41
- package/src/market-data/request-types.test.ts +0 -110
- package/src/market-data/snapshot-contract.test.ts +0 -110
- package/src/market-data/snapshot-provider.test.ts +0 -251
- package/src/market-data/ticker-price-returns.test.ts +0 -26
- package/src/news/aggregator.test.ts +0 -596
- package/src/news/hooks.test.tsx +0 -66
- package/src/notifications/app-notifier.test.ts +0 -199
- package/src/pane-settings.test.ts +0 -38
- package/src/plugins/builtin/account-management/model.test.ts +0 -149
- package/src/plugins/builtin/account-management/navigation.test.ts +0 -27
- package/src/plugins/builtin/alerts/alert-engine.test.ts +0 -105
- package/src/plugins/builtin/alerts/events.test.ts +0 -28
- package/src/plugins/builtin/alerts/index.test.tsx +0 -459
- package/src/plugins/builtin/alerts/research.test.ts +0 -75
- package/src/plugins/builtin/analytics/broker-performance.test.ts +0 -79
- package/src/plugins/builtin/analytics/index.test.tsx +0 -657
- package/src/plugins/builtin/analytics/metrics.test.ts +0 -138
- package/src/plugins/builtin/analytics/pane-model.test.ts +0 -191
- package/src/plugins/builtin/analytics/portfolio-identity.test.tsx +0 -272
- package/src/plugins/builtin/analytics/return-window.test.ts +0 -72
- package/src/plugins/builtin/analytics/risk-client.test.ts +0 -100
- package/src/plugins/builtin/analytics/risk-evidence.test.ts +0 -123
- package/src/plugins/builtin/analytics/risk-headless.test.ts +0 -27
- package/src/plugins/builtin/analytics/risk-math.test.ts +0 -95
- package/src/plugins/builtin/analytics/risk-model.test.ts +0 -284
- package/src/plugins/builtin/analytics/sector-model.test.ts +0 -56
- package/src/plugins/builtin/analytics/sharpe-cadence.test.ts +0 -111
- package/src/plugins/builtin/backtest/engine.test.ts +0 -71
- package/src/plugins/builtin/bond-calculator/math.test.ts +0 -97
- package/src/plugins/builtin/bond-calculator/model.test.ts +0 -56
- package/src/plugins/builtin/bond-calculator/pane.test.tsx +0 -84
- package/src/plugins/builtin/broker-manager/index.test.tsx +0 -173
- package/src/plugins/builtin/broker-manager/model.test.ts +0 -145
- package/src/plugins/builtin/buildout/cells.test.tsx +0 -31
- package/src/plugins/builtin/buildout/pane/header.tsx +0 -30
- package/src/plugins/builtin/cds/client.test.ts +0 -103
- package/src/plugins/builtin/cds/headless.test.ts +0 -48
- package/src/plugins/builtin/cds/model.test.ts +0 -242
- package/src/plugins/builtin/cds/pane.test.tsx +0 -139
- package/src/plugins/builtin/central-bank-rates/model.test.ts +0 -84
- package/src/plugins/builtin/changelog/model.test.ts +0 -77
- package/src/plugins/builtin/chart-composer/catalog-inventory.test.ts +0 -105
- package/src/plugins/builtin/chart-composer/editor/model.test.ts +0 -85
- package/src/plugins/builtin/chart-composer/editor.test.tsx +0 -341
- package/src/plugins/builtin/chart-composer/financial-periods.fixture.json +0 -225
- package/src/plugins/builtin/chart-composer/follow-binding.test.tsx +0 -253
- package/src/plugins/builtin/chart-composer/headless.test.ts +0 -158
- package/src/plugins/builtin/chart-composer/loading.test.tsx +0 -134
- package/src/plugins/builtin/chart-composer/pane-share.test.ts +0 -144
- package/src/plugins/builtin/chart-composer/presets.test.ts +0 -672
- package/src/plugins/builtin/chart-composer/quick-add.test.tsx +0 -245
- package/src/plugins/builtin/chart-composer/quote-metadata.test.ts +0 -176
- package/src/plugins/builtin/chart-composer/series-catalog.test.ts +0 -104
- package/src/plugins/builtin/chart-composer/served-cadence-snapshot.test.ts +0 -161
- package/src/plugins/builtin/chart-composer/settings.test.ts +0 -200
- package/src/plugins/builtin/chart-composer/shortcuts.test.ts +0 -44
- package/src/plugins/builtin/chart-composer/use-series-catalog.test.tsx +0 -94
- package/src/plugins/builtin/chart-composer/viewport-labels.test.ts +0 -13
- package/src/plugins/builtin/chat/chat.test.tsx +0 -1481
- package/src/plugins/builtin/chat/composer-commands.test.ts +0 -30
- package/src/plugins/builtin/chat/content/composer-runtime.test.tsx +0 -144
- package/src/plugins/builtin/chat/content/mentions.test.ts +0 -74
- package/src/plugins/builtin/chat/controller/session-lifetime.test.ts +0 -182
- package/src/plugins/builtin/chat/controller/session.test.ts +0 -25
- package/src/plugins/builtin/chat/controller.test.ts +0 -1894
- package/src/plugins/builtin/chat/message/desktop.test.tsx +0 -88
- package/src/plugins/builtin/chat/message/profile-popover.test.tsx +0 -127
- package/src/plugins/builtin/chat/pane-state.test.ts +0 -31
- package/src/plugins/builtin/chat/sidebar.test.tsx +0 -830
- package/src/plugins/builtin/chat/test-harness.test.ts +0 -46
- package/src/plugins/builtin/chat/test-harness.tsx +0 -267
- package/src/plugins/builtin/cloud/askg/controller.test.ts +0 -525
- package/src/plugins/builtin/cloud/askg/conversation-store.test.ts +0 -230
- package/src/plugins/builtin/cloud/askg/executor.test.ts +0 -160
- package/src/plugins/builtin/cloud/askg/manifest.test.ts +0 -153
- package/src/plugins/builtin/cloud/askg/model.test.ts +0 -349
- package/src/plugins/builtin/cloud/askg/pane.test.tsx +0 -356
- package/src/plugins/builtin/cloud/askg/protocol.test.ts +0 -190
- package/src/plugins/builtin/cloud/askg/undo.test.ts +0 -44
- package/src/plugins/builtin/cloud/auth-model.test.ts +0 -67
- package/src/plugins/builtin/cloud/buildout-module.tsx +0 -23
- package/src/plugins/builtin/cloud/device-signin.test.ts +0 -217
- package/src/plugins/builtin/cloud/reveal-in-scroll-box.ts +0 -34
- package/src/plugins/builtin/cloud/team/collections.test.ts +0 -126
- package/src/plugins/builtin/cloud/team/model.test.ts +0 -174
- package/src/plugins/builtin/cloud/team/pane-model.test.ts +0 -114
- package/src/plugins/builtin/cloud/team/pane.test.tsx +0 -234
- package/src/plugins/builtin/cloud/team/store.test.ts +0 -231
- package/src/plugins/builtin/cloud/thesis/board-pane.test.tsx +0 -266
- package/src/plugins/builtin/cloud/thesis/model.test.ts +0 -171
- package/src/plugins/builtin/cloud-tweets/pane-share.test.ts +0 -56
- package/src/plugins/builtin/cloud-tweets/table.test.tsx +0 -125
- package/src/plugins/builtin/congress-trades/aggregates.test.ts +0 -27
- package/src/plugins/builtin/congress-trades/headless.test.ts +0 -113
- package/src/plugins/builtin/congress-trades/model.test.ts +0 -129
- package/src/plugins/builtin/connections/pane.test.tsx +0 -84
- package/src/plugins/builtin/correlation/colors.test.ts +0 -39
- package/src/plugins/builtin/correlation/compute.test.ts +0 -97
- package/src/plugins/builtin/correlation/headless.test.ts +0 -147
- package/src/plugins/builtin/correlation/index.test.tsx +0 -155
- package/src/plugins/builtin/correlation/relationship/history.test.tsx +0 -62
- package/src/plugins/builtin/correlation/relationship/layout.test.ts +0 -17
- package/src/plugins/builtin/cot/model.test.ts +0 -89
- package/src/plugins/builtin/credit-conditions/client.test.ts +0 -122
- package/src/plugins/builtin/credit-conditions/headless.test.ts +0 -35
- package/src/plugins/builtin/credit-conditions/index.test.tsx +0 -136
- package/src/plugins/builtin/credit-conditions/model.test.ts +0 -56
- package/src/plugins/builtin/crypto-board/client.test.ts +0 -51
- package/src/plugins/builtin/crypto-board/model.test.ts +0 -111
- package/src/plugins/builtin/crypto-board/pane.test.tsx +0 -130
- package/src/plugins/builtin/crypto-board/test-fixture.ts +0 -80
- package/src/plugins/builtin/custom-view/live-quotes.test.ts +0 -53
- package/src/plugins/builtin/custom-view/view-spec.test.ts +0 -134
- package/src/plugins/builtin/debt-maturities/debt-maturities.test.ts +0 -317
- package/src/plugins/builtin/dividend-yield/calendar.ts +0 -9
- package/src/plugins/builtin/dividend-yield/client.test.ts +0 -260
- package/src/plugins/builtin/dividend-yield/dividend-source-integrity.test.ts +0 -233
- package/src/plugins/builtin/dividend-yield/headless.test.ts +0 -123
- package/src/plugins/builtin/dividend-yield/pane.test.tsx +0 -351
- package/src/plugins/builtin/dividend-yield/provider-client.test.ts +0 -61
- package/src/plugins/builtin/dividend-yield/reference-price.test.ts +0 -115
- package/src/plugins/builtin/dividend-yield/view.test.ts +0 -81
- package/src/plugins/builtin/earnings/data/cache.test.ts +0 -117
- package/src/plugins/builtin/earnings/detail-model.test.ts +0 -103
- package/src/plugins/builtin/earnings/detail-model.ts +0 -165
- package/src/plugins/builtin/earnings/detail-view.tsx +0 -136
- package/src/plugins/builtin/earnings/estimate-basis.test.ts +0 -184
- package/src/plugins/builtin/earnings/estimate-fixtures.test-data.ts +0 -327
- package/src/plugins/builtin/earnings/headless.test.ts +0 -82
- package/src/plugins/builtin/earnings/model.test.ts +0 -98
- package/src/plugins/builtin/earnings/table.test.ts +0 -76
- package/src/plugins/builtin/earnings/table.ts +0 -246
- package/src/plugins/builtin/earnings-calls/data.test.ts +0 -252
- package/src/plugins/builtin/earnings-calls/headless-freshness.test.ts +0 -41
- package/src/plugins/builtin/earnings-calls/headless.test.ts +0 -258
- package/src/plugins/builtin/earnings-calls/pane.test.tsx +0 -520
- package/src/plugins/builtin/earnings-calls/prose.test.ts +0 -51
- package/src/plugins/builtin/econ/calendar-model.test.ts +0 -82
- package/src/plugins/builtin/econ/fred-cache.test.ts +0 -188
- package/src/plugins/builtin/econ/fred-client.test.ts +0 -79
- package/src/plugins/builtin/econ/index.test.tsx +0 -144
- package/src/plugins/builtin/econ-statistics/client.test.ts +0 -122
- package/src/plugins/builtin/econ-statistics/headless.test.ts +0 -54
- package/src/plugins/builtin/econ-statistics/pane.test.tsx +0 -69
- package/src/plugins/builtin/econ-statistics/transform.test.ts +0 -109
- package/src/plugins/builtin/econ-statistics/transform.ts +0 -94
- package/src/plugins/builtin/econ-statistics/trend.ts +0 -57
- package/src/plugins/builtin/econ-statistics/view.test.ts +0 -43
- package/src/plugins/builtin/equity-screener/headless.test.ts +0 -22
- package/src/plugins/builtin/equity-screener/model.test.ts +0 -116
- package/src/plugins/builtin/equity-screener/results.test.tsx +0 -44
- package/src/plugins/builtin/equity-screener/test-fixture.ts +0 -63
- package/src/plugins/builtin/estimate-revisions/model.test.ts +0 -253
- package/src/plugins/builtin/estimate-revisions/sorting.test.ts +0 -91
- package/src/plugins/builtin/executives/format.test.ts +0 -23
- package/src/plugins/builtin/executives/pane.test.tsx +0 -339
- package/src/plugins/builtin/filing-events/feed.test.ts +0 -143
- package/src/plugins/builtin/filing-events/pane.test.tsx +0 -125
- package/src/plugins/builtin/futures/model.test.ts +0 -151
- package/src/plugins/builtin/futures/pane.test.tsx +0 -219
- package/src/plugins/builtin/futures/table.test.ts +0 -155
- package/src/plugins/builtin/futures-curve/model.test.ts +0 -90
- package/src/plugins/builtin/fx-matrix/export.test.ts +0 -30
- package/src/plugins/builtin/fx-matrix/pairs.test.ts +0 -16
- package/src/plugins/builtin/fx-matrix/pane.test.tsx +0 -109
- package/src/plugins/builtin/fx-matrix/refresh.test.tsx +0 -69
- package/src/plugins/builtin/help/components.tsx +0 -44
- package/src/plugins/builtin/help/keybindings-editor.test.tsx +0 -164
- package/src/plugins/builtin/holders/headless.test.ts +0 -58
- package/src/plugins/builtin/holders/index.test.ts +0 -12
- package/src/plugins/builtin/holders/thirteenf-match.test.ts +0 -30
- package/src/plugins/builtin/insider/amendments.test.ts +0 -112
- package/src/plugins/builtin/insider/headless.test.ts +0 -136
- package/src/plugins/builtin/insider/insider-data.test.ts +0 -66
- package/src/plugins/builtin/insider/pane.test.tsx +0 -112
- package/src/plugins/builtin/iv-history/client.test.ts +0 -18
- package/src/plugins/builtin/iv-history/model.test.ts +0 -87
- package/src/plugins/builtin/jobs/model.test.ts +0 -119
- package/src/plugins/builtin/jobs/pages.test.tsx +0 -103
- package/src/plugins/builtin/kelly-sizer/index.test.tsx +0 -202
- package/src/plugins/builtin/kelly-sizer/model.test.ts +0 -158
- package/src/plugins/builtin/kelly-sizer/view.test.tsx +0 -88
- package/src/plugins/builtin/market-movers/headless.test.ts +0 -34
- package/src/plugins/builtin/market-movers/integrity.test.ts +0 -119
- package/src/plugins/builtin/market-movers/pane-research.test.tsx +0 -138
- package/src/plugins/builtin/market-movers/screener.test.ts +0 -333
- package/src/plugins/builtin/market-valuation/client.test.ts +0 -283
- package/src/plugins/builtin/market-valuation/headless.test.ts +0 -75
- package/src/plugins/builtin/market-valuation/model.test.ts +0 -405
- package/src/plugins/builtin/market-valuation/pane.test.tsx +0 -235
- package/src/plugins/builtin/market-valuation/trend.ts +0 -87
- package/src/plugins/builtin/money-markets/model.test.ts +0 -61
- package/src/plugins/builtin/news/headless.test.ts +0 -149
- package/src/plugins/builtin/news/wire/breaking/filters.test.ts +0 -99
- package/src/plugins/builtin/news/wire/breaking/notifications.test.ts +0 -204
- package/src/plugins/builtin/news/wire/breaking/pane.test.tsx +0 -128
- package/src/plugins/builtin/news/wire/breaking/pane.tsx +0 -89
- package/src/plugins/builtin/news/wire/feed-config.test.ts +0 -109
- package/src/plugins/builtin/news/wire/news/detail-view.test.tsx +0 -279
- package/src/plugins/builtin/news/wire/news/table.test.tsx +0 -223
- package/src/plugins/builtin/news/wire/read-state.test.ts +0 -37
- package/src/plugins/builtin/news/wire/rss/parser.test.ts +0 -178
- package/src/plugins/builtin/news/wire/rss/source.test.ts +0 -153
- package/src/plugins/builtin/notes/files.test.ts +0 -18
- package/src/plugins/builtin/notes/quick-notes-pane.test.tsx +0 -209
- package/src/plugins/builtin/notes/store.test.ts +0 -245
- package/src/plugins/builtin/notes/ticker-notes-tab.test.tsx +0 -350
- package/src/plugins/builtin/options/analytics.test.ts +0 -234
- package/src/plugins/builtin/options/calc-seed.test.ts +0 -130
- package/src/plugins/builtin/options/chain-integrity.test.tsx +0 -284
- package/src/plugins/builtin/options/enrichment-hook.test.tsx +0 -149
- package/src/plugins/builtin/options/enrichment.test.ts +0 -257
- package/src/plugins/builtin/options/expiry-selection.test.tsx +0 -370
- package/src/plugins/builtin/options/footer.test.ts +0 -60
- package/src/plugins/builtin/options/live-quotes.test.ts +0 -421
- package/src/plugins/builtin/options/market-reference.test.ts +0 -36
- package/src/plugins/builtin/options/table.test.ts +0 -100
- package/src/plugins/builtin/options/view.test.tsx +0 -657
- package/src/plugins/builtin/options-calculator/binomial.test.ts +0 -264
- package/src/plugins/builtin/options-calculator/boundary-integrity.test.tsx +0 -114
- package/src/plugins/builtin/options-calculator/evidence.test.ts +0 -138
- package/src/plugins/builtin/options-calculator/headless.test.ts +0 -39
- package/src/plugins/builtin/options-calculator/inputs.test.ts +0 -24
- package/src/plugins/builtin/options-calculator/model.test.ts +0 -242
- package/src/plugins/builtin/options-calculator/pane.test.tsx +0 -305
- package/src/plugins/builtin/options-calculator/surface.test.ts +0 -164
- package/src/plugins/builtin/options-scenario/client.test.ts +0 -143
- package/src/plugins/builtin/options-scenario/evidence.test.ts +0 -34
- package/src/plugins/builtin/options-scenario/live.test.ts +0 -34
- package/src/plugins/builtin/options-scenario/model.test.ts +0 -222
- package/src/plugins/builtin/options-scenario/pane.test.tsx +0 -195
- package/src/plugins/builtin/options-scenario/state.test.ts +0 -62
- package/src/plugins/builtin/plugin-marketplace/model.test.ts +0 -493
- package/src/plugins/builtin/plugin-module.test.ts +0 -101
- package/src/plugins/builtin/portfolio-list/account-metrics.test.ts +0 -243
- package/src/plugins/builtin/portfolio-list/bond-price-basis.test.ts +0 -120
- package/src/plugins/builtin/portfolio-list/cell-version.test.ts +0 -89
- package/src/plugins/builtin/portfolio-list/cli/render.test.ts +0 -261
- package/src/plugins/builtin/portfolio-list/index.test.ts +0 -248
- package/src/plugins/builtin/portfolio-list/live-valuation.test.ts +0 -94
- package/src/plugins/builtin/portfolio-list/metrics.test.ts +0 -562
- package/src/plugins/builtin/portfolio-list/mutations.test.ts +0 -200
- package/src/plugins/builtin/portfolio-list/pane/data.test.ts +0 -54
- package/src/plugins/builtin/portfolio-list/pane/index.test.tsx +0 -1835
- package/src/plugins/builtin/portfolio-list/position-cost-integrity.test.ts +0 -101
- package/src/plugins/builtin/portfolio-list/summary/index.test.ts +0 -184
- package/src/plugins/builtin/portfolio-list/summary/live-accounts.test.tsx +0 -90
- package/src/plugins/builtin/portfolio-list/use-cursor-neighbor-prefetch.test.tsx +0 -96
- package/src/plugins/builtin/portfolio-list/use-throttled-cursor-symbol.test.tsx +0 -166
- package/src/plugins/builtin/portfolio-list/use-throttled-ticker-order.test.tsx +0 -76
- package/src/plugins/builtin/rate-path/model.test.ts +0 -50
- package/src/plugins/builtin/realized-vol/chart-model.test.ts +0 -24
- package/src/plugins/builtin/realized-vol/client.test.ts +0 -193
- package/src/plugins/builtin/realized-vol/model.test.ts +0 -155
- package/src/plugins/builtin/relative-rotation/model.test.ts +0 -194
- package/src/plugins/builtin/research/analyst-headless.test.ts +0 -88
- package/src/plugins/builtin/research/analyst-model.test.ts +0 -125
- package/src/plugins/builtin/research/analyst-pane.test.tsx +0 -162
- package/src/plugins/builtin/research/corporate-actions-pane.test.tsx +0 -77
- package/src/plugins/builtin/research/equity-diagnostic-pane.test.tsx +0 -303
- package/src/plugins/builtin/research/event-model.test.ts +0 -165
- package/src/plugins/builtin/research/events-headless.test.ts +0 -43
- package/src/plugins/builtin/research/headless.test.ts +0 -111
- package/src/plugins/builtin/research/index.test.ts +0 -442
- package/src/plugins/builtin/research/relative-valuation-headless.test.ts +0 -192
- package/src/plugins/builtin/research/relative-valuation-model.test.ts +0 -49
- package/src/plugins/builtin/research/relative-valuation-pane.test.tsx +0 -99
- package/src/plugins/builtin/research-search/command-bar-search.test.ts +0 -81
- package/src/plugins/builtin/research-search/document-view.test.tsx +0 -75
- package/src/plugins/builtin/research-search/model.test.ts +0 -40
- package/src/plugins/builtin/research-search/pane.test.tsx +0 -256
- package/src/plugins/builtin/research-search/snippet.test.ts +0 -78
- package/src/plugins/builtin/risk-factors/data.test.ts +0 -63
- package/src/plugins/builtin/risk-factors/headless.test.ts +0 -40
- package/src/plugins/builtin/risk-factors/pane.test.tsx +0 -56
- package/src/plugins/builtin/risk-factors/test-fixtures.ts +0 -4
- package/src/plugins/builtin/scanner/flow-history.test.tsx +0 -138
- package/src/plugins/builtin/scanner/flow-model.test.ts +0 -180
- package/src/plugins/builtin/scanner/flow-pane.test.tsx +0 -159
- package/src/plugins/builtin/scanner/headless.test.ts +0 -121
- package/src/plugins/builtin/scanner/hilo-model.test.ts +0 -44
- package/src/plugins/builtin/sec/filing-content.test.ts +0 -57
- package/src/plugins/builtin/sec/headless.test.ts +0 -99
- package/src/plugins/builtin/sec/pane.test.tsx +0 -152
- package/src/plugins/builtin/sectors/client.test.ts +0 -228
- package/src/plugins/builtin/sectors/headless.test.ts +0 -87
- package/src/plugins/builtin/sectors/pane-cache.test.tsx +0 -78
- package/src/plugins/builtin/sectors/sector-model.test.ts +0 -119
- package/src/plugins/builtin/shared/auto-refresh.test.tsx +0 -95
- package/src/plugins/builtin/shared/auto-refresh.ts +0 -97
- package/src/plugins/builtin/shared/live-streaming.ts +0 -60
- package/src/plugins/builtin/shared/pane-footer.ts +0 -93
- package/src/plugins/builtin/shared/plan-access.test.ts +0 -69
- package/src/plugins/builtin/shared/plan-access.ts +0 -109
- package/src/plugins/builtin/shared/public-pane.test.ts +0 -12
- package/src/plugins/builtin/shared/read-state.ts +0 -104
- package/src/plugins/builtin/shared/research-cloud-session.test.tsx +0 -143
- package/src/plugins/builtin/shared/screener-live-quotes.test.ts +0 -111
- package/src/plugins/builtin/shared/screener-live-quotes.ts +0 -165
- package/src/plugins/builtin/shared/series-cache.test.ts +0 -106
- package/src/plugins/builtin/shared/table-pane.ts +0 -32
- package/src/plugins/builtin/shared/ticker-request.test.ts +0 -18
- package/src/plugins/builtin/shared/ticker-request.test.tsx +0 -137
- package/src/plugins/builtin/shared/ticker-source.ts +0 -32
- package/src/plugins/builtin/shared/ticker-surface.test.ts +0 -84
- package/src/plugins/builtin/shared/use-quote-board.test.tsx +0 -325
- package/src/plugins/builtin/shared/volatility/live-session.test.ts +0 -91
- package/src/plugins/builtin/shared/volatility/options.test.ts +0 -127
- package/src/plugins/builtin/shared/volatility/realized.test.ts +0 -201
- package/src/plugins/builtin/shared/volatility/realized.ts +0 -292
- package/src/plugins/builtin/shared/volatility/smile.test.ts +0 -209
- package/src/plugins/builtin/short-interest/client.test.ts +0 -55
- package/src/plugins/builtin/short-interest/headless.test.ts +0 -96
- package/src/plugins/builtin/short-interest/pane.test.tsx +0 -57
- package/src/plugins/builtin/short-volume/model.test.ts +0 -39
- package/src/plugins/builtin/thirteenf/api.test.ts +0 -149
- package/src/plugins/builtin/thirteenf/data.test.ts +0 -291
- package/src/plugins/builtin/thirteenf/headless.test.ts +0 -182
- package/src/plugins/builtin/thirteenf/model.test.ts +0 -230
- package/src/plugins/builtin/thirteenf/overlap.test.ts +0 -29
- package/src/plugins/builtin/thirteenf/pane.test.tsx +0 -407
- package/src/plugins/builtin/thirteenf/signals.test.ts +0 -16
- package/src/plugins/builtin/ticker-detail/chart-tab-switch.test.tsx +0 -275
- package/src/plugins/builtin/ticker-detail/data-panes/historical-price-precision.test.tsx +0 -120
- package/src/plugins/builtin/ticker-detail/data-panes/historical-prices.test.tsx +0 -41
- package/src/plugins/builtin/ticker-detail/financials/aggregation.test.ts +0 -79
- package/src/plugins/builtin/ticker-detail/financials/model.test.ts +0 -276
- package/src/plugins/builtin/ticker-detail/financials/period-integrity.test.tsx +0 -78
- package/src/plugins/builtin/ticker-detail/fund-profile.test.tsx +0 -118
- package/src/plugins/builtin/ticker-detail/headless.test.ts +0 -165
- package/src/plugins/builtin/ticker-detail/index.test.tsx +0 -850
- package/src/plugins/builtin/ticker-detail/overview/model.test.ts +0 -118
- package/src/plugins/builtin/ticker-detail/overview-return-coverage.test.tsx +0 -71
- package/src/plugins/builtin/ticker-detail/quote-monitor/card.test.tsx +0 -70
- package/src/plugins/builtin/ticker-detail/quote-monitor/index.test.tsx +0 -261
- package/src/plugins/builtin/ticker-detail/quote-monitor/retained-status.test.tsx +0 -134
- package/src/plugins/builtin/ticker-detail/quote-status.test.tsx +0 -116
- package/src/plugins/builtin/ticker-detail/quote-time-integrity.test.ts +0 -42
- package/src/plugins/builtin/ticker-research-backend-plugin.ts +0 -10
- package/src/plugins/builtin/ticker-research-plugin.ts +0 -61
- package/src/plugins/builtin/time-sales/model.test.ts +0 -83
- package/src/plugins/builtin/time-sales/snapshot-client.test.ts +0 -31
- package/src/plugins/builtin/time-sales/test-fixture.ts +0 -12
- package/src/plugins/builtin/time-sales/use-tape.test.tsx +0 -115
- package/src/plugins/builtin/treasury-auctions/cache.test.ts +0 -215
- package/src/plugins/builtin/treasury-auctions/client.test.ts +0 -207
- package/src/plugins/builtin/treasury-auctions/headless.test.ts +0 -34
- package/src/plugins/builtin/treasury-auctions/model.test.ts +0 -187
- package/src/plugins/builtin/treasury-auctions/pane.test.tsx +0 -174
- package/src/plugins/builtin/vol-surface/client.test.ts +0 -179
- package/src/plugins/builtin/vol-surface/evidence.test.ts +0 -73
- package/src/plugins/builtin/vol-surface/live.test.ts +0 -95
- package/src/plugins/builtin/vol-surface/model.test.ts +0 -243
- package/src/plugins/builtin/vol-surface/pane.test.tsx +0 -265
- package/src/plugins/builtin/vol-surface/raster.test.ts +0 -28
- package/src/plugins/builtin/vol-surface/stored.test.ts +0 -62
- package/src/plugins/builtin/volatility/chart-model.test.ts +0 -61
- package/src/plugins/builtin/volatility/client.test.ts +0 -207
- package/src/plugins/builtin/volatility/evidence.test.ts +0 -49
- package/src/plugins/builtin/volatility/headless.test.ts +0 -52
- package/src/plugins/builtin/volatility/model.test.ts +0 -152
- package/src/plugins/builtin/world-indices/headless.test.ts +0 -32
- package/src/plugins/builtin/world-indices/pane.test.tsx +0 -156
- package/src/plugins/builtin/world-venue-map/map.desktop.test.tsx +0 -45
- package/src/plugins/builtin/world-venue-map/model.test.ts +0 -85
- package/src/plugins/builtin/yield-curve/chart.test.ts +0 -23
- package/src/plugins/builtin/yield-curve/headless.test.ts +0 -40
- package/src/plugins/builtin/yield-curve/history.test.ts +0 -124
- package/src/plugins/builtin/yield-curve/pane.test.tsx +0 -140
- package/src/plugins/builtin/yield-curve/treasury-data.test.ts +0 -35
- package/src/plugins/bundle.test.ts +0 -209
- package/src/plugins/catalog-backend.test.ts +0 -47
- package/src/plugins/catalog-browser.test.ts +0 -72
- package/src/plugins/gridlock-notification.ts +0 -16
- package/src/plugins/host-contract.ts +0 -72
- package/src/plugins/host-link.test.ts +0 -133
- package/src/plugins/host-module-imports.test.ts +0 -94
- package/src/plugins/host-module-imports.ts +0 -73
- package/src/plugins/host-resolver.test.ts +0 -96
- package/src/plugins/launch-layout.test.ts +0 -131
- package/src/plugins/loader.test.ts +0 -54
- package/src/plugins/pane-manager.test.ts +0 -309
- package/src/plugins/registry/index.test.ts +0 -601
- package/src/plugins/registry/pane-settings.test.ts +0 -98
- package/src/plugins/registry/setup-command.test.ts +0 -62
- package/src/plugins/runtime/index.test.tsx +0 -328
- package/src/plugins/seed.test.ts +0 -136
- package/src/plugins/ticker-navigation.test.ts +0 -141
- package/src/public/public-api.test.ts +0 -42
- package/src/react/async-resource.test.tsx +0 -124
- package/src/react/input.test.ts +0 -182
- package/src/remote/controller.test.ts +0 -585
- package/src/remote/json-patch.test.ts +0 -31
- package/src/remote/schema.test.ts +0 -65
- package/src/remote/semantic-tree.test.tsx +0 -105
- package/src/remote/server.test.ts +0 -50
- package/src/renderers/browser/bundled-plugins.test.ts +0 -41
- package/src/renderers/browser/cloud-transport.test.ts +0 -68
- package/src/renderers/browser/config-host.test.ts +0 -70
- package/src/renderers/browser/deeplink-bridge.test.ts +0 -56
- package/src/renderers/browser/error-boundary.tsx +0 -23
- package/src/renderers/browser/http-proxy-transport.test.ts +0 -98
- package/src/renderers/browser/research-entry.test.ts +0 -32
- package/src/renderers/browser/storage.test.ts +0 -66
- package/src/renderers/cloudflare/http-proxy.test.ts +0 -122
- package/src/renderers/cloudflare/worker.test.ts +0 -155
- package/src/renderers/electrobun/bun/application-menu/click.test.ts +0 -55
- package/src/renderers/electrobun/bun/context-menu/click.test.ts +0 -67
- package/src/renderers/electrobun/bun/context-menu/normalize.test.ts +0 -52
- package/src/renderers/electrobun/bun/desktop/capability-bridge.test.ts +0 -112
- package/src/renderers/electrobun/bun/desktop/http-fetch.test.ts +0 -89
- package/src/renderers/electrobun/bun/desktop/http-stream.test.ts +0 -200
- package/src/renderers/electrobun/bun/desktop/initialization.test.ts +0 -27
- package/src/renderers/electrobun/bun/desktop/window-controls.test.ts +0 -53
- package/src/renderers/electrobun/bun/desktop/window-controls.ts +0 -75
- package/src/renderers/electrobun/bun/desktop/window-events.ts +0 -49
- package/src/renderers/electrobun/bun/desktop/window-style.ts +0 -34
- package/src/renderers/electrobun/bun/desktop/windows-custom-chrome.ts +0 -58
- package/src/renderers/electrobun/bun/desktop/windows-icons.ts +0 -70
- package/src/renderers/electrobun/bun/desktop/windows-native.ts +0 -75
- package/src/renderers/electrobun/bun/desktop/workspace/index.test.ts +0 -147
- package/src/renderers/electrobun/bun/window/frame.test.ts +0 -47
- package/src/renderers/electrobun/view/application-menu-bridge.ts +0 -12
- package/src/renderers/electrobun/view/cli-pane-shot-frame.test.tsx +0 -76
- package/src/renderers/electrobun/view/cli-pane-shot-health.test.ts +0 -25
- package/src/renderers/electrobun/view/context-menu.test.ts +0 -146
- package/src/renderers/electrobun/view/data-table/frozen-column.test.tsx +0 -73
- package/src/renderers/electrobun/view/data-table/horizontal-navigation.test.tsx +0 -82
- package/src/renderers/electrobun/view/data-table/index.test.tsx +0 -127
- package/src/renderers/electrobun/view/desktop/controls.test.tsx +0 -161
- package/src/renderers/electrobun/view/desktop/list-view.test.tsx +0 -37
- package/src/renderers/electrobun/view/desktop/window/snapshot.test.ts +0 -57
- package/src/renderers/electrobun/view/desktop-deeplink-bridge.ts +0 -10
- package/src/renderers/electrobun/view/dialog-host.test.ts +0 -25
- package/src/renderers/electrobun/view/dialog-stack.test.tsx +0 -73
- package/src/renderers/electrobun/view/external-plugins.test.ts +0 -57
- package/src/renderers/electrobun/view/history-metadata-rpc.test.ts +0 -62
- package/src/renderers/electrobun/view/host/ascii-text.test.ts +0 -48
- package/src/renderers/electrobun/view/host/box.test.tsx +0 -171
- package/src/renderers/electrobun/view/host/focus-scope.test.ts +0 -37
- package/src/renderers/electrobun/view/host/scroll-box.desktop.test.tsx +0 -46
- package/src/renderers/electrobun/view/host/style.test.ts +0 -15
- package/src/renderers/electrobun/view/host/surface-3d.test.ts +0 -33
- package/src/renderers/electrobun/view/input-host.test.tsx +0 -104
- package/src/renderers/electrobun/view/key-event.test.ts +0 -34
- package/src/renderers/electrobun/view/native-stubs/chart/kitty-support.ts +0 -19
- package/src/renderers/electrobun/view/native-stubs/chart/surface-manager.ts +0 -36
- package/src/renderers/electrobun/view/native-stubs/ibkr-native-loader.ts +0 -3
- package/src/renderers/electrobun/view/native-stubs/native-stubs.test.ts +0 -42
- package/src/renderers/electrobun/view/notes-files.ts +0 -56
- package/src/renderers/electrobun/view/remote/backend-quote-subscription.test.ts +0 -87
- package/src/renderers/electrobun/view/remote/capability-invoker.test.ts +0 -96
- package/src/renderers/electrobun/view/remote/connection-health-backend.ts +0 -19
- package/src/renderers/electrobun/view/remote/connection-health.test.ts +0 -44
- package/src/renderers/electrobun/view/remote/quote-subscription-registry.test.ts +0 -86
- package/src/renderers/electrobun/view/rpc-codec.test.ts +0 -112
- package/src/renderers/electrobun/view/screenshot-watermark.test.ts +0 -48
- package/src/renderers/electrobun/view/toast-host.test.tsx +0 -61
- package/src/renderers/opentui/chart-surface.test.tsx +0 -147
- package/src/renderers/opentui/image/loader.test.ts +0 -25
- package/src/renderers/opentui/interaction-performance.test.ts +0 -79
- package/src/renderers/opentui/terminal-media.test.ts +0 -173
- package/src/renderers/share/chart.test.ts +0 -52
- package/src/renderers/share/layout-view.test.tsx +0 -58
- package/src/renderers/share/view.test.tsx +0 -120
- package/src/shares/api.test.ts +0 -120
- package/src/shares/location.test.ts +0 -19
- package/src/shares/pane.test.ts +0 -110
- package/src/sources/asml-earnings.test.ts +0 -197
- package/src/sources/fixtures/sec-operating-expenses.json +0 -163
- package/src/sources/fixtures/shop-20251231-quarterly-summary.html +0 -1
- package/src/sources/fixtures/shop-20260630-quarterly-summary.html +0 -1
- package/src/sources/fixtures/shop-operating-provider.json +0 -141
- package/src/sources/fixtures/shop-quarterly-summary-provenance.json +0 -24
- package/src/sources/fixtures/shop-submissions-20260922.json +0 -31
- package/src/sources/gloomberb-cloud/history-coverage.test.ts +0 -119
- package/src/sources/gloomberb-cloud/history-retention.test.ts +0 -207
- package/src/sources/gloomberb-cloud/history-session.test.ts +0 -76
- package/src/sources/gloomberb-cloud/index.test.ts +0 -1116
- package/src/sources/gloomberb-cloud/normalizers.test.ts +0 -135
- package/src/sources/gloomberb-cloud/quote-metadata.test.ts +0 -50
- package/src/sources/gloomberb-cloud/valuation-observations.ts +0 -29
- package/src/sources/history-coverage.test.ts +0 -40
- package/src/sources/listing-history.ts +0 -52
- package/src/sources/provider-router/arca-cache.test.ts +0 -97
- package/src/sources/provider-router/asml-earnings-cache.test.ts +0 -158
- package/src/sources/provider-router/broker-session.test.ts +0 -52
- package/src/sources/provider-router/cache.test.ts +0 -133
- package/src/sources/provider-router/cached-financials.test.ts +0 -711
- package/src/sources/provider-router/cached-listing-identity.test.ts +0 -159
- package/src/sources/provider-router/cached-routes.test.ts +0 -232
- package/src/sources/provider-router/connection-health.test.ts +0 -28
- package/src/sources/provider-router/financials.test.ts +0 -209
- package/src/sources/provider-router/fixtures/quarterly-source-disagreements.json +0 -438
- package/src/sources/provider-router/fixtures/shop-nasdaqgs.json +0 -137
- package/src/sources/provider-router/history-boundary-cache.test.ts +0 -72
- package/src/sources/provider-router/history-calendar-cache.test.ts +0 -301
- package/src/sources/provider-router/history-exact-window.test.ts +0 -187
- package/src/sources/provider-router/history-gap-cache.test.ts +0 -84
- package/src/sources/provider-router/history-gaps.test.ts +0 -141
- package/src/sources/provider-router/history-retention.test.ts +0 -239
- package/src/sources/provider-router/history-session.test.ts +0 -138
- package/src/sources/provider-router/history.test.ts +0 -780
- package/src/sources/provider-router/index.test.ts +0 -1990
- package/src/sources/provider-router/listing-history.test.ts +0 -139
- package/src/sources/provider-router/listing-identity.test.ts +0 -128
- package/src/sources/provider-router/nasdaqgs-listing.test.ts +0 -78
- package/src/sources/provider-router/news.test.ts +0 -34
- package/src/sources/provider-router/non-company-metadata.test.ts +0 -95
- package/src/sources/provider-router/o-income-basis.test.ts +0 -64
- package/src/sources/provider-router/operating-result-cache.test.ts +0 -44
- package/src/sources/provider-router/operating-result-retry.test.ts +0 -221
- package/src/sources/provider-router/profile-enrichment.test.ts +0 -168
- package/src/sources/provider-router/quote-completion.test.ts +0 -62
- package/src/sources/provider-router/quote-domain.test.ts +0 -92
- package/src/sources/provider-router/quote-route.test.ts +0 -255
- package/src/sources/provider-router/realtime-access.test.ts +0 -22
- package/src/sources/provider-router/routing.test.ts +0 -39
- package/src/sources/provider-router/search.test.ts +0 -191
- package/src/sources/provider-router/shell-history-cache.test.ts +0 -131
- package/src/sources/provider-router/statement-history.test.ts +0 -71
- package/src/sources/provider-router/statement-observations.test.ts +0 -162
- package/src/sources/provider-router/valuation-retractions.test.ts +0 -280
- package/src/sources/reported-operating-results.test.ts +0 -286
- package/src/sources/sec-bank-revenue.test.ts +0 -79
- package/src/sources/sec-edgar-shares.fixture.json +0 -188
- package/src/sources/sec-edgar-shares.test.ts +0 -66
- package/src/sources/sec-edgar.test.ts +0 -924
- package/src/sources/sec-income-attribution.test.ts +0 -93
- package/src/sources/sec-operating-expenses.test.ts +0 -42
- package/src/sources/yahoo-finance/fixtures/aapl-final-observation.json +0 -20
- package/src/sources/yahoo-finance/history-session.test.ts +0 -120
- package/src/sources/yahoo-finance/history.test.ts +0 -47
- package/src/sources/yahoo-finance/mappers.test.ts +0 -176
- package/src/sources/yahoo-finance/options.test.ts +0 -23
- package/src/sources/yahoo-finance/requests.test.ts +0 -119
- package/src/sources/yahoo-finance/snapshots.test.ts +0 -225
- package/src/sources/yahoo-finance/symbols.test.ts +0 -18
- package/src/sources/yahoo-finance.test.ts +0 -330
- package/src/state/app/activity.test.ts +0 -54
- package/src/state/app/bootstrap.test.ts +0 -664
- package/src/state/app/context/index.test.ts +0 -604
- package/src/state/app/context/index.test.tsx +0 -347
- package/src/state/app/context/selector.test.tsx +0 -424
- package/src/state/hooks/inline-ticker-failures.test.ts +0 -77
- package/src/state/hooks/inline-tickers.test.tsx +0 -253
- package/src/state/hooks/live-ticker-financials.test.tsx +0 -120
- package/src/state/hooks/quote-streaming.test.ts +0 -44
- package/src/state/hooks/quote-streaming.test.tsx +0 -442
- package/src/state/persist-scheduler.test.ts +0 -151
- package/src/state/selectors-ui.ts +0 -47
- package/src/state/selectors.ts +0 -27
- package/src/state/session-persistence.test.ts +0 -187
- package/src/state/ticker-refresh-queue.test.ts +0 -46
- package/src/sync/auth-transition.test.ts +0 -36
- package/src/sync/controller.test.ts +0 -527
- package/src/sync/core-contributors.test.ts +0 -643
- package/src/test-support/fixtures/asml-earnings.json +0 -993
- package/src/theme/colors.test.ts +0 -85
- package/src/theme/font-scale.test.ts +0 -14
- package/src/theme/theme-context.test.tsx +0 -67
- package/src/theme/themes.test.ts +0 -100
- package/src/tickers/instrument-kind.test.ts +0 -21
- package/src/tickers/instrument-label.test.ts +0 -13
- package/src/tickers/list.test.ts +0 -17
- package/src/tickers/open-target.test.ts +0 -86
- package/src/tickers/search/index.test.ts +0 -950
- package/src/tickers/search-contract-context.test.tsx +0 -161
- package/src/tickers/search-contract-templates.test.ts +0 -83
- package/src/tickers/search-issuer-grouping.test.ts +0 -74
- package/src/tickers/search-listing-ranking.test.tsx +0 -122
- package/src/tickers/tokenizer.test.ts +0 -31
- package/src/time-series/bond-price-history.test.ts +0 -52
- package/src/time-series/calendar-month-end-resolution.test.ts +0 -106
- package/src/time-series/calendar-window-resolution.test.ts +0 -133
- package/src/time-series/chart-data.test.ts +0 -288
- package/src/time-series/date-window.test.ts +0 -113
- package/src/time-series/economic.test.ts +0 -44
- package/src/time-series/financial-history-request.test.ts +0 -20
- package/src/time-series/financial-period-coverage.test.ts +0 -37
- package/src/time-series/financial-period-gaps.test.ts +0 -128
- package/src/time-series/fixtures/q4-reported-common-income.json +0 -394
- package/src/time-series/fixtures/q4-reported-per-share.json +0 -305
- package/src/time-series/fixtures/quote-store.ts +0 -55
- package/src/time-series/forward-valuation.test.ts +0 -131
- package/src/time-series/fundamentals.test.ts +0 -592
- package/src/time-series/history-retention.test.ts +0 -141
- package/src/time-series/history-session-cache.test.ts +0 -250
- package/src/time-series/hooks.test.ts +0 -59
- package/src/time-series/legacy-contract-live.test.ts +0 -22
- package/src/time-series/live-bars.test.ts +0 -290
- package/src/time-series/live-quotes.test.ts +0 -208
- package/src/time-series/market-price-units.test.ts +0 -75
- package/src/time-series/parsed-history-identity.test.tsx +0 -142
- package/src/time-series/price-comparison.test.ts +0 -233
- package/src/time-series/price-history-integrity-window.test.ts +0 -137
- package/src/time-series/price-history-integrity.test.ts +0 -195
- package/src/time-series/q4-common-income.test.ts +0 -63
- package/src/time-series/q4-per-share.test.ts +0 -144
- package/src/time-series/realized-vol-study.test.ts +0 -189
- package/src/time-series/reporting-currency.test.ts +0 -99
- package/src/time-series/resolution.test.ts +0 -132
- package/src/time-series/resolve.test.ts +0 -2471
- package/src/time-series/sec-eps-research.test.ts +0 -55
- package/src/time-series/seed-cadence.test.tsx +0 -219
- package/src/time-series/served-cadence-consumers.test.ts +0 -52
- package/src/time-series/session-history-domain.test.ts +0 -160
- package/src/time-series/spec-studies.test.ts +0 -619
- package/src/time-series/transforms.test.ts +0 -216
- package/src/time-series/use-chart-resolution.test.tsx +0 -632
- package/src/time-series/valuation-currency.test.ts +0 -129
- package/src/time-series/valuation-denominator.test.ts +0 -240
- package/src/time-series/valuation-live-status.test.ts +0 -64
- package/src/time-series/valuation-price.test.ts +0 -267
- package/src/types/config.test.ts +0 -161
- package/src/ui/context-menu.test.ts +0 -95
- package/src/ui/qr.test.ts +0 -79
- package/src/updater/github-releases.test.ts +0 -41
- package/src/updater.test.ts +0 -561
- package/src/updater.ts +0 -480
- package/src/utils/calendar-date.test.ts +0 -18
- package/src/utils/cli-output.test.ts +0 -43
- package/src/utils/csv.test.ts +0 -13
- package/src/utils/currency-units.test.ts +0 -66
- package/src/utils/dom-screenshot.test.ts +0 -52
- package/src/utils/double-escape-close.test.ts +0 -33
- package/src/utils/earnings-result.ts +0 -35
- package/src/utils/exchange-rate-map.ts +0 -9
- package/src/utils/exchange-rate-snapshot.test.ts +0 -33
- package/src/utils/exchanges.test.ts +0 -62
- package/src/utils/external-url.test.ts +0 -32
- package/src/utils/financial-statements.test.ts +0 -211
- package/src/utils/format.test.ts +0 -61
- package/src/utils/fuzzy-search.test.ts +0 -94
- package/src/utils/fx-market-hours.test.ts +0 -28
- package/src/utils/fx-status.test.ts +0 -16
- package/src/utils/html-entities.test.ts +0 -8
- package/src/utils/inline-content-tokenizer.test.ts +0 -31
- package/src/utils/instrument-identity.test.ts +0 -26
- package/src/utils/latest-financial-period.test.ts +0 -19
- package/src/utils/link-tokenizer.test.ts +0 -27
- package/src/utils/main-thread-monitor.ts +0 -127
- package/src/utils/main-thread-stall.test.ts +0 -59
- package/src/utils/market-capitalization-consumers.test.ts +0 -59
- package/src/utils/market-capitalization.test.ts +0 -38
- package/src/utils/operating-result-aggregation.ts +0 -106
- package/src/utils/operating-result-consumers.test.ts +0 -212
- package/src/utils/operating-result.ts +0 -100
- package/src/utils/options.test.ts +0 -20
- package/src/utils/price-earnings.test.ts +0 -39
- package/src/utils/price-history.test.ts +0 -230
- package/src/utils/relative-time.ts +0 -8
- package/src/utils/reported-earnings-result.ts +0 -336
- package/src/utils/reported-money.test.ts +0 -25
- package/src/utils/reported-operating-result.ts +0 -271
- package/src/utils/save-text-file.test.ts +0 -24
- package/src/utils/sec-eps-basis.test.ts +0 -82
- package/src/utils/sec.test.ts +0 -60
- package/src/utils/semver.test.ts +0 -31
- package/src/utils/shop-operating-table.ts +0 -230
- package/src/utils/shortcut-labels.test.ts +0 -20
- package/src/utils/sort-values.test.ts +0 -11
- package/src/utils/statement-observations.ts +0 -129
- package/src/utils/throttled-fetch.test.ts +0 -186
- package/src/utils/tweet-text.test.ts +0 -13
|
@@ -1,1990 +0,0 @@
|
|
|
1
|
-
import { useRegularMarketSession } from "../../test-support/market-session";
|
|
2
|
-
import { afterEach, describe, expect, test } from "bun:test";
|
|
3
|
-
import { CloudApiRequestTransport } from "../../api-client/request";
|
|
4
|
-
import { AppPersistence } from "../../data/app-persistence";
|
|
5
|
-
import { AssetDataRouter } from "./index";
|
|
6
|
-
import { getRouterEntityKey } from "./cache";
|
|
7
|
-
import { assetDataProvider } from "../../capabilities";
|
|
8
|
-
import type { BrokerAdapter } from "../../types/broker";
|
|
9
|
-
import type { DataProvider, QuoteSubscriptionTarget } from "../../types/data-provider";
|
|
10
|
-
import type { CapabilityRouteSource } from "../../types/capability-route-source";
|
|
11
|
-
import {
|
|
12
|
-
attachTestRegistry,
|
|
13
|
-
brokerInstance,
|
|
14
|
-
cleanupProviderRouterTestFiles,
|
|
15
|
-
createBrokerConfig,
|
|
16
|
-
createTempDbPath,
|
|
17
|
-
fallbackProvider,
|
|
18
|
-
makeArticle,
|
|
19
|
-
makeFinancials,
|
|
20
|
-
makeQuote,
|
|
21
|
-
setBrokerInstances,
|
|
22
|
-
} from "./test-support";
|
|
23
|
-
|
|
24
|
-
useRegularMarketSession();
|
|
25
|
-
|
|
26
|
-
const originalConsoleError = console.error;
|
|
27
|
-
|
|
28
|
-
afterEach(() => {
|
|
29
|
-
console.error = originalConsoleError;
|
|
30
|
-
cleanupProviderRouterTestFiles();
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
describe("AssetDataRouter", () => {
|
|
34
|
-
test("falls through to Yahoo quotes and history when Cloud market requests never settle", async () => {
|
|
35
|
-
const cloudCalls = { quote: 0, history: 0 };
|
|
36
|
-
const yahooCalls = { quote: 0, history: 0 };
|
|
37
|
-
const cloudTransport = new CloudApiRequestTransport({
|
|
38
|
-
marketRequestTimeoutMs: 10,
|
|
39
|
-
fetchTransport: async () => new Promise<Response>(() => {}),
|
|
40
|
-
});
|
|
41
|
-
const cloudProvider: DataProvider = {
|
|
42
|
-
...fallbackProvider,
|
|
43
|
-
id: "gloomberb-cloud",
|
|
44
|
-
name: "Cloud",
|
|
45
|
-
priority: 100,
|
|
46
|
-
async getQuote() {
|
|
47
|
-
cloudCalls.quote += 1;
|
|
48
|
-
await cloudTransport.request("/market/quote?symbol=AAPL");
|
|
49
|
-
throw new Error("unreachable");
|
|
50
|
-
},
|
|
51
|
-
async getPriceHistory() {
|
|
52
|
-
cloudCalls.history += 1;
|
|
53
|
-
await cloudTransport.request("/market/history?symbol=AAPL&range=1Y");
|
|
54
|
-
throw new Error("unreachable");
|
|
55
|
-
},
|
|
56
|
-
};
|
|
57
|
-
const yahooProvider: DataProvider = {
|
|
58
|
-
...fallbackProvider,
|
|
59
|
-
id: "yahoo",
|
|
60
|
-
name: "Yahoo",
|
|
61
|
-
priority: 1000,
|
|
62
|
-
async getQuote() {
|
|
63
|
-
yahooCalls.quote += 1;
|
|
64
|
-
return makeQuote({ providerId: "yahoo", price: 212.5 });
|
|
65
|
-
},
|
|
66
|
-
async getPriceHistory() {
|
|
67
|
-
yahooCalls.history += 1;
|
|
68
|
-
return [
|
|
69
|
-
{ date: new Date("2026-07-10T00:00:00Z"), close: 210 },
|
|
70
|
-
{ date: new Date("2026-07-11T00:00:00Z"), close: 212.5 },
|
|
71
|
-
];
|
|
72
|
-
},
|
|
73
|
-
};
|
|
74
|
-
const router = new AssetDataRouter(yahooProvider, [cloudProvider]);
|
|
75
|
-
console.error = () => {};
|
|
76
|
-
|
|
77
|
-
const quote = await router.getQuote("AAPL", "NASDAQ");
|
|
78
|
-
const history = await router.getPriceHistory("AAPL", "NASDAQ", "1Y");
|
|
79
|
-
|
|
80
|
-
expect(quote.providerId).toBe("yahoo");
|
|
81
|
-
expect(quote.price).toBe(212.5);
|
|
82
|
-
expect(history.map((point) => point.close)).toEqual([210, 212.5]);
|
|
83
|
-
expect(cloudCalls).toEqual({ quote: 1, history: 1 });
|
|
84
|
-
expect(yahooCalls).toEqual({ quote: 1, history: 1 });
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
test("serves USD exchange rate locally without provider revalidation", async () => {
|
|
88
|
-
let providerCalls = 0;
|
|
89
|
-
const router = new AssetDataRouter({
|
|
90
|
-
...fallbackProvider,
|
|
91
|
-
async getExchangeRate() {
|
|
92
|
-
providerCalls += 1;
|
|
93
|
-
return 1;
|
|
94
|
-
},
|
|
95
|
-
});
|
|
96
|
-
|
|
97
|
-
const rate = await router.getExchangeRate("usd");
|
|
98
|
-
await Promise.resolve();
|
|
99
|
-
|
|
100
|
-
expect(rate).toBe(1);
|
|
101
|
-
expect(providerCalls).toBe(0);
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
test("routes market calls only through sources with market capability", async () => {
|
|
105
|
-
const newsOnlySource: CapabilityRouteSource = {
|
|
106
|
-
id: "news-only",
|
|
107
|
-
name: "News Only",
|
|
108
|
-
priority: 1,
|
|
109
|
-
news: {
|
|
110
|
-
fetchNews: async () => {
|
|
111
|
-
throw new Error("news-only source should not handle market requests");
|
|
112
|
-
},
|
|
113
|
-
},
|
|
114
|
-
};
|
|
115
|
-
const marketSource: CapabilityRouteSource = {
|
|
116
|
-
id: "market-source",
|
|
117
|
-
name: "Market Source",
|
|
118
|
-
priority: 10,
|
|
119
|
-
market: {
|
|
120
|
-
...fallbackProvider,
|
|
121
|
-
id: "market-source",
|
|
122
|
-
name: "Market Source",
|
|
123
|
-
async getQuote(symbol) {
|
|
124
|
-
return {
|
|
125
|
-
symbol,
|
|
126
|
-
providerId: "market-source",
|
|
127
|
-
price: 250,
|
|
128
|
-
currency: "USD",
|
|
129
|
-
change: 1,
|
|
130
|
-
changePercent: 0.4,
|
|
131
|
-
lastUpdated: Date.now(),
|
|
132
|
-
};
|
|
133
|
-
},
|
|
134
|
-
},
|
|
135
|
-
};
|
|
136
|
-
|
|
137
|
-
const router = new AssetDataRouter(fallbackProvider, [newsOnlySource, marketSource]);
|
|
138
|
-
|
|
139
|
-
const quote = await router.getQuote("AAPL", "NASDAQ");
|
|
140
|
-
|
|
141
|
-
expect(quote.providerId).toBe("market-source");
|
|
142
|
-
expect(quote.price).toBe(250);
|
|
143
|
-
});
|
|
144
|
-
|
|
145
|
-
test("routes news calls only through sources with news capability", async () => {
|
|
146
|
-
const article = makeArticle("source-news");
|
|
147
|
-
const marketOnlySource: CapabilityRouteSource = {
|
|
148
|
-
id: "market-only",
|
|
149
|
-
name: "Market Only",
|
|
150
|
-
priority: 1,
|
|
151
|
-
market: {
|
|
152
|
-
...fallbackProvider,
|
|
153
|
-
id: "market-only",
|
|
154
|
-
name: "Market Only",
|
|
155
|
-
},
|
|
156
|
-
};
|
|
157
|
-
const newsSource: CapabilityRouteSource = {
|
|
158
|
-
id: "news-source",
|
|
159
|
-
name: "News Source",
|
|
160
|
-
priority: 10,
|
|
161
|
-
news: {
|
|
162
|
-
fetchNews: async () => [article],
|
|
163
|
-
},
|
|
164
|
-
};
|
|
165
|
-
const router = new AssetDataRouter(null, [marketOnlySource, newsSource]);
|
|
166
|
-
|
|
167
|
-
const articles = await router.getNews({ feed: "latest", limit: 10 });
|
|
168
|
-
|
|
169
|
-
expect(articles).toEqual([article]);
|
|
170
|
-
});
|
|
171
|
-
|
|
172
|
-
test("falls back to later providers when holder data is empty", async () => {
|
|
173
|
-
const cloudProvider: DataProvider = {
|
|
174
|
-
...fallbackProvider,
|
|
175
|
-
id: "cloud",
|
|
176
|
-
name: "Cloud",
|
|
177
|
-
priority: 100,
|
|
178
|
-
async getHolders(symbol) {
|
|
179
|
-
return {
|
|
180
|
-
providerId: "cloud",
|
|
181
|
-
symbol,
|
|
182
|
-
holders: [],
|
|
183
|
-
};
|
|
184
|
-
},
|
|
185
|
-
};
|
|
186
|
-
const yahooProvider: DataProvider = {
|
|
187
|
-
...fallbackProvider,
|
|
188
|
-
id: "yahoo",
|
|
189
|
-
name: "Yahoo",
|
|
190
|
-
priority: 1000,
|
|
191
|
-
async getHolders(symbol) {
|
|
192
|
-
return {
|
|
193
|
-
providerId: "yahoo",
|
|
194
|
-
symbol,
|
|
195
|
-
currency: "USD",
|
|
196
|
-
holders: [{
|
|
197
|
-
providerId: "yahoo",
|
|
198
|
-
ownerType: "institution",
|
|
199
|
-
name: "Vanguard Group Inc",
|
|
200
|
-
shares: 1_200_000_000,
|
|
201
|
-
value: 250_000_000_000,
|
|
202
|
-
percentHeld: 0.08,
|
|
203
|
-
changePercent: 0.02,
|
|
204
|
-
}],
|
|
205
|
-
};
|
|
206
|
-
},
|
|
207
|
-
};
|
|
208
|
-
|
|
209
|
-
const router = new AssetDataRouter(yahooProvider, [cloudProvider]);
|
|
210
|
-
const holders = await router.getHolders("AAPL", "NASDAQ");
|
|
211
|
-
|
|
212
|
-
expect(holders.providerId).toBe("yahoo");
|
|
213
|
-
expect(holders.holders[0]?.name).toBe("Vanguard Group Inc");
|
|
214
|
-
});
|
|
215
|
-
|
|
216
|
-
test("routes earnings calendars through providers and fills missing symbols from fallback", async () => {
|
|
217
|
-
const cloudCalls: string[][] = [];
|
|
218
|
-
const yahooCalls: string[][] = [];
|
|
219
|
-
const event = (symbol: string, date: string) => ({
|
|
220
|
-
symbol,
|
|
221
|
-
name: symbol,
|
|
222
|
-
earningsDate: new Date(date),
|
|
223
|
-
epsEstimate: null,
|
|
224
|
-
epsActual: null,
|
|
225
|
-
revenueEstimate: null,
|
|
226
|
-
revenueActual: null,
|
|
227
|
-
surprise: null,
|
|
228
|
-
timing: "" as const,
|
|
229
|
-
});
|
|
230
|
-
const cloudProvider: DataProvider = {
|
|
231
|
-
...fallbackProvider,
|
|
232
|
-
id: "cloud",
|
|
233
|
-
name: "Cloud",
|
|
234
|
-
priority: 100,
|
|
235
|
-
async getEarningsCalendar(symbols) {
|
|
236
|
-
cloudCalls.push(symbols);
|
|
237
|
-
return [event("AAPL", "2026-07-30T20:00:00Z")];
|
|
238
|
-
},
|
|
239
|
-
};
|
|
240
|
-
const yahooProvider: DataProvider = {
|
|
241
|
-
...fallbackProvider,
|
|
242
|
-
id: "yahoo",
|
|
243
|
-
name: "Yahoo",
|
|
244
|
-
priority: 1000,
|
|
245
|
-
async getEarningsCalendar(symbols) {
|
|
246
|
-
yahooCalls.push(symbols);
|
|
247
|
-
return [event("MSFT", "2026-07-29T20:00:00Z")];
|
|
248
|
-
},
|
|
249
|
-
};
|
|
250
|
-
|
|
251
|
-
const router = new AssetDataRouter(yahooProvider, [cloudProvider]);
|
|
252
|
-
const events = await router.getEarningsCalendar(["msft", " AAPL ", "aapl"]);
|
|
253
|
-
|
|
254
|
-
expect(cloudCalls).toEqual([["MSFT", "AAPL"]]);
|
|
255
|
-
expect(yahooCalls).toEqual([["MSFT"]]);
|
|
256
|
-
expect(events.map((entry) => entry.symbol)).toEqual(["MSFT", "AAPL"]);
|
|
257
|
-
});
|
|
258
|
-
|
|
259
|
-
test("falls back to later analyst providers when rating targets are missing", async () => {
|
|
260
|
-
const cloudProvider: DataProvider = {
|
|
261
|
-
...fallbackProvider,
|
|
262
|
-
id: "cloud",
|
|
263
|
-
name: "Cloud",
|
|
264
|
-
priority: 100,
|
|
265
|
-
async getAnalystResearch(symbol) {
|
|
266
|
-
return {
|
|
267
|
-
providerId: "cloud",
|
|
268
|
-
symbol,
|
|
269
|
-
ratings: [{ date: "2026-05-01", firm: "Cloud Firm", action: "Raises", current: "Buy", prior: "Buy" }],
|
|
270
|
-
recommendations: [],
|
|
271
|
-
earningsEstimates: [],
|
|
272
|
-
revenueEstimates: [],
|
|
273
|
-
};
|
|
274
|
-
},
|
|
275
|
-
};
|
|
276
|
-
const yahooProvider: DataProvider = {
|
|
277
|
-
...fallbackProvider,
|
|
278
|
-
id: "yahoo",
|
|
279
|
-
name: "Yahoo",
|
|
280
|
-
priority: 1000,
|
|
281
|
-
async getAnalystResearch(symbol) {
|
|
282
|
-
return {
|
|
283
|
-
providerId: "yahoo",
|
|
284
|
-
symbol,
|
|
285
|
-
ratings: [{
|
|
286
|
-
date: "2026-05-01",
|
|
287
|
-
firm: "Yahoo Firm",
|
|
288
|
-
action: "Raises",
|
|
289
|
-
current: "Buy",
|
|
290
|
-
prior: "Buy",
|
|
291
|
-
currentPriceTarget: 680,
|
|
292
|
-
priorPriceTarget: 595,
|
|
293
|
-
}],
|
|
294
|
-
recommendations: [],
|
|
295
|
-
earningsEstimates: [],
|
|
296
|
-
revenueEstimates: [],
|
|
297
|
-
};
|
|
298
|
-
},
|
|
299
|
-
};
|
|
300
|
-
|
|
301
|
-
const router = new AssetDataRouter(yahooProvider, [cloudProvider]);
|
|
302
|
-
const research = await router.getAnalystResearch("AAPL", "NASDAQ");
|
|
303
|
-
|
|
304
|
-
expect(research.providerId).toBe("yahoo");
|
|
305
|
-
expect(research.ratings[0]?.currentPriceTarget).toBe(680);
|
|
306
|
-
expect(research.ratings[0]?.priorPriceTarget).toBe(595);
|
|
307
|
-
});
|
|
308
|
-
|
|
309
|
-
test("prefers cached analyst records with rating targets", async () => {
|
|
310
|
-
const dbPath = createTempDbPath("cached-analyst-targets");
|
|
311
|
-
const persistence = new AppPersistence(dbPath);
|
|
312
|
-
const cloudProvider: DataProvider = {
|
|
313
|
-
...fallbackProvider,
|
|
314
|
-
id: "cloud",
|
|
315
|
-
name: "Cloud",
|
|
316
|
-
priority: 100,
|
|
317
|
-
async getAnalystResearch(symbol) {
|
|
318
|
-
return {
|
|
319
|
-
providerId: "cloud",
|
|
320
|
-
symbol,
|
|
321
|
-
ratings: [{ date: "2026-05-01", firm: "Cloud Firm", action: "Raises", current: "Buy", prior: "Buy" }],
|
|
322
|
-
recommendations: [],
|
|
323
|
-
earningsEstimates: [],
|
|
324
|
-
revenueEstimates: [],
|
|
325
|
-
};
|
|
326
|
-
},
|
|
327
|
-
};
|
|
328
|
-
const yahooProvider: DataProvider = {
|
|
329
|
-
...fallbackProvider,
|
|
330
|
-
id: "yahoo",
|
|
331
|
-
name: "Yahoo",
|
|
332
|
-
priority: 1000,
|
|
333
|
-
async getAnalystResearch(symbol) {
|
|
334
|
-
return {
|
|
335
|
-
providerId: "yahoo",
|
|
336
|
-
symbol,
|
|
337
|
-
ratings: [{
|
|
338
|
-
date: "2026-05-01",
|
|
339
|
-
firm: "Yahoo Firm",
|
|
340
|
-
action: "Raises",
|
|
341
|
-
current: "Buy",
|
|
342
|
-
prior: "Buy",
|
|
343
|
-
currentPriceTarget: 680,
|
|
344
|
-
priorPriceTarget: 595,
|
|
345
|
-
}],
|
|
346
|
-
recommendations: [],
|
|
347
|
-
earningsEstimates: [],
|
|
348
|
-
revenueEstimates: [],
|
|
349
|
-
};
|
|
350
|
-
},
|
|
351
|
-
};
|
|
352
|
-
const unavailableProvider = (id: string, priority: number): DataProvider => ({
|
|
353
|
-
...fallbackProvider,
|
|
354
|
-
id,
|
|
355
|
-
name: id,
|
|
356
|
-
priority,
|
|
357
|
-
async getAnalystResearch() {
|
|
358
|
-
throw new Error(`${id} should not be fetched`);
|
|
359
|
-
},
|
|
360
|
-
});
|
|
361
|
-
|
|
362
|
-
try {
|
|
363
|
-
const seedRouter = new AssetDataRouter(yahooProvider, [cloudProvider], persistence.resources);
|
|
364
|
-
await seedRouter.getAnalystResearch("AAPL", "NASDAQ");
|
|
365
|
-
|
|
366
|
-
const cachedRouter = new AssetDataRouter(
|
|
367
|
-
unavailableProvider("yahoo", 1000),
|
|
368
|
-
[unavailableProvider("cloud", 100)],
|
|
369
|
-
persistence.resources,
|
|
370
|
-
);
|
|
371
|
-
const research = await cachedRouter.getAnalystResearch("AAPL", "NASDAQ");
|
|
372
|
-
|
|
373
|
-
expect(research.providerId).toBe("yahoo");
|
|
374
|
-
expect(research.ratings[0]?.currentPriceTarget).toBe(680);
|
|
375
|
-
expect(research.ratings[0]?.priorPriceTarget).toBe(595);
|
|
376
|
-
} finally {
|
|
377
|
-
persistence.close();
|
|
378
|
-
}
|
|
379
|
-
});
|
|
380
|
-
|
|
381
|
-
test("prefers broker quotes over fallback quotes", async () => {
|
|
382
|
-
const router = new AssetDataRouter(fallbackProvider);
|
|
383
|
-
const broker: BrokerAdapter = {
|
|
384
|
-
id: "ibkr",
|
|
385
|
-
name: "IBKR",
|
|
386
|
-
configSchema: [],
|
|
387
|
-
async validate() {
|
|
388
|
-
return true;
|
|
389
|
-
},
|
|
390
|
-
async importPositions() {
|
|
391
|
-
return [];
|
|
392
|
-
},
|
|
393
|
-
async getQuote() {
|
|
394
|
-
return {
|
|
395
|
-
symbol: "AAPL",
|
|
396
|
-
price: 123.45,
|
|
397
|
-
currency: "USD",
|
|
398
|
-
change: 1,
|
|
399
|
-
changePercent: 0.8,
|
|
400
|
-
lastUpdated: Date.now(),
|
|
401
|
-
};
|
|
402
|
-
},
|
|
403
|
-
};
|
|
404
|
-
|
|
405
|
-
attachTestRegistry(router, { brokers: [["ibkr", broker]] });
|
|
406
|
-
setBrokerInstances(router, [
|
|
407
|
-
brokerInstance({
|
|
408
|
-
config: { connectionMode: "gateway", gateway: { host: "127.0.0.1", port: 4002, clientId: 1 } },
|
|
409
|
-
}),
|
|
410
|
-
]);
|
|
411
|
-
|
|
412
|
-
const quote = await router.getQuote("AAPL", "NASDAQ", { brokerId: "ibkr", brokerInstanceId: "ibkr-work" });
|
|
413
|
-
expect(quote.price).toBe(123.45);
|
|
414
|
-
});
|
|
415
|
-
|
|
416
|
-
test("reconciles broker quote price with provider day reference fields", async () => {
|
|
417
|
-
const router = new AssetDataRouter({
|
|
418
|
-
...fallbackProvider,
|
|
419
|
-
id: "yahoo",
|
|
420
|
-
async getQuote() {
|
|
421
|
-
return {
|
|
422
|
-
symbol: "VICR",
|
|
423
|
-
providerId: "yahoo",
|
|
424
|
-
price: 299.74,
|
|
425
|
-
currency: "USD",
|
|
426
|
-
previousClose: 282.95,
|
|
427
|
-
change: 16.79,
|
|
428
|
-
changePercent: 5.93,
|
|
429
|
-
lastUpdated: Date.now(),
|
|
430
|
-
};
|
|
431
|
-
},
|
|
432
|
-
});
|
|
433
|
-
const broker: BrokerAdapter = {
|
|
434
|
-
id: "ibkr",
|
|
435
|
-
name: "IBKR",
|
|
436
|
-
configSchema: [],
|
|
437
|
-
async validate() {
|
|
438
|
-
return true;
|
|
439
|
-
},
|
|
440
|
-
async importPositions() {
|
|
441
|
-
return [];
|
|
442
|
-
},
|
|
443
|
-
async getQuote() {
|
|
444
|
-
return {
|
|
445
|
-
symbol: "VICR",
|
|
446
|
-
providerId: "ibkr",
|
|
447
|
-
price: 299.8,
|
|
448
|
-
currency: "USD",
|
|
449
|
-
previousClose: 380.1,
|
|
450
|
-
change: -80.3,
|
|
451
|
-
changePercent: -21.12,
|
|
452
|
-
lastUpdated: Date.now(),
|
|
453
|
-
dataSource: "live",
|
|
454
|
-
};
|
|
455
|
-
},
|
|
456
|
-
};
|
|
457
|
-
|
|
458
|
-
attachTestRegistry(router, { brokers: [["ibkr", broker]] });
|
|
459
|
-
setBrokerInstances(router, [brokerInstance()]);
|
|
460
|
-
|
|
461
|
-
const quote = await router.getQuote("VICR", "NASDAQ", { brokerId: "ibkr", brokerInstanceId: "ibkr-work" });
|
|
462
|
-
expect(quote.providerId).toBe("ibkr");
|
|
463
|
-
expect(quote.price).toBe(299.8);
|
|
464
|
-
expect(quote.previousClose).toBe(282.95);
|
|
465
|
-
expect(quote.change).toBeCloseTo(16.85, 5);
|
|
466
|
-
expect(quote.changePercent).toBeCloseTo(5.955, 3);
|
|
467
|
-
expect(quote.provenance?.price?.providerId).toBe("ibkr");
|
|
468
|
-
expect(quote.provenance?.fields?.previousClose?.providerId).toBe("yahoo");
|
|
469
|
-
});
|
|
470
|
-
|
|
471
|
-
test("refreshes broker option session references across the market close", async () => {
|
|
472
|
-
const dbPath = createTempDbPath("option-session-transition");
|
|
473
|
-
const persistence = new AppPersistence(dbPath);
|
|
474
|
-
const optionSymbol = "IBIT 281215C00030000";
|
|
475
|
-
const context = {
|
|
476
|
-
brokerId: "ibkr",
|
|
477
|
-
brokerInstanceId: "ibkr-work",
|
|
478
|
-
instrument: {
|
|
479
|
-
brokerId: "ibkr",
|
|
480
|
-
brokerInstanceId: "ibkr-work",
|
|
481
|
-
symbol: "IBIT",
|
|
482
|
-
localSymbol: optionSymbol,
|
|
483
|
-
secType: "OPT",
|
|
484
|
-
},
|
|
485
|
-
} as const;
|
|
486
|
-
const entityKey = getRouterEntityKey(optionSymbol, context.instrument);
|
|
487
|
-
const providerSourceKey = "provider:yahoo";
|
|
488
|
-
const cacheKey = {
|
|
489
|
-
namespace: "market",
|
|
490
|
-
kind: "quote",
|
|
491
|
-
entityKey,
|
|
492
|
-
variantKey: "",
|
|
493
|
-
sourceKey: providerSourceKey,
|
|
494
|
-
};
|
|
495
|
-
const regularReference = makeQuote({
|
|
496
|
-
symbol: optionSymbol,
|
|
497
|
-
providerId: "yahoo",
|
|
498
|
-
price: 15.775,
|
|
499
|
-
change: 0.29,
|
|
500
|
-
changePercent: 1.87,
|
|
501
|
-
previousClose: 15.485,
|
|
502
|
-
listingExchangeName: "OPTIONS",
|
|
503
|
-
marketState: "REGULAR",
|
|
504
|
-
sessionConfidence: "derived",
|
|
505
|
-
});
|
|
506
|
-
let providerCalls = 0;
|
|
507
|
-
let providerAvailable = true;
|
|
508
|
-
const provider: DataProvider = {
|
|
509
|
-
...fallbackProvider,
|
|
510
|
-
id: "yahoo",
|
|
511
|
-
name: "Yahoo",
|
|
512
|
-
async getQuote() {
|
|
513
|
-
providerCalls += 1;
|
|
514
|
-
if (!providerAvailable) throw new Error("temporary provider outage");
|
|
515
|
-
return {
|
|
516
|
-
...regularReference,
|
|
517
|
-
marketState: "CLOSED",
|
|
518
|
-
lastUpdated: Date.now(),
|
|
519
|
-
};
|
|
520
|
-
},
|
|
521
|
-
};
|
|
522
|
-
const broker: BrokerAdapter = {
|
|
523
|
-
id: "ibkr",
|
|
524
|
-
name: "IBKR",
|
|
525
|
-
configSchema: [],
|
|
526
|
-
async validate() {
|
|
527
|
-
return true;
|
|
528
|
-
},
|
|
529
|
-
async importPositions() {
|
|
530
|
-
return [];
|
|
531
|
-
},
|
|
532
|
-
async getQuote() {
|
|
533
|
-
return {
|
|
534
|
-
...regularReference,
|
|
535
|
-
providerId: "ibkr",
|
|
536
|
-
previousClose: 99,
|
|
537
|
-
marketState: undefined,
|
|
538
|
-
sessionConfidence: "unknown",
|
|
539
|
-
dataSource: "live",
|
|
540
|
-
lastUpdated: Date.now(),
|
|
541
|
-
};
|
|
542
|
-
},
|
|
543
|
-
};
|
|
544
|
-
|
|
545
|
-
try {
|
|
546
|
-
persistence.resources.set(cacheKey, regularReference, {
|
|
547
|
-
cachePolicy: { staleMs: 60_000, expireMs: 24 * 60 * 60_000 },
|
|
548
|
-
fetchedAt: Date.now() - 2 * 60_000,
|
|
549
|
-
});
|
|
550
|
-
const router = new AssetDataRouter(provider, [], persistence.resources);
|
|
551
|
-
attachTestRegistry(router, { brokers: [["ibkr", broker]] });
|
|
552
|
-
setBrokerInstances(router, [brokerInstance()]);
|
|
553
|
-
|
|
554
|
-
const staleTransition = await router.getQuote(optionSymbol, "", context);
|
|
555
|
-
expect(staleTransition.marketState).toBe("CLOSED");
|
|
556
|
-
expect(providerCalls).toBe(1);
|
|
557
|
-
|
|
558
|
-
persistence.resources.set(cacheKey, regularReference, {
|
|
559
|
-
cachePolicy: { staleMs: 60_000, expireMs: 24 * 60 * 60_000 },
|
|
560
|
-
fetchedAt: Date.now(),
|
|
561
|
-
});
|
|
562
|
-
const forcedTransition = await router.getQuote(optionSymbol, "", {
|
|
563
|
-
...context,
|
|
564
|
-
cacheMode: "refresh",
|
|
565
|
-
});
|
|
566
|
-
expect(forcedTransition.marketState).toBe("CLOSED");
|
|
567
|
-
expect(providerCalls).toBe(2);
|
|
568
|
-
|
|
569
|
-
providerAvailable = false;
|
|
570
|
-
persistence.resources.set(cacheKey, regularReference, {
|
|
571
|
-
cachePolicy: { staleMs: 60_000, expireMs: 24 * 60 * 60_000 },
|
|
572
|
-
fetchedAt: Date.now() - 2 * 60_000,
|
|
573
|
-
});
|
|
574
|
-
const outageFallback = await router.getQuote(optionSymbol, "", context);
|
|
575
|
-
expect(outageFallback.previousClose).toBe(15.485);
|
|
576
|
-
expect(outageFallback.provenance?.fields?.previousClose?.providerId).toBe("yahoo");
|
|
577
|
-
expect(outageFallback.marketState).toBeUndefined();
|
|
578
|
-
expect(providerCalls).toBe(3);
|
|
579
|
-
} finally {
|
|
580
|
-
persistence.close();
|
|
581
|
-
}
|
|
582
|
-
});
|
|
583
|
-
|
|
584
|
-
test("prefers broker options chains for broker-context targets", async () => {
|
|
585
|
-
const chain = {
|
|
586
|
-
underlyingSymbol: "AAPL",
|
|
587
|
-
expirationDates: [1_800_000_000],
|
|
588
|
-
calls: [],
|
|
589
|
-
puts: [],
|
|
590
|
-
};
|
|
591
|
-
const broker: BrokerAdapter = {
|
|
592
|
-
id: "ibkr",
|
|
593
|
-
name: "IBKR",
|
|
594
|
-
configSchema: [],
|
|
595
|
-
async validate() {
|
|
596
|
-
return true;
|
|
597
|
-
},
|
|
598
|
-
async importPositions() {
|
|
599
|
-
return [];
|
|
600
|
-
},
|
|
601
|
-
async getOptionsChain(ticker, _instance, exchange, expirationDate) {
|
|
602
|
-
expect(ticker).toBe("AAPL");
|
|
603
|
-
expect(exchange).toBe("NASDAQ");
|
|
604
|
-
expect(expirationDate).toBe(1_800_000_000);
|
|
605
|
-
return chain;
|
|
606
|
-
},
|
|
607
|
-
};
|
|
608
|
-
const fallback: DataProvider = {
|
|
609
|
-
...fallbackProvider,
|
|
610
|
-
async getOptionsChain() {
|
|
611
|
-
throw new Error("fallback should not handle broker-context options");
|
|
612
|
-
},
|
|
613
|
-
};
|
|
614
|
-
const router = new AssetDataRouter(fallback);
|
|
615
|
-
attachTestRegistry(router, { brokers: [["ibkr", broker]] });
|
|
616
|
-
setBrokerInstances(router, [brokerInstance()]);
|
|
617
|
-
|
|
618
|
-
const result = await router.getOptionsChain("AAPL", "NASDAQ", 1_800_000_000, {
|
|
619
|
-
brokerId: "ibkr",
|
|
620
|
-
brokerInstanceId: "ibkr-work",
|
|
621
|
-
});
|
|
622
|
-
|
|
623
|
-
expect(result).toBe(chain);
|
|
624
|
-
});
|
|
625
|
-
|
|
626
|
-
test("falls back to provider quotes when a broker mark is stale", async () => {
|
|
627
|
-
const fixedNow = Date.parse("2026-05-13T21:00:00Z");
|
|
628
|
-
const realDateNow = Date.now;
|
|
629
|
-
Date.now = () => fixedNow;
|
|
630
|
-
try {
|
|
631
|
-
const yahooProvider: DataProvider = {
|
|
632
|
-
...fallbackProvider,
|
|
633
|
-
id: "yahoo",
|
|
634
|
-
name: "Yahoo",
|
|
635
|
-
async getQuote(symbol) {
|
|
636
|
-
return {
|
|
637
|
-
symbol,
|
|
638
|
-
providerId: "yahoo",
|
|
639
|
-
price: 50_500,
|
|
640
|
-
currency: "JPY",
|
|
641
|
-
change: 4400,
|
|
642
|
-
changePercent: 9.54,
|
|
643
|
-
lastUpdated: Date.parse("2026-05-13T06:24:00Z"),
|
|
644
|
-
listingExchangeName: "JPX",
|
|
645
|
-
marketState: "CLOSED",
|
|
646
|
-
dataSource: "delayed",
|
|
647
|
-
};
|
|
648
|
-
},
|
|
649
|
-
};
|
|
650
|
-
const router = new AssetDataRouter(yahooProvider);
|
|
651
|
-
const broker: BrokerAdapter = {
|
|
652
|
-
id: "ibkr",
|
|
653
|
-
name: "IBKR",
|
|
654
|
-
configSchema: [],
|
|
655
|
-
async validate() {
|
|
656
|
-
return true;
|
|
657
|
-
},
|
|
658
|
-
async importPositions() {
|
|
659
|
-
return [];
|
|
660
|
-
},
|
|
661
|
-
async getQuote() {
|
|
662
|
-
return {
|
|
663
|
-
symbol: "285A.T",
|
|
664
|
-
providerId: "ibkr",
|
|
665
|
-
price: 46_100,
|
|
666
|
-
currency: "JPY",
|
|
667
|
-
change: 0,
|
|
668
|
-
changePercent: 0,
|
|
669
|
-
lastUpdated: Date.parse("2026-05-08T06:00:00Z"),
|
|
670
|
-
dataSource: "delayed",
|
|
671
|
-
};
|
|
672
|
-
},
|
|
673
|
-
};
|
|
674
|
-
|
|
675
|
-
attachTestRegistry(router, { brokers: [["ibkr", broker]] });
|
|
676
|
-
setBrokerInstances(router, [
|
|
677
|
-
brokerInstance({
|
|
678
|
-
config: { connectionMode: "gateway", gateway: { host: "127.0.0.1", port: 4002, clientId: 1 } },
|
|
679
|
-
}),
|
|
680
|
-
]);
|
|
681
|
-
|
|
682
|
-
const quote = await router.getQuote("285A.T", "TSEJ", { brokerId: "ibkr", brokerInstanceId: "ibkr-work" });
|
|
683
|
-
expect(quote.providerId).toBe("yahoo");
|
|
684
|
-
expect(quote.price).toBe(50_500);
|
|
685
|
-
} finally {
|
|
686
|
-
Date.now = realDateNow;
|
|
687
|
-
}
|
|
688
|
-
});
|
|
689
|
-
|
|
690
|
-
test("prefers the requested broker instance in search results", async () => {
|
|
691
|
-
const router = new AssetDataRouter(fallbackProvider);
|
|
692
|
-
const broker: BrokerAdapter = {
|
|
693
|
-
id: "ibkr",
|
|
694
|
-
name: "IBKR",
|
|
695
|
-
configSchema: [],
|
|
696
|
-
async validate() {
|
|
697
|
-
return true;
|
|
698
|
-
},
|
|
699
|
-
async importPositions() {
|
|
700
|
-
return [];
|
|
701
|
-
},
|
|
702
|
-
async searchInstruments(_query, instance) {
|
|
703
|
-
return [{
|
|
704
|
-
providerId: "ibkr",
|
|
705
|
-
symbol: instance.label === "Work" ? "AAPL" : "MSFT",
|
|
706
|
-
name: `${instance.label} contract`,
|
|
707
|
-
exchange: "NASDAQ",
|
|
708
|
-
type: "STK",
|
|
709
|
-
brokerContract: {
|
|
710
|
-
brokerId: "ibkr",
|
|
711
|
-
symbol: instance.label === "Work" ? "AAPL" : "MSFT",
|
|
712
|
-
exchange: "SMART",
|
|
713
|
-
},
|
|
714
|
-
}];
|
|
715
|
-
},
|
|
716
|
-
};
|
|
717
|
-
|
|
718
|
-
attachTestRegistry(router, { brokers: [["ibkr", broker]] });
|
|
719
|
-
setBrokerInstances(router, [
|
|
720
|
-
brokerInstance({
|
|
721
|
-
config: { connectionMode: "gateway", gateway: { host: "127.0.0.1", port: 4002, clientId: 1 } },
|
|
722
|
-
}),
|
|
723
|
-
brokerInstance({
|
|
724
|
-
id: "ibkr-personal",
|
|
725
|
-
label: "Personal",
|
|
726
|
-
config: { connectionMode: "gateway", gateway: { host: "127.0.0.1", port: 4003, clientId: 2 } },
|
|
727
|
-
}),
|
|
728
|
-
]);
|
|
729
|
-
|
|
730
|
-
const results = await router.search("AAPL", { preferBroker: true, brokerInstanceId: "ibkr-work" });
|
|
731
|
-
expect(results[0]?.brokerInstanceId).toBe("ibkr-work");
|
|
732
|
-
expect(results[0]?.brokerLabel).toBe("Work");
|
|
733
|
-
expect(results[0]?.brokerContract?.brokerInstanceId).toBe("ibkr-work");
|
|
734
|
-
});
|
|
735
|
-
|
|
736
|
-
test("keeps the richer search result when providers return the same instrument", async () => {
|
|
737
|
-
const broker: BrokerAdapter = {
|
|
738
|
-
id: "ibkr",
|
|
739
|
-
name: "IBKR",
|
|
740
|
-
configSchema: [],
|
|
741
|
-
async validate() {
|
|
742
|
-
return true;
|
|
743
|
-
},
|
|
744
|
-
async importPositions() {
|
|
745
|
-
return [];
|
|
746
|
-
},
|
|
747
|
-
async searchInstruments() {
|
|
748
|
-
return [{
|
|
749
|
-
providerId: "ibkr",
|
|
750
|
-
symbol: "AAPL",
|
|
751
|
-
name: "Apple Inc",
|
|
752
|
-
exchange: "NASDAQ",
|
|
753
|
-
type: "STK",
|
|
754
|
-
brokerLabel: "Work",
|
|
755
|
-
brokerContract: {
|
|
756
|
-
brokerId: "ibkr",
|
|
757
|
-
brokerInstanceId: "ibkr-work",
|
|
758
|
-
symbol: "AAPL",
|
|
759
|
-
localSymbol: "AAPL",
|
|
760
|
-
exchange: "SMART",
|
|
761
|
-
},
|
|
762
|
-
}];
|
|
763
|
-
},
|
|
764
|
-
};
|
|
765
|
-
const provider: DataProvider = {
|
|
766
|
-
...fallbackProvider,
|
|
767
|
-
id: "yahoo",
|
|
768
|
-
name: "Yahoo",
|
|
769
|
-
async search() {
|
|
770
|
-
return [{
|
|
771
|
-
providerId: "yahoo",
|
|
772
|
-
symbol: "AAPL",
|
|
773
|
-
name: "Apple",
|
|
774
|
-
exchange: "NASDAQ",
|
|
775
|
-
type: "STK",
|
|
776
|
-
}];
|
|
777
|
-
},
|
|
778
|
-
};
|
|
779
|
-
const router = new AssetDataRouter(fallbackProvider, [provider]);
|
|
780
|
-
|
|
781
|
-
attachTestRegistry(router, { brokers: [["ibkr", broker]] });
|
|
782
|
-
setBrokerInstances(router, [
|
|
783
|
-
brokerInstance({
|
|
784
|
-
config: { connectionMode: "gateway", gateway: { host: "127.0.0.1", port: 4002, clientId: 1 } },
|
|
785
|
-
}),
|
|
786
|
-
]);
|
|
787
|
-
|
|
788
|
-
const results = await router.search("AAPL", { preferBroker: true, brokerInstanceId: "ibkr-work" });
|
|
789
|
-
expect(results).toHaveLength(1);
|
|
790
|
-
expect(results[0]?.providerId).toBe("ibkr");
|
|
791
|
-
expect(results[0]?.brokerContract?.localSymbol).toBe("AAPL");
|
|
792
|
-
});
|
|
793
|
-
|
|
794
|
-
test("ignores disabled plugin sources when the registry filters them out", async () => {
|
|
795
|
-
const router = new AssetDataRouter(fallbackProvider);
|
|
796
|
-
attachTestRegistry(router);
|
|
797
|
-
|
|
798
|
-
const quote = await router.getQuote("AAPL", "NASDAQ");
|
|
799
|
-
expect(quote.price).toBe(100);
|
|
800
|
-
expect(quote.providerId).toBeUndefined();
|
|
801
|
-
});
|
|
802
|
-
|
|
803
|
-
test("does not search fallback providers when the preferred provider returns results", async () => {
|
|
804
|
-
let cloudCalls = 0;
|
|
805
|
-
let yahooCalls = 0;
|
|
806
|
-
const cloudProvider: DataProvider = {
|
|
807
|
-
...fallbackProvider,
|
|
808
|
-
id: "cloud",
|
|
809
|
-
name: "Cloud",
|
|
810
|
-
priority: 100,
|
|
811
|
-
async search() {
|
|
812
|
-
cloudCalls += 1;
|
|
813
|
-
return [{ providerId: "cloud", symbol: "SEC0", name: "iShares ETF", exchange: "XETRA", type: "ETF" }];
|
|
814
|
-
},
|
|
815
|
-
};
|
|
816
|
-
const yahooProvider: DataProvider = {
|
|
817
|
-
...fallbackProvider,
|
|
818
|
-
id: "yahoo",
|
|
819
|
-
name: "Yahoo",
|
|
820
|
-
priority: 1000,
|
|
821
|
-
async search() {
|
|
822
|
-
yahooCalls += 1;
|
|
823
|
-
return [{ providerId: "yahoo", symbol: "SEC0", name: "iShares ETF", exchange: "XETRA", type: "ETF" }];
|
|
824
|
-
},
|
|
825
|
-
};
|
|
826
|
-
|
|
827
|
-
const router = new AssetDataRouter(yahooProvider, [cloudProvider]);
|
|
828
|
-
const results = await router.search("SEC0");
|
|
829
|
-
|
|
830
|
-
expect(results[0]?.providerId).toBe("cloud");
|
|
831
|
-
expect(cloudCalls).toBe(1);
|
|
832
|
-
expect(yahooCalls).toBe(0);
|
|
833
|
-
});
|
|
834
|
-
|
|
835
|
-
test("routes through registered asset-data capabilities", async () => {
|
|
836
|
-
const cloudProvider: DataProvider = {
|
|
837
|
-
...fallbackProvider,
|
|
838
|
-
id: "cloud",
|
|
839
|
-
name: "Cloud",
|
|
840
|
-
priority: 10,
|
|
841
|
-
async getQuote() {
|
|
842
|
-
return {
|
|
843
|
-
symbol: "AAPL",
|
|
844
|
-
providerId: "cloud",
|
|
845
|
-
price: 125,
|
|
846
|
-
currency: "USD",
|
|
847
|
-
change: 1,
|
|
848
|
-
changePercent: 0.8,
|
|
849
|
-
lastUpdated: Date.now(),
|
|
850
|
-
};
|
|
851
|
-
},
|
|
852
|
-
};
|
|
853
|
-
const router = new AssetDataRouter(fallbackProvider);
|
|
854
|
-
attachTestRegistry(router, {
|
|
855
|
-
getEnabledCapabilities: (kind?: string) => (
|
|
856
|
-
kind === "asset-data" ? [assetDataProvider(cloudProvider)] : []
|
|
857
|
-
),
|
|
858
|
-
});
|
|
859
|
-
|
|
860
|
-
const quote = await router.getQuote("AAPL", "NASDAQ");
|
|
861
|
-
expect(quote.price).toBe(125);
|
|
862
|
-
expect(quote.providerId).toBe("cloud");
|
|
863
|
-
});
|
|
864
|
-
|
|
865
|
-
test("falls back when the preferred provider returns a stale quote", async () => {
|
|
866
|
-
const fixedNow = Date.parse("2026-05-13T21:00:00Z");
|
|
867
|
-
const realDateNow = Date.now;
|
|
868
|
-
Date.now = () => fixedNow;
|
|
869
|
-
try {
|
|
870
|
-
const yahooProvider: DataProvider = {
|
|
871
|
-
...fallbackProvider,
|
|
872
|
-
id: "yahoo",
|
|
873
|
-
name: "Yahoo",
|
|
874
|
-
async getQuote(symbol) {
|
|
875
|
-
return {
|
|
876
|
-
symbol,
|
|
877
|
-
providerId: "yahoo",
|
|
878
|
-
price: 168,
|
|
879
|
-
currency: "TWD",
|
|
880
|
-
change: 1,
|
|
881
|
-
changePercent: 0.6,
|
|
882
|
-
lastUpdated: Date.parse("2026-05-13T05:30:00Z"),
|
|
883
|
-
listingExchangeName: "TWSE",
|
|
884
|
-
marketState: "CLOSED",
|
|
885
|
-
dataSource: "delayed",
|
|
886
|
-
};
|
|
887
|
-
},
|
|
888
|
-
};
|
|
889
|
-
const cloudProvider: DataProvider = {
|
|
890
|
-
...fallbackProvider,
|
|
891
|
-
id: "gloomberb-cloud",
|
|
892
|
-
name: "Cloud",
|
|
893
|
-
priority: 100,
|
|
894
|
-
async getQuote(symbol) {
|
|
895
|
-
return {
|
|
896
|
-
symbol,
|
|
897
|
-
providerId: "gloomberb-cloud",
|
|
898
|
-
price: 150,
|
|
899
|
-
currency: "TWD",
|
|
900
|
-
change: 0,
|
|
901
|
-
changePercent: 0,
|
|
902
|
-
lastUpdated: Date.parse("2026-05-08T06:00:00Z"),
|
|
903
|
-
listingExchangeName: "TWSE",
|
|
904
|
-
marketState: "CLOSED",
|
|
905
|
-
dataSource: "delayed",
|
|
906
|
-
};
|
|
907
|
-
},
|
|
908
|
-
async getQuotesBatch(targets) {
|
|
909
|
-
return targets.map((target) => ({
|
|
910
|
-
target,
|
|
911
|
-
quote: {
|
|
912
|
-
symbol: target.symbol,
|
|
913
|
-
providerId: "gloomberb-cloud",
|
|
914
|
-
price: 150,
|
|
915
|
-
currency: "TWD",
|
|
916
|
-
change: 0,
|
|
917
|
-
changePercent: 0,
|
|
918
|
-
lastUpdated: Date.parse("2026-05-08T06:00:00Z"),
|
|
919
|
-
listingExchangeName: "TWSE",
|
|
920
|
-
marketState: "CLOSED",
|
|
921
|
-
dataSource: "delayed",
|
|
922
|
-
},
|
|
923
|
-
}));
|
|
924
|
-
},
|
|
925
|
-
};
|
|
926
|
-
const router = new AssetDataRouter(yahooProvider, [cloudProvider]);
|
|
927
|
-
|
|
928
|
-
const quote = await router.getQuote("2337", "TWSE");
|
|
929
|
-
expect(quote.providerId).toBe("yahoo");
|
|
930
|
-
expect(quote.price).toBe(168);
|
|
931
|
-
|
|
932
|
-
const [batch] = await router.getQuotesBatch([{ symbol: "2337", exchange: "TWSE" }], { forceRefresh: true });
|
|
933
|
-
expect(batch?.quote?.providerId).toBe("yahoo");
|
|
934
|
-
expect(batch?.quote?.price).toBe(168);
|
|
935
|
-
} finally {
|
|
936
|
-
Date.now = realDateNow;
|
|
937
|
-
}
|
|
938
|
-
});
|
|
939
|
-
|
|
940
|
-
test("prefers provider quote streams when one is available", () => {
|
|
941
|
-
const brokerTargets: QuoteSubscriptionTarget[] = [];
|
|
942
|
-
const providerTargets: QuoteSubscriptionTarget[] = [];
|
|
943
|
-
let brokerUnsubscribed = 0;
|
|
944
|
-
let providerUnsubscribed = 0;
|
|
945
|
-
|
|
946
|
-
const broker: BrokerAdapter = {
|
|
947
|
-
id: "ibkr",
|
|
948
|
-
name: "IBKR",
|
|
949
|
-
configSchema: [],
|
|
950
|
-
async validate() {
|
|
951
|
-
return true;
|
|
952
|
-
},
|
|
953
|
-
async importPositions() {
|
|
954
|
-
return [];
|
|
955
|
-
},
|
|
956
|
-
subscribeQuotes(_instance, targets, onQuote) {
|
|
957
|
-
brokerTargets.push(...targets);
|
|
958
|
-
onQuote(targets[0]!, {
|
|
959
|
-
symbol: "AAPL",
|
|
960
|
-
price: 123.45,
|
|
961
|
-
currency: "USD",
|
|
962
|
-
change: 1,
|
|
963
|
-
changePercent: 0.8,
|
|
964
|
-
lastUpdated: Date.now(),
|
|
965
|
-
});
|
|
966
|
-
return () => {
|
|
967
|
-
brokerUnsubscribed += 1;
|
|
968
|
-
};
|
|
969
|
-
},
|
|
970
|
-
};
|
|
971
|
-
const streamingProvider: DataProvider = {
|
|
972
|
-
...fallbackProvider,
|
|
973
|
-
id: "cloud",
|
|
974
|
-
name: "Cloud",
|
|
975
|
-
subscribeQuotes(targets, onQuote) {
|
|
976
|
-
providerTargets.push(...targets);
|
|
977
|
-
onQuote(targets[0]!, {
|
|
978
|
-
symbol: targets[0]!.symbol,
|
|
979
|
-
price: 456.78,
|
|
980
|
-
currency: "USD",
|
|
981
|
-
change: 2,
|
|
982
|
-
changePercent: 0.4,
|
|
983
|
-
lastUpdated: Date.now(),
|
|
984
|
-
});
|
|
985
|
-
return () => {
|
|
986
|
-
providerUnsubscribed += 1;
|
|
987
|
-
};
|
|
988
|
-
},
|
|
989
|
-
};
|
|
990
|
-
|
|
991
|
-
const router = new AssetDataRouter(fallbackProvider, [streamingProvider]);
|
|
992
|
-
attachTestRegistry(router, { brokers: [["ibkr", broker]] });
|
|
993
|
-
setBrokerInstances(router, [brokerInstance()]);
|
|
994
|
-
|
|
995
|
-
const seenSymbols: string[] = [];
|
|
996
|
-
const unsubscribe = router.subscribeQuotes([
|
|
997
|
-
{
|
|
998
|
-
symbol: "AAPL",
|
|
999
|
-
exchange: "NASDAQ",
|
|
1000
|
-
context: {
|
|
1001
|
-
brokerId: "ibkr",
|
|
1002
|
-
brokerInstanceId: "ibkr-work",
|
|
1003
|
-
},
|
|
1004
|
-
},
|
|
1005
|
-
{
|
|
1006
|
-
symbol: "MSFT",
|
|
1007
|
-
exchange: "NASDAQ",
|
|
1008
|
-
},
|
|
1009
|
-
], (target) => {
|
|
1010
|
-
seenSymbols.push(target.symbol);
|
|
1011
|
-
});
|
|
1012
|
-
|
|
1013
|
-
expect(brokerTargets).toEqual([]);
|
|
1014
|
-
expect(providerTargets).toEqual([
|
|
1015
|
-
{
|
|
1016
|
-
symbol: "AAPL",
|
|
1017
|
-
exchange: "NASDAQ",
|
|
1018
|
-
context: {
|
|
1019
|
-
brokerId: "ibkr",
|
|
1020
|
-
brokerInstanceId: "ibkr-work",
|
|
1021
|
-
},
|
|
1022
|
-
},
|
|
1023
|
-
{
|
|
1024
|
-
symbol: "MSFT",
|
|
1025
|
-
exchange: "NASDAQ",
|
|
1026
|
-
},
|
|
1027
|
-
]);
|
|
1028
|
-
expect(seenSymbols).toEqual(["AAPL"]);
|
|
1029
|
-
|
|
1030
|
-
unsubscribe();
|
|
1031
|
-
expect(brokerUnsubscribed).toBe(0);
|
|
1032
|
-
expect(providerUnsubscribed).toBe(1);
|
|
1033
|
-
});
|
|
1034
|
-
|
|
1035
|
-
test("can force broker-linked targets onto provider streaming", () => {
|
|
1036
|
-
const brokerTargets: QuoteSubscriptionTarget[] = [];
|
|
1037
|
-
const providerTargets: QuoteSubscriptionTarget[] = [];
|
|
1038
|
-
|
|
1039
|
-
const broker: BrokerAdapter = {
|
|
1040
|
-
id: "ibkr",
|
|
1041
|
-
name: "IBKR",
|
|
1042
|
-
configSchema: [],
|
|
1043
|
-
async validate() {
|
|
1044
|
-
return true;
|
|
1045
|
-
},
|
|
1046
|
-
async importPositions() {
|
|
1047
|
-
return [];
|
|
1048
|
-
},
|
|
1049
|
-
subscribeQuotes(_instance, targets) {
|
|
1050
|
-
brokerTargets.push(...targets);
|
|
1051
|
-
return () => {};
|
|
1052
|
-
},
|
|
1053
|
-
};
|
|
1054
|
-
const streamingProvider: DataProvider = {
|
|
1055
|
-
...fallbackProvider,
|
|
1056
|
-
id: "cloud",
|
|
1057
|
-
name: "Cloud",
|
|
1058
|
-
subscribeQuotes(targets) {
|
|
1059
|
-
providerTargets.push(...targets);
|
|
1060
|
-
return () => {};
|
|
1061
|
-
},
|
|
1062
|
-
};
|
|
1063
|
-
|
|
1064
|
-
const router = new AssetDataRouter(fallbackProvider, [streamingProvider]);
|
|
1065
|
-
attachTestRegistry(router, { brokers: [["ibkr", broker]] });
|
|
1066
|
-
setBrokerInstances(router, [brokerInstance()]);
|
|
1067
|
-
|
|
1068
|
-
const unsubscribe = router.subscribeQuotes([{
|
|
1069
|
-
symbol: "AAPL",
|
|
1070
|
-
exchange: "NASDAQ",
|
|
1071
|
-
route: "provider",
|
|
1072
|
-
context: {
|
|
1073
|
-
brokerId: "ibkr",
|
|
1074
|
-
brokerInstanceId: "ibkr-work",
|
|
1075
|
-
},
|
|
1076
|
-
}], () => {});
|
|
1077
|
-
|
|
1078
|
-
expect(brokerTargets).toEqual([]);
|
|
1079
|
-
expect(providerTargets).toEqual([{
|
|
1080
|
-
symbol: "AAPL",
|
|
1081
|
-
exchange: "NASDAQ",
|
|
1082
|
-
route: "provider",
|
|
1083
|
-
context: {
|
|
1084
|
-
brokerId: "ibkr",
|
|
1085
|
-
brokerInstanceId: "ibkr-work",
|
|
1086
|
-
},
|
|
1087
|
-
}]);
|
|
1088
|
-
|
|
1089
|
-
unsubscribe();
|
|
1090
|
-
});
|
|
1091
|
-
|
|
1092
|
-
test("drops empty zero provider stream quotes", () => {
|
|
1093
|
-
const providerTargets: QuoteSubscriptionTarget[] = [];
|
|
1094
|
-
const seenQuotes: Array<{ symbol: string; price: number }> = [];
|
|
1095
|
-
const streamingProvider: DataProvider = {
|
|
1096
|
-
...fallbackProvider,
|
|
1097
|
-
id: "cloud",
|
|
1098
|
-
name: "Cloud",
|
|
1099
|
-
subscribeQuotes(targets, onQuote) {
|
|
1100
|
-
providerTargets.push(...targets);
|
|
1101
|
-
onQuote(targets[0]!, {
|
|
1102
|
-
symbol: "HEXA B",
|
|
1103
|
-
price: 0,
|
|
1104
|
-
currency: "SEK",
|
|
1105
|
-
change: 0,
|
|
1106
|
-
changePercent: 0,
|
|
1107
|
-
lastUpdated: Date.now(),
|
|
1108
|
-
listingExchangeName: "SFB",
|
|
1109
|
-
dataSource: "delayed",
|
|
1110
|
-
});
|
|
1111
|
-
return () => {};
|
|
1112
|
-
},
|
|
1113
|
-
};
|
|
1114
|
-
|
|
1115
|
-
const router = new AssetDataRouter(fallbackProvider, [streamingProvider]);
|
|
1116
|
-
const unsubscribe = router.subscribeQuotes([{
|
|
1117
|
-
symbol: "HEXA B",
|
|
1118
|
-
exchange: "SFB",
|
|
1119
|
-
route: "provider",
|
|
1120
|
-
}], (_target, quote) => {
|
|
1121
|
-
seenQuotes.push({ symbol: quote.symbol, price: quote.price });
|
|
1122
|
-
});
|
|
1123
|
-
|
|
1124
|
-
expect(providerTargets).toEqual([{
|
|
1125
|
-
symbol: "HEXA B",
|
|
1126
|
-
exchange: "SFB",
|
|
1127
|
-
route: "provider",
|
|
1128
|
-
}]);
|
|
1129
|
-
expect(seenQuotes).toEqual([]);
|
|
1130
|
-
|
|
1131
|
-
unsubscribe();
|
|
1132
|
-
});
|
|
1133
|
-
|
|
1134
|
-
test("returns quote-only financials for option tickers when snapshots are unavailable", async () => {
|
|
1135
|
-
const router = new AssetDataRouter({
|
|
1136
|
-
...fallbackProvider,
|
|
1137
|
-
async getTickerFinancials() {
|
|
1138
|
-
return makeFinancials();
|
|
1139
|
-
},
|
|
1140
|
-
async getQuote(ticker) {
|
|
1141
|
-
return makeQuote({
|
|
1142
|
-
symbol: ticker,
|
|
1143
|
-
price: 252.375,
|
|
1144
|
-
change: 1.5,
|
|
1145
|
-
changePercent: 0.6,
|
|
1146
|
-
bid: 250.25,
|
|
1147
|
-
ask: 254.5,
|
|
1148
|
-
mark: 252.375,
|
|
1149
|
-
providerId: "gloomberb-cloud",
|
|
1150
|
-
dataSource: "delayed",
|
|
1151
|
-
});
|
|
1152
|
-
},
|
|
1153
|
-
});
|
|
1154
|
-
|
|
1155
|
-
const financials = await router.getTickerFinancials("AMD 270917C00230000");
|
|
1156
|
-
|
|
1157
|
-
expect(financials.quote?.symbol).toBe("AMD 270917C00230000");
|
|
1158
|
-
expect(financials.quote?.mark).toBe(252.375);
|
|
1159
|
-
expect(financials.annualStatements).toEqual([]);
|
|
1160
|
-
expect(financials.priceHistory).toEqual([]);
|
|
1161
|
-
});
|
|
1162
|
-
|
|
1163
|
-
test("merges cached broker financials with cached fallback fundamentals", async () => {
|
|
1164
|
-
const dbPath = createTempDbPath("cache-merge");
|
|
1165
|
-
const persistence = new AppPersistence(dbPath);
|
|
1166
|
-
const providerCalls = { broker: 0, fallback: 0 };
|
|
1167
|
-
const router = new AssetDataRouter({
|
|
1168
|
-
...fallbackProvider,
|
|
1169
|
-
async getTickerFinancials() {
|
|
1170
|
-
providerCalls.fallback += 1;
|
|
1171
|
-
return makeFinancials({
|
|
1172
|
-
annualStatements: [{ date: "2025-12-31", totalRevenue: 1000 }],
|
|
1173
|
-
quarterlyStatements: [{ date: "2025-12-31", totalRevenue: 250 }],
|
|
1174
|
-
fundamentals: { revenue: 1000, netIncome: 200 },
|
|
1175
|
-
});
|
|
1176
|
-
},
|
|
1177
|
-
}, [], persistence.resources);
|
|
1178
|
-
const broker: BrokerAdapter = {
|
|
1179
|
-
id: "ibkr",
|
|
1180
|
-
name: "IBKR",
|
|
1181
|
-
configSchema: [],
|
|
1182
|
-
async validate() {
|
|
1183
|
-
return true;
|
|
1184
|
-
},
|
|
1185
|
-
async importPositions() {
|
|
1186
|
-
return [];
|
|
1187
|
-
},
|
|
1188
|
-
async getTickerFinancials() {
|
|
1189
|
-
providerCalls.broker += 1;
|
|
1190
|
-
return makeFinancials({
|
|
1191
|
-
quote: makeQuote({
|
|
1192
|
-
price: 125,
|
|
1193
|
-
change: 2,
|
|
1194
|
-
changePercent: 1.6,
|
|
1195
|
-
}),
|
|
1196
|
-
fundamentals: {},
|
|
1197
|
-
});
|
|
1198
|
-
},
|
|
1199
|
-
};
|
|
1200
|
-
|
|
1201
|
-
attachTestRegistry(router, { brokers: [["ibkr", broker]] });
|
|
1202
|
-
setBrokerInstances(router, [brokerInstance()]);
|
|
1203
|
-
|
|
1204
|
-
const merged = await router.getTickerFinancials("AAPL", "NASDAQ", {
|
|
1205
|
-
brokerId: "ibkr",
|
|
1206
|
-
brokerInstanceId: "ibkr-work",
|
|
1207
|
-
});
|
|
1208
|
-
expect(merged.quote?.price).toBe(125);
|
|
1209
|
-
expect(merged.fundamentals?.revenue).toBe(1000);
|
|
1210
|
-
expect(providerCalls.broker).toBe(1);
|
|
1211
|
-
expect(providerCalls.fallback).toBe(1);
|
|
1212
|
-
|
|
1213
|
-
const cached = router.getCachedFinancialsForTargets([{
|
|
1214
|
-
symbol: "AAPL",
|
|
1215
|
-
exchange: "NASDAQ",
|
|
1216
|
-
brokerId: "ibkr",
|
|
1217
|
-
brokerInstanceId: "ibkr-work",
|
|
1218
|
-
}], { allowExpired: true });
|
|
1219
|
-
expect(cached.get("AAPL")?.quote?.price).toBe(125);
|
|
1220
|
-
expect(cached.get("AAPL")?.fundamentals?.revenue).toBe(1000);
|
|
1221
|
-
persistence.close();
|
|
1222
|
-
});
|
|
1223
|
-
|
|
1224
|
-
test("keeps broker price authority when a fallback quote is off by a likely 100x unit mismatch", async () => {
|
|
1225
|
-
const router = new AssetDataRouter({
|
|
1226
|
-
...fallbackProvider,
|
|
1227
|
-
async getTickerFinancials() {
|
|
1228
|
-
return makeFinancials({
|
|
1229
|
-
priceHistory: [{ date: new Date("2026-03-28T00:00:00Z"), close: 0.245 }],
|
|
1230
|
-
quote: makeQuote({
|
|
1231
|
-
symbol: "IQE.L",
|
|
1232
|
-
listingExchangeName: "LSE",
|
|
1233
|
-
providerId: "yahoo",
|
|
1234
|
-
price: 0.245,
|
|
1235
|
-
currency: "GBP",
|
|
1236
|
-
change: -0.021,
|
|
1237
|
-
changePercent: -7.89,
|
|
1238
|
-
dataSource: "delayed",
|
|
1239
|
-
}),
|
|
1240
|
-
fundamentals: { revenue: 1000 },
|
|
1241
|
-
});
|
|
1242
|
-
},
|
|
1243
|
-
});
|
|
1244
|
-
const broker: BrokerAdapter = {
|
|
1245
|
-
id: "ibkr",
|
|
1246
|
-
name: "IBKR",
|
|
1247
|
-
configSchema: [],
|
|
1248
|
-
async validate() {
|
|
1249
|
-
return true;
|
|
1250
|
-
},
|
|
1251
|
-
async importPositions() {
|
|
1252
|
-
return [];
|
|
1253
|
-
},
|
|
1254
|
-
async getTickerFinancials() {
|
|
1255
|
-
return makeFinancials({
|
|
1256
|
-
priceHistory: [{ date: new Date("2026-03-28T00:00:00Z"), close: 24.5 }],
|
|
1257
|
-
quote: makeQuote({
|
|
1258
|
-
symbol: "IQE",
|
|
1259
|
-
providerId: "ibkr",
|
|
1260
|
-
price: 24.5,
|
|
1261
|
-
currency: "GBP",
|
|
1262
|
-
change: -2.1,
|
|
1263
|
-
changePercent: -7.89,
|
|
1264
|
-
dataSource: "live",
|
|
1265
|
-
}),
|
|
1266
|
-
fundamentals: { netIncome: 200 },
|
|
1267
|
-
});
|
|
1268
|
-
},
|
|
1269
|
-
};
|
|
1270
|
-
|
|
1271
|
-
attachTestRegistry(router, { brokers: [["ibkr", broker]] });
|
|
1272
|
-
setBrokerInstances(router, [brokerInstance()]);
|
|
1273
|
-
|
|
1274
|
-
const merged = await router.getTickerFinancials("IQE", "LSE", {
|
|
1275
|
-
brokerId: "ibkr",
|
|
1276
|
-
brokerInstanceId: "ibkr-work",
|
|
1277
|
-
});
|
|
1278
|
-
|
|
1279
|
-
expect(merged.quote?.price).toBe(24.5);
|
|
1280
|
-
expect(merged.quote?.provenance?.rejectedPriceProviders).toContain("yahoo");
|
|
1281
|
-
expect(merged.priceHistory[0]?.close).toBe(0.245);
|
|
1282
|
-
expect(merged.fundamentals?.netIncome).toBe(200);
|
|
1283
|
-
});
|
|
1284
|
-
|
|
1285
|
-
test("preserves fallback profile data when broker already has fundamentals", async () => {
|
|
1286
|
-
const router = new AssetDataRouter({
|
|
1287
|
-
...fallbackProvider,
|
|
1288
|
-
async getTickerFinancials() {
|
|
1289
|
-
return makeFinancials({
|
|
1290
|
-
profile: {
|
|
1291
|
-
description: "Builds hardware and software.",
|
|
1292
|
-
sector: "Technology",
|
|
1293
|
-
industry: "Consumer Electronics",
|
|
1294
|
-
},
|
|
1295
|
-
});
|
|
1296
|
-
},
|
|
1297
|
-
});
|
|
1298
|
-
const broker: BrokerAdapter = {
|
|
1299
|
-
id: "ibkr",
|
|
1300
|
-
name: "IBKR",
|
|
1301
|
-
configSchema: [],
|
|
1302
|
-
async validate() {
|
|
1303
|
-
return true;
|
|
1304
|
-
},
|
|
1305
|
-
async importPositions() {
|
|
1306
|
-
return [];
|
|
1307
|
-
},
|
|
1308
|
-
async getTickerFinancials() {
|
|
1309
|
-
return makeFinancials({
|
|
1310
|
-
fundamentals: { revenue: 1000, netIncome: 200 },
|
|
1311
|
-
});
|
|
1312
|
-
},
|
|
1313
|
-
};
|
|
1314
|
-
|
|
1315
|
-
attachTestRegistry(router, { brokers: [["ibkr", broker]] });
|
|
1316
|
-
setBrokerInstances(router, [brokerInstance()]);
|
|
1317
|
-
|
|
1318
|
-
const merged = await router.getTickerFinancials("AAPL", "NASDAQ", {
|
|
1319
|
-
brokerId: "ibkr",
|
|
1320
|
-
brokerInstanceId: "ibkr-work",
|
|
1321
|
-
});
|
|
1322
|
-
expect(merged.fundamentals?.revenue).toBe(1000);
|
|
1323
|
-
expect(merged.profile?.description).toBe("Builds hardware and software.");
|
|
1324
|
-
expect(merged.profile?.sector).toBe("Technology");
|
|
1325
|
-
});
|
|
1326
|
-
|
|
1327
|
-
test("merges fallback provider statement arrays without taking over preferred financials", async () => {
|
|
1328
|
-
const cloudProvider: DataProvider = {
|
|
1329
|
-
...fallbackProvider,
|
|
1330
|
-
id: "cloud",
|
|
1331
|
-
name: "Cloud",
|
|
1332
|
-
priority: 100,
|
|
1333
|
-
async getTickerFinancials() {
|
|
1334
|
-
return makeFinancials({
|
|
1335
|
-
quote: makeQuote({
|
|
1336
|
-
price: 125,
|
|
1337
|
-
change: 2,
|
|
1338
|
-
changePercent: 1.6,
|
|
1339
|
-
}),
|
|
1340
|
-
fundamentals: {
|
|
1341
|
-
trailingPE: 25,
|
|
1342
|
-
},
|
|
1343
|
-
});
|
|
1344
|
-
},
|
|
1345
|
-
};
|
|
1346
|
-
let yahooCalls = 0;
|
|
1347
|
-
const yahooProvider: DataProvider = {
|
|
1348
|
-
...fallbackProvider,
|
|
1349
|
-
id: "yahoo",
|
|
1350
|
-
name: "Yahoo",
|
|
1351
|
-
priority: 1000,
|
|
1352
|
-
async getTickerFinancials() {
|
|
1353
|
-
yahooCalls += 1;
|
|
1354
|
-
return makeFinancials({
|
|
1355
|
-
annualStatements: [{ date: "2025-12-31", totalRevenue: 391035000000 }],
|
|
1356
|
-
quarterlyStatements: [{ date: "2026-03-31", totalRevenue: 95359000000 }],
|
|
1357
|
-
priceHistory: [{ date: new Date("2026-03-28T00:00:00Z"), close: 124 }],
|
|
1358
|
-
quote: makeQuote({
|
|
1359
|
-
price: 124,
|
|
1360
|
-
change: 1,
|
|
1361
|
-
changePercent: 0.8,
|
|
1362
|
-
marketCap: 2_000_000_000,
|
|
1363
|
-
}),
|
|
1364
|
-
fundamentals: {
|
|
1365
|
-
forwardPE: 22,
|
|
1366
|
-
},
|
|
1367
|
-
});
|
|
1368
|
-
},
|
|
1369
|
-
};
|
|
1370
|
-
|
|
1371
|
-
const router = new AssetDataRouter(yahooProvider, [cloudProvider]);
|
|
1372
|
-
const merged = await router.getTickerFinancials("AAPL", "NASDAQ");
|
|
1373
|
-
|
|
1374
|
-
expect(merged.quote?.price).toBe(125);
|
|
1375
|
-
expect(merged.quote?.marketCap).toBeUndefined();
|
|
1376
|
-
expect(merged.fundamentals?.trailingPE).toBe(25);
|
|
1377
|
-
expect(merged.fundamentals?.forwardPE).toBeUndefined();
|
|
1378
|
-
expect(merged.priceHistory).toEqual([]);
|
|
1379
|
-
expect(merged.annualStatements).toEqual([{ date: "2025-12-31", totalRevenue: 391035000000 }]);
|
|
1380
|
-
expect(merged.quarterlyStatements).toEqual([{ date: "2026-03-31", totalRevenue: 95359000000 }]);
|
|
1381
|
-
expect(yahooCalls).toBe(1);
|
|
1382
|
-
});
|
|
1383
|
-
|
|
1384
|
-
test("supplements shallow preferred provider statement history", async () => {
|
|
1385
|
-
const cloudProvider: DataProvider = {
|
|
1386
|
-
...fallbackProvider,
|
|
1387
|
-
id: "cloud",
|
|
1388
|
-
name: "Cloud",
|
|
1389
|
-
priority: 100,
|
|
1390
|
-
async getTickerFinancials() {
|
|
1391
|
-
return makeFinancials({
|
|
1392
|
-
profile: { sector: "Technology" },
|
|
1393
|
-
quote: makeQuote({ symbol: "LINK", price: 25 }),
|
|
1394
|
-
quarterlyStatements: [
|
|
1395
|
-
{ date: "2025-03-31", operatingCashFlow: -271_000 },
|
|
1396
|
-
{ date: "2025-06-30", operatingCashFlow: -138_000 },
|
|
1397
|
-
{ date: "2025-09-30", operatingCashFlow: 653_000 },
|
|
1398
|
-
{ date: "2025-12-31", operatingCashFlow: -356_000 },
|
|
1399
|
-
{ date: "2026-03-31", operatingCashFlow: -543_000 },
|
|
1400
|
-
],
|
|
1401
|
-
});
|
|
1402
|
-
},
|
|
1403
|
-
};
|
|
1404
|
-
let yahooCalls = 0;
|
|
1405
|
-
const yahooProvider: DataProvider = {
|
|
1406
|
-
...fallbackProvider,
|
|
1407
|
-
id: "yahoo",
|
|
1408
|
-
name: "Yahoo",
|
|
1409
|
-
priority: 1000,
|
|
1410
|
-
async getTickerFinancials() {
|
|
1411
|
-
yahooCalls += 1;
|
|
1412
|
-
return makeFinancials({
|
|
1413
|
-
quarterlyStatements: [
|
|
1414
|
-
{ date: "2024-03-31", operatingCashFlow: -601_000 },
|
|
1415
|
-
{ date: "2024-06-30", operatingCashFlow: -488_000 },
|
|
1416
|
-
{ date: "2024-09-30", operatingCashFlow: -204_000 },
|
|
1417
|
-
{ date: "2024-12-31", operatingCashFlow: 122_000 },
|
|
1418
|
-
],
|
|
1419
|
-
});
|
|
1420
|
-
},
|
|
1421
|
-
};
|
|
1422
|
-
|
|
1423
|
-
const router = new AssetDataRouter(yahooProvider, [cloudProvider]);
|
|
1424
|
-
const merged = await router.getTickerFinancials("LINK", "NASDAQ");
|
|
1425
|
-
|
|
1426
|
-
expect(yahooCalls).toBe(1);
|
|
1427
|
-
expect(merged.profile?.sector).toBe("Technology");
|
|
1428
|
-
expect(merged.quote?.price).toBe(25);
|
|
1429
|
-
expect(merged.quarterlyStatements.map((row) => row.date)).toEqual([
|
|
1430
|
-
"2024-03-31",
|
|
1431
|
-
"2024-06-30",
|
|
1432
|
-
"2024-09-30",
|
|
1433
|
-
"2024-12-31",
|
|
1434
|
-
"2025-03-31",
|
|
1435
|
-
"2025-06-30",
|
|
1436
|
-
"2025-09-30",
|
|
1437
|
-
"2025-12-31",
|
|
1438
|
-
"2026-03-31",
|
|
1439
|
-
]);
|
|
1440
|
-
});
|
|
1441
|
-
|
|
1442
|
-
test("enriches shallow batch provider statement history through the single financial route", async () => {
|
|
1443
|
-
const shallowCloudRows = [
|
|
1444
|
-
{ date: "2025-03-31", eps: 0.44 },
|
|
1445
|
-
{ date: "2025-06-30", eps: 0.54 },
|
|
1446
|
-
{ date: "2025-09-30", eps: 0.75 },
|
|
1447
|
-
{ date: "2025-12-31", eps: 0.92 },
|
|
1448
|
-
{ date: "2026-03-31", eps: 0.84 },
|
|
1449
|
-
];
|
|
1450
|
-
let cloudBatchCalls = 0;
|
|
1451
|
-
let cloudSingleCalls = 0;
|
|
1452
|
-
const cloudProvider: DataProvider = {
|
|
1453
|
-
...fallbackProvider,
|
|
1454
|
-
id: "cloud",
|
|
1455
|
-
name: "Cloud",
|
|
1456
|
-
priority: 100,
|
|
1457
|
-
async getTickerFinancials() {
|
|
1458
|
-
cloudSingleCalls += 1;
|
|
1459
|
-
return makeFinancials({
|
|
1460
|
-
profile: { sector: "Technology" },
|
|
1461
|
-
quote: makeQuote({ symbol: "AMD", price: 125 }),
|
|
1462
|
-
quarterlyStatements: shallowCloudRows,
|
|
1463
|
-
});
|
|
1464
|
-
},
|
|
1465
|
-
async getTickerFinancialsBatch(targets) {
|
|
1466
|
-
cloudBatchCalls += 1;
|
|
1467
|
-
return targets.map((target) => ({
|
|
1468
|
-
target,
|
|
1469
|
-
financials: makeFinancials({
|
|
1470
|
-
profile: { sector: "Technology" },
|
|
1471
|
-
quote: makeQuote({ symbol: target.symbol, price: 125 }),
|
|
1472
|
-
quarterlyStatements: shallowCloudRows,
|
|
1473
|
-
}),
|
|
1474
|
-
}));
|
|
1475
|
-
},
|
|
1476
|
-
};
|
|
1477
|
-
let yahooCalls = 0;
|
|
1478
|
-
const yahooProvider: DataProvider = {
|
|
1479
|
-
...fallbackProvider,
|
|
1480
|
-
id: "yahoo",
|
|
1481
|
-
name: "Yahoo",
|
|
1482
|
-
priority: 1000,
|
|
1483
|
-
async getTickerFinancials() {
|
|
1484
|
-
yahooCalls += 1;
|
|
1485
|
-
return makeFinancials({
|
|
1486
|
-
quarterlyStatements: [
|
|
1487
|
-
{ date: "2024-03-31", eps: 0.07 },
|
|
1488
|
-
{ date: "2024-06-30", eps: 0.16 },
|
|
1489
|
-
{ date: "2024-09-30", eps: 0.47 },
|
|
1490
|
-
{ date: "2024-12-31", eps: 0.29 },
|
|
1491
|
-
],
|
|
1492
|
-
});
|
|
1493
|
-
},
|
|
1494
|
-
};
|
|
1495
|
-
|
|
1496
|
-
const router = new AssetDataRouter(yahooProvider, [cloudProvider]);
|
|
1497
|
-
const results = await router.getTickerFinancialsBatch([{ symbol: "AMD", exchange: "NASDAQ" }], { forceRefresh: true });
|
|
1498
|
-
const financials = results[0]?.financials;
|
|
1499
|
-
|
|
1500
|
-
expect(cloudBatchCalls).toBe(1);
|
|
1501
|
-
expect(cloudSingleCalls).toBe(1);
|
|
1502
|
-
expect(yahooCalls).toBe(1);
|
|
1503
|
-
expect(financials?.profile?.sector).toBe("Technology");
|
|
1504
|
-
expect(financials?.quote?.symbol).toBe("AMD");
|
|
1505
|
-
expect(financials?.quarterlyStatements.map((row) => row.date)).toEqual([
|
|
1506
|
-
"2024-03-31",
|
|
1507
|
-
"2024-06-30",
|
|
1508
|
-
"2024-09-30",
|
|
1509
|
-
"2024-12-31",
|
|
1510
|
-
"2025-03-31",
|
|
1511
|
-
"2025-06-30",
|
|
1512
|
-
"2025-09-30",
|
|
1513
|
-
"2025-12-31",
|
|
1514
|
-
"2026-03-31",
|
|
1515
|
-
]);
|
|
1516
|
-
});
|
|
1517
|
-
|
|
1518
|
-
test("refreshes shallow cached provider statement history", async () => {
|
|
1519
|
-
const dbPath = createTempDbPath("cached-shallow-statement-history");
|
|
1520
|
-
const persistence = new AppPersistence(dbPath);
|
|
1521
|
-
const cloudProvider: DataProvider = {
|
|
1522
|
-
...fallbackProvider,
|
|
1523
|
-
id: "cloud",
|
|
1524
|
-
name: "Cloud",
|
|
1525
|
-
priority: 100,
|
|
1526
|
-
async getTickerFinancials() {
|
|
1527
|
-
return makeFinancials({
|
|
1528
|
-
profile: { sector: "Technology" },
|
|
1529
|
-
quote: makeQuote({ symbol: "LINK", price: 25 }),
|
|
1530
|
-
quarterlyStatements: [
|
|
1531
|
-
{ date: "2025-03-31", operatingCashFlow: -271_000 },
|
|
1532
|
-
{ date: "2025-06-30", operatingCashFlow: -138_000 },
|
|
1533
|
-
{ date: "2025-09-30", operatingCashFlow: 653_000 },
|
|
1534
|
-
{ date: "2025-12-31", operatingCashFlow: -356_000 },
|
|
1535
|
-
{ date: "2026-03-31", operatingCashFlow: -543_000 },
|
|
1536
|
-
],
|
|
1537
|
-
});
|
|
1538
|
-
},
|
|
1539
|
-
};
|
|
1540
|
-
let yahooCalls = 0;
|
|
1541
|
-
const yahooProvider: DataProvider = {
|
|
1542
|
-
...fallbackProvider,
|
|
1543
|
-
id: "yahoo",
|
|
1544
|
-
name: "Yahoo",
|
|
1545
|
-
priority: 1000,
|
|
1546
|
-
async getTickerFinancials() {
|
|
1547
|
-
yahooCalls += 1;
|
|
1548
|
-
return makeFinancials({
|
|
1549
|
-
quarterlyStatements: [
|
|
1550
|
-
{ date: "2024-03-31", operatingCashFlow: -601_000 },
|
|
1551
|
-
{ date: "2024-06-30", operatingCashFlow: -488_000 },
|
|
1552
|
-
{ date: "2024-09-30", operatingCashFlow: -204_000 },
|
|
1553
|
-
{ date: "2024-12-31", operatingCashFlow: 122_000 },
|
|
1554
|
-
],
|
|
1555
|
-
});
|
|
1556
|
-
},
|
|
1557
|
-
};
|
|
1558
|
-
|
|
1559
|
-
try {
|
|
1560
|
-
const seedRouter = new AssetDataRouter(null, [cloudProvider], persistence.resources);
|
|
1561
|
-
await seedRouter.getTickerFinancials("LINK", "NASDAQ");
|
|
1562
|
-
|
|
1563
|
-
const cachedRouter = new AssetDataRouter(yahooProvider, [cloudProvider], persistence.resources);
|
|
1564
|
-
const merged = await cachedRouter.getTickerFinancials("LINK", "NASDAQ");
|
|
1565
|
-
|
|
1566
|
-
expect(yahooCalls).toBe(1);
|
|
1567
|
-
expect(merged.quarterlyStatements).toHaveLength(9);
|
|
1568
|
-
} finally {
|
|
1569
|
-
persistence.close();
|
|
1570
|
-
}
|
|
1571
|
-
});
|
|
1572
|
-
|
|
1573
|
-
test("fills missing preferred statement fields from richer fallback rows", async () => {
|
|
1574
|
-
const cloudProvider: DataProvider = {
|
|
1575
|
-
...fallbackProvider,
|
|
1576
|
-
id: "cloud",
|
|
1577
|
-
name: "Cloud",
|
|
1578
|
-
priority: 100,
|
|
1579
|
-
async getTickerFinancials() {
|
|
1580
|
-
return makeFinancials({
|
|
1581
|
-
annualStatements: [{ date: "2025-12-31", totalRevenue: 1000 }],
|
|
1582
|
-
quote: makeQuote({
|
|
1583
|
-
symbol: "AMD",
|
|
1584
|
-
price: 125,
|
|
1585
|
-
change: 2,
|
|
1586
|
-
changePercent: 1.6,
|
|
1587
|
-
}),
|
|
1588
|
-
});
|
|
1589
|
-
},
|
|
1590
|
-
};
|
|
1591
|
-
let yahooCalls = 0;
|
|
1592
|
-
const yahooProvider: DataProvider = {
|
|
1593
|
-
...fallbackProvider,
|
|
1594
|
-
id: "yahoo",
|
|
1595
|
-
name: "Yahoo",
|
|
1596
|
-
priority: 1000,
|
|
1597
|
-
async getTickerFinancials() {
|
|
1598
|
-
yahooCalls += 1;
|
|
1599
|
-
return makeFinancials({
|
|
1600
|
-
annualStatements: [{
|
|
1601
|
-
date: "2025-12-31",
|
|
1602
|
-
totalRevenue: 900,
|
|
1603
|
-
accountsReceivable: 250,
|
|
1604
|
-
inventory: 125,
|
|
1605
|
-
}],
|
|
1606
|
-
});
|
|
1607
|
-
},
|
|
1608
|
-
};
|
|
1609
|
-
|
|
1610
|
-
const router = new AssetDataRouter(yahooProvider, [cloudProvider]);
|
|
1611
|
-
const merged = await router.getTickerFinancials("AMD", "NASDAQ");
|
|
1612
|
-
|
|
1613
|
-
expect(merged.quote?.price).toBe(125);
|
|
1614
|
-
expect(merged.annualStatements).toEqual([{
|
|
1615
|
-
date: "2025-12-31",
|
|
1616
|
-
totalRevenue: 1000,
|
|
1617
|
-
accountsReceivable: 250,
|
|
1618
|
-
inventory: 125,
|
|
1619
|
-
}]);
|
|
1620
|
-
expect(yahooCalls).toBe(1);
|
|
1621
|
-
});
|
|
1622
|
-
|
|
1623
|
-
test("fills unusable preferred provider financial quotes from a later provider", async () => {
|
|
1624
|
-
const cloudProvider: DataProvider = {
|
|
1625
|
-
...fallbackProvider,
|
|
1626
|
-
id: "cloud",
|
|
1627
|
-
name: "Cloud",
|
|
1628
|
-
priority: 100,
|
|
1629
|
-
async getTickerFinancials() {
|
|
1630
|
-
return makeFinancials({
|
|
1631
|
-
profile: { sector: "Industrials" },
|
|
1632
|
-
quote: makeQuote({
|
|
1633
|
-
symbol: "HY9H",
|
|
1634
|
-
price: 1295,
|
|
1635
|
-
change: -95,
|
|
1636
|
-
changePercent: -6.83,
|
|
1637
|
-
lastUpdated: Date.now() - 20 * 60_000,
|
|
1638
|
-
listingExchangeName: "FWB2",
|
|
1639
|
-
marketState: "REGULAR",
|
|
1640
|
-
}),
|
|
1641
|
-
});
|
|
1642
|
-
},
|
|
1643
|
-
};
|
|
1644
|
-
const yahooProvider: DataProvider = {
|
|
1645
|
-
...fallbackProvider,
|
|
1646
|
-
id: "yahoo",
|
|
1647
|
-
name: "Yahoo",
|
|
1648
|
-
priority: 1000,
|
|
1649
|
-
async getTickerFinancials() {
|
|
1650
|
-
return makeFinancials({
|
|
1651
|
-
quote: makeQuote({
|
|
1652
|
-
symbol: "HY9H.F",
|
|
1653
|
-
price: 1305,
|
|
1654
|
-
change: -85,
|
|
1655
|
-
changePercent: -6.12,
|
|
1656
|
-
lastUpdated: Date.now(),
|
|
1657
|
-
listingExchangeName: "FWB2",
|
|
1658
|
-
marketState: "REGULAR",
|
|
1659
|
-
}),
|
|
1660
|
-
});
|
|
1661
|
-
},
|
|
1662
|
-
};
|
|
1663
|
-
|
|
1664
|
-
const router = new AssetDataRouter(yahooProvider, [cloudProvider]);
|
|
1665
|
-
const merged = await router.getTickerFinancials("HY9H", "FWB2", { cacheMode: "refresh" });
|
|
1666
|
-
|
|
1667
|
-
expect(merged.profile?.sector).toBe("Industrials");
|
|
1668
|
-
expect(merged.quote?.symbol).toBe("HY9H.F");
|
|
1669
|
-
expect(merged.quote?.price).toBe(1305);
|
|
1670
|
-
expect(merged.quote?.changePercent).toBe(-6.12);
|
|
1671
|
-
});
|
|
1672
|
-
|
|
1673
|
-
test("caches the preferred provider financial snapshot without merging fallback snapshots", async () => {
|
|
1674
|
-
const dbPath = createTempDbPath("cached-provider-financial-preferred");
|
|
1675
|
-
const persistence = new AppPersistence(dbPath);
|
|
1676
|
-
|
|
1677
|
-
const cloudProvider: DataProvider = {
|
|
1678
|
-
...fallbackProvider,
|
|
1679
|
-
id: "cloud",
|
|
1680
|
-
name: "Cloud",
|
|
1681
|
-
priority: 100,
|
|
1682
|
-
async getTickerFinancials() {
|
|
1683
|
-
return makeFinancials({
|
|
1684
|
-
quote: makeQuote({
|
|
1685
|
-
price: 125,
|
|
1686
|
-
change: 2,
|
|
1687
|
-
changePercent: 1.6,
|
|
1688
|
-
}),
|
|
1689
|
-
fundamentals: {
|
|
1690
|
-
trailingPE: 25,
|
|
1691
|
-
},
|
|
1692
|
-
profile: {
|
|
1693
|
-
sector: "Technology",
|
|
1694
|
-
},
|
|
1695
|
-
});
|
|
1696
|
-
},
|
|
1697
|
-
};
|
|
1698
|
-
const yahooProvider: DataProvider = {
|
|
1699
|
-
...fallbackProvider,
|
|
1700
|
-
id: "yahoo",
|
|
1701
|
-
name: "Yahoo",
|
|
1702
|
-
priority: 1000,
|
|
1703
|
-
async getTickerFinancials() {
|
|
1704
|
-
return makeFinancials({
|
|
1705
|
-
priceHistory: [{ date: new Date("2026-03-28T00:00:00Z"), close: 124 }],
|
|
1706
|
-
quote: makeQuote({
|
|
1707
|
-
price: 124,
|
|
1708
|
-
change: 1,
|
|
1709
|
-
changePercent: 0.8,
|
|
1710
|
-
marketCap: 2_000_000_000,
|
|
1711
|
-
}),
|
|
1712
|
-
fundamentals: {
|
|
1713
|
-
forwardPE: 22,
|
|
1714
|
-
},
|
|
1715
|
-
});
|
|
1716
|
-
},
|
|
1717
|
-
};
|
|
1718
|
-
|
|
1719
|
-
const seedRouter = new AssetDataRouter(yahooProvider, [cloudProvider], persistence.resources);
|
|
1720
|
-
const seeded = await seedRouter.getTickerFinancials("AAPL", "NASDAQ");
|
|
1721
|
-
expect(seeded.quote?.price).toBe(125);
|
|
1722
|
-
expect(seeded.quote?.marketCap).toBeUndefined();
|
|
1723
|
-
|
|
1724
|
-
let cloudCalls = 0;
|
|
1725
|
-
let yahooCalls = 0;
|
|
1726
|
-
const cachedRouter = new AssetDataRouter({
|
|
1727
|
-
...yahooProvider,
|
|
1728
|
-
async getTickerFinancials() {
|
|
1729
|
-
yahooCalls += 1;
|
|
1730
|
-
throw new Error("expected cached yahoo financials");
|
|
1731
|
-
},
|
|
1732
|
-
}, [{
|
|
1733
|
-
...cloudProvider,
|
|
1734
|
-
async getTickerFinancials() {
|
|
1735
|
-
cloudCalls += 1;
|
|
1736
|
-
throw new Error("expected cached cloud financials");
|
|
1737
|
-
},
|
|
1738
|
-
}], persistence.resources);
|
|
1739
|
-
|
|
1740
|
-
const cached = await cachedRouter.getTickerFinancials("AAPL", "NASDAQ");
|
|
1741
|
-
|
|
1742
|
-
expect(cloudCalls).toBe(0);
|
|
1743
|
-
expect(yahooCalls).toBe(0);
|
|
1744
|
-
expect(cached.quote?.price).toBe(125);
|
|
1745
|
-
expect(cached.quote?.marketCap).toBeUndefined();
|
|
1746
|
-
expect(cached.fundamentals?.trailingPE).toBe(25);
|
|
1747
|
-
expect(cached.fundamentals?.forwardPE).toBeUndefined();
|
|
1748
|
-
expect(cached.profile?.sector).toBe("Technology");
|
|
1749
|
-
expect(cached.priceHistory).toEqual([]);
|
|
1750
|
-
|
|
1751
|
-
persistence.close();
|
|
1752
|
-
});
|
|
1753
|
-
|
|
1754
|
-
test("refreshes missing profile data even when cached financials exist", async () => {
|
|
1755
|
-
const dbPath = createTempDbPath("cache-profile-refresh");
|
|
1756
|
-
const persistence = new AppPersistence(dbPath);
|
|
1757
|
-
|
|
1758
|
-
const broker: BrokerAdapter = {
|
|
1759
|
-
id: "ibkr",
|
|
1760
|
-
name: "IBKR",
|
|
1761
|
-
configSchema: [],
|
|
1762
|
-
async validate() {
|
|
1763
|
-
return true;
|
|
1764
|
-
},
|
|
1765
|
-
async importPositions() {
|
|
1766
|
-
return [];
|
|
1767
|
-
},
|
|
1768
|
-
async getTickerFinancials() {
|
|
1769
|
-
return makeFinancials({
|
|
1770
|
-
fundamentals: { revenue: 1000, netIncome: 200 },
|
|
1771
|
-
});
|
|
1772
|
-
},
|
|
1773
|
-
};
|
|
1774
|
-
|
|
1775
|
-
const config = createBrokerConfig([brokerInstance()]);
|
|
1776
|
-
|
|
1777
|
-
const seedRouter = new AssetDataRouter({
|
|
1778
|
-
...fallbackProvider,
|
|
1779
|
-
async getTickerFinancials() {
|
|
1780
|
-
return makeFinancials();
|
|
1781
|
-
},
|
|
1782
|
-
}, [], persistence.resources);
|
|
1783
|
-
attachTestRegistry(seedRouter, { brokers: [["ibkr", broker]] });
|
|
1784
|
-
seedRouter.setConfigAccessor(() => config);
|
|
1785
|
-
|
|
1786
|
-
const seeded = await seedRouter.getTickerFinancials("PSTG", "NYSE", {
|
|
1787
|
-
brokerId: "ibkr",
|
|
1788
|
-
brokerInstanceId: "ibkr-work",
|
|
1789
|
-
});
|
|
1790
|
-
expect(seeded.profile).toBeUndefined();
|
|
1791
|
-
|
|
1792
|
-
const refreshedRouter = new AssetDataRouter({
|
|
1793
|
-
...fallbackProvider,
|
|
1794
|
-
async getTickerFinancials() {
|
|
1795
|
-
return makeFinancials({
|
|
1796
|
-
profile: {
|
|
1797
|
-
description: "Provides enterprise data storage platforms.",
|
|
1798
|
-
sector: "Technology",
|
|
1799
|
-
industry: "Computer Hardware",
|
|
1800
|
-
},
|
|
1801
|
-
});
|
|
1802
|
-
},
|
|
1803
|
-
}, [], persistence.resources);
|
|
1804
|
-
attachTestRegistry(refreshedRouter, { brokers: [["ibkr", broker]] });
|
|
1805
|
-
refreshedRouter.setConfigAccessor(() => config);
|
|
1806
|
-
|
|
1807
|
-
const refreshed = await refreshedRouter.getTickerFinancials("PSTG", "NYSE", {
|
|
1808
|
-
brokerId: "ibkr",
|
|
1809
|
-
brokerInstanceId: "ibkr-work",
|
|
1810
|
-
});
|
|
1811
|
-
expect(refreshed.fundamentals?.revenue).toBe(1000);
|
|
1812
|
-
expect(refreshed.profile?.description).toBe("Provides enterprise data storage platforms.");
|
|
1813
|
-
|
|
1814
|
-
persistence.close();
|
|
1815
|
-
});
|
|
1816
|
-
|
|
1817
|
-
test("does not reuse another broker instance's financials when a specific instance is requested", async () => {
|
|
1818
|
-
const dbPath = createTempDbPath("instance-scoped-financials");
|
|
1819
|
-
const persistence = new AppPersistence(dbPath);
|
|
1820
|
-
const router = new AssetDataRouter({
|
|
1821
|
-
...fallbackProvider,
|
|
1822
|
-
async getTickerFinancials() {
|
|
1823
|
-
return makeFinancials({
|
|
1824
|
-
quote: makeQuote({
|
|
1825
|
-
symbol: "IQE.L",
|
|
1826
|
-
listingExchangeName: "LSE",
|
|
1827
|
-
providerId: "yahoo",
|
|
1828
|
-
price: 0.245,
|
|
1829
|
-
currency: "GBP",
|
|
1830
|
-
dataSource: "delayed",
|
|
1831
|
-
}),
|
|
1832
|
-
});
|
|
1833
|
-
},
|
|
1834
|
-
}, [], persistence.resources);
|
|
1835
|
-
const broker: BrokerAdapter = {
|
|
1836
|
-
id: "ibkr",
|
|
1837
|
-
name: "IBKR",
|
|
1838
|
-
configSchema: [],
|
|
1839
|
-
async validate() {
|
|
1840
|
-
return true;
|
|
1841
|
-
},
|
|
1842
|
-
async importPositions() {
|
|
1843
|
-
return [];
|
|
1844
|
-
},
|
|
1845
|
-
async getTickerFinancials(_ticker, instance) {
|
|
1846
|
-
if (instance.id === "ibkr-flex") {
|
|
1847
|
-
throw new Error("Gateway mode is required for broker market data");
|
|
1848
|
-
}
|
|
1849
|
-
return makeFinancials({
|
|
1850
|
-
quote: makeQuote({
|
|
1851
|
-
symbol: "IQE",
|
|
1852
|
-
providerId: "ibkr",
|
|
1853
|
-
price: 24.5,
|
|
1854
|
-
currency: "GBP",
|
|
1855
|
-
dataSource: "live",
|
|
1856
|
-
}),
|
|
1857
|
-
});
|
|
1858
|
-
},
|
|
1859
|
-
};
|
|
1860
|
-
|
|
1861
|
-
attachTestRegistry(router, { brokers: [["ibkr", broker]] });
|
|
1862
|
-
setBrokerInstances(router, [
|
|
1863
|
-
brokerInstance({ id: "ibkr-flex", label: "Flex", connectionMode: "flex" }),
|
|
1864
|
-
brokerInstance({ id: "ibkr-live", label: "Live" }),
|
|
1865
|
-
]);
|
|
1866
|
-
|
|
1867
|
-
const live = await router.getTickerFinancials("IQE", "LSE", {
|
|
1868
|
-
brokerId: "ibkr",
|
|
1869
|
-
brokerInstanceId: "ibkr-live",
|
|
1870
|
-
});
|
|
1871
|
-
expect(live.quote?.price).toBe(24.5);
|
|
1872
|
-
|
|
1873
|
-
const flex = await router.getTickerFinancials("IQE", "LSE", {
|
|
1874
|
-
brokerId: "ibkr",
|
|
1875
|
-
brokerInstanceId: "ibkr-flex",
|
|
1876
|
-
});
|
|
1877
|
-
expect(flex.quote?.price).toBe(0.245);
|
|
1878
|
-
|
|
1879
|
-
const cached = router.getCachedFinancialsForTargets([{
|
|
1880
|
-
symbol: "IQE",
|
|
1881
|
-
exchange: "LSE",
|
|
1882
|
-
brokerId: "ibkr",
|
|
1883
|
-
brokerInstanceId: "ibkr-flex",
|
|
1884
|
-
}], { allowExpired: true });
|
|
1885
|
-
expect(cached.get("IQE")?.quote?.price).toBe(0.245);
|
|
1886
|
-
|
|
1887
|
-
persistence.close();
|
|
1888
|
-
});
|
|
1889
|
-
|
|
1890
|
-
test("returns merged cached provider financials on cold start when sub-unit quotes exist", async () => {
|
|
1891
|
-
const dbPath = createTempDbPath("cached-sub-unit-financials");
|
|
1892
|
-
const persistence = new AppPersistence(dbPath);
|
|
1893
|
-
const now = Date.now();
|
|
1894
|
-
|
|
1895
|
-
persistence.resources.set(
|
|
1896
|
-
{
|
|
1897
|
-
namespace: "market",
|
|
1898
|
-
kind: "financials",
|
|
1899
|
-
entityKey: "contract:14075064",
|
|
1900
|
-
variantKey: "exchange=LSE",
|
|
1901
|
-
sourceKey: "provider:gloomberb-cloud",
|
|
1902
|
-
},
|
|
1903
|
-
makeFinancials({
|
|
1904
|
-
quote: makeQuote({
|
|
1905
|
-
symbol: "IQE",
|
|
1906
|
-
price: 23.1,
|
|
1907
|
-
currency: "GBp",
|
|
1908
|
-
change: -1.4,
|
|
1909
|
-
changePercent: -5.71,
|
|
1910
|
-
previousClose: 24.5,
|
|
1911
|
-
lastUpdated: now,
|
|
1912
|
-
dataSource: "delayed",
|
|
1913
|
-
}),
|
|
1914
|
-
profile: {
|
|
1915
|
-
description: "Cloud profile",
|
|
1916
|
-
},
|
|
1917
|
-
}),
|
|
1918
|
-
{
|
|
1919
|
-
cachePolicy: { staleMs: 60_000, expireMs: 60_000 },
|
|
1920
|
-
fetchedAt: now,
|
|
1921
|
-
},
|
|
1922
|
-
);
|
|
1923
|
-
persistence.resources.set(
|
|
1924
|
-
{
|
|
1925
|
-
namespace: "market",
|
|
1926
|
-
kind: "financials",
|
|
1927
|
-
entityKey: "contract:14075064",
|
|
1928
|
-
variantKey: "exchange=LSE",
|
|
1929
|
-
sourceKey: "provider:yahoo",
|
|
1930
|
-
},
|
|
1931
|
-
makeFinancials({
|
|
1932
|
-
quote: makeQuote({
|
|
1933
|
-
symbol: "IQE.L",
|
|
1934
|
-
providerId: "yahoo",
|
|
1935
|
-
price: 0.231,
|
|
1936
|
-
currency: "GBP",
|
|
1937
|
-
change: -0.014,
|
|
1938
|
-
changePercent: -5.71,
|
|
1939
|
-
previousClose: 0.245,
|
|
1940
|
-
lastUpdated: now,
|
|
1941
|
-
dataSource: "delayed",
|
|
1942
|
-
}),
|
|
1943
|
-
fundamentals: {
|
|
1944
|
-
revenue: 1000,
|
|
1945
|
-
},
|
|
1946
|
-
}),
|
|
1947
|
-
{
|
|
1948
|
-
cachePolicy: { staleMs: 60_000, expireMs: 60_000 },
|
|
1949
|
-
fetchedAt: now,
|
|
1950
|
-
},
|
|
1951
|
-
);
|
|
1952
|
-
|
|
1953
|
-
const yahooProvider: DataProvider = {
|
|
1954
|
-
...fallbackProvider,
|
|
1955
|
-
id: "yahoo",
|
|
1956
|
-
name: "Yahoo",
|
|
1957
|
-
priority: 200,
|
|
1958
|
-
async getTickerFinancials() {
|
|
1959
|
-
throw new Error("should not fetch yahoo financials");
|
|
1960
|
-
},
|
|
1961
|
-
};
|
|
1962
|
-
const cloudProvider: DataProvider = {
|
|
1963
|
-
...fallbackProvider,
|
|
1964
|
-
id: "gloomberb-cloud",
|
|
1965
|
-
name: "Cloud",
|
|
1966
|
-
priority: 100,
|
|
1967
|
-
async getTickerFinancials() {
|
|
1968
|
-
throw new Error("should not fetch cloud financials");
|
|
1969
|
-
},
|
|
1970
|
-
};
|
|
1971
|
-
const router = new AssetDataRouter(yahooProvider, [cloudProvider], persistence.resources);
|
|
1972
|
-
|
|
1973
|
-
const financials = await router.getTickerFinancials("IQE", "LSE", {
|
|
1974
|
-
instrument: {
|
|
1975
|
-
brokerId: "ibkr",
|
|
1976
|
-
brokerInstanceId: "ibkr-personal",
|
|
1977
|
-
conId: 14075064,
|
|
1978
|
-
symbol: "IQE",
|
|
1979
|
-
},
|
|
1980
|
-
});
|
|
1981
|
-
|
|
1982
|
-
expect(financials.quote?.price).toBe(0.231);
|
|
1983
|
-
expect(financials.quote?.currency).toBe("GBP");
|
|
1984
|
-
expect(financials.fundamentals?.revenue).toBe(1000);
|
|
1985
|
-
expect(financials.profile?.description).toBe("Cloud profile");
|
|
1986
|
-
|
|
1987
|
-
persistence.close();
|
|
1988
|
-
});
|
|
1989
|
-
|
|
1990
|
-
});
|