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
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ExposureExtensionObservation, ExposurePayload } from "../../../api-client/exposure";
|
|
2
|
+
import { formatCompact, formatNumber } from "../../../utils/format";
|
|
3
|
+
import type { ExposureRow } from "./model";
|
|
4
|
+
|
|
5
|
+
export function driverUnits(row: ExposureExtensionObservation): string {
|
|
6
|
+
const currency = row.currency ?? "Currency";
|
|
7
|
+
return ({ currency, currency_per_share: `${currency}/share`, currency_per_unit: `${currency}/${row.dimensions?.unit ?? "unit"}`,
|
|
8
|
+
percent: "%", basis_points: "bp", ratio: "x", volume: row.dimensions?.unit ?? "Volume" } as Record<string, string>)[row.units] ?? row.units;
|
|
9
|
+
}
|
|
10
|
+
export function driverValue(row: ExposureExtensionObservation): string {
|
|
11
|
+
const number = (value: number) => Math.abs(value) >= 10_000 ? formatCompact(value, { fixedDecimals: true }) : formatNumber(value, Number.isInteger(value) ? 0 : 2);
|
|
12
|
+
const qualifier = ({ approximately: "≈ ", at_least: "≥ ", at_most: "≤ ", greater_than: "> ", less_than: "< " } as Record<string, string>)[row.qualifier ?? "exact"] ?? "";
|
|
13
|
+
if (row.value !== null) return `${qualifier}${number(row.value)}`;
|
|
14
|
+
if (row.range?.low != null && row.range.high != null) return `${qualifier}${number(row.range.low)} to ${number(row.range.high)}`;
|
|
15
|
+
if (row.range?.low != null) return `${row.qualifier === "greater_than" ? ">" : "≥"} ${number(row.range.low)}`;
|
|
16
|
+
if (row.range?.high != null) return `${row.qualifier === "less_than" ? "<" : "≤"} ${number(row.range.high)}`;
|
|
17
|
+
return row.valueText ?? (row.status ? row.status.charAt(0).toUpperCase() + row.status.slice(1) : "Unknown");
|
|
18
|
+
}
|
|
19
|
+
export function driverRows(data: ExposurePayload): ExposureRow[] {
|
|
20
|
+
return data.holdings.flatMap(holding => (holding.extensions ?? []).map(driver => ({
|
|
21
|
+
id: `${holding.symbol}:${driver.id}`, symbol: holding.symbol, shockId: "", label: driver.label,
|
|
22
|
+
basis: null, period: driver.period ?? null, exposure: null, impact: null,
|
|
23
|
+
weight: holding.weight, classification: "unknown" as const, incomplete: true,
|
|
24
|
+
driver, unknowns: driver.notes ?? [],
|
|
25
|
+
components: [{ id: driver.id, shockId: "", label: driver.label, channel: "extension" as const,
|
|
26
|
+
order: 0, basis: null, period: driver.period ?? null, classification: "unknown" as const,
|
|
27
|
+
exposurePct: null, impactPct: null, evidence: driver.evidence, path: [], unknowns: driver.notes ?? [] }],
|
|
28
|
+
})));
|
|
29
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { useRef, useState } from "react";
|
|
2
|
+
import { Button, Notice, NumberField, SelectButton, TextField, useFieldRing, type SelectControl } from "../../../components";
|
|
3
|
+
import { useInputCapture, useShortcut } from "../../../public/react";
|
|
4
|
+
import { Box, ScrollBox, type ScrollBoxRenderable } from "../../../ui";
|
|
5
|
+
import { useDialogState } from "../../../ui/dialog";
|
|
6
|
+
import type { ExposureScenario } from "../../../api-client/exposure";
|
|
7
|
+
import { parseCustomScenario } from "./model";
|
|
8
|
+
|
|
9
|
+
export interface ExposureInputs { input: string; source: string; nav: string; cash: string; depth: number; scenario: ExposureScenario; }
|
|
10
|
+
export function ExposureEditor({ initial, sources, focused, width, onSave, onCancel }: {
|
|
11
|
+
initial: ExposureInputs; sources: { value: string; label: string }[]; focused: boolean; width: number;
|
|
12
|
+
onSave: (value: ExposureInputs) => void; onCancel: () => void;
|
|
13
|
+
}) {
|
|
14
|
+
const [draft, setDraft] = useState(initial);
|
|
15
|
+
const first = initial.scenario.shocks[0]!;
|
|
16
|
+
const [custom, setCustom] = useState(initial.scenario.shocks.length > 1 || !!first.transmission ? JSON.stringify(initial.scenario) : "");
|
|
17
|
+
const [label, setLabel] = useState(initial.scenario.label);
|
|
18
|
+
const [kind, setKind] = useState(first.kind);
|
|
19
|
+
const [target, setTarget] = useState(first.target);
|
|
20
|
+
const [size, setSize] = useState(String(first.changeBps ?? first.changePct ?? -100));
|
|
21
|
+
const [products, setProducts] = useState(first.products?.join(", ") ?? "");
|
|
22
|
+
const [error, setError] = useState<string | null>(null);
|
|
23
|
+
const ids = ["source", "input", "nav", "cash", "depth", "label", "kind", "target", "size", "products", "custom", "save", "cancel"] as const;
|
|
24
|
+
type Id = typeof ids[number];
|
|
25
|
+
const [active, setActive] = useState<Id>("input");
|
|
26
|
+
const sourceControl = useRef<SelectControl>(null), kindControl = useRef<SelectControl>(null), depthControl = useRef<SelectControl>(null);
|
|
27
|
+
const scrollRef = useRef<ScrollBoxRenderable>(null);
|
|
28
|
+
const dialogOpen = useDialogState(s => s.isOpen);
|
|
29
|
+
const submit = () => {
|
|
30
|
+
try {
|
|
31
|
+
const scenario = parseCustomScenario(custom.trim() || JSON.stringify({ label, shocks: [{ id: "custom", kind, target, ...(kind === "rate" ? { changeBps: Number(size) } : { changePct: Number(size) }), ...(products.trim() ? { products: products.split(",").map(p => p.trim()).filter(Boolean) } : {}) }] }));
|
|
32
|
+
if (!size.trim() && !custom.trim()) throw new Error("Enter a shock size.");
|
|
33
|
+
if (draft.cash.trim() && (!Number.isFinite(Number(draft.cash)) || Math.abs(Number(draft.cash)) > 10)) throw new Error("Cash must be a NAV fraction between -10 and 10, for example 0.1.");
|
|
34
|
+
onSave({ ...draft, scenario });
|
|
35
|
+
} catch (e) { setError(e instanceof Error ? e.message : String(e)); }
|
|
36
|
+
};
|
|
37
|
+
const ring = useFieldRing({ ids, activeId: active, onActivate: setActive, enabled: focused && !dialogOpen, scope: "exposure-editor", scrollRef,
|
|
38
|
+
actions: { source: () => sourceControl.current?.open(), kind: () => kindControl.current?.open(), depth: () => depthControl.current?.open(), save: submit, cancel: onCancel } });
|
|
39
|
+
useInputCapture(focused);
|
|
40
|
+
useShortcut(e => { if (e.name === "escape") { e.preventDefault(); e.stopPropagation(); onCancel(); } }, { enabled: focused && !dialogOpen, phase: "before", allowEditable: true, scope: "exposure-editor" });
|
|
41
|
+
const fieldWidth = Math.max(20, width - 4);
|
|
42
|
+
const text = (id: Id, title: string, value: string, change: (v: string) => void, numeric = false) => {
|
|
43
|
+
const props = { label: title, value, onChange: change, width: fieldWidth, focused: focused && active === id, active: active === id, onMouseDown: () => setActive(id), onSubmit: submit };
|
|
44
|
+
return <Box ref={ring.nodeRef(id)}>{numeric ? <NumberField {...props} allowNegative /> : <TextField {...props} />}</Box>;
|
|
45
|
+
};
|
|
46
|
+
return <ScrollBox ref={scrollRef} flexGrow={1} flexBasis={0} minHeight={0} scrollY><Box paddingX={1} flexDirection="column" gap={1}>
|
|
47
|
+
<Box ref={ring.nodeRef("source")}><SelectButton label="Holdings source" value={draft.source} options={sources} onChange={source => setDraft(d => ({ ...d, source }))} controlRef={sourceControl} onFocus={() => setActive("source")} emphasized={active === "source"} /></Box>
|
|
48
|
+
{text("input", "Tickers / signed NAV weights", draft.input, input => setDraft(d => ({ ...d, input })))}
|
|
49
|
+
{text("nav", "Portfolio NAV (portfolio currency)", draft.nav, nav => setDraft(d => ({ ...d, nav })), true)}
|
|
50
|
+
{text("cash", "Cash weight (NAV fraction, optional)", draft.cash, cash => setDraft(d => ({ ...d, cash })), true)}
|
|
51
|
+
<Box ref={ring.nodeRef("depth")}><SelectButton label="Relationship depth" value={String(draft.depth)} options={[1, 2, 3, 4].map(n => ({ value: String(n), label: String(n) }))} onChange={depth => setDraft(d => ({ ...d, depth: Number(depth) }))} controlRef={depthControl} onFocus={() => setActive("depth")} emphasized={active === "depth"} /></Box>
|
|
52
|
+
{text("label", "Scenario name", label, setLabel)}
|
|
53
|
+
<Box ref={ring.nodeRef("kind")}><SelectButton label="Shock kind" value={kind} options={["country", "supplier", "customer", "commodity", "rate", "fx", "tariff"].map(value => ({ value, label: value }))} onChange={value => setKind(value as typeof kind)} controlRef={kindControl} onFocus={() => setActive("kind")} emphasized={active === "kind"} /></Box>
|
|
54
|
+
{text("target", "Country / entity / commodity / currency", target, setTarget)}
|
|
55
|
+
{text("size", kind === "rate" ? "Rate change (basis points)" : "Shock change (%)", size, setSize, true)}
|
|
56
|
+
{text("products", "Product restriction (comma separated, optional)", products, setProducts)}
|
|
57
|
+
{text("custom", "Advanced scenario JSON (overrides fields above)", custom, setCustom)}
|
|
58
|
+
{error ? <Notice tone="warning">{error}</Notice> : null}
|
|
59
|
+
<Box flexDirection="row" gap={2}><Box ref={ring.nodeRef("save")}><Button label="Analyze" variant="primary" onPress={submit} /></Box><Box ref={ring.nodeRef("cancel")}><Button label="Cancel" variant="secondary" onPress={onCancel} /></Box></Box>
|
|
60
|
+
</Box></ScrollBox>;
|
|
61
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { ExposurePayload } from "../../../api-client/exposure";
|
|
2
|
+
import type { PaneScreenshotEvidenceHook } from "../../../cli/pane-functions/screenshot-evidence";
|
|
3
|
+
import { useRemoteUiNode } from "../../../remote/semantic-tree";
|
|
4
|
+
import { isRecord } from "../../../utils/guards";
|
|
5
|
+
import { validateExposure } from "./client";
|
|
6
|
+
import { pathRows, portfolioRows, tableRows } from "./model";
|
|
7
|
+
import { driverRows } from "./drivers";
|
|
8
|
+
|
|
9
|
+
interface ExposureCapture { kind: "exposure"; version: 1; complete: boolean; plottedValueCount: number; payload: ExposurePayload; tab: string; view: string; rowIds: string[]; }
|
|
10
|
+
export function useExposureEvidence(payload: ExposurePayload | null, tab: string, view: string, rowIds: string[]) {
|
|
11
|
+
useRemoteUiNode({ role: "chart-data", label: "Rendered exposure analysis", getMetadata: () => ({ kind: "exposure", version: 1, complete: !!payload, ready: !!payload, payload, tab, view, rowIds, plottedValueCount: rowIds.length }) });
|
|
12
|
+
}
|
|
13
|
+
export const exposureScreenshotEvidence: PaneScreenshotEvidenceHook<ExposureCapture> = {
|
|
14
|
+
paneId: "exposure", kind: "exposure", label: "exposure",
|
|
15
|
+
async prepare({ loadModel }) {
|
|
16
|
+
const model = await loadModel();
|
|
17
|
+
const result = model.result;
|
|
18
|
+
if (!("metadata" in result) || !isRecord(result.metadata)) throw new Error("Exposure screenshot needs its analyzed payload.");
|
|
19
|
+
const payload = validateExposure(result.metadata.payload as ExposurePayload);
|
|
20
|
+
return { settings: { exposureSnapshot: payload }, financials: payload.holdings.map(h => [h.symbol, { annualStatements: [], quarterlyStatements: [], priceHistory: [] }]) };
|
|
21
|
+
},
|
|
22
|
+
read(metadata) {
|
|
23
|
+
if (!isRecord(metadata) || metadata.kind !== "exposure" || metadata.version !== 1 || metadata.complete !== true || !["table", "drivers", "paths", "portfolio"].includes(String(metadata.tab)) || !Array.isArray(metadata.rowIds)) return null;
|
|
24
|
+
try {
|
|
25
|
+
const payload = validateExposure(metadata.payload as ExposurePayload);
|
|
26
|
+
const rows = metadata.tab === "drivers" ? driverRows(payload) : metadata.tab === "paths" ? pathRows(payload) : metadata.tab === "portfolio" ? portfolioRows(payload, String(metadata.view)) : tableRows(payload);
|
|
27
|
+
if (metadata.plottedValueCount !== rows.length || metadata.rowIds.length !== rows.length || metadata.rowIds.some(id => !rows.some(r => r.id === id))) return null;
|
|
28
|
+
return metadata as unknown as ExposureCapture;
|
|
29
|
+
} catch { return null; }
|
|
30
|
+
},
|
|
31
|
+
mismatches(evidence, { resolved, payload }) {
|
|
32
|
+
const snapshot = payload.config.layout.instances.find(i => i.instanceId === payload.paneId)?.settings?.exposureSnapshot;
|
|
33
|
+
return [...(JSON.stringify(evidence.payload) !== JSON.stringify(snapshot) ? ["Exposure output differs from the captured analysis"] : []),
|
|
34
|
+
...(evidence.tab !== (resolved.options.tab ?? "table") ? ["Exposure tab does not match"] : []),
|
|
35
|
+
...(evidence.view !== (resolved.options.view ?? "stress") ? ["Exposure concentration view does not match"] : [])];
|
|
36
|
+
},
|
|
37
|
+
unavailable: evidence => evidence?.complete ? [] : ["exposure analysis"],
|
|
38
|
+
symbols: ({ payload }) => payload.financials.map(([symbol]) => symbol),
|
|
39
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { HeadlessPaneDefinition } from "../../../types/plugin";
|
|
2
|
+
import type { ExposureRequest } from "../../../api-client/exposure";
|
|
3
|
+
import { fetchExposure, fetchScenarios } from "./client";
|
|
4
|
+
import { DEFAULT_SCENARIO, parseCustomScenario, parseHoldings, TABS } from "./model";
|
|
5
|
+
import { portfolioHoldings, watchlistHoldings } from "./holdings";
|
|
6
|
+
|
|
7
|
+
export const exposureHeadless: HeadlessPaneDefinition<"bundle"> = {
|
|
8
|
+
shape: "bundle", argument: { kind: "free-text", optional: true, placeholder: "AAPL=60% NVDA=40%", description: "Tickers, signed NAV weights, PORT:<id>, or WATCH:<id>. Unweighted lists and watchlists use equal weights." },
|
|
9
|
+
discovery: { aliases: ["EXPO"], dataRequirements: ["Gloom Cloud geographic revenue, disclosed supply chains, KPIs, guidance and credit disclosures", "Portfolio NAV for local PORT weights"],
|
|
10
|
+
limitations: ["Pro: full holdings and up to four-hop paths; free: one holding, one hop", "Operating exposure estimates, never predicted stock returns", "Missing relationships and sensitivities remain unknown", "Basis and reporting period are kept separate"] },
|
|
11
|
+
options: [
|
|
12
|
+
{ key: "scenario", type: "string", settingKey: "scenario", defaultValue: "taiwan-disruption", description: "Library scenario id, or use --custom." },
|
|
13
|
+
{ key: "custom", type: "string", settingKey: "customScenario", description: "JSON scenario with label and shocks; supports multiple shocks and explicit transmission assumptions." },
|
|
14
|
+
{ key: "depth", type: "integer", settingKey: "depth", defaultValue: 2, minimum: 1, maximum: 4, description: "Maximum relationship hops." },
|
|
15
|
+
{ key: "nav", type: "string", settingKey: "nav", description: "Positive portfolio NAV in its configured currency; required for PORT." },
|
|
16
|
+
{ key: "cash", type: "string", settingKey: "cash", description: "Explicit cash weight as NAV fraction; no normalization." },
|
|
17
|
+
{ key: "tab", type: "enum", settingKey: "tab", defaultValue: "table", values: TABS.map(t => ({ value: t.value })), description: "Pane tab." },
|
|
18
|
+
{ key: "view", type: "enum", settingKey: "view", defaultValue: "stress", values: ["stress", "country", "supplier", "customer"].map(value => ({ value })), description: "Portfolio stress or concentration grouping." },
|
|
19
|
+
],
|
|
20
|
+
describe: args => `Exposure | ${args.rawArgument || "holdings"}`,
|
|
21
|
+
async load(args, ctx) {
|
|
22
|
+
const input = args.rawArgument.trim();
|
|
23
|
+
const source = /^(PORT|WATCH):(.+)$/i.exec(input);
|
|
24
|
+
let holdings: ExposureRequest["holdings"];
|
|
25
|
+
if (source?.[1]?.toUpperCase() === "PORT") {
|
|
26
|
+
const local = await ctx.resolvePortfolio?.(source[2]!);
|
|
27
|
+
if (!local) throw new Error(`Unknown local portfolio: ${source[2]}`);
|
|
28
|
+
holdings = await portfolioHoldings(local.portfolio, local.tickers, Number(args.options.nav), ctx.marketData);
|
|
29
|
+
} else if (source) {
|
|
30
|
+
const tickers = await ctx.resolveWatchlist?.(source[2]!);
|
|
31
|
+
if (!tickers) throw new Error(`Unknown local watchlist: ${source[2]}`);
|
|
32
|
+
holdings = watchlistHoldings(tickers, source[2]!);
|
|
33
|
+
} else holdings = parseHoldings(input);
|
|
34
|
+
const id = String(args.options.scenario ?? DEFAULT_SCENARIO.id);
|
|
35
|
+
const scenario = args.options.custom ? parseCustomScenario(String(args.options.custom)) : (await fetchScenarios(ctx.apiClient)).find(s => s.id === id);
|
|
36
|
+
if (!scenario) throw new Error(`Unknown scenario: ${id}`);
|
|
37
|
+
const cashWeight = args.options.cash === undefined ? undefined : Number(args.options.cash);
|
|
38
|
+
if (cashWeight !== undefined && (!Number.isFinite(cashWeight) || Math.abs(cashWeight) > 10)) throw new Error("Cash must be a NAV fraction between -10 and 10.");
|
|
39
|
+
if (ctx.signal.aborted) throw new Error("Exposure analysis cancelled.");
|
|
40
|
+
const data = await fetchExposure({ holdings, scenario, depth: Number(args.options.depth ?? 2), ...(cashWeight === undefined ? {} : { cashWeight }) }, ctx.apiClient);
|
|
41
|
+
return { complete: data.lockedHoldings === 0 && data.holdings.every(h => h.status === "quantified") && data.unknowns.length === 0,
|
|
42
|
+
errors: [...data.unknowns, ...(data.access === "preview" ? ["Free preview: one holding, depth one. Full analysis requires Pro."] : [])],
|
|
43
|
+
sections: [
|
|
44
|
+
{ title: "Holdings", rows: data.holdings.map(h => ({ symbol: h.symbol, weight: h.weight, status: h.status, measures: h.measures, coverage: h.coverage, unknowns: h.unknowns })) },
|
|
45
|
+
{ title: "Company drivers", rows: data.holdings.flatMap(h => (h.extensions ?? []).map(row => ({ symbol: h.symbol, ...row }))) },
|
|
46
|
+
{ title: "Paths and evidence", rows: data.holdings.flatMap(h => h.components.map(c => ({ symbol: h.symbol, ...c }))) },
|
|
47
|
+
{ title: "Portfolio operating stress", rows: data.portfolio.measures.map(m => ({ ...m })) },
|
|
48
|
+
{ title: "Concentrations", rows: data.portfolio.concentrations.map(c => ({ ...c })) },
|
|
49
|
+
], metadata: { payload: data } };
|
|
50
|
+
},
|
|
51
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { ExposureHolding } from "../../../api-client/exposure";
|
|
2
|
+
import type { DataProvider } from "../../../types/data-provider";
|
|
3
|
+
import type { Portfolio, TickerRecord } from "../../../types/ticker";
|
|
4
|
+
import { publicTickerKey } from "../../../utils/exchanges";
|
|
5
|
+
import { resolveCurrencyUnit } from "../../../utils/currency-units";
|
|
6
|
+
import { convertCurrency } from "../../../utils/format";
|
|
7
|
+
import { getPortfolioPositionMetrics, getPortfolioQuoteDisplay, resolvePortfolioMarketValue } from "../portfolio-list/position-metrics";
|
|
8
|
+
|
|
9
|
+
/** Explicit NAV preserves cash, shorts and leverage; net holdings are never used as NAV. */
|
|
10
|
+
export async function portfolioHoldings(portfolio: Portfolio, tickers: TickerRecord[], nav: number, market: Pick<DataProvider, "getQuote" | "getExchangeRate">): Promise<ExposureHolding[]> {
|
|
11
|
+
if (!Number.isFinite(nav) || nav <= 0) throw new Error(`Enter positive NAV in ${portfolio.currency} for ${portfolio.name}.`);
|
|
12
|
+
const positions = tickers.filter(t => t.metadata.positions.some(p => p.portfolio === portfolio.id && p.shares !== 0));
|
|
13
|
+
if (!positions.length) throw new Error("The selected portfolio has no positions.");
|
|
14
|
+
if (positions.length > 100) throw new Error("Portfolio exceeds the 100 holding limit. Use an explicit subset with its original NAV weights.");
|
|
15
|
+
const currencies = new Set([portfolio.currency]);
|
|
16
|
+
for (const t of positions) {
|
|
17
|
+
const category = t.metadata.assetCategory?.toUpperCase();
|
|
18
|
+
if (category && !["STK", "STOCK", "EQUITY", "ETF", "FUND"].includes(category)) throw new Error(`${t.metadata.ticker}: ${category} position needs an explicit underlying exposure weight.`);
|
|
19
|
+
currencies.add(t.metadata.currency);
|
|
20
|
+
t.metadata.positions.filter(p => p.portfolio === portfolio.id).forEach(p => { if (p.currency) currencies.add(p.currency); });
|
|
21
|
+
}
|
|
22
|
+
const rates = new Map<string, number>([["USD", 1]]);
|
|
23
|
+
const majorRates = new Map<string, number>([["USD", 1]]);
|
|
24
|
+
const ensureRate = async (rawCurrency: string) => {
|
|
25
|
+
const unit = resolveCurrencyUnit(rawCurrency);
|
|
26
|
+
if (!unit.currency) throw new Error("Portfolio currency is missing.");
|
|
27
|
+
let rate = majorRates.get(unit.currency);
|
|
28
|
+
if (rate === undefined) {
|
|
29
|
+
rate = await market.getExchangeRate(unit.currency);
|
|
30
|
+
if (!Number.isFinite(rate) || rate <= 0) throw new Error(`FX unavailable for ${unit.currency}; weights were not estimated.`);
|
|
31
|
+
majorRates.set(unit.currency, rate);
|
|
32
|
+
}
|
|
33
|
+
rates.set(rawCurrency, rate / unit.divisor);
|
|
34
|
+
};
|
|
35
|
+
for (const currency of currencies) await ensureRate(currency);
|
|
36
|
+
const holdings: ExposureHolding[] = [];
|
|
37
|
+
for (const ticker of positions) {
|
|
38
|
+
const quote = await market.getQuote(ticker.metadata.ticker, ticker.metadata.exchange).catch(() => null);
|
|
39
|
+
const currency = quote?.currency || ticker.metadata.currency;
|
|
40
|
+
if (!rates.has(currency)) await ensureRate(currency);
|
|
41
|
+
const metrics = getPortfolioPositionMetrics(ticker, portfolio.id, currency, {
|
|
42
|
+
currency: portfolio.currency, convert: (value, from) => convertCurrency(value, from, portfolio.currency, rates),
|
|
43
|
+
}, quote);
|
|
44
|
+
const active = getPortfolioQuoteDisplay(metrics, quote);
|
|
45
|
+
const value = resolvePortfolioMarketValue(metrics, active ? convertCurrency(active.price, currency, portfolio.currency, rates) : null);
|
|
46
|
+
if (!value || !Number.isFinite(value.net)) throw new Error(`Market value unavailable for ${ticker.metadata.ticker}; no partial portfolio was reweighted.`);
|
|
47
|
+
holdings.push({ symbol: publicTickerKey(ticker.metadata.ticker, ticker.metadata.exchange), weight: value.net / nav });
|
|
48
|
+
}
|
|
49
|
+
return holdings;
|
|
50
|
+
}
|
|
51
|
+
export function watchlistHoldings(tickers: TickerRecord[], id: string): ExposureHolding[] {
|
|
52
|
+
const list = tickers.filter(t => t.metadata.watchlists.includes(id));
|
|
53
|
+
if (!list.length) throw new Error("The selected watchlist is empty.");
|
|
54
|
+
if (list.length > 100) throw new Error("Watchlist exceeds the 100 holding limit.");
|
|
55
|
+
return list.map(t => ({ symbol: publicTickerKey(t.metadata.ticker, t.metadata.exchange), weight: 1 / list.length }));
|
|
56
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { PluginModule } from "../plugin-module";
|
|
2
|
+
import { exposureHeadless } from "./headless";
|
|
3
|
+
import { ExposurePane } from "./pane";
|
|
4
|
+
|
|
5
|
+
export const exposureModule: PluginModule = {
|
|
6
|
+
panes: [{ id: "exposure", name: "Exposure", icon: "E", component: ExposurePane, defaultPosition: "right", defaultMode: "floating", defaultFloatingSize: { width: 138, height: 31 }, tableExport: true, headless: exposureHeadless,
|
|
7
|
+
portableShare: { private: { params: true, settings: true, state: true } } }],
|
|
8
|
+
paneTemplates: [{ id: "exposure-pane", paneId: "exposure", label: "Exposure", description: "Pro scenario exposures across holdings, geographic revenue and supply chains, with source evidence and portfolio concentrations.",
|
|
9
|
+
keywords: ["exposure", "scenario", "stress", "portfolio", "supply", "country", "tariff", "pro"],
|
|
10
|
+
shortcut: { prefix: "EXPO", argKind: "text", argOptional: true, argPlaceholder: "AAPL=60% NVDA=40%" }, headless: exposureHeadless,
|
|
11
|
+
createInstance: (_context, options) => ({ params: { input: options?.arg ?? "" } }),
|
|
12
|
+
}],
|
|
13
|
+
};
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import type { ExposureBasis, ExposureComponent, ExposureExtensionObservation, ExposureHolding, ExposurePayload, ExposureRange, ExposureScenario } from "../../../api-client/exposure";
|
|
2
|
+
|
|
3
|
+
export const TABS = [{ value: "table", label: "Table" }, { value: "drivers", label: "Drivers" }, { value: "paths", label: "Paths" }, { value: "portfolio", label: "Portfolio" }];
|
|
4
|
+
export const DEFAULT_SCENARIO: ExposureScenario = { id: "taiwan-disruption", label: "Taiwan disruption", shocks: [{ id: "taiwan", kind: "country", target: "TW", changePct: -100 }] };
|
|
5
|
+
export const basisLabel = (basis: string | null) => basis?.replaceAll("_", " ") ?? "Unknown basis";
|
|
6
|
+
const pct = (value: number) => `${value.toFixed(1)}%`;
|
|
7
|
+
export const rangeText = (range: ExposureRange | null) => !range ? "Unknown" : range.low === range.high ? pct(range.low) : `${range.low.toFixed(1)} to ${range.high.toFixed(1)}%`;
|
|
8
|
+
export const fraction = (value: number) => pct(value * 100);
|
|
9
|
+
|
|
10
|
+
/** A weighted list is entirely explicit. Never silently fill missing weights or normalize shorts. */
|
|
11
|
+
export function parseHoldings(text: string): ExposureHolding[] {
|
|
12
|
+
const tokens = text.trim().split(/[\s,;]+/).filter(Boolean);
|
|
13
|
+
if (!tokens.length) throw new Error("Enter holdings, for example AAPL=60% NVDA=40%.");
|
|
14
|
+
if (tokens.length > 100) throw new Error("Use at most 100 holdings.");
|
|
15
|
+
const weighted = tokens.some(token => token.includes("="));
|
|
16
|
+
const seen = new Set<string>();
|
|
17
|
+
return tokens.map(token => {
|
|
18
|
+
const match = /^([A-Za-z0-9.:-]{1,40})(?:=([+-]?(?:\d+(?:\.\d*)?|\.\d+))(%?))?$/.exec(token);
|
|
19
|
+
if (!match || (weighted && match[2] === undefined)) throw new Error("Use tickers alone for equal weights, or give every holding a weight: AAPL=60% NVDA=-10%.");
|
|
20
|
+
const symbol = match[1]!.toUpperCase();
|
|
21
|
+
if (seen.has(symbol)) throw new Error(`Duplicate holding: ${symbol}`);
|
|
22
|
+
seen.add(symbol);
|
|
23
|
+
const weight = weighted ? Number(match[2]) / (match[3] === "%" ? 100 : 1) : 1 / tokens.length;
|
|
24
|
+
if (!Number.isFinite(weight) || Math.abs(weight) > 10) throw new Error(`Weight for ${symbol} must be between -1000% and 1000%.`);
|
|
25
|
+
return { symbol, weight };
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
function onlyKeys(value: object, allowed: string[]): boolean {
|
|
29
|
+
return Object.keys(value).every(key => allowed.includes(key));
|
|
30
|
+
}
|
|
31
|
+
export function parseCustomScenario(text: string): ExposureScenario {
|
|
32
|
+
let value: unknown;
|
|
33
|
+
try { value = JSON.parse(text); } catch { throw new Error("Custom scenario must be valid JSON."); }
|
|
34
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) throw new Error("Custom scenario must be an object.");
|
|
35
|
+
const scenario = value as ExposureScenario;
|
|
36
|
+
if (!onlyKeys(scenario, ["id", "label", "shocks"]) || (scenario.id !== undefined && (typeof scenario.id !== "string" || scenario.id.length > 64))) throw new Error("Unsupported scenario field or invalid id (maximum 64 characters).");
|
|
37
|
+
if (typeof scenario.label !== "string" || !scenario.label.trim() || scenario.label.trim().length > 160 || !Array.isArray(scenario.shocks) || !scenario.shocks.length || scenario.shocks.length > 8) throw new Error("A scenario needs a label (1 to 160 characters) and 1 to 8 shocks.");
|
|
38
|
+
scenario.label = scenario.label.trim();
|
|
39
|
+
const ids = new Set<string>();
|
|
40
|
+
for (const shock of scenario.shocks) {
|
|
41
|
+
if (!shock || typeof shock !== "object" || !onlyKeys(shock, ["id", "kind", "target", "changePct", "changeBps", "products", "transmission"]) || typeof shock.id !== "string" || !shock.id.trim() || shock.id.trim().length > 64 || ids.has(shock.id.trim()) || !["country", "commodity", "rate", "fx", "tariff", "supplier", "customer"].includes(shock.kind) || typeof shock.target !== "string" || !shock.target.trim() || shock.target.trim().length > 160) throw new Error("Each shock needs a unique id (up to 64 characters), supported kind and target (up to 160 characters), with no unsupported fields.");
|
|
42
|
+
shock.id = shock.id.trim(); shock.target = shock.target.trim(); ids.add(shock.id);
|
|
43
|
+
const change = shock.kind === "rate" ? shock.changeBps : shock.changePct;
|
|
44
|
+
if (typeof change !== "number" || !Number.isFinite(change)) throw new Error("Each shock needs a finite changePct (or changeBps for rates).");
|
|
45
|
+
if (shock.kind === "rate" ? Math.abs(change) > 10_000 || shock.changePct !== undefined : change < -100 || change > 1000 || shock.changeBps !== undefined) throw new Error("Rate shocks use only changeBps (-10000 to 10000); other shocks use only changePct (-100 to 1000).");
|
|
46
|
+
if (shock.products !== undefined && (!["country", "tariff"].includes(shock.kind) || !Array.isArray(shock.products) || shock.products.length < 1 || shock.products.length > 12 || shock.products.some(p => typeof p !== "string" || !p.trim() || p.trim().length > 100))) throw new Error("Product restrictions require 1 to 12 names of up to 100 characters on a country or tariff shock.");
|
|
47
|
+
if (shock.transmission !== undefined) {
|
|
48
|
+
const t = shock.transmission;
|
|
49
|
+
if (!t || typeof t !== "object" || !onlyKeys(t, ["basis", "exposurePct", "factor", "direction"]) || !["revenue", "cost", "purchases", "receivables", "operating_income", "interest_expense", "debt"].includes(t.basis) || !validRange(t.exposurePct) || !onlyKeys(t.exposurePct, ["low", "high"]) || t.exposurePct.low < 0 || t.exposurePct.high > 100 || !validRange(t.factor) || !onlyKeys(t.factor, ["low", "high"]) || t.factor.low < 0 || t.factor.high > 100 || ![undefined, 1, -1].includes(t.direction)) throw new Error("Transmission needs a basis, exposurePct and factor ranges within 0 to 100, direction 1 or -1, and no unsupported fields.");
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return scenario;
|
|
53
|
+
}
|
|
54
|
+
export function validRange(value: unknown): value is ExposureRange {
|
|
55
|
+
const r = value as ExposureRange | null;
|
|
56
|
+
return !!r && Number.isFinite(r.low) && Number.isFinite(r.high) && r.low <= r.high;
|
|
57
|
+
}
|
|
58
|
+
export interface ExposureRow {
|
|
59
|
+
driver?: ExposureExtensionObservation;
|
|
60
|
+
id: string; symbol: string; shockId: string; label: string; basis: ExposureBasis | null; period: string | null;
|
|
61
|
+
exposure: ExposureRange | null; impact: ExposureRange | null; weight: number | null;
|
|
62
|
+
classification: string; incomplete: boolean; concentration?: boolean; components: ExposureComponent[]; unknowns: string[];
|
|
63
|
+
}
|
|
64
|
+
function shockLabel(data: ExposurePayload, id: string): string {
|
|
65
|
+
const shock = data.scenario.shocks.find(s => s.id === id);
|
|
66
|
+
if (!shock) return id;
|
|
67
|
+
const change = shock.changeBps ?? shock.changePct;
|
|
68
|
+
return `${shock.target}${change == null ? "" : ` ${change > 0 ? "+" : ""}${change}${shock.kind === "rate" ? "bp" : "%"}`}`;
|
|
69
|
+
}
|
|
70
|
+
export function tableRows(data: ExposurePayload): ExposureRow[] {
|
|
71
|
+
return data.holdings.flatMap<ExposureRow>(holding => [
|
|
72
|
+
...holding.measures.map((measure, i): ExposureRow => ({
|
|
73
|
+
id: `${holding.symbol}:${i}`, symbol: holding.symbol, shockId: measure.shockId, label: shockLabel(data, measure.shockId),
|
|
74
|
+
basis: measure.basis, period: measure.period, exposure: measure.exposurePct, impact: measure.impactPct,
|
|
75
|
+
weight: holding.weight, classification: measure.classification, incomplete: measure.incomplete,
|
|
76
|
+
components: holding.components.filter(c => measure.componentIds.includes(c.id)), unknowns: holding.unknowns,
|
|
77
|
+
})),
|
|
78
|
+
...data.scenario.shocks.filter(shock => !holding.measures.some(m => m.shockId === shock.id)).map((shock): ExposureRow => ({
|
|
79
|
+
id: `${holding.symbol}:unknown:${shock.id}`, symbol: holding.symbol, shockId: shock.id, label: shockLabel(data, shock.id), basis: null, period: null,
|
|
80
|
+
exposure: null, impact: null, weight: holding.weight, classification: "unknown", incomplete: true,
|
|
81
|
+
components: holding.components.filter(c => c.shockId === shock.id), unknowns: holding.unknowns,
|
|
82
|
+
})),
|
|
83
|
+
]);
|
|
84
|
+
}
|
|
85
|
+
export function pathRows(data: ExposurePayload): ExposureRow[] {
|
|
86
|
+
return data.holdings.flatMap(holding => holding.components.map(component => ({
|
|
87
|
+
id: `${holding.symbol}:${component.id}`, symbol: holding.symbol, shockId: component.shockId,
|
|
88
|
+
label: component.path.length ? [component.path[0]!.from.symbol ?? component.path[0]!.from.name, ...component.path.map(h => h.to.symbol ?? h.to.name)].join(" → ") : component.label,
|
|
89
|
+
basis: component.basis, period: component.period, exposure: component.exposurePct, impact: component.impactPct,
|
|
90
|
+
weight: holding.weight, classification: component.classification, incomplete: component.unknowns.length > 0,
|
|
91
|
+
components: [component], unknowns: component.unknowns,
|
|
92
|
+
})));
|
|
93
|
+
}
|
|
94
|
+
export function portfolioRows(data: ExposurePayload, view: string): ExposureRow[] {
|
|
95
|
+
if (view === "stress") return data.portfolio.measures.map((m, i) => ({ id: `stress:${i}`, symbol: m.symbols.join(", "), shockId: m.shockId, label: shockLabel(data, m.shockId),
|
|
96
|
+
basis: m.basis, period: m.period, exposure: m.signedExposurePct, impact: m.impactPct, weight: m.coveredGrossWeight,
|
|
97
|
+
classification: "estimated", incomplete: m.unknownGrossWeight > 0, components: [], unknowns: [`Unknown gross holding weight: ${fraction(m.unknownGrossWeight)}`] }));
|
|
98
|
+
return data.portfolio.concentrations.filter(c => c.kind === view).map((c, i) => ({
|
|
99
|
+
id: `${c.kind}:${c.key}:${i}`, symbol: c.symbols.join(", "), shockId: "", label: c.label, basis: c.basis, period: c.period,
|
|
100
|
+
exposure: c.grossExposurePct, impact: c.signedExposurePct, weight: c.grossHoldingWeight, classification: c.grossExposurePct === null ? "unknown" : "estimated", incomplete: c.incomplete, concentration: true,
|
|
101
|
+
components: [{ id: c.key, shockId: "", label: c.label, channel: c.kind === "country" ? "geography" : c.kind, order: 0, basis: c.basis, period: c.period,
|
|
102
|
+
classification: c.grossExposurePct === null ? "unknown" : "estimated", exposurePct: c.grossExposurePct, impactPct: null, evidence: c.evidence, path: [], unknowns: [] }], unknowns: c.incomplete ? ["Concentration includes unquantified relationships."] : [],
|
|
103
|
+
}));
|
|
104
|
+
}
|