gloomberb 0.20.13 → 0.20.16
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/patches/@opentui%2Fcore@0.3.2.patch +22 -4
- package/src/account/auth-dialog.tsx +22 -4
- package/src/account/auth-form.tsx +6 -1
- package/src/account/checkout-handoff.tsx +7 -14
- package/src/account/device-signin-dialog.tsx +35 -24
- package/src/api-client/crypto-markets.ts +10 -0
- package/src/api-client/errors.ts +3 -1
- package/src/api-client/index.ts +54 -0
- package/src/api-client/install-experiments.ts +8 -7
- package/src/api-client/money-markets.ts +7 -0
- package/src/api-client/paths.ts +2 -1
- package/src/api-client/product-waitlist.ts +63 -0
- package/src/api-client/request.ts +16 -4
- package/src/api-client/types/billing.ts +45 -0
- package/src/api-client/yearly-plan.ts +132 -0
- package/src/app/global-shortcuts.ts +5 -3
- package/src/app/pane-runtime/index.tsx +2 -2
- package/src/app/pane-runtime/plugin-bindings.ts +3 -1
- package/src/app/pane-runtime/ticker-open-runtime.ts +6 -1
- package/src/app/since-last-visit/keys.ts +26 -0
- package/src/app/since-last-visit/model.ts +266 -0
- package/src/app/since-last-visit/strip.tsx +193 -0
- package/src/app/since-last-visit/use-since-last-visit.ts +289 -0
- package/src/app/since-last-visit/visit-tracker.ts +191 -0
- package/src/app.tsx +15 -0
- package/src/architecture/floating-promise-allowlist.json +0 -1
- package/src/brokers/signed-in/sign-in-dialog.tsx +38 -38
- package/src/cli/commands/market.ts +103 -27
- package/src/cli/commands/overview.ts +18 -4
- package/src/cli/commands/system.ts +29 -1
- package/src/cli/commands/ticker.ts +12 -5
- package/src/cli/desktop-pane-shot-api-policy.ts +4 -1
- package/src/cli/desktop-pane-shot-browser.ts +2 -1
- package/src/cli/desktop-pane-shot-view.ts +3 -7
- package/src/cli/desktop-pane-shot.ts +26 -28
- package/src/cli/errors.ts +3 -1
- package/src/cli/freshness.ts +7 -2
- package/src/cli/glossary.ts +10 -5
- package/src/cli/help.ts +1 -0
- package/src/cli/helpers.ts +8 -16
- package/src/cli/history-export.ts +4 -0
- package/src/cli/history-rows.ts +24 -0
- package/src/cli/index.ts +4 -0
- package/src/cli/known-gaps.ts +2 -2
- package/src/cli/listing-arg.ts +79 -11
- package/src/cli/not-a-ticker.ts +4 -0
- package/src/cli/options.ts +29 -1
- package/src/cli/pane-functions/catalog.ts +70 -12
- package/src/cli/pane-functions/function-help.ts +1 -1
- package/src/cli/pane-functions/headless.ts +68 -3
- package/src/cli/pane-functions/index.ts +2 -2
- package/src/cli/pane-functions/options.ts +7 -0
- package/src/cli/pane-functions/resolver.ts +104 -15
- package/src/cli/pane-functions/screenshot-payload.ts +3 -0
- package/src/cli/report-tables.ts +20 -5
- package/src/cli/result.ts +22 -4
- package/src/cli/shot-temp-dir.ts +30 -0
- package/src/cli/suffixed-listing-rows.ts +11 -0
- package/src/cli/symbol-args.ts +5 -3
- package/src/cli/symbol-list.ts +23 -10
- package/src/cli/symbol-rows.ts +135 -3
- package/src/cli/treasury-yields.ts +15 -1
- package/src/components/chart/composite/composite-chart.tsx +3 -3
- package/src/components/chart/composite/format.ts +2 -1
- package/src/components/chart/composite/panel-surface/axis-markers.ts +133 -0
- package/src/components/chart/composite/panel-surface/level-labels.tsx +78 -0
- package/src/components/chart/composite/panel-surface/overlays.ts +108 -0
- package/src/components/chart/composite/panel-surface/pan-coast.ts +54 -0
- package/src/components/chart/composite/panel-surface/panel-cursor.tsx +138 -0
- package/src/components/chart/composite/panel-surface/panel-levels.ts +47 -0
- package/src/components/chart/composite/panel-surface/plot-gestures.ts +403 -0
- package/src/components/chart/composite/panel-surface/plot-pointer.ts +65 -0
- package/src/components/chart/composite/panel-surface/plot-wheel.ts +102 -0
- package/src/components/chart/composite/panel-surface/pointer.ts +12 -0
- package/src/components/chart/composite/panel-surface/props.ts +79 -0
- package/src/components/chart/composite/panel-surface/tool-readout.ts +151 -0
- package/src/components/chart/composite/panel-surface/value-axis-gestures.ts +152 -0
- package/src/components/chart/composite/panel-surface.tsx +81 -1177
- package/src/components/command-bar/commands/collection-list.ts +1 -0
- package/src/components/command-bar/commands/direct/index.ts +31 -8
- package/src/components/command-bar/commands/registry.ts +7 -0
- package/src/components/command-bar/routes/root/command-items.ts +8 -0
- package/src/components/command-bar/routes/root/results.ts +19 -2
- package/src/components/command-bar/routes/root/runtime.ts +3 -2
- package/src/components/command-bar/routes/root/selection.ts +3 -2
- package/src/components/command-bar/routes/root/shortcuts.ts +15 -0
- package/src/components/company-logo.tsx +10 -3
- package/src/components/data-table/sections.ts +6 -1
- package/src/components/layout/pane/title.ts +16 -6
- package/src/components/layout/shell/index.tsx +5 -1
- package/src/components/layout/shell/ticker-link-menu.ts +12 -9
- package/src/components/pane-settings-dialog/tui.tsx +6 -3
- package/src/components/pane-settings-dialog.tsx +2 -1
- package/src/components/pane-template-wizard.tsx +2 -0
- package/src/components/ticker/badge/format.ts +12 -3
- package/src/components/ticker/badge/index.tsx +9 -3
- package/src/components/ticker/list-table-view.tsx +119 -17
- package/src/components/ui/choice-dialog.tsx +1 -1
- package/src/components/ui/confirm-dialog.tsx +3 -2
- package/src/components/ui/data-table/display-columns.ts +16 -0
- package/src/components/ui/data-table/index.tsx +40 -9
- package/src/components/ui/data-table/types.ts +14 -0
- package/src/components/ui/frame.tsx +7 -3
- package/src/components/ui/icon.tsx +4 -2
- package/src/components/ui/list-view.tsx +8 -0
- package/src/components/ui/number-prompt-dialog.tsx +2 -1
- package/src/components/use-pane-notice-footer.tsx +3 -1
- package/src/core/state/app/layout-reducer.ts +3 -1
- package/src/core/state/app/layout.ts +2 -2
- package/src/data/config/layout.ts +14 -0
- package/src/data/config/store/normalize.ts +11 -1
- package/src/docs/snapshot.json +2 -2
- package/src/i18n/es.ts +39 -0
- package/src/i18n/ja.ts +39 -0
- package/src/i18n/ko.ts +39 -0
- package/src/i18n/zh-cn.ts +39 -0
- package/src/i18n/zh-tw.ts +39 -0
- package/src/layout/pane-follow.ts +141 -4
- package/src/layout/pane-layout-move.ts +10 -7
- package/src/layout/ticker-navigation.ts +13 -19
- package/src/layout/ticker-retarget.ts +3 -2
- package/src/market-data/market/format.ts +35 -1
- package/src/market-data/market/index-level.ts +19 -0
- package/src/market-data/quotes/contributions.ts +13 -0
- package/src/market-data/quotes/export-identity.ts +36 -1
- package/src/market-data/quotes/resolution.ts +16 -0
- package/src/plugins/builtin/account-management/keyboard.ts +14 -0
- package/src/plugins/builtin/account-management/model.ts +2 -0
- package/src/plugins/builtin/account-management/pane.tsx +79 -7
- package/src/plugins/builtin/account-management/password-dialog.tsx +2 -2
- package/src/plugins/builtin/account-management/payment-recovery-row.tsx +97 -0
- package/src/plugins/builtin/account-management/yearly-plan-row.tsx +359 -0
- package/src/plugins/builtin/analytics/risk-client.ts +12 -2
- package/src/plugins/builtin/analytics/risk-headless.ts +66 -6
- package/src/plugins/builtin/analytics/risk-math.ts +23 -6
- package/src/plugins/builtin/analytics/risk-model.ts +20 -9
- package/src/plugins/builtin/analytics/risk-pane.tsx +2 -2
- package/src/plugins/builtin/awards/pane.tsx +6 -8
- package/src/plugins/builtin/changelog/index.tsx +6 -44
- package/src/plugins/builtin/changelog/versions.ts +17 -68
- package/src/plugins/builtin/chart-composer/catalog-inventory.ts +5 -2
- package/src/plugins/builtin/chart-composer/editor.tsx +1 -0
- package/src/plugins/builtin/chart-composer/pane.tsx +1 -1
- package/src/plugins/builtin/chart-composer/quick-add.tsx +4 -1
- package/src/plugins/builtin/chart-composer/series-catalog.ts +17 -1
- package/src/plugins/builtin/cloud/askg/executor.ts +2 -1
- package/src/plugins/builtin/cloud/askg/sources.ts +2 -1
- package/src/plugins/builtin/cloud/plugin.tsx +2 -0
- package/src/plugins/builtin/cloud/thesis/module.tsx +2 -0
- package/src/plugins/builtin/cloud/upgrade-status-widget.tsx +6 -2
- package/src/plugins/builtin/cpi/headless.ts +6 -1
- package/src/plugins/builtin/cpi/model.ts +17 -0
- package/src/plugins/builtin/cpi/pane.tsx +4 -2
- package/src/plugins/builtin/crypto-board/client.ts +6 -1
- package/src/plugins/builtin/crypto-board/headless.ts +10 -2
- package/src/plugins/builtin/crypto-board/model.ts +89 -11
- package/src/plugins/builtin/crypto-board/pane.tsx +20 -5
- package/src/plugins/builtin/debt-maturities/model.ts +1 -1
- package/src/plugins/builtin/dividend-yield/client.ts +24 -2
- package/src/plugins/builtin/dividend-yield/headless.ts +4 -2
- package/src/plugins/builtin/dividend-yield/ranking.ts +2 -1
- package/src/plugins/builtin/dividend-yield/view.ts +5 -1
- package/src/plugins/builtin/earnings/board-table.ts +1 -1
- package/src/plugins/builtin/earnings/board.tsx +36 -16
- package/src/plugins/builtin/earnings/highlight.ts +47 -0
- package/src/plugins/builtin/earnings/history-table.ts +9 -1
- package/src/plugins/builtin/earnings/index.tsx +1 -1
- package/src/plugins/builtin/earnings-calls/pane.tsx +2 -2
- package/src/plugins/builtin/earnings-ripple/index.tsx +2 -0
- package/src/plugins/builtin/econ/calendar-model.ts +17 -1
- package/src/plugins/builtin/econ/fred-catalog.ts +33 -4
- package/src/plugins/builtin/econ-statistics/headless.ts +21 -0
- package/src/plugins/builtin/estimate-revisions/model.ts +1 -1
- package/src/plugins/builtin/exposure/index.tsx +1 -1
- package/src/plugins/builtin/macro-day/headless.ts +21 -10
- package/src/plugins/builtin/macro-day/model.ts +42 -3
- package/src/plugins/builtin/macro-day/pane.tsx +26 -8
- package/src/plugins/builtin/macro-day/releases.ts +24 -1
- package/src/plugins/builtin/market-valuation/detail.tsx +3 -3
- package/src/plugins/builtin/market-valuation/headless.ts +11 -4
- package/src/plugins/builtin/market-valuation/pane.tsx +3 -1
- package/src/plugins/builtin/market-valuation/view.ts +14 -0
- package/src/plugins/builtin/money-markets/client.ts +4 -1
- package/src/plugins/builtin/money-markets/headless.ts +15 -4
- package/src/plugins/builtin/money-markets/index.tsx +1 -1
- package/src/plugins/builtin/money-markets/pane.tsx +7 -1
- package/src/plugins/builtin/news/wire/news/detail-view.tsx +20 -8
- package/src/plugins/builtin/pe-band/pane.tsx +1 -1
- package/src/plugins/builtin/portfolio-list/cli/bulk-symbols.ts +4 -2
- package/src/plugins/builtin/portfolio-list/cli/period-report.ts +61 -11
- package/src/plugins/builtin/portfolio-list/cli/portfolio-command.ts +11 -3
- package/src/plugins/builtin/portfolio-list/cli/render.ts +8 -1
- package/src/plugins/builtin/portfolio-list/cli/watchlist-command.ts +178 -17
- package/src/plugins/builtin/portfolio-list/headless.ts +33 -6
- package/src/plugins/builtin/portfolio-list/pane/groups.tsx +220 -0
- package/src/plugins/builtin/portfolio-list/pane/index.tsx +95 -18
- package/src/plugins/builtin/portfolio-list/pane/period-pnl.ts +24 -6
- package/src/plugins/builtin/portfolio-list/period-pnl.ts +16 -1
- package/src/plugins/builtin/portfolio-list/summary/index.tsx +4 -1
- package/src/plugins/builtin/portfolio-list/summary/totals.ts +6 -4
- package/src/plugins/builtin/portfolio-list/table.tsx +38 -16
- package/src/plugins/builtin/research/corporate-actions-pane.tsx +4 -2
- package/src/plugins/builtin/research/relative-valuation-headless.ts +15 -5
- package/src/plugins/builtin/research/relative-valuation-model.ts +7 -1
- package/src/plugins/builtin/research/relative-valuation-pane.tsx +7 -4
- package/src/plugins/builtin/shared/cloud-upgrade.ts +4 -2
- package/src/plugins/builtin/shared/cpi-year-gap.ts +67 -0
- package/src/plugins/builtin/shared/headless-options.ts +1 -1
- package/src/plugins/builtin/social-mentions/model.ts +2 -2
- package/src/plugins/builtin/thirteenf/pane.tsx +1 -1
- package/src/plugins/builtin/ticker-detail/adr-pair/headless.ts +45 -2
- package/src/plugins/builtin/ticker-detail/financials/model.ts +51 -16
- package/src/plugins/builtin/ticker-detail/financials/nopat.ts +16 -0
- package/src/plugins/builtin/ticker-detail/financials/ratios.ts +44 -13
- package/src/plugins/builtin/ticker-detail/financials/schema.ts +33 -2
- package/src/plugins/builtin/ticker-detail/financials/tab.tsx +4 -2
- package/src/plugins/builtin/ticker-detail/headless-schema.ts +30 -4
- package/src/plugins/builtin/ticker-detail/headless.ts +280 -35
- package/src/plugins/builtin/ticker-detail/overview/components.tsx +4 -5
- package/src/plugins/builtin/ticker-detail/overview/model.ts +9 -2
- package/src/plugins/builtin/ticker-detail/overview-tab.tsx +10 -2
- package/src/plugins/builtin/ticker-detail/pharma-signals/eligibility.ts +32 -0
- package/src/plugins/builtin/ticker-detail/pharma-signals/tab.tsx +162 -0
- package/src/plugins/builtin/ticker-detail/pharma-signals/waitlist.ts +126 -0
- package/src/plugins/builtin/ticker-detail/research-groups.ts +6 -4
- package/src/plugins/builtin/ticker-detail/research-tabs.ts +11 -0
- package/src/portfolio/collection-name.ts +2 -1
- package/src/portfolio/column-values.ts +34 -12
- package/src/portfolio/listed-symbol.ts +4 -2
- package/src/portfolio/period-pnl.ts +51 -1
- package/src/portfolio/suffixed-listings.ts +3 -1
- package/src/portfolio/watchlist-groups.ts +212 -0
- package/src/react/ticker-source.ts +3 -1
- package/src/renderers/dom/dialog-host.tsx +5 -5
- package/src/renderers/dom/styles.css +7 -0
- package/src/renderers/electrobun/view/remote/capability-invoker.ts +1 -1
- package/src/renderers/opentui/dialog-host.tsx +3 -4
- package/src/sources/gloomberb-cloud/normalizers.ts +5 -0
- package/src/sources/provider-router/history.ts +5 -2
- package/src/state/app/bootstrap.ts +11 -0
- package/src/state/app/context/index.tsx +6 -0
- package/src/sync/collections-contributor.ts +5 -2
- package/src/sync/config-merge.ts +10 -2
- package/src/sync/sanitize.ts +28 -0
- package/src/telemetry/usage-counts.ts +17 -0
- package/src/test-support/plugin-persistence.ts +12 -0
- package/src/tickers/company-name-listing.ts +4 -3
- package/src/tickers/company-name.ts +19 -1
- package/src/tickers/instrument-coverage.ts +27 -0
- package/src/tickers/search/home-listing.ts +38 -1
- package/src/tickers/search/index.ts +3 -2
- package/src/tickers/search/ranking.ts +21 -2
- package/src/time-series/base-series.ts +4 -0
- package/src/time-series/chart-seed.ts +1 -1
- package/src/time-series/financial-period-coverage.ts +4 -12
- package/src/time-series/parsed-history-cache.ts +1 -1
- package/src/time-series/resolve.ts +1 -1
- package/src/time-series/types.ts +5 -2
- package/src/time-series/use-chart-resolution.ts +6 -1
- package/src/types/config.ts +32 -0
- package/src/types/financials.ts +13 -0
- package/src/types/headless.ts +7 -0
- package/src/types/plugin-context.ts +5 -0
- package/src/types/ticker.ts +14 -0
- package/src/ui/ascii-font.ts +1 -4
- package/src/ui/dialog-stack.ts +17 -0
- package/src/ui/dialog.tsx +6 -2
- package/src/utils/async-deadline.ts +2 -2
- package/src/utils/crypto-pair.ts +9 -0
- package/src/utils/csv.ts +44 -5
- package/src/utils/exchanges.ts +13 -0
- package/src/utils/financial-statements.ts +60 -3
- package/src/utils/futures-generic.ts +17 -0
- package/src/utils/trailing-dividend.ts +13 -3
|
@@ -6,6 +6,8 @@ import { layoutWindowCounts } from "../../layout/pane-manager/transient";
|
|
|
6
6
|
import { builtinPluginGroupMembers } from "../../plugins/ownership";
|
|
7
7
|
import type { AppConfig, TelemetryConfig } from "../../types/config";
|
|
8
8
|
import { canonicalTimeZone } from "../../utils/utc-time";
|
|
9
|
+
import type { CsvDecimal } from "../../utils/csv";
|
|
10
|
+
import { parseCsvDecimal } from "../options";
|
|
9
11
|
import { readBaseCurrency } from "../../utils/base-currency";
|
|
10
12
|
import { NIGHTLY_CHANNEL_SUMMARY, parseUpdateChannel, withUpdateChannel } from "../../updater/channel";
|
|
11
13
|
import type { CliCommandDef } from "../../types/plugin";
|
|
@@ -40,6 +42,8 @@ const TIMEZONE_CONFIG_KEY = "timezone";
|
|
|
40
42
|
const NO_TIMEZONE = "none";
|
|
41
43
|
/** Stable releases, or nightly builds as well. */
|
|
42
44
|
const UPDATE_CHANNEL_CONFIG_KEY = "updates.channel";
|
|
45
|
+
/** The decimal mark CSV exports write: a dot, or a comma with `;` between cells. */
|
|
46
|
+
const CSV_DECIMAL_CONFIG_KEY = "csvDecimal";
|
|
43
47
|
const EDITABLE_CONFIG_KEYS = [
|
|
44
48
|
"baseCurrency",
|
|
45
49
|
"refreshIntervalMinutes",
|
|
@@ -49,6 +53,7 @@ const EDITABLE_CONFIG_KEYS = [
|
|
|
49
53
|
STAR_PROMPT_CONFIG_KEY,
|
|
50
54
|
TIMEZONE_CONFIG_KEY,
|
|
51
55
|
UPDATE_CHANNEL_CONFIG_KEY,
|
|
56
|
+
CSV_DECIMAL_CONFIG_KEY,
|
|
52
57
|
];
|
|
53
58
|
|
|
54
59
|
function isTelemetryConfigKey(key: string): key is TelemetryConfigKey {
|
|
@@ -120,6 +125,16 @@ function describeConfigValue(value: unknown): string {
|
|
|
120
125
|
return String(value);
|
|
121
126
|
}
|
|
122
127
|
|
|
128
|
+
/** The config with CSV exports' decimal mark: a comma is saved, the dot is the default and leaves nothing. */
|
|
129
|
+
function withCsvDecimal(config: AppConfig, decimal: CsvDecimal): AppConfig {
|
|
130
|
+
const { csvDecimal: _previous, ...rest } = config;
|
|
131
|
+
return decimal === "comma" ? { ...rest, csvDecimal: "comma" } : rest;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function describeCsvDecimal(value: unknown): string {
|
|
135
|
+
return value === "comma" ? "comma: CSV numbers as 17,2, cells split by ;" : "dot: CSV numbers as 17.2, cells split by ,";
|
|
136
|
+
}
|
|
137
|
+
|
|
123
138
|
function withTimezone(config: AppConfig, timezone: string | null): AppConfig {
|
|
124
139
|
const { timezone: _previous, ...rest } = config;
|
|
125
140
|
return timezone ? { ...rest, timezone } : rest;
|
|
@@ -253,6 +268,7 @@ export function createSystemCliCommands(): CliCommandDef[] {
|
|
|
253
268
|
"config set starPrompt.enabled false",
|
|
254
269
|
"config set timezone <Region/City>|none",
|
|
255
270
|
"config set updates.channel stable|nightly",
|
|
271
|
+
"config set csvDecimal comma|dot",
|
|
256
272
|
"config get keybindings",
|
|
257
273
|
"config set keybindings.actions.<action> <keys>|null|default",
|
|
258
274
|
"config set keybindings.commands.<keys> <command>|null",
|
|
@@ -265,6 +281,11 @@ export function createSystemCliCommands(): CliCommandDef[] {
|
|
|
265
281
|
lines: [
|
|
266
282
|
"Times print in UTC. timezone takes an IANA zone name such as Asia/Tokyo or America/New_York, and CLI text and function reports then show your local time beside every UTC time. Trading days keep their market's date. none goes back to UTC alone. JSON and CSV keep the raw values.",
|
|
267
283
|
],
|
|
284
|
+
}, {
|
|
285
|
+
title: "CSV numbers",
|
|
286
|
+
lines: [
|
|
287
|
+
"CSV exports write numbers with a decimal point, cells split by commas. csvDecimal comma writes 17,2 with cells split by ; for a spreadsheet in a decimal-comma locale (German, French), every CSV the CLI and the app export; --decimal comma or --decimal dot decides for one command. Text and JSON keep the dot, and dates stay ISO.",
|
|
288
|
+
],
|
|
268
289
|
}, {
|
|
269
290
|
title: "Themes",
|
|
270
291
|
lines: [
|
|
@@ -328,6 +349,7 @@ export function createSystemCliCommands(): CliCommandDef[] {
|
|
|
328
349
|
[STAR_PROMPT_CONFIG_KEY]: context.config.starPrompt?.enabled !== false,
|
|
329
350
|
[TIMEZONE_CONFIG_KEY]: context.config.timezone ?? null,
|
|
330
351
|
[UPDATE_CHANNEL_CONFIG_KEY]: context.config.updates?.channel ?? "stable",
|
|
352
|
+
[CSV_DECIMAL_CONFIG_KEY]: context.config.csvDecimal ?? "dot",
|
|
331
353
|
};
|
|
332
354
|
|
|
333
355
|
if (action === "list") {
|
|
@@ -338,6 +360,7 @@ export function createSystemCliCommands(): CliCommandDef[] {
|
|
|
338
360
|
...(key === KEYBINDINGS_CONFIG_KEY ? { format: summarizeKeybindings } : {}),
|
|
339
361
|
...(key === "theme" ? { format: (value: unknown) => describeThemeId(String(value)) } : {}),
|
|
340
362
|
...(key === TIMEZONE_CONFIG_KEY ? { format: describeTimezone } : {}),
|
|
363
|
+
...(key === CSV_DECIMAL_CONFIG_KEY ? { format: describeCsvDecimal } : {}),
|
|
341
364
|
...(key === "baseCurrency" ? { format: describeBaseCurrency } : {}),
|
|
342
365
|
...(key === "telemetry.attention" ? { format: describeAttentionSetting } : {}),
|
|
343
366
|
})),
|
|
@@ -359,6 +382,7 @@ export function createSystemCliCommands(): CliCommandDef[] {
|
|
|
359
382
|
ctx.printResult({ data: { key, value: safeConfig[key] } }, {
|
|
360
383
|
text: (data) => key === KEYBINDINGS_CONFIG_KEY ? renderKeybindings(data.value)
|
|
361
384
|
: key === TIMEZONE_CONFIG_KEY ? describeTimezone(data.value)
|
|
385
|
+
: key === CSV_DECIMAL_CONFIG_KEY ? describeCsvDecimal(data.value)
|
|
362
386
|
: key === "baseCurrency" ? describeBaseCurrency(data.value)
|
|
363
387
|
: key === "telemetry.attention" ? describeAttentionSetting(data.value) : describeConfigValue(data.value),
|
|
364
388
|
});
|
|
@@ -404,6 +428,8 @@ export function createSystemCliCommands(): CliCommandDef[] {
|
|
|
404
428
|
? parseTimezoneSetting(value)
|
|
405
429
|
: key === UPDATE_CHANNEL_CONFIG_KEY
|
|
406
430
|
? parseUpdateChannel(value)
|
|
431
|
+
: key === CSV_DECIMAL_CONFIG_KEY
|
|
432
|
+
? parseCsvDecimal(value, `config set ${CSV_DECIMAL_CONFIG_KEY}`)
|
|
407
433
|
: key === "refreshIntervalMinutes"
|
|
408
434
|
? Number(value)
|
|
409
435
|
: isBooleanConfigKey(key)
|
|
@@ -417,7 +443,9 @@ export function createSystemCliCommands(): CliCommandDef[] {
|
|
|
417
443
|
? withTimezone(context.config, parsedValue as string | null)
|
|
418
444
|
: key === UPDATE_CHANNEL_CONFIG_KEY
|
|
419
445
|
? withUpdateChannel(context.config, parsedValue as "stable" | "nightly")
|
|
420
|
-
:
|
|
446
|
+
: key === CSV_DECIMAL_CONFIG_KEY
|
|
447
|
+
? withCsvDecimal(context.config, parsedValue as CsvDecimal)
|
|
448
|
+
: { ...context.config, [key]: parsedValue };
|
|
421
449
|
if (!ctx.cliOptions.dryRun) await saveConfig(nextConfig);
|
|
422
450
|
ctx.printResult({
|
|
423
451
|
data: {
|
|
@@ -59,9 +59,10 @@ import { apiClient } from "../../api-client";
|
|
|
59
59
|
import { withBalanceSheetRate } from "../../market-data/quotes/balance-sheet-rate";
|
|
60
60
|
import { enterpriseValueBridgeNote, listingEnterpriseValue } from "../../market-data/quotes/listing-enterprise-value";
|
|
61
61
|
import { regularSessionValuationPrice } from "../../market-data/quotes/regular-session-valuation";
|
|
62
|
+
import { quoteStatsBasisText } from "../../market-data/quotes/export-identity";
|
|
62
63
|
import { computeTickerPriceReturns } from "../../market-data/ticker-price-returns";
|
|
63
64
|
import { instrumentTypeLabel, resolveTickerInstrumentKind } from "../../tickers/instrument-kind";
|
|
64
|
-
import { INDEX_POINTS_LABEL, isIndexLevel, reportedQuoteVolume } from "../../market-data/market/index-level";
|
|
65
|
+
import { INDEX_POINTS_LABEL, isIndexLevel, quoteVolumeCurrency, reportedQuoteVolume } from "../../market-data/market/index-level";
|
|
65
66
|
import type { SecFilingItem } from "../../types/data-provider";
|
|
66
67
|
import type { NewsArticle } from "../../news/types";
|
|
67
68
|
import { summaryRestatesHeadline } from "../../news/news-model";
|
|
@@ -1479,8 +1480,14 @@ export async function buildTickerReport({
|
|
|
1479
1480
|
)
|
|
1480
1481
|
: "—";
|
|
1481
1482
|
const volume = reportedQuoteVolume(quote);
|
|
1482
|
-
// A coin's volume is traded value in its quote currency (BTC-USD: US dollars), not a count of coins
|
|
1483
|
-
|
|
1483
|
+
// A coin's volume is traded value in its quote currency (BTC-USD: US dollars), not a count of coins, and its
|
|
1484
|
+
// range and volume say whose day they are (composite, 1 exchange), as the Overview's do.
|
|
1485
|
+
const volumeCurrency = quoteVolumeCurrency(quote, symbol);
|
|
1486
|
+
const coinBasis = (range: boolean) => {
|
|
1487
|
+
const basis = quoteStatsBasisText(quote, range);
|
|
1488
|
+
return basis ? ` (${basis})` : "";
|
|
1489
|
+
};
|
|
1490
|
+
const rangeBasis = consolidatedRangeBasis(quote);
|
|
1484
1491
|
// A futures price is its latest trade; the exchange settlement is its own row, dated by its session.
|
|
1485
1492
|
appendMetricSection(lines, "Quote", [
|
|
1486
1493
|
// A price in cents says what it is per: 314.95¢/lb.
|
|
@@ -1496,7 +1503,7 @@ export async function buildTickerReport({
|
|
|
1496
1503
|
// A listing that no longer trades: its last session's range, never today's. A US line's says what it counts,
|
|
1497
1504
|
// the rule GIP and TAS read the session's low and high by.
|
|
1498
1505
|
[quote.delisting ? "Last Session" : "Day Range", quote.low != null || quote.high != null
|
|
1499
|
-
? `${formatPriceRange(quote.low, quote.high, quote.currency, quoteOptions)}${
|
|
1506
|
+
? `${formatPriceRange(quote.low, quote.high, quote.currency, quoteOptions)}${rangeBasis ? ` (${rangeBasis})` : coinBasis(true)}`
|
|
1500
1507
|
: "—"],
|
|
1501
1508
|
// The year's high and low come from bars (a continuous future's are float32, 54.97999954): they print at
|
|
1502
1509
|
// the instrument's own decimals, as the Overview's ranges do, never at every digit the bars carry.
|
|
@@ -1504,7 +1511,7 @@ export async function buildTickerReport({
|
|
|
1504
1511
|
["52W Range", yearRangeText(quote, quoteOptions)],
|
|
1505
1512
|
["Bid / Ask", bidAskText(quote, quoteOptions)],
|
|
1506
1513
|
// An index's and a perpetual's 0 means none is counted, not no trades: no Volume row.
|
|
1507
|
-
["Volume", volume != null ? `${formatNumber(volume, 0)}${volumeCurrency}` : "—"],
|
|
1514
|
+
["Volume", volume != null ? `${formatNumber(volume, 0)}${volumeCurrency ? ` ${volumeCurrency}` : ""}${coinBasis(false)}` : "—"],
|
|
1508
1515
|
["Updated", formatTimestamp(quoteHeadlineTime(quote))],
|
|
1509
1516
|
]);
|
|
1510
1517
|
|
|
@@ -18,12 +18,15 @@ const AUTH_IN_FAMILY = /^\/cloud\/auth(?:\/|$)/;
|
|
|
18
18
|
* theses, and a signed-in broker's catalog, connection status, holdings,
|
|
19
19
|
* orders and fills. The Buildout plan is one: its answer is the plan and its
|
|
20
20
|
* prices, never the token `POST /account/buildout/token` mints, which stays
|
|
21
|
-
* refused, so the Buildout panes cannot be drawn with a plan's data.
|
|
21
|
+
* refused, so the Buildout panes cannot be drawn with a plan's data. So is
|
|
22
|
+
* the account's place on an add-on waitlist (joined or not); joining and
|
|
23
|
+
* leaving are writes, refused like any other.
|
|
22
24
|
*/
|
|
23
25
|
const READ_PATHS = [
|
|
24
26
|
/^\/auth\/get-session$/,
|
|
25
27
|
/^\/account\/cloud$/,
|
|
26
28
|
/^\/account\/buildout$/,
|
|
29
|
+
/^\/account\/waitlist\/[a-z0-9-]+$/,
|
|
27
30
|
/^\/pricing$/,
|
|
28
31
|
/^\/health$/,
|
|
29
32
|
/^\/roadmap$/,
|
|
@@ -357,7 +357,8 @@ async function startShotBrowser(
|
|
|
357
357
|
}
|
|
358
358
|
throw error;
|
|
359
359
|
}
|
|
360
|
-
const {
|
|
360
|
+
const { browserContextId } = await connection.send("Target.createBrowserContext", { disposeOnDetach: true }) as { browserContextId: string };
|
|
361
|
+
const { targetId } = await connection.send("Target.createTarget", { url: "about:blank", browserContextId }) as { targetId: string };
|
|
361
362
|
const { sessionId } = await connection.send("Target.attachToTarget", { targetId, flatten: true }) as { sessionId: string };
|
|
362
363
|
const page: CdpPage = { send: (method, params) => connection.send(method, params, sessionId) };
|
|
363
364
|
return {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { existsSync } from "fs";
|
|
2
|
-
import { mkdtemp, rm } from "fs/promises";
|
|
3
|
-
import { tmpdir } from "os";
|
|
4
2
|
import { join } from "path";
|
|
5
3
|
import { buildViewBundle, electrobunViewPath, readViewStylesheet } from "../renderers/dom/build-assets";
|
|
4
|
+
import { withShotTempDir } from "./shot-temp-dir";
|
|
6
5
|
|
|
7
6
|
/**
|
|
8
7
|
* The page `shot` and rendered `fn` reports draw a pane in: the view bundle,
|
|
@@ -90,13 +89,10 @@ async function unpackShotView(archivePath: string): Promise<ShotViewFiles> {
|
|
|
90
89
|
async function buildShotViewFromSource(): Promise<ShotViewFiles> {
|
|
91
90
|
// A bundle of the CLI without its sources, and without the page embedded.
|
|
92
91
|
if (!existsSync(electrobunViewPath(SHOT_VIEW_ENTRY))) throw new Error(MISSING_VIEW_MESSAGE);
|
|
93
|
-
|
|
94
|
-
try {
|
|
92
|
+
return withShotTempDir("gloom-pane-shot-view-", async (dir) => {
|
|
95
93
|
await buildShotView(dir, process.env.GLOOMBERB_API_URL ?? "");
|
|
96
94
|
return completeShotView(await readShotViewDir(dir));
|
|
97
|
-
}
|
|
98
|
-
await rm(dir, { recursive: true, force: true });
|
|
99
|
-
}
|
|
95
|
+
});
|
|
100
96
|
}
|
|
101
97
|
|
|
102
98
|
/**
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import type { ScannerCapture } from "../plugins/builtin/shared/scanner-capture";
|
|
2
2
|
import type { TapeCapture } from "../plugins/builtin/time-sales/snapshot-client";
|
|
3
|
-
import { mkdtemp, rm } from "fs/promises";
|
|
4
3
|
import { randomBytes, timingSafeEqual } from "crypto";
|
|
5
|
-
import { tmpdir } from "os";
|
|
6
4
|
import { join } from "path";
|
|
7
5
|
import { writeOutputFile } from "./output-file";
|
|
6
|
+
import { withShotTempDir } from "./shot-temp-dir";
|
|
8
7
|
import { encodeRpcValue } from "../renderers/electrobun/shared/rpc-codec";
|
|
9
8
|
import type { AppConfig } from "../types/config";
|
|
10
9
|
import type { ChartResolutionResult } from "../time-series/types";
|
|
@@ -272,32 +271,31 @@ export async function renderDesktopPaneScreenshot(
|
|
|
272
271
|
): Promise<DesktopPaneShotRenderResult> {
|
|
273
272
|
const chrome = await findChromeExecutable();
|
|
274
273
|
const view = await loadShotView();
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
},
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
}
|
|
274
|
+
return withShotTempDir("gloom-pane-shot-", async (tempDir) => {
|
|
275
|
+
const server = serveShotPage(view, shotPageHtml(view, payload), apiProxy, options.bridge ?? null);
|
|
276
|
+
try {
|
|
277
|
+
return await capturePageScreenshot({
|
|
278
|
+
chrome,
|
|
279
|
+
url: server.url,
|
|
280
|
+
outputPath,
|
|
281
|
+
widthPx: payload.widthPx,
|
|
282
|
+
heightPx: payload.heightPx,
|
|
283
|
+
deviceScaleFactor: payload.deviceScaleFactor ?? DEFAULT_DEVICE_SCALE_FACTOR,
|
|
284
|
+
userDataDir: join(tempDir, "chrome-profile"),
|
|
285
|
+
captureImage: options.captureImage !== false,
|
|
286
|
+
statusLine: payload.statusLine ? options.statusLine : undefined,
|
|
287
|
+
...(payload.maxHeightCells ? {
|
|
288
|
+
fitRows: {
|
|
289
|
+
heightCells: payload.heightCells,
|
|
290
|
+
maxHeightCells: payload.maxHeightCells,
|
|
291
|
+
roles: payload.fitRoles ?? ["data-table-body-scroll"],
|
|
292
|
+
},
|
|
293
|
+
} : {}),
|
|
294
|
+
});
|
|
295
|
+
} finally {
|
|
296
|
+
server.stop();
|
|
297
|
+
}
|
|
298
|
+
});
|
|
301
299
|
}
|
|
302
300
|
|
|
303
301
|
/** The page for one capture: the shared view, with this capture's pane and data in its bootstrap script. */
|
package/src/cli/errors.ts
CHANGED
|
@@ -135,7 +135,9 @@ function cliErrorObject(error: unknown): CliErrorObject {
|
|
|
135
135
|
}
|
|
136
136
|
// A source failed (a timeout, a rate limit) where none had the data to answer: asked again it may.
|
|
137
137
|
if (isSourceFailure(error) || isSourceUnavailableAnswer(error)) {
|
|
138
|
-
|
|
138
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
139
|
+
// It failed, it is not missing: says to ask again unless the message already says when.
|
|
140
|
+
return { code: SOURCE_UNAVAILABLE_CODE, message, ...(/\btry again\b/i.test(message) ? {} : { details: "Try again in a moment." }), retryable: true };
|
|
139
141
|
}
|
|
140
142
|
// A listing read the data service failed to answer twice: said in Gloom's words. Any other 5xx keeps the server's.
|
|
141
143
|
if (wasAskedTwice(error)) {
|
package/src/cli/freshness.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type { HeadlessPaneFreshness, HeadlessPaneRow } from "../types/headless";
|
|
|
3
3
|
import { deriveHeadlessFreshness, type ReportFreshness } from "./pane-functions/freshness";
|
|
4
4
|
import { quoteObservation, REPORTED_DATA } from "../plugins/builtin/shared/report-freshness";
|
|
5
5
|
import { latestReportedPeriod } from "../utils/latest-financial-period";
|
|
6
|
+
import { quoteSourceName } from "../market-data/quotes/export-identity";
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* The source, as-of and status line of a plain CLI command, derived exactly as
|
|
@@ -33,8 +34,12 @@ export function quotesFreshness(
|
|
|
33
34
|
declared?: HeadlessPaneFreshness,
|
|
34
35
|
now = Date.now(),
|
|
35
36
|
): ReportFreshness | undefined {
|
|
36
|
-
const
|
|
37
|
-
|
|
37
|
+
const shown = [...quotes].filter((quote): quote is Quote => quote != null);
|
|
38
|
+
const rows = shown.map((quote) => quoteObservation(quote, now));
|
|
39
|
+
// A coin priced by an exchange's own trade names the exchange, as its pane footer does: `Coinbase and Kraken`.
|
|
40
|
+
const names = shown.some((quote) => quote.priceVenue) ? [...new Set(shown.map((quote) => quoteSourceName(quote)))] : [];
|
|
41
|
+
const source = !declared?.source && names.length > 0 && names.every(Boolean) ? names.join(" and ") : undefined;
|
|
42
|
+
return rows.length > 0 ? rowsFreshness(rows, source ? { ...declared, source } : declared, undefined, now) : undefined;
|
|
38
43
|
}
|
|
39
44
|
|
|
40
45
|
/**
|
package/src/cli/glossary.ts
CHANGED
|
@@ -126,7 +126,7 @@ export const GLOSSARY: readonly GlossaryEntry[] = [
|
|
|
126
126
|
definition: "The nine-character code that identifies a US security. A reopening repeats the original issue's CUSIP.",
|
|
127
127
|
},
|
|
128
128
|
{
|
|
129
|
-
term: "Bill", aliases: ["t-bill", "treasury bill", "bills"], functions: ["AUCT", "BTMM"], shown: ["Bill", "bill"],
|
|
129
|
+
term: "Bill", aliases: ["t-bill", "t-bills", "tbill", "tbills", "treasury bill", "bills"], functions: ["AUCT", "BTMM"], shown: ["Bill", "bill"],
|
|
130
130
|
definition: "Treasury debt of a year or less, sold below face value with no coupon; the climb back to face value is the interest.",
|
|
131
131
|
},
|
|
132
132
|
{
|
|
@@ -870,11 +870,16 @@ export const GLOSSARY: readonly GlossaryEntry[] = [
|
|
|
870
870
|
+ "(10 bp is about ±5 points at 7 days), so CTM greys it there and Vs Spot is the figure to read.",
|
|
871
871
|
},
|
|
872
872
|
{
|
|
873
|
-
term: "Crypto composite price", aliases: ["CCC", "crypto composite", "composite price", "composite crypto price"], functions: ["CTM"],
|
|
873
|
+
term: "Crypto composite price", aliases: ["CCC", "crypto composite", "composite price", "composite crypto price"], functions: ["CTM", "CRYP"],
|
|
874
874
|
shown: ["crypto composite price"],
|
|
875
|
-
definition: "A coin's dollar price blended from trading on
|
|
876
|
-
+ "
|
|
877
|
-
+ "
|
|
875
|
+
definition: "A coin's dollar price blended from trading on many crypto exchanges, Binance, Coinbase, Kraken and Bitstamp among them, "
|
|
876
|
+
+ "quoted around the clock under the code CCC. "
|
|
877
|
+
+ "Its 5-minute low or high can be one exchange's brief wick: CRYP reads Coinbase's, Kraken's and Bitstamp's own candles "
|
|
878
|
+
+ "around it and says Coinbase only when one alone reached it, other exchange when none of them did. "
|
|
879
|
+
+ "An exchange's price outside the composite's 24-hour range widens it, and the extreme says so (+ Kraken). "
|
|
880
|
+
+ "A price named after an exchange (Coinbase · 15:55 UTC) is that exchange's own price at that time, not the composite. "
|
|
881
|
+
+ "An intraday bar's volume counts the spot venues the bar names (1 spot venue), not every exchange. "
|
|
882
|
+
+ "CTM reads CME crypto futures against the composite, while the futures settle to CME's own reference rate, so a small gap at expiry is expected.",
|
|
878
883
|
},
|
|
879
884
|
{
|
|
880
885
|
term: "Contango", aliases: ["contango curve", "upward curve"], functions: ["CTM", "FUT"], shown: ["contango", "Contango"],
|
package/src/cli/help.ts
CHANGED
|
@@ -48,6 +48,7 @@ const GLOBAL_OPTIONS: Array<[string, string]> = [
|
|
|
48
48
|
["--csv", "Print rows as CSV under the columns the text shows; each row ends with what it is, its source, as_of and retrieved_at (when it was read), then any columns a report adds (a formula's leg contracts, a board's Group), and fn reports and fundamentals put each table under # section:. The closing source and note lines go to stderr, not into the rows or an --output file"],
|
|
49
49
|
["--ndjson", "Print one JSON object per table row"],
|
|
50
50
|
["--output <path>, --out <path>", "Write a --csv, --json or --ndjson export to this file in UTF-8, and print where it went (a redirect is UTF-16 in Windows PowerShell 5.1)"],
|
|
51
|
+
["--decimal comma|dot", "Write a --csv export's numbers with a decimal comma (17,2), cells split by ;, for a spreadsheet in a decimal-comma locale; or a dot. gloom config set csvDecimal comma makes the comma the default. Text and JSON keep the dot"],
|
|
51
52
|
["--limit <n>", "Show at most n rows, the first n as printed"],
|
|
52
53
|
["--tail <n>", "Show the newest n rows of a dated series (history, fred, econ) in their printed order, or the last n of another list"],
|
|
53
54
|
["--refresh", "Fetch fresh data instead of reading the cache"],
|
package/src/cli/helpers.ts
CHANGED
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
formatNumber,
|
|
6
6
|
formatPercentRaw,
|
|
7
7
|
} from "../utils/format";
|
|
8
|
-
import { formatMarketChangeWithCurrency, formatMarketPriceWithCurrency, type MarketFormatOptions } from "../market-data/market/format";
|
|
8
|
+
import { formatMarketChangeWithCurrency, formatMarketPriceRange, formatMarketPriceWithCurrency, type MarketFormatOptions } from "../market-data/market/format";
|
|
9
9
|
import { changeBasisLabel, changeBasisNote, printPredatesChangeBasis, quoteChangeBasis } from "../market-data/market/change-basis";
|
|
10
10
|
import type { FuturesContractTermsPayload } from "../api-client/futures-curve";
|
|
11
11
|
import type { ActiveQuoteDisplay } from "../market-data/market/status";
|
|
@@ -100,12 +100,8 @@ export function dryRunNote(dryRun: boolean): string {
|
|
|
100
100
|
return dryRun ? cliStyles.muted(" (dry run, nothing saved)") : "";
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
/** Low and high of a range. A sub-unit quote (pence shown in pounds) varies in decimals,
|
|
108
|
-
* so its pair shares one count: £35.1000 - £35.4871, not £35.10 - £35.4871. */
|
|
103
|
+
/** Low and high of a range, both to one number of decimals (formatMarketPriceRange): £35.1000 - £35.4871 for pence
|
|
104
|
+
* shown in pounds, not £35.10 - £35.4871, and a coin's at its price's decimals. */
|
|
109
105
|
export function formatPriceRange(
|
|
110
106
|
low: number | undefined,
|
|
111
107
|
high: number | undefined,
|
|
@@ -113,15 +109,11 @@ export function formatPriceRange(
|
|
|
113
109
|
options: MarketFormatOptions,
|
|
114
110
|
separator = " - ",
|
|
115
111
|
): string {
|
|
116
|
-
|
|
117
|
-
value == null ? "—" : formatMarketPriceWithCurrency(value, currency,
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
if (!options.quotedUnitDivisor || low == null || high == null) return `${lowText}${separator}${highText}`;
|
|
122
|
-
const digits = Math.max(fractionDigits(lowText), fractionDigits(highText));
|
|
123
|
-
if (fractionDigits(lowText) === digits && fractionDigits(highText) === digits) return `${lowText}${separator}${highText}`;
|
|
124
|
-
return `${format(low, { fixedFractionDigits: digits })}${separator}${format(high, { fixedFractionDigits: digits })}`;
|
|
112
|
+
if (low == null || high == null) {
|
|
113
|
+
const format = (value: number | undefined) => value == null ? "—" : formatMarketPriceWithCurrency(value, currency, options);
|
|
114
|
+
return `${format(low)}${separator}${format(high)}`;
|
|
115
|
+
}
|
|
116
|
+
return formatMarketPriceRange(low, high, options, currency).join(separator);
|
|
125
117
|
}
|
|
126
118
|
|
|
127
119
|
/** A timestamp in CLI text: UTC with the zone named, the same on every machine. */
|
|
@@ -16,6 +16,10 @@ export interface HistoryListRow extends HistoryRow {
|
|
|
16
16
|
symbol: string;
|
|
17
17
|
/** Why the symbol has no bars, as its warning says it; only on a symbol's one row with no bar. */
|
|
18
18
|
status?: string;
|
|
19
|
+
/** In a list read from a file or standard input, the line the row is for, as typed. */
|
|
20
|
+
input?: string;
|
|
21
|
+
/** In such a list, the earlier line that is the same listing. */
|
|
22
|
+
duplicateOf?: string;
|
|
19
23
|
}
|
|
20
24
|
|
|
21
25
|
type ExportedRow = Record<string, unknown>;
|
package/src/cli/history-rows.ts
CHANGED
|
@@ -493,6 +493,30 @@ export function historyRows(
|
|
|
493
493
|
});
|
|
494
494
|
}
|
|
495
495
|
|
|
496
|
+
/** Bars a volume step is read from, how many of them must have one, and the newest bars that may differ from it. */
|
|
497
|
+
const VOLUME_STEP_BARS = 20;
|
|
498
|
+
const VOLUME_STEP_MIN_BARS = 5;
|
|
499
|
+
const VOLUME_STEP_NEWEST = 2;
|
|
500
|
+
|
|
501
|
+
/**
|
|
502
|
+
* The volumes a text table prints at the step the rest of the column is in, by bar date: daily or longer bars whose
|
|
503
|
+
* source serves volume in whole hundreds (round lots) and the newest one or two as exact counts (the session's own
|
|
504
|
+
* feed) print those at the hundred too, so the column reads at one precision, never 6,764,700 above 4,650,114.
|
|
505
|
+
* Only the text rounds: the rows, `--json` and `--csv` keep every count as served. Empty for bars of another step
|
|
506
|
+
* and for intraday bars.
|
|
507
|
+
*/
|
|
508
|
+
export function historyTextVolumes(rows: ReadonlyArray<{ date: string; volume: number | null }>, intraday: boolean): Map<string, number> {
|
|
509
|
+
const shown = new Map<string, number>();
|
|
510
|
+
if (intraday) return shown;
|
|
511
|
+
const recent = rows.slice(-VOLUME_STEP_BARS);
|
|
512
|
+
const older = recent.slice(0, -VOLUME_STEP_NEWEST).flatMap((row) => row.volume != null && row.volume > 0 ? [row.volume] : []);
|
|
513
|
+
if (older.length < VOLUME_STEP_MIN_BARS || !older.every((volume) => volume % 100 === 0)) return shown;
|
|
514
|
+
for (const row of rows.slice(-VOLUME_STEP_NEWEST)) {
|
|
515
|
+
if (row.volume != null && row.volume % 100 !== 0) shown.set(row.date, Math.round(row.volume / 100) * 100);
|
|
516
|
+
}
|
|
517
|
+
return shown;
|
|
518
|
+
}
|
|
519
|
+
|
|
496
520
|
/** Bars on each side of a bar whose volumes it is held against. */
|
|
497
521
|
const THIN_NEIGHBOURS = 5;
|
|
498
522
|
/** A bar under this share of its neighbours' median volume traded thin. */
|
package/src/cli/index.ts
CHANGED
|
@@ -28,6 +28,7 @@ import { CLI_EXIT_CODES } from "./exit-codes";
|
|
|
28
28
|
import { asUsageError, fail, inferCliErrorOptions, printCliError } from "./errors";
|
|
29
29
|
import { cliStyles, setCliColorEnabledOverride, setCliPlainOverride, setCliWidthOverride } from "../utils/cli-output";
|
|
30
30
|
import { setDisplayTimeZone } from "../utils/utc-time";
|
|
31
|
+
import { setCsvDecimal } from "../utils/csv";
|
|
31
32
|
import { collectSavedCopies } from "../data/saved-copies";
|
|
32
33
|
import { search, searchCandidatesForCli, buildSearchReport } from "./commands/search";
|
|
33
34
|
import { ticker } from "./commands/ticker";
|
|
@@ -398,6 +399,8 @@ async function createRegistry(options: DispatchCliOptions = {}): Promise<CliComm
|
|
|
398
399
|
const config = await loadCliConfigIfAvailable();
|
|
399
400
|
// Every time a command prints follows the reader's zone from here on.
|
|
400
401
|
setDisplayTimeZone(config?.timezone);
|
|
402
|
+
// Every CSV is written with the reader's decimal mark from here on; --decimal decides for one run.
|
|
403
|
+
setCsvDecimal(config?.csvDecimal);
|
|
401
404
|
let registry: CliCommandRegistry | null = null;
|
|
402
405
|
const coreCommands = createCoreCliCommands(
|
|
403
406
|
() => listedCommands(registry!).map(({ command, source }) => ({ command, source })),
|
|
@@ -435,6 +438,7 @@ export async function dispatchCli(args: string[], options: DispatchCliOptions =
|
|
|
435
438
|
}
|
|
436
439
|
|
|
437
440
|
const registry = await createRegistry(options);
|
|
441
|
+
if (parsed.options.decimal) setCsvDecimal(parsed.options.decimal);
|
|
438
442
|
const token = normalizeCliCommandToken(foldTypedText(command));
|
|
439
443
|
let resolved = registry.lookup.get(token);
|
|
440
444
|
if (!resolved) {
|
package/src/cli/known-gaps.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { parsePublicTickerKey } from "../utils/exchanges";
|
|
|
5
5
|
import { commandWord } from "../utils/shell-word";
|
|
6
6
|
import { listingAbroadVenue } from "../utils/sec";
|
|
7
7
|
import { nimCommand } from "./bank-section";
|
|
8
|
-
import { treasuryYieldLine, treasuryYieldTenor } from "./treasury-yields";
|
|
8
|
+
import { treasuryBillLine, treasuryYieldLine, treasuryYieldTenor } from "./treasury-yields";
|
|
9
9
|
import { namedCurrencyPair } from "./currency-name-hint";
|
|
10
10
|
import { dollarPairListing } from "../utils/currency-pair";
|
|
11
11
|
import { currencyCodeTyped } from "../utils/currency-names";
|
|
@@ -589,7 +589,7 @@ export function knownGapMessage(query: string): string | null {
|
|
|
589
589
|
const index = uncarriedIndexFor(query);
|
|
590
590
|
if (index) return uncarriedIndexLine(index);
|
|
591
591
|
return KNOWN_GAPS.find((gap) => namesKnownGap(gap, query))?.message
|
|
592
|
-
?? (tenor ? treasuryYieldLine(tenor) : null)
|
|
592
|
+
?? (tenor ? treasuryBillLine(query, tenor) ?? treasuryYieldLine(tenor) : null)
|
|
593
593
|
?? topicPointer(query)?.message
|
|
594
594
|
?? macroReleaseTopic(query)?.line ?? null;
|
|
595
595
|
}
|