@gloom-sh/terminal 0.19.4 → 0.19.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -1
- package/patches/@opentui%2Fcore@0.3.2.patch +86 -25
- package/src/api-client/equity-screener.ts +23 -0
- package/src/app/pane-runtime/index.tsx +2 -0
- package/src/app/pane-runtime/plugin-bindings.ts +10 -1
- package/src/app.tsx +63 -16
- package/src/cli/commands/command-utils.ts +4 -0
- package/src/cli/commands/market.ts +264 -33
- package/src/cli/commands/search.ts +22 -4
- package/src/cli/commands/ticker.ts +84 -39
- package/src/cli/currency-name-hint.ts +60 -0
- package/src/cli/glossary.ts +3 -3
- package/src/cli/history-rows.ts +18 -1
- package/src/cli/known-gaps.ts +25 -2
- package/src/cli/listing-arg.ts +12 -0
- package/src/cli/not-a-ticker.ts +5 -3
- package/src/cli/pane-functions/capabilities.ts +2 -0
- package/src/cli/pane-functions/catalog.ts +31 -5
- package/src/cli/pane-functions/function-help.ts +8 -5
- package/src/cli/pane-functions/headless.ts +11 -6
- package/src/cli/pane-functions/market-session.ts +6 -7
- package/src/cli/pane-functions/resolver.ts +75 -2
- package/src/cli/quote-answer.ts +9 -0
- package/src/cli/series-search.ts +4 -5
- package/src/cli/symbol-list.ts +54 -2
- package/src/cli/symbol-rows.ts +14 -2
- package/src/cli/ticker-resolution.ts +89 -20
- package/src/components/chart/composite/axis-overlays.tsx +60 -27
- package/src/components/chart/composite/composite-chart.tsx +118 -63
- package/src/components/chart/composite/cursor-source.ts +111 -0
- package/src/components/chart/composite/format.ts +168 -6
- package/src/components/chart/composite/legend.tsx +8 -4
- package/src/components/chart/composite/panel-bitmap.ts +28 -2
- package/src/components/chart/composite/panel-labels.ts +20 -1
- package/src/components/chart/composite/panel-surface.tsx +201 -92
- package/src/components/chart/composite/price-axis-labels.tsx +92 -46
- package/src/components/chart/composite/price-series.ts +31 -8
- package/src/components/chart/composite/scene.ts +154 -59
- package/src/components/chart/composite/series-axis-tags.tsx +4 -2
- package/src/components/chart/composite/time-axis.ts +30 -7
- package/src/components/chart/composite/time-scale.ts +211 -56
- package/src/components/chart/composite/types.ts +11 -1
- package/src/components/chart/composite/use-composite-chart-keyboard.ts +32 -12
- package/src/components/chart/curve/curve-surface.tsx +5 -2
- package/src/components/chart/curve/model.ts +4 -1
- package/src/components/chart/native/use-bitmap-metrics.ts +81 -0
- package/src/components/chart/static/series.ts +3 -0
- package/src/components/command-bar/commands/collection-list.ts +81 -0
- package/src/components/command-bar/commands/direct/index.ts +6 -0
- package/src/components/command-bar/commands/registry.ts +8 -0
- package/src/components/command-bar/layout-items/current-layout.ts +22 -1
- package/src/components/command-bar/layout-items/focused-pane.ts +22 -1
- package/src/components/command-bar/pane-templates/items.ts +19 -3
- package/src/components/command-bar/pane-templates/workflow.ts +5 -0
- package/src/components/command-bar/routes/root/results.ts +23 -3
- package/src/components/command-bar/routes/root/selection.ts +4 -2
- package/src/components/command-bar/routes/root/shortcut-feedback.ts +1 -1
- package/src/components/command-bar/routes/root/shortcut-items.ts +3 -4
- package/src/components/command-bar/routes/root/shortcuts.ts +58 -14
- package/src/components/command-bar/routes/root/ticker-first.ts +32 -0
- package/src/components/command-bar/surface/environment.ts +2 -0
- package/src/components/command-bar/view-model.ts +7 -0
- package/src/components/command-bar/workflow/ops.ts +2 -1
- package/src/components/command-bar/workflow/tickers.ts +20 -0
- package/src/components/layout/shell/active-drag.ts +38 -7
- package/src/components/layout/shell/drag/magnets.ts +106 -0
- package/src/components/layout/shell/menu.ts +15 -1
- package/src/components/layout/shell/pane/actions.ts +4 -0
- package/src/components/layout/shell/ticker-link-menu.ts +12 -3
- package/src/components/layout/status-bar.tsx +20 -0
- package/src/components/layout/window-controls.tsx +96 -35
- package/src/components/layout/window-fullscreen.ts +20 -0
- package/src/components/onboarding/onboarding-keyboard.ts +5 -1
- package/src/components/onboarding/onboarding-wizard.tsx +15 -4
- package/src/components/onboarding/portfolio-step/positions-panel.tsx +8 -5
- package/src/components/onboarding/use-onboarding-progress.ts +20 -1
- package/src/components/price-sparkline/view.tsx +14 -6
- package/src/components/quote-flash.ts +36 -32
- package/src/components/ticker/badge/index.tsx +8 -4
- package/src/components/ticker/badge/list.tsx +23 -7
- package/src/components/ui/column-grid.tsx +8 -2
- package/src/components/ui/data-table/opentui/model.ts +4 -1
- package/src/components/ui/tabs.tsx +5 -2
- package/src/core/state/app/layout.ts +18 -3
- package/src/core/state/app/state.ts +2 -0
- package/src/core/state/app/types.ts +5 -0
- package/src/data/config/layout.ts +3 -0
- package/src/data/config/store/normalize.ts +39 -4
- package/src/i18n/es.ts +10 -0
- package/src/i18n/ja.ts +10 -0
- package/src/i18n/ko.ts +10 -0
- package/src/i18n/zh-cn.ts +10 -0
- package/src/i18n/zh-tw.ts +10 -0
- package/src/layout/pane-manager/floating-placement.ts +7 -4
- package/src/layout/pane-manager/floating.ts +5 -2
- package/src/market-data/bond-funds.ts +19 -0
- package/src/market-data/coordinator/events.ts +17 -1
- package/src/market-data/frame-scheduler.ts +47 -10
- package/src/market-data/frame-wake.ts +74 -0
- package/src/market-data/futures-board.ts +7 -6
- package/src/market-data/futures-contract.ts +14 -3
- package/src/market-data/hooks.tsx +12 -3
- package/src/market-data/market/freshness.ts +18 -0
- package/src/market-data/market/status.ts +15 -2
- package/src/market-data/performance.ts +78 -9
- package/src/market-data/request-types.ts +6 -3
- package/src/plugins/builtin/alerts/cli.ts +2 -1
- package/src/plugins/builtin/analytics/risk-evidence.ts +1 -0
- package/src/plugins/builtin/attention/evidence.ts +1 -1
- package/src/plugins/builtin/awards/client.ts +1 -1
- package/src/plugins/builtin/awards/evidence.ts +1 -1
- package/src/plugins/builtin/awards/pane.tsx +2 -1
- package/src/plugins/builtin/bond-calculator/headless.ts +2 -1
- package/src/plugins/builtin/bond-calculator/index.tsx +1 -1
- package/src/plugins/builtin/bond-calculator/math.ts +1 -1
- package/src/plugins/builtin/bond-calculator/model.ts +14 -5
- package/src/plugins/builtin/bond-calculator/pane.tsx +1 -1
- package/src/plugins/builtin/broker-manager/footer.ts +3 -2
- package/src/plugins/builtin/broker-manager/index.tsx +2 -1
- package/src/plugins/builtin/broker-manager/keyboard.ts +2 -1
- package/src/plugins/builtin/buildout/cells.tsx +25 -45
- package/src/plugins/builtin/buildout/detail/company.tsx +3 -3
- package/src/plugins/builtin/buildout/detail/index.tsx +1 -1
- package/src/plugins/builtin/buildout/detail/intel.tsx +4 -7
- package/src/plugins/builtin/buildout/detail/site.tsx +4 -4
- package/src/plugins/builtin/buildout/detail/ui.tsx +39 -38
- package/src/plugins/builtin/buildout/format.ts +23 -1
- package/src/plugins/builtin/buildout/model/types.ts +1 -0
- package/src/plugins/builtin/buildout/pane/index.tsx +2 -8
- package/src/plugins/builtin/buildout/table-model.ts +12 -4
- package/src/plugins/builtin/catalysts/evidence.ts +1 -1
- package/src/plugins/builtin/catalysts/pane.tsx +2 -1
- package/src/plugins/builtin/cds/headless.ts +1 -0
- package/src/plugins/builtin/cds/index.tsx +1 -1
- package/src/plugins/builtin/chart-composer/headless.ts +40 -1
- package/src/plugins/builtin/cloud/plugin.tsx +2 -0
- package/src/plugins/builtin/cloud/upgrade-status-widget.tsx +28 -3
- package/src/plugins/builtin/cloud-tweets/table.tsx +3 -2
- package/src/plugins/builtin/comment-letters/client.ts +2 -1
- package/src/plugins/builtin/company-kpis/client.ts +1 -1
- package/src/plugins/builtin/company-kpis/pane.tsx +2 -1
- package/src/plugins/builtin/company-kpis/screenshot-evidence.ts +3 -2
- package/src/plugins/builtin/correlation/headless.ts +3 -2
- package/src/plugins/builtin/cot/headless.ts +9 -3
- package/src/plugins/builtin/cot/model.ts +44 -3
- package/src/plugins/builtin/credit-documents/client.ts +1 -1
- package/src/plugins/builtin/credit-documents/evidence.ts +1 -1
- package/src/plugins/builtin/credit-documents/pane.tsx +2 -1
- package/src/plugins/builtin/crypto-board/pane.tsx +5 -4
- package/src/plugins/builtin/debt-maturities/headless.ts +11 -2
- package/src/plugins/builtin/debt-maturities/model.ts +66 -0
- package/src/plugins/builtin/debt-maturities/pane.tsx +23 -4
- package/src/plugins/builtin/earnings-calls/pane.tsx +1 -1
- package/src/plugins/builtin/earnings-ripple/index.tsx +6 -1
- package/src/plugins/builtin/earnings-ripple/pane.tsx +1 -1
- package/src/plugins/builtin/econ/calendar-model.ts +30 -6
- package/src/plugins/builtin/econ/fred-catalog.ts +5 -5
- package/src/plugins/builtin/econ/print-watch.ts +3 -1
- package/src/plugins/builtin/equity-screener/client.ts +1 -1
- package/src/plugins/builtin/equity-screener/criterion-editor.tsx +4 -16
- package/src/plugins/builtin/equity-screener/headless.ts +4 -2
- package/src/plugins/builtin/equity-screener/ideas.ts +67 -3
- package/src/plugins/builtin/equity-screener/model.ts +180 -12
- package/src/plugins/builtin/equity-screener/pane.tsx +52 -12
- package/src/plugins/builtin/equity-screener/screen-check.ts +7 -4
- package/src/plugins/builtin/equity-screener/watchlist.ts +33 -0
- package/src/plugins/builtin/futures/series.ts +16 -1
- package/src/plugins/builtin/futures-curve/client.ts +19 -0
- package/src/plugins/builtin/futures-curve/headless.ts +52 -13
- package/src/plugins/builtin/futures-curve/index.tsx +1 -1
- package/src/plugins/builtin/futures-curve/model.ts +77 -6
- package/src/plugins/builtin/futures-curve/pane.tsx +19 -3
- package/src/plugins/builtin/fx-matrix/headless.ts +4 -2
- package/src/plugins/builtin/fx-matrix/index.tsx +37 -3
- package/src/plugins/builtin/fx-matrix/pairs.ts +15 -0
- package/src/plugins/builtin/gpu/headless.ts +2 -1
- package/src/plugins/builtin/help/function-card.tsx +2 -1
- package/src/plugins/builtin/help/index.tsx +2 -1
- package/src/plugins/builtin/insider/display.ts +45 -6
- package/src/plugins/builtin/ipo-calendar/model.ts +2 -0
- package/src/plugins/builtin/iv-history/client.ts +2 -1
- package/src/plugins/builtin/iv-history/headless.ts +2 -1
- package/src/plugins/builtin/jobs/pages.ts +4 -4
- package/src/plugins/builtin/kelly-sizer/headless.ts +2 -1
- package/src/plugins/builtin/macro-day/client.ts +41 -0
- package/src/plugins/builtin/macro-day/headless.ts +19 -9
- package/src/plugins/builtin/macro-day/model.ts +3 -1
- package/src/plugins/builtin/market-heatmap/index.tsx +2 -1
- package/src/plugins/builtin/market-movers/index.tsx +4 -3
- package/src/plugins/builtin/members/client.ts +1 -1
- package/src/plugins/builtin/mna/distress/client.ts +1 -0
- package/src/plugins/builtin/mna/distress/headless.ts +1 -0
- package/src/plugins/builtin/mna/pane.tsx +4 -1
- package/src/plugins/builtin/options/market-reference.ts +1 -1
- package/src/plugins/builtin/options/open-interest-as-of.ts +3 -1
- package/src/plugins/builtin/options/view.tsx +2 -1
- package/src/plugins/builtin/options-calculator/evidence.ts +1 -1
- package/src/plugins/builtin/options-scenario/csp-screen-pane.tsx +1 -1
- package/src/plugins/builtin/options-scenario/csp-screen.ts +8 -4
- package/src/plugins/builtin/options-scenario/csp.ts +28 -9
- package/src/plugins/builtin/options-scenario/evidence.ts +5 -4
- package/src/plugins/builtin/options-scenario/pane.tsx +2 -1
- package/src/plugins/builtin/perps/client.ts +1 -1
- package/src/plugins/builtin/perps/pane.tsx +3 -1
- package/src/plugins/builtin/portfolio-list/cli/bulk-symbols.ts +17 -0
- package/src/plugins/builtin/portfolio-list/cli/portfolio-command.ts +2 -1
- package/src/plugins/builtin/portfolio-list/cli/watchlist-command.ts +4 -2
- package/src/plugins/builtin/portfolio-list/pane/index.tsx +7 -3
- package/src/plugins/builtin/portfolio-list/use-throttled-memo.ts +10 -19
- package/src/plugins/builtin/rate-path/headless.ts +24 -10
- package/src/plugins/builtin/research/analyst-model.ts +1 -0
- package/src/plugins/builtin/research/equity-diagnostic-pane.tsx +2 -1
- package/src/plugins/builtin/research/event-model.ts +10 -3
- package/src/plugins/builtin/research/events-headless.ts +20 -2
- package/src/plugins/builtin/research/index.tsx +1 -0
- package/src/plugins/builtin/research/relative-valuation-currency.ts +1 -1
- package/src/plugins/builtin/research/relative-valuation-peers.ts +2 -1
- package/src/plugins/builtin/research-search/command-bar-search.ts +3 -1
- package/src/plugins/builtin/research-search/snippet.ts +1 -0
- package/src/plugins/builtin/revenue-breakdown/client.ts +3 -2
- package/src/plugins/builtin/seasonality/headless.ts +2 -1
- package/src/plugins/builtin/sec/command-bar-search.ts +3 -2
- package/src/plugins/builtin/sec/fund-facts.ts +17 -1
- package/src/plugins/builtin/sec/index.tsx +8 -5
- package/src/plugins/builtin/sec/row-summaries.ts +28 -12
- package/src/plugins/builtin/shared/members-menu.tsx +103 -38
- package/src/plugins/builtin/short-interest/publications-model.ts +22 -1
- package/src/plugins/builtin/short-interest/publications-pane.tsx +13 -4
- package/src/plugins/builtin/short-interest/watch-client.ts +2 -1
- package/src/plugins/builtin/short-interest/watch-model.ts +1 -1
- package/src/plugins/builtin/social-mentions/client.ts +2 -1
- package/src/plugins/builtin/supply-chain/client.ts +1 -1
- package/src/plugins/builtin/supply-chain/evidence.ts +1 -1
- package/src/plugins/builtin/supply-chain/graph-pane.tsx +2 -1
- package/src/plugins/builtin/supply-chain/pane.tsx +2 -1
- package/src/plugins/builtin/ticker-detail/adr-pair/headless.ts +1 -1
- package/src/plugins/builtin/ticker-detail/adr-pair/model.ts +24 -4
- package/src/plugins/builtin/ticker-detail/adr-pair/tab.tsx +1 -1
- package/src/plugins/builtin/time-sales/client.ts +1 -0
- package/src/plugins/builtin/time-sales/pane.tsx +3 -2
- package/src/plugins/builtin/trace-bonds/client.ts +7 -4
- package/src/plugins/builtin/trace-bonds/index.tsx +1 -1
- package/src/plugins/builtin/vol-surface/client.ts +2 -1
- package/src/plugins/builtin/volatility/client.ts +6 -1
- package/src/plugins/builtin/volatility/headless.ts +0 -1
- package/src/plugins/builtin/yield-curve/curves.ts +15 -0
- package/src/plugins/builtin/yield-curve/headless.ts +9 -2
- package/src/plugins/builtin/yield-curve/index.tsx +5 -8
- package/src/plugins/host-modules.ts +22 -3
- package/src/plugins/host-smoke.ts +6 -3
- package/src/portfolio/collection-name.ts +19 -0
- package/src/portfolio/column-values.ts +76 -10
- package/src/renderers/browser/http-proxy-transport.ts +78 -8
- package/src/renderers/cloudflare/http-proxy.ts +13 -2
- package/src/renderers/cloudflare/proxy-session.ts +47 -24
- package/src/renderers/cloudflare/worker.ts +15 -2
- package/src/renderers/desktop/geometry.ts +279 -0
- package/src/renderers/desktop/screen-setup.ts +246 -0
- package/src/renderers/desktop/sequential-window-host.ts +179 -0
- package/src/renderers/desktop/test-utils.ts +71 -0
- package/src/renderers/desktop/window-controller.ts +433 -0
- package/src/renderers/desktop/window-host.ts +70 -0
- package/src/renderers/desktop/window-layouts.ts +630 -0
- package/src/renderers/dom/data-frames.ts +15 -4
- package/src/renderers/dom/host/box.tsx +204 -176
- package/src/renderers/dom/host/style.ts +49 -20
- package/src/renderers/dom/host/text.tsx +3 -2
- package/src/renderers/electrobun/bun/application-menu/click.ts +1 -0
- package/src/renderers/electrobun/bun/application-menu/index.ts +4 -1
- package/src/renderers/electrobun/bun/desktop/backend-requests.ts +19 -8
- package/src/renderers/electrobun/bun/desktop/backend.ts +322 -19
- package/src/renderers/electrobun/bun/desktop/detached-windows.ts +83 -61
- package/src/renderers/electrobun/bun/desktop/host-requests.ts +29 -15
- package/src/renderers/electrobun/bun/desktop/initialization.ts +30 -11
- package/src/renderers/electrobun/bun/desktop/relaunch.ts +9 -1
- package/src/renderers/electrobun/bun/desktop/screen-setup-file.ts +55 -0
- package/src/renderers/electrobun/bun/desktop/state-broadcaster.ts +44 -8
- package/src/renderers/electrobun/bun/desktop/windows-script.ts +9 -6
- package/src/renderers/electrobun/bun/desktop/workspace/index.ts +298 -97
- package/src/renderers/electrobun/bun/desktop/workspace/requests.ts +44 -6
- package/src/renderers/electrobun/bun/index.ts +4 -97
- package/src/renderers/electrobun/bun/window/electrobun-window-host.ts +306 -0
- package/src/renderers/electrobun/bun/window/focus.ts +0 -25
- package/src/renderers/electrobun/bun/window/remembered-frame.ts +4 -82
- package/src/renderers/electrobun/bun/window/windows-native.ts +26 -1
- package/src/renderers/electrobun/shared/protocol.ts +50 -2
- package/src/renderers/electrobun/view/backend-rpc.ts +15 -0
- package/src/renderers/electrobun/view/desktop/window/bridge.ts +63 -3
- package/src/renderers/electrobun/view/main.tsx +13 -7
- package/src/renderers/electrobun/view/ui-host.tsx +7 -0
- package/src/renderers/electrobun/view/window-fullscreen.ts +10 -3
- package/src/series/fred-argument.ts +17 -0
- package/src/sources/provider-router/financial-routes.ts +7 -1
- package/src/sources/provider-router/index.ts +7 -1
- package/src/state/app/context/index.tsx +16 -2
- package/src/state/desktop-windows.ts +63 -0
- package/src/sync/other-window-tabs.ts +62 -0
- package/src/tickers/company-name-listing.ts +23 -3
- package/src/tickers/listing-fate.ts +147 -1
- package/src/tickers/terminal-codes.ts +5 -0
- package/src/time-series/price-units.ts +11 -0
- package/src/time-series/types.ts +6 -0
- package/src/types/config.ts +10 -1
- package/src/types/desktop-window.ts +71 -2
- package/src/types/financials.ts +4 -0
- package/src/types/headless.ts +19 -0
- package/src/types/plugin.ts +6 -0
- package/src/ui/host.tsx +2 -0
- package/src/ui/index.tsx +14 -13
- package/src/ui/same-props.ts +58 -0
- package/src/utils/cli-output.ts +33 -4
- package/src/utils/currency-names.ts +20 -0
- package/src/utils/currency-pair.ts +6 -0
- package/src/utils/exchange-rate-snapshot.ts +20 -2
- package/src/utils/format.ts +7 -2
- package/src/utils/futures-generic.ts +12 -0
- package/src/utils/fx-market-hours.ts +43 -0
- package/src/utils/http-proxy-upstream.ts +6 -2
- package/src/utils/plugin-proxy-hosts.json +0 -4
- package/src/utils/plugin-proxy-hosts.ts +22 -0
- package/src/utils/sec-filings.ts +7 -1
|
@@ -10,7 +10,7 @@ import type {
|
|
|
10
10
|
} from "./model/types";
|
|
11
11
|
import { dropColumnsToFit } from "../../../components/ui/table-layout";
|
|
12
12
|
import type { SortDirection } from "../../../utils/sort-values";
|
|
13
|
-
import { LIST_TIER_ORDER, metricNumber, sourceDetailEntries, textOrNull, tickerSymbol } from "./format";
|
|
13
|
+
import { LIST_TIER_ORDER, listingKey, metricNumber, sourceDetailEntries, textOrNull, tickerSymbol } from "./format";
|
|
14
14
|
|
|
15
15
|
export const tabs: Array<{ label: string; value: BuildoutTabId }> = [
|
|
16
16
|
{ label: "Themes", value: "themes" },
|
|
@@ -31,8 +31,12 @@ const listColumns: BuildoutColumn[] = [
|
|
|
31
31
|
|
|
32
32
|
const favoriteColumn: BuildoutColumn = { id: "favorite", label: "", width: 2, align: "left" };
|
|
33
33
|
|
|
34
|
+
/** A ticker chip takes its own column, as in every ticker and name table; the name takes the spare width. */
|
|
35
|
+
const tickerColumn: BuildoutColumn = { id: "ticker", label: "Ticker", width: 12, align: "left" };
|
|
36
|
+
|
|
34
37
|
const companyColumns: BuildoutColumn[] = [
|
|
35
|
-
|
|
38
|
+
tickerColumn,
|
|
39
|
+
{ id: "company", label: "Company", width: 16, align: "left", flexGrow: 2 },
|
|
36
40
|
{ id: "description", label: "Description", width: 34, align: "left", flexGrow: 2 },
|
|
37
41
|
{ id: "sectorTech", label: "Sector & Tech", width: 26, align: "left", flexGrow: 1 },
|
|
38
42
|
{ id: "criticality", label: "Criticality", width: 12, align: "left" },
|
|
@@ -49,7 +53,8 @@ const companyColumns: BuildoutColumn[] = [
|
|
|
49
53
|
|
|
50
54
|
/** A theme's companies under its board: what each does in the theme, then the figures. */
|
|
51
55
|
const themeCompanyColumns: BuildoutColumn[] = [
|
|
52
|
-
|
|
56
|
+
tickerColumn,
|
|
57
|
+
{ id: "company", label: "Company", width: 16, align: "left", flexGrow: 2 },
|
|
53
58
|
{ id: "listRole", label: "Role", width: 15, align: "left" },
|
|
54
59
|
{ id: "listTier", label: "Tier", width: 9, align: "left" },
|
|
55
60
|
{ id: "marketCap", label: "Mkt Cap", width: 10, align: "right" },
|
|
@@ -280,6 +285,8 @@ function sortValue(row: BuildoutRow, columnId: BuildoutColumnId): SortComparable
|
|
|
280
285
|
switch (columnId) {
|
|
281
286
|
case "favorite":
|
|
282
287
|
return numberSort(company.starred ? 1 : 0);
|
|
288
|
+
case "ticker":
|
|
289
|
+
return stringSort(listingKey(company.ticker, company.exchange) ?? tickerSymbol(company.ticker));
|
|
283
290
|
case "company":
|
|
284
291
|
return stringSort(company.name);
|
|
285
292
|
case "description":
|
|
@@ -397,7 +404,8 @@ export function defaultSortDirection(columnId: BuildoutColumnId | null): SortDir
|
|
|
397
404
|
export function rowTickerSymbols(row: BuildoutRow): string[] {
|
|
398
405
|
switch (row.kind) {
|
|
399
406
|
case "company":
|
|
400
|
-
return [
|
|
407
|
+
return [listingKey(row.item.ticker, row.item.exchange) ?? tickerSymbol(row.item.ticker)]
|
|
408
|
+
.filter((symbol): symbol is string => symbol != null);
|
|
401
409
|
case "site":
|
|
402
410
|
return [
|
|
403
411
|
tickerSymbol(row.item.ownerTicker),
|
|
@@ -32,7 +32,7 @@ function screenshotEvidence(paneId: string): PaneScreenshotEvidenceHook<Catalyst
|
|
|
32
32
|
const payload = validateCatalysts(value.payload as unknown as CatalystResponse);
|
|
33
33
|
if (value.rowIds.some((id) => !payload.events.some((event) => event.id === id)) || value.plottedValueCount !== value.rowIds.length) return null;
|
|
34
34
|
return value as unknown as CatalystEvidence;
|
|
35
|
-
} catch { return null; }
|
|
35
|
+
} catch { /* Intentional ignore: invalid captured observations are rejected as evidence by returning null. */ return null; }
|
|
36
36
|
},
|
|
37
37
|
mismatches(evidence, { resolved, payload }) {
|
|
38
38
|
const snapshot = payload.config.layout.instances.find((pane) => pane.instanceId === payload.paneId)?.settings?.catalystSnapshot;
|
|
@@ -18,6 +18,7 @@ import { CLOUD_PLAN_KEY, useCloudUpgradeAction } from "../shared/cloud-upgrade";
|
|
|
18
18
|
import { useOpenDescription } from "../shared/open-description";
|
|
19
19
|
import { Blurred, LockedOverlay, UpgradeLabel } from "../shared/locked-rows";
|
|
20
20
|
import { listingCell, toneColor } from "../shared/research-cells";
|
|
21
|
+
import { logFailure } from "../../../utils/log-failure";
|
|
21
22
|
import { isCloudSessionRequired, useResearchCloudSession } from "../shared/research-cloud-session";
|
|
22
23
|
import { loadCatalystDetail, loadCatalysts, validateCatalysts } from "./client";
|
|
23
24
|
import { CatalystEventDetail } from "./detail";
|
|
@@ -65,7 +66,7 @@ export function CatalystView({ width, height, focused, symbol, litigation = fals
|
|
|
65
66
|
const [selectedId, setSelectedId] = usePluginPaneState<string | null>("catalyst:selected", null);
|
|
66
67
|
const [searchActive, setSearchActive] = useState(false);
|
|
67
68
|
const [dateFieldActive, setDateFieldActive] = useState<string | null>(null);
|
|
68
|
-
const snapshot = useMemo(() => { try { return snapshotSetting ? validateCatalysts(snapshotSetting) : null; } catch { return null; } }, [snapshotSetting]);
|
|
69
|
+
const snapshot = useMemo(() => { try { return snapshotSetting ? validateCatalysts(snapshotSetting) : null; } catch (error) { return logFailure("catalysts.pane", "Validate catalysts snapshot failed", null)(error); } }, [snapshotSetting]);
|
|
69
70
|
const query = useMemo(() => catalystQuery({ ...filters, tab }, symbol ?? undefined, litigation), [filters, tab, symbol, litigation]);
|
|
70
71
|
const loader = useCallback(async ({ offset, signal, force }: PageRequest) => {
|
|
71
72
|
const result = snapshot ? { payload: snapshot, stale: false, refreshError: null } : await loadCatalysts({ ...query, limit: 100, offset }, accessKey, force, signal);
|
|
@@ -375,6 +375,7 @@ export function createCdsHeadless(
|
|
|
375
375
|
description: "Days of a named issuer's daily 5Y levels, the report's Daily section (fn CDS F --csv --section daily).",
|
|
376
376
|
},
|
|
377
377
|
],
|
|
378
|
+
discovery: { aliases: ["CDS", "CDSW"] },
|
|
378
379
|
describe: (args) => typeof args.argument === "string" ? `CDS | ${args.argument}` : "Single-Name CDS",
|
|
379
380
|
async load(args, ctx) {
|
|
380
381
|
const issuer = typeof args.argument === "string" ? args.argument : null;
|
|
@@ -21,7 +21,7 @@ export const cdsModule: PluginModule = {
|
|
|
21
21
|
label: "Single-Name CDS",
|
|
22
22
|
description: "Single-name corporate CDS from DTCC public dissemination: with no argument, the issuers traded in the last 5 days with their 5Y spread and its 1W and 1M moves (in points upfront past 2,000bp), ranked by any column (fn CDS --sort 1m); with a ticker or issuer, its 5Y spread history, trades and daily levels (fn CDS F --csv --section daily exports them).",
|
|
23
23
|
keywords: ["cds", "credit", "default", "swap", "spread", "single name", "issuer", "dtcc", "protection"],
|
|
24
|
-
shortcut: { prefix: "CDS", argPlaceholder: "ticker", argKind: "ticker", argOptional: true },
|
|
24
|
+
shortcut: { prefix: "CDS", aliases: ["CDSW"], argPlaceholder: "ticker", argKind: "ticker", argOptional: true, focusedIssuer: true },
|
|
25
25
|
headless: cdsHeadless,
|
|
26
26
|
createInstance: (_context, options) => {
|
|
27
27
|
const symbol = explicitSymbol(options);
|
|
@@ -37,7 +37,7 @@ import { futuresSessionOpenMinute } from "../../../market-data/market/trading-se
|
|
|
37
37
|
import { isAlwaysOpenExchange, isRegularSessionTime } from "../../../market-data/market/freshness";
|
|
38
38
|
import { isRoundTheClockCoin } from "../../../utils/crypto-pair";
|
|
39
39
|
import { isCurrencyPairListing } from "../../../utils/fx-market-hours";
|
|
40
|
-
import { cleanFloat32Price } from "../../../cli/history-rows";
|
|
40
|
+
import { cleanFloat32Price, historyPriceDecimals } from "../../../cli/history-rows";
|
|
41
41
|
import { parseChartSpec } from "./chart-spec";
|
|
42
42
|
import { paneSchemas } from "./headless-schema";
|
|
43
43
|
import { barHistoryFreshness, DAILY_CLOSES, REPORTED_DATA } from "../shared/report-freshness";
|
|
@@ -533,6 +533,43 @@ function tradedBars(series: HeadlessSeries): HeadlessSeries {
|
|
|
533
533
|
};
|
|
534
534
|
}
|
|
535
535
|
|
|
536
|
+
/** The significant digits an exported bar price keeps however few decimals its series needs, as `formatSignificant` shows a small value. */
|
|
537
|
+
const PRICE_SIGNIFICANT_FLOOR = 4;
|
|
538
|
+
|
|
539
|
+
/**
|
|
540
|
+
* A chart's bars at the series' own precision: each price the decimal the
|
|
541
|
+
* feed's float stands for (113.045, not 113.044998), then all of them to the
|
|
542
|
+
* decimals nine in ten need (historyPriceDecimals), so a bar from a finer
|
|
543
|
+
* source reads as the rest do: USDJPY=X's 154.19901 among three-decimal bars
|
|
544
|
+
* is 154.199. A price those decimals would leave with fewer than four
|
|
545
|
+
* significant digits keeps four, so a reverse-split penny stock adjusted up to
|
|
546
|
+
* 50,000 still writes its 0.00421875 as 0.004219, never 0. A `value` that is
|
|
547
|
+
* no close (a transform) keeps its digits.
|
|
548
|
+
*/
|
|
549
|
+
function barsAtSeriesPrecision(series: HeadlessSeries): HeadlessSeries {
|
|
550
|
+
if (!series.points.some((point) => point.close != null)) return series;
|
|
551
|
+
const valueIsClose = series.points.every((point) => point.value == null || point.value === point.close);
|
|
552
|
+
const clean = (price: number | null | undefined) => price == null || !Number.isFinite(price) ? price : cleanFloat32Price(price);
|
|
553
|
+
const decimals = historyPriceDecimals(series.points.map((point) => ({
|
|
554
|
+
open: clean(point.open) ?? null, high: clean(point.high) ?? null, low: clean(point.low) ?? null, close: clean(point.close) ?? null,
|
|
555
|
+
})));
|
|
556
|
+
const round = (price: number | null | undefined) => {
|
|
557
|
+
const cleaned = clean(price);
|
|
558
|
+
if (cleaned == null || !Number.isFinite(cleaned) || cleaned === 0) return cleaned;
|
|
559
|
+
const floorDecimals = PRICE_SIGNIFICANT_FLOOR - 1 - Math.floor(Math.log10(Math.abs(cleaned)));
|
|
560
|
+
return floorDecimals > decimals ? Number(cleaned.toPrecision(PRICE_SIGNIFICANT_FLOOR)) : Number(cleaned.toFixed(decimals));
|
|
561
|
+
};
|
|
562
|
+
return {
|
|
563
|
+
...series,
|
|
564
|
+
points: series.points.map((point) => {
|
|
565
|
+
const bar = { ...point };
|
|
566
|
+
for (const field of ["open", "high", "low", "close"] as const) if (point[field] !== undefined) bar[field] = round(point[field]);
|
|
567
|
+
if (point.value != null && valueIsClose) bar.value = bar.close;
|
|
568
|
+
return bar;
|
|
569
|
+
}),
|
|
570
|
+
};
|
|
571
|
+
}
|
|
572
|
+
|
|
536
573
|
/** What a chart series was asked as: a listing as typed (`USDZAR=X`, `SAN:EPA`), a FRED series by its ID. */
|
|
537
574
|
function askedSymbol(source: ChartSeriesSource): string {
|
|
538
575
|
switch (source.kind) {
|
|
@@ -830,6 +867,8 @@ export function chartHeadless(template: keyof typeof paneSchemas): HeadlessPaneD
|
|
|
830
867
|
const interval = servedInterval(series as HeadlessSeries & Pick<ResolvedSeries, "historyResolution" | "barSize" | "nativeFrequency">);
|
|
831
868
|
return { ...series, ...(symbol ? { symbol } : {}), ...(interval ? { interval } : {}) };
|
|
832
869
|
});
|
|
870
|
+
// GIP keeps each intraday print as traded (a sub-penny 86.3775); a chart's bars read at the series' precision.
|
|
871
|
+
if (template !== "graph-intraday-price-pane") model.series = model.series.map(barsAtSeriesPrecision);
|
|
833
872
|
if (template === "graph-intraday-price-pane") {
|
|
834
873
|
model.series = model.series.map(tradedBars);
|
|
835
874
|
const regular = regularSessionNotice(intradayHistories.map((window) => ({ ...window, exchange: listingExchange(window.symbol, window.exchange) })));
|
|
@@ -188,6 +188,8 @@ export function createGloomberbCloudPlugin(): GloomPlugin {
|
|
|
188
188
|
description: "Free market, macro, and chat services. Chat requires signup.",
|
|
189
189
|
toggleable: true,
|
|
190
190
|
order: 10,
|
|
191
|
+
// TheBuildout's panes read its API directly.
|
|
192
|
+
hosts: ["api.thebuildout.ai"],
|
|
191
193
|
modules: [
|
|
192
194
|
createCloudDataModule(),
|
|
193
195
|
chatModule,
|
|
@@ -3,12 +3,21 @@ import { apiClient } from "../../../api-client";
|
|
|
3
3
|
import { t, tf } from "../../../i18n";
|
|
4
4
|
import { useAppLanguage } from "../../../i18n/react";
|
|
5
5
|
import { Button } from "../../../components/ui/button";
|
|
6
|
-
import { DelayedMark } from "../../../components/ui/delayed-mark";
|
|
6
|
+
import { DelayedMark, delayedMarkWidth } from "../../../components/ui/delayed-mark";
|
|
7
7
|
import { Box, useCommandBarShortcut, useUiCapabilities } from "../../../ui";
|
|
8
8
|
import { chatController, type ChatController } from "../chat/controller";
|
|
9
9
|
import { useCloudPlanAction, useCloudUpgradeAction } from "../shared/cloud-upgrade";
|
|
10
10
|
import { CLOUD_QUOTE_DELAY_MINUTES, resolvePlanAccess } from "../../../api-client/plan-access";
|
|
11
11
|
import { useTrialOfferShowing } from "./trial-offer-status-widget";
|
|
12
|
+
import {
|
|
13
|
+
STATUS_WIDGET_COLUMNS,
|
|
14
|
+
useOtherStatusWidgetClaims,
|
|
15
|
+
useStatusWidgetClaim,
|
|
16
|
+
useStatusWidgetRoom,
|
|
17
|
+
} from "../../../components/layout/status-widget-space";
|
|
18
|
+
import { displayWidth } from "../../../utils/format";
|
|
19
|
+
|
|
20
|
+
const CLAIM_ID = "cloud-upgrade";
|
|
12
21
|
|
|
13
22
|
interface CloudUpgradeStatusWidgetProps {
|
|
14
23
|
controller?: Pick<ChatController, "getSnapshot" | "subscribe">;
|
|
@@ -29,6 +38,22 @@ export function CloudUpgradeStatusWidget({ controller = chatController }: CloudU
|
|
|
29
38
|
// The status bar takes no keyboard focus; the chip names the command instead.
|
|
30
39
|
const commandBarKey = useCommandBarShortcut();
|
|
31
40
|
const [access, setAccess] = useState(() => resolvePlanAccess(apiClient.getCurrentUser()));
|
|
41
|
+
// The bar holds back its usual columns for the widgets' own text, which
|
|
42
|
+
// this one shares with the chat's sign-in: half of them are its own. The
|
|
43
|
+
// label never shrinks into Feedback beside it: "delayed data · upgrade"
|
|
44
|
+
// where the row has room for what the mark and "upgrade" draw past that
|
|
45
|
+
// half and the words before it, else "upgrade". What it draws past the
|
|
46
|
+
// usual columns is claimed, so the version chip gives way to it.
|
|
47
|
+
const room = useStatusWidgetRoom();
|
|
48
|
+
const othersClaimed = useOtherStatusWidgetClaims(CLAIM_ID);
|
|
49
|
+
const free = !access.isTrialActive && !access.hasProAccess && !offerShowing;
|
|
50
|
+
const longLabel = t("delayed data · upgrade");
|
|
51
|
+
const shortLabel = t("upgrade");
|
|
52
|
+
const overflow = Math.max(0, delayedMarkWidth(CLOUD_QUOTE_DELAY_MINUTES, false) + 1 + displayWidth(shortLabel) + 1
|
|
53
|
+
- STATUS_WIDGET_COLUMNS / 2);
|
|
54
|
+
const extra = displayWidth(longLabel) - displayWidth(shortLabel);
|
|
55
|
+
const long = nativePaneChrome || room - STATUS_WIDGET_COLUMNS - othersClaimed >= overflow + extra;
|
|
56
|
+
useStatusWidgetClaim(CLAIM_ID, free && !nativePaneChrome ? long ? extra : overflow : 0);
|
|
32
57
|
|
|
33
58
|
useEffect(
|
|
34
59
|
// The chat widget already drives session refreshes; this only follows them.
|
|
@@ -52,11 +77,11 @@ export function CloudUpgradeStatusWidget({ controller = chatController }: CloudU
|
|
|
52
77
|
|
|
53
78
|
const mark = <DelayedMark minutes={CLOUD_QUOTE_DELAY_MINUTES} />;
|
|
54
79
|
return (
|
|
55
|
-
<Box flexDirection="row" alignItems="center" gap={1} paddingRight={offerShowing || !nativePaneChrome ? 1 : 0} data-gloom-role="delayed-status">
|
|
80
|
+
<Box flexDirection="row" alignItems="center" gap={1} flexShrink={0} paddingRight={offerShowing || !nativePaneChrome ? 1 : 0} data-gloom-role="delayed-status">
|
|
56
81
|
{mark}
|
|
57
82
|
{offerShowing ? null : (
|
|
58
83
|
<Button
|
|
59
|
-
label={
|
|
84
|
+
label={long ? longLabel : shortLabel}
|
|
60
85
|
title={tf("Upgrade to Pro ({key}, then {command})", { key: commandBarKey, command: "UPGRADE" })}
|
|
61
86
|
variant="plain"
|
|
62
87
|
compact
|
|
@@ -49,6 +49,7 @@ import {
|
|
|
49
49
|
} from "./model";
|
|
50
50
|
import { useAutoRefresh } from "../../../react/auto-refresh";
|
|
51
51
|
import { usePaneStatusLinkFooter } from "../../../components/layout/pane/status-footer";
|
|
52
|
+
import { logFailure } from "../../../utils/log-failure";
|
|
52
53
|
|
|
53
54
|
function isAuthError(error: string | null): boolean {
|
|
54
55
|
return !!error && /unauthorized|verification/i.test(error);
|
|
@@ -301,7 +302,7 @@ function useTweetSearchData(
|
|
|
301
302
|
});
|
|
302
303
|
})
|
|
303
304
|
// The tweets on screen are still the answer; the next cycle tries again.
|
|
304
|
-
.catch((
|
|
305
|
+
.catch(logFailure("cloud-tweets.table", "Refresh latest tweets failed"));
|
|
305
306
|
}, [enabled, load, requestKey]);
|
|
306
307
|
const fetchedAt = state.data ? cachedTweetResult(requestKey)?.fetchedAt ?? null : null;
|
|
307
308
|
useAutoRefresh(fetchedAt, refreshLatest, { intervalMs: TWEET_REFRESH_MS });
|
|
@@ -378,7 +379,7 @@ export function TweetSearchTable({
|
|
|
378
379
|
content: (ctx: PromptContext<string>) => (
|
|
379
380
|
<ChoiceDialog {...ctx} title="Open from this tweet" choices={selectedLinks.map(tweetLinkChoice)} />
|
|
380
381
|
),
|
|
381
|
-
}).catch((
|
|
382
|
+
}).catch(logFailure("cloud-tweets.table", "Open tweet links prompt failed"));
|
|
382
383
|
const link = choice === undefined ? undefined : selectedLinks[Number(choice)];
|
|
383
384
|
if (!link) return;
|
|
384
385
|
if (link.kind === "ticker") openTicker(link.symbol);
|
|
@@ -9,6 +9,7 @@ import type {
|
|
|
9
9
|
CommentLetterIssuer,
|
|
10
10
|
CommentLetterPage,
|
|
11
11
|
} from "./types";
|
|
12
|
+
import { logFailure } from "../../../utils/log-failure";
|
|
12
13
|
|
|
13
14
|
const EFTS_URL = "https://efts.sec.gov/LATEST/search-index";
|
|
14
15
|
const FETCH_TIMEOUT_MS = 15_000;
|
|
@@ -324,7 +325,7 @@ export function createCommentLettersLoader(
|
|
|
324
325
|
}
|
|
325
326
|
const company = issuer ? await issuer : null;
|
|
326
327
|
if (company && offset === 0) {
|
|
327
|
-
const listed = await loadIssuerFilings(company.ticker, force).catch((
|
|
328
|
+
const listed = await loadIssuerFilings(company.ticker, force).catch(logFailure("comment-letters.client", "Load issuer filings for comment letters failed", null));
|
|
328
329
|
issuerFromCloud = !!listed?.complete;
|
|
329
330
|
if (listed?.complete) {
|
|
330
331
|
const rows = listed.filings
|
|
@@ -31,7 +31,7 @@ function validPeriod(period: KpiPeriod): boolean {
|
|
|
31
31
|
}
|
|
32
32
|
function validEvidence(evidence: KpiEvidence): boolean {
|
|
33
33
|
let safeUrl = false;
|
|
34
|
-
try { safeUrl = ["https:", "http:"].includes(new URL(evidence.url).protocol); } catch { /*
|
|
34
|
+
try { safeUrl = ["https:", "http:"].includes(new URL(evidence.url).protocol); } catch { /* Intentional ignore: evidence without a web link cannot be opened, so it fails validation. */ }
|
|
35
35
|
return !!evidence && text(evidence.id) && text(evidence.documentId) && text(evidence.sourceId)
|
|
36
36
|
&& sourceKinds.includes(evidence.sourceKind) && safeUrl && text(evidence.title) && instant(evidence.publishedAt)
|
|
37
37
|
&& text(evidence.country) && text(evidence.language) && text(evidence.quote) && evidence.quote.trim().length > 0
|
|
@@ -27,6 +27,7 @@ import { allGuidance, allObservations, basisLabel, changeText, changeTone, compa
|
|
|
27
27
|
import { PriceSparkline } from "../../../components/price-sparkline/view";
|
|
28
28
|
import type { PricePoint } from "../../../types/financials";
|
|
29
29
|
import { toneColor, withoutQuietColumns } from "../shared/research-cells";
|
|
30
|
+
import { logFailure } from "../../../utils/log-failure";
|
|
30
31
|
|
|
31
32
|
/** A locked placeholder, or with `note` the line above them saying what free shows and what Pro adds. */
|
|
32
33
|
type Item = { id: string; row: CompanyRow } | { id: string; row: null; note?: string };
|
|
@@ -92,7 +93,7 @@ function CompanyView({ symbol, exchange, name, mode, width, height, focused }: P
|
|
|
92
93
|
const accessKey = `${session.requestKey}:${access.hasProAccess ? "full" : "preview"}`;
|
|
93
94
|
const openUpgrade = useCloudUpgradeAction(mode === "kpis" ? "kpis" : "guide");
|
|
94
95
|
const [snapshotSetting] = usePaneSettingValue<CompanyDataset | null>("companySnapshot", null);
|
|
95
|
-
const snapshot = useMemo(() => { try { return snapshotSetting ? validateCompanyData(snapshotSetting) : null; } catch { return null; } }, [snapshotSetting]);
|
|
96
|
+
const snapshot = useMemo(() => { try { return snapshotSetting ? validateCompanyData(snapshotSetting) : null; } catch (error) { return logFailure("company-kpis.pane", "Validate company disclosures snapshot failed", null)(error); } }, [snapshotSetting]);
|
|
96
97
|
const loader = useCallback((force: boolean) => snapshot ? Promise.resolve({ payload: snapshot, stale: false, refreshError: null })
|
|
97
98
|
: loadCompanyData(mode, symbol!, accessKey, force, { exchange, name }), [mode, symbol, exchange, name, accessKey, snapshot]);
|
|
98
99
|
const resource = useAsyncResource(symbol ? loader : null, { initialData: () => symbol ? cachedCompanyData(mode, symbol, accessKey, { exchange, name }) : null, clearOnError: isAccessDenied });
|
|
@@ -6,6 +6,7 @@ import { isRecord } from "../../../utils/guards";
|
|
|
6
6
|
import { resolveIssuerListing } from "../shared/headless-market-data";
|
|
7
7
|
import { companyQuery, fetchCompanyData, validateCompanyData, type CompanyDataset, type CompanyMode } from "./client";
|
|
8
8
|
import { allGuidance, allObservations } from "./model";
|
|
9
|
+
import { logFailure } from "../../../utils/log-failure";
|
|
9
10
|
|
|
10
11
|
interface Evidence { kind: "company-disclosures"; version: 1; complete: boolean; plottedValueCount: number; payload: CompanyDataset; mode: CompanyMode; tab: string; rowIds: string[]; }
|
|
11
12
|
export function useCompanyEvidence(payload: CompanyDataset | null, mode: CompanyMode, tab: string, rowIds: string[]) {
|
|
@@ -20,7 +21,7 @@ function screenshotEvidence(mode: CompanyMode): PaneScreenshotEvidenceHook<Evide
|
|
|
20
21
|
const symbol = resolved.createOptions?.symbol ?? resolved.createOptions?.arg;
|
|
21
22
|
if (!symbol) throw new Error("A company disclosure screenshot requires a ticker");
|
|
22
23
|
// A bare symbol takes the saved listing's venue, as the pane does.
|
|
23
|
-
const saved = parsePublicTickerKey(symbol).exchange ? null : await context.store.loadTicker(symbol).catch((
|
|
24
|
+
const saved = parsePublicTickerKey(symbol).exchange ? null : await context.store.loadTicker(symbol).catch(logFailure("company-kpis.screenshot-evidence", "Load saved ticker for disclosure capture failed", null));
|
|
24
25
|
const listing = await resolveIssuerListing(symbol, saved?.metadata.exchange, context.dataProvider);
|
|
25
26
|
const payload = await fetchCompanyData(mode, symbol, companyQuery(resolved.options), apiClient, listing);
|
|
26
27
|
// Keyed by the requested ticker: a listing abroad is answered under its bare symbol.
|
|
@@ -34,7 +35,7 @@ function screenshotEvidence(mode: CompanyMode): PaneScreenshotEvidenceHook<Evide
|
|
|
34
35
|
const rows = "series" in payload ? allObservations(payload) : allGuidance(payload);
|
|
35
36
|
if (value.plottedValueCount !== value.rowIds.length || value.rowIds.some((id) => !rows.some((row) => row.id === id))) return null;
|
|
36
37
|
return value as unknown as Evidence;
|
|
37
|
-
} catch { return null; }
|
|
38
|
+
} catch { /* Intentional ignore: invalid captured observations are rejected as evidence by returning null. */ return null; }
|
|
38
39
|
},
|
|
39
40
|
mismatches(evidence, { resolved, payload }) {
|
|
40
41
|
const snapshot = payload.config.layout.instances.find((entry) => entry.instanceId === payload.paneId)?.settings?.companySnapshot;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { HeadlessPaneDefinition } from "../../../types/headless";
|
|
2
2
|
import type { TimeRange } from "../../../time-series/range";
|
|
3
|
-
import { formatNumber, formatSignificant } from "../../../utils/format";
|
|
3
|
+
import { formatNumber, formatSignificant, significantDecimals } from "../../../utils/format";
|
|
4
4
|
import { logFailure } from "../../../utils/log-failure";
|
|
5
5
|
import { mixedSessionCloseNote } from "../../../market-data/market/session-close-note";
|
|
6
6
|
import { resolveHeadlessInstrument, loadHeadlessSymbols } from "../shared/headless-market-data";
|
|
@@ -124,7 +124,8 @@ export const relationshipHeadless: HeadlessPaneDefinition<"series"> = {
|
|
|
124
124
|
return {
|
|
125
125
|
symbols,
|
|
126
126
|
series: [
|
|
127
|
-
|
|
127
|
+
// The latest ratio reads as Statistics reads it, to four significant digits (1.123, 0.8904), not every float digit.
|
|
128
|
+
{ id: "ratio", label: `${symbols[0]}/${symbols[1]}`, ...analysis.latestRatio != null ? { textDecimals: significantDecimals(analysis.latestRatio) } : {}, points: analysis.ratioPoints.map(({ date, close }) => ({ date: date.toISOString(), value: close })) },
|
|
128
129
|
{ id: "correlation", label: `Rolling correlation (${correlationWindow})`, textDecimals: 3, points: analysis.returns.slice(correlationWindow - 1).map(({ date }) => ({ date: date.toISOString(), value: correlations.get(date.getTime()) ?? null })) },
|
|
129
130
|
],
|
|
130
131
|
stats: [
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { CotClass, CotClassSummary, CotContractPayload, CotHistoryPoint } from "../../../api-client/cot";
|
|
2
2
|
import type { HeadlessPaneColumn, HeadlessPaneDefinition } from "../../../types/plugin";
|
|
3
3
|
import { fetchCotBoard, fetchCotContract } from "./client";
|
|
4
|
-
import { COT_CLASSES, COT_FAMILIES, COT_MAJOR_CODES, COT_POSITIONS, COT_SCOPES, cotClass, cotContractCode, cotContractUnitText, cotFamily, cotInteger, cotMarketName, cotPositions, cotPositionsText, cotProxyFor, cotProxyNote, cotScope, cotUnknownMarketMessage } from "./model";
|
|
4
|
+
import { COT_CLASSES, COT_FAMILIES, COT_MAJOR_CODES, COT_POSITIONS, COT_SCOPES, cotClass, cotContractCode, cotContractUnitText, cotFamily, cotInteger, cotMarketName, cotPositions, cotPositionsText, cotProxyFor, cotProxyNote, cotReleaseTime, cotScope, cotUnknownMarketMessage } from "./model";
|
|
5
5
|
import { COMMODITIES_VIEW_STATE } from "../commodities-energy/view-state";
|
|
6
6
|
import { REPORT_ROWS } from "../shared/headless-options";
|
|
7
7
|
|
|
@@ -12,6 +12,12 @@ const signed = (value: unknown) => cotInteger(typeof value === "number" ? value
|
|
|
12
12
|
const percent = (value: unknown) => typeof value === "number" ? `${value > 0 ? "+" : ""}${value.toFixed(1)}%` : "--";
|
|
13
13
|
const rank = (value: unknown) => typeof value === "number" ? value.toFixed(0) : "--";
|
|
14
14
|
|
|
15
|
+
/** The report's release, by the CFTC's schedule, for an export's publication time; nothing outside the schedule. */
|
|
16
|
+
function cotReleased(asOf: string | null) {
|
|
17
|
+
const publishedAt = cotReleaseTime(asOf);
|
|
18
|
+
return publishedAt ? { freshness: { publishedAt } } : {};
|
|
19
|
+
}
|
|
20
|
+
|
|
15
21
|
/** The pane's columns: percentiles as their rank value, net share of open interest to one decimal. */
|
|
16
22
|
function cotPositionRow(row: CotClassSummary) {
|
|
17
23
|
return { long: row.long, short: row.short, spreading: row.spreading, net: row.net,
|
|
@@ -83,7 +89,7 @@ export const cotHeadless: HeadlessPaneDefinition<"bundle"> = {
|
|
|
83
89
|
...Object.fromEntries(row.positions.map((position) => [`${camelClass(position.id)}Net`, position.net])) })) }],
|
|
84
90
|
// "jet fuel" reads heating oil's positions, and says so.
|
|
85
91
|
...(proxy ? { notes: [cotProxyNote(proxy)] } : {}),
|
|
86
|
-
errors: data.gaps, metadata: { ...data, complete: data.status === "available" } };
|
|
92
|
+
errors: data.gaps, metadata: { ...data, complete: data.status === "available" }, ...cotReleased(data.asOf) };
|
|
87
93
|
}
|
|
88
94
|
const traderClass = cotClass(family, args.options.traderClass);
|
|
89
95
|
if (args.options.traderClass && traderClass !== args.options.traderClass) throw new Error("Trader class does not belong to this report family");
|
|
@@ -94,6 +100,6 @@ export const cotHeadless: HeadlessPaneDefinition<"bundle"> = {
|
|
|
94
100
|
columns: [{ key: "marketName", header: "Market" }, { key: "contractCode", header: "Code" }, ...POSITION_COLUMNS,
|
|
95
101
|
{ key: "openInterest", header: "Open interest", align: "right", format: count }, { key: "reportDate", header: "As of" }],
|
|
96
102
|
rows: rows.map((row) => ({ contractCode: row.contractCode, marketName: cotMarketName(row.marketName), reportDate: row.reportDate, openInterest: row.openInterest, ...cotPositionRow(row.position) })) }],
|
|
97
|
-
errors: data.gaps, metadata: { ...data, scope, complete: data.status === "available" } };
|
|
103
|
+
errors: data.gaps, metadata: { ...data, scope, complete: data.status === "available" }, ...cotReleased(data.asOf) };
|
|
98
104
|
},
|
|
99
105
|
};
|
|
@@ -6,6 +6,7 @@ import { formatMarketPriceWithCurrency, formatPriceObservation } from "../../../
|
|
|
6
6
|
import { futuresPricePer } from "../../../market-data/futures-contract";
|
|
7
7
|
import { unitCurrencyToken } from "../../../time-series/price-units";
|
|
8
8
|
import { cleanFloat32Price } from "../../../cli/history-rows";
|
|
9
|
+
import { zonedWallClockToUtcMs } from "../../../utils/zoned-date-time";
|
|
9
10
|
import { cryptoPairCoin, isFuturesSymbol } from "../shared/crypto-pair";
|
|
10
11
|
import {
|
|
11
12
|
bestNameMatch, FUTURES_CONTRACTS, futuresBoardContract, futuresBoardContractForTicker, futuresContractByCode, futuresContractByName, type FuturesContract,
|
|
@@ -139,6 +140,14 @@ export type CotScope = typeof COT_SCOPES[number]["value"];
|
|
|
139
140
|
export function cotScope(value: unknown): CotScope { return value === "all" ? "all" : "major"; }
|
|
140
141
|
|
|
141
142
|
const rootAlias = (input: string) => ROOTS[input === "VIX" ? "VX" : input]?.code ?? null;
|
|
143
|
+
/** The CME currency futures by their currency's ISO code, as a reader of FX types them: JPY is 6J, the yen. */
|
|
144
|
+
const CURRENCY_FUTURES: Readonly<Record<string, string>> = {
|
|
145
|
+
EUR: "6E=F", JPY: "6J=F", GBP: "6B=F", CAD: "6C=F", AUD: "6A=F", CHF: "6S=F", MXN: "6M=F",
|
|
146
|
+
};
|
|
147
|
+
const currencyFuture = (input: string) => {
|
|
148
|
+
const symbol = CURRENCY_FUTURES[input];
|
|
149
|
+
return symbol ? Object.entries(PRICE_OVERLAYS).find(([, row]) => row.priceSymbol === symbol)?.[0] ?? null : null;
|
|
150
|
+
};
|
|
142
151
|
const marketCode = (input: string) => /^[0-9A-Z]{5}[0-9A-Z+]$/.test(input) ? input : null;
|
|
143
152
|
/**
|
|
144
153
|
* The FUT board row a typed argument names, by code, symbol or commodity name
|
|
@@ -154,7 +163,8 @@ function typedMarket(value: string): { board: FuturesContract } | { root: string
|
|
|
154
163
|
/**
|
|
155
164
|
* A CFTC code, root or commodity name typed as an argument or stored in a
|
|
156
165
|
* pane: every alias, crypto included, every FUT board root the CFTC reports,
|
|
157
|
-
*
|
|
166
|
+
* the names FUT finds them by (cocoa, coffee, sugar, gold, crude), and a
|
|
167
|
+
* currency's ISO code for its CME future (JPY, CHF, EUR). A typed
|
|
158
168
|
* root is always the future, so ZM here is soybean meal, never Zoom. A CFTC
|
|
159
169
|
* code is tried after the names, as one could be spelled with six letters
|
|
160
170
|
* (COFFEE, COPPER).
|
|
@@ -162,7 +172,7 @@ function typedMarket(value: string): { board: FuturesContract } | { root: string
|
|
|
162
172
|
export function cotContractCode(value: unknown): string | null {
|
|
163
173
|
if (typeof value !== "string") return null;
|
|
164
174
|
const input = value.trim().toUpperCase().replace(/=F$/, "");
|
|
165
|
-
const alias = rootAlias(input);
|
|
175
|
+
const alias = rootAlias(input) ?? currencyFuture(input);
|
|
166
176
|
if (alias) return alias;
|
|
167
177
|
const market = typedMarket(value);
|
|
168
178
|
if (market && "root" in market) return ROOTS[market.root]!.code;
|
|
@@ -199,7 +209,7 @@ export function cotProxyNote(proxy: { subject: string; root: string }): string {
|
|
|
199
209
|
/** The markets the unknown-market hint names, by the code and the word a newcomer knows them by. */
|
|
200
210
|
const SUGGESTED_MARKETS: ReadonlyArray<readonly [string, string]> = [
|
|
201
211
|
["ES", "S&P 500"], ["CL", "crude oil"], ["NG", "natural gas"], ["GC", "gold"], ["HG", "copper"],
|
|
202
|
-
["ZC", "corn"], ["CC", "cocoa"], ["KC", "coffee"], ["SB", "sugar"], ["ZN", "10-year note"],
|
|
212
|
+
["ZC", "corn"], ["CC", "cocoa"], ["KC", "coffee"], ["SB", "sugar"], ["ZN", "10-year note"], ["JPY", "yen"],
|
|
203
213
|
];
|
|
204
214
|
/**
|
|
205
215
|
* What a market `cotContractCode` does not know is told: a FUT board row the
|
|
@@ -230,6 +240,37 @@ export function cotContractCodeForTicker(ticker: unknown): string | null {
|
|
|
230
240
|
const board = futuresBoardContractForTicker(ticker);
|
|
231
241
|
return rootAlias(input) ?? (board ? boardMarketCode(board) : null) ?? marketCode(input);
|
|
232
242
|
}
|
|
243
|
+
/**
|
|
244
|
+
* The CFTC's published release schedule (cftc.gov, Commitments of Traders,
|
|
245
|
+
* Release Schedule, read 2026-11-01): 3:30 p.m. Eastern on the Friday after
|
|
246
|
+
* the Tuesday the positions are as of, or the day a federal holiday moved that
|
|
247
|
+
* Friday's release to. Years it has not published, and 2027 with its move to
|
|
248
|
+
* two releases a week, are left out rather than guessed.
|
|
249
|
+
*/
|
|
250
|
+
const COT_SCHEDULED_YEARS: ReadonlySet<number> = new Set([2026]);
|
|
251
|
+
const COT_DELAYED_RELEASES: Readonly<Record<string, string>> = {
|
|
252
|
+
"2026-01-02": "2026-01-05", "2026-06-19": "2026-06-22", "2026-07-03": "2026-07-06",
|
|
253
|
+
"2026-11-13": "2026-11-16", "2026-11-27": "2026-11-30", "2026-12-25": "2026-12-28",
|
|
254
|
+
};
|
|
255
|
+
const DAY_MS = 86_400_000;
|
|
256
|
+
/**
|
|
257
|
+
* When the CFTC released the report of positions as of `reportDate`, an ISO
|
|
258
|
+
* instant, by its schedule (`COT_SCHEDULED_YEARS`). Null for a date that is
|
|
259
|
+
* no Tuesday or a release outside the schedule, which an export then says was
|
|
260
|
+
* not published.
|
|
261
|
+
*/
|
|
262
|
+
export function cotReleaseTime(reportDate: string | null | undefined): string | null {
|
|
263
|
+
const match = /^(\d{4})-(\d{2})-(\d{2})$/.exec(reportDate ?? "");
|
|
264
|
+
if (!match) return null;
|
|
265
|
+
const tuesday = Date.UTC(Number(match[1]), Number(match[2]) - 1, Number(match[3]));
|
|
266
|
+
if (new Date(tuesday).getUTCDay() !== 2) return null;
|
|
267
|
+
const friday = new Date(tuesday + 3 * DAY_MS).toISOString().slice(0, 10);
|
|
268
|
+
const day = COT_DELAYED_RELEASES[friday] ?? friday;
|
|
269
|
+
const [year, month, date] = day.split("-").map(Number) as [number, number, number];
|
|
270
|
+
if (!COT_SCHEDULED_YEARS.has(year)) return null;
|
|
271
|
+
return new Date(zonedWallClockToUtcMs("America/New_York", year, month, date, 15, 30, 0)).toISOString();
|
|
272
|
+
}
|
|
273
|
+
|
|
233
274
|
/** The futures root a CFTC code belongs to, for titles readers recognize: a verified alias, else its FUT board root. */
|
|
234
275
|
export function cotRoot(code: string): string | null {
|
|
235
276
|
return Object.entries(ROOTS).find(([, row]) => row.code === code)?.[0]
|
|
@@ -22,7 +22,7 @@ const currency = (value: unknown) => value === null || (text(value) && /^[A-Z]{3
|
|
|
22
22
|
const day = (value: unknown): value is string => text(value) && /^\d{4}-\d{2}-\d{2}$/.test(value) && Number.isFinite(Date.parse(value)) && new Date(value).toISOString().slice(0, 10) === value;
|
|
23
23
|
const nullableDay = (value: unknown) => value === null || day(value);
|
|
24
24
|
const strings = (value: unknown): value is string[] => Array.isArray(value) && value.every(text);
|
|
25
|
-
const url = (value: unknown) => { try { return text(value) && ["https:", "http:"].includes(new URL(value).protocol); } catch { return false; } };
|
|
25
|
+
const url = (value: unknown) => { try { return text(value) && ["https:", "http:"].includes(new URL(value).protocol); } catch { /* Intentional ignore: malformed URLs fail this web link field validator. */ return false; } };
|
|
26
26
|
const unique = (rows: readonly { id: string }[]) => new Set(rows.map((row) => row.id)).size === rows.length;
|
|
27
27
|
function fact(row: CreditFact): boolean {
|
|
28
28
|
return !!row && [row.id, row.instrumentId, row.documentId, row.field, row.instrumentName, row.factKey, row.form, row.language].every(text)
|
|
@@ -45,7 +45,7 @@ export const creditScreenshotEvidence: PaneScreenshotEvidenceHook<CreditEvidence
|
|
|
45
45
|
const eligible = new Set(value.tab === "capital" ? payload.instruments.map((row) => row.id) : value.tab === "covenants" ? payload.covenants.map((row) => row.id) : value.tab === "screen" ? (screen?.rows ?? []).map(screenRowId) : payload.maturities.flatMap((row) => row.instruments.map((instrument) => `${row.year}:${instrument.id}`)));
|
|
46
46
|
if (new Set(value.rowIds).size !== value.rowIds.length || value.rowIds.some((id) => !eligible.has(id as string))) return null;
|
|
47
47
|
return value as unknown as CreditEvidence;
|
|
48
|
-
} catch { return null; }
|
|
48
|
+
} catch { /* Intentional ignore: invalid captured observations are rejected as evidence by returning null. */ return null; }
|
|
49
49
|
},
|
|
50
50
|
mismatches(evidence, { resolved, payload }) {
|
|
51
51
|
const settings = payload.config.layout.instances.find((entry) => entry.instanceId === payload.paneId)?.settings;
|
|
@@ -20,6 +20,7 @@ import { CreditInstrumentDetail } from "./detail";
|
|
|
20
20
|
import { useCreditEvidence } from "./evidence";
|
|
21
21
|
import { HeadroomGauge } from "./gauge";
|
|
22
22
|
import { capitalCell, capitalColumns, capitalFigures, comparatorSymbol, covenantColumns, covenantFact, covenantReason, covenantUsage, CREDIT_EMPTY_TITLE, creditEmptyCause, CREDIT_TABS, creditAmount, covenantNumber, creditCurrencies, creditMaturityRows, creditPercent, creditTab, fieldLabel, headroomTone, instrumentOutstanding, isClosed, maturityAxis, maturityColumns, maturitySeries, maturityShares, NO_VALUE, screenColumns, screenRowId, screenSignal, sentence } from "./model";
|
|
23
|
+
import { logFailure } from "../../../utils/log-failure";
|
|
23
24
|
|
|
24
25
|
type Row = { numbers?: Record<string, number | null>; id: string; values: Record<string, string>; instrumentId?: string; covenant?: CreditHeadroom; screen?: CreditScreenRow; year?: number; locked?: boolean; closed?: boolean };
|
|
25
26
|
const rowId = (row: Row) => row.id;
|
|
@@ -54,7 +55,7 @@ function CreditView({ symbol, width, height, focused, accessKey, needsVerificati
|
|
|
54
55
|
const [snapshotSetting] = usePaneSettingValue<CreditDocumentsPayload | null>("creditSnapshot", null);
|
|
55
56
|
const [screenSnapshot] = usePaneSettingValue<CreditScreenPayload | null>("creditScreenSnapshot", null);
|
|
56
57
|
const [instrumentSnapshot] = usePaneSettingValue<CreditInstrument | null>("creditInstrumentSnapshot", null);
|
|
57
|
-
const snapshot = useMemo(() => { try { return snapshotSetting ? validateCreditDocuments(snapshotSetting, symbol ? creditIssuerSymbol(symbol) : undefined) : null; } catch { return null; } }, [snapshotSetting, symbol]);
|
|
58
|
+
const snapshot = useMemo(() => { try { return snapshotSetting ? validateCreditDocuments(snapshotSetting, symbol ? creditIssuerSymbol(symbol) : undefined) : null; } catch (error) { return logFailure("credit-documents.pane", "Validate credit documents snapshot failed", null)(error); } }, [snapshotSetting, symbol]);
|
|
58
59
|
const loader = useCallback((force: boolean) => snapshot ? Promise.resolve({ payload: snapshot, stale: false, refreshError: null }) : loadCredit(symbol!, accessKey, force), [symbol, accessKey, snapshot]);
|
|
59
60
|
const resource = useAsyncResource(symbol ? loader : null, { initialData: () => symbol ? cachedCredit(symbol, accessKey) : null, clearOnError: isAccessDenied });
|
|
60
61
|
const data = resource.data?.payload ?? null;
|
|
@@ -295,15 +295,16 @@ export function CryptoBoardPane({ width, height, focused }: PaneProps) {
|
|
|
295
295
|
}, [stablecoins, supply]);
|
|
296
296
|
const supplyError = !supply && supplyResource.error ? supplyResource.error : null;
|
|
297
297
|
|
|
298
|
-
|
|
298
|
+
// Kept between quotes, so the tab strip skips the renders a board update gives the pane.
|
|
299
|
+
const tabItems = useMemo(() => CRYPTO_TABS.map((tab) => ({
|
|
299
300
|
label: tab.label,
|
|
300
301
|
value: tab.value,
|
|
301
|
-
}));
|
|
302
|
-
const selectTab = (value: string) => {
|
|
302
|
+
})), []);
|
|
303
|
+
const selectTab = useCallback((value: string) => {
|
|
303
304
|
setActiveTab(value as CryptoTab);
|
|
304
305
|
setSelectedId(null);
|
|
305
306
|
setVisibleRange(INITIAL_STREAM_RANGE);
|
|
306
|
-
};
|
|
307
|
+
}, [setActiveTab, setSelectedId]);
|
|
307
308
|
const { strip: tabStrip } = usePaneTabs({ tabs: tabItems, activeValue: activeTab, onSelect: selectTab, focused, compact: true, variant: "bare" });
|
|
308
309
|
|
|
309
310
|
usePaneNoticeFooter({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { HeadlessPaneDefinition } from "../../../types/plugin";
|
|
2
2
|
import { fetchDebtMaturities } from "./client";
|
|
3
|
-
import { bucketShare, debtAmount, debtNewestAsOf, debtNewestForm, debtNotices, debtPercent, newerQuarter } from "./model";
|
|
3
|
+
import { bucketShare, debtAmount, debtCostProxyNote, debtHistoryRows, debtNewestAsOf, debtNewestForm, debtNotices, debtPercent, newerQuarter } from "./model";
|
|
4
4
|
import { SEC_FILINGS } from "../shared/report-freshness";
|
|
5
5
|
import { resolveHeadlessIssuerListing } from "../shared/headless-market-data";
|
|
6
6
|
|
|
@@ -46,6 +46,7 @@ export const debtMaturitiesHeadless: HeadlessPaneDefinition<"bundle"> = {
|
|
|
46
46
|
const symbol = args.symbols[0]!;
|
|
47
47
|
const data = await fetchDebtMaturities(symbol, ctx.apiClient, await resolveHeadlessIssuerListing(ctx, symbol));
|
|
48
48
|
const quarter = newerQuarter(data);
|
|
49
|
+
const costNote = debtCostProxyNote(data.history);
|
|
49
50
|
return {
|
|
50
51
|
complete: data.status === "available",
|
|
51
52
|
errors: debtNotices(data),
|
|
@@ -111,12 +112,20 @@ export const debtMaturitiesHeadless: HeadlessPaneDefinition<"bundle"> = {
|
|
|
111
112
|
align: "right",
|
|
112
113
|
textFormat: percent,
|
|
113
114
|
},
|
|
115
|
+
{
|
|
116
|
+
// What the proxy divides: exports keep `filed` or `average-principal`, the text says it in words.
|
|
117
|
+
key: "borrowingCostBasis",
|
|
118
|
+
header: "Cost basis",
|
|
119
|
+
optional: true,
|
|
120
|
+
textFormat: (value) => value === "filed" ? "Filed" : value === "average-principal" ? "Avg principal" : "",
|
|
121
|
+
},
|
|
114
122
|
{ key: "currency", header: "Currency" },
|
|
115
123
|
{ key: "filed", header: "Filed" },
|
|
116
124
|
],
|
|
117
|
-
rows: data.history
|
|
125
|
+
rows: debtHistoryRows(data.history).map((row) => ({ ...row })),
|
|
118
126
|
},
|
|
119
127
|
],
|
|
128
|
+
...(costNote ? { notes: [costNote] } : {}),
|
|
120
129
|
metadata: { ...data },
|
|
121
130
|
// The latest filing dates the report (a newer 10-Q's balance date), named by its form so the date is
|
|
122
131
|
// not read as the schedule's; the history rows are past years, not stale data.
|