gloomberb 0.19.3 → 0.19.5
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 +4 -2
- package/src/api-client/errors.ts +8 -0
- package/src/api-client/index.ts +18 -0
- package/src/api-client/request.ts +295 -42
- package/src/api-client/socket.ts +95 -0
- package/src/app/keybindings/actions.ts +1 -1
- package/src/app/pane-runtime/index.tsx +1 -1
- package/src/app/pane-runtime/ticker-inspector-runtime.ts +1 -1
- package/src/app/pane-runtime/ticker-open-runtime.ts +1 -1
- package/src/app/pane-runtime/ticker-open-target.ts +12 -2
- package/src/cli/commands/command-utils.ts +4 -0
- package/src/cli/commands/market.ts +119 -27
- package/src/cli/commands/search.ts +1 -1
- package/src/cli/commands/ticker.ts +10 -6
- package/src/cli/currency-name-hint.ts +60 -0
- package/src/cli/desktop-pane-shot-api-policy.ts +10 -2
- package/src/cli/desktop-pane-shot.ts +2 -1
- package/src/cli/history-rows.ts +18 -1
- package/src/cli/known-gaps.ts +17 -2
- package/src/cli/not-a-ticker.ts +5 -3
- package/src/cli/pane-functions/catalog.ts +9 -1
- package/src/cli/pane-functions/headless.ts +7 -3
- package/src/cli/pane-functions/market-session.ts +6 -7
- package/src/cli/series-search.ts +4 -5
- package/src/components/chart/composite/panel-bitmap.ts +28 -2
- package/src/components/chart/composite/time-axis.ts +17 -2
- package/src/components/command-bar/action-runtime.ts +2 -0
- package/src/components/command-bar/commands/direct/runtime.ts +3 -3
- package/src/components/command-bar/helpers.ts +2 -0
- package/src/components/command-bar/list/model.ts +9 -0
- package/src/components/command-bar/pane-actions.ts +46 -35
- package/src/components/command-bar/pane-templates/workflow.ts +6 -0
- package/src/components/command-bar/panel/index.tsx +30 -3
- package/src/components/command-bar/panel/types.ts +7 -0
- package/src/components/command-bar/routes/root/results.ts +4 -4
- package/src/components/command-bar/routes/root/selection.ts +3 -2
- package/src/components/command-bar/routes/ticker-search/actions.ts +21 -16
- package/src/components/command-bar/routing/launch-request.ts +3 -2
- package/src/components/command-bar/routing/list-state.ts +4 -1
- package/src/components/command-bar/surface/index.tsx +15 -1
- package/src/components/layout/floating-pane.tsx +10 -0
- package/src/components/layout/pane/frame.tsx +6 -0
- package/src/components/layout/pane/header.tsx +244 -42
- package/src/components/layout/pane/index.tsx +20 -2
- package/src/components/layout/shell/active-drag.ts +160 -28
- package/src/components/layout/shell/drag/index.ts +99 -96
- package/src/components/layout/shell/drag/live.ts +3 -17
- package/src/components/layout/shell/drag/magnets.ts +304 -0
- package/src/components/layout/shell/drag/overlays.tsx +77 -75
- package/src/components/layout/shell/drag/runtime.ts +12 -7
- package/src/components/layout/shell/index.tsx +66 -32
- package/src/components/layout/shell/native/pointer-runtime.ts +7 -2
- package/src/components/layout/shell/native/surfaces.ts +1 -9
- package/src/components/layout/shell/native/window-state.ts +21 -25
- package/src/components/layout/shell/pane/layers.tsx +153 -24
- package/src/components/layout/shell/shortcuts.ts +4 -1
- package/src/components/layout/shell/terminal-pointer-runtime.ts +24 -1
- package/src/components/layout/shell/window-mode/overlays.tsx +14 -6
- package/src/components/layout/status-bar.tsx +75 -6
- package/src/components/layout/window-controls.tsx +96 -35
- package/src/components/layout/window-fullscreen.ts +20 -0
- package/src/components/quote-flash.ts +36 -32
- package/src/core/app-runtime.ts +4 -1
- package/src/core/connection-health.ts +76 -1
- package/src/core/state/app/command-bar-launch.ts +12 -0
- package/src/core/state/app/layout.ts +4 -3
- package/src/core/state/app/types.ts +4 -1
- package/src/data/config/layout.ts +2 -2
- package/src/data/config/store/fold-panes.ts +6 -1
- package/src/i18n/es.ts +8 -1
- package/src/i18n/ja.ts +8 -1
- package/src/i18n/ko.ts +8 -1
- package/src/i18n/zh-cn.ts +8 -1
- package/src/i18n/zh-tw.ts +8 -1
- package/src/layout/pane-follow.ts +3 -2
- package/src/layout/pane-layout-move.ts +2 -1
- package/src/layout/pane-manager/dock-stack.ts +38 -0
- package/src/layout/pane-manager/dock-tree.ts +76 -15
- package/src/layout/pane-manager/docking.ts +48 -6
- package/src/layout/pane-manager/floating-actions.ts +12 -3
- package/src/layout/pane-manager/floating-placement.ts +189 -0
- package/src/layout/pane-manager/floating.ts +23 -4
- package/src/layout/pane-manager/gridlock.ts +16 -4
- package/src/layout/pane-manager/hidden-panes.ts +30 -1
- package/src/layout/pane-manager/index.ts +2 -0
- package/src/layout/pane-manager/layout-state.ts +17 -0
- package/src/layout/pane-manager/types.ts +4 -1
- package/src/layout/ticker-retarget.ts +88 -0
- package/src/layout-marketplace/cloud.ts +9 -1
- package/src/market-data/connection-follow.ts +68 -0
- package/src/market-data/coordinator/entries.ts +15 -3
- package/src/market-data/coordinator/events.ts +17 -1
- package/src/market-data/coordinator/financials.ts +20 -7
- package/src/market-data/coordinator/index.ts +217 -4
- package/src/market-data/coordinator/quotes.ts +10 -0
- 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/hooks.tsx +43 -3
- package/src/market-data/performance.ts +78 -9
- package/src/market-data/request-types.ts +6 -3
- package/src/news/aggregator.ts +12 -1
- 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/math.ts +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/company/pane.tsx +2 -1
- package/src/plugins/builtin/buildout/model/index.ts +6 -0
- package/src/plugins/builtin/buildout/pane/index.tsx +2 -1
- package/src/plugins/builtin/catalysts/evidence.ts +1 -1
- package/src/plugins/builtin/catalysts/pane.tsx +2 -1
- package/src/plugins/builtin/chart-composer/headless.ts +40 -1
- package/src/plugins/builtin/chart-composer/index.tsx +13 -0
- package/src/plugins/builtin/chat/controller/index.ts +10 -3
- package/src/plugins/builtin/chat/controller/session-runtime.ts +9 -2
- package/src/plugins/builtin/chat/status-widget.tsx +3 -1
- 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/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/earnings-calls/pane.tsx +1 -1
- package/src/plugins/builtin/earnings-ripple/index.tsx +6 -1
- package/src/plugins/builtin/econ/calendar-model.ts +2 -0
- package/src/plugins/builtin/econ/fred-catalog.ts +5 -5
- package/src/plugins/builtin/econ/print-watch.ts +3 -1
- package/src/plugins/builtin/futures/series.ts +16 -1
- 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 +3 -2
- 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/market-heatmap/index.tsx +2 -1
- package/src/plugins/builtin/members/client.ts +1 -1
- package/src/plugins/builtin/mna/distress/client.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/portfolio-list/cli/watchlist-command.ts +2 -1
- 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/research/analyst-model.ts +1 -0
- package/src/plugins/builtin/research/equity-diagnostic-pane.tsx +2 -1
- 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/index.tsx +7 -4
- package/src/plugins/builtin/sec/row-summaries.ts +28 -12
- package/src/plugins/builtin/sectors/client.ts +18 -8
- package/src/plugins/builtin/sectors/index.tsx +19 -5
- package/src/plugins/builtin/short-interest/watch-client.ts +2 -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/ticker-detail/overview/pane.tsx +4 -1
- package/src/plugins/builtin/ticker-detail/overview-tab.tsx +25 -2
- package/src/plugins/builtin/time-sales/client.ts +1 -0
- package/src/plugins/builtin/vol-surface/client.ts +2 -1
- package/src/plugins/builtin/yield-curve/headless.ts +3 -1
- package/src/portfolio/column-values.ts +76 -10
- package/src/react/async-resource.ts +12 -0
- package/src/remote/controller.ts +3 -1
- package/src/renderers/browser/app-services.ts +8 -1
- package/src/renderers/browser/cloud-transport.ts +6 -1
- package/src/renderers/cloudflare/worker.ts +24 -2
- 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/dom/styles.css +32 -0
- package/src/renderers/electrobun/bun/desktop/backend.ts +2 -0
- package/src/renderers/electrobun/bun/desktop/host-requests.ts +25 -1
- package/src/renderers/electrobun/bun/desktop/relaunch.ts +9 -1
- package/src/renderers/electrobun/bun/desktop/windows-script.ts +9 -6
- package/src/renderers/electrobun/bun/window/windows-native.ts +26 -1
- package/src/renderers/electrobun/shared/protocol.ts +6 -0
- package/src/renderers/electrobun/view/ui-host.tsx +7 -0
- package/src/renderers/electrobun/view/window-fullscreen.ts +10 -3
- package/src/shares/portable-layout.ts +99 -2
- package/src/sources/provider-router/index.ts +9 -3
- package/src/sources/provider-router/sources.ts +26 -1
- package/src/sync/core-contributors.ts +18 -4
- package/src/time-series/price-units.ts +11 -0
- package/src/time-series/resolve.ts +12 -0
- package/src/types/config.ts +17 -1
- package/src/types/plugin.ts +6 -0
- package/src/ui/host.tsx +2 -0
- 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/fx-market-hours.ts +43 -0
|
@@ -98,6 +98,12 @@ function pairBaseRank(code: string): number {
|
|
|
98
98
|
return code === "JPY" ? PAIR_BASE_ORDER.length + 1 : PAIR_BASE_ORDER.length;
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
+
/** A currency's pair against the dollar, as markets quote it and as a listing: EURUSD=X for the euro, USDCHF=X for the franc. */
|
|
102
|
+
export function dollarPairListing(code: string): string {
|
|
103
|
+
const currency = code.trim().toUpperCase();
|
|
104
|
+
return pairBaseRank(currency) < pairBaseRank("USD") ? `${currency}USD=X` : `USD${currency}=X`;
|
|
105
|
+
}
|
|
106
|
+
|
|
101
107
|
/**
|
|
102
108
|
* A rate of `quote` per unit of `currency`, written the way markets quote
|
|
103
109
|
* the pair, as `fx` reads a pair: 0.0067 USD per JPY is USD/JPY 149.25, and
|
|
@@ -2,10 +2,26 @@ import { readIntradayBar, readStaleReason } from "../market-data/quotes/intraday
|
|
|
2
2
|
import type { QuoteIntradayBar } from "../types/financials";
|
|
3
3
|
import type { ExchangeRateSnapshot } from "../types/exchange-rate";
|
|
4
4
|
import { fixedUsdRate } from "./currency-units";
|
|
5
|
-
import { fxFreshUntil } from "./fx-market-hours";
|
|
5
|
+
import { fxFreshUntil, fxPreCloseRefetchAt } from "./fx-market-hours";
|
|
6
6
|
|
|
7
7
|
export const MAX_FX_OBSERVATION_AGE_MS = 7 * 24 * 60 * 60_000;
|
|
8
8
|
const FX_FRESH_MS = 60 * 60_000;
|
|
9
|
+
/** The longest a source's FX runs behind the market, and what a rate that states no delay is taken to: Gloom Cloud's 15 minutes. */
|
|
10
|
+
const MAX_FX_DELAY_MINUTES = 15;
|
|
11
|
+
|
|
12
|
+
/** When a rate read at `fetchedAt` is read again for its week's close (fxPreCloseRefetchAt); a rate with no stated delay may be up to 15 minutes behind. */
|
|
13
|
+
function preCloseRefetchAt(fetchedAt: number | undefined, asOf: number | undefined, delayMinutes: number | undefined): number {
|
|
14
|
+
return fxPreCloseRefetchAt(fetchedAt, asOf, Math.min(delayMinutes ?? MAX_FX_DELAY_MINUTES, MAX_FX_DELAY_MINUTES) * 60_000);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Whether a cached rate is past the point it is read again for its FX week's
|
|
19
|
+
* close: shown while it is read again, it would stand in for a close it is
|
|
20
|
+
* not, so a caller that revalidates in the background waits for this one.
|
|
21
|
+
*/
|
|
22
|
+
export function isPastPreCloseRefetch(result: { fetchedAt: number; asOf?: number; delayMinutes?: number }, now = Date.now()): boolean {
|
|
23
|
+
return preCloseRefetchAt(result.fetchedAt, result.asOf, result.delayMinutes) <= now;
|
|
24
|
+
}
|
|
9
25
|
|
|
10
26
|
interface FxRateMetadata {
|
|
11
27
|
fetchedAt?: number;
|
|
@@ -62,12 +78,14 @@ export function exchangeRateMetadata(value: unknown, currency: string, now = Dat
|
|
|
62
78
|
if (expiresAt <= now) return fail();
|
|
63
79
|
const delayMinutes = typeof data.delayMinutes === "number" && Number.isFinite(data.delayMinutes) && data.delayMinutes >= 0
|
|
64
80
|
? data.delayMinutes : undefined;
|
|
65
|
-
const delay = Math.min(delayMinutes ?? 0,
|
|
81
|
+
const delay = Math.min(delayMinutes ?? 0, MAX_FX_DELAY_MINUTES) * 60_000;
|
|
66
82
|
const intradayBar = readIntradayBar(data.intradayBar);
|
|
67
83
|
const staleReason = readStaleReason(data.staleReason);
|
|
68
84
|
const staleAt = Math.min(declaredStaleAt ?? Infinity,
|
|
69
85
|
fetchedAt === undefined ? Infinity : fxFreshUntil(fetchedAt, FX_FRESH_MS),
|
|
70
86
|
asOf === undefined ? Infinity : fxFreshUntil(asOf, FX_FRESH_MS + delay),
|
|
87
|
+
// A rate this app read before the week closed is read again once the close is out: when it read it, not the source.
|
|
88
|
+
preCloseRefetchAt(fallbackFetchedAt ?? fetchedAt, asOf, delayMinutes),
|
|
71
89
|
data.stale === true ? now : Infinity);
|
|
72
90
|
return {
|
|
73
91
|
...(fetchedAt !== undefined ? { fetchedAt } : {}),
|
|
@@ -85,6 +85,49 @@ export function latestFxWeekOpen(time: number): number | null {
|
|
|
85
85
|
return latestNewYorkFivePm(time, 0);
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
+
/**
|
|
89
|
+
* How close to the FX week's close a print is its close: Gloom Cloud dates the
|
|
90
|
+
* week's close by its last minute (20:59Z, or 21:59Z in winter).
|
|
91
|
+
*/
|
|
92
|
+
const FX_CLOSE_PRINT_MS = 60_000;
|
|
93
|
+
|
|
94
|
+
/** Whether a print made at `time` is the close of the FX week that closed at `weekClose`. */
|
|
95
|
+
export function isFxWeekClosePrint(time: number, weekClose: number): boolean {
|
|
96
|
+
return time <= weekClose && time >= weekClose - FX_CLOSE_PRINT_MS;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* When a rate fetched at `fetchedAt` must be read again because it may stand
|
|
101
|
+
* in for a close it is not: once the close of its FX week is out (the
|
|
102
|
+
* week's close, `delayMs` later for a delayed feed). A rate fetched at 20:39Z
|
|
103
|
+
* on a Friday is no close, yet the hours the market is shut do not age it
|
|
104
|
+
* (fxFreshUntil), so until Sunday's open it stood in for Friday's close. The
|
|
105
|
+
* week is the one `fetchedAt` falls in, not the one it is now, so the time is
|
|
106
|
+
* the same whether it is asked on Friday or on Sunday. Infinity for a rate
|
|
107
|
+
* that is that close (isFxWeekClosePrint).
|
|
108
|
+
*/
|
|
109
|
+
export function fxPreCloseRefetchAt(fetchedAt: number | undefined, observedAt: number | undefined, delayMs: number): number {
|
|
110
|
+
if (fetchedAt == null || !Number.isFinite(fetchedAt)) return Infinity;
|
|
111
|
+
const close = fxWeekCloseOf(fetchedAt, delayMs);
|
|
112
|
+
if (close == null || (observedAt != null && isFxWeekClosePrint(observedAt, close))) return Infinity;
|
|
113
|
+
return close + delayMs;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* The close of the FX week a rate fetched at `time` belongs to: the latest
|
|
118
|
+
* one while its print may still be on its way (`delayMs`), else the next one.
|
|
119
|
+
* The next close is a week on, give or take the hour a clock change moves it.
|
|
120
|
+
*/
|
|
121
|
+
function fxWeekCloseOf(time: number, delayMs: number): number | null {
|
|
122
|
+
const latest = latestFxWeekClose(time);
|
|
123
|
+
if (latest != null && time < latest + delayMs) return latest;
|
|
124
|
+
for (const ahead of [7 * DAY_MS, 7 * DAY_MS + 2 * HOUR_MS]) {
|
|
125
|
+
const close = latestFxWeekClose(time + ahead);
|
|
126
|
+
if (close != null && close > time) return close;
|
|
127
|
+
}
|
|
128
|
+
return null;
|
|
129
|
+
}
|
|
130
|
+
|
|
88
131
|
/**
|
|
89
132
|
* When the closure the market is in began (Friday 17:00 New York time); null
|
|
90
133
|
* while it trades. That is `latestFxWeekClose` for every moment the week is
|