@gloom-sh/terminal 0.20.17 → 0.20.19

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 (453) hide show
  1. package/package.json +3 -1
  2. package/src/account/auth-dialog.tsx +19 -1
  3. package/src/account/billing.ts +2 -1
  4. package/src/account/heard-from-question.tsx +235 -0
  5. package/src/account/heard-from.ts +97 -0
  6. package/src/api-client/cot.ts +5 -6
  7. package/src/api-client/data.ts +14 -3
  8. package/src/api-client/heard-from.ts +72 -0
  9. package/src/api-client/index.ts +64 -6
  10. package/src/api-client/mna.ts +18 -0
  11. package/src/api-client/request.ts +162 -40
  12. package/src/api-client/supply-chain.ts +9 -0
  13. package/src/api-client/types/billing.ts +35 -1
  14. package/src/api-client/types/news.ts +45 -0
  15. package/src/api-client/types/world-venues.ts +9 -0
  16. package/src/app/global-shortcuts.ts +5 -3
  17. package/src/app/pro-welcome/keys.ts +27 -0
  18. package/src/app/pro-welcome/model.ts +158 -0
  19. package/src/app/pro-welcome/row.tsx +176 -0
  20. package/src/app/pro-welcome/use-pro-welcome.ts +156 -0
  21. package/src/app/runtime/external-profile-changes.ts +135 -0
  22. package/src/app.tsx +37 -4
  23. package/src/architecture/core-builtin-allowlist.json +1 -1
  24. package/src/architecture/floating-promise-allowlist.json +1 -2
  25. package/src/architecture/shortcut-labels-allowlist.json +1 -0
  26. package/src/cli/alert-listing.ts +98 -0
  27. package/src/cli/commands/market.ts +191 -39
  28. package/src/cli/commands/overview.ts +7 -1
  29. package/src/cli/commands/plugins.ts +3 -2
  30. package/src/cli/commands/search.ts +30 -6
  31. package/src/cli/commands/ticker.ts +13 -6
  32. package/src/cli/context.ts +24 -5
  33. package/src/cli/csv-export.ts +2 -1
  34. package/src/cli/desktop-pane-shot-browser.ts +3 -1
  35. package/src/cli/desktop-pane-shot-view.ts +0 -1
  36. package/src/cli/desktop-pane-shot.ts +276 -52
  37. package/src/cli/errors.ts +3 -9
  38. package/src/cli/exit-codes.ts +1 -1
  39. package/src/cli/glossary.ts +65 -11
  40. package/src/cli/help.ts +1 -1
  41. package/src/cli/history-demergers.ts +117 -0
  42. package/src/cli/history-rows.ts +8 -4
  43. package/src/cli/index.ts +2 -1
  44. package/src/cli/known-gaps.ts +16 -0
  45. package/src/cli/known-us-stocks.ts +18 -0
  46. package/src/cli/listing-arg.ts +192 -38
  47. package/src/cli/pane-functions/catalog-snapshot-build.ts +83 -0
  48. package/src/cli/pane-functions/catalog-snapshot.json +877 -0
  49. package/src/cli/pane-functions/catalog-snapshot.ts +62 -0
  50. package/src/cli/pane-functions/catalog.ts +50 -16
  51. package/src/cli/pane-functions/data.ts +16 -4
  52. package/src/cli/pane-functions/dom.ts +54 -8
  53. package/src/cli/pane-functions/freshness.ts +39 -4
  54. package/src/cli/pane-functions/function-help.ts +3 -3
  55. package/src/cli/pane-functions/headless.ts +9 -1
  56. package/src/cli/pane-functions/index.ts +175 -50
  57. package/src/cli/pane-functions/report-notices.ts +10 -0
  58. package/src/cli/pane-functions/resolver.ts +11 -7
  59. package/src/cli/pane-functions/screenshot-assessment.ts +38 -10
  60. package/src/cli/pane-functions/screenshot-data-evidence.ts +7 -15
  61. package/src/cli/pane-functions/screenshot-payload.ts +36 -1
  62. package/src/cli/pane-functions/screenshot-render.ts +24 -9
  63. package/src/cli/pane-functions/screenshot-types.ts +9 -0
  64. package/src/cli/quote-answer.ts +33 -17
  65. package/src/cli/registry.ts +22 -2
  66. package/src/cli/result.ts +22 -4
  67. package/src/cli/scroll-truncation.ts +7 -2
  68. package/src/cli/series-search.ts +45 -6
  69. package/src/cli/shot-temp-dir.ts +4 -9
  70. package/src/cli/ticker-resolution.ts +1 -1
  71. package/src/cli/unreachable.ts +21 -0
  72. package/src/components/chart/composite/drawing-store.ts +11 -7
  73. package/src/components/chart/composite/format.ts +1 -0
  74. package/src/components/chart/composite/legend.tsx +48 -20
  75. package/src/components/chart/composite/panel-surface/panel-cursor.tsx +3 -3
  76. package/src/components/chart/composite/panel-surface/plot-gestures.ts +9 -2
  77. package/src/components/chart/composite/panel-surface.tsx +1 -1
  78. package/src/components/chart/composite/price-axis-labels.tsx +7 -5
  79. package/src/components/chart/composite/tools.ts +164 -39
  80. package/src/components/chart-table/header.tsx +11 -2
  81. package/src/components/chart-table/layout.ts +16 -17
  82. package/src/components/command-bar/pane-templates/items.ts +17 -1
  83. package/src/components/command-bar/routes/root/provider-search.ts +10 -1
  84. package/src/components/command-bar/routes/root/results.ts +34 -2
  85. package/src/components/command-bar/routes/root/runtime.ts +19 -4
  86. package/src/components/command-bar/routes/ticker-search/results.ts +5 -0
  87. package/src/components/command-bar/routes/ticker-search/route.ts +5 -0
  88. package/src/components/command-bar/selection-runtime.ts +29 -5
  89. package/src/components/command-bar/surface/index.tsx +4 -1
  90. package/src/components/command-bar/workflow/alert.ts +32 -13
  91. package/src/components/data-table/view.tsx +15 -2
  92. package/src/components/form-modal/content.tsx +9 -4
  93. package/src/components/index.ts +1 -1
  94. package/src/components/layout/header.tsx +9 -5
  95. package/src/components/layout/pane/capture-status.ts +6 -0
  96. package/src/components/layout/pane/footer/index.tsx +2 -0
  97. package/src/components/layout/pane/footer/model.ts +123 -17
  98. package/src/components/layout/pane/header.tsx +16 -2
  99. package/src/components/layout/pane/status-footer.ts +24 -0
  100. package/src/components/market-board/index.tsx +4 -2
  101. package/src/components/onboarding/onboarding-frame.tsx +6 -2
  102. package/src/components/onboarding/onboarding-keyboard.ts +7 -1
  103. package/src/components/onboarding/onboarding-wizard.tsx +3 -1
  104. package/src/components/onboarding/portfolio-step/positions-panel.tsx +24 -15
  105. package/src/components/onboarding/setup-cards.ts +36 -0
  106. package/src/components/onboarding/use-onboarding-progress.ts +22 -1
  107. package/src/components/onboarding/wizard-account.ts +6 -1
  108. package/src/components/onboarding/wizard-model.ts +32 -6
  109. package/src/components/onboarding/wizard-positions.ts +1 -1
  110. package/src/components/price-performance.tsx +26 -8
  111. package/src/components/reader/article-reader.tsx +12 -5
  112. package/src/components/sign-in-gate.tsx +3 -1
  113. package/src/components/toggle-list.tsx +6 -8
  114. package/src/components/ui/confirm-dialog.tsx +47 -7
  115. package/src/components/ui/data-table/opentui/index.tsx +7 -0
  116. package/src/components/ui/data-table/types.ts +8 -0
  117. package/src/components/ui/display.tsx +17 -2
  118. package/src/components/ui/index.ts +1 -1
  119. package/src/components/ui/stat-grid.tsx +4 -0
  120. package/src/components/ui/status.tsx +13 -1
  121. package/src/components/ui/table-layout.ts +34 -2
  122. package/src/components/use-pane-notice-footer.tsx +16 -3
  123. package/src/data/config/store/index.ts +31 -0
  124. package/src/data/config/store/node.ts +61 -11
  125. package/src/data/config/store/normalize.ts +4 -6
  126. package/src/data/config/store/shared-file.ts +309 -0
  127. package/src/data/profile-merge.ts +299 -0
  128. package/src/data/sqlite/checkpointer.ts +11 -1
  129. package/src/data/sqlite/database.ts +1 -1
  130. package/src/data/ticker-repository.ts +134 -10
  131. package/src/data/ticker-store.ts +67 -0
  132. package/src/data/ticker-writes.ts +5 -0
  133. package/src/i18n/es.ts +27 -0
  134. package/src/i18n/ja.ts +27 -0
  135. package/src/i18n/ko.ts +27 -0
  136. package/src/i18n/zh-cn.ts +27 -0
  137. package/src/i18n/zh-tw.ts +27 -0
  138. package/src/layout-marketplace/gallery-desktop.tsx +2 -2
  139. package/src/market-data/ah-pair.ts +122 -0
  140. package/src/market-data/coordinator/entries.ts +6 -4
  141. package/src/market-data/coordinator/index.ts +14 -3
  142. package/src/market-data/depositary-pair.ts +6 -2
  143. package/src/market-data/futures-board.ts +36 -29
  144. package/src/market-data/futures-contract.ts +37 -1
  145. package/src/market-data/hooks.tsx +33 -2
  146. package/src/market-data/market/change-basis.ts +11 -1
  147. package/src/market-data/market/header-market.ts +11 -0
  148. package/src/market-data/market/status.ts +40 -4
  149. package/src/market-data/performance.ts +127 -32
  150. package/src/market-data/quotes/time.ts +5 -2
  151. package/src/market-data/split-terms.ts +28 -0
  152. package/src/news/types.ts +28 -0
  153. package/src/notifications/app-badge.ts +2 -3
  154. package/src/notifications/app-notifier.ts +5 -0
  155. package/src/plugins/builtin/account-management/footer.ts +1 -1
  156. package/src/plugins/builtin/account-management/keyboard.ts +4 -0
  157. package/src/plugins/builtin/account-management/model.ts +1 -0
  158. package/src/plugins/builtin/account-management/pane.tsx +75 -7
  159. package/src/plugins/builtin/account-management/payment-recovery-row.tsx +12 -5
  160. package/src/plugins/builtin/account-management/pro-cancel.tsx +197 -0
  161. package/src/plugins/builtin/account-management/trial-cancel.ts +1 -1
  162. package/src/plugins/builtin/alerts/cli-move.ts +2 -2
  163. package/src/plugins/builtin/alerts/cli.ts +101 -48
  164. package/src/plugins/builtin/alerts/command.ts +39 -9
  165. package/src/plugins/builtin/alerts/constants.ts +10 -0
  166. package/src/plugins/builtin/alerts/earnings-listing.ts +20 -0
  167. package/src/plugins/builtin/alerts/event-rows.ts +9 -3
  168. package/src/plugins/builtin/alerts/events-pane.tsx +16 -10
  169. package/src/plugins/builtin/alerts/format.ts +24 -8
  170. package/src/plugins/builtin/alerts/headless.ts +12 -6
  171. package/src/plugins/builtin/alerts/index.tsx +97 -16
  172. package/src/plugins/builtin/alerts/move-checks.ts +7 -0
  173. package/src/plugins/builtin/alerts/option-contract.ts +197 -0
  174. package/src/plugins/builtin/alerts/pane.tsx +1 -1
  175. package/src/plugins/builtin/alerts/price.ts +30 -5
  176. package/src/plugins/builtin/alerts/pro-rules.ts +62 -0
  177. package/src/plugins/builtin/alerts/quotes.ts +26 -2
  178. package/src/plugins/builtin/alerts/research-builder.ts +5 -10
  179. package/src/plugins/builtin/alerts/scheduled.ts +6 -1
  180. package/src/plugins/builtin/alerts/types.ts +7 -0
  181. package/src/plugins/builtin/analytics/account-returns.ts +1 -1
  182. package/src/plugins/builtin/analytics/manual-value.ts +61 -0
  183. package/src/plugins/builtin/analytics/pane-model.ts +2 -2
  184. package/src/plugins/builtin/analytics/risk-book.ts +7 -7
  185. package/src/plugins/builtin/analytics/risk-client.ts +27 -14
  186. package/src/plugins/builtin/analytics/risk-headless.ts +13 -8
  187. package/src/plugins/builtin/analytics/risk-model.ts +92 -4
  188. package/src/plugins/builtin/analytics/risk-pane.tsx +85 -38
  189. package/src/plugins/builtin/awards/pane.tsx +1 -1
  190. package/src/plugins/builtin/broker-trading/orders.tsx +2 -2
  191. package/src/plugins/builtin/buildout/company/pane.tsx +4 -14
  192. package/src/plugins/builtin/catalysts/model.ts +2 -1
  193. package/src/plugins/builtin/central-bank-rates/model.ts +8 -2
  194. package/src/plugins/builtin/central-bank-rates/pane.tsx +5 -3
  195. package/src/plugins/builtin/chart-composer/chart-spec.ts +5 -0
  196. package/src/plugins/builtin/chart-composer/cli-options.ts +9 -5
  197. package/src/plugins/builtin/chart-composer/data-catalog-pane.tsx +2 -6
  198. package/src/plugins/builtin/chart-composer/headless-schema.ts +14 -10
  199. package/src/plugins/builtin/chart-composer/headless.ts +2 -0
  200. package/src/plugins/builtin/chart-composer/index.tsx +17 -5
  201. package/src/plugins/builtin/chart-composer/pane.tsx +19 -6
  202. package/src/plugins/builtin/chart-composer/viewport-labels.ts +2 -17
  203. package/src/plugins/builtin/chat/controller/notifications.ts +1 -0
  204. package/src/plugins/builtin/chat/index.tsx +0 -1
  205. package/src/plugins/builtin/cloud/auth-actions.tsx +11 -6
  206. package/src/plugins/builtin/cloud/company-picker.tsx +5 -3
  207. package/src/plugins/builtin/cloud/upgrade-command.ts +1 -1
  208. package/src/plugins/builtin/commodities-energy/index.tsx +1 -1
  209. package/src/plugins/builtin/company-kpis/headless.ts +10 -5
  210. package/src/plugins/builtin/company-kpis/latest.ts +45 -0
  211. package/src/plugins/builtin/company-kpis/model.ts +57 -15
  212. package/src/plugins/builtin/company-kpis/pane.tsx +22 -8
  213. package/src/plugins/builtin/composite/alt-data.ts +20 -0
  214. package/src/plugins/builtin/composite/application.ts +14 -0
  215. package/src/plugins/builtin/composite/broker.ts +12 -0
  216. package/src/plugins/builtin/composite/credit.ts +33 -0
  217. package/src/plugins/builtin/composite/crypto.ts +10 -0
  218. package/src/plugins/builtin/composite/earnings.ts +12 -0
  219. package/src/plugins/builtin/composite/filings.ts +13 -0
  220. package/src/plugins/builtin/composite/futures-commodities.ts +23 -0
  221. package/src/plugins/builtin/composite/global-markets.ts +12 -0
  222. package/src/plugins/builtin/composite/options-volatility.ts +23 -0
  223. package/src/plugins/builtin/composite/ownership.ts +23 -0
  224. package/src/plugins/builtin/composite/portfolio.ts +10 -0
  225. package/src/plugins/builtin/composite/quant.ts +15 -0
  226. package/src/plugins/builtin/composite/rates-macro.ts +30 -0
  227. package/src/plugins/builtin/composite/screeners.ts +11 -0
  228. package/src/plugins/builtin/composite/shared.ts +11 -0
  229. package/src/plugins/builtin/composite/ticker-core.ts +36 -0
  230. package/src/plugins/builtin/congress-trades/headless.ts +31 -3
  231. package/src/plugins/builtin/congress-trades/model.ts +9 -5
  232. package/src/plugins/builtin/correlation/index.tsx +13 -17
  233. package/src/plugins/builtin/correlation/matrix/model.ts +18 -0
  234. package/src/plugins/builtin/cot/client.ts +2 -3
  235. package/src/plugins/builtin/cot/headless.ts +16 -16
  236. package/src/plugins/builtin/cot/index.tsx +6 -6
  237. package/src/plugins/builtin/cot/model.ts +25 -5
  238. package/src/plugins/builtin/cot/pane.tsx +11 -6
  239. package/src/plugins/builtin/cot/series.ts +11 -8
  240. package/src/plugins/builtin/cpi/model.ts +15 -4
  241. package/src/plugins/builtin/cpi/pane.tsx +29 -7
  242. package/src/plugins/builtin/dividend-yield/client.ts +57 -16
  243. package/src/plugins/builtin/dividend-yield/headless.ts +17 -11
  244. package/src/plugins/builtin/dividend-yield/model.ts +4 -3
  245. package/src/plugins/builtin/dividend-yield/pane.tsx +22 -18
  246. package/src/plugins/builtin/dividend-yield/ranking.ts +1 -1
  247. package/src/plugins/builtin/dividend-yield/types.ts +4 -0
  248. package/src/plugins/builtin/dividend-yield/view.ts +23 -12
  249. package/src/plugins/builtin/doe/model.ts +30 -0
  250. package/src/plugins/builtin/doe/pane.tsx +8 -2
  251. package/src/plugins/builtin/earnings/board-table.ts +9 -4
  252. package/src/plugins/builtin/earnings/fiscal-quarter.ts +39 -0
  253. package/src/plugins/builtin/earnings/headless.ts +16 -6
  254. package/src/plugins/builtin/earnings/history-model.ts +6 -4
  255. package/src/plugins/builtin/earnings/history-table.ts +7 -4
  256. package/src/plugins/builtin/earnings-calls/calendar.tsx +4 -3
  257. package/src/plugins/builtin/earnings-calls/pane.tsx +8 -2
  258. package/src/plugins/builtin/earnings-ripple/pane.tsx +2 -2
  259. package/src/plugins/builtin/econ/calendar-model.ts +16 -0
  260. package/src/plugins/builtin/econ/index.tsx +7 -2
  261. package/src/plugins/builtin/equity-screener/headless.ts +4 -1
  262. package/src/plugins/builtin/equity-screener/model.ts +7 -6
  263. package/src/plugins/builtin/estimate-revisions/headless.ts +1 -1
  264. package/src/plugins/builtin/exposure/model.ts +10 -0
  265. package/src/plugins/builtin/exposure/pane.tsx +10 -3
  266. package/src/plugins/builtin/futures/model.ts +14 -1
  267. package/src/plugins/builtin/futures/series.ts +1 -8
  268. package/src/plugins/builtin/fx-matrix/amount.ts +15 -1
  269. package/src/plugins/builtin/fx-matrix/headless.ts +12 -6
  270. package/src/plugins/builtin/fx-matrix/index.tsx +25 -7
  271. package/src/plugins/builtin/fx-matrix/settings.ts +9 -4
  272. package/src/plugins/builtin/insider/detail.tsx +36 -7
  273. package/src/plugins/builtin/insider/filing-stories.ts +110 -0
  274. package/src/plugins/builtin/insider/headless.ts +37 -2
  275. package/src/plugins/builtin/insider/index.tsx +79 -10
  276. package/src/plugins/builtin/insider/model.ts +43 -5
  277. package/src/plugins/builtin/ipo-calendar/client.ts +11 -1
  278. package/src/plugins/builtin/ipo-calendar/model.ts +3 -7
  279. package/src/plugins/builtin/jobs/headless.ts +2 -1
  280. package/src/plugins/builtin/jobs/model.ts +6 -0
  281. package/src/plugins/builtin/jobs/pane.tsx +8 -3
  282. package/src/plugins/builtin/kelly-sizer/pane.tsx +9 -4
  283. package/src/plugins/builtin/market-valuation/pane.tsx +22 -10
  284. package/src/plugins/builtin/mna/detail.tsx +67 -6
  285. package/src/plugins/builtin/mna/headless.ts +128 -13
  286. package/src/plugins/builtin/mna/model.ts +219 -16
  287. package/src/plugins/builtin/mna/pane.tsx +34 -6
  288. package/src/plugins/builtin/money-markets/model.ts +14 -5
  289. package/src/plugins/builtin/money-markets/pane.tsx +4 -3
  290. package/src/plugins/builtin/news/wire/news/detail-view.tsx +118 -10
  291. package/src/plugins/builtin/news/wire/news/footer.ts +3 -8
  292. package/src/plugins/builtin/news/wire/news/story-evidence.ts +178 -0
  293. package/src/plugins/builtin/options/analytics.ts +1 -1
  294. package/src/plugins/builtin/options/view.tsx +18 -11
  295. package/src/plugins/builtin/options-positioning/model.ts +11 -0
  296. package/src/plugins/builtin/options-positioning/pane.tsx +22 -1
  297. package/src/plugins/builtin/options-scenario/client.ts +49 -8
  298. package/src/plugins/builtin/options-scenario/csp-screen-pane.tsx +22 -6
  299. package/src/plugins/builtin/options-scenario/csp-screen.ts +39 -12
  300. package/src/plugins/builtin/options-scenario/headless.ts +7 -3
  301. package/src/plugins/builtin/options-scenario/model.ts +33 -2
  302. package/src/plugins/builtin/options-scenario/pane.tsx +3 -4
  303. package/src/plugins/builtin/options-scenario/strategy-screen.ts +7 -5
  304. package/src/plugins/builtin/pe-band/client.ts +13 -1
  305. package/src/plugins/builtin/pe-band/headless.ts +2 -2
  306. package/src/plugins/builtin/pe-band/model.ts +63 -10
  307. package/src/plugins/builtin/pe-band/pane.tsx +5 -5
  308. package/src/plugins/builtin/perps/cascade.ts +4 -3
  309. package/src/plugins/builtin/perps/markets-section.tsx +5 -2
  310. package/src/plugins/builtin/perps/model.ts +4 -3
  311. package/src/plugins/builtin/portfolio-list/allocation-rows.ts +26 -7
  312. package/src/plugins/builtin/portfolio-list/cli/portfolio-command.ts +66 -13
  313. package/src/plugins/builtin/portfolio-list/cli/render.ts +76 -33
  314. package/src/plugins/builtin/portfolio-list/headless.ts +69 -22
  315. package/src/plugins/builtin/portfolio-list/pane/data.ts +3 -3
  316. package/src/plugins/builtin/portfolio-list/pane/index.tsx +29 -14
  317. package/src/plugins/builtin/portfolio-list/summary/index.tsx +2 -2
  318. package/src/plugins/builtin/portfolio-list/table.tsx +3 -2
  319. package/src/plugins/builtin/relative-rotation/pane.tsx +2 -3
  320. package/src/plugins/builtin/research/corporate-actions-pane.tsx +33 -14
  321. package/src/plugins/builtin/research/event-model.ts +43 -19
  322. package/src/plugins/builtin/research/headless.ts +8 -1
  323. package/src/plugins/builtin/research/relative-valuation-pane.tsx +19 -17
  324. package/src/plugins/builtin/research-search/index.tsx +3 -1
  325. package/src/plugins/builtin/scanner/denied.tsx +16 -4
  326. package/src/plugins/builtin/scanner/flow-pane.tsx +1 -1
  327. package/src/plugins/builtin/scanner/hilo-pane.tsx +1 -1
  328. package/src/plugins/builtin/sec/filing-display.tsx +14 -2
  329. package/src/plugins/builtin/sec/headless.ts +42 -4
  330. package/src/plugins/builtin/sec/index.tsx +21 -1
  331. package/src/plugins/builtin/sectors/index.tsx +6 -9
  332. package/src/plugins/builtin/sectors/sector-model.ts +1 -1
  333. package/src/plugins/builtin/shared/cloud-upgrade.ts +1 -1
  334. package/src/plugins/builtin/shared/earnings-report.ts +49 -5
  335. package/src/plugins/builtin/shared/options-pro-copy.ts +34 -0
  336. package/src/plugins/builtin/shared/report-freshness.ts +2 -3
  337. package/src/plugins/builtin/shared/statement-currency.ts +23 -0
  338. package/src/plugins/builtin/shared/ticker-surface.ts +1 -1
  339. package/src/plugins/builtin/supply-chain/client.ts +34 -9
  340. package/src/plugins/builtin/supply-chain/evidence.ts +3 -2
  341. package/src/plugins/builtin/supply-chain/flow.tsx +4 -3
  342. package/src/plugins/builtin/supply-chain/graph-model.ts +14 -7
  343. package/src/plugins/builtin/supply-chain/graph-pane.tsx +3 -1
  344. package/src/plugins/builtin/supply-chain/graph.tsx +6 -3
  345. package/src/plugins/builtin/supply-chain/headless.ts +19 -4
  346. package/src/plugins/builtin/supply-chain/model.ts +50 -6
  347. package/src/plugins/builtin/supply-chain/pane.tsx +79 -18
  348. package/src/plugins/builtin/themes/headless.ts +4 -4
  349. package/src/plugins/builtin/themes/model.ts +11 -8
  350. package/src/plugins/builtin/themes/pane.tsx +2 -2
  351. package/src/plugins/builtin/ticker-detail/adr-pair/ah.ts +62 -0
  352. package/src/plugins/builtin/ticker-detail/adr-pair/headless.ts +119 -20
  353. package/src/plugins/builtin/ticker-detail/adr-pair/model.ts +51 -1
  354. package/src/plugins/builtin/ticker-detail/adr-pair/tab.tsx +25 -14
  355. package/src/plugins/builtin/ticker-detail/financials/model.ts +22 -32
  356. package/src/plugins/builtin/ticker-detail/financials/tab.tsx +7 -9
  357. package/src/plugins/builtin/ticker-detail/headless-schema.ts +2 -0
  358. package/src/plugins/builtin/ticker-detail/headless.ts +28 -12
  359. package/src/plugins/builtin/ticker-detail/overview/board-lot.ts +21 -0
  360. package/src/plugins/builtin/ticker-detail/overview/model.ts +28 -2
  361. package/src/plugins/builtin/ticker-detail/overview/pane.tsx +8 -0
  362. package/src/plugins/builtin/ticker-detail/overview-tab.tsx +68 -13
  363. package/src/plugins/builtin/ticker-detail/quote-monitor/card.tsx +9 -2
  364. package/src/plugins/builtin/ticker-detail/quote-monitor/index.tsx +5 -2
  365. package/src/plugins/builtin/volatility/model.ts +17 -0
  366. package/src/plugins/builtin/volatility/pane.tsx +16 -7
  367. package/src/plugins/builtin/world-indices/index.tsx +2 -0
  368. package/src/plugins/builtin/world-indices/table.tsx +15 -0
  369. package/src/plugins/builtin/world-venue-map/evidence.ts +3 -2
  370. package/src/plugins/builtin/world-venue-map/headless.ts +32 -18
  371. package/src/plugins/builtin/world-venue-map/index.ts +19 -6
  372. package/src/plugins/builtin/world-venue-map/layered-pane.tsx +9 -5
  373. package/src/plugins/builtin/world-venue-map/layers.ts +33 -11
  374. package/src/plugins/builtin/world-venue-map/map.tsx +12 -0
  375. package/src/plugins/builtin/world-venue-map/model.ts +6 -1
  376. package/src/plugins/builtin/world-venue-map/pane.tsx +35 -6
  377. package/src/plugins/builtin/world-venue-map/place.ts +119 -0
  378. package/src/plugins/builtin/world-venue-map/venue-header.tsx +5 -3
  379. package/src/plugins/catalog-browser.ts +10 -1
  380. package/src/plugins/catalog-data.ts +20 -0
  381. package/src/plugins/catalog-lazy.ts +51 -0
  382. package/src/plugins/catalog-ui.ts +16 -18
  383. package/src/plugins/host-smoke.ts +5 -2
  384. package/src/portfolio/allocation.ts +79 -19
  385. package/src/portfolio/cash-balances.ts +76 -0
  386. package/src/portfolio/mutations.ts +43 -8
  387. package/src/public/__snapshots__/public-api.test.ts.snap +1 -0
  388. package/src/renderers/browser/activity.ts +16 -0
  389. package/src/renderers/browser/app-badge-host.ts +14 -0
  390. package/src/renderers/browser/main.tsx +5 -0
  391. package/src/renderers/browser/notifications.ts +103 -0
  392. package/src/renderers/browser/ui-host.tsx +4 -0
  393. package/src/renderers/desktop/window-layouts.ts +14 -0
  394. package/src/renderers/dom/data-table/index.tsx +27 -4
  395. package/src/renderers/dom/data-table/row.tsx +2 -0
  396. package/src/renderers/dom/host/tabs.tsx +57 -8
  397. package/src/renderers/dom/styles.css +13 -5
  398. package/src/renderers/electrobun/bun/desktop/backend-requests.ts +4 -0
  399. package/src/renderers/electrobun/bun/desktop/backend.ts +22 -1
  400. package/src/renderers/electrobun/bun/window/native-min-size.ts +6 -1
  401. package/src/renderers/electrobun/shared/protocol.ts +4 -0
  402. package/src/renderers/electrobun/view/cli-pane-shot-frame.tsx +50 -12
  403. package/src/renderers/electrobun/view/http-fetch.ts +3 -2
  404. package/src/renderers/electrobun/view/remote/ticker-repository.ts +10 -0
  405. package/src/series/standalone-catalog.ts +5 -4
  406. package/src/series/standalone.ts +13 -7
  407. package/src/sources/gloomberb-cloud/index.ts +22 -9
  408. package/src/sources/gloomberb-cloud/news.ts +35 -0
  409. package/src/sources/gloomberb-cloud/perpetuals.ts +60 -3
  410. package/src/sources/provider-errors.ts +34 -7
  411. package/src/sources/provider-router/financials.ts +20 -13
  412. package/src/sources/provider-router/history.ts +32 -6
  413. package/src/sources/provider-router/index.ts +4 -0
  414. package/src/sources/provider-router/search.ts +1 -0
  415. package/src/sync/collections-contributor.ts +3 -1
  416. package/src/sync/config-merge.ts +10 -1
  417. package/src/sync/sanitize.ts +26 -2
  418. package/src/tickers/company-name-listing.ts +16 -2
  419. package/src/tickers/listing-fate.ts +12 -8
  420. package/src/tickers/renamed-listings.ts +43 -10
  421. package/src/tickers/search/home-listing.ts +28 -0
  422. package/src/tickers/search/index.ts +19 -7
  423. package/src/tickers/terminal-codes.ts +11 -1
  424. package/src/time-series/base-series.ts +39 -6
  425. package/src/time-series/chart-seed.ts +2 -2
  426. package/src/time-series/history-quality.ts +4 -1
  427. package/src/time-series/hooks.ts +2 -0
  428. package/src/time-series/price-comparison.ts +17 -23
  429. package/src/time-series/reporting.ts +1 -1
  430. package/src/time-series/resolution.ts +13 -0
  431. package/src/time-series/resolve-context.ts +6 -0
  432. package/src/time-series/resolve.ts +42 -3
  433. package/src/time-series/spec.ts +2 -2
  434. package/src/time-series/types.ts +3 -2
  435. package/src/types/data-provider.ts +11 -0
  436. package/src/types/financials.ts +48 -4
  437. package/src/types/headless.ts +1 -0
  438. package/src/types/issuer-listings.ts +2 -0
  439. package/src/types/plugin-notifications.ts +3 -0
  440. package/src/types/price-history.ts +6 -4
  441. package/src/types/ticker.ts +10 -2
  442. package/src/ui/host.tsx +2 -0
  443. package/src/utils/cli-output.ts +1 -1
  444. package/src/utils/declared-dividends.ts +13 -1
  445. package/src/utils/dividend-cash.ts +5 -1
  446. package/src/utils/exchange-announcements.ts +7 -2
  447. package/src/utils/forward-dividend.ts +4 -3
  448. package/src/utils/fundamentals.ts +40 -0
  449. package/src/utils/network-failure.ts +2 -0
  450. package/src/utils/price-history-integrity.ts +9 -1
  451. package/src/utils/remove-folder.ts +37 -0
  452. package/src/utils/trailing-dividend.ts +1 -1
  453. package/src/plugins/builtin/composite-plugins.ts +0 -285
@@ -0,0 +1,36 @@
1
+ import { composeBuiltinPlugin } from "../plugin-module";
2
+ import { rendererOnly } from "./shared";
3
+ import { tickerCorePluginMeta } from "../builtin-plugin-meta";
4
+ import { chartComposerModule } from "../chart-composer";
5
+ import { userSeriesModule } from "../chart-composer/user-series";
6
+ import { companyKpisModule } from "../company-kpis";
7
+ import { dividendYieldModule } from "../dividend-yield";
8
+ import { estimateRevisionsModule } from "../estimate-revisions";
9
+ import { executivesModule } from "../executives";
10
+ import { peBandModule } from "../pe-band";
11
+ import { researchModule } from "../research";
12
+ import { revenueBreakdownModule } from "../revenue-breakdown";
13
+ import { reverseDcfModule } from "../reverse-dcf";
14
+ import { tickerDetailModule } from "../ticker-detail";
15
+ import { timeSalesModule } from "../time-sales";
16
+
17
+ export const tickerCorePlugin = composeBuiltinPlugin({
18
+ ...tickerCorePluginMeta,
19
+ modules: [
20
+ ...[
21
+ tickerDetailModule,
22
+ chartComposerModule,
23
+ researchModule,
24
+ estimateRevisionsModule,
25
+ companyKpisModule,
26
+ revenueBreakdownModule,
27
+ dividendYieldModule,
28
+ reverseDcfModule,
29
+ peBandModule,
30
+ executivesModule,
31
+ timeSalesModule,
32
+ ].map(rendererOnly),
33
+ // Reads the profile's series folder, so it runs where the disk is: the desktop backend too.
34
+ userSeriesModule,
35
+ ],
36
+ });
@@ -15,6 +15,8 @@ import {
15
15
  formatCongressReturn,
16
16
  formatLag,
17
17
  FILING_DAY_FORMAT,
18
+ nextCongressPage,
19
+ previousCongressYearPage,
18
20
  sortedMembers,
19
21
  sortedTrades,
20
22
  sortedTickers,
@@ -113,6 +115,28 @@ function shotFilters(options: HeadlessPaneLoadArgs["options"], given: ReadonlySe
113
115
  }));
114
116
  }
115
117
 
118
+ /**
119
+ * Why a page holds no trades, as the pane says it ("No matching trades in
120
+ * this filing window."): a ticker search reads one window of the year's
121
+ * filings, so none in it says nothing of the year, and never that Congress
122
+ * disclosures do not cover the ticker. Names the window read and the
123
+ * command that reads the next one, or the year before after the last.
124
+ */
125
+ function emptyFilingWindow(payload: CloudCongressHousePayload, args: HeadlessPaneLoadArgs): string {
126
+ const symbol = args.symbols[0];
127
+ const from = payload.filingOffset ?? Number(args.options.filingOffset ?? 0);
128
+ const window = payload.filingsScanned > 0
129
+ ? `${payload.year} filings ${from + 1}-${from + payload.filingsScanned} of ${payload.filingCount}`
130
+ : `${payload.year} filings`;
131
+ const lines = [`No matching trades${symbol ? ` in ${symbol}` : ""} in this filing window (${window}).`];
132
+ const next = nextCongressPage(payload);
133
+ const asked = ["fn CG", symbol, args.options.tab && args.options.tab !== "trades" ? `--tab ${args.options.tab}` : null].filter(Boolean).join(" ");
134
+ const before = next ? null : previousCongressYearPage(payload);
135
+ if (next) lines.push(`An empty window does not mean none this year; the next: gloom ${asked} --year ${payload.year} --filingOffset ${next.filingOffset}`);
136
+ else if (before) lines.push(`That was the year's last window; the year before: gloom ${asked} --year ${before.year}`);
137
+ return lines.join("\n");
138
+ }
139
+
116
140
  export function createCongressHeadless(
117
141
  dependencies: CongressHeadlessDependencies = defaultDependencies,
118
142
  ): HeadlessPaneDefinition<"rows"> {
@@ -184,7 +208,10 @@ export function createCongressHeadless(
184
208
  filingsPaper: payload.filingsPaper ?? 0,
185
209
  senateUnavailable: payload.senateUnavailable ?? false,
186
210
  };
211
+ // None in this window is the window's answer for a covered ticker, not a gap in coverage.
212
+ const empty = (rows: unknown[]) => rows.length === 0 ? { empty: emptyFilingWindow(payload, args), unavailableSymbols: [] } : {};
187
213
  if (args.options.tab === "tickers") {
214
+ const rows = sortedTickers(payload.tickers ?? [], { columnId: "buyCount", direction: "desc" }).slice(0, limit).map((row) => ({ ...row }));
188
215
  return {
189
216
  columns: [
190
217
  { key: "ticker", header: "Ticker" }, { key: "buyCount", header: "Buys", align: "right" },
@@ -192,9 +219,10 @@ export function createCongressHeadless(
192
219
  { key: "estimatedLow", header: "Est Range", format: (_value, row) => formatAmountRange(row.estimatedLow as number | null, row.estimatedHigh as number | null) },
193
220
  { key: "lastFilingDate", header: "Last filed" },
194
221
  ],
195
- rows: sortedTickers(payload.tickers ?? [], { columnId: "buyCount", direction: "desc" }).slice(0, limit).map((row) => ({ ...row })),
222
+ rows,
196
223
  // Tickers aggregate the filings scanned so far rather than paging rows.
197
224
  metadata: { ...metadata, aggregateScope: "filtered filing window", filingOffset: payload.filingOffset, filingsScanned: payload.filingsScanned },
225
+ ...empty(rows),
198
226
  };
199
227
  }
200
228
  const pagedMetadata = { ...metadata, nextOffset: payload.nextOffset, hasMore: payload.hasMore };
@@ -202,12 +230,12 @@ export function createCongressHeadless(
202
230
  const rows = sortedMembers(payload.members, { columnId: "trades", direction: "desc" })
203
231
  .slice(0, limit)
204
232
  .map((member) => ({ ...member }));
205
- return { columns: MEMBER_COLUMNS, rows, metadata: pagedMetadata };
233
+ return { columns: MEMBER_COLUMNS, rows, metadata: pagedMetadata, ...empty(rows) };
206
234
  }
207
235
  const rows = sortedTrades(payload.trades, { columnId: "filed", direction: "desc" })
208
236
  .slice(0, limit)
209
237
  .map((trade) => ({ ...trade }));
210
- return { columns: TRADE_COLUMNS, rows, metadata: pagedMetadata };
238
+ return { columns: TRADE_COLUMNS, rows, metadata: pagedMetadata, ...empty(rows) };
211
239
  },
212
240
  };
213
241
  }
@@ -1,5 +1,5 @@
1
1
  import type { DataTableColumn } from "../../../components";
2
- import { dropColumnsToFit, getTableWidth } from "../../../components/ui/table-layout";
2
+ import { dropColumnsToFit, getTableWidth, markHiddenTableColumns } from "../../../components/ui/table-layout";
3
3
  import type { ShortDateOptions } from "../../../utils/datetime-format";
4
4
  import { MISSING_VALUE, formatCompact } from "../../../utils/format";
5
5
  import type { SortDirection } from "../../../utils/sort-values";
@@ -246,8 +246,10 @@ export function buildTradeColumns(width: number, tickerView = false): TradeColum
246
246
  const fitted = getTableWidth(long) <= width ? long : dropColumnsToFit(tradeColumns(tickerView, 7, MEMBER_READABLE_WIDTH, null), width, TRADE_DROP_ORDER);
247
247
  const shown = new Set(fitted.map((column) => column.id));
248
248
  const dateWidth = fitted[0]!.width;
249
- const layout = (memberWidth: number, assetWidth: number | null) => tradeColumns(tickerView, dateWidth, memberWidth, assetWidth)
250
- .filter((column) => shown.has(column.id) || column.id === "asset");
249
+ const layout = (memberWidth: number, assetWidth: number | null) => {
250
+ const all = tradeColumns(tickerView, dateWidth, memberWidth, assetWidth);
251
+ return markHiddenTableColumns(all, all.filter((column) => shown.has(column.id) || column.id === "asset"));
252
+ };
251
253
  // What the other columns leave, as the table draws them, names the member and then the asset.
252
254
  const flexWidth = Math.max(TRADE_MEMBER_MIN_WIDTH, MEMBER_READABLE_WIDTH + width - getTableWidth(fitted));
253
255
  // Member names rarely pass 22 cells; the rest names the asset, which is the
@@ -276,7 +278,8 @@ export function buildMemberTradeColumns(width: number): TradeColumn[] {
276
278
  const fitted = dropColumnsToFit(layout(MEMBER_TRADE_ASSET_MIN_WIDTH), width, MEMBER_TRADE_DROP_ORDER);
277
279
  const shown = new Set(fitted.map((column) => column.id));
278
280
  const assetWidth = Math.max(MEMBER_TRADE_ASSET_MIN_WIDTH, MEMBER_TRADE_ASSET_MIN_WIDTH + width - getTableWidth(fitted));
279
- return layout(assetWidth).filter((column) => shown.has(column.id));
281
+ const all = layout(assetWidth);
282
+ return markHiddenTableColumns(all, all.filter((column) => shown.has(column.id)));
280
283
  }
281
284
 
282
285
  /**
@@ -304,7 +307,8 @@ export function buildMemberColumns(width: number): MemberColumn[] {
304
307
  const fitted = dropColumnsToFit(layout(MEMBER_READABLE_WIDTH), width, MEMBER_DROP_ORDER);
305
308
  const shown = new Set(fitted.map((column) => column.id));
306
309
  const memberWidth = Math.max(MEMBER_READABLE_WIDTH, MEMBER_READABLE_WIDTH + width - getTableWidth(fitted));
307
- return layout(memberWidth).filter((column) => shown.has(column.id));
310
+ const all = layout(memberWidth);
311
+ return markHiddenTableColumns(all, all.filter((column) => shown.has(column.id)));
308
312
  }
309
313
 
310
314
  export function sortedTrades(
@@ -1,6 +1,7 @@
1
1
  import { Box, type InputRenderable } from "../../../ui";
2
2
  import { useCallback, useMemo, useRef, useState } from "react";
3
- import { PaneStatusBody, QueryBar, usePaneFooter, usePaneNoticeFooter } from "../../../components";
3
+ import { PaneStatusBody, QueryBar, RowNote, usePaneFooter } from "../../../components";
4
+ import { wrapTextLines } from "../../../utils/text-wrap";
4
5
  import { handleRefreshKey } from "../../../components/data-table/table-pane";
5
6
  import type { PaneProps } from "../../../types/plugin";
6
7
  import type { PluginModule } from "../plugin-module";
@@ -37,7 +38,7 @@ import {
37
38
  buildCorrelationPaneTitle,
38
39
  buildGeoCorrelationSeries,
39
40
  buildStatusSummary,
40
- correlationRollNotes,
41
+ matrixCellNotes,
41
42
  type CorrelationSeries,
42
43
  getSeriesForEntry,
43
44
  pairKey,
@@ -215,29 +216,23 @@ function CorrelationMatrixPane({ focused, width, height }: PaneProps) {
215
216
  phase: "before",
216
217
  scope: "correlation:tickers",
217
218
  });
218
- usePaneNoticeFooter({
219
- registrationId: "correlation-warnings", focused,
220
- notices: [...seriesBySymbol.values()].flatMap((series) => series.refreshError
221
- ? [`${series.symbol}: ${series.refreshError}${series.fetchedAt ? ` Retained history retrieved ${new Date(series.fetchedAt).toISOString()}.` : ""}`]
222
- : []).concat(pair && pairHistory?.unavailable ? [`${pair.join("/")}: ${pairHistory.unavailable}`] : []),
223
- });
224
-
225
- // The ticker set and range are visible in-pane and an invalid list shows in
226
- // the body, so the footer carries load state, and a future's rolls as GR
227
- // says them. `r` is global: no hint.
228
- const rollNotes = correlationRollNotes(symbols, seriesBySymbol).join(" · ");
219
+ // What concerns a symbol (a failed refresh, a future's rolls as GR says them) or the selected pair is said under
220
+ // the matrix while a cell of it is selected, as a table's row note is; the footer carries the matrix's load state.
221
+ // The ticker set and range are visible in-pane and an invalid list shows in the body. `r` is global: no hint.
222
+ const cellNote = matrixCellNotes(selection ? [...new Set(selection)] : [], seriesBySymbol,
223
+ pair && pairHistory?.unavailable ? `${pair.join("/")}: ${pairHistory.unavailable}` : null).join(" ");
229
224
  usePaneFooter("correlation", () => ({
230
225
  info: !settings.symbolsError && symbols.length >= 2 && statusSummary
231
- ? [{ id: "status", parts: [{ text: statusSummary, tone: "muted" as const }] },
232
- ...(rollNotes ? [{ id: "rolls", parts: [{ text: rollNotes, tone: "muted" as const }] }] : [])]
226
+ ? [{ id: "status", parts: [{ text: statusSummary, tone: "muted" as const }] }]
233
227
  : [],
234
- }), [rollNotes, settings.symbolsError, statusSummary, symbols.length]);
228
+ }), [settings.symbolsError, statusSummary, symbols.length]);
235
229
 
236
230
  // Rows are exactly as wide as the matrix (after the one-cell inset), so the
237
231
  // zebra and hover bands stop at the last column instead of running on.
238
232
  const matrixRowWidth = correlationMatrixLayout(symbols, width).rowWidth;
239
233
  const chartRows = pair ? matrixChartRows(width, height, symbols.length, matrixRowWidth) : 0;
240
- const matrixHeight = Math.max(1, height - 1 - (chartRows > 0 ? chartRows + 1 : 0));
234
+ const noteRows = cellNote ? wrapTextLines(cellNote, Math.max(1, width - 2)).length : 0;
235
+ const matrixHeight = Math.max(1, height - 1 - noteRows - (chartRows > 0 ? chartRows + 1 : 0));
241
236
  const bodyStatus = settings.symbolsError
242
237
  ? <PaneStatusBody error={settings.symbolsError} />
243
238
  : symbols.length < 2
@@ -287,6 +282,7 @@ function CorrelationMatrixPane({ focused, width, height }: PaneProps) {
287
282
  rowColor={(symbol) => rowHeaderColor(seriesBySymbol.get(symbol)?.status ?? "loading")}
288
283
  onOpenSymbol={openSymbol}
289
284
  />
285
+ <RowNote>{cellNote}</RowNote>
290
286
  {chartRows > 0 && pair && pairHistory ? (
291
287
  <MatrixPairChart
292
288
  pair={pair}
@@ -204,6 +204,24 @@ export function correlationRollNotes(symbols: readonly string[], seriesBySymbol:
204
204
  });
205
205
  }
206
206
 
207
+ /**
208
+ * What the matrix says under itself for the selected cell: each of its
209
+ * symbols' rolls and failed refresh, then the pair's own note. A note about
210
+ * one symbol is said where that symbol is selected, never in the footer.
211
+ */
212
+ export function matrixCellNotes(symbols: readonly string[], seriesBySymbol: ReadonlyMap<string, CorrelationSeries>, pairNote: string | null): string[] {
213
+ return [
214
+ ...correlationRollNotes(symbols, seriesBySymbol).map((note) => `${note.replace(/\.$/, "")}.`),
215
+ ...symbols.flatMap((symbol) => {
216
+ const series = seriesBySymbol.get(symbol);
217
+ return series?.refreshError
218
+ ? [`${symbol}: ${series.refreshError}${series.fetchedAt ? ` Retained history retrieved ${new Date(series.fetchedAt).toISOString()}.` : ""}`]
219
+ : [];
220
+ }),
221
+ ...(pairNote ? [pairNote] : []),
222
+ ];
223
+ }
224
+
207
225
  /**
208
226
  * The matrix already labels every symbol on both axes and the pane now carries
209
227
  * its own range control, so the title stays generic instead of repeating them.
@@ -16,7 +16,7 @@ const number = (value: unknown) => value === null || typeof value === "number" &
16
16
  const count = (value: unknown) => value === null || typeof value === "number" && Number.isSafeInteger(value) && value >= 0;
17
17
  const code = (value: unknown) => typeof value === "string" && /^[0-9A-Z]{5}[0-9A-Z+]$/.test(value);
18
18
  function base(data: CotPayloadBase, family: CotFamily, positions: CotPositions) {
19
- if (!data || data.source !== "CFTC" || data.scope !== positions || data.reportFamily !== family
19
+ if (!data || !["CFTC", "ICE Futures Europe", "CFTC / ICE Futures Europe"].includes(data.source) || data.scope !== positions || data.reportFamily !== family
20
20
  || !Array.isArray(data.gaps) || !data.gaps.every((gap) => typeof gap === "string")
21
21
  || !Array.isArray(data.classes) || data.classes.some((row) => !COT_CLASSES[family].some((option) => option.value === row.id))
22
22
  || data.asOf !== null && !date(data.asOf) || !Number.isFinite(Date.parse(data.generatedAt))
@@ -71,9 +71,8 @@ export async function fetchCotBoard(family: CotFamily, traderClass: CotClass, cl
71
71
  try { return validateCotBoard(await client.getCloudCotBoard(family, traderClass, positions), family, traderClass, positions); }
72
72
  catch (error) { throw unavailable(error); }
73
73
  }
74
- // Futures-only boards keep the key they always had, so a cached board still opens.
75
74
  const cotBoardKey = (family: CotFamily, traderClass: CotClass, positions: CotPositions) =>
76
- positions === "combined" ? `${family}:${traderClass}:combined` : `${family}:${traderClass}`;
75
+ `${family}:${traderClass}${positions === "combined" ? ":combined" : ""}${family === "disaggregated" ? ":ice" : ""}`;
77
76
  const presentCotBoard = (payload: CotBoardPayload, stale: boolean, refreshError: string | null) => ({
78
77
  ...payload, gaps: [...payload.gaps, ...(refreshError ? [refreshError] : [])],
79
78
  status: stale && payload.status === "available" ? "partial" as const : payload.status,
@@ -2,7 +2,7 @@ import { MISSING_VALUE } from "../../../utils/format";
2
2
  import type { CotClass, CotClassSummary, CotContractPayload, CotFamily, CotHistoryPoint } from "../../../api-client/cot";
3
3
  import type { HeadlessPaneColumn, HeadlessPaneDefinition } from "../../../types/plugin";
4
4
  import { fetchCotBoard, fetchCotContract } from "./client";
5
- import { COT_CLASSES, COT_FAMILIES, COT_MAJOR_CODES, COT_POSITIONS, COT_SCOPES, cotClass, cotContractCode, cotContractUnitText, cotFamily, cotInteger, cotMarketName, cotPositions, cotPositionsText, cotProxyFor, cotProxyNote, cotReleaseTime, cotRoot, cotScope, cotUnknownMarketMessage } from "./model";
5
+ import { COT_CLASSES, COT_FAMILIES, COT_MAJOR_CODES, COT_POSITIONS, COT_SCOPES, cotClass, cotContractCode, cotContractUnitText, cotDefaultFamily, cotFamily, cotInteger, cotMarketName, cotPositions, cotPositionsText, cotProxyFor, cotProxyNote, cotReleaseTime, cotRoot, cotScope, cotUnknownMarketMessage } from "./model";
6
6
  import { COMMODITIES_VIEW_STATE } from "../commodities-energy/view-state";
7
7
  import { REPORT_ROWS } from "../shared/headless-options";
8
8
  import { DATE_OPTION_EXAMPLES, isoDateOption } from "../../../utils/calendar-date";
@@ -19,13 +19,13 @@ const rank = (value: unknown) => typeof value === "number" ? value.toFixed(0) :
19
19
  * the app's copy of the schedule): one time for the text, CSV and JSON, the
20
20
  * export's publication time and the metadata's `publishedAt` alike.
21
21
  */
22
- function cotPublishedAt(data: Pick<CotContractPayload, "asOf" | "publishedAt">): string | null {
23
- return data.publishedAt ?? cotReleaseTime(data.asOf);
22
+ function cotPublishedAt(data: Pick<CotContractPayload, "asOf" | "publishedAt" | "source">): string | null {
23
+ return data.publishedAt ?? (data.source === "CFTC" ? cotReleaseTime(data.asOf) : null);
24
24
  }
25
- /** Who published the report, cited by every export: the CFTC itself. */
25
+ /** The CFTC's full publisher name for exports of its reports. */
26
26
  const COT_PUBLISHER = "Commodity Futures Trading Commission (CFTC)";
27
- function cotReleased(publishedAt: string | null) {
28
- return { freshness: { publisher: COT_PUBLISHER, ...(publishedAt ? { publishedAt } : {}) } };
27
+ function cotReleased(publishedAt: string | null, source: CotContractPayload["source"]) {
28
+ return { freshness: { source, publisher: source === "CFTC" ? COT_PUBLISHER : source, ...(publishedAt ? { publishedAt } : {}) } };
29
29
  }
30
30
 
31
31
  /** The pane's columns: percentiles as their rank value, net share of open interest to one decimal. */
@@ -104,15 +104,15 @@ function cotHistoryNote(data: CotContractPayload, since: string | null): string
104
104
  const previous = data.reportFamily === "legacy" ? COT_CODES_BEFORE_1998[data.contract?.contractCode ?? ""] : undefined;
105
105
  return previous
106
106
  ? `Reports under CFTC code ${data.contract!.contractCode} start ${data.historyStart}, when the CFTC began counting this market in contracts; its earlier reports are under its previous code ${previous}, in thousands of bushels, and are not joined to these. --since ${since} lists from ${data.historyStart}.`
107
- : `The CFTC's first report of this market in Gloom Cloud is ${data.historyStart}; --since ${since} lists from there.`;
107
+ : `The first report of this market in Gloom Cloud is ${data.historyStart}; --since ${since} lists from there.`;
108
108
  }
109
109
 
110
110
  export const cotHeadless: HeadlessPaneDefinition<"bundle"> = {
111
111
  shape: "bundle",
112
112
  // Tuesday positions published the Friday after; two weeks without a new report means one was missed.
113
- freshness: { source: "CFTC", status: "not-a-feed", basis: "weekly report", maxAgeMinutes: 14 * 24 * 60 },
114
- argument: { kind: "free-text", optional: true, placeholder: "code or name", description: "Futures root (KC), commodity name (coffee) or CFTC market code; omit for the extremes board." },
115
- options: [{ key: "report", type: "enum", values: COT_FAMILIES.map(({ value }) => ({ value })), defaultValue: "legacy", description: "CFTC report: legacy, disaggregated, or tff (Traders in Financial Futures)." },
113
+ freshness: { source: "Commitments of Traders", status: "not-a-feed", basis: "weekly report", maxAgeMinutes: 14 * 24 * 60 },
114
+ argument: { kind: "free-text", optional: true, placeholder: "code or name", description: "Futures root (KC), commodity name (coffee, Brent, gasoil) or CFTC/ICE market code; omit for the extremes board." },
115
+ options: [{ key: "report", type: "enum", values: COT_FAMILIES.map(({ value }) => ({ value })), description: "Report: legacy (default), disaggregated (default for ICE Europe markets), or tff (Traders in Financial Futures)." },
116
116
  { key: "traderClass", type: "enum", values: TRADER_CLASSES.map((value) => ({ value })), description: "Trader class for the extremes board; defaults by report family.",
117
117
  pluginState: { pluginId: COMMODITIES_VIEW_STATE.cot, key: "class" } },
118
118
  { key: "positions", type: "enum", values: COT_POSITIONS.map(({ value }) => ({ value })), defaultValue: "futures-only", description: "Futures positions only, or futures and options combined, as in the pane.",
@@ -125,10 +125,10 @@ export const cotHeadless: HeadlessPaneDefinition<"bundle"> = {
125
125
  // Weekly reports come newest first, so --tail asks for the same newest n as --limit.
126
126
  { key: "limit", type: "integer", aliases: ["tail", "weeks", "rows"], minimum: 1, maximum: 2000, shot: REPORT_ROWS,
127
127
  description: "Newest weekly reports a market lists; every one by default." }],
128
- discovery: { aliases: ["COT", "CFTC"], dataRequirements: ["Gloom Cloud CFTC history"], limitations: ["Positions aggregate all maturities; combined adds options, delta-adjusted.", "Legacy, disaggregated and TFF classes differ.", "Observation date is not publication date.", "Some markets have short or suppressed histories."] },
129
- describe: "CFTC positioning",
128
+ discovery: { aliases: ["COT", "CFTC"], dataRequirements: ["Gloom Cloud CFTC and ICE Futures Europe history"], limitations: ["Positions aggregate all maturities; combined adds options, delta-adjusted.", "Legacy, disaggregated and TFF classes differ.", "Observation date is not publication date.", "Some markets have short or suppressed histories."] },
129
+ describe: "Commitments of Traders positioning",
130
130
  async load(args, ctx) {
131
- const family = cotFamily(args.options.report);
131
+ const family = cotFamily(args.options.report ?? cotDefaultFamily(cotContractCode(args.argument)));
132
132
  const positions = cotPositions(args.options.positions);
133
133
  if (args.argument) {
134
134
  const code = cotContractCode(args.argument);
@@ -155,11 +155,11 @@ export const cotHeadless: HeadlessPaneDefinition<"bundle"> = {
155
155
  columns: weeklyColumns,
156
156
  // Each report's scheduled release, for an export read as of a past week; the text keeps to the positions.
157
157
  textColumns: weeklyColumns.filter((column) => column.key !== "released"),
158
- rows: weeks.map((row) => ({ reportDate: row.reportDate, released: row.publishedAt ?? cotReleaseTime(row.reportDate), openInterest: row.openInterest,
158
+ rows: weeks.map((row) => ({ reportDate: row.reportDate, released: row.publishedAt ?? (code.startsWith("ICE") ? null : cotReleaseTime(row.reportDate)), openInterest: row.openInterest,
159
159
  ...Object.fromEntries(row.positions.map((position) => [`${camelClass(position.id)}Net`, position.net])) })) }],
160
160
  // "jet fuel" reads heating oil's positions, and says so.
161
161
  ...(proxy || historyNote ? { notes: [...(proxy ? [cotProxyNote(proxy)] : []), ...(historyNote ? [historyNote] : [])] } : {}),
162
- errors: data.gaps, metadata: { ...data, publishedAt, complete: data.status === "available" }, ...cotReleased(publishedAt) };
162
+ errors: data.gaps, metadata: { ...data, publishedAt, complete: data.status === "available" }, ...cotReleased(publishedAt, data.source) };
163
163
  }
164
164
  const traderClass = cotClass(family, args.options.traderClass);
165
165
  if (args.options.traderClass && traderClass !== args.options.traderClass) throw new Error("Trader class does not belong to this report family");
@@ -173,6 +173,6 @@ export const cotHeadless: HeadlessPaneDefinition<"bundle"> = {
173
173
  ...POSITION_COLUMNS.map((column) => column.key === "net" ? { ...column, textHeader: cotBoardNetHeader(family, traderClass) } : column),
174
174
  { key: "openInterest", header: "Open interest", align: "right", format: count }, { key: "reportDate", header: "As of" }],
175
175
  rows: rows.map((row) => ({ contractCode: row.contractCode, root: cotRoot(row.contractCode) ?? row.contractCode, marketName: cotMarketName(row.marketName), reportDate: row.reportDate, openInterest: row.openInterest, ...cotPositionRow(row.position) })) }],
176
- errors: data.gaps, metadata: { ...data, scope, publishedAt, complete: data.status === "available" }, ...cotReleased(publishedAt) };
176
+ errors: data.gaps, metadata: { ...data, scope, publishedAt, complete: data.status === "available" }, ...cotReleased(publishedAt, data.source) };
177
177
  },
178
178
  };
@@ -1,17 +1,17 @@
1
1
  import type { PluginModule } from "../plugin-module";
2
2
  import { cotBoardCache } from "./client";
3
3
  import { cotHeadless } from "./headless";
4
- import { COT_ROOT_OPTIONS, cotContractCode, cotContractCodeForTicker, cotProxyFor, cotRoot, cotUnknownMarketMessage } from "./model";
4
+ import { COT_ROOT_OPTIONS, cotContractCode, cotContractCodeForTicker, cotDefaultFamily, cotProxyFor, cotRoot, cotUnknownMarketMessage } from "./model";
5
5
  import { COT_SERIES } from "./series";
6
6
 
7
7
  export const cotModule: PluginModule = {
8
8
  series: COT_SERIES,
9
- panes: [{ id: "cot", name: "CFTC Positioning", icon: "P", shareItem: { argument: true }, get component(): typeof import("./pane").CotPane { const { CotPane } = require("./pane"); return CotPane; },
9
+ panes: [{ id: "cot", name: "Trader Positioning", icon: "P", shareItem: { argument: true }, get component(): typeof import("./pane").CotPane { const { CotPane } = require("./pane"); return CotPane; },
10
10
  defaultPosition: "right", defaultMode: "floating", defaultFloatingSize: { width: 106, height: 30 },
11
11
  tableExport: true, headless: cotHeadless }],
12
- paneTemplates: [{ id: "cot-cot", paneId: "cot", label: "CFTC Positioning",
12
+ paneTemplates: [{ id: "cot-cot", paneId: "cot", label: "Trader Positioning",
13
13
  description: "Weekly futures positioning, changes, historical percentiles and cross-market extremes.",
14
- keywords: ["cot", "cftc", "positioning", "commitments", "managed money", "net spec", "crude oil", "natural gas"],
14
+ keywords: ["cot", "cftc", "positioning", "commitments", "managed money", "net spec", "crude oil", "natural gas", "brent", "gasoil", "ICE Europe"],
15
15
  shortcut: { prefix: "COT", aliases: ["CFTC"], argKind: "text" as const, argPlaceholder: "code or name", argOptional: true,
16
16
  argOptions: () => COT_ROOT_OPTIONS }, headless: cotHeadless,
17
17
  createInstance: (context, options) => {
@@ -20,8 +20,8 @@ export const cotModule: PluginModule = {
20
20
  if (input && !code) throw new Error(cotUnknownMarketMessage(input));
21
21
  // "jet fuel" opens heating oil, and the title says which market stands in.
22
22
  const proxy = input ? cotProxyFor(input) : null;
23
- return { title: code ? `COT ${cotRoot(code) ?? code}${proxy ? ` (${proxy.subject} proxy)` : ""}` : "CFTC Positioning", params: code ? { code } : undefined,
24
- settings: { report: options?.values?.report ?? "legacy" }, placement: "floating" as const };
23
+ return { title: code ? `COT ${cotRoot(code) ?? code}${proxy ? ` (${proxy.subject} proxy)` : ""}` : "Trader Positioning", params: code ? { code, cotReport: String(options?.values?.report ?? cotDefaultFamily(code)) } : undefined,
24
+ settings: { report: options?.values?.report ?? cotDefaultFamily(code) }, placement: "floating" as const };
25
25
  },
26
26
  }],
27
27
  setup(ctx) { cotBoardCache.attach(ctx.persistence); },
@@ -50,7 +50,23 @@ const ROOTS: Record<string, { code: string; exchange: string; priceSymbol: strin
50
50
  XRP: { code: "176740", exchange: "CME", priceSymbol: null, name: "XRP", crypto: true },
51
51
  };
52
52
  /** The verified root aliases, labeled "ZQ 30-Day Fed Funds"; `cotContractCode` also takes every FUT board root the CFTC reports. */
53
- export const COT_ROOT_OPTIONS = Object.entries(ROOTS).map(([root, row]) => ({ value: root, label: root === row.name ? root : `${root} ${row.name}` }));
53
+ const ICE_MARKETS = [
54
+ { code: "ICE00B", root: "BRENT", name: "ICE Brent Crude", aliases: ["brent", "ice brent", "brent crude", "brent crude oil", "ice brent crude", "ice brent crude oil"], exchange: "NYM", priceSymbol: "BZ=F" },
55
+ { code: "ICE00G", root: "GASOIL", name: "ICE Gasoil", aliases: ["gasoil", "gas oil", "ice gasoil", "ice gas oil", "low sulphur gasoil"], exchange: "ICEU", priceSymbol: null },
56
+ { code: "ICEDBI", root: "ICE DUBAI", name: "ICE Dubai 1st Line", aliases: ["dubai", "ice dubai", "dubai 1st line", "ice dubai 1st line"], exchange: "ICEU", priceSymbol: null },
57
+ { code: "ICE00C", root: "ICE COCOA", name: "ICE Cocoa", aliases: ["ice cocoa", "london cocoa"], exchange: "ICEU", priceSymbol: null },
58
+ { code: "ICE0RC", root: "ROBUSTA", name: "ICE Robusta Coffee", aliases: ["robusta", "robusta coffee", "ice robusta", "ice robusta coffee", "rc", "ice rc"], exchange: "ICEU", priceSymbol: null },
59
+ { code: "ICE00W", root: "WHITE SUGAR", name: "ICE White Sugar", aliases: ["white sugar", "ice white sugar"], exchange: "ICEU", priceSymbol: null },
60
+ { code: "ICE00T", root: "ICE WHEAT", name: "ICE Wheat", aliases: ["ice wheat", "feed wheat", "uk wheat", "london wheat"], exchange: "ICEU", priceSymbol: null },
61
+ { code: "067411", root: "ICE WTI", name: "ICE WTI Crude", aliases: ["ice wti", "ice wti crude", "ice wti crude oil"], exchange: "ICEU", priceSymbol: null },
62
+ ] as const;
63
+ const iceMarket = (value: string) => {
64
+ const input = value.trim().toLowerCase().replace(/[\s_-]+/g, " ");
65
+ return ICE_MARKETS.find((market) => (market.aliases as readonly string[]).includes(input));
66
+ };
67
+ export const COT_ROOT_OPTIONS = [...Object.entries(ROOTS).map(([root, row]) => ({ value: root, label: root === row.name ? root : `${root} ${row.name}` })),
68
+ ...ICE_MARKETS.map((market) => ({ value: market.aliases[0], label: market.name }))];
69
+ export function cotDefaultFamily(code: string | null): CotFamily { return code?.startsWith("ICE") ? "disaggregated" : "legacy"; }
54
70
  /** The crypto roots named for a coin, which a coin pair (BTC-USD) can stand for. The micros have no pair. */
55
71
  const COIN_PAIR_ROOTS: ReadonlySet<string> = new Set(["BTC", "ETH", "SOL", "XRP"]);
56
72
  /**
@@ -119,6 +135,7 @@ function boardMarketCode(contract: FuturesContract): string | null {
119
135
  * not appear; nothing is substituted. Everything else is one scope switch away.
120
136
  */
121
137
  export const COT_MAJOR_CODES: ReadonlySet<string> = new Set([
138
+ ...ICE_MARKETS.map((market) => market.code),
122
139
  // Equity index and volatility
123
140
  "13874A", "209742", "239742", "124603", "1170E1",
124
141
  // Rates
@@ -172,6 +189,8 @@ function typedMarket(value: string): { board: FuturesContract } | { root: string
172
189
  */
173
190
  export function cotContractCode(value: unknown): string | null {
174
191
  if (typeof value !== "string") return null;
192
+ const ice = iceMarket(value);
193
+ if (ice) return ice.code;
175
194
  const input = value.trim().toUpperCase().replace(/=F$/, "");
176
195
  const alias = rootAlias(input) ?? currencyFuture(input);
177
196
  if (alias) return alias;
@@ -219,9 +238,9 @@ const SUGGESTED_MARKETS: ReadonlyArray<readonly [string, string]> = [
219
238
  */
220
239
  export function cotUnknownMarketMessage(value: unknown): string {
221
240
  const market = typeof value === "string" ? typedMarket(value) : null;
222
- if (market && "board" in market) return `${market.board.code} (${market.board.name}) is not reported in the CFTC COT.`;
241
+ if (market && "board" in market) return `${market.board.code} (${market.board.name}) is not reported in COT.`;
223
242
  const known = SUGGESTED_MARKETS.map(([code, name]) => `${code} ${name}`).join(", ");
224
- return `Unknown market "${String(value)}". Try a code or name such as ${known}, or a CFTC market code such as ${ROOTS.GC!.code}.`;
243
+ return `Unknown market "${String(value)}". Try a code or name such as ${known}, Brent, gasoil, or a market code such as ${ROOTS.GC!.code} or ICE00B.`;
225
244
  }
226
245
  /**
227
246
  * The code for the ticker under the cursor, when COT is opened without an
@@ -274,11 +293,12 @@ export function cotReleaseTime(reportDate: string | null | undefined): string |
274
293
 
275
294
  /** The futures root a CFTC code belongs to, for titles readers recognize: a verified alias, else its FUT board root. */
276
295
  export function cotRoot(code: string): string | null {
277
- return Object.entries(ROOTS).find(([, row]) => row.code === code)?.[0]
296
+ return ICE_MARKETS.find((market) => market.code === code)?.root
297
+ ?? Object.entries(ROOTS).find(([, row]) => row.code === code)?.[0]
278
298
  ?? FUTURES_CONTRACTS.find((contract) => boardMarketCode(contract) === code)?.code
279
299
  ?? null;
280
300
  }
281
- export function cotPriceMapping(code: string) { return Object.values(ROOTS).find((row) => row.code === code) ?? PRICE_OVERLAYS[code] ?? null; }
301
+ export function cotPriceMapping(code: string) { return ICE_MARKETS.find((market) => market.code === code) ?? Object.values(ROOTS).find((row) => row.code === code) ?? PRICE_OVERLAYS[code] ?? null; }
282
302
  export function cotClass(family: CotFamily, value: unknown): CotClass {
283
303
  return COT_CLASSES[family].find((row) => row.value === value)?.value ?? COT_CLASSES[family][0]!.value;
284
304
  }
@@ -3,6 +3,8 @@ import { useCallback, useMemo, useRef, useState } from "react";
3
3
  import { ChartTableHeader, CompositeChart, DataTableStackView, spanDigits, DataTableView, PaneStatusBody, QueryBar, usePaneFooter, usePaneNoticeFooter, usePaneStatusFooter, usePaneTabs, useQueryBarSearch, type ChartTableChart, type DataTableColumn, type SelectControl } from "../../../components";
4
4
  import { useAsyncResource, usePluginPaneState, useShortcut } from "../../../public/react";
5
5
  import { usePaneInstance } from "../../../state/app/context";
6
+ import { COMMODITIES_ENERGY_PANE_ID } from "../commodities-energy/view-state";
7
+ import { useCommandValue } from "../shared/command-tab";
6
8
  import { useThemeColors } from "../../../theme/theme-context";
7
9
  import type { PaneProps } from "../../../types/plugin";
8
10
  import type { ResolvedSeries } from "../../../time-series/types";
@@ -49,7 +51,8 @@ const cotDetailTitle = (name: string | undefined, code: string | null) => name ?
49
51
 
50
52
  export function CotPane(props: PaneProps) {
51
53
  const pane = usePaneInstance();
52
- const [storedFamily, setFamily] = usePluginPaneState<CotFamily>("report", cotFamily(pane?.settings?.report));
54
+ const [storedFamily, setFamily] = useCommandValue<CotFamily>(COMMODITIES_ENERGY_PANE_ID, "report",
55
+ (params) => params.tab === "positioning" && params.cotReport ? cotFamily(params.cotReport) : null, cotFamily(pane?.settings?.report));
53
56
  const family = cotFamily(storedFamily);
54
57
  const { strip: tabStrip, rows: tabRows } = usePaneTabs({ tabs: [...COT_FAMILIES], activeValue: family, onSelect: (value) => setFamily(value as CotFamily), focused: props.focused, dense: true });
55
58
  return <Box width={props.width} height={props.height} flexDirection="column">
@@ -62,10 +65,12 @@ function CotBoard({ width, height, focused, family, initialCode }: PaneProps & {
62
65
  const session = useResearchCloudSession();
63
66
  const [storedClass, setClass] = usePluginPaneState<CotClass>("class", COT_CLASSES[family][0]!.value);
64
67
  const traderClass = cotClass(family, storedClass);
65
- const [selected, setSelected] = usePluginPaneState<string | null>("selected", initialCode);
68
+ const [selected, setSelected] = useCommandValue<string | null>(COMMODITIES_ENERGY_PANE_ID, "selected",
69
+ (params) => params.tab === "positioning" ? params.code ?? null : null, initialCode);
66
70
  // A closed detail is stored as "": pane state reads null as unset, so Back
67
71
  // would fall through to the deep-linked code and reopen it.
68
- const [storedOpen, setOpen] = usePluginPaneState<string>("open", initialCode ?? "");
72
+ const [storedOpen, setOpen] = useCommandValue<string>(COMMODITIES_ENERGY_PANE_ID, "open",
73
+ (params) => params.tab === "positioning" ? params.code ?? null : null, initialCode ?? "");
69
74
  const open = storedOpen || null;
70
75
  const [storedScope, setScope] = usePluginPaneState<CotScope>("scope", "major");
71
76
  const scope = cotScope(storedScope);
@@ -111,7 +116,7 @@ function CotBoard({ width, height, focused, family, initialCode }: PaneProps & {
111
116
  ] : [] }), [boardShown, focusSearch]);
112
117
  usePaneNoticeFooter({ registrationId: "cot:board-notices", focused, enabled: !open, notices: data?.gaps ?? [] });
113
118
  usePaneStatusFooter({ registrationId: "cot:board", enabled: !open, loading: resource.loading, error: resource.error,
114
- info: data ? [{ id: "as-of", parts: [{ text: `CFTC ${cotPositionsText(positions)} · ${data.asOf ?? MISSING_VALUE} · contracts`, tone: "muted" }] }] : [] });
119
+ info: data ? [{ id: "as-of", parts: [{ text: `${cotPositionsText(positions)} · as of ${data.asOf ?? MISSING_VALUE} · contracts`, tone: "muted" }] }] : [] });
115
120
  // A class change reloads under the query bar, which stays.
116
121
  return <DataTableStackView<CotBoardRow> columns={BOARD_COLUMNS} items={rows} focused={focused && !searching}
117
122
  status={data ? undefined : { loading: resource.loading, error: resource.error, empty: !resource.loading && !resource.error, subject: "COT history" }}
@@ -127,7 +132,7 @@ function CotBoard({ width, height, focused, family, initialCode }: PaneProps & {
127
132
  return { text: row.reportDate, color: colors.textMuted };
128
133
  }}
129
134
  rootBefore={<QueryBar width={width}
130
- search={{ value: query, onChange: setQuery, placeholder: "market or CFTC code", focused, ...searchProps }}
135
+ search={{ value: query, onChange: setQuery, placeholder: "market or COT code", focused, ...searchProps }}
131
136
  filters={[
132
137
  { id: "class", label: "Class", value: traderClass, options: COT_CLASSES[family], onChange: setClass, controlRef: control },
133
138
  { id: "scope", label: "Scope", value: scope, defaultValue: "major", options: [...COT_SCOPES], onChange: setScope, controlRef: scopeControl },
@@ -197,7 +202,7 @@ function CotDetail({ width, height, focused, code, family, positions, traderClas
197
202
  usePaneStatusFooter({ registrationId: "cot:detail", loading: resource.loading, error: resource.error,
198
203
  // The unit the net is counted in, as `fn COT` titles it: what one contract is, where the report says.
199
204
  // Futures and options combined says so; futures only reads as it always has.
200
- info: payload ? [{ id: "as-of", parts: [{ text: `CFTC ${positions === "combined" ? `${cotPositionsText(positions)} · ` : ""}${payload.asOf ?? MISSING_VALUE} · ${cotContractUnitText(payload.contract?.contractUnits) ?? "contracts"}${data?.priceAsOf ? ` · ${data.priceSymbol} ${data.priceAsOf}` : ""}`, tone: "muted" }] }] : [] });
205
+ info: payload ? [{ id: "as-of", parts: [{ text: `${positions === "combined" ? `${cotPositionsText(positions)} · ` : ""}as of ${payload.asOf ?? MISSING_VALUE} · ${cotContractUnitText(payload.contract?.contractUnits) ?? "contracts"}${data?.priceAsOf ? ` · ${data.priceSymbol} ${data.priceAsOf}` : ""}`, tone: "muted" }] }] : [] });
201
206
  return <PaneStatusBody loading={resource.loading && !data} error={!data ? resource.error : null} empty={!!payload && !payload.contract} subject="COT contract">
202
207
  {payload && data ? <DataTableView columns={POSITION_COLUMNS} items={payload.positions} focused={focused} rootWidth={width} rootHeight={height}
203
208
  rootBefore={<ChartTableHeader width={width} height={height} tableRows={payload.positions.length} chart={chart}
@@ -1,27 +1,30 @@
1
1
  import type { SeriesDefinition } from "../../../series/types";
2
2
  import { fetchCotContract } from "./client";
3
- import { COT_ROOT_OPTIONS, cotContractCode, cotNetPoints } from "./model";
3
+ import { COT_ROOT_OPTIONS, cotContractCode, cotDefaultFamily, cotNetPoints } from "./model";
4
4
 
5
5
  /**
6
- * Speculative (noncommercial) net positioning for each market the COT pane
7
- * names by root, from the legacy report every market is in. The pane's other
6
+ * Speculative net positioning for each market the COT pane names by root:
7
+ * CFTC noncommercial or ICE Europe's managed money. The pane's other
8
8
  * trader classes and markets stay in the pane.
9
9
  */
10
10
  export const COT_SERIES: readonly SeriesDefinition[] = COT_ROOT_OPTIONS.flatMap((option): SeriesDefinition[] => {
11
11
  const code = cotContractCode(option.value);
12
12
  if (!code) return [];
13
+ const family = cotDefaultFamily(code);
14
+ const traderClass = family === "disaggregated" ? "managed-money" : "noncommercial";
15
+ const className = family === "disaggregated" ? "managed money" : "noncommercial";
13
16
  const market = option.label.startsWith(`${option.value} `) ? option.label.slice(option.value.length + 1) : option.label;
14
17
  return [{
15
- id: `cot:${option.value.toLowerCase()}-noncommercial-net`,
16
- name: `${market}: noncommercial net position`,
18
+ id: `cot:${option.value.toLowerCase().replace(/\s+/g, "-")}-${traderClass}-net`,
19
+ name: `${market}: ${className} net position`,
17
20
  unit: "contracts",
18
21
  frequency: "weekly",
19
22
  group: "Positioning",
20
23
  tags: ["COT", "commitments of traders", "speculators", "net spec", option.value],
21
- publisher: "CFTC",
24
+ publisher: family === "disaggregated" ? "ICE Futures Europe" : "CFTC",
22
25
  load: async () => {
23
- const payload = await fetchCotContract(code, "legacy");
24
- return { points: cotNetPoints(payload.history, "noncommercial").map((point) => ({ date: point.date, value: point.value })) };
26
+ const payload = await fetchCotContract(code, family);
27
+ return { points: cotNetPoints(payload.history, traderClass).map((point) => ({ date: point.date, value: point.value })) };
25
28
  },
26
29
  }];
27
30
  });
@@ -124,11 +124,22 @@ function releaseTime(iso: string): string {
124
124
  * 14 Oct 08:30 ET". A release past its time and not in yet reads "due".
125
125
  */
126
126
  export function cpiHeaderLine(release: CpiReleaseStatus, now = Date.now()): string | undefined {
127
+ const stamp = cpiReleaseStamp(release);
128
+ if (!stamp) return undefined;
129
+ const next = cpiNextRelease(release, now);
130
+ return next ? `${stamp} · ${next}` : stamp;
131
+ }
132
+
133
+ /** The month the data covers and when it came out: "Aug 2026 · released Fri 11 Sep 08:30 ET". What the pane's bar keeps whole. */
134
+ export function cpiReleaseStamp(release: CpiReleaseStatus): string | undefined {
127
135
  if (!release.period) return undefined;
128
- const parts = [cpiMonth(release.period)];
129
- if (release.releasedAt) parts.push(`released ${releaseTime(release.releasedAt)}`);
130
- if (release.nextReleaseAt) parts.push(`${Date.parse(release.nextReleaseAt) <= now ? "due" : "next"} ${releaseTime(release.nextReleaseAt)}`);
131
- return parts.join(" · ");
136
+ return release.releasedAt ? `${cpiMonth(release.period)} · released ${releaseTime(release.releasedAt)}` : cpiMonth(release.period);
137
+ }
138
+
139
+ /** When the next release is due, "next Wed 14 Oct 08:30 ET" ("due" once past its time): what gives way in a narrow pane. */
140
+ export function cpiNextRelease(release: CpiReleaseStatus, now = Date.now()): string | undefined {
141
+ if (!release.nextReleaseAt) return undefined;
142
+ return `${Date.parse(release.nextReleaseAt) <= now ? "due" : "next"} ${releaseTime(release.nextReleaseAt)}`;
132
143
  }
133
144
 
134
145
  /** The first of the month a change is for, which the chart plots it on. */