@gloom-sh/terminal 0.20.10 → 0.20.12

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 (324) hide show
  1. package/package.json +2 -1
  2. package/patches/@opentui%2Fcore@0.3.2.patch +16 -0
  3. package/src/api-client/awards.ts +16 -0
  4. package/src/api-client/central-bank-rates.ts +5 -0
  5. package/src/api-client/data.ts +55 -2
  6. package/src/api-client/index.ts +18 -1
  7. package/src/api-client/request.ts +86 -3
  8. package/src/api-client/socket-connection.ts +366 -0
  9. package/src/api-client/socket-features.ts +75 -0
  10. package/src/api-client/socket-frames.ts +161 -0
  11. package/src/api-client/socket-listeners.ts +207 -0
  12. package/src/api-client/socket-quotes.ts +332 -0
  13. package/src/api-client/socket.ts +168 -983
  14. package/src/api-client/supply-chain-graph.ts +4 -2
  15. package/src/api-client/supply-chain.ts +8 -0
  16. package/src/api-client/types/econ.ts +10 -7
  17. package/src/api-client/types/filings-and-calls.ts +8 -0
  18. package/src/app/global-shortcuts.ts +2 -1
  19. package/src/app/keybindings/actions.ts +19 -0
  20. package/src/app/pane-runtime/index.tsx +18 -3
  21. package/src/app/pane-runtime/layout-placement.ts +63 -0
  22. package/src/app/pane-runtime/ticker-open-runtime.ts +10 -2
  23. package/src/brokers/signed-in/adapter.ts +19 -5
  24. package/src/brokers/signed-in/client.ts +13 -1
  25. package/src/brokers/signed-in/sign-in-dialog.tsx +33 -9
  26. package/src/capabilities/chart-series.ts +4 -1
  27. package/src/cli/board-coins.ts +10 -1
  28. package/src/cli/commands/crypto-hints.ts +3 -2
  29. package/src/cli/commands/fred-series.ts +0 -54
  30. package/src/cli/commands/market.ts +209 -31
  31. package/src/cli/commands/overview.ts +47 -14
  32. package/src/cli/commands/search.ts +37 -8
  33. package/src/cli/commands/ticker.ts +15 -4
  34. package/src/cli/desktop-pane-shot.ts +27 -2
  35. package/src/cli/fx-quote-rate.ts +1 -1
  36. package/src/cli/glossary.ts +14 -5
  37. package/src/cli/history-catalog-series.ts +85 -0
  38. package/src/cli/index.ts +1 -1
  39. package/src/cli/list-progress.ts +45 -0
  40. package/src/cli/listing-arg.ts +71 -7
  41. package/src/cli/name-entries.ts +8 -4
  42. package/src/cli/not-a-ticker.ts +2 -2
  43. package/src/cli/pane-functions/freshness.ts +50 -3
  44. package/src/cli/pane-functions/index.ts +7 -4
  45. package/src/cli/pane-functions/market-session.ts +66 -14
  46. package/src/cli/pane-functions/options.ts +5 -0
  47. package/src/cli/pane-functions/resolver.ts +9 -2
  48. package/src/cli/pane-functions/screenshot-assessment.ts +28 -3
  49. package/src/cli/pane-functions/screenshot-types.ts +6 -0
  50. package/src/cli/quote-answer.ts +49 -10
  51. package/src/cli/quote-list-reads.ts +87 -0
  52. package/src/cli/report-tables.ts +70 -13
  53. package/src/cli/result.ts +24 -2
  54. package/src/cli/symbol-list.ts +31 -4
  55. package/src/cli/terminal-code-hints.ts +83 -0
  56. package/src/cli/ticker-resolution.ts +2 -1
  57. package/src/cli/treasury-yields.ts +5 -0
  58. package/src/components/chart/native/kitty/manager.ts +2 -0
  59. package/src/components/chart/native/surface/manager.ts +211 -11
  60. package/src/components/command-bar/action-runtime.ts +2 -0
  61. package/src/components/command-bar/panel/index.tsx +2 -13
  62. package/src/components/command-bar/panel/layout.ts +1 -7
  63. package/src/components/command-bar/panel/runtime.ts +0 -1
  64. package/src/components/command-bar/panel/types.ts +0 -2
  65. package/src/components/command-bar/routing/launch-request.ts +2 -1
  66. package/src/components/command-bar/routing/navigation-state.ts +4 -2
  67. package/src/components/command-bar/workflow/types.ts +6 -0
  68. package/src/components/data-table/column-menu.tsx +89 -0
  69. package/src/components/data-table/sort-menu.tsx +9 -2
  70. package/src/components/data-table/view.tsx +33 -6
  71. package/src/components/form-modal/content.tsx +10 -0
  72. package/src/components/index.ts +1 -1
  73. package/src/components/layout/detached-pane-shell.tsx +3 -0
  74. package/src/components/layout/double-escape-close.ts +34 -3
  75. package/src/components/layout/floating-pane.tsx +10 -4
  76. package/src/components/layout/pane/cycle-order.ts +66 -2
  77. package/src/components/layout/pane/footer/index.tsx +25 -11
  78. package/src/components/layout/pane/footer/model.ts +62 -20
  79. package/src/components/layout/pane/header.tsx +140 -31
  80. package/src/components/layout/pane/sidebar.tsx +138 -20
  81. package/src/components/layout/pane/status-footer.ts +3 -1
  82. package/src/components/layout/shell/active-drag.ts +18 -13
  83. package/src/components/layout/shell/drag/magnets.ts +34 -18
  84. package/src/components/layout/shell/drag/runtime.ts +5 -0
  85. package/src/components/layout/shell/index.tsx +25 -0
  86. package/src/components/layout/shell/menu.ts +9 -0
  87. package/src/components/layout/shell/pane/actions.ts +36 -0
  88. package/src/components/layout/shell/pane/management-shortcuts.ts +27 -3
  89. package/src/components/layout/shell/pane-occlusion.ts +40 -0
  90. package/src/components/layout/shell/shortcuts.ts +17 -1
  91. package/src/components/layout/shell/terminal-pointer-runtime.ts +39 -6
  92. package/src/components/layout/shell/window-mode/index.ts +5 -16
  93. package/src/components/layout/shell/window-mode/overlays.tsx +3 -1
  94. package/src/components/market-board/index.tsx +14 -5
  95. package/src/components/metric-treemap/index.tsx +3 -1
  96. package/src/components/ticker/list-table-view.tsx +5 -0
  97. package/src/components/ui/button.tsx +48 -4
  98. package/src/components/ui/data-table/column-order.ts +180 -0
  99. package/src/components/ui/data-table/index.tsx +12 -1
  100. package/src/components/ui/data-table/opentui/index.tsx +291 -32
  101. package/src/components/ui/data-table/opentui/model.ts +43 -4
  102. package/src/components/ui/data-table/types.ts +56 -0
  103. package/src/components/ui/data-table/use-column-order.ts +135 -0
  104. package/src/components/ui/index.ts +1 -1
  105. package/src/components/ui/inline-quick-add.tsx +19 -3
  106. package/src/components/ui/list-view.tsx +11 -5
  107. package/src/components/ui/query-bar.tsx +16 -1
  108. package/src/components/ui/selection-fill.ts +39 -0
  109. package/src/components/ui/table-layout.ts +120 -0
  110. package/src/core/state/app/layout-reducer.ts +2 -1
  111. package/src/core/state/app/pane-choices.ts +68 -0
  112. package/src/core/state/app/state.ts +14 -6
  113. package/src/core/state/app/types.ts +8 -0
  114. package/src/docs/snapshot.json +3 -2
  115. package/src/i18n/es.ts +2 -0
  116. package/src/i18n/ja.ts +2 -0
  117. package/src/i18n/ko.ts +2 -0
  118. package/src/i18n/zh-cn.ts +2 -0
  119. package/src/i18n/zh-tw.ts +2 -0
  120. package/src/layout/pane-manager/dock-tree.ts +19 -0
  121. package/src/layout/pane-manager/index.ts +3 -0
  122. package/src/market-data/coordinator/index.ts +4 -3
  123. package/src/market-data/coordinator/quotes.ts +12 -4
  124. package/src/market-data/market/freshness.ts +33 -0
  125. package/src/market-data/market/status.ts +5 -1
  126. package/src/market-data/quotes/contributions.ts +10 -0
  127. package/src/market-data/quotes/freshness.ts +31 -0
  128. package/src/market-data/quotes/live-valuation.ts +32 -5
  129. package/src/market-data/quotes/regular-session-valuation.ts +1 -1
  130. package/src/market-data/quotes/resolution.ts +4 -0
  131. package/src/market-data/quotes/time.ts +0 -14
  132. package/src/plugins/builtin/account-management/index.tsx +1 -0
  133. package/src/plugins/builtin/awards/detail.tsx +12 -4
  134. package/src/plugins/builtin/awards/headless.ts +29 -8
  135. package/src/plugins/builtin/awards/model.ts +36 -2
  136. package/src/plugins/builtin/awards/pane.tsx +7 -4
  137. package/src/plugins/builtin/broker-manager/detail.tsx +5 -3
  138. package/src/plugins/builtin/broker-manager/index.tsx +7 -6
  139. package/src/plugins/builtin/broker-manager/model.ts +15 -6
  140. package/src/plugins/builtin/broker-manager/pane-actions.tsx +11 -4
  141. package/src/plugins/builtin/broker-manager/sign-in-end.ts +50 -19
  142. package/src/plugins/builtin/broker-manager/table.ts +10 -4
  143. package/src/plugins/builtin/broker-trading/index.tsx +1 -1
  144. package/src/plugins/builtin/central-bank-rates/headless.ts +6 -6
  145. package/src/plugins/builtin/central-bank-rates/index.tsx +1 -1
  146. package/src/plugins/builtin/central-bank-rates/model.ts +21 -3
  147. package/src/plugins/builtin/central-bank-rates/pane.tsx +15 -5
  148. package/src/plugins/builtin/chart-composer/headless.ts +5 -1
  149. package/src/plugins/builtin/chart-composer/pane.tsx +1 -0
  150. package/src/plugins/builtin/chat/content/handle-prompt.tsx +4 -0
  151. package/src/plugins/builtin/chat/controller/realtime.ts +17 -1
  152. package/src/plugins/builtin/chat/message/terminal.tsx +4 -1
  153. package/src/plugins/builtin/chat/sidebar.tsx +35 -19
  154. package/src/plugins/builtin/cloud/askg/pane.tsx +4 -0
  155. package/src/plugins/builtin/cloud/askg/tool-timeline.tsx +2 -0
  156. package/src/plugins/builtin/cloud/plugin.tsx +1 -0
  157. package/src/plugins/builtin/cloud/team/module.tsx +1 -0
  158. package/src/plugins/builtin/cloud/thesis/detail.tsx +9 -4
  159. package/src/plugins/builtin/commodity-balances/pane.tsx +13 -5
  160. package/src/plugins/builtin/company-kpis/model.ts +3 -3
  161. package/src/plugins/builtin/connections/index.ts +1 -0
  162. package/src/plugins/builtin/credit-boards/cdx-pane.tsx +9 -5
  163. package/src/plugins/builtin/credit-boards/client.ts +5 -0
  164. package/src/plugins/builtin/credit-boards/headless.ts +1 -6
  165. package/src/plugins/builtin/credit-boards/model.ts +0 -6
  166. package/src/plugins/builtin/credit-boards/series.ts +19 -8
  167. package/src/plugins/builtin/credit-boards/sovr-pane.tsx +9 -5
  168. package/src/plugins/builtin/crypto-etf-flows/headless.ts +23 -13
  169. package/src/plugins/builtin/crypto-etf-flows/pane.tsx +8 -3
  170. package/src/plugins/builtin/debt-maturities/headless.ts +16 -7
  171. package/src/plugins/builtin/debt-maturities/model.ts +9 -15
  172. package/src/plugins/builtin/debt-maturities/pane.tsx +9 -10
  173. package/src/plugins/builtin/earnings/board-model.ts +33 -4
  174. package/src/plugins/builtin/earnings/board.tsx +15 -3
  175. package/src/plugins/builtin/earnings/calendar.tsx +10 -6
  176. package/src/plugins/builtin/earnings/client.ts +0 -9
  177. package/src/plugins/builtin/earnings/headless.ts +10 -7
  178. package/src/plugins/builtin/earnings/history.tsx +21 -14
  179. package/src/plugins/builtin/earnings-calls/data.ts +24 -4
  180. package/src/plugins/builtin/earnings-calls/format.ts +23 -5
  181. package/src/plugins/builtin/earnings-calls/headless.ts +23 -3
  182. package/src/plugins/builtin/earnings-calls/index.tsx +1 -0
  183. package/src/plugins/builtin/earnings-calls/model.ts +11 -1
  184. package/src/plugins/builtin/earnings-calls/pane.tsx +2 -5
  185. package/src/plugins/builtin/econ/calendar-model.ts +27 -0
  186. package/src/plugins/builtin/econ/fred-catalog.ts +3 -0
  187. package/src/plugins/builtin/econ/index.tsx +9 -2
  188. package/src/plugins/builtin/econ-statistics/headless.ts +3 -1
  189. package/src/plugins/builtin/econ-statistics/index.tsx +1 -1
  190. package/src/plugins/builtin/equity-screener/live.ts +74 -18
  191. package/src/plugins/builtin/equity-screener/model.ts +19 -4
  192. package/src/plugins/builtin/equity-screener/pane.tsx +19 -14
  193. package/src/plugins/builtin/equity-screener/refresh-anchor.ts +45 -0
  194. package/src/plugins/builtin/equity-screener/results.ts +22 -2
  195. package/src/plugins/builtin/equity-screener/screen-check.ts +9 -3
  196. package/src/plugins/builtin/fear-greed/headless.ts +16 -13
  197. package/src/plugins/builtin/fear-greed/pane.tsx +12 -4
  198. package/src/plugins/builtin/filing-events/index.tsx +1 -0
  199. package/src/plugins/builtin/futures/index.tsx +15 -1
  200. package/src/plugins/builtin/futures/table.tsx +1 -1
  201. package/src/plugins/builtin/fx-matrix/index.tsx +32 -19
  202. package/src/plugins/builtin/holders/pane.tsx +30 -20
  203. package/src/plugins/builtin/insider/table.tsx +10 -7
  204. package/src/plugins/builtin/insider/tickers.tsx +1 -1
  205. package/src/plugins/builtin/iv-history/events.ts +5 -0
  206. package/src/plugins/builtin/iv-history/headless.ts +15 -9
  207. package/src/plugins/builtin/jobs/index.tsx +1 -0
  208. package/src/plugins/builtin/kelly-sizer/sections.tsx +2 -0
  209. package/src/plugins/builtin/macro-day/headless.ts +15 -6
  210. package/src/plugins/builtin/macro-day/model.ts +1 -1
  211. package/src/plugins/builtin/macro-day/releases.ts +25 -16
  212. package/src/plugins/builtin/market-movers/index.tsx +20 -8
  213. package/src/plugins/builtin/market-movers/model.ts +5 -0
  214. package/src/plugins/builtin/market-movers/session-body.tsx +2 -1
  215. package/src/plugins/builtin/money-markets/headless.ts +12 -2
  216. package/src/plugins/builtin/money-markets/pane.tsx +10 -1
  217. package/src/plugins/builtin/options/view.tsx +3 -0
  218. package/src/plugins/builtin/options-positioning/pane.tsx +1 -1
  219. package/src/plugins/builtin/options-scenario/pane.tsx +2 -1
  220. package/src/plugins/builtin/perps/cascade-tabs.tsx +2 -1
  221. package/src/plugins/builtin/portfolio-list/cli/bulk-symbols.ts +4 -31
  222. package/src/plugins/builtin/portfolio-list/pane/index.tsx +19 -1
  223. package/src/plugins/builtin/portfolio-list/quick-add/index.tsx +22 -8
  224. package/src/plugins/builtin/portfolio-list/summary/index.tsx +6 -8
  225. package/src/plugins/builtin/portfolio-list/table.tsx +15 -1
  226. package/src/plugins/builtin/rate-path/pane.tsx +2 -0
  227. package/src/plugins/builtin/realized-vol/headless.ts +28 -2
  228. package/src/plugins/builtin/revenue-breakdown/pane.tsx +2 -0
  229. package/src/plugins/builtin/reverse-dcf/pane.tsx +2 -1
  230. package/src/plugins/builtin/risk-factors/index.tsx +1 -0
  231. package/src/plugins/builtin/seasonality/pane.tsx +2 -1
  232. package/src/plugins/builtin/shared/source-footer.ts +70 -0
  233. package/src/plugins/builtin/short-interest/publications-pane.tsx +5 -1
  234. package/src/plugins/builtin/short-volume/pane.tsx +5 -1
  235. package/src/plugins/builtin/social-mentions/outliers.tsx +10 -1
  236. package/src/plugins/builtin/social-mentions/pane.tsx +7 -0
  237. package/src/plugins/builtin/supply-chain/client.ts +3 -1
  238. package/src/plugins/builtin/supply-chain/flow.tsx +25 -8
  239. package/src/plugins/builtin/supply-chain/graph-client.ts +1 -1
  240. package/src/plugins/builtin/supply-chain/graph-evidence.ts +1 -1
  241. package/src/plugins/builtin/supply-chain/graph-model.ts +12 -1
  242. package/src/plugins/builtin/supply-chain/graph-pane.tsx +9 -8
  243. package/src/plugins/builtin/supply-chain/graph.tsx +12 -6
  244. package/src/plugins/builtin/supply-chain/headless.ts +13 -7
  245. package/src/plugins/builtin/supply-chain/model.ts +68 -11
  246. package/src/plugins/builtin/supply-chain/pane.tsx +9 -6
  247. package/src/plugins/builtin/supply-chain/row-evidence.tsx +5 -5
  248. package/src/plugins/builtin/thirteenf/pane.tsx +2 -0
  249. package/src/plugins/builtin/ticker-detail/financials/model.ts +28 -6
  250. package/src/plugins/builtin/ticker-detail/financials/ratio-table.tsx +26 -9
  251. package/src/plugins/builtin/ticker-detail/financials/tab.tsx +58 -35
  252. package/src/plugins/builtin/ticker-detail/overview/components.tsx +14 -1
  253. package/src/plugins/builtin/ticker-detail/overview-tab.tsx +2 -0
  254. package/src/plugins/builtin/ticker-detail/pane.tsx +48 -24
  255. package/src/plugins/builtin/ticker-detail/quote-footer.ts +5 -0
  256. package/src/plugins/builtin/ticker-detail/quote-monitor/card.tsx +6 -3
  257. package/src/plugins/builtin/treasury-auctions/after.ts +50 -23
  258. package/src/plugins/builtin/treasury-auctions/cache.ts +23 -5
  259. package/src/plugins/builtin/treasury-auctions/headless.ts +226 -37
  260. package/src/plugins/builtin/treasury-auctions/hk-headless.ts +11 -5
  261. package/src/plugins/builtin/treasury-auctions/hk-view.tsx +27 -25
  262. package/src/plugins/builtin/treasury-auctions/hk.ts +60 -8
  263. package/src/plugins/builtin/treasury-auctions/index.tsx +3 -0
  264. package/src/plugins/builtin/treasury-auctions/keys.ts +27 -0
  265. package/src/plugins/builtin/treasury-auctions/like.ts +137 -0
  266. package/src/plugins/builtin/treasury-auctions/model.ts +100 -22
  267. package/src/plugins/builtin/treasury-auctions/pane.tsx +39 -11
  268. package/src/plugins/builtin/vol-surface/heat-grid.tsx +6 -3
  269. package/src/plugins/builtin/vol-surface/pane.tsx +7 -3
  270. package/src/plugins/builtin/world-indices/index.tsx +5 -1
  271. package/src/plugins/builtin/yield-curve/index.tsx +2 -1
  272. package/src/plugins/runtime/index.tsx +1 -0
  273. package/src/plugins/runtime/state.ts +20 -0
  274. package/src/portfolio/column-values.ts +8 -2
  275. package/src/public/__snapshots__/public-api.test.ts.snap +5 -0
  276. package/src/public/react.ts +7 -0
  277. package/src/react/auto-refresh.ts +29 -0
  278. package/src/renderers/browser/deeplink-bridge.ts +24 -3
  279. package/src/renderers/dom/data-table/column-drag.ts +147 -0
  280. package/src/renderers/dom/data-table/index.tsx +22 -0
  281. package/src/renderers/dom/data-table/row.tsx +27 -5
  282. package/src/renderers/dom/desktop/query-bar.tsx +229 -60
  283. package/src/renderers/dom/host/overflow-fade-px.ts +2 -0
  284. package/src/renderers/dom/host/overflow-fade.ts +1 -2
  285. package/src/renderers/dom/styles.css +47 -5
  286. package/src/renderers/electrobun/view/cli-pane-shot-entry.tsx +2 -1
  287. package/src/renderers/opentui/chart-surface.tsx +1 -0
  288. package/src/renderers/opentui/frame-hits.ts +33 -0
  289. package/src/renderers/opentui/host.tsx +2 -0
  290. package/src/renderers/opentui/native-surface.ts +14 -21
  291. package/src/renderers/opentui/test-utils.tsx +3 -0
  292. package/src/series/types.ts +2 -0
  293. package/src/sources/gloomberb-cloud/fred-attribution.ts +86 -0
  294. package/src/sources/gloomberb-cloud/index.ts +25 -1
  295. package/src/sources/gloomberb-cloud/normalizers.ts +22 -3
  296. package/src/sources/provider-errors.ts +64 -1
  297. package/src/sources/provider-router/batches.ts +19 -0
  298. package/src/sources/provider-router/index.ts +7 -1
  299. package/src/state/app/context/index.tsx +46 -1
  300. package/src/state/pane-unsent-work.ts +47 -0
  301. package/src/test-support/app-store.ts +24 -1
  302. package/src/test-support/shell-pane-keys.tsx +5 -0
  303. package/src/test-support/telemetry-guard.ts +83 -0
  304. package/src/test-support/test-env.ts +12 -0
  305. package/src/theme/colors.ts +17 -1
  306. package/src/theme/ui-tokens.ts +50 -1
  307. package/src/tickers/listing-venues.ts +11 -1
  308. package/src/tickers/search/japanese-names.json +1 -0
  309. package/src/tickers/search/japanese-names.ts +152 -0
  310. package/src/tickers/terminal-codes.ts +55 -6
  311. package/src/time-series/base-series.ts +3 -0
  312. package/src/time-series/live-quotes.ts +3 -9
  313. package/src/types/data-provider.ts +6 -0
  314. package/src/types/financials.ts +11 -0
  315. package/src/types/plugin-contributions.ts +7 -0
  316. package/src/types/plugin-panes.ts +7 -0
  317. package/src/ui/host.tsx +24 -0
  318. package/src/ui/pointer-drag.ts +11 -2
  319. package/src/utils/double-escape-close.ts +42 -0
  320. package/src/utils/fundamentals.ts +14 -3
  321. package/src/utils/fx-status.ts +30 -7
  322. package/src/utils/network-failure.ts +23 -0
  323. package/src/utils/share-multiples.cases.json +780 -2
  324. package/src/utils/share-multiples.ts +154 -24
@@ -7,7 +7,7 @@ export interface GraphOptions {
7
7
  minPct: number; minConfidence: number; limit: number; ranking: "score" | "shortest"; asOf?: string;
8
8
  }
9
9
  export const DEFAULT_GRAPH_OPTIONS: GraphOptions = { depth: 2, direction: "both", roles: [], sources: [], tiers: [], minPct: 0, minConfidence: 0, limit: 50, ranking: "score" };
10
- export interface GraphEvidence extends Pick<SupplyRow, "claimType" | "corroboration" | "leadStatus" | "firstSeenAt" | "lastSeenAt" | "lastConfirmedAt" | "whyUnconfirmed" | "evidence" | "nativeAmount" | "nativeCurrency" | "nativeScale" | "entityScope" | "quoteGloss" | "sectionRef" | "sourceAttribution" | "periodMonths"> {
10
+ export interface GraphEvidence extends Pick<SupplyRow, "claimType" | "corroboration" | "leadStatus" | "firstSeenAt" | "lastSeenAt" | "lastConfirmedAt" | "whyUnconfirmed" | "evidence" | "nativeAmount" | "nativeCurrency" | "nativeScale" | "entityScope" | "relatedParty" | "quoteGloss" | "sectionRef" | "sourceAttribution" | "periodMonths"> {
11
11
  /** Source trust tier, distinct from the graph evidence class in tier. */
12
12
  trustTier?: SupplyTier;
13
13
  id: string; fromEntity: string; toEntity: string; reportingEntity: string;
@@ -25,7 +25,9 @@ interface GraphLink {
25
25
  }
26
26
  export interface GraphPath {
27
27
  id: string; nodeIds: string[]; linkIds: string[]; hops: number; score: number; confidence: number;
28
- exposure: { pct: number; basis: NonNullable<SupplyRow["pctBasis"]>; period: string; periodMonths?: number | null; denominatorEntityId: string; estimated: true } | null;
28
+ exposure: { pct: number; basis: NonNullable<SupplyRow["pctBasis"]>; period: string; periodMonths?: number | null; denominatorEntityId: string;
29
+ /** True for a product of shares along a longer route; false for one hop, whose share is the one its report files. */
30
+ estimated: boolean } | null;
29
31
  }
30
32
  interface GraphReach { entityId: string; direction: "upstream" | "downstream"; hops: number; bestPath: GraphPath; shortestPath: GraphPath; }
31
33
  export interface GraphPayload {
@@ -25,6 +25,8 @@ export interface SupplyEvidenceItem {
25
25
  value: number | null;
26
26
  valueUnit: string | null;
27
27
  currency: string | null;
28
+ /** A related-party (connected) trade the report prints, with its actual amount. Absent from older servers. */
29
+ relatedParty?: boolean;
28
30
  }
29
31
  export interface SupplyEntity {
30
32
  id: string;
@@ -54,6 +56,12 @@ export interface SupplyRow {
54
56
  nativeScale?: number | null;
55
57
  jurisdiction?: string | null;
56
58
  entityScope?: "entity" | "group" | "anonymous" | "aggregate" | null;
59
+ /**
60
+ * Every disclosure behind the row is a related-party (connected) trade: the
61
+ * counterparty is the company's parent, its group or a company under the
62
+ * same control, never a plain supplier or customer. Absent from older servers.
63
+ */
64
+ relatedParty?: boolean;
57
65
  period: string;
58
66
  /** Months every figure on the row covers: 0 a balance at the period end, 3 a quarter, 12 a year. Null or absent when the source does not say or the figures differ in length. */
59
67
  periodMonths?: number | null;
@@ -103,17 +103,20 @@ export interface CloudMacroReleaseDaysPayload {
103
103
  /** The last New York day the lists are complete for. */
104
104
  coveredThrough: string;
105
105
  sources: string[];
106
- /** New York dates, oldest first. Brazil's IPCA days when the server can vouch for them, and the ECB's decision days. */
107
- releases: Record<"cpi" | "jobs" | "fomc", string[]> & { ipca?: string[]; ecb?: string[] };
106
+ /**
107
+ * New York dates, oldest first. Brazil's IPCA days when the server can vouch for them, and the ECB's decision days;
108
+ * the BoJ's decision days are its own Tokyo days.
109
+ */
110
+ releases: Record<"cpi" | "jobs" | "fomc", string[]> & { ipca?: string[]; ecb?: string[]; boj?: string[] };
108
111
  /** Each kind's figures by New York release day, for the days they are known. */
109
- figures?: Partial<Record<"cpi" | "jobs" | "fomc" | "ipca" | "ecb", Record<string, {
112
+ figures?: Partial<Record<"cpi" | "jobs" | "fomc" | "ipca" | "ecb" | "boj", Record<string, {
110
113
  event: string;
111
114
  actual: string | null;
112
115
  forecast: string | null;
113
116
  prior: string | null;
114
117
  /** Above the consensus (hot), below it (cool), at it (in-line); null without both. */
115
118
  surprise: "hot" | "cool" | "in-line" | null;
116
- /** An FOMC or ECB day's move in the rate: "held", "cut 25bp", "raised 50bp". */
119
+ /** An FOMC, ECB or BoJ day's move in the rate: "held", "cut 25bp", "raised 50bp". */
117
120
  decision?: string;
118
121
  /** How the actual was computed where the calendar lists none: a CPI's year-on-year change from the index. */
119
122
  computed?: string;
@@ -123,9 +126,9 @@ export interface CloudMacroReleaseDaysPayload {
123
126
  /** The first day the kept economic calendar holds, the one `econ` names: days before it have no figures. */
124
127
  figuresFrom?: string;
125
128
  /** Why a release day from `figuresFrom` on has no figures, by kind and day. */
126
- figureGaps?: Partial<Record<"cpi" | "jobs" | "fomc" | "ecb", Record<string, string>>>;
127
- /** The next day of a kind its publisher schedules ahead: the ECB's next decision. */
128
- scheduled?: { ecb?: string };
129
+ figureGaps?: Partial<Record<"cpi" | "jobs" | "fomc" | "ecb" | "boj", Record<string, string>>>;
130
+ /** The next day of a kind its publisher schedules ahead: the ECB's and the BoJ's next decisions. */
131
+ scheduled?: { ecb?: string; boj?: string };
129
132
  }
130
133
 
131
134
  export interface CloudFredObservationPayload {
@@ -6,6 +6,12 @@ export interface CloudEarningsCallPayload {
6
6
  companyName: string | null;
7
7
  fiscalYear: number | null;
8
8
  fiscalQuarter: number | null;
9
+ /**
10
+ * 1 for a half year's results ("H1 2026", a Hong Kong interim results
11
+ * briefing), stored with no quarter as a year's results are. Absent for any
12
+ * other call, and from a server that predates it.
13
+ */
14
+ fiscalHalf?: number;
9
15
  callAt: string | null;
10
16
  status: string;
11
17
  durationSeconds: number | null;
@@ -253,6 +259,8 @@ export interface CloudEarningsTranscriptPayload {
253
259
  companyName: string | null;
254
260
  fiscalYear: number | null;
255
261
  fiscalQuarter: number | null;
262
+ /** 1 for a half year's results (CloudEarningsCallPayload.fiscalHalf). */
263
+ fiscalHalf?: number;
256
264
  /**
257
265
  * "other" for an event that is not an earnings call (a deal call, a
258
266
  * conference, an investor day), named by eventLabel and with no fiscal
@@ -9,7 +9,7 @@ import type { TickerRecord } from "../types/ticker";
9
9
  import { findPaneInstance } from "../types/config";
10
10
  import type { ReleaseInfo } from "../updater";
11
11
  import { canRestartToApply, canRetryUpdate } from "../updater";
12
- import { getVisiblePaneCycleOrder } from "../components/layout/pane/cycle-order";
12
+ import { coveredDockedPaneIds, getVisiblePaneCycleOrder } from "../components/layout/pane/cycle-order";
13
13
  import { requestFunctionHelp, useFunctionHelpHost } from "../plugins/builtin/help/function-card";
14
14
  import { buildRegistryHelpIndex, helpFunctionForPane } from "../plugins/builtin/help/function-index";
15
15
  import { recordFunctionOpen } from "../telemetry/usage-counts";
@@ -239,6 +239,7 @@ export function useAppGlobalShortcuts({
239
239
  state.config.layout,
240
240
  pluginRegistry,
241
241
  state.config.disabledPlugins,
242
+ { covered: coveredDockedPaneIds(), focusedPaneId: state.focusedPaneId },
242
243
  );
243
244
  if (paneOrder.length === 0) return;
244
245
 
@@ -18,6 +18,8 @@ export type CoreKeybindingActionId =
18
18
  | "notification-dismiss"
19
19
  | "quit"
20
20
  | "pane-menu"
21
+ | "pane-next-tab"
22
+ | "pane-prev-tab"
21
23
  | "pane-close"
22
24
  | "close-floating-panes"
23
25
  | "pane-settings"
@@ -54,6 +56,8 @@ export interface KeybindingActionDef {
54
56
 
55
57
  export const PANE_ACTION_IDS = new Set<CoreKeybindingActionId>([
56
58
  "pane-menu",
59
+ "pane-next-tab",
60
+ "pane-prev-tab",
57
61
  "pane-close",
58
62
  "close-floating-panes",
59
63
  "pane-settings",
@@ -176,6 +180,21 @@ export const KEYBINDING_ACTIONS: readonly KeybindingActionDef[] = [
176
180
  // the platform keys for a context menu, and this is the pane's.
177
181
  defaults: [".", "Shift+F10", "ContextMenu"],
178
182
  },
183
+ {
184
+ id: "pane-next-tab",
185
+ category: "Pane Management",
186
+ description: "Show the next tab of the focused pane's stack.",
187
+ // Tab moves between panes and passes the tabs a stack hides; these step
188
+ // through them. Ctrl+PageDown is the tab key of browsers and editors and
189
+ // reaches most terminals; Ctrl+Tab, where the host can tell it from Tab.
190
+ defaults: ["Ctrl+PageDown", "Ctrl+Tab"],
191
+ },
192
+ {
193
+ id: "pane-prev-tab",
194
+ category: "Pane Management",
195
+ description: "Show the previous tab of the focused pane's stack.",
196
+ defaults: ["Ctrl+PageUp", "Ctrl+Shift+Tab"],
197
+ },
179
198
  {
180
199
  id: "pane-close",
181
200
  category: "Pane Management",
@@ -1,4 +1,4 @@
1
- import { useCallback, type Dispatch } from "react";
1
+ import { useCallback, useRef, type Dispatch } from "react";
2
2
  import type { AppTickerRepositoryPort } from "../../core/app-service-ports";
3
3
  import {
4
4
  addPaneFloating,
@@ -39,6 +39,8 @@ import type {
39
39
  } from "../../types/plugin";
40
40
  import type { DialogApi } from "../../ui/dialog";
41
41
  import {
42
+ gridDockTarget,
43
+ utilityWindowsOf,
42
44
  resolvePaneShowTarget,
43
45
  resolvePaneTarget as resolvePaneTargetInLayout,
44
46
  selectEdgeAnchor,
@@ -170,6 +172,9 @@ export function useAppPaneRuntime({
170
172
  if (isPaneDetached(nextLayout, paneId)) focusDetachedPane?.(paneId);
171
173
  }, [activatePane, focusDetachedPane, persistLayout, state.config.layout]);
172
174
 
175
+ /** The layouts this window has been filling from empty, which a new pane docks into as a grid (gridDockTarget). */
176
+ const gridLayouts = useRef(new Set<string>());
177
+
173
178
  const placePaneInstance = useCallback((
174
179
  instance: PaneInstanceConfig,
175
180
  paneDef: PaneDef,
@@ -178,7 +183,8 @@ export function useAppPaneRuntime({
178
183
  const { width, height } = pluginRegistry.getTermSize();
179
184
  // Templates can await ticker resolution before placing their pane, so the
180
185
  // layout from the render that started the request may be out of date.
181
- const { config: { layout }, focusedPaneId } = stateRef.current;
186
+ const { config, focusedPaneId } = stateRef.current;
187
+ const { layout } = config;
182
188
  const relativeTo = options?.relativeToPaneId
183
189
  ? resolvePaneTarget(options.relativeToPaneId, layout)
184
190
  : (focusedPaneId && isPaneInLayout(layout, focusedPaneId) ? focusedPaneId : null);
@@ -186,7 +192,15 @@ export function useAppPaneRuntime({
186
192
  let nextLayout = layout;
187
193
  const dockedPaneIds = getDockedPaneIds(nextLayout);
188
194
 
189
- if (options?.placement === "floating" || (options?.placement !== "docked" && paneDef.defaultMode === "floating")) {
195
+ const floating = options?.placement === "floating" || (options?.placement !== "docked" && paneDef.defaultMode === "floating");
196
+ // A pane that would float, as most functions ask to, docks into a layout being built as a grid; one placed
197
+ // beside a given pane goes there, and a utility window (account, brokers, Ask Gloom, team) floats.
198
+ const grid = floating && !options?.relativeToPaneId && !paneDef.utilityWindow
199
+ ? gridDockTarget(gridLayouts.current, config, instance.instanceId, { width, height },
200
+ utilityWindowsOf(layout, (paneId) => !!pluginRegistry.panes.get(paneId)?.utilityWindow)) : null;
201
+ if (grid) {
202
+ nextLayout = addPaneToLayout(nextLayout, instance, grid);
203
+ } else if (floating) {
190
204
  nextLayout = addPaneFloating(nextLayout, instance, width, height, paneDef, { focusedPaneId });
191
205
  } else if (relativeTo && findDockLeaf(nextLayout, relativeTo)) {
192
206
  nextLayout = addPaneToLayout(nextLayout, instance, { relativeTo, position: relativePosition });
@@ -286,6 +300,7 @@ export function useAppPaneRuntime({
286
300
  dataProvider,
287
301
  dispatch,
288
302
  focusVisiblePane,
303
+ gridLayouts: gridLayouts.current,
289
304
  persistLayout,
290
305
  pluginRegistry,
291
306
  stateRef,
@@ -1,11 +1,13 @@
1
1
  import {
2
2
  getDockLeafLayouts,
3
+ type DockTarget,
3
4
  } from "../../layout/pane-manager";
4
5
  import {
5
6
  findPaneInstance,
6
7
  isTickerPaneId,
7
8
  normalizePaneId,
8
9
  resolvePaneInstance,
10
+ type AppConfig,
9
11
  type LayoutConfig,
10
12
  type PaneInstanceConfig,
11
13
  } from "../../types/config";
@@ -54,3 +56,64 @@ export function selectEdgeAnchor(layout: LayoutConfig, edge: "left" | "right"):
54
56
  .sort((a, b) => (b.rect.y + b.rect.height) - (a.rect.y + a.rect.height))
55
57
  [0]?.instanceId ?? null;
56
58
  }
59
+
60
+ /** Whether a pane instance is a utility window (PaneDef.utilityWindow: account, brokers, Ask Gloom, team), by its instance id. */
61
+ type IsUtilityWindow = (instanceId: string) => boolean;
62
+
63
+ /**
64
+ * A layout with no pane in it, docked, floating or in a window of its own,
65
+ * but utility windows (an account or Ask Gloom window open over it): one a new
66
+ * pane starts a grid in.
67
+ */
68
+ function isEmptyLayout(layout: LayoutConfig, isUtility: IsUtilityWindow): boolean {
69
+ return layout.dockRoot == null && layout.detached.length === 0
70
+ && layout.instances.every((instance) => isUtility(instance.instanceId))
71
+ && layout.floating.every((entry) => isUtility(entry.instanceId));
72
+ }
73
+
74
+ /**
75
+ * Where a pane docks in a layout being built as a grid: beside the largest
76
+ * pane, splitting it along its longer side (a cell is about twice as tall as
77
+ * it is wide), so each pane added halves the roomiest one and four make two
78
+ * by two rather than ever thinner columns. Null with nothing docked.
79
+ */
80
+ function gridAnchor(layout: LayoutConfig, bounds: { width: number; height: number }): DockTarget | null {
81
+ const leaves = getDockLeafLayouts(layout, { x: 0, y: 0, width: Math.max(1, bounds.width), height: Math.max(1, bounds.height) });
82
+ const largest = [...leaves].sort((a, b) => b.rect.width * b.rect.height - a.rect.width * a.rect.height
83
+ || a.rect.y - b.rect.y || a.rect.x - b.rect.x)[0];
84
+ if (!largest) return null;
85
+ return { relativeTo: largest.instanceId, position: largest.rect.width >= largest.rect.height * 2 ? "right" : "below" };
86
+ }
87
+
88
+ /**
89
+ * Where a new pane that would open floating docks instead, in a layout this
90
+ * window has been filling from empty (`grids`, the layouts' keys, which this
91
+ * adds to): beside the roomiest pane (gridAnchor), the first one alone. Four
92
+ * panes added one after another make a grid, not a stack of windows over an
93
+ * empty layout that only Tidy Windows would dock. Null for any other layout,
94
+ * and once the layout has a floating window, which a pane then joins as before.
95
+ * Utility windows (`isUtility`) are no panes of the layout: one open over it
96
+ * neither stops the grid nor counts against an empty layout.
97
+ */
98
+ export function gridDockTarget(
99
+ grids: Set<string>,
100
+ config: Pick<AppConfig, "layout" | "layouts" | "activeLayoutIndex">,
101
+ instanceId: string,
102
+ bounds: { width: number; height: number },
103
+ isUtility: IsUtilityWindow = () => false,
104
+ ): DockTarget | null {
105
+ const active = config.layouts[config.activeLayoutIndex];
106
+ const key = active ? active.id ?? `${config.activeLayoutIndex}:${active.name}` : null;
107
+ if (!key) return null;
108
+ if (isEmptyLayout(config.layout, isUtility)) grids.add(key);
109
+ if (!grids.has(key) || config.layout.floating.some((entry) => !isUtility(entry.instanceId))) return null;
110
+ return gridAnchor(config.layout, bounds) ?? { relativeTo: instanceId, position: "right" };
111
+ }
112
+
113
+ /** A layout's pane instances that are utility windows, by the pane each shows (PaneDef.utilityWindow). */
114
+ export function utilityWindowsOf(layout: LayoutConfig, isUtilityPane: (paneId: string) => boolean): IsUtilityWindow {
115
+ return (instanceId) => {
116
+ const instance = layout.instances.find((candidate) => candidate.instanceId === instanceId);
117
+ return !!instance && isUtilityPane(instance.paneId);
118
+ };
119
+ }
@@ -11,6 +11,7 @@ import {
11
11
  import type { PluginRegistry } from "../../plugins/registry";
12
12
  import { PluginOffError, notifyPluginOff } from "../../plugins/plugin-off";
13
13
  import { findFixedTickerPaneForSymbol } from "../../layout/ticker-navigation";
14
+ import { gridDockTarget, utilityWindowsOf } from "./layout-placement";
14
15
  import type { AppAction, AppState } from "../../state/app/context";
15
16
  import { findPaneInstance, TICKER_RESEARCH_PANE_ID, normalizePaneId } from "../../types/config";
16
17
  import type {
@@ -56,6 +57,8 @@ interface UseAppTickerOpenRuntimeOptions {
56
57
  dataProvider: DataProvider;
57
58
  dispatch: Dispatch<AppAction>;
58
59
  focusVisiblePane: (paneId: string, layout?: LayoutConfig) => void;
60
+ /** The layouts this window has been filling from empty, which a new pane docks into as a grid (gridDockTarget). */
61
+ gridLayouts?: Set<string>;
59
62
  persistLayout: (layout: LayoutConfig, options?: { pushHistory?: boolean; focusedPaneId?: string | null }) => void;
60
63
  pluginRegistry: PluginRegistry;
61
64
  stateRef: { current: AppState };
@@ -145,6 +148,7 @@ export function useAppTickerOpenRuntime({
145
148
  dataProvider,
146
149
  dispatch,
147
150
  focusVisiblePane,
151
+ gridLayouts,
148
152
  persistLayout,
149
153
  pluginRegistry,
150
154
  stateRef,
@@ -212,7 +216,11 @@ export function useAppTickerOpenRuntime({
212
216
  const currentLayout = currentState.config.layout;
213
217
  const { width, height } = pluginRegistry.getTermSize();
214
218
  const shouldFloat = options?.floating ?? true;
215
- const nextLayout = shouldFloat
219
+ // A pane that would float docks into a layout being built as a grid, as any other pane does.
220
+ const grid = shouldFloat && gridLayouts && !paneDef.utilityWindow
221
+ ? gridDockTarget(gridLayouts, currentState.config, instance.instanceId, { width, height },
222
+ utilityWindowsOf(currentLayout, (paneId) => !!pluginRegistry.panes.get(paneId)?.utilityWindow)) : null;
223
+ const nextLayout = grid ? addPaneToLayout(currentLayout, instance, grid) : shouldFloat
216
224
  ? addPaneFloating(currentLayout, instance, width, height, paneDef, { focusedPaneId: currentState.focusedPaneId })
217
225
  : addPaneToLayout(
218
226
  currentLayout,
@@ -230,7 +238,7 @@ export function useAppTickerOpenRuntime({
230
238
  }
231
239
  activatePane(instance.instanceId, opening ? { trackTicker: false } : undefined);
232
240
  return instance.instanceId;
233
- }, [activatePane, buildPaneInstance, dispatch, persistLayout, pluginRegistry, stateRef]);
241
+ }, [activatePane, buildPaneInstance, dispatch, gridLayouts, persistLayout, pluginRegistry, stateRef]);
234
242
 
235
243
  const placePinnedTickerTarget = useCallback((target: TickerOpenTarget, options?: PinTickerOptions, typed?: string) => {
236
244
  const paneType = normalizePaneId(options?.paneType ?? TICKER_RESEARCH_PANE_ID);
@@ -50,6 +50,23 @@ function brokerReason(lastError: string | null | undefined): string | null {
50
50
  return described.replace(/[\s.]+$/, "").slice(0, 200) || null;
51
51
  }
52
52
 
53
+ /**
54
+ * What a profile says once the broker ended its sign-in, and to connect again.
55
+ * A broker that keeps one AI app per account (IBKR) ends Gloom's grant when
56
+ * another app is connected to the account, and says only "Invalid
57
+ * authorization status"; that one is said in plain words. A broker the app
58
+ * does not know yet counts as one, since only IBKR says it.
59
+ */
60
+ function signInEndedMessage(name: string, lastError: string | null | undefined, singleConnection = true): string {
61
+ if (singleConnection && /invalid authorization status/i.test(lastError ?? "")) {
62
+ return `${name} disconnected Gloom, most often because another AI app was connected to the same account, and ${name} allows one at a time. Press Connect in Brokers.`;
63
+ }
64
+ const reason = brokerReason(lastError);
65
+ return reason
66
+ ? `${name} needs you to sign in again: ${reason}. Press Connect in Brokers.`
67
+ : `Press Connect in Brokers to sign in to ${name}.`;
68
+ }
69
+
53
70
  /** Gloom holds no live sign-in for the broker: only connecting again helps. */
54
71
  class SignInNeededError extends Error {}
55
72
 
@@ -520,11 +537,8 @@ export function createSignedInBrokerAdapter(overrides: Partial<SignedInBrokerAda
520
537
  const connection = await get<SignedInBrokerConnection>(instance, "");
521
538
  canTrade.set(instance.id, connection.status === "connected" && connection.canTrade === true);
522
539
  if (connection.status !== "connected") {
523
- const name = brokerName(instance);
524
- const reason = brokerReason(connection.lastError);
525
- throw new SignInNeededError(reason
526
- ? `${name} needs you to sign in again: ${reason}. Press Connect in Brokers.`
527
- : `Press Connect in Brokers to sign in to ${name}.`);
540
+ const singleConnection = deps.findBroker(signedInBrokerId(instance))?.capabilities.singleConnection;
541
+ throw new SignInNeededError(signInEndedMessage(brokerName(instance), connection.lastError, singleConnection !== false));
528
542
  }
529
543
  });
530
544
  },
@@ -49,12 +49,24 @@ export interface SignedInBrokerConnection {
49
49
  * The three fields below are absent from a Gloom server that predates them.
50
50
  */
51
51
  expiresAt?: string | null;
52
- /** Within a day of `expiresAt`, or past it: time to connect again. */
52
+ /** Within Gloom's warning window before `expiresAt` (two days), or past it: time to renew. */
53
53
  expiresSoon?: boolean;
54
54
  /** Why the broker ended the sign-in, in its own words. Null while connected. */
55
55
  lastError?: string | null;
56
+ /**
57
+ * Whether the broker keeps one connection per account and will ask to
58
+ * replace the Gloom connection it lists for this one on the next sign-in:
59
+ * while it is live, or after the broker ended it on its clock. `may` when
60
+ * Gloom cannot tell an end from the user removing Gloom at the broker;
61
+ * null when it will not ask (none, or another app took the account).
62
+ * Absent from a Gloom server that predates it.
63
+ */
64
+ replacePrompt?: BrokerReplacePrompt | null;
56
65
  }
57
66
 
67
+ /** What a single-connection broker asks about the Gloom connection it lists, on a new sign-in. */
68
+ export type BrokerReplacePrompt = "will" | "may";
69
+
58
70
  /** Public: the list does not depend on the user, so Add Broker can show it signed out. */
59
71
  export function listSignedInBrokers(): Promise<{ connectors: SignedInBroker[] }> {
60
72
  return apiClient.brokerRequest("connectors", "");
@@ -22,7 +22,7 @@ import { useDialog, useDialogKeyboard, type DialogApi, type PromptContext } from
22
22
  import { isPlainKey } from "../../utils/keyboard";
23
23
  import { wrapTextLines } from "../../utils/text-wrap";
24
24
  import { DeviceSignInDialog } from "../../account/device-signin-dialog";
25
- import type { SignedInBroker } from "./client";
25
+ import type { BrokerReplacePrompt, SignedInBroker } from "./client";
26
26
  import {
27
27
  BrokerSignInController,
28
28
  runBrokerSignIn,
@@ -53,8 +53,18 @@ export const BROKER_CONNECT_SUBTITLE = "Continue in your browser.";
53
53
  /** The key every connect surface takes for a fresh link, as the desktop shows it. */
54
54
  export const BROKER_CONNECT_NEW_LINK = { key: "r", label: "new link" };
55
55
 
56
- /** Under the panel: the broker's own note, or what connecting a single-connection broker does to other apps. */
57
- export function brokerSignInNote(broker: SignedInBroker): string | null {
56
+ /**
57
+ * Under the panel: the broker's own note, or what connecting a single-connection
58
+ * broker does to other apps. When the broker will ask to replace the Gloom
59
+ * connection it already lists (`replace`, as Gloom says), the note says to
60
+ * choose that before the user gets there; `may` when Gloom cannot tell.
61
+ */
62
+ export function brokerSignInNote(broker: SignedInBroker, replace: BrokerReplacePrompt | null = null): string | null {
63
+ if (replace && broker.capabilities.singleConnection) {
64
+ return replace === "will"
65
+ ? tf("{broker} will ask to replace your existing Gloom connection. Choose to replace it.", { broker: broker.name })
66
+ : tf("{broker} may ask to replace your existing Gloom connection. If it does, choose to replace it.", { broker: broker.name });
67
+ }
58
68
  return broker.capabilities.signupNote
59
69
  ?? (broker.capabilities.singleConnection
60
70
  ? tf("Other AI apps linked to {broker} get disconnected. Connect them to Gloom instead.", { broker: broker.name })
@@ -125,8 +135,8 @@ export async function promptGloomSignIn(dialog: DialogApi): Promise<boolean> {
125
135
  */
126
136
  const TERMINAL_DIALOG_ROWS = 12;
127
137
  const DESKTOP_DIALOG_ROWS = 10;
128
- /** Columns the terminal's full dialog takes from the window: margins, border and padding. */
129
- const TERMINAL_DIALOG_INSET = 8;
138
+ /** Columns the terminal's full dialog takes from the window: margins (4), border (2) and padding (4). */
139
+ const TERMINAL_DIALOG_INSET = 10;
130
140
  /** Cells the desktop dialog's padding takes from its width. */
131
141
  const DESKTOP_DIALOG_INSET = 4;
132
142
 
@@ -136,7 +146,13 @@ function BrokerSignInDialog({
136
146
  broker,
137
147
  write,
138
148
  renew,
139
- }: PromptContext<BrokerSignInOutcome> & { broker: SignedInBroker; write: boolean; renew: boolean }) {
149
+ replace,
150
+ }: PromptContext<BrokerSignInOutcome> & {
151
+ broker: SignedInBroker;
152
+ write: boolean;
153
+ renew: boolean;
154
+ replace: BrokerReplacePrompt | null;
155
+ }) {
140
156
  useAppLanguage();
141
157
  const { nativePaneChrome } = useUiCapabilities();
142
158
  const { width: termWidth, height: termHeight } = useViewport();
@@ -169,6 +185,7 @@ function BrokerSignInDialog({
169
185
  snapshot={snapshot}
170
186
  height={Math.max(4, termHeight - DESKTOP_DIALOG_ROWS)}
171
187
  width={FORM_DIALOG_WIDTH - DESKTOP_DIALOG_INSET}
188
+ replace={replace}
172
189
  />
173
190
  <Box style={{ marginTop: "var(--gloom-space-md)" }}>
174
191
  <DialogActions alignEnd hints={{ keys: [BROKER_CONNECT_NEW_LINK] }}>
@@ -194,6 +211,7 @@ function BrokerSignInDialog({
194
211
  snapshot={snapshot}
195
212
  height={Math.max(4, termHeight - TERMINAL_DIALOG_ROWS)}
196
213
  width={Math.max(10, termWidth - TERMINAL_DIALOG_INSET)}
214
+ replace={replace}
197
215
  />
198
216
  <Box height={1} />
199
217
  <Box height={1}>
@@ -221,6 +239,7 @@ export function BrokerConnectView({
221
239
  height,
222
240
  width,
223
241
  browserKey = true,
242
+ replace = null,
224
243
  }: {
225
244
  broker: SignedInBroker;
226
245
  snapshot: BrokerSignInSnapshot;
@@ -230,11 +249,13 @@ export function BrokerConnectView({
230
249
  width: number;
231
250
  /** Whether `b` opens the link now. */
232
251
  browserKey?: boolean;
252
+ /** Whether the broker will or may ask to replace the Gloom connection it lists: the note says to choose that. */
253
+ replace?: BrokerReplacePrompt | null;
233
254
  }) {
234
255
  useAppLanguage();
235
256
  const colors = useThemeColors();
236
257
  const desktop = useUiCapabilities().nativePaneChrome === true;
237
- const note = brokerSignInNote(broker);
258
+ const note = brokerSignInNote(broker, replace);
238
259
  const noteLines = note ? wrapTextLines(note, Math.max(10, desktop ? Math.min(width, NOTE_MEASURE) : width)) : [];
239
260
  // The note goes under the panel, which gets the rows left.
240
261
  const noteRows = note ? 1 + noteLines.length : 0;
@@ -275,6 +296,8 @@ export interface BrokerSignInRequest {
275
296
  write?: boolean;
276
297
  /** Sign in again although the broker is connected. */
277
298
  renew?: boolean;
299
+ /** Whether the broker will or may ask to replace the Gloom connection it lists, as Gloom says. */
300
+ replace?: BrokerReplacePrompt | null;
278
301
  resolve: (connected: boolean) => void;
279
302
  }
280
303
 
@@ -288,12 +311,12 @@ const requestListeners = new Set<(request: BrokerSignInRequest) => void>();
288
311
  */
289
312
  export function requestBrokerSignIn(
290
313
  broker: SignedInBroker,
291
- options: { write?: boolean; renew?: boolean } = {},
314
+ options: { write?: boolean; renew?: boolean; replace?: BrokerReplacePrompt | null } = {},
292
315
  ): Promise<boolean> {
293
316
  if (requestListeners.size === 0) return Promise.resolve(false);
294
317
  return new Promise((resolve) => {
295
318
  const write = options.write ?? Boolean(broker.capabilities.orders);
296
- for (const listener of requestListeners) listener({ broker, write, renew: options.renew, resolve });
319
+ for (const listener of requestListeners) listener({ broker, write, renew: options.renew, replace: options.replace, resolve });
297
320
  });
298
321
  }
299
322
 
@@ -320,6 +343,7 @@ export function BrokerSignInDialogHost() {
320
343
  broker={broker}
321
344
  write={write}
322
345
  renew={renew}
346
+ replace={request.replace ?? null}
323
347
  />
324
348
  ),
325
349
  }) ?? "cancelled",
@@ -235,8 +235,10 @@ function resolvedOutput(value: unknown): ResolvedSeries {
235
235
  const kind = timeBasis?.kind === undefined ? undefined : enumValue<"market">(timeBasis.kind, "time basis kind", new Set(["market"]));
236
236
  const warning = optionalString(input.warning, "resolve output warning", 500);
237
237
  const attribution = input.attribution === undefined ? undefined : object(input.attribution, "resolve output attribution");
238
- if (attribution) onlyKeys(attribution, "resolve output attribution", ["source", "publisher"]);
238
+ if (attribution) onlyKeys(attribution, "resolve output attribution", ["source", "publisher", "publishedAt"]);
239
239
  const publisher = attribution ? optionalString(attribution.publisher, "resolve output publisher", 160) : undefined;
240
+ const publishedAt = attribution ? optionalString(attribution.publishedAt, "resolve output publication time", 64) : undefined;
241
+ if (publishedAt !== undefined && !Number.isFinite(Date.parse(publishedAt))) fail("resolve output publication time", "expected an ISO date.");
240
242
  return {
241
243
  id: boundedString(input.id, "resolve output ID", 160),
242
244
  label: boundedString(input.label, "resolve output label", 160),
@@ -271,6 +273,7 @@ function resolvedOutput(value: unknown): ResolvedSeries {
271
273
  ...(attribution ? { attribution: {
272
274
  source: boundedString(attribution.source, "resolve output source", 160),
273
275
  ...(publisher !== undefined ? { publisher } : {}),
276
+ ...(publishedAt !== undefined ? { publishedAt } : {}),
274
277
  } } : {}),
275
278
  ...(input.hidden !== undefined
276
279
  ? typeof input.hidden === "boolean" ? { hidden: input.hidden } : fail("resolve output hidden", "expected a boolean.")
@@ -42,7 +42,7 @@ const KNOWN_COINS: readonly BoardEntry[] = [
42
42
 
43
43
  let board: readonly BoardEntry[] | null = null;
44
44
  let loading: Promise<void> | null = null;
45
- /** The board was asked for and did not come: the known coins answer instead. */
45
+ /** The board was asked for and did not come, or is not to be waited for: the known coins answer instead. */
46
46
  let unread = false;
47
47
 
48
48
  /**
@@ -66,6 +66,15 @@ export async function primeBoardCoins(
66
66
  await loading;
67
67
  }
68
68
 
69
+ /**
70
+ * Answers a coin hint from the coins this build knows, the largest and the stablecoins, with no read of the board. For
71
+ * a command whose symbol the data service has already said no listing carries: it answers at once, where reading the
72
+ * board would add a round trip to the end of it for the name of a rarer coin.
73
+ */
74
+ export function useKnownCoins(): void {
75
+ if (!board) unread = true;
76
+ }
77
+
69
78
  /** The board's coins a hint can name: a symbol, a code and a name each. */
70
79
  function boardEntries(assets: unknown): BoardEntry[] {
71
80
  return (Array.isArray(assets) ? assets : []).filter((asset): asset is BoardEntry => !!asset
@@ -5,7 +5,7 @@ import { isCryptoPairSymbol, TOP_COIN_NAMES } from "../../utils/crypto-pair";
5
5
  import { isNotATickerMessage } from "../not-a-ticker";
6
6
  import { groupByCompany } from "../../tickers/company-name";
7
7
  import { DATA_SERVICE_UNREACHABLE_MESSAGE } from "../../utils/network-failure";
8
- import { serviceDidNotAnswerMessage } from "../../sources/provider-errors";
8
+ import { rateLimitedMessage, serviceDidNotAnswerMessage } from "../../sources/provider-errors";
9
9
  import type { TickerRecord } from "../../types/ticker";
10
10
 
11
11
  /** Where a crypto pair that will not load can still be read. `fn CRYP` takes no argument. */
@@ -104,7 +104,8 @@ function failureReason(message: string, symbol: string): string {
104
104
 
105
105
  /** A reason that says the data service gave no answer at all, not what it found: the symbol was never checked. */
106
106
  function unanswered(reason: string): boolean {
107
- return reason === DATA_SERVICE_UNREACHABLE_MESSAGE || reason.startsWith(serviceDidNotAnswerMessage().split(".")[0]!);
107
+ return reason === DATA_SERVICE_UNREACHABLE_MESSAGE || reason.startsWith(serviceDidNotAnswerMessage().split(".")[0]!)
108
+ || reason.startsWith(rateLimitedMessage().split(".")[0]!);
108
109
  }
109
110
 
110
111
  /**