gloomberb 0.20.3 → 0.20.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.
Files changed (348) hide show
  1. package/README.md +2 -0
  2. package/bin/gloom +9 -0
  3. package/bin/without-bun.cjs +98 -0
  4. package/package.json +3 -1
  5. package/src/account/auth-dialog.tsx +17 -0
  6. package/src/api-client/data.ts +144 -35
  7. package/src/api-client/fx-interventions.ts +64 -0
  8. package/src/api-client/index.ts +1 -0
  9. package/src/api-client/release-summaries.ts +21 -0
  10. package/src/api-client/types/econ.ts +12 -0
  11. package/src/api-client/yield-curves.ts +1 -1
  12. package/src/app/global-shortcuts.ts +4 -1
  13. package/src/app/keybindings/actions.ts +8 -2
  14. package/src/app/keybindings/config.ts +2 -1
  15. package/src/app/keybindings/index.ts +1 -0
  16. package/src/app/keybindings/labels.ts +6 -1
  17. package/src/app/keybindings/resolve.ts +23 -4
  18. package/src/app/keybindings/terminal-keys.ts +35 -0
  19. package/src/app/pane-runtime/index.tsx +2 -2
  20. package/src/app/pane-runtime/ticker-open-runtime.ts +274 -67
  21. package/src/architecture/ui-literals-allowlist.json +1 -1
  22. package/src/capabilities/chart-series.ts +27 -1
  23. package/src/cli/commands/keybindings.ts +5 -5
  24. package/src/cli/commands/market.ts +154 -21
  25. package/src/cli/commands/news-search.ts +60 -10
  26. package/src/cli/commands/overview.ts +16 -1
  27. package/src/cli/commands/plugins.ts +27 -5
  28. package/src/cli/commands/remote.ts +16 -17
  29. package/src/cli/commands/system.ts +20 -4
  30. package/src/cli/commands/ticker.ts +60 -19
  31. package/src/cli/fx-forward.ts +25 -7
  32. package/src/cli/glossary.ts +19 -5
  33. package/src/cli/history-rows.ts +5 -3
  34. package/src/cli/index.ts +8 -8
  35. package/src/cli/known-gaps.ts +27 -1
  36. package/src/cli/listing-arg.ts +11 -1
  37. package/src/cli/name-entries.ts +5 -1
  38. package/src/cli/not-a-ticker.ts +4 -0
  39. package/src/cli/pane-functions/function-help.ts +5 -5
  40. package/src/cli/report-tables.ts +18 -6
  41. package/src/cli/result.ts +15 -7
  42. package/src/cli/types.ts +2 -0
  43. package/src/components/chart/composite/axis-overlays.tsx +22 -0
  44. package/src/components/chart/composite/composite-chart.tsx +54 -13
  45. package/src/components/chart/composite/event-captions.ts +109 -0
  46. package/src/components/chart/composite/event-guides.ts +74 -0
  47. package/src/components/chart/composite/rasterizer.ts +2 -0
  48. package/src/components/chart/composite/text-renderer.ts +2 -0
  49. package/src/components/chart/composite/types.ts +31 -0
  50. package/src/components/command-bar/layout-items/focused-pane.ts +5 -5
  51. package/src/components/command-bar/pane-settings.ts +2 -2
  52. package/src/components/command-bar/routes/root/provider-search.ts +5 -4
  53. package/src/components/command-bar/routes/root/results.ts +6 -2
  54. package/src/components/command-bar/routes/ticker-search/results.ts +51 -0
  55. package/src/components/command-bar/routes/ticker-search/route.ts +3 -2
  56. package/src/components/input-search-bar.tsx +9 -2
  57. package/src/components/layout/detached-pane-shell.tsx +1 -1
  58. package/src/components/layout/floating-pane.tsx +5 -1
  59. package/src/components/layout/pane/footer/index.tsx +21 -14
  60. package/src/components/layout/pane/footer/model.ts +6 -0
  61. package/src/components/layout/pane/header.tsx +2 -0
  62. package/src/components/layout/shell/action-menu-overlay.tsx +10 -5
  63. package/src/components/layout/shell/active-drag.ts +149 -105
  64. package/src/components/layout/shell/drag/drop-zones.ts +162 -0
  65. package/src/components/layout/shell/drag/index.ts +47 -218
  66. package/src/components/layout/shell/drag/live.ts +10 -3
  67. package/src/components/layout/shell/drag/overlays.tsx +182 -5
  68. package/src/components/layout/shell/drag/runtime.ts +29 -6
  69. package/src/components/layout/shell/drag/shared-edges.ts +156 -0
  70. package/src/components/layout/shell/index.tsx +11 -6
  71. package/src/components/layout/shell/menu.ts +11 -2
  72. package/src/components/layout/shell/native/pointer-runtime.ts +25 -0
  73. package/src/components/layout/shell/native/window-state.ts +2 -2
  74. package/src/components/layout/shell/pane/capture.ts +4 -1
  75. package/src/components/layout/shell/pane/layers.tsx +71 -7
  76. package/src/components/layout/shell/terminal-pointer-runtime.ts +18 -9
  77. package/src/components/layout/shell/window-mode/index.ts +8 -10
  78. package/src/components/layout/status-bar.tsx +6 -1
  79. package/src/components/layout/window-edit/mode.ts +39 -7
  80. package/src/components/layout/window-edit/presentation.ts +1 -1
  81. package/src/components/onboarding/first-run-workspace.ts +44 -2
  82. package/src/components/onboarding/onboarding-frame.tsx +11 -2
  83. package/src/components/onboarding/onboarding-keyboard.ts +20 -0
  84. package/src/components/onboarding/onboarding-wizard.tsx +16 -11
  85. package/src/components/onboarding/portfolio-step/positions-panel.tsx +62 -1
  86. package/src/components/onboarding/use-onboarding-progress.ts +12 -4
  87. package/src/components/pane-settings-dialog/desktop.tsx +2 -2
  88. package/src/components/pane-settings-dialog/tui.tsx +2 -2
  89. package/src/components/pane-settings-dialog/value.ts +6 -0
  90. package/src/components/pane-settings-dialog.tsx +3 -3
  91. package/src/components/reader/detail-reader.tsx +4 -0
  92. package/src/components/ui/button.tsx +2 -0
  93. package/src/components/ui/choice-dialog.tsx +1 -0
  94. package/src/components/ui/data-table/index.tsx +4 -3
  95. package/src/components/ui/index.ts +1 -1
  96. package/src/components/ui/list-view.tsx +7 -12
  97. package/src/components/ui/loading.tsx +10 -3
  98. package/src/components/ui/menu.tsx +6 -2
  99. package/src/components/ui/page-stack-view.tsx +3 -0
  100. package/src/components/ui/pane-link-chip.tsx +269 -54
  101. package/src/components/ui/query-bar.tsx +2 -1
  102. package/src/components/ui/quote.ts +14 -1
  103. package/src/components/ui/tabs.tsx +97 -19
  104. package/src/core/state/app/layout-reducer.ts +7 -0
  105. package/src/core/state/app/layout.ts +44 -7
  106. package/src/core/state/app/state.ts +1 -1
  107. package/src/core/state/app/types.ts +22 -2
  108. package/src/data/config/layout.ts +5 -2
  109. package/src/docs/snapshot.json +54 -13
  110. package/src/i18n/es.ts +9 -8
  111. package/src/i18n/ja.ts +9 -8
  112. package/src/i18n/ko.ts +9 -8
  113. package/src/i18n/zh-cn.ts +9 -8
  114. package/src/i18n/zh-tw.ts +9 -8
  115. package/src/layout/pane-manager/floating-actions.ts +17 -0
  116. package/src/layout/pane-manager/floating-stack.ts +187 -0
  117. package/src/layout/pane-manager/floating.ts +4 -2
  118. package/src/layout/pane-manager/gridlock.ts +5 -1
  119. package/src/layout/pane-manager/index.ts +11 -0
  120. package/src/layout/pane-manager/layout-state.ts +10 -3
  121. package/src/market-data/depositary-pair.ts +5 -3
  122. package/src/market-data/futures-board.ts +46 -1
  123. package/src/market-data/futures-contract.ts +12 -3
  124. package/src/market-data/fx-interventions.ts +270 -0
  125. package/src/market-data/market/dated-previous-close.ts +94 -15
  126. package/src/market-data/market/status.ts +17 -1
  127. package/src/news/news-model.ts +44 -2
  128. package/src/plugins/builtin/alerts/cli.ts +4 -4
  129. package/src/plugins/builtin/alerts/format.ts +1 -2
  130. package/src/plugins/builtin/alerts/headless.ts +1 -2
  131. package/src/plugins/builtin/alerts/move-checks.ts +12 -6
  132. package/src/plugins/builtin/alerts/move.ts +30 -9
  133. package/src/plugins/builtin/alerts/pane.tsx +0 -2
  134. package/src/plugins/builtin/alerts/storage.ts +4 -2
  135. package/src/plugins/builtin/alerts/types.ts +12 -0
  136. package/src/plugins/builtin/analytics/risk-client.ts +10 -4
  137. package/src/plugins/builtin/analytics/risk-episodes.ts +5 -4
  138. package/src/plugins/builtin/analytics/risk-headless.ts +4 -2
  139. package/src/plugins/builtin/analytics/risk-sectors.ts +91 -0
  140. package/src/plugins/builtin/awards/index.tsx +1 -1
  141. package/src/plugins/builtin/buildout/index.tsx +1 -0
  142. package/src/plugins/builtin/catalysts/index.tsx +2 -2
  143. package/src/plugins/builtin/cds/headless.ts +4 -0
  144. package/src/plugins/builtin/changelog/index.tsx +292 -101
  145. package/src/plugins/builtin/changelog/versions.ts +293 -0
  146. package/src/plugins/builtin/chart-composer/headless.ts +2 -1
  147. package/src/plugins/builtin/chart-composer/index.tsx +1 -0
  148. package/src/plugins/builtin/chart-composer/intervention-events.ts +105 -0
  149. package/src/plugins/builtin/chart-composer/pane.tsx +21 -7
  150. package/src/plugins/builtin/chat/content/composer.tsx +5 -4
  151. package/src/plugins/builtin/chat/content/index.tsx +12 -2
  152. package/src/plugins/builtin/chat/content/layout-metrics.ts +3 -3
  153. package/src/plugins/builtin/chat/content/open-targets.ts +3 -3
  154. package/src/plugins/builtin/chat/layout.ts +5 -2
  155. package/src/plugins/builtin/chat/message/pane-chip.tsx +61 -40
  156. package/src/plugins/builtin/chat/message/render-state.ts +2 -5
  157. package/src/plugins/builtin/chat/message/terminal.tsx +13 -15
  158. package/src/plugins/builtin/chat/pane-links/previews.ts +51 -5
  159. package/src/plugins/builtin/chat/pane-links/share-card.ts +36 -0
  160. package/src/plugins/builtin/cloud/askg/attached-pane.tsx +10 -5
  161. package/src/plugins/builtin/cloud/askg/controller.ts +141 -5
  162. package/src/plugins/builtin/cloud/askg/executor.ts +113 -4
  163. package/src/plugins/builtin/cloud/askg/manifest.ts +28 -13
  164. package/src/plugins/builtin/cloud/askg/model.ts +14 -4
  165. package/src/plugins/builtin/cloud/askg/pane.tsx +70 -46
  166. package/src/plugins/builtin/cloud/askg/tool-display.ts +1 -0
  167. package/src/plugins/builtin/cloud/askg/turn-parts.tsx +70 -0
  168. package/src/plugins/builtin/cloud/terminal-relay/engine.ts +50 -130
  169. package/src/plugins/builtin/cloud/terminal-relay/policy.ts +327 -7
  170. package/src/plugins/builtin/cloud/terminal-relay/prompts.tsx +2 -1
  171. package/src/plugins/builtin/cloud/terminal-relay/redact.ts +52 -9
  172. package/src/plugins/builtin/commodities-energy/index.tsx +1 -3
  173. package/src/plugins/builtin/commodities-energy/view-state.ts +3 -0
  174. package/src/plugins/builtin/commodity-balances/index.tsx +1 -0
  175. package/src/plugins/builtin/company-attention/index.tsx +1 -1
  176. package/src/plugins/builtin/company-kpis/headless.ts +3 -1
  177. package/src/plugins/builtin/company-kpis/index.tsx +2 -2
  178. package/src/plugins/builtin/cot/headless.ts +14 -2
  179. package/src/plugins/builtin/cot/index.tsx +1 -1
  180. package/src/plugins/builtin/cpi/index.tsx +1 -1
  181. package/src/plugins/builtin/crypto-board/index.tsx +1 -0
  182. package/src/plugins/builtin/dividend-yield/index.tsx +1 -0
  183. package/src/plugins/builtin/doe/index.tsx +1 -1
  184. package/src/plugins/builtin/earnings/index.tsx +2 -2
  185. package/src/plugins/builtin/earnings-calls/headless.ts +5 -1
  186. package/src/plugins/builtin/earnings-calls/index.tsx +1 -0
  187. package/src/plugins/builtin/econ/calendar-model.ts +74 -1
  188. package/src/plugins/builtin/econ/fred-catalog.ts +3 -1
  189. package/src/plugins/builtin/econ/index.tsx +1 -0
  190. package/src/plugins/builtin/econ-statistics/index.tsx +1 -0
  191. package/src/plugins/builtin/econ-statistics/pane.tsx +6 -0
  192. package/src/plugins/builtin/estimate-revisions/index.tsx +1 -0
  193. package/src/plugins/builtin/executives/index.tsx +1 -0
  194. package/src/plugins/builtin/filing-events/index.tsx +1 -0
  195. package/src/plugins/builtin/fixed-income/index.tsx +1 -0
  196. package/src/plugins/builtin/futures/index.tsx +25 -4
  197. package/src/plugins/builtin/futures/model.ts +28 -32
  198. package/src/plugins/builtin/futures/series.ts +4 -3
  199. package/src/plugins/builtin/futures/table.tsx +16 -9
  200. package/src/plugins/builtin/futures/use-board-terms.ts +3 -3
  201. package/src/plugins/builtin/futures-curve/headless.ts +3 -3
  202. package/src/plugins/builtin/futures-curve/index.tsx +1 -1
  203. package/src/plugins/builtin/futures-curve/model.ts +18 -0
  204. package/src/plugins/builtin/gpu/index.tsx +1 -1
  205. package/src/plugins/builtin/help/functions-table.tsx +1 -1
  206. package/src/plugins/builtin/help/index.tsx +14 -4
  207. package/src/plugins/builtin/help/keybindings-editor.tsx +19 -5
  208. package/src/plugins/builtin/holders/index.tsx +1 -0
  209. package/src/plugins/builtin/holders/report-header.ts +2 -2
  210. package/src/plugins/builtin/insider/index.tsx +1 -0
  211. package/src/plugins/builtin/iv-history/index.tsx +1 -1
  212. package/src/plugins/builtin/jobs/index.tsx +1 -0
  213. package/src/plugins/builtin/layout-manager/index.tsx +8 -8
  214. package/src/plugins/builtin/macro-day/headless.ts +27 -8
  215. package/src/plugins/builtin/macro-day/index.tsx +1 -1
  216. package/src/plugins/builtin/macro-day/model.ts +19 -3
  217. package/src/plugins/builtin/macro-day/pane.tsx +14 -9
  218. package/src/plugins/builtin/macro-day/releases.ts +25 -7
  219. package/src/plugins/builtin/market-valuation/index.tsx +1 -0
  220. package/src/plugins/builtin/market-valuation/pane.tsx +8 -0
  221. package/src/plugins/builtin/members/index.tsx +1 -1
  222. package/src/plugins/builtin/mna/index.tsx +1 -0
  223. package/src/plugins/builtin/news/headless.ts +2 -2
  224. package/src/plugins/builtin/news/index.tsx +4 -3
  225. package/src/plugins/builtin/news/wire/index.tsx +5 -1
  226. package/src/plugins/builtin/news/wire/news/detail-view.tsx +4 -0
  227. package/src/plugins/builtin/news/wire/news/list-search.ts +5 -2
  228. package/src/plugins/builtin/options/index.tsx +1 -0
  229. package/src/plugins/builtin/options-positioning/index.tsx +1 -0
  230. package/src/plugins/builtin/pe-band/index.tsx +1 -1
  231. package/src/plugins/builtin/perps/markets-section.tsx +5 -2
  232. package/src/plugins/builtin/plugin-marketplace/pane.tsx +11 -11
  233. package/src/plugins/builtin/portfolio-list/cli/portfolio-command.ts +25 -0
  234. package/src/plugins/builtin/portfolio-list/headless.ts +15 -6
  235. package/src/plugins/builtin/portfolio-list/summary/index.tsx +3 -1
  236. package/src/plugins/builtin/power/index.tsx +1 -1
  237. package/src/plugins/builtin/realized-vol/index.tsx +1 -1
  238. package/src/plugins/builtin/research/event-model.ts +9 -1
  239. package/src/plugins/builtin/research/event-sources.ts +22 -0
  240. package/src/plugins/builtin/research/headless.ts +11 -5
  241. package/src/plugins/builtin/research/index.tsx +4 -0
  242. package/src/plugins/builtin/research-search/index.tsx +1 -0
  243. package/src/plugins/builtin/research-search/pane.tsx +8 -0
  244. package/src/plugins/builtin/revenue-breakdown/index.tsx +1 -0
  245. package/src/plugins/builtin/reverse-dcf/index.tsx +1 -1
  246. package/src/plugins/builtin/risk-factors/index.tsx +1 -0
  247. package/src/plugins/builtin/scanner/headless.ts +52 -13
  248. package/src/plugins/builtin/seasonality/index.tsx +1 -1
  249. package/src/plugins/builtin/sec/index.tsx +1 -0
  250. package/src/plugins/builtin/series-inventory.ts +1 -1
  251. package/src/plugins/builtin/shared/cloud-upgrade.ts +27 -3
  252. package/src/plugins/builtin/shared/scanner-capture.ts +11 -3
  253. package/src/plugins/builtin/shared/series-list-detail.tsx +5 -0
  254. package/src/plugins/builtin/short-interest/index.tsx +1 -0
  255. package/src/plugins/builtin/social-mentions/index.tsx +1 -1
  256. package/src/plugins/builtin/supply-chain/index.tsx +1 -0
  257. package/src/plugins/builtin/thirteenf/data.ts +43 -10
  258. package/src/plugins/builtin/thirteenf/headless.ts +55 -11
  259. package/src/plugins/builtin/thirteenf/model.ts +25 -9
  260. package/src/plugins/builtin/thirteenf/report-notes.ts +27 -6
  261. package/src/plugins/builtin/thirteenf/types.ts +2 -0
  262. package/src/plugins/builtin/ticker-detail/adr-pair/model.ts +1 -1
  263. package/src/plugins/builtin/ticker-detail/financials/model.ts +12 -0
  264. package/src/plugins/builtin/ticker-detail/financials/ratio-table.tsx +3 -3
  265. package/src/plugins/builtin/ticker-detail/financials/tab.tsx +5 -5
  266. package/src/plugins/builtin/ticker-detail/headless.ts +18 -13
  267. package/src/plugins/builtin/ticker-detail/index.tsx +4 -0
  268. package/src/plugins/builtin/ticker-detail/overview/components.tsx +54 -5
  269. package/src/plugins/builtin/ticker-detail/overview/model.ts +6 -4
  270. package/src/plugins/builtin/ticker-detail/overview-tab.tsx +34 -17
  271. package/src/plugins/builtin/ticker-detail/pane.tsx +7 -2
  272. package/src/plugins/builtin/time-sales/client.ts +9 -11
  273. package/src/plugins/builtin/time-sales/index.tsx +1 -1
  274. package/src/plugins/builtin/treasury-auctions/after.ts +267 -0
  275. package/src/plugins/builtin/treasury-auctions/cache.ts +18 -3
  276. package/src/plugins/builtin/treasury-auctions/client.ts +33 -2
  277. package/src/plugins/builtin/treasury-auctions/headless.ts +109 -19
  278. package/src/plugins/builtin/treasury-auctions/index.tsx +14 -4
  279. package/src/plugins/builtin/treasury-auctions/model.ts +256 -28
  280. package/src/plugins/builtin/treasury-auctions/pane.tsx +139 -28
  281. package/src/plugins/builtin/treasury-auctions/treasury-direct.ts +5 -2
  282. package/src/plugins/builtin/treasury-auctions/types.ts +7 -1
  283. package/src/plugins/builtin/vol-surface/index.tsx +1 -1
  284. package/src/plugins/builtin/world-venue-map/index.ts +1 -0
  285. package/src/plugins/builtin/yield-curve/curves.ts +10 -4
  286. package/src/plugins/builtin/yield-curve/headless.ts +6 -2
  287. package/src/plugins/builtin/yield-curve/index.tsx +3 -3
  288. package/src/plugins/builtin/yield-curve/series.ts +10 -0
  289. package/src/plugins/builtin/yield-curve/world.ts +3 -1
  290. package/src/plugins/installer.ts +45 -0
  291. package/src/portfolio/column-values.ts +2 -1
  292. package/src/public/__snapshots__/public-api.test.ts.snap +4 -0
  293. package/src/public/remote.ts +7 -1
  294. package/src/remote/client.ts +191 -11
  295. package/src/remote/controller-utils.ts +13 -1
  296. package/src/remote/controller.ts +88 -26
  297. package/src/remote/endpoint.ts +24 -0
  298. package/src/remote/form.ts +59 -4
  299. package/src/remote/resources.ts +56 -19
  300. package/src/remote/schema.ts +22 -9
  301. package/src/remote/secrets.ts +12 -0
  302. package/src/remote/semantic-helpers.ts +29 -1
  303. package/src/remote/semantic-tree.tsx +44 -15
  304. package/src/remote/server.ts +2 -1
  305. package/src/remote/surface.tsx +192 -0
  306. package/src/remote/types.ts +5 -0
  307. package/src/renderers/cloudflare/worker.ts +16 -1
  308. package/src/renderers/dom/styles.css +40 -6
  309. package/src/renderers/opentui/host.tsx +6 -0
  310. package/src/renderers/share/layout-view.tsx +1 -1
  311. package/src/series/standalone.ts +2 -2
  312. package/src/shares/api.ts +21 -4
  313. package/src/shares/item.ts +73 -0
  314. package/src/shares/pane-item.ts +205 -0
  315. package/src/shares/pane.ts +4 -0
  316. package/src/shares/payload.ts +9 -5
  317. package/src/sources/gloomberb-cloud/news.ts +37 -12
  318. package/src/state/opening-ticker-panes.ts +47 -0
  319. package/src/test-support/cli-context.ts +2 -0
  320. package/src/test-support/preload.ts +4 -1
  321. package/src/tickers/instrument-kind.ts +23 -3
  322. package/src/tickers/renamed-listings.ts +105 -0
  323. package/src/tickers/search/index.ts +103 -16
  324. package/src/time-series/resolve.ts +2 -2
  325. package/src/types/config.ts +5 -0
  326. package/src/types/context-menu.ts +2 -0
  327. package/src/types/financials.ts +1 -0
  328. package/src/types/plugin-commands.ts +140 -0
  329. package/src/types/plugin-context.ts +125 -0
  330. package/src/types/plugin-contributions.ts +55 -0
  331. package/src/types/plugin-definition.ts +234 -0
  332. package/src/types/plugin-notifications.ts +38 -0
  333. package/src/types/plugin-pane-settings.ts +116 -0
  334. package/src/types/plugin-pane-templates.ts +160 -0
  335. package/src/types/plugin-panes.ts +243 -0
  336. package/src/types/plugin-reports.ts +35 -0
  337. package/src/types/plugin-shared.ts +14 -0
  338. package/src/types/plugin-state.ts +71 -0
  339. package/src/types/plugin.ts +14 -1169
  340. package/src/ui/index.tsx +14 -3
  341. package/src/updater/github-releases.ts +23 -0
  342. package/src/utils/central-banks.ts +86 -1
  343. package/src/utils/cli-output.ts +22 -9
  344. package/src/utils/datetime-format.ts +12 -3
  345. package/src/utils/depositary-receipt.ts +28 -3
  346. package/src/utils/fundamentals.ts +14 -0
  347. package/src/utils/max-drawdown.ts +97 -16
  348. package/src/utils/untrusted-text.ts +29 -0
@@ -14,6 +14,7 @@ const FIELDS = [
14
14
  "high_investment_rate",
15
15
  "high_yield",
16
16
  "avg_med_yield",
17
+ "low_yield",
17
18
  "high_price",
18
19
  "low_price",
19
20
  "avg_med_price",
@@ -29,6 +30,7 @@ const FIELDS = [
29
30
  "high_discnt_margin",
30
31
  "high_discnt_rate",
31
32
  "avg_med_discnt_rate",
33
+ "low_discnt_rate",
32
34
  ].join(",");
33
35
 
34
36
  export const AUCTION_HISTORY_DAYS = 120;
@@ -123,6 +125,33 @@ function toNumber(value: string | undefined | null): number | null {
123
125
  return Number.isFinite(parsed) ? parsed : null;
124
126
  }
125
127
 
128
+ /**
129
+ * A high and low in the order the auction cleared them. Fiscal Data has some
130
+ * early rows the other way round (the 30-year bond of 1982-02-04: high 14.47%,
131
+ * median 14.56%, low 14.61%; about 420 bills of 1979-83): a high below its low
132
+ * is read swapped when the median sits between them, and dropped when it does
133
+ * not, so neither reaches the stop-out as a negative spread. Prices follow a
134
+ * swapped pair. A bill's investment rate restates its high discount rate as
135
+ * the source had it, so once that pair is swapped or dropped the investment
136
+ * rate is blank rather than disagree with the discount rate beside it.
137
+ */
138
+ export function inClearingOrder(auction: TreasuryAuction): TreasuryAuction {
139
+ let next = auction;
140
+ for (const [high, median, low] of [["highYield", "avgMedYield", "lowYield"], ["highDiscountRate", "avgMedDiscountRate", "lowDiscountRate"]] as const) {
141
+ const top = next[high], bottom = next[low], middle = next[median];
142
+ if (top == null || bottom == null || top >= bottom) continue;
143
+ const investment = high === "highDiscountRate" ? { highInvestmentRate: null } : {};
144
+ if (middle != null && middle >= top && middle <= bottom) {
145
+ const prices = next.highPrice != null && next.lowPrice != null && next.highPrice > next.lowPrice
146
+ ? { highPrice: next.lowPrice, lowPrice: next.highPrice } : {};
147
+ next = { ...next, [high]: bottom, [low]: top, ...prices, ...investment };
148
+ } else {
149
+ next = { ...next, [high]: null, [low]: null, ...investment };
150
+ }
151
+ }
152
+ return next;
153
+ }
154
+
126
155
  export function normalizeAuction(raw: unknown): TreasuryAuction | null {
127
156
  if (!raw || typeof raw !== "object") return null;
128
157
  const record = raw as TreasuryAuctionRaw;
@@ -132,7 +161,7 @@ export function normalizeAuction(raw: unknown): TreasuryAuction | null {
132
161
  const cusip = (record.cusip ?? "").trim();
133
162
  if (!secType || !auctionDate) return null;
134
163
 
135
- return {
164
+ return inClearingOrder({
136
165
  // A reopening reuses its original CUSIP but is auctioned on its own date,
137
166
  // so CUSIP plus date is what keeps reopenings from collapsing into one row.
138
167
  id: cusip ? `${cusip}|${auctionDate}` : `${secType}|${auctionDate}|${securityTerm}`,
@@ -145,9 +174,11 @@ export function normalizeAuction(raw: unknown): TreasuryAuction | null {
145
174
  highInvestmentRate: toNumber(record.high_investment_rate),
146
175
  highDiscountRate: toNumber(record.high_discnt_rate),
147
176
  avgMedDiscountRate: toNumber(record.avg_med_discnt_rate),
177
+ lowDiscountRate: toNumber(record.low_discnt_rate),
148
178
  highDiscountMargin: toNumber(record.high_discnt_margin),
149
179
  highYield: toNumber(record.high_yield),
150
180
  avgMedYield: toNumber(record.avg_med_yield),
181
+ lowYield: toNumber(record.low_yield),
151
182
  highPrice: toNumber(record.high_price),
152
183
  lowPrice: toNumber(record.low_price),
153
184
  avgMedPrice: toNumber(record.avg_med_price),
@@ -158,7 +189,7 @@ export function normalizeAuction(raw: unknown): TreasuryAuction | null {
158
189
  primaryDealerAccepted: toNumber(record.primary_dealer_accepted),
159
190
  totalAccepted: toNumber(record.total_accepted),
160
191
  offeringAmount: toNumber(record.offering_amt),
161
- };
192
+ });
162
193
  }
163
194
 
164
195
  export function parseTreasuryAuctionsPayload(body: unknown): TreasuryAuction[] {
@@ -2,6 +2,10 @@ import type {
2
2
  HeadlessPaneDefinition,
3
3
  HeadlessPaneLoadArgs,
4
4
  } from "../../../types/plugin";
5
+ import type { HeadlessPaneColumn } from "../../../types/headless";
6
+ import {
7
+ afterLoadWindow, afterWindowStart, AUCTION_VIEWS, loadAuctionCurves, projectAuctionAfter, widerAfterWindow, type AuctionCurveRead, type AuctionView,
8
+ } from "./after";
5
9
  import { formatCompact } from "../../../utils/format";
6
10
  import { AUCTION_HISTORY_ALL, AUCTION_HISTORY_START, fetchTreasuryAuctions, type AuctionHistoryWindow } from "./client";
7
11
  import { loadTreasuryAuctions, type TreasuryAuctionsResult } from "./cache";
@@ -11,20 +15,29 @@ import { FIXED_INCOME_VIEW_STATE } from "../fixed-income/model";
11
15
  import {
12
16
  AUCTION_HISTORY_WINDOWS,
13
17
  AUCTION_SEARCH_FIELDS,
18
+ AUCTION_SORT_NAMES,
14
19
  auctionHistoryPhrase,
15
20
  auctionHistoryWindow,
16
21
  auctionSize,
22
+ auctionSortColumn,
17
23
  dealerPct,
18
24
  DEFAULT_AUCTION_SORT,
19
25
  directPct,
26
+ firstAuctionSortDirection,
20
27
  formatAuctionRate,
21
28
  indirectPct,
29
+ isAfterColumn,
30
+ isBill,
22
31
  isPendingAuction,
32
+ namesOtherMarket,
23
33
  nextAuctionHistoryWindow,
34
+ rateColumnLabel,
24
35
  rateQualifier,
25
36
  rateValue,
26
- stopOutVsAverageBp,
37
+ stopOutColumnLabel,
38
+ stopOutVsAvgBp,
27
39
  visibleAuctions,
40
+ widerWindowCouldAdd,
28
41
  type AuctionFilter,
29
42
  } from "./model";
30
43
 
@@ -40,7 +53,8 @@ const RESULTS_NOT_PUBLISHED = "results not published";
40
53
  const pending = (row: Record<string, unknown>) => isPendingAuction(row as unknown as TreasuryAuction);
41
54
 
42
55
  /** Why the stop-out column is not a tail; the docs page says the same at length. */
43
- const STOP_OUT_NOTE = "Stop-out vs avg is the high yield minus the average/median yield, in bp (bills: discount rates). "
56
+ const STOP_OUT_NOTE = "Stop-out vs median is the high yield minus the median yield, in bp (bills: discount rates); "
57
+ + "before November 1998, when most auctions were multiple-price, Treasury published the average, so older rows read against the average. "
44
58
  + "A true tail, the stop-out against the 1 pm when-issued yield, needs the when-issued yield, which the source does not carry.";
45
59
 
46
60
  const MISSING_METRICS_NOTE = "A blank B/C or bidder share is one the source does not have for that auction: "
@@ -61,7 +75,7 @@ const rateCell = (value: unknown, row: Record<string, unknown>) => {
61
75
  return qualifier ? `${text} ${qualifier}` : text;
62
76
  };
63
77
 
64
- const COLUMNS = [
78
+ const LEAD_COLUMNS: HeadlessPaneColumn[] = [
65
79
  { key: "auctionDate", header: "Date" },
66
80
  { key: "secType", header: "Type" },
67
81
  { key: "securityTerm", header: "Term" },
@@ -74,7 +88,17 @@ const COLUMNS = [
74
88
  ),
75
89
  textFormat: rateCell,
76
90
  },
91
+ ];
92
+
93
+ /** A bill's high discount rate, beside the investment rate its Rate is: the rate Treasury's announcement leads with. */
94
+ const DISCOUNT_RATE_COLUMN: HeadlessPaneColumn = {
95
+ key: "highDiscountRate", header: "Discount rate", align: "right" as const,
96
+ format: (value: unknown, row: Record<string, unknown>) => value == null ? pending(row) ? "" : "-" : `${Number(value).toFixed(3)}%`,
97
+ };
98
+
99
+ const RESULT_COLUMNS: HeadlessPaneColumn[] = [
77
100
  {
101
+ // Exports keep the name scripts read it by: the spread against the published average, or the median from November 1998.
78
102
  key: "stopOutVsAvgBp", header: "Stop-out vs avg (bp)", align: "right" as const,
79
103
  format: (value: unknown, row: Record<string, unknown>) => value == null ? pending(row) ? "" : "-" : Number(value).toFixed(1),
80
104
  },
@@ -86,22 +110,53 @@ const COLUMNS = [
86
110
  { key: "cusip", header: "CUSIP" },
87
111
  ];
88
112
 
113
+ const percentile = (value: unknown) => value == null ? "" : String(value);
114
+ const bpMove = (value: unknown) => value == null ? "" : `${Number(value) > 0 ? "+" : ""}${Number(value).toFixed(0)}`;
115
+
116
+ /** The after view: each auction against its tenor's last 24, and the matching Treasury yield's moves after it. */
117
+ const AFTER_COLUMNS: HeadlessPaneColumn[] = [
118
+ { key: "bidToCoverRatio", header: "B/C", align: "right" as const, format: (value: unknown) => value == null ? "" : Number(value).toFixed(2) },
119
+ { key: "btcPercentile", header: "B/C pctl", align: "right" as const, format: percentile },
120
+ { key: "indirectPercentile", header: "Indirect pctl", align: "right" as const, format: percentile },
121
+ { key: "dealerPercentile", header: "Dealer pctl", align: "right" as const, format: percentile },
122
+ { key: "cmt", header: "Yield", description: "The Treasury par yield the moves are read on: the auction's tenor, real for a TIPS." },
123
+ { key: "after1d", header: "+1d (bp)", align: "right" as const, format: bpMove },
124
+ { key: "after5d", header: "+5d (bp)", align: "right" as const, format: bpMove },
125
+ { key: "after20d", header: "+20d (bp)", align: "right" as const, format: bpMove },
126
+ { key: "cusip", header: "CUSIP" },
127
+ ];
128
+
129
+ /** The columns a board lists: a bill board heads its rate as the investment rate and puts the discount rate beside it. */
130
+ function columnsFor(view: AuctionView, auctions: readonly TreasuryAuction[]): HeadlessPaneColumn[] {
131
+ const rate = { ...LEAD_COLUMNS[3]!, textHeader: rateColumnLabel(auctions, "report") };
132
+ const discount = auctions.some(isBill) ? [DISCOUNT_RATE_COLUMN] : [];
133
+ // The spread is against the median from November 1998 and the average before: the heading says which the rows hold.
134
+ const results = RESULT_COLUMNS.map((column) => column.key === "stopOutVsAvgBp" ? { ...column, textHeader: stopOutColumnLabel(auctions, "report") } : column);
135
+ return [...LEAD_COLUMNS.slice(0, 3), rate, ...discount, ...view === "after" ? AFTER_COLUMNS : results];
136
+ }
137
+
138
+ const AFTER_NOTE = "Percentiles rank each auction against its tenor's previous 24 (at least 12); the moves are the Treasury par yield "
139
+ + "of its tenor (real for TIPS) from the auction day's close, in bp. Treasury par yields start in 1990, real yields in 2003.";
140
+
89
141
  interface TreasuryAuctionsHeadlessDependencies {
90
142
  load(args: HeadlessPaneLoadArgs, window: AuctionHistoryWindow): Promise<TreasuryAuctionsResult>;
143
+ curves(shown: readonly TreasuryAuction[], from: string | null): Promise<AuctionCurveRead>;
91
144
  }
92
145
 
93
146
  const defaultDependencies: TreasuryAuctionsHeadlessDependencies = {
94
147
  load: (_args, window) => loadTreasuryAuctions(false, fetchTreasuryAuctions, window),
148
+ curves: (shown, from) => loadAuctionCurves(shown, from),
95
149
  };
96
150
 
97
- /** An empty table says what was searched, in which window, and what the search understands. */
151
+ /** An empty table says what was searched, in which window, and what the search understands; another market's paper, what AUCT covers. */
98
152
  function emptyNote(query: string, filter: AuctionFilter, historyDays: AuctionHistoryWindow): string {
153
+ if (namesOtherMarket(query)) return `AUCT covers US Treasury auctions; "${query.trim()}" is not one. Search by ${AUCTION_SEARCH_FIELDS}.`;
99
154
  const searched = query.trim() ? `match "${query.trim()}"` : "found";
100
155
  const group = filter === "all" ? "" : ` in the ${filter} group`;
101
156
  return `No auctions ${searched}${group} in ${auctionHistoryPhrase(historyDays)}. Search by ${AUCTION_SEARCH_FIELDS}.`;
102
157
  }
103
158
 
104
- function createTreasuryAuctionsHeadless(
159
+ export function createTreasuryAuctionsHeadless(
105
160
  dependencies: TreasuryAuctionsHeadlessDependencies = defaultDependencies,
106
161
  ): HeadlessPaneDefinition<"rows"> {
107
162
  return {
@@ -119,6 +174,7 @@ function createTreasuryAuctionsHeadless(
119
174
  aliases: ["history"],
120
175
  settingKey: "historyDays",
121
176
  description: `Auction history window in days, up to 3650 (10 years), or all: every auction since ${AUCTION_HISTORY_START}.`,
177
+ example: "--history-days 3650",
122
178
  type: "enum",
123
179
  values: AUCTION_HISTORY_WINDOWS.map((days) => ({ value: String(days) })),
124
180
  defaultValue: "120",
@@ -131,8 +187,25 @@ function createTreasuryAuctionsHeadless(
131
187
  defaultValue: "all",
132
188
  pluginState: { pluginId: FIXED_INCOME_VIEW_STATE.treasuryAuctions, key: "activeTab" },
133
189
  },
190
+ {
191
+ key: "view",
192
+ description: "results: each auction's figures; after: its B/C, indirect and dealer percentiles against the tenor's last 24 auctions, and the matching Treasury yield's change 1, 5 and 20 sessions later (bp).",
193
+ type: "enum",
194
+ values: AUCTION_VIEWS.map((value) => ({ value })),
195
+ defaultValue: "results",
196
+ example: "--view after",
197
+ pluginState: { pluginId: FIXED_INCOME_VIEW_STATE.treasuryAuctions, key: "view" },
198
+ },
199
+ {
200
+ key: "sort",
201
+ description: "Row order, by a column: largest first for a figure, newest first for date, A to Z for type, term and CUSIP. An after-view column (btc-pctl, 1d...) shows the after view.",
202
+ type: "enum",
203
+ values: AUCTION_SORT_NAMES.map((entry) => ({ value: entry.value, ...(entry.aliases ? { aliases: entry.aliases } : {}) })),
204
+ example: "--sort btc-pctl",
205
+ pluginState: { pluginId: FIXED_INCOME_VIEW_STATE.treasuryAuctions, key: "sortColumn" },
206
+ },
134
207
  ],
135
- columns: COLUMNS,
208
+ columns: columnsFor("results", []),
136
209
  describe: (args) => {
137
210
  const window = auctionHistoryWindow({ historyDays: args.options.historyDays });
138
211
  return `Treasury Auctions | ${window === AUCTION_HISTORY_ALL ? "all" : `${window} days`} | ${String(args.options.filter)}`;
@@ -140,40 +213,57 @@ function createTreasuryAuctionsHeadless(
140
213
  async load(args) {
141
214
  const historyDays = auctionHistoryWindow({ historyDays: args.options.historyDays });
142
215
  const filter = args.options.filter as AuctionFilter;
143
- const result = await dependencies.load(args, historyDays);
216
+ const sortColumn = typeof args.options.sort === "string" ? auctionSortColumn(args.options.sort) : null;
217
+ // A sort by an after-view column is a request for that view.
218
+ const view: AuctionView = args.options.view === "after" || (sortColumn && isAfterColumn(sortColumn)) ? "after" : "results";
219
+ const sort = sortColumn ? { columnId: sortColumn, direction: firstAuctionSortDirection(sortColumn) } : DEFAULT_AUCTION_SORT;
144
220
  const query = typeof args.argument === "string" ? args.argument : "";
145
- const auctions = visibleAuctions(result.auctions, {
146
- filter,
147
- query,
148
- sort: DEFAULT_AUCTION_SORT,
149
- });
150
- const nextWindow = nextAuctionHistoryWindow(historyDays);
221
+ const from = view === "after" ? afterWindowStart(historyDays) : undefined;
222
+ // The after view reads more than it lists, until each listed tenor has its 24 before the oldest row (or ALL).
223
+ let window = view === "after" ? afterLoadWindow(historyDays) : historyDays;
224
+ let result = await dependencies.load(args, window);
225
+ let listed = visibleAuctions(result.auctions, { filter, query, sort: DEFAULT_AUCTION_SORT, from });
226
+ for (let wider = view === "after" ? widerAfterWindow(listed, result.auctions, window) : null; wider;
227
+ wider = widerAfterWindow(listed, result.auctions, window)) {
228
+ window = wider;
229
+ result = await dependencies.load(args, window);
230
+ listed = visibleAuctions(result.auctions, { filter, query, sort: DEFAULT_AUCTION_SORT, from });
231
+ }
232
+ const curves = view === "after" ? await dependencies.curves(listed, from ?? null) : null;
233
+ const after = curves ? projectAuctionAfter(listed, result.auctions, curves.curves) : null;
234
+ const auctions = sortColumn ? visibleAuctions(listed, { filter: "all", query: "", sort, ...(after ? { after } : {}) }) : listed;
151
235
  const notes = [
152
236
  ...(auctions.length === 0 ? [emptyNote(query, filter, historyDays)] : []),
153
- // ALL is the whole history: nothing older to point to.
154
- ...(nextWindow ? [`Older auctions: use --historyDays ${nextWindow}.`] : []),
155
- ...(auctions.length > 0 ? [STOP_OUT_NOTE] : []),
237
+ // Only where a longer window could list more: never past ALL, for another market, or for a CUSIP whose first auction is listed.
238
+ ...(nextAuctionHistoryWindow(historyDays) && widerWindowCouldAdd(query, auctions, historyDays)
239
+ ? [`Older auctions: use --history-days ${nextAuctionHistoryWindow(historyDays)}.`] : []),
240
+ ...(auctions.length > 0 && view === "results" ? [STOP_OUT_NOTE] : []),
241
+ ...(auctions.length > 0 && view === "after" ? [AFTER_NOTE] : []),
156
242
  ...(auctions.some(lacksMetrics) ? [MISSING_METRICS_NOTE] : []),
157
243
  ];
158
244
  return {
159
- complete: !result.refreshError,
245
+ complete: !result.refreshError && !curves?.errors.length,
160
246
  // A saved copy answering the failed refresh ends the report by saying when it was saved instead.
161
- errors: [unansweredRefreshError(result)].filter((error): error is string => !!error),
247
+ errors: [unansweredRefreshError(result), ...curves?.errors ?? []].filter((error): error is string => !!error),
162
248
  notes,
249
+ columns: columnsFor(view, auctions),
163
250
  rows: auctions.map((auction) => ({
164
251
  ...auction,
165
252
  rate: rateValue(auction),
166
- stopOutVsAvgBp: stopOutVsAverageBp(auction),
253
+ stopOutVsAvgBp: stopOutVsAvgBp(auction),
167
254
  indirectPercent: indirectPct(auction),
168
255
  directPercent: directPct(auction),
169
256
  dealerPercent: dealerPct(auction),
170
257
  size: auctionSize(auction),
258
+ ...(after ? after.get(auction.id) : {}),
171
259
  })),
172
260
  metadata: {
173
261
  fetchedAt: result.fetchedAt,
174
262
  stale: result.stale,
175
263
  historyDays,
176
264
  filter,
265
+ view,
266
+ ...(sortColumn ? { sort: args.options.sort } : {}),
177
267
  },
178
268
  };
179
269
  },
@@ -7,7 +7,8 @@ import {
7
7
  TREASURY_DIRECT_CONNECTION_ID,
8
8
  TREASURY_FISCAL_DATA_CONNECTION_ID,
9
9
  } from "./cache";
10
- import { AUCTION_HISTORY_WINDOWS, auctionHistoryLabel } from "./model";
10
+ import { AUCTION_HISTORY_WINDOWS, auctionCommandRequest, auctionHistoryLabel } from "./model";
11
+ import { AUCTION_HISTORY_DAYS } from "./client";
11
12
  import { createPublicPaneShare } from "../shared/public-pane";
12
13
  import { treasuryAuctionsHeadless } from "./headless";
13
14
 
@@ -24,6 +25,7 @@ export function treasuryAuctionsSettings(): PaneSettingsDef {
24
25
  description: "How far back auction results are requested.",
25
26
  type: "select",
26
27
  options: AUCTION_HISTORY_WINDOWS.map((days) => ({ value: String(days), label: auctionHistoryLabel(days) })),
28
+ defaultValue: String(AUCTION_HISTORY_DAYS),
27
29
  },
28
30
  ],
29
31
  };
@@ -65,7 +67,7 @@ export const treasuryAuctionsModule: PluginModule = {
65
67
  paneId: "treasury-auctions",
66
68
  label: "Treasury Auctions",
67
69
  description:
68
- "Bill, note, bond, and TIPS auction results from Treasury Fiscal Data: rate, stop-out versus average, bid-to-cover, indirect, direct and dealer takedown, and size. Search by benchmark (10Y) or CUSIP.",
70
+ "Bill, note, bond and TIPS auction results since 1979, from Treasury Fiscal Data and TreasuryDirect: rate, stop-out versus median, bid-to-cover, bidder takedown and size; an after view ranks each auction against its tenor and shows the yield's moves after it. Search by benchmark (10Y) or CUSIP.",
69
71
  keywords: [
70
72
  "treasury",
71
73
  "auction",
@@ -82,6 +84,14 @@ export const treasuryAuctionsModule: PluginModule = {
82
84
  "tail",
83
85
  "stop-out",
84
86
  "stop out",
87
+ "treasury auction",
88
+ "bond auction",
89
+ "note auction",
90
+ "bill auction",
91
+ "auction results",
92
+ "10 year auction",
93
+ "30 year auction",
94
+ "percentile",
85
95
  "cusip",
86
96
  "reopening",
87
97
  "issuance",
@@ -89,8 +99,8 @@ export const treasuryAuctionsModule: PluginModule = {
89
99
  shortcut: { prefix: "AUCT", argKind: "text", argOptional: true, argPlaceholder: "search" },
90
100
  headless: treasuryAuctionsHeadless,
91
101
  createInstance: (_context, options) => {
92
- const search = options?.arg?.trim();
93
- return { placement: "floating", ...(search ? { params: { search } } : {}) };
102
+ const { params, settings } = auctionCommandRequest(options?.arg);
103
+ return { placement: "floating", params, ...(settings ? { settings } : {}) };
94
104
  },
95
105
  publicShare: createPublicPaneShare("Treasury Auctions"),
96
106
  }, "treasury", "auctions"),