gloomberb 0.15.7 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -2
- package/package.json +1 -1
- package/src/api-client/app-attention.ts +147 -0
- package/src/api-client/attention.ts +26 -0
- package/src/api-client/awards.ts +215 -0
- package/src/api-client/catalysts.ts +160 -0
- package/src/api-client/chat.ts +137 -14
- package/src/api-client/company-kpis.ts +153 -0
- package/src/api-client/cpi.ts +52 -0
- package/src/api-client/credit-documents.ts +107 -0
- package/src/api-client/data.ts +192 -3
- package/src/api-client/distress.ts +164 -0
- package/src/api-client/doe.ts +75 -0
- package/src/api-client/equity-screener.ts +11 -0
- package/src/api-client/exposure.ts +202 -0
- package/src/api-client/gpu.ts +93 -0
- package/src/api-client/hiring.ts +110 -0
- package/src/api-client/index.ts +78 -3
- package/src/api-client/normalizers.ts +31 -1
- package/src/api-client/paths.ts +3 -0
- package/src/api-client/perps.ts +127 -0
- package/src/api-client/power.ts +148 -0
- package/src/api-client/request.ts +58 -1
- package/src/api-client/research-activity.ts +172 -13
- package/src/api-client/socket.ts +75 -27
- package/src/api-client/supply-chain-graph.ts +40 -0
- package/src/api-client/supply-chain.ts +98 -0
- package/src/api-client/telemetry.ts +29 -0
- package/src/api-client/themes.ts +28 -0
- package/src/api-client/types.ts +33 -1
- package/src/api-client/wall-experiments.ts +100 -0
- package/src/api-client/wall-summary.ts +49 -0
- package/src/api-client/web-experiments.ts +136 -0
- package/src/app/pane-runtime/plugin-bindings.ts +5 -0
- package/src/app/pane-runtime/ticker-open-runtime.ts +8 -2
- package/src/app/runtime/update.ts +13 -1
- package/src/cli/commands/system.ts +2 -0
- package/src/cli/desktop-pane-shot.ts +3 -4
- package/src/cli/pane-functions/data.ts +78 -0
- package/src/cli/pane-functions/financial-ratio-shot.ts +160 -0
- package/src/cli/pane-functions/function-help.ts +220 -8
- package/src/cli/pane-functions/headless.ts +4 -0
- package/src/cli/pane-functions/screenshot-evidence.ts +21 -0
- package/src/cli/pane-functions/screenshot.ts +49 -5
- package/src/components/chart/composite/composite-chart.tsx +15 -2
- package/src/components/chart/composite/format.ts +24 -11
- package/src/components/chart/composite/rasterizer.ts +67 -16
- package/src/components/chart/composite/scene.ts +53 -2
- package/src/components/chart/composite/session-shading.ts +3 -2
- package/src/components/chart/composite/text-renderer.ts +52 -1
- package/src/components/chart/composite/time-axis.ts +100 -30
- package/src/components/chart/composite/tools.ts +2 -1
- package/src/components/chart/composite/types.ts +4 -0
- package/src/components/chart-table/index.ts +1 -0
- package/src/components/chart-table/layout.ts +15 -0
- package/src/components/command-bar/action-runtime.ts +1 -0
- package/src/components/command-bar/commands/direct/index.ts +32 -0
- package/src/components/command-bar/commands/registry.ts +7 -0
- package/src/components/command-bar/pane-templates/items.ts +11 -0
- package/src/components/command-bar/pane-templates/workflow.ts +19 -4
- package/src/components/command-bar/routes/root/command-items.ts +6 -0
- package/src/components/command-bar/routes/root/provider-search.ts +2 -0
- package/src/components/command-bar/routes/root/results.ts +64 -0
- package/src/components/command-bar/routes/root/runtime.ts +8 -0
- package/src/components/command-bar/routes/ticker-search/results.ts +89 -24
- package/src/components/command-bar/routes/ticker-search/route.ts +2 -0
- package/src/components/command-bar/surface/index.tsx +15 -0
- package/src/components/command-bar/view-model.ts +3 -0
- package/src/components/command-bar/workflow/collection-actions.ts +9 -7
- package/src/components/command-bar/workflow/ops.ts +19 -0
- package/src/components/command-bar/workflow/tickers.ts +5 -0
- package/src/components/company-logo.tsx +15 -2
- package/src/components/data-table/table-pane.ts +2 -1
- package/src/components/index.ts +1 -0
- package/src/components/layout/detached-pane-shell.tsx +12 -1
- package/src/components/layout/missing-pane.tsx +87 -23
- package/src/components/layout/pane/footer/index.tsx +64 -18
- package/src/components/layout/pane/footer/model.ts +85 -0
- package/src/components/layout/pane/sidebar.tsx +19 -1
- package/src/components/layout/shell/index.tsx +38 -28
- package/src/components/layout/shell/pane/management-shortcuts.ts +13 -1
- package/src/components/layout/status-bar.tsx +93 -28
- package/src/components/layout/status-widget-space.ts +72 -0
- package/src/components/onboarding/first-run-workspace.ts +8 -2
- package/src/components/onboarding/onboarding-wizard.tsx +35 -16
- package/src/components/onboarding/portfolio-step/positions-panel.tsx +14 -5
- package/src/components/onboarding/wizard-model.ts +13 -5
- package/src/components/onboarding/wizard-positions.ts +56 -7
- package/src/components/price-performance.tsx +31 -34
- package/src/components/ui/data-table/index.tsx +11 -8
- package/src/components/ui/display.tsx +15 -6
- package/src/components/ui/fields.tsx +5 -0
- package/src/components/ui/figure.tsx +94 -0
- package/src/components/ui/header-case.ts +25 -3
- package/src/components/ui/icon.tsx +3 -1
- package/src/components/ui/message-composer.tsx +8 -1
- package/src/components/ui/query-bar.tsx +8 -1
- package/src/components/ui/ratio-bar.tsx +84 -0
- package/src/components/ui/toggle.tsx +3 -1
- package/src/components/use-scrollbox-layout.ts +17 -0
- package/src/core/state/app/layout.ts +35 -1
- package/src/core/state/app/state.ts +15 -0
- package/src/core/state/app/types.ts +1 -0
- package/src/data/config/store/normalize.ts +24 -0
- package/src/i18n/es.ts +2 -0
- package/src/i18n/ja.ts +2 -0
- package/src/i18n/ko.ts +2 -0
- package/src/i18n/zh-cn.ts +2 -0
- package/src/i18n/zh-tw.ts +2 -0
- package/src/layout-marketplace/pane-imagery.ts +1 -0
- package/src/market-data/coordinator/entries.ts +13 -0
- package/src/market-data/coordinator/financials.ts +33 -8
- package/src/market-data/market/freshness.ts +16 -5
- package/src/market-data/market/trading-sessions.ts +65 -1
- package/src/market-data/published-cn-sessions.ts +25 -0
- package/src/market-data/published-nse-sessions.ts +20 -0
- package/src/news/aggregator.ts +4 -0
- package/src/plugins/builtin/account-management/model.ts +6 -1
- package/src/plugins/builtin/account-management/pane.tsx +36 -25
- package/src/plugins/builtin/alerts/catalysts.ts +77 -0
- package/src/plugins/builtin/alerts/events-pane.tsx +3 -0
- package/src/plugins/builtin/alerts/events.ts +10 -4
- package/src/plugins/builtin/alerts/history-pane.tsx +1 -1
- package/src/plugins/builtin/alerts/history.ts +1 -0
- package/src/plugins/builtin/alerts/index.tsx +6 -0
- package/src/plugins/builtin/alerts/research-builder.ts +10 -3
- package/src/plugins/builtin/alerts/research-rules.ts +15 -1
- package/src/plugins/builtin/analytics/risk-client.ts +15 -3
- package/src/plugins/builtin/analytics/risk-headless.ts +123 -18
- package/src/plugins/builtin/attention/client.ts +80 -0
- package/src/plugins/builtin/attention/evidence.ts +30 -0
- package/src/plugins/builtin/attention/headless.ts +33 -0
- package/src/plugins/builtin/attention/index.tsx +18 -0
- package/src/plugins/builtin/attention/model.ts +59 -0
- package/src/plugins/builtin/attention/pane.tsx +211 -0
- package/src/plugins/builtin/attention/trending.tsx +59 -0
- package/src/plugins/builtin/awards/alerts.ts +32 -0
- package/src/plugins/builtin/awards/client.ts +82 -0
- package/src/plugins/builtin/awards/detail.tsx +107 -0
- package/src/plugins/builtin/awards/evidence.ts +36 -0
- package/src/plugins/builtin/awards/headless.ts +55 -0
- package/src/plugins/builtin/awards/index.tsx +20 -0
- package/src/plugins/builtin/awards/model.ts +42 -0
- package/src/plugins/builtin/awards/pane.tsx +263 -0
- package/src/plugins/builtin/catalysts/client.ts +28 -0
- package/src/plugins/builtin/catalysts/detail.tsx +88 -0
- package/src/plugins/builtin/catalysts/evidence.ts +47 -0
- package/src/plugins/builtin/catalysts/headless.ts +42 -0
- package/src/plugins/builtin/catalysts/history.ts +26 -0
- package/src/plugins/builtin/catalysts/index.tsx +29 -0
- package/src/plugins/builtin/catalysts/model.ts +135 -0
- package/src/plugins/builtin/catalysts/pane.tsx +159 -0
- package/src/plugins/builtin/chart-composer/cli-options.ts +4 -0
- package/src/plugins/builtin/chart-composer/headless-schema.ts +6 -0
- package/src/plugins/builtin/chart-composer/index.tsx +8 -1
- package/src/plugins/builtin/chart-composer/pane.tsx +28 -1
- package/src/plugins/builtin/chat/attachments/desktop.tsx +610 -0
- package/src/plugins/builtin/chat/attachments/files.ts +45 -0
- package/src/plugins/builtin/chat/attachments/model.ts +164 -0
- package/src/plugins/builtin/chat/attachments/terminal.tsx +72 -0
- package/src/plugins/builtin/chat/attachments/transfer.ts +165 -0
- package/src/plugins/builtin/chat/content/channel-navigation.ts +13 -12
- package/src/plugins/builtin/chat/content/composer-runtime.ts +25 -4
- package/src/plugins/builtin/chat/content/composer.tsx +46 -4
- package/src/plugins/builtin/chat/content/footer.tsx +46 -8
- package/src/plugins/builtin/chat/content/index.tsx +263 -62
- package/src/plugins/builtin/chat/content/layout-metrics.ts +10 -2
- package/src/plugins/builtin/chat/content/open-targets.ts +17 -3
- package/src/plugins/builtin/chat/content/scroll.ts +7 -1
- package/src/plugins/builtin/chat/content/shortcuts.ts +36 -11
- package/src/plugins/builtin/chat/content/snapshot.ts +3 -0
- package/src/plugins/builtin/chat/content/transcript.tsx +17 -1
- package/src/plugins/builtin/chat/content/types.ts +7 -0
- package/src/plugins/builtin/chat/controller/attachments.ts +213 -0
- package/src/plugins/builtin/chat/controller/connections.ts +3 -1
- package/src/plugins/builtin/chat/controller/index.ts +114 -2
- package/src/plugins/builtin/chat/controller/lifecycle.ts +9 -0
- package/src/plugins/builtin/chat/controller/messages.ts +35 -2
- package/src/plugins/builtin/chat/controller/send.ts +128 -25
- package/src/plugins/builtin/chat/controller/state.ts +12 -1
- package/src/plugins/builtin/chat/controller/utils.ts +7 -5
- package/src/plugins/builtin/chat/controller/view.ts +2 -0
- package/src/plugins/builtin/chat/index.tsx +21 -0
- package/src/plugins/builtin/chat/layout.ts +9 -4
- package/src/plugins/builtin/chat/message/desktop.tsx +55 -20
- package/src/plugins/builtin/chat/message/header.tsx +30 -5
- package/src/plugins/builtin/chat/message/inline-tokens.tsx +9 -0
- package/src/plugins/builtin/chat/message/pending-send.ts +35 -0
- package/src/plugins/builtin/chat/message/profile-popover.tsx +5 -1
- package/src/plugins/builtin/chat/message/render-state.ts +12 -2
- package/src/plugins/builtin/chat/message/terminal.tsx +51 -4
- package/src/plugins/builtin/chat/message/types.ts +6 -1
- package/src/plugins/builtin/chat/pane-state.ts +59 -1
- package/src/plugins/builtin/chat/profile-popover.ts +50 -1
- package/src/plugins/builtin/chat/sidebar.tsx +8 -3
- package/src/plugins/builtin/chat/status-widget.tsx +29 -12
- package/src/plugins/builtin/chat/unread-inbox-pane.tsx +143 -0
- package/src/plugins/builtin/chat/unread-inbox.ts +91 -0
- package/src/plugins/builtin/clinical-trials/client.ts +237 -0
- package/src/plugins/builtin/clinical-trials/index.tsx +74 -0
- package/src/plugins/builtin/clinical-trials/pane.tsx +225 -0
- package/src/plugins/builtin/clinical-trials/types.ts +2 -0
- package/src/plugins/builtin/cloud/askg/controller.ts +37 -6
- package/src/plugins/builtin/cloud/askg/executor.ts +59 -44
- package/src/plugins/builtin/cloud/askg/host.ts +8 -1
- package/src/plugins/builtin/cloud/askg/manifest.ts +29 -2
- package/src/plugins/builtin/cloud/askg/model.ts +47 -13
- package/src/plugins/builtin/cloud/askg/notes.ts +100 -0
- package/src/plugins/builtin/cloud/askg/pane.tsx +50 -14
- package/src/plugins/builtin/cloud/askg/protocol.ts +39 -1
- package/src/plugins/builtin/cloud/askg/result-budget.ts +156 -0
- package/src/plugins/builtin/cloud/askg/user-data.ts +89 -0
- package/src/plugins/builtin/cloud/auth-actions.tsx +55 -31
- package/src/plugins/builtin/cloud/plugin.tsx +4 -1
- package/src/plugins/builtin/cloud/team/pane-sections.tsx +10 -1
- package/src/plugins/builtin/cloud/team/pane.tsx +3 -2
- package/src/plugins/builtin/cloud/thesis/board-pane.tsx +2 -2
- package/src/plugins/builtin/cloud/thesis/detail.tsx +1 -1
- package/src/plugins/builtin/cloud/thesis/ticker-tab.tsx +2 -2
- package/src/plugins/builtin/cloud/trial-offer-status-widget.tsx +202 -0
- package/src/plugins/builtin/cloud/upgrade-command.ts +1 -1
- package/src/plugins/builtin/cloud/upgrade-dialog.tsx +29 -3
- package/src/plugins/builtin/cloud/upgrade-status-widget.tsx +1 -1
- package/src/plugins/builtin/cloud-tweets/table.tsx +1 -1
- package/src/plugins/builtin/comment-letters/client.ts +342 -0
- package/src/plugins/builtin/comment-letters/index.tsx +74 -0
- package/src/plugins/builtin/comment-letters/pane.tsx +295 -0
- package/src/plugins/builtin/comment-letters/types.ts +43 -0
- package/src/plugins/builtin/company-attention/app-rank.tsx +79 -0
- package/src/plugins/builtin/company-attention/client.ts +69 -0
- package/src/plugins/builtin/company-attention/evidence.ts +45 -0
- package/src/plugins/builtin/company-attention/headless.ts +47 -0
- package/src/plugins/builtin/company-attention/index.tsx +30 -0
- package/src/plugins/builtin/company-attention/model.ts +129 -0
- package/src/plugins/builtin/company-attention/pane.tsx +183 -0
- package/src/plugins/builtin/company-kpis/client.ts +92 -0
- package/src/plugins/builtin/company-kpis/headless.ts +32 -0
- package/src/plugins/builtin/company-kpis/index.tsx +26 -0
- package/src/plugins/builtin/company-kpis/model.ts +124 -0
- package/src/plugins/builtin/company-kpis/pane.tsx +226 -0
- package/src/plugins/builtin/company-kpis/related.ts +11 -0
- package/src/plugins/builtin/company-kpis/screenshot-evidence.ts +44 -0
- package/src/plugins/builtin/composite-plugins.ts +34 -0
- package/src/plugins/builtin/correlation/history.ts +4 -1
- package/src/plugins/builtin/correlation/index.tsx +139 -80
- package/src/plugins/builtin/correlation/matrix/pair-chart.tsx +48 -0
- package/src/plugins/builtin/correlation/matrix/selection.ts +77 -0
- package/src/plugins/builtin/correlation/relationship/model.ts +2 -2
- package/src/plugins/builtin/cpi/client.ts +66 -0
- package/src/plugins/builtin/cpi/headless.ts +78 -0
- package/src/plugins/builtin/cpi/index.tsx +31 -0
- package/src/plugins/builtin/cpi/model.ts +198 -0
- package/src/plugins/builtin/cpi/pane.tsx +157 -0
- package/src/plugins/builtin/credit-documents/client.ts +99 -0
- package/src/plugins/builtin/credit-documents/detail.tsx +109 -0
- package/src/plugins/builtin/credit-documents/evidence.ts +64 -0
- package/src/plugins/builtin/credit-documents/gauge.tsx +55 -0
- package/src/plugins/builtin/credit-documents/headless.ts +40 -0
- package/src/plugins/builtin/credit-documents/index.tsx +19 -0
- package/src/plugins/builtin/credit-documents/model.ts +336 -0
- package/src/plugins/builtin/credit-documents/pane.tsx +185 -0
- package/src/plugins/builtin/custom-view/view-spec.ts +14 -2
- package/src/plugins/builtin/debt-maturities/pane.tsx +1 -0
- package/src/plugins/builtin/dividend-yield/pane.tsx +1 -1
- package/src/plugins/builtin/doe/client.ts +73 -0
- package/src/plugins/builtin/doe/headless.ts +93 -0
- package/src/plugins/builtin/doe/index.tsx +41 -0
- package/src/plugins/builtin/doe/model.ts +215 -0
- package/src/plugins/builtin/doe/pane.tsx +148 -0
- package/src/plugins/builtin/doe/range-bar.tsx +45 -0
- package/src/plugins/builtin/earnings/board.tsx +3 -0
- package/src/plugins/builtin/earnings/index.tsx +2 -0
- package/src/plugins/builtin/earnings-calls/pane.tsx +7 -1
- package/src/plugins/builtin/earnings-calls/transcript-view.tsx +7 -7
- package/src/plugins/builtin/earnings-ripple/client.ts +60 -0
- package/src/plugins/builtin/earnings-ripple/headless.ts +35 -0
- package/src/plugins/builtin/earnings-ripple/index.tsx +35 -0
- package/src/plugins/builtin/earnings-ripple/model.ts +98 -0
- package/src/plugins/builtin/earnings-ripple/pane.tsx +103 -0
- package/src/plugins/builtin/equity-screener/client.ts +1 -1
- package/src/plugins/builtin/equity-screener/criterion-editor.tsx +1 -1
- package/src/plugins/builtin/equity-screener/model.ts +74 -9
- package/src/plugins/builtin/equity-screener/pane.tsx +2 -0
- package/src/plugins/builtin/estimate-revisions/pane.tsx +3 -0
- package/src/plugins/builtin/executives/pane.tsx +7 -5
- package/src/plugins/builtin/exposure/charts.tsx +66 -0
- package/src/plugins/builtin/exposure/client.ts +53 -0
- package/src/plugins/builtin/exposure/drivers.ts +29 -0
- package/src/plugins/builtin/exposure/editor.tsx +61 -0
- package/src/plugins/builtin/exposure/evidence.ts +39 -0
- package/src/plugins/builtin/exposure/headless.ts +51 -0
- package/src/plugins/builtin/exposure/holdings.ts +56 -0
- package/src/plugins/builtin/exposure/index.tsx +13 -0
- package/src/plugins/builtin/exposure/model.ts +104 -0
- package/src/plugins/builtin/exposure/pane.tsx +247 -0
- package/src/plugins/builtin/fear-greed/charts.tsx +1 -1
- package/src/plugins/builtin/fear-greed/pane.tsx +2 -9
- package/src/plugins/builtin/filing-events/pane.tsx +2 -1
- package/src/plugins/builtin/gpu/board.tsx +163 -0
- package/src/plugins/builtin/gpu/changes.tsx +94 -0
- package/src/plugins/builtin/gpu/client.ts +130 -0
- package/src/plugins/builtin/gpu/equities.tsx +112 -0
- package/src/plugins/builtin/gpu/headless.ts +67 -0
- package/src/plugins/builtin/gpu/history.tsx +140 -0
- package/src/plugins/builtin/gpu/index.tsx +18 -0
- package/src/plugins/builtin/gpu/ladder.tsx +127 -0
- package/src/plugins/builtin/gpu/model.ts +317 -0
- package/src/plugins/builtin/gpu/pane.tsx +63 -0
- package/src/plugins/builtin/help/index.tsx +19 -2
- package/src/plugins/builtin/holders/pane.tsx +5 -9
- package/src/plugins/builtin/insider/detail.tsx +119 -0
- package/src/plugins/builtin/insider/display.ts +221 -0
- package/src/plugins/builtin/insider/headless.ts +24 -3
- package/src/plugins/builtin/insider/index.tsx +206 -108
- package/src/plugins/builtin/insider/insider-data.ts +31 -3
- package/src/plugins/builtin/insider/model.ts +53 -4
- package/src/plugins/builtin/insider/table-model.ts +226 -0
- package/src/plugins/builtin/insider/table.tsx +79 -0
- package/src/plugins/builtin/iv-history/screen-pane.tsx +1 -1
- package/src/plugins/builtin/jobs/pane.tsx +14 -7
- package/src/plugins/builtin/kelly-sizer/pane.tsx +1 -1
- package/src/plugins/builtin/macro-day/client.ts +50 -0
- package/src/plugins/builtin/macro-day/headless.ts +51 -0
- package/src/plugins/builtin/macro-day/index.tsx +21 -0
- package/src/plugins/builtin/macro-day/model.ts +137 -0
- package/src/plugins/builtin/macro-day/pane.tsx +118 -0
- package/src/plugins/builtin/macro-day/releases.ts +58 -0
- package/src/plugins/builtin/market-halts/model.ts +30 -17
- package/src/plugins/builtin/market-halts/pane.tsx +15 -21
- package/src/plugins/builtin/market-heatmap/data.ts +1 -1
- package/src/plugins/builtin/market-heatmap/index.tsx +198 -50
- package/src/plugins/builtin/market-heatmap/portfolio.ts +220 -0
- package/src/plugins/builtin/market-movers/index.tsx +1 -0
- package/src/plugins/builtin/market-movers/session-body.tsx +5 -2
- package/src/plugins/builtin/mna/distress/client.ts +326 -0
- package/src/plugins/builtin/mna/distress/detail.tsx +247 -0
- package/src/plugins/builtin/mna/distress/headless.ts +257 -0
- package/src/plugins/builtin/mna/distress/model.ts +427 -0
- package/src/plugins/builtin/mna/distress/pane.tsx +606 -0
- package/src/plugins/builtin/mna/index.tsx +15 -0
- package/src/plugins/builtin/mna/pane.tsx +42 -1
- package/src/plugins/builtin/news/index.tsx +62 -16
- package/src/plugins/builtin/news/wire/filter-articles.ts +54 -0
- package/src/plugins/builtin/news/wire/index.tsx +37 -3
- package/src/plugins/builtin/news/wire/industry-pane.tsx +29 -13
- package/src/plugins/builtin/news/wire/mutes.ts +253 -0
- package/src/plugins/builtin/news/wire/news/command-bar-search.ts +117 -0
- package/src/plugins/builtin/news/wire/news/footer.ts +4 -0
- package/src/plugins/builtin/news/wire/news/list-search.ts +34 -0
- package/src/plugins/builtin/news/wire/news/pop-out.tsx +158 -0
- package/src/plugins/builtin/news/wire/news/preset-pane.tsx +64 -19
- package/src/plugins/builtin/openfda/client.ts +300 -0
- package/src/plugins/builtin/openfda/index.tsx +71 -0
- package/src/plugins/builtin/openfda/pane.tsx +382 -0
- package/src/plugins/builtin/openfda/types.ts +76 -0
- package/src/plugins/builtin/options/footer.ts +1 -0
- package/src/plugins/builtin/options/view.tsx +1 -1
- package/src/plugins/builtin/options-calculator/pane.tsx +0 -1
- package/src/plugins/builtin/options-positioning/index.tsx +4 -2
- package/src/plugins/builtin/options-positioning/pane.tsx +1 -1
- package/src/plugins/builtin/pe-band/client.ts +61 -0
- package/src/plugins/builtin/pe-band/headless.ts +51 -0
- package/src/plugins/builtin/pe-band/index.tsx +20 -0
- package/src/plugins/builtin/pe-band/model.ts +267 -0
- package/src/plugins/builtin/pe-band/pane.tsx +159 -0
- package/src/plugins/builtin/perps/client.ts +66 -0
- package/src/plugins/builtin/perps/equity-row.tsx +28 -0
- package/src/plugins/builtin/perps/headless.ts +34 -0
- package/src/plugins/builtin/perps/index.tsx +14 -0
- package/src/plugins/builtin/perps/model.ts +58 -0
- package/src/plugins/builtin/perps/pane.tsx +185 -0
- package/src/plugins/builtin/plugin-marketplace/pane.tsx +0 -1
- package/src/plugins/builtin/portfolio-list/cli/render.ts +177 -87
- package/src/plugins/builtin/portfolio-list/cli/watchlist-command.ts +6 -20
- package/src/plugins/builtin/portfolio-list/command-bar.ts +6 -2
- package/src/plugins/builtin/portfolio-list/headless.ts +237 -0
- package/src/plugins/builtin/portfolio-list/index.tsx +2 -0
- package/src/plugins/builtin/portfolio-list/mutations.ts +70 -1
- package/src/plugins/builtin/portfolio-list/pane/data.ts +17 -0
- package/src/plugins/builtin/portfolio-list/pane/index.tsx +88 -5
- package/src/plugins/builtin/portfolio-list/pane/remove-ticker.ts +85 -0
- package/src/plugins/builtin/portfolio-list/pane/streaming.ts +18 -12
- package/src/plugins/builtin/portfolio-list/quick-add/index.tsx +6 -0
- package/src/plugins/builtin/power/client.ts +100 -0
- package/src/plugins/builtin/power/detail.tsx +82 -0
- package/src/plugins/builtin/power/evidence.ts +56 -0
- package/src/plugins/builtin/power/generation.tsx +37 -0
- package/src/plugins/builtin/power/headless.ts +43 -0
- package/src/plugins/builtin/power/index.tsx +16 -0
- package/src/plugins/builtin/power/model.ts +89 -0
- package/src/plugins/builtin/power/pane.tsx +209 -0
- package/src/plugins/builtin/power/query.ts +25 -0
- package/src/plugins/builtin/relative-rotation/pane.tsx +3 -3
- package/src/plugins/builtin/research/analyst-pane.tsx +1 -1
- package/src/plugins/builtin/research/corporate-actions-pane.tsx +13 -4
- package/src/plugins/builtin/research/equity-diagnostic-pane.tsx +11 -9
- package/src/plugins/builtin/research-search/pane.tsx +21 -7
- package/src/plugins/builtin/revenue-breakdown/pane.tsx +1 -1
- package/src/plugins/builtin/reverse-dcf/client.ts +35 -0
- package/src/plugins/builtin/reverse-dcf/headless.ts +44 -0
- package/src/plugins/builtin/reverse-dcf/index.tsx +20 -0
- package/src/plugins/builtin/reverse-dcf/model.ts +87 -0
- package/src/plugins/builtin/reverse-dcf/pane.tsx +107 -0
- package/src/plugins/builtin/risk-factors/pane.tsx +6 -5
- package/src/plugins/builtin/scanner/denied.tsx +4 -2
- package/src/plugins/builtin/scanner/feed.ts +1 -0
- package/src/plugins/builtin/scanner/flow-pane.tsx +3 -2
- package/src/plugins/builtin/scanner/hilo-pane.tsx +1 -1
- package/src/plugins/builtin/seasonality/client.ts +4 -1
- package/src/plugins/builtin/sec/command-bar-search.ts +217 -0
- package/src/plugins/builtin/sec/forms.ts +54 -0
- package/src/plugins/builtin/sec/headless.ts +31 -5
- package/src/plugins/builtin/sec/index.tsx +67 -11
- package/src/plugins/builtin/sec/model.ts +35 -5
- package/src/plugins/builtin/sectors/headless.ts +1 -0
- package/src/plugins/builtin/sectors/index.tsx +72 -26
- package/src/plugins/builtin/shared/cloud-upgrade.ts +143 -39
- package/src/plugins/builtin/shared/pro-feature-wall.tsx +8 -4
- package/src/plugins/builtin/shared/research-cells.tsx +107 -0
- package/src/plugins/builtin/shared/series-list-detail.tsx +5 -1
- package/src/plugins/builtin/shared/ticker-request.ts +1 -1
- package/src/plugins/builtin/shared/wall-teaser-catalog.ts +80 -0
- package/src/plugins/builtin/shared/wall-teaser.tsx +192 -0
- package/src/plugins/builtin/shared/wall-view-lifecycle.ts +43 -0
- package/src/plugins/builtin/short-interest/index.tsx +31 -0
- package/src/plugins/builtin/short-interest/watch-client.ts +70 -0
- package/src/plugins/builtin/short-interest/watch-headless.ts +49 -0
- package/src/plugins/builtin/short-interest/watch-model.ts +185 -0
- package/src/plugins/builtin/short-interest/watch-pane.tsx +169 -0
- package/src/plugins/builtin/short-volume/pane.tsx +1 -1
- package/src/plugins/builtin/social-mentions/pane.tsx +1 -1
- package/src/plugins/builtin/supply-chain/client.ts +104 -0
- package/src/plugins/builtin/supply-chain/disclosure-quote.tsx +17 -0
- package/src/plugins/builtin/supply-chain/evidence.ts +88 -0
- package/src/plugins/builtin/supply-chain/flow-layout.ts +133 -0
- package/src/plugins/builtin/supply-chain/flow.tsx +323 -0
- package/src/plugins/builtin/supply-chain/graph-client.ts +83 -0
- package/src/plugins/builtin/supply-chain/graph-evidence.ts +25 -0
- package/src/plugins/builtin/supply-chain/graph-model.ts +45 -0
- package/src/plugins/builtin/supply-chain/graph-pane.tsx +218 -0
- package/src/plugins/builtin/supply-chain/graph.tsx +163 -0
- package/src/plugins/builtin/supply-chain/headless.ts +105 -0
- package/src/plugins/builtin/supply-chain/index.tsx +17 -0
- package/src/plugins/builtin/supply-chain/model.ts +145 -0
- package/src/plugins/builtin/supply-chain/pane.tsx +276 -0
- package/src/plugins/builtin/supply-chain/row-evidence.tsx +96 -0
- package/src/plugins/builtin/supply-chain/trust.ts +34 -0
- package/src/plugins/builtin/themes/client.ts +39 -0
- package/src/plugins/builtin/themes/headless.ts +38 -0
- package/src/plugins/builtin/themes/model.ts +92 -0
- package/src/plugins/builtin/themes/pane.tsx +125 -0
- package/src/plugins/builtin/thirteenf/pane.tsx +6 -15
- package/src/plugins/builtin/ticker-detail/data-panes/historical-prices.tsx +5 -6
- package/src/plugins/builtin/ticker-detail/data-panes/returns-model.ts +201 -0
- package/src/plugins/builtin/ticker-detail/data-panes/returns-pane.tsx +327 -0
- package/src/plugins/builtin/ticker-detail/financials/period-end-history.ts +5 -2
- package/src/plugins/builtin/ticker-detail/financials/ratios.ts +60 -12
- package/src/plugins/builtin/ticker-detail/financials/tab.tsx +2 -1
- package/src/plugins/builtin/ticker-detail/headless.ts +7 -2
- package/src/plugins/builtin/ticker-detail/index.tsx +22 -0
- package/src/plugins/builtin/ticker-detail/overview/components.tsx +53 -30
- package/src/plugins/builtin/ticker-detail/overview/pane.tsx +2 -0
- package/src/plugins/builtin/ticker-detail/overview-tab.tsx +112 -47
- package/src/plugins/builtin/ticker-detail/pane.tsx +50 -6
- package/src/plugins/builtin/ticker-detail/quote-monitor/card.tsx +21 -42
- package/src/plugins/builtin/ticker-detail/quote-monitor/index.tsx +3 -0
- package/src/plugins/builtin/time-sales/pane.tsx +1 -1
- package/src/plugins/builtin/world-indices/indices.ts +1 -0
- package/src/plugins/catalog-browser.ts +40 -0
- package/src/plugins/catalog-manifest.ts +3 -0
- package/src/plugins/catalog-ui.ts +6 -0
- package/src/plugins/current-target.ts +0 -9
- package/src/public/__snapshots__/public-api.test.ts.snap +1 -0
- package/src/renderers/browser/cloud-transport.ts +66 -1
- package/src/renderers/browser/main.tsx +2 -0
- package/src/renderers/dom/data-table/row.tsx +2 -0
- package/src/renderers/dom/desktop/controls.tsx +38 -25
- package/src/renderers/dom/desktop/icons.tsx +8 -0
- package/src/renderers/dom/host/chart-surface.tsx +36 -2
- package/src/renderers/dom/host/focus-scope.ts +11 -1
- package/src/renderers/dom/styles.css +28 -0
- package/src/renderers/electrobun/view/backend-rpc.ts +3 -2
- package/src/renderers/electrobun/view/cli-pane-shot-entry.tsx +1 -1
- package/src/renderers/electrobun/view/http-fetch.ts +2 -0
- package/src/renderers/electrobun/view/main.tsx +3 -1
- package/src/renderers/electrobun/view/rpc-timeout.ts +59 -0
- package/src/renderers/opentui/start.tsx +3 -0
- package/src/shares/api.ts +3 -1
- package/src/sources/gloomberb-cloud/index.ts +47 -13
- package/src/sources/history-result.ts +1 -0
- package/src/sources/history-retention.ts +16 -0
- package/src/sources/provider-router/history.ts +4 -2
- package/src/sources/sec-edgar/identity.ts +36 -0
- package/src/sources/sec-edgar.ts +1 -34
- package/src/state/app/context/index.tsx +8 -0
- package/src/sync/core-contributors.ts +20 -2
- package/src/telemetry/attention-counts.ts +164 -0
- package/src/telemetry/live-config.ts +7 -0
- package/src/test-support/rpc-loopback.ts +7 -3
- package/src/test-support/shell-pane-keys.tsx +34 -0
- package/src/tickers/instrument-kind.ts +12 -6
- package/src/tickers/open-target.ts +1 -1
- package/src/tickers/search/asset-classes.ts +91 -0
- package/src/tickers/search/index.ts +62 -15
- package/src/tickers/search/ranking.ts +22 -3
- package/src/tickers/search/upsert.ts +4 -1
- package/src/time-series/live-bars.ts +8 -3
- package/src/time-series/resolve.ts +224 -17
- package/src/time-series/spec.ts +1 -0
- package/src/time-series/types.ts +9 -1
- package/src/types/config.ts +23 -1
- package/src/types/data-provider.ts +2 -0
- package/src/types/headless.ts +17 -0
- package/src/types/price-history.ts +2 -0
- package/src/ui/host.tsx +6 -0
- package/src/utils/double-escape-close.ts +20 -0
- package/src/utils/exchanges.ts +1 -0
- package/src/utils/html-entities.ts +15 -0
- package/src/utils/http-proxy-response.ts +44 -7
- package/src/utils/plugin-proxy-hosts.json +3 -0
- package/src/utils/price-history.ts +35 -1
- package/src/utils/sec.ts +21 -2
- package/src/utils/text-wrap.ts +13 -8
- package/src/utils/zoned-date-time.ts +67 -0
package/src/api-client/socket.ts
CHANGED
|
@@ -31,7 +31,9 @@ const QUOTE_SUBSCRIPTION_FLUSH_MS = 25;
|
|
|
31
31
|
* sees a request it does not understand.
|
|
32
32
|
*/
|
|
33
33
|
const MARKET_BATCH_FEATURE = "market.batch";
|
|
34
|
-
|
|
34
|
+
/** Chat frames carry `attachments`; without it the server writes images into the text. */
|
|
35
|
+
export const CHAT_ATTACHMENTS_FEATURE = "chat.attachments";
|
|
36
|
+
const CLIENT_SOCKET_FEATURES = [MARKET_BATCH_FEATURE, CHAT_ATTACHMENTS_FEATURE] as const;
|
|
35
37
|
const cloudApiLog = debugLog.createLogger("cloud-api");
|
|
36
38
|
|
|
37
39
|
type ChannelListener = (message: ChatMessage) => void;
|
|
@@ -73,12 +75,15 @@ type CloudApiSocketDelegate = {
|
|
|
73
75
|
updateCurrentUserFromSocket: (user: Partial<AuthUser>) => void;
|
|
74
76
|
};
|
|
75
77
|
|
|
78
|
+
type ChatSendMessage = (
|
|
79
|
+
content: string,
|
|
80
|
+
replyToId?: string,
|
|
81
|
+
clientMessageId?: string,
|
|
82
|
+
attachmentIds?: string[],
|
|
83
|
+
) => Promise<ChatMessage>;
|
|
84
|
+
|
|
76
85
|
type ChatChannelConnection = {
|
|
77
|
-
send:
|
|
78
|
-
content: string,
|
|
79
|
-
replyToId?: string,
|
|
80
|
-
clientMessageId?: string,
|
|
81
|
-
) => Promise<ChatMessage>;
|
|
86
|
+
send: ChatSendMessage;
|
|
82
87
|
close: () => void;
|
|
83
88
|
};
|
|
84
89
|
|
|
@@ -123,6 +128,9 @@ export class CloudApiSocket {
|
|
|
123
128
|
null;
|
|
124
129
|
/** The connection that already opted into server features; a reconnect negotiates again. */
|
|
125
130
|
private featuresRequestedFor: WebSocket | null = null;
|
|
131
|
+
/** What the last "ready" frame offered; kept across reconnects so a blip does not hide features. */
|
|
132
|
+
private offeredFeatures: ReadonlySet<string> = new Set();
|
|
133
|
+
private readonly offeredFeatureListeners = new Set<() => void>();
|
|
126
134
|
private readonly tapeListeners = new Map<string, { symbol: string; exchange: string; listeners: Set<(event: TapeFeedEvent) => void> }>();
|
|
127
135
|
private readonly scannerListeners = new Map<
|
|
128
136
|
ScannerKind,
|
|
@@ -174,11 +182,7 @@ export class CloudApiSocket {
|
|
|
174
182
|
channelId: string,
|
|
175
183
|
onMessage: (msg: ChatMessage) => void,
|
|
176
184
|
onError: ((err: string) => void) | undefined,
|
|
177
|
-
sendMessage:
|
|
178
|
-
content: string,
|
|
179
|
-
replyToId?: string,
|
|
180
|
-
clientMessageId?: string,
|
|
181
|
-
) => Promise<ChatMessage>,
|
|
185
|
+
sendMessage: ChatSendMessage,
|
|
182
186
|
): ChatChannelConnection {
|
|
183
187
|
if (!channelId) {
|
|
184
188
|
return {
|
|
@@ -200,16 +204,13 @@ export class CloudApiSocket {
|
|
|
200
204
|
}
|
|
201
205
|
|
|
202
206
|
return {
|
|
203
|
-
send: async (
|
|
204
|
-
content: string,
|
|
205
|
-
replyToId?: string,
|
|
206
|
-
clientMessageId?: string,
|
|
207
|
-
) => {
|
|
207
|
+
send: async (content, replyToId, clientMessageId, attachmentIds) => {
|
|
208
208
|
try {
|
|
209
209
|
const message = await sendMessage(
|
|
210
210
|
content,
|
|
211
211
|
replyToId,
|
|
212
212
|
clientMessageId,
|
|
213
|
+
attachmentIds,
|
|
213
214
|
);
|
|
214
215
|
onMessage(message);
|
|
215
216
|
return message;
|
|
@@ -247,6 +248,18 @@ export class CloudApiSocket {
|
|
|
247
248
|
};
|
|
248
249
|
}
|
|
249
250
|
|
|
251
|
+
/** Whether the server's last "ready" frame offered this protocol feature. */
|
|
252
|
+
serverOffers(feature: string): boolean {
|
|
253
|
+
return this.offeredFeatures.has(feature);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
subscribeServerFeatures(listener: () => void): () => void {
|
|
257
|
+
this.offeredFeatureListeners.add(listener);
|
|
258
|
+
return () => {
|
|
259
|
+
this.offeredFeatureListeners.delete(listener);
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
|
|
250
263
|
subscribeTeamNotifications(listener: TeamNotificationListener): () => void {
|
|
251
264
|
this.teamNotificationListeners.add(listener);
|
|
252
265
|
this.syncAuthState();
|
|
@@ -456,6 +469,7 @@ export class CloudApiSocket {
|
|
|
456
469
|
channelTargets: this.channelListeners.size,
|
|
457
470
|
});
|
|
458
471
|
this.channelListeners.clear();
|
|
472
|
+
this.offeredFeatureListeners.clear();
|
|
459
473
|
this.chatNotificationListeners.clear();
|
|
460
474
|
this.chatPresenceListeners.clear();
|
|
461
475
|
this.teamNotificationListeners.clear();
|
|
@@ -631,6 +645,7 @@ export class CloudApiSocket {
|
|
|
631
645
|
}
|
|
632
646
|
|
|
633
647
|
private negotiateSocketFeatures(offered: unknown): void {
|
|
648
|
+
this.recordOfferedFeatures(offered);
|
|
634
649
|
if (!Array.isArray(offered) || this.featuresRequestedFor === this.ws) return;
|
|
635
650
|
const features = CLIENT_SOCKET_FEATURES.filter((feature) => offered.includes(feature));
|
|
636
651
|
if (features.length === 0) return;
|
|
@@ -638,8 +653,27 @@ export class CloudApiSocket {
|
|
|
638
653
|
this.sendSocketMessage({ type: "client.features", features });
|
|
639
654
|
}
|
|
640
655
|
|
|
641
|
-
private
|
|
656
|
+
private recordOfferedFeatures(offered: unknown): void {
|
|
657
|
+
const next = new Set(
|
|
658
|
+
Array.isArray(offered)
|
|
659
|
+
? offered.filter((feature): feature is string => typeof feature === "string")
|
|
660
|
+
: [],
|
|
661
|
+
);
|
|
662
|
+
const changed = next.size !== this.offeredFeatures.size
|
|
663
|
+
|| [...next].some((feature) => !this.offeredFeatures.has(feature));
|
|
664
|
+
this.offeredFeatures = next;
|
|
665
|
+
if (!changed) return;
|
|
666
|
+
for (const listener of this.offeredFeatureListeners) listener();
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
/**
|
|
670
|
+
* The ws(s) form of the API base URL, or null when the base is not an
|
|
671
|
+
* http(s) URL. The web build derives it from `location.origin`, which is the
|
|
672
|
+
* string "null" on an opaque page, and `null/api` must not become a socket URL.
|
|
673
|
+
*/
|
|
674
|
+
private getWebSocketBaseUrl(): string | null {
|
|
642
675
|
const baseUrl = this.delegate.getBaseUrl();
|
|
676
|
+
if (!/^https?:\/\//.test(baseUrl)) return null;
|
|
643
677
|
const wsProtocol = baseUrl.startsWith("https") ? "wss" : "ws";
|
|
644
678
|
return baseUrl.replace(/^https?/, wsProtocol);
|
|
645
679
|
}
|
|
@@ -669,11 +703,17 @@ export class CloudApiSocket {
|
|
|
669
703
|
private ensureSocket(): void {
|
|
670
704
|
if (!this.shouldKeepSocketOpen() || this.ws || this.reconnectTimer) return;
|
|
671
705
|
|
|
706
|
+
const socketBaseUrl = this.getWebSocketBaseUrl();
|
|
707
|
+
if (!socketBaseUrl) {
|
|
708
|
+
this.failSocketOpen(`Not a usable Gloom Cloud URL: ${this.delegate.getBaseUrl()}`);
|
|
709
|
+
return;
|
|
710
|
+
}
|
|
711
|
+
|
|
672
712
|
const socketToken = this.delegate.getSocketAuthToken();
|
|
673
713
|
const usingWebSocketToken = this.delegate.isUsingWebSocketToken();
|
|
674
714
|
const url = socketToken
|
|
675
|
-
? `${
|
|
676
|
-
: `${
|
|
715
|
+
? `${socketBaseUrl}/cloud/ws?token=${encodeURIComponent(socketToken)}`
|
|
716
|
+
: `${socketBaseUrl}/cloud/ws`;
|
|
677
717
|
cloudApiLog.info("open websocket", {
|
|
678
718
|
hasToken: !!socketToken,
|
|
679
719
|
tokenSource: usingWebSocketToken ? "websocket" : "session",
|
|
@@ -683,18 +723,14 @@ export class CloudApiSocket {
|
|
|
683
723
|
this.health.reportSocketState(
|
|
684
724
|
GLOOM_CLOUD_SOCKET_CONNECTION_ID,
|
|
685
725
|
"connecting",
|
|
686
|
-
|
|
726
|
+
socketBaseUrl,
|
|
687
727
|
);
|
|
688
728
|
let ws: WebSocket;
|
|
689
729
|
try {
|
|
690
730
|
ws = new WebSocket(url);
|
|
691
731
|
} catch (error) {
|
|
692
|
-
this.
|
|
693
|
-
|
|
694
|
-
"error",
|
|
695
|
-
error instanceof Error ? error.message : String(error),
|
|
696
|
-
);
|
|
697
|
-
throw error;
|
|
732
|
+
this.failSocketOpen(error instanceof Error ? error.message : String(error));
|
|
733
|
+
return;
|
|
698
734
|
}
|
|
699
735
|
this.ws = ws;
|
|
700
736
|
|
|
@@ -704,7 +740,7 @@ export class CloudApiSocket {
|
|
|
704
740
|
this.health.reportSocketState(
|
|
705
741
|
GLOOM_CLOUD_SOCKET_CONNECTION_ID,
|
|
706
742
|
"open",
|
|
707
|
-
|
|
743
|
+
socketBaseUrl,
|
|
708
744
|
);
|
|
709
745
|
this.reconnectDelayMs = 1000;
|
|
710
746
|
// The full set goes out now; queued diffs from before the open are part of it.
|
|
@@ -763,6 +799,18 @@ export class CloudApiSocket {
|
|
|
763
799
|
};
|
|
764
800
|
}
|
|
765
801
|
|
|
802
|
+
/**
|
|
803
|
+
* A socket that could not be constructed is an error to show, not to throw:
|
|
804
|
+
* ensureSocket runs from effects and timers nobody awaits. The reconnect
|
|
805
|
+
* backoff retries it, so a URL that never works settles at the slowest delay.
|
|
806
|
+
*/
|
|
807
|
+
private failSocketOpen(reason: string): void {
|
|
808
|
+
// The reason can carry the socket URL with its token, so only the health detail keeps it.
|
|
809
|
+
cloudApiLog.warn("websocket could not be opened");
|
|
810
|
+
this.health.reportSocketState(GLOOM_CLOUD_SOCKET_CONNECTION_ID, "error", reason);
|
|
811
|
+
this.scheduleReconnect();
|
|
812
|
+
}
|
|
813
|
+
|
|
766
814
|
private scheduleReconnect(): void {
|
|
767
815
|
if (this.reconnectTimer || !this.shouldKeepSocketOpen()) return;
|
|
768
816
|
// Jittered so clients dropped together by a server restart do not all
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { SupplyEntity, SupplyRole, SupplyRow, SupplyTier } from "./supply-chain";
|
|
2
|
+
|
|
3
|
+
type GraphTier = "structured" | "primary" | "secondary" | "imported";
|
|
4
|
+
export interface GraphOptions {
|
|
5
|
+
depth: number; direction: "upstream" | "downstream" | "both";
|
|
6
|
+
roles: SupplyRole[]; sources: SupplyRow["sourceKind"][]; tiers: GraphTier[];
|
|
7
|
+
minPct: number; minConfidence: number; limit: number; ranking: "score" | "shortest"; asOf?: string;
|
|
8
|
+
}
|
|
9
|
+
export const DEFAULT_GRAPH_OPTIONS: GraphOptions = { depth: 2, direction: "both", roles: [], sources: [], tiers: [], minPct: 0, minConfidence: 0, limit: 50, ranking: "score" };
|
|
10
|
+
export interface GraphEvidence extends Pick<SupplyRow, "claimType" | "corroboration" | "leadStatus" | "firstSeenAt" | "lastSeenAt" | "lastConfirmedAt" | "whyUnconfirmed" | "evidence" | "nativeAmount" | "nativeCurrency" | "nativeScale" | "entityScope" | "quoteGloss" | "sectionRef" | "sourceAttribution"> {
|
|
11
|
+
/** Source trust tier, distinct from the graph evidence class in tier. */
|
|
12
|
+
trustTier?: SupplyTier;
|
|
13
|
+
id: string; fromEntity: string; toEntity: string; reportingEntity: string;
|
|
14
|
+
from: SupplyEntity; to: SupplyEntity; reporter: SupplyEntity;
|
|
15
|
+
role: SupplyRole; sourceKind: SupplyRow["sourceKind"]; tier: GraphTier;
|
|
16
|
+
jurisdiction: string; filingUrl: string; accession?: string | null; documentId?: string | null;
|
|
17
|
+
form?: string | null; filedDate?: string | null; period: string; fiscalYear?: string | null; asOf: string;
|
|
18
|
+
pctOfRevenue?: number | null; pctBasis?: SupplyRow["pctBasis"]; pctScope?: string | null;
|
|
19
|
+
usd?: number | null; usdBasis?: SupplyRow["usdBasis"];
|
|
20
|
+
confidence: number; quote: string; quoteLanguage?: string | null; quoteMatchMode?: SupplyRow["quoteMatchMode"];
|
|
21
|
+
}
|
|
22
|
+
interface GraphLink {
|
|
23
|
+
id: string; from: string; to: string; relationship: "commerce" | "partner" | "competitor" | "investee";
|
|
24
|
+
evidence: GraphEvidence[]; primaryEvidenceId: string; confidence: number; weight: number;
|
|
25
|
+
}
|
|
26
|
+
export interface GraphPath {
|
|
27
|
+
id: string; nodeIds: string[]; linkIds: string[]; hops: number; score: number; confidence: number;
|
|
28
|
+
exposure: { pct: number; basis: NonNullable<SupplyRow["pctBasis"]>; period: string; denominatorEntityId: string; estimated: true } | null;
|
|
29
|
+
}
|
|
30
|
+
interface GraphReach { entityId: string; direction: "upstream" | "downstream"; hops: number; bestPath: GraphPath; shortestPath: GraphPath; }
|
|
31
|
+
export interface GraphPayload {
|
|
32
|
+
symbol: string; entity: SupplyEntity | null; target: SupplyEntity | null; status: "available" | "unavailable";
|
|
33
|
+
nodes: SupplyEntity[]; links: GraphLink[]; upstream: GraphReach[]; downstream: GraphReach[]; related: GraphReach[]; paths: GraphPath[];
|
|
34
|
+
options: GraphOptions; requestedDepth: number; access: "full" | "preview"; maxDepth: number; truncated: boolean;
|
|
35
|
+
search: { complete: boolean; reasons: string[]; exploredStates: number; maxStates: number };
|
|
36
|
+
asOf: string | null; snapshotAt: string; methodology: string;
|
|
37
|
+
}
|
|
38
|
+
export function supplyGraphQuery(options: Partial<GraphOptions>): string {
|
|
39
|
+
return new URLSearchParams(Object.entries(options).filter(([, value]) => value !== undefined && (!Array.isArray(value) || value.length > 0)).map(([key, value]) => [key, Array.isArray(value) ? value.join(",") : String(value)])).toString();
|
|
40
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
export type SupplyRole = "customer" | "supplier" | "partner" | "competitor" | "investee";
|
|
2
|
+
export type SupplyTier = 1 | 2 | 3 | 4 | 5 | 6;
|
|
3
|
+
export type SupplyTierFilter = "sec" | "company" | "call" | "reported" | "unconfirmed";
|
|
4
|
+
type SupplyClaim = "disclosed" | "company_confirmed" | "reported" | "rumored";
|
|
5
|
+
export interface SupplyOptions { tiers?: SupplyTierFilter[]; includeLeads?: boolean; }
|
|
6
|
+
export interface SupplyEvidenceItem {
|
|
7
|
+
id: string;
|
|
8
|
+
tier: SupplyTier;
|
|
9
|
+
claimType: SupplyClaim;
|
|
10
|
+
url: string;
|
|
11
|
+
title: string;
|
|
12
|
+
publisher: string;
|
|
13
|
+
publishedAt: string;
|
|
14
|
+
fetchedAt: string;
|
|
15
|
+
quote: string | null;
|
|
16
|
+
quoteRights: "full" | "short" | "link_only";
|
|
17
|
+
textOrigin: "publisher_text" | "asr" | "ocr" | "snippet";
|
|
18
|
+
quoteLanguage: string | null;
|
|
19
|
+
englishGloss: string | null;
|
|
20
|
+
originKey: string;
|
|
21
|
+
confidence: number;
|
|
22
|
+
status: "active" | "superseded" | "rejected" | "stale";
|
|
23
|
+
verificationStatus?: "verified" | "lead";
|
|
24
|
+
valueKind: string | null;
|
|
25
|
+
value: number | null;
|
|
26
|
+
valueUnit: string | null;
|
|
27
|
+
currency: string | null;
|
|
28
|
+
}
|
|
29
|
+
export interface SupplyEntity {
|
|
30
|
+
id: string;
|
|
31
|
+
name: string;
|
|
32
|
+
ticker: string | null;
|
|
33
|
+
exchange: string | null;
|
|
34
|
+
country: string | null;
|
|
35
|
+
kind: "listed" | "private" | "government" | "unknown";
|
|
36
|
+
identifiers: Record<string, unknown>;
|
|
37
|
+
anonymous: boolean;
|
|
38
|
+
aggregate: boolean;
|
|
39
|
+
}
|
|
40
|
+
export interface SupplyRow {
|
|
41
|
+
id: string;
|
|
42
|
+
counterparty: SupplyEntity;
|
|
43
|
+
reportingEntity: SupplyEntity;
|
|
44
|
+
role: SupplyRole;
|
|
45
|
+
direction: "in" | "out" | "mutual";
|
|
46
|
+
pctOfRevenue: number | null;
|
|
47
|
+
pctScope: string | null;
|
|
48
|
+
pctBasis: "revenue" | "receivables" | "cost" | "purchases" | null;
|
|
49
|
+
usd: number | null;
|
|
50
|
+
usdBasis: "disclosed" | "derived" | null;
|
|
51
|
+
/** Amount in the filing's disclosed units; multiply by nativeScale for currency units. */
|
|
52
|
+
nativeAmount?: number | null;
|
|
53
|
+
nativeCurrency?: string | null;
|
|
54
|
+
nativeScale?: number | null;
|
|
55
|
+
jurisdiction?: string | null;
|
|
56
|
+
entityScope?: "entity" | "group" | "anonymous" | "aggregate" | null;
|
|
57
|
+
period: string;
|
|
58
|
+
fiscalYear: string | null;
|
|
59
|
+
sourceKind: "xbrl" | "filing_text" | "call" | "news" | "web" | "import" | "press_release";
|
|
60
|
+
form: string | null;
|
|
61
|
+
filedDate: string | null;
|
|
62
|
+
asOf: string;
|
|
63
|
+
confidence: number;
|
|
64
|
+
quote: string;
|
|
65
|
+
quoteLanguage: string | null;
|
|
66
|
+
/** English machine translation, separate from the validated original-language quote. */
|
|
67
|
+
quoteGloss?: string | null;
|
|
68
|
+
sectionRef?: string | null;
|
|
69
|
+
sourceAttribution?: string | null;
|
|
70
|
+
quoteMatchMode: "exact" | "whitespace" | "nfkc_whitespace" | null;
|
|
71
|
+
filingUrl: string;
|
|
72
|
+
accession: string | null;
|
|
73
|
+
tier?: SupplyTier;
|
|
74
|
+
claimType?: SupplyClaim;
|
|
75
|
+
corroboration?: number;
|
|
76
|
+
leadStatus?: "none" | "lead" | "verified" | "rejected" | "stale";
|
|
77
|
+
firstSeenAt?: string | null;
|
|
78
|
+
lastSeenAt?: string | null;
|
|
79
|
+
lastConfirmedAt?: string | null;
|
|
80
|
+
whyUnconfirmed?: string | null;
|
|
81
|
+
evidence?: SupplyEvidenceItem[];
|
|
82
|
+
}
|
|
83
|
+
export interface SupplyChainPayload {
|
|
84
|
+
symbol: string;
|
|
85
|
+
entity: SupplyEntity | null;
|
|
86
|
+
asOf: string | null;
|
|
87
|
+
status: "available" | "unavailable";
|
|
88
|
+
says: SupplyRow[];
|
|
89
|
+
names: SupplyRow[];
|
|
90
|
+
counts: { says: Record<SupplyRole, number>; names: Record<SupplyRole, number> };
|
|
91
|
+
access: "full" | "preview";
|
|
92
|
+
lockedRows: number;
|
|
93
|
+
totalRows: number;
|
|
94
|
+
truncated: boolean;
|
|
95
|
+
previewRowsPerRole: 3 | null;
|
|
96
|
+
disclaimer: string;
|
|
97
|
+
tierCounts?: Record<SupplyTierFilter, number>;
|
|
98
|
+
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { withDeadline } from "../utils/async-deadline";
|
|
2
2
|
import type { CloudApiRequest } from "./request";
|
|
3
|
+
import { getCurrentPluginTarget } from "../plugins/current-target";
|
|
4
|
+
import { VERSION } from "../version";
|
|
3
5
|
|
|
4
6
|
/** A report is fire-and-forget; a slow uplink must not hold anything open for long. */
|
|
5
7
|
const REPORT_TIMEOUT_MS = 5_000;
|
|
@@ -27,6 +29,12 @@ export interface CrashReportsPayload {
|
|
|
27
29
|
|
|
28
30
|
export type UsageCountsSurface = "terminal" | "desktop" | "web";
|
|
29
31
|
|
|
32
|
+
export type AttentionAction = "des" | "chart" | "quote" | "option_chain" | "watchlist_add";
|
|
33
|
+
export interface AttentionCountsPayload {
|
|
34
|
+
consent: true;
|
|
35
|
+
events: Array<{ symbol: string; action: AttentionAction }>;
|
|
36
|
+
}
|
|
37
|
+
|
|
30
38
|
/** One function's counts since the last batch; `fn` is its mnemonic, or `plugin`. */
|
|
31
39
|
export interface FunctionUsageCount {
|
|
32
40
|
fn: string;
|
|
@@ -115,6 +123,27 @@ function fitCommandSearchReport(report: CommandSearchReport): CommandSearchRepor
|
|
|
115
123
|
export class CloudTelemetryApi {
|
|
116
124
|
constructor(private readonly request: CloudApiRequest) {}
|
|
117
125
|
|
|
126
|
+
/** Authenticated first-party counts; never use the usage/crash install id. */
|
|
127
|
+
reportAttentionCounts(payload: AttentionCountsPayload, signal: AbortSignal): Promise<void> {
|
|
128
|
+
if (payload.consent !== true || signal.aborted) return Promise.resolve();
|
|
129
|
+
const controller = new AbortController();
|
|
130
|
+
const abort = () => controller.abort();
|
|
131
|
+
if (signal.aborted) abort();
|
|
132
|
+
else signal.addEventListener("abort", abort, { once: true });
|
|
133
|
+
// Rebuild the allowlisted body so runtime extra properties cannot leak.
|
|
134
|
+
const body: AttentionCountsPayload = {
|
|
135
|
+
consent: true,
|
|
136
|
+
events: payload.events.map(({ symbol, action }) => ({ symbol, action })),
|
|
137
|
+
};
|
|
138
|
+
return withDeadline(this.request<void>("/telemetry/attention", {
|
|
139
|
+
method: "POST",
|
|
140
|
+
body: JSON.stringify(body),
|
|
141
|
+
...(getCurrentPluginTarget() === "web" ? {} : { headers: { "User-Agent": `Gloomberb/${VERSION}` } }),
|
|
142
|
+
signal: controller.signal,
|
|
143
|
+
}), REPORT_TIMEOUT_MS, "Attention counts timed out.", abort)
|
|
144
|
+
.finally(() => signal.removeEventListener("abort", abort));
|
|
145
|
+
}
|
|
146
|
+
|
|
118
147
|
/**
|
|
119
148
|
* Sends a batch of app errors. The session goes along when one exists, so
|
|
120
149
|
* a signed-in report is tied to the account; a signed-out one is identified
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** Stored thematic baskets served by /cloud/themes and /cloud/themes/:id. */
|
|
2
|
+
export const THEME_PERIODS = ["changePercent", "return1WPercent", "return1MPercent", "return3MPercent", "returnYtdPercent"] as const;
|
|
3
|
+
export type ThemePeriod = typeof THEME_PERIODS[number];
|
|
4
|
+
export interface ThemeAggregate { value: number | null; covered: number; total: number }
|
|
5
|
+
export interface ThemeSummary {
|
|
6
|
+
id: string;
|
|
7
|
+
name: string;
|
|
8
|
+
description: string;
|
|
9
|
+
keywords: readonly string[];
|
|
10
|
+
memberCount: number;
|
|
11
|
+
present: number;
|
|
12
|
+
returns: Record<ThemePeriod, ThemeAggregate>;
|
|
13
|
+
breadth: ThemeAggregate;
|
|
14
|
+
best: { symbol: string; changePercent: number } | null;
|
|
15
|
+
worst: { symbol: string; changePercent: number } | null;
|
|
16
|
+
stale: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface ThemeMember extends Record<ThemePeriod | "price", number | null> {
|
|
19
|
+
symbol: string;
|
|
20
|
+
name: string | null;
|
|
21
|
+
exchange: string | null;
|
|
22
|
+
present: boolean;
|
|
23
|
+
asOf: Record<ThemePeriod | "price", string | null>;
|
|
24
|
+
stale: boolean;
|
|
25
|
+
}
|
|
26
|
+
interface SnapshotMetadata { asOf: string; snapshotId: string; stale: boolean }
|
|
27
|
+
export interface ThemesPayload extends SnapshotMetadata { themes: ThemeSummary[] }
|
|
28
|
+
export interface ThemeMembersPayload extends SnapshotMetadata { theme: ThemeSummary; members: ThemeMember[] }
|
package/src/api-client/types.ts
CHANGED
|
@@ -22,6 +22,21 @@ export interface ChatUserSummary {
|
|
|
22
22
|
portfolioAnalytics?: PublicPortfolioAnalytics | null;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
+
/**
|
|
26
|
+
* An image in a chat message, as the server stored it: `width`, `height`,
|
|
27
|
+
* `size` and `mime` describe the stored copy, not the upload. `url` opens in an
|
|
28
|
+
* <img> without headers; signed links last one to two hours, and a fresh copy
|
|
29
|
+
* of the message carries a fresh one.
|
|
30
|
+
*/
|
|
31
|
+
export interface ChatAttachment {
|
|
32
|
+
id: string;
|
|
33
|
+
mime: string;
|
|
34
|
+
width: number;
|
|
35
|
+
height: number;
|
|
36
|
+
size: number;
|
|
37
|
+
url: string;
|
|
38
|
+
}
|
|
39
|
+
|
|
25
40
|
export interface ChatMessage {
|
|
26
41
|
id: string;
|
|
27
42
|
channelId: string;
|
|
@@ -30,9 +45,24 @@ export interface ChatMessage {
|
|
|
30
45
|
createdAt: string;
|
|
31
46
|
editedAt?: string | null;
|
|
32
47
|
user: ChatUserSummary;
|
|
33
|
-
replyTo?: {
|
|
48
|
+
replyTo?: {
|
|
49
|
+
content: string;
|
|
50
|
+
user: { id?: string; username: string };
|
|
51
|
+
/** Images on the quoted message. */
|
|
52
|
+
attachmentCount?: number;
|
|
53
|
+
} | null;
|
|
54
|
+
/** Images in display order. A server that predates them leaves this out. */
|
|
55
|
+
attachments?: ChatAttachment[];
|
|
56
|
+
/**
|
|
57
|
+
* Only on the author's copy of a public message whose images are still being
|
|
58
|
+
* checked ("pending") or could not be checked ("failed"). Nobody else has the
|
|
59
|
+
* message yet.
|
|
60
|
+
*/
|
|
61
|
+
attachmentReview?: "pending" | "failed";
|
|
34
62
|
clientStatus?: "sending" | "failed";
|
|
35
63
|
clientError?: string | null;
|
|
64
|
+
/** The idempotency key a local send went out with, so a retry repeats it. */
|
|
65
|
+
clientMessageId?: string;
|
|
36
66
|
}
|
|
37
67
|
|
|
38
68
|
export interface ChatChannel {
|
|
@@ -1293,6 +1323,8 @@ export interface CloudMarketResponse<T> {
|
|
|
1293
1323
|
historyRetention?: unknown;
|
|
1294
1324
|
/** Source-declared history semantics; validated separately from quote metadata. */
|
|
1295
1325
|
historySession?: unknown;
|
|
1326
|
+
/** "extended" when the history includes the pre-market and after-hours bars asked for. */
|
|
1327
|
+
session?: unknown;
|
|
1296
1328
|
/** Untrusted until the history adapter validates its boundary dates. */
|
|
1297
1329
|
coverage?: CloudHistoryCoverage;
|
|
1298
1330
|
providerMeta?: {
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { EXPERIMENTS_STORAGE_KEY, storedExperimentAssignments, type ExperimentAnswer, type StorageLike } from "./web-experiments";
|
|
2
|
+
|
|
3
|
+
export type WallExperiment = "wall_teaser" | "wall_teaser_signin";
|
|
4
|
+
|
|
5
|
+
export type WallTeaserVariant = "control" | "teaser";
|
|
6
|
+
|
|
7
|
+
export interface WallExperimentContext {
|
|
8
|
+
surface: "web" | "desktop" | "tui" | "cli";
|
|
9
|
+
accountId?: string;
|
|
10
|
+
pro: boolean;
|
|
11
|
+
anonymousId?: string;
|
|
12
|
+
optedOut: boolean;
|
|
13
|
+
automated: boolean;
|
|
14
|
+
/** Only the hosted browser carries a visitor's first arm between visits. */
|
|
15
|
+
local?: StorageLike;
|
|
16
|
+
session?: StorageLike;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function unit(context: WallExperimentContext, experiment: WallExperiment): string | undefined {
|
|
20
|
+
if (context.pro || context.optedOut || context.automated) return undefined;
|
|
21
|
+
if (experiment === "wall_teaser_signin" && context.accountId) return undefined;
|
|
22
|
+
if (context.accountId) return `account:${context.accountId}`;
|
|
23
|
+
if (context.surface === "web" && context.anonymousId) return `visitor:${context.anonymousId}`;
|
|
24
|
+
return undefined;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function read(storage: StorageLike | undefined, key: string): string | null {
|
|
28
|
+
try { return storage?.getItem(key) ?? null; } catch { return null; }
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function write(storage: StorageLike | undefined, key: string, value: string): void {
|
|
32
|
+
try { storage?.setItem(key, value); } catch { /* Storage is optional in private browsing. */ }
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function isVariant(value: unknown): value is WallTeaserVariant {
|
|
36
|
+
return value === "control" || value === "teaser";
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function storedVariant(local: StorageLike | undefined, experiment: WallExperiment): WallTeaserVariant | undefined {
|
|
40
|
+
if (!local) return undefined;
|
|
41
|
+
const value = storedExperimentAssignments(local)?.split(",").find((part) => part.startsWith(`${experiment}:`))?.split(":")[1];
|
|
42
|
+
return isVariant(value) ? value : undefined;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/** Isolated from the live trial-offer experiment: these sessions are keyed by their actual unit. */
|
|
46
|
+
export function createWallExperimentSession(experiment: WallExperiment = "wall_teaser") {
|
|
47
|
+
const sessionPrefix = experiment === "wall_teaser"
|
|
48
|
+
? "gloomberb.wall-teaser.exposed:"
|
|
49
|
+
: "gloomberb.wall-teaser-signin.exposed:";
|
|
50
|
+
const answers = new Map<string, WallTeaserVariant | null>();
|
|
51
|
+
const pending = new Map<string, Promise<WallTeaserVariant | null>>();
|
|
52
|
+
|
|
53
|
+
function known(context: WallExperimentContext): WallTeaserVariant | null | undefined {
|
|
54
|
+
const identity = unit(context, experiment);
|
|
55
|
+
if (!identity) return null;
|
|
56
|
+
if (answers.has(identity)) return answers.get(identity);
|
|
57
|
+
const saved = read(context.session, `${sessionPrefix}${identity}`);
|
|
58
|
+
if (saved === "excluded") return null;
|
|
59
|
+
return isVariant(saved) ? saved : undefined;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return {
|
|
63
|
+
/** An accepted arm for attribution, never a remembered arm from an earlier visit. */
|
|
64
|
+
variant(context: WallExperimentContext): WallTeaserVariant | undefined {
|
|
65
|
+
return known(context) ?? undefined;
|
|
66
|
+
},
|
|
67
|
+
expose(
|
|
68
|
+
context: WallExperimentContext,
|
|
69
|
+
ask: (variant: WallTeaserVariant | undefined) => Promise<ExperimentAnswer>,
|
|
70
|
+
): Promise<WallTeaserVariant | null> {
|
|
71
|
+
const identity = unit(context, experiment);
|
|
72
|
+
if (!identity) return Promise.resolve(null);
|
|
73
|
+
const previous = known(context);
|
|
74
|
+
if (previous !== undefined) return Promise.resolve(previous);
|
|
75
|
+
const inFlight = pending.get(identity);
|
|
76
|
+
if (inFlight) return inFlight;
|
|
77
|
+
|
|
78
|
+
const request = (async () => {
|
|
79
|
+
let answer: ExperimentAnswer;
|
|
80
|
+
try { answer = await ask(storedVariant(context.local, experiment)); } catch {
|
|
81
|
+
// An older API (422), offline connection or timeout is not an exposure.
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
const variant = answer.accepted && isVariant(answer.variant) ? answer.variant : null;
|
|
85
|
+
answers.set(identity, variant);
|
|
86
|
+
write(context.session, `${sessionPrefix}${identity}`, variant ?? "excluded");
|
|
87
|
+
// A stopped experiment must win over an arm retained from a previous visit.
|
|
88
|
+
if (!variant) return null;
|
|
89
|
+
if (context.local && !storedVariant(context.local, experiment)) {
|
|
90
|
+
const existing = storedExperimentAssignments(context.local);
|
|
91
|
+
const next = existing ? `${existing},${experiment}:${variant}` : `${experiment}:${variant}`;
|
|
92
|
+
if (next.length <= 500) write(context.local, EXPERIMENTS_STORAGE_KEY, next);
|
|
93
|
+
}
|
|
94
|
+
return variant;
|
|
95
|
+
})().finally(() => pending.delete(identity));
|
|
96
|
+
pending.set(identity, request);
|
|
97
|
+
return request;
|
|
98
|
+
},
|
|
99
|
+
};
|
|
100
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { withDeadline } from "../utils/async-deadline";
|
|
2
|
+
import { canonicalExchange } from "../utils/exchanges";
|
|
3
|
+
import { CloudApiRequestTransport } from "./request";
|
|
4
|
+
|
|
5
|
+
const LABELS = ["risk_count", "proxy_count", "filed_at", "call_count", "last_call_at", "filing_count_90d", "last_filed_at", "open_roles", "as_of"] as const;
|
|
6
|
+
type SummaryLabel = (typeof LABELS)[number];
|
|
7
|
+
|
|
8
|
+
export interface WallSummary {
|
|
9
|
+
kind: "counts";
|
|
10
|
+
items: Array<{ label: SummaryLabel; value: number | string }>;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/** Keep the optional public route at its counts-and-dates boundary even on a mismatched API. */
|
|
14
|
+
export function parseWallSummary(value: unknown): WallSummary | null {
|
|
15
|
+
if (!value || typeof value !== "object") return null;
|
|
16
|
+
const summary = value as Record<string, unknown>;
|
|
17
|
+
if (summary.kind !== "counts" || !Array.isArray(summary.items) || summary.items.length === 0 || summary.items.length > 4) return null;
|
|
18
|
+
const items: WallSummary["items"] = [];
|
|
19
|
+
for (const raw of summary.items) {
|
|
20
|
+
if (!raw || typeof raw !== "object") return null;
|
|
21
|
+
const item = raw as Record<string, unknown>;
|
|
22
|
+
if (!LABELS.includes(item.label as SummaryLabel)) return null;
|
|
23
|
+
const count = typeof item.value === "number" && Number.isSafeInteger(item.value) && item.value >= 0;
|
|
24
|
+
const date = typeof item.value === "string" && /^\d{4}-\d{2}-\d{2}$/.test(item.value) && Number.isFinite(Date.parse(item.value));
|
|
25
|
+
if (!count && !date) return null;
|
|
26
|
+
items.push({ label: item.label as SummaryLabel, value: item.value as number | string });
|
|
27
|
+
}
|
|
28
|
+
return { kind: "counts", items };
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// A public summary needs no session credential. A separate transport still
|
|
32
|
+
// follows the installed desktop/web bridge and keeps this optional feature
|
|
33
|
+
// out of clients, such as public share pages, that never render Pro walls.
|
|
34
|
+
const publicTransport = new CloudApiRequestTransport();
|
|
35
|
+
|
|
36
|
+
/** Public aggregate facts only. Missing routes and empty summaries fall back to the frozen sample. */
|
|
37
|
+
export async function getWallSummary(wall: string, symbol: string, exchange?: string): Promise<WallSummary | null> {
|
|
38
|
+
const query = new URLSearchParams({ wall, symbol });
|
|
39
|
+
if (exchange) query.set("exchange", canonicalExchange(exchange));
|
|
40
|
+
const controller = new AbortController();
|
|
41
|
+
try {
|
|
42
|
+
const result = await withDeadline(publicTransport.request<unknown>(`/public/wall-summary?${query}`, {
|
|
43
|
+
signal: controller.signal,
|
|
44
|
+
}), 3_000, "Wall summary request timed out", (error) => controller.abort(error));
|
|
45
|
+
return parseWallSummary(result);
|
|
46
|
+
} catch {
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
}
|