gloomberb 0.17.2 → 0.17.4
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 +2 -1
- package/src/api-client/chat.ts +28 -0
- package/src/api-client/errors.ts +11 -1
- package/src/api-client/futures-curve.ts +16 -0
- package/src/api-client/index.ts +22 -9
- package/src/api-client/normalizers.ts +21 -0
- package/src/api-client/socket.ts +27 -0
- package/src/api-client/types.ts +3 -1
- package/src/app/runtime/startup.ts +4 -0
- package/src/cli/commands/market.ts +60 -9
- package/src/cli/commands/search.ts +43 -2
- package/src/cli/commands/ticker.ts +100 -21
- package/src/cli/desktop-pane-shot.ts +34 -9
- package/src/cli/fx-pair.ts +17 -0
- package/src/cli/glossary.ts +134 -6
- package/src/cli/history-rows.ts +16 -4
- package/src/cli/index.ts +44 -12
- package/src/cli/known-gaps.ts +21 -2
- package/src/cli/listing-arg.ts +19 -4
- package/src/cli/listing-suggestion.ts +33 -2
- package/src/cli/pane-functions/dom.ts +39 -6
- package/src/cli/pane-functions/freshness.ts +48 -5
- package/src/cli/pane-functions/function-help.ts +1 -1
- package/src/cli/pane-functions/headless.ts +85 -19
- package/src/cli/pane-functions/index.ts +60 -4
- package/src/cli/pane-functions/market-session.ts +69 -6
- package/src/cli/pane-functions/resolver.ts +4 -2
- package/src/cli/pane-functions/screenshot.ts +14 -1
- package/src/cli/scroll-truncation.ts +5 -1
- package/src/cli/symbol-args.ts +41 -3
- package/src/cli/symbol-list.ts +19 -7
- package/src/cli/unknown-command.ts +70 -0
- package/src/components/chart/native/surface/visibility.ts +37 -7
- package/src/components/index.ts +1 -1
- package/src/components/layout/header.tsx +348 -102
- package/src/components/markdown-text.tsx +40 -66
- package/src/components/market-board/index.tsx +12 -6
- package/src/components/metric-treemap/heat-surface.tsx +76 -14
- package/src/components/metric-treemap/heat-tiles.ts +5 -3
- package/src/components/metric-treemap/index.tsx +1 -1
- package/src/components/reader/detail-reader.tsx +28 -6
- package/src/components/ticker/badge/index.tsx +2 -0
- package/src/components/ui/button.tsx +24 -9
- package/src/components/ui/display.tsx +6 -1
- package/src/components/ui/external-link.tsx +10 -2
- package/src/components/ui/index.ts +1 -1
- package/src/components/ui/status.tsx +148 -5
- package/src/data/memory-resource-store.ts +1 -1
- package/src/data/resource-store.ts +13 -1
- package/src/docs/snapshot.json +13 -13
- package/src/i18n/es.ts +1 -0
- package/src/i18n/ja.ts +1 -0
- package/src/i18n/ko.ts +1 -0
- package/src/i18n/zh-cn.ts +1 -0
- package/src/i18n/zh-tw.ts +1 -0
- package/src/layout-marketplace/gallery-desktop.tsx +2 -2
- package/src/market-data/futures-board.ts +44 -1
- package/src/market-data/futures-contract.ts +10 -0
- package/src/market-data/market/format.ts +7 -2
- package/src/market-data/market/freshness.ts +25 -1
- package/src/market-data/quotes/regular-session-valuation.ts +32 -1
- package/src/market-data/quotes/resolution.ts +2 -0
- package/src/plugins/builtin/account-management/calendar-tab.tsx +1 -1
- package/src/plugins/builtin/account-management/pane.tsx +17 -13
- package/src/plugins/builtin/alerts/cli.ts +72 -11
- package/src/plugins/builtin/attention/headless.ts +19 -10
- package/src/plugins/builtin/attention/model.ts +22 -0
- package/src/plugins/builtin/awards/headless.ts +5 -1
- package/src/plugins/builtin/bond-calculator/pane.tsx +2 -1
- package/src/plugins/builtin/catalysts/headless.ts +5 -1
- package/src/plugins/builtin/changelog/index.tsx +11 -8
- package/src/plugins/builtin/chart-composer/editor/desktop-view.tsx +2 -0
- package/src/plugins/builtin/chat/attachments/desktop.tsx +2 -1
- package/src/plugins/builtin/chat/attachments/model.ts +5 -3
- package/src/plugins/builtin/chat/content/footer.tsx +6 -0
- package/src/plugins/builtin/chat/content/open-targets.ts +13 -4
- package/src/plugins/builtin/chat/content/transcript.tsx +2 -0
- package/src/plugins/builtin/chat/content/whole-message-copy.ts +70 -0
- package/src/plugins/builtin/chat/controller/connections.ts +18 -0
- package/src/plugins/builtin/chat/controller/fetch.ts +5 -2
- package/src/plugins/builtin/chat/controller/index.ts +49 -21
- package/src/plugins/builtin/chat/controller/notifications.ts +132 -72
- package/src/plugins/builtin/chat/controller/realtime.ts +37 -1
- package/src/plugins/builtin/chat/layout.ts +91 -31
- package/src/plugins/builtin/chat/markdown.ts +94 -0
- package/src/plugins/builtin/chat/message/desktop.tsx +3 -2
- package/src/plugins/builtin/chat/message/inline-tokens.tsx +197 -80
- package/src/plugins/builtin/chat/message/render-state.ts +3 -0
- package/src/plugins/builtin/chat/message/terminal.tsx +4 -4
- package/src/plugins/builtin/cloud/thesis/exposure.ts +18 -2
- package/src/plugins/builtin/company-attention/headless.ts +8 -5
- package/src/plugins/builtin/company-attention/model.ts +53 -2
- package/src/plugins/builtin/company-attention/pane.tsx +1 -1
- package/src/plugins/builtin/congress-trades/detail.tsx +7 -4
- package/src/plugins/builtin/congress-trades/pane.tsx +3 -1
- package/src/plugins/builtin/correlation/relationship/pane.tsx +3 -7
- package/src/plugins/builtin/cot/client.ts +12 -4
- package/src/plugins/builtin/cot/model.ts +20 -0
- package/src/plugins/builtin/cot/pane.tsx +2 -2
- package/src/plugins/builtin/crypto-board/model.ts +7 -3
- package/src/plugins/builtin/custom-view/pane.tsx +2 -2
- package/src/plugins/builtin/debt-maturities/pane.tsx +1 -6
- package/src/plugins/builtin/debug/index.tsx +15 -15
- package/src/plugins/builtin/dividend-yield/client.ts +8 -1
- package/src/plugins/builtin/dividend-yield/headless.ts +4 -1
- package/src/plugins/builtin/dividend-yield/pane.tsx +6 -5
- package/src/plugins/builtin/docs/index.tsx +5 -3
- package/src/plugins/builtin/docs/pane.tsx +19 -2
- package/src/plugins/builtin/docs/targets.ts +5 -3
- package/src/plugins/builtin/earnings-calls/data.ts +22 -0
- package/src/plugins/builtin/earnings-calls/pane.tsx +24 -14
- package/src/plugins/builtin/equity-screener/headless.ts +4 -3
- package/src/plugins/builtin/equity-screener/live.ts +27 -1
- package/src/plugins/builtin/equity-screener/pane.tsx +21 -2
- package/src/plugins/builtin/fear-greed/charts.tsx +5 -1
- package/src/plugins/builtin/fear-greed/pane.tsx +1 -1
- package/src/plugins/builtin/futures/index.tsx +33 -6
- package/src/plugins/builtin/futures/model.ts +69 -5
- package/src/plugins/builtin/futures/series.ts +3 -3
- package/src/plugins/builtin/futures/table.tsx +31 -11
- package/src/plugins/builtin/futures/use-board-terms.ts +89 -0
- package/src/plugins/builtin/holders/pane.tsx +6 -1
- package/src/plugins/builtin/jobs/pane.tsx +12 -9
- package/src/plugins/builtin/market-heatmap/index.tsx +6 -15
- package/src/plugins/builtin/mna/client.ts +12 -2
- package/src/plugins/builtin/mna/detail.tsx +2 -2
- package/src/plugins/builtin/mna/pane.tsx +2 -2
- package/src/plugins/builtin/news/headless.ts +4 -2
- package/src/plugins/builtin/notes/owner.tsx +5 -4
- package/src/plugins/builtin/notes/ticker-notes-tab.tsx +2 -3
- package/src/plugins/builtin/options-calculator/pane.tsx +2 -3
- package/src/plugins/builtin/plugin-marketplace/pane.tsx +1 -1
- package/src/plugins/builtin/portfolio-list/cli/bulk-symbols.ts +8 -5
- package/src/plugins/builtin/portfolio-list/cli/portfolio-command.ts +4 -3
- package/src/plugins/builtin/portfolio-list/cli/shared.ts +9 -0
- package/src/plugins/builtin/portfolio-list/cli/watchlist-command.ts +6 -3
- package/src/plugins/builtin/research/equity-diagnostic-pane.tsx +4 -12
- package/src/plugins/builtin/research/event-model.ts +14 -0
- package/src/plugins/builtin/research/headless-schema.ts +31 -1
- package/src/plugins/builtin/research/relative-valuation-columns.ts +289 -0
- package/src/plugins/builtin/research/relative-valuation-currency.ts +164 -0
- package/src/plugins/builtin/research/relative-valuation-headless.ts +94 -11
- package/src/plugins/builtin/research/relative-valuation-model.ts +4 -1
- package/src/plugins/builtin/research/relative-valuation-pane.tsx +13 -4
- package/src/plugins/builtin/research/relative-valuation-peers.ts +302 -0
- package/src/plugins/builtin/research-search/data.ts +11 -0
- package/src/plugins/builtin/research-search/pane.tsx +13 -2
- package/src/plugins/builtin/scanner/hilo-pane.tsx +7 -17
- package/src/plugins/builtin/seasonality/client.ts +23 -0
- package/src/plugins/builtin/seasonality/pane.tsx +4 -2
- package/src/plugins/builtin/sectors/index.tsx +7 -3
- package/src/plugins/builtin/shared/report-freshness.ts +6 -2
- package/src/plugins/builtin/short-interest/headless.ts +13 -3
- package/src/plugins/builtin/short-interest/index.tsx +1 -1
- package/src/plugins/builtin/short-interest/model.ts +62 -3
- package/src/plugins/builtin/short-interest/pane.tsx +2 -2
- package/src/plugins/builtin/short-interest/schedule.ts +107 -0
- package/src/plugins/builtin/short-interest/watch-client.ts +54 -8
- package/src/plugins/builtin/short-interest/watch-headless.ts +8 -3
- package/src/plugins/builtin/short-interest/watch-model.ts +52 -23
- package/src/plugins/builtin/short-interest/watch-pane.tsx +1 -1
- package/src/plugins/builtin/supply-chain/flow.tsx +14 -4
- package/src/plugins/builtin/themes/headless.ts +1 -1
- package/src/plugins/builtin/thirteenf/overlap-pane.tsx +23 -27
- package/src/plugins/builtin/ticker-detail/index.tsx +1 -1
- package/src/plugins/builtin/ticker-detail/overview/model.ts +4 -3
- package/src/plugins/builtin/ticker-detail/overview-tab.tsx +4 -4
- package/src/plugins/builtin/ticker-detail/quote-monitor/card.tsx +9 -4
- package/src/plugins/builtin/vol-surface/pane.tsx +16 -1
- package/src/plugins/builtin/volatility/chart-model.ts +1 -1
- package/src/plugins/builtin/volatility/charts.tsx +1 -1
- package/src/renderers/dom/build-assets.ts +17 -4
- package/src/renderers/dom/desktop/controls.tsx +2 -0
- package/src/renderers/dom/styles.css +6 -0
- package/src/renderers/electrobun/bun/desktop/macos-dock-badge.ts +4 -3
- package/src/renderers/electrobun/bun/desktop/macos-dock-icon.ts +2 -3
- package/src/renderers/electrobun/bun/desktop/macos-objc.ts +17 -6
- package/src/sources/gloomberb-cloud/normalizers.ts +13 -4
- package/src/sources/provider-router/batches.ts +2 -1
- package/src/sources/provider-router/cache.ts +3 -0
- package/src/sync/baseline.ts +19 -14
- package/src/sync/controller.ts +140 -40
- package/src/sync/core-contributors.ts +256 -32
- package/src/sync/types.ts +44 -0
- package/src/time-series/resolve.ts +24 -5
- package/src/types/data-provider.ts +8 -0
- package/src/types/financials.ts +40 -4
- package/src/types/headless.ts +43 -0
- package/src/types/plugin.ts +7 -0
- package/src/ui/resize-settle.ts +128 -0
- package/src/utils/calendar-date.ts +56 -0
- package/src/utils/decimal-comma.ts +31 -0
- package/src/utils/declared-dividends.ts +39 -0
- package/src/utils/forward-dividend.ts +34 -11
- package/src/utils/fundamentals.ts +13 -2
- package/src/utils/futures-generic.ts +25 -4
- package/src/utils/markdown.ts +180 -0
- package/src/utils/market-capitalization.ts +22 -0
- package/src/utils/plugin-proxy-hosts.json +5 -0
- package/src/utils/utc-time.ts +14 -3
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/** A function the catalog finds for a word typed as a command (`comps`, `peers`). */
|
|
2
|
+
export interface CatalogCommandHit {
|
|
3
|
+
code: string;
|
|
4
|
+
label: string;
|
|
5
|
+
/** What the function takes after its code: `ticker`, `tickers`, `free-text`, `none`... */
|
|
6
|
+
argKind: string | null;
|
|
7
|
+
argPlaceholder: string | null;
|
|
8
|
+
/** It has a `--peers` switch that adds a symbol's competitors (RV). */
|
|
9
|
+
peers: boolean;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const TICKER_ARGUMENTS = new Set(["ticker", "tickers", "symbol-list", "ticker-list"]);
|
|
13
|
+
|
|
14
|
+
/** A company name typed where a ticker goes (`duolingo`, `"coca cola"`): lowercase and longer than a ticker, or several words. */
|
|
15
|
+
function nameLike(arg: string): boolean {
|
|
16
|
+
return /\s/.test(arg.trim()) || /^[a-z]{6,}$/.test(arg.trim());
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function shellWord(arg: string): string {
|
|
20
|
+
return /^[\w.:,=%+@/$^-]+$/.test(arg) ? arg : JSON.stringify(arg);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* The command that runs `hit` with what the reader typed after the unknown
|
|
25
|
+
* word: their tickers (`gloomberb fn RV DUOL --peers`, the switch added when
|
|
26
|
+
* one symbol meets a function that picks its peers), or the function's
|
|
27
|
+
* placeholder and a search when they typed a company's name.
|
|
28
|
+
*/
|
|
29
|
+
function catalogHitCommand(hit: CatalogCommandHit, args: readonly string[]): { command: string; search: string | null } {
|
|
30
|
+
const typed = args.filter((arg) => arg.trim() && !arg.startsWith("-"));
|
|
31
|
+
const base = `gloomberb fn ${hit.code}`;
|
|
32
|
+
if (hit.argKind === "none") return { command: base, search: null };
|
|
33
|
+
const placeholder = hit.argPlaceholder ?? hit.argKind;
|
|
34
|
+
if (!hit.argKind || !TICKER_ARGUMENTS.has(hit.argKind)) {
|
|
35
|
+
const argument = typed.length > 0 ? typed.map(shellWord).join(" ") : placeholder ? `<${placeholder}>` : "";
|
|
36
|
+
return { command: [base, argument].filter(Boolean).join(" "), search: null };
|
|
37
|
+
}
|
|
38
|
+
const names = typed.filter(nameLike);
|
|
39
|
+
const single = typed.length === 1;
|
|
40
|
+
const peers = hit.peers && single ? " --peers" : "";
|
|
41
|
+
if (names.length > 0) {
|
|
42
|
+
return { command: `${base} <${single ? "ticker" : placeholder ?? "tickers"}>${peers}`, search: `gloomberb search ${names.map(shellWord).join(" ")}` };
|
|
43
|
+
}
|
|
44
|
+
return { command: `${base} ${typed.length > 0 ? typed.map(shellWord).join(" ") : `<${placeholder ?? "ticker"}>`}${peers}`, search: null };
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* What an unknown command word is answered with when it names something the
|
|
49
|
+
* catalog has (`peers`, `comps`): one function as a command to run, several
|
|
50
|
+
* as a list, with the catalog search for more. Null when the catalog has
|
|
51
|
+
* nothing for it.
|
|
52
|
+
*/
|
|
53
|
+
export function catalogPointer(token: string, hits: readonly CatalogCommandHit[], args: readonly string[]): string | null {
|
|
54
|
+
if (hits.length === 0) return null;
|
|
55
|
+
const word = /^[\w.:-]+$/.test(token) ? token : JSON.stringify(token);
|
|
56
|
+
const more = `gloomberb catalog ${word}`;
|
|
57
|
+
if (hits.length === 1) {
|
|
58
|
+
const { command, search } = catalogHitCommand(hits[0]!, args);
|
|
59
|
+
return `Try \`${command}\` (${hits[0]!.label})${search ? `; \`${search}\` finds the ticker` : ""}. \`${more}\` lists more.`;
|
|
60
|
+
}
|
|
61
|
+
const commands = hits.map((hit) => catalogHitCommand(hit, args));
|
|
62
|
+
const width = Math.max(...commands.map(({ command }) => command.length));
|
|
63
|
+
const searches = [...new Set(commands.flatMap(({ search }) => search ?? []))];
|
|
64
|
+
return [
|
|
65
|
+
"Closest functions:",
|
|
66
|
+
...commands.map(({ command }, index) => ` ${command.padEnd(width)} ${hits[index]!.label}`),
|
|
67
|
+
...searches.map((search) => `Find the ticker: ${search}`),
|
|
68
|
+
`Search the catalog: ${more}`,
|
|
69
|
+
].join("\n");
|
|
70
|
+
}
|
|
@@ -29,27 +29,57 @@ export function resolveNativeSurfaceVisibleRect(
|
|
|
29
29
|
): CellRect | null {
|
|
30
30
|
if (!renderable) return null;
|
|
31
31
|
|
|
32
|
+
const cached = visibleRectCache.get(renderable);
|
|
33
|
+
if (cached && cached.terminalWidth === terminalWidth && cached.terminalHeight === terminalHeight && ancestorChainUnchanged(renderable, cached.chain)) {
|
|
34
|
+
return cached.visible;
|
|
35
|
+
}
|
|
36
|
+
const chain: Array<CellRect & { visible: boolean }> = [];
|
|
37
|
+
let current: NativeSurfaceRenderableNode | null = renderable;
|
|
38
|
+
const seen = new Set<NativeSurfaceRenderableNode>();
|
|
39
|
+
let depth = 0;
|
|
32
40
|
let visible: CellRect = {
|
|
33
41
|
x: 0,
|
|
34
42
|
y: 0,
|
|
35
43
|
width: terminalWidth,
|
|
36
44
|
height: terminalHeight,
|
|
37
45
|
};
|
|
38
|
-
let current: NativeSurfaceRenderableNode | null = renderable;
|
|
39
|
-
const seen = new Set<NativeSurfaceRenderableNode>();
|
|
40
|
-
let depth = 0;
|
|
41
|
-
|
|
42
46
|
while (current && !seen.has(current)) {
|
|
43
47
|
if (depth >= MAX_RENDERABLE_ANCESTOR_DEPTH) return null;
|
|
44
48
|
seen.add(current);
|
|
45
49
|
depth += 1;
|
|
46
50
|
if (current.visible === false) return null;
|
|
47
|
-
|
|
48
|
-
const nextVisible = intersectCellRects(visible,
|
|
51
|
+
const rect = getRenderableCellRect(current);
|
|
52
|
+
const nextVisible = intersectCellRects(visible, rect);
|
|
49
53
|
if (!nextVisible) return null;
|
|
54
|
+
chain.push({ ...rect, visible: true });
|
|
50
55
|
visible = nextVisible;
|
|
51
56
|
current = current.parent;
|
|
52
57
|
}
|
|
53
|
-
|
|
58
|
+
visibleRectCache.set(renderable, { terminalWidth, terminalHeight, chain, visible });
|
|
54
59
|
return visible;
|
|
55
60
|
}
|
|
61
|
+
|
|
62
|
+
function ancestorChainUnchanged(
|
|
63
|
+
renderable: NativeSurfaceRenderableNode,
|
|
64
|
+
chain: ReadonlyArray<CellRect & { visible: boolean }>,
|
|
65
|
+
): boolean {
|
|
66
|
+
let current: NativeSurfaceRenderableNode | null = renderable;
|
|
67
|
+
let index = 0;
|
|
68
|
+
const seen = new Set<NativeSurfaceRenderableNode>();
|
|
69
|
+
while (current && !seen.has(current)) {
|
|
70
|
+
if (index >= chain.length || index >= MAX_RENDERABLE_ANCESTOR_DEPTH) return false;
|
|
71
|
+
seen.add(current);
|
|
72
|
+
const cached = chain[index]!;
|
|
73
|
+
if (current.visible === false || current.x !== cached.x || current.y !== cached.y || current.width !== cached.width || current.height !== cached.height) return false;
|
|
74
|
+
current = current.parent;
|
|
75
|
+
index += 1;
|
|
76
|
+
}
|
|
77
|
+
return index === chain.length;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
const visibleRectCache = new WeakMap<NativeSurfaceRenderableNode, {
|
|
81
|
+
terminalWidth: number;
|
|
82
|
+
terminalHeight: number;
|
|
83
|
+
chain: Array<CellRect & { visible: boolean }>;
|
|
84
|
+
visible: CellRect;
|
|
85
|
+
}>();
|
package/src/components/index.ts
CHANGED
|
@@ -147,7 +147,7 @@ export type {
|
|
|
147
147
|
NoticeProps, NumberFieldProps, PaneStatusBodyProps, PopoverProps, ProseProps, QueryBarFilter,
|
|
148
148
|
QueryBarMultiFilter, QueryBarProps, QueryBarSearch, QueryBarSearchFocus, QueryBarSelectFilter, QueryBarTextFilter,
|
|
149
149
|
QueryBarToggleFilter, QueryBarView, RangeTrackProps, RatioBarProps, SectionHeadingProps, SectionProps, SegmentedControlProps,
|
|
150
|
-
SelectButtonOption, SelectButtonProps, SelectControl, StatGridProps, StatItem, TabsProps,
|
|
150
|
+
SelectButtonOption, SelectButtonProps, SelectControl, StatGridProps, StatItem, StatusRetry, TabsProps,
|
|
151
151
|
TextFieldProps, TextPromptDialogProps,
|
|
152
152
|
} from "./ui";
|
|
153
153
|
export { usePaneTicker } from "../state/app/context";
|