gloomberb 0.20.2 → 0.20.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (471) hide show
  1. package/README.md +1 -1
  2. package/README.zh-CN.md +1 -1
  3. package/package.json +2 -1
  4. package/src/account/auth-dialog.tsx +17 -0
  5. package/src/account/auth-form.tsx +13 -8
  6. package/src/account/upgrade-dialog.tsx +1 -1
  7. package/src/api-client/central-bank-rates.ts +5 -0
  8. package/src/api-client/data.ts +23 -4
  9. package/src/api-client/debt-maturities.ts +45 -2
  10. package/src/api-client/earnings.ts +4 -2
  11. package/src/api-client/errors.ts +21 -11
  12. package/src/api-client/fx-interventions.ts +64 -0
  13. package/src/api-client/index.ts +2 -0
  14. package/src/api-client/paths.ts +9 -1
  15. package/src/api-client/release-summaries.ts +21 -0
  16. package/src/api-client/social-mentions.ts +47 -0
  17. package/src/api-client/types/econ.ts +4 -0
  18. package/src/app/keybindings/actions.ts +2 -2
  19. package/src/app/pane-runtime/ticker-open-runtime.ts +245 -66
  20. package/src/app.tsx +11 -1
  21. package/src/cli/command-options.ts +2 -1
  22. package/src/cli/commands/market.ts +188 -30
  23. package/src/cli/commands/news-search.ts +1 -3
  24. package/src/cli/commands/options-chain.ts +23 -6
  25. package/src/cli/commands/overview.ts +13 -5
  26. package/src/cli/commands/plugins.ts +76 -23
  27. package/src/cli/commands/search.ts +25 -6
  28. package/src/cli/commands/system.ts +19 -3
  29. package/src/cli/commands/ticker.ts +64 -21
  30. package/src/cli/fx-quote-rate.ts +49 -1
  31. package/src/cli/glossary.ts +95 -15
  32. package/src/cli/history-rows.ts +9 -25
  33. package/src/cli/index.ts +14 -46
  34. package/src/cli/known-gaps.ts +3 -3
  35. package/src/cli/listing-arg.ts +78 -18
  36. package/src/cli/name-entries.ts +3 -2
  37. package/src/cli/not-a-ticker.ts +6 -2
  38. package/src/cli/pane-functions/capabilities.ts +12 -1
  39. package/src/cli/pane-functions/function-help.ts +26 -14
  40. package/src/cli/pane-functions/headless.ts +3 -1
  41. package/src/cli/pane-functions/index.ts +32 -4
  42. package/src/cli/pane-functions/market-session.ts +8 -3
  43. package/src/cli/pane-functions/resolver.ts +18 -11
  44. package/src/cli/pane-functions/screenshot-payload.ts +36 -6
  45. package/src/cli/pane-functions/screenshot-render.ts +4 -0
  46. package/src/cli/quote-answer.ts +10 -0
  47. package/src/cli/report-tables.ts +40 -8
  48. package/src/cli/result.ts +21 -9
  49. package/src/cli/spreadsheet-hint.ts +43 -0
  50. package/src/cli/symbol-list.ts +58 -4
  51. package/src/cli/symbol-rows.ts +49 -2
  52. package/src/cli/ticker-resolution.ts +98 -5
  53. package/src/cli/types.ts +2 -0
  54. package/src/cli/unknown-command.ts +88 -0
  55. package/src/components/chart/composite/axis-overlays.tsx +22 -0
  56. package/src/components/chart/composite/composite-chart.tsx +54 -13
  57. package/src/components/chart/composite/event-captions.ts +109 -0
  58. package/src/components/chart/composite/event-guides.ts +74 -0
  59. package/src/components/chart/composite/rasterizer.ts +2 -0
  60. package/src/components/chart/composite/text-renderer.ts +2 -0
  61. package/src/components/chart/composite/types.ts +31 -0
  62. package/src/components/command-bar/assist/model.ts +6 -1
  63. package/src/components/command-bar/commands/direct/index.ts +9 -1
  64. package/src/components/command-bar/commands/registry.ts +18 -0
  65. package/src/components/command-bar/layout-items/focused-pane.ts +5 -5
  66. package/src/components/command-bar/pane-actions.ts +30 -13
  67. package/src/components/command-bar/panel/index.tsx +6 -3
  68. package/src/components/command-bar/panel/prompt-binding.ts +4 -0
  69. package/src/components/command-bar/panel/types.ts +3 -0
  70. package/src/components/command-bar/routes/header-market.ts +108 -0
  71. package/src/components/command-bar/routes/root/command-items.ts +5 -0
  72. package/src/components/command-bar/routes/root/provider-search.ts +192 -33
  73. package/src/components/command-bar/routes/root/results.ts +3 -0
  74. package/src/components/command-bar/routes/root/runtime.ts +28 -5
  75. package/src/components/command-bar/routes/ticker-search/results.ts +104 -6
  76. package/src/components/command-bar/routes/ticker-search/route.ts +3 -2
  77. package/src/components/command-bar/routing/list-state.ts +38 -0
  78. package/src/components/command-bar/selection-hint.ts +28 -0
  79. package/src/components/command-bar/surface/index.tsx +41 -3
  80. package/src/components/command-bar/view-model.ts +15 -0
  81. package/src/components/command-bar/workflow/tickers.ts +3 -2
  82. package/src/components/company-logo.tsx +20 -2
  83. package/src/components/data-table/export.ts +13 -8
  84. package/src/components/feedback-dialog.tsx +2 -1
  85. package/src/components/form-modal/field-row.tsx +2 -1
  86. package/src/components/input-search-bar.tsx +2 -2
  87. package/src/components/layout/detached-pane-shell.tsx +1 -1
  88. package/src/components/layout/double-escape-close.ts +8 -5
  89. package/src/components/layout/floating-pane.tsx +5 -1
  90. package/src/components/layout/header.tsx +75 -44
  91. package/src/components/layout/market-summary.ts +322 -116
  92. package/src/components/layout/pane/footer/index.tsx +44 -19
  93. package/src/components/layout/pane/footer/model.ts +52 -20
  94. package/src/components/layout/pane/header.tsx +3 -2
  95. package/src/components/layout/shell/action-menu-overlay.tsx +10 -5
  96. package/src/components/layout/shell/active-drag.ts +149 -105
  97. package/src/components/layout/shell/chrome.ts +15 -15
  98. package/src/components/layout/shell/drag/drop-zones.ts +162 -0
  99. package/src/components/layout/shell/drag/index.ts +47 -218
  100. package/src/components/layout/shell/drag/live.ts +10 -3
  101. package/src/components/layout/shell/drag/overlays.tsx +182 -5
  102. package/src/components/layout/shell/drag/runtime.ts +29 -6
  103. package/src/components/layout/shell/drag/shared-edges.ts +156 -0
  104. package/src/components/layout/shell/index.tsx +11 -6
  105. package/src/components/layout/shell/menu.ts +11 -2
  106. package/src/components/layout/shell/native/pointer-runtime.ts +25 -0
  107. package/src/components/layout/shell/native/window-state.ts +2 -2
  108. package/src/components/layout/shell/pane/layers.tsx +71 -7
  109. package/src/components/layout/shell/terminal-pointer-runtime.ts +18 -9
  110. package/src/components/layout/shell/window-mode/index.ts +8 -10
  111. package/src/components/layout/status-bar.tsx +8 -7
  112. package/src/components/layout/status-widget-space.ts +8 -0
  113. package/src/components/layout/window-edit/mode.ts +39 -7
  114. package/src/components/layout/window-edit/presentation.ts +1 -1
  115. package/src/components/markdown-editor.tsx +2 -2
  116. package/src/components/onboarding/account-step/form-panel.tsx +0 -3
  117. package/src/components/onboarding/onboarding-keyboard.ts +19 -6
  118. package/src/components/onboarding/onboarding-wizard.tsx +69 -14
  119. package/src/components/onboarding/portfolio-step/broker-fields-panel.tsx +0 -1
  120. package/src/components/onboarding/portfolio-step/positions-panel.tsx +0 -2
  121. package/src/components/price-sparkline/model.ts +26 -10
  122. package/src/components/ticker/list-table-view.tsx +29 -4
  123. package/src/components/ui/button.tsx +15 -2
  124. package/src/components/ui/choice-dialog.tsx +1 -0
  125. package/src/components/ui/column-grid.tsx +18 -9
  126. package/src/components/ui/data-table/index.tsx +5 -4
  127. package/src/components/ui/data-table/opentui/index.tsx +2 -1
  128. package/src/components/ui/data-table/types.ts +18 -0
  129. package/src/components/ui/delayed-mark.tsx +3 -2
  130. package/src/components/ui/field-grid.tsx +0 -2
  131. package/src/components/ui/fields.tsx +7 -4
  132. package/src/components/ui/inline-quick-add.tsx +2 -2
  133. package/src/components/ui/key-hint-words.ts +153 -0
  134. package/src/components/ui/key-hints.tsx +73 -0
  135. package/src/components/ui/list-view.tsx +7 -12
  136. package/src/components/ui/loading.tsx +10 -3
  137. package/src/components/ui/menu.tsx +9 -3
  138. package/src/components/ui/message-composer.tsx +2 -2
  139. package/src/components/ui/quote.ts +14 -1
  140. package/src/components/ui/shortcut-hint.tsx +28 -3
  141. package/src/components/ui/tabs.tsx +7 -0
  142. package/src/components/ui/text-prompt-dialog.tsx +2 -1
  143. package/src/core/state/app/command-bar-launch.ts +3 -0
  144. package/src/data/config/layout.ts +5 -2
  145. package/src/data/config/store/normalize.ts +6 -0
  146. package/src/docs/snapshot.json +149 -74
  147. package/src/i18n/es.ts +33 -9
  148. package/src/i18n/ja.ts +33 -9
  149. package/src/i18n/ko.ts +33 -9
  150. package/src/i18n/zh-cn.ts +33 -9
  151. package/src/i18n/zh-tw.ts +33 -9
  152. package/src/layout/pane-manager/floating-actions.ts +17 -0
  153. package/src/layout/pane-manager/floating-stack.ts +187 -0
  154. package/src/layout/pane-manager/floating.ts +4 -2
  155. package/src/layout/pane-manager/gridlock.ts +16 -1
  156. package/src/layout/pane-manager/index.ts +11 -0
  157. package/src/layout/pane-manager/layout-state.ts +10 -3
  158. package/src/market-data/bars-per-year.ts +27 -9
  159. package/src/market-data/coordinator/quotes.ts +22 -3
  160. package/src/market-data/futures-board.ts +126 -1
  161. package/src/market-data/futures-contract.ts +21 -6
  162. package/src/market-data/fx-interventions.ts +270 -0
  163. package/src/market-data/market/change-basis.ts +2 -2
  164. package/src/market-data/market/dated-previous-close.ts +163 -47
  165. package/src/market-data/market/format.ts +14 -3
  166. package/src/market-data/market/freshness.ts +24 -7
  167. package/src/market-data/market/header-market.ts +154 -0
  168. package/src/market-data/market/index-level.ts +29 -0
  169. package/src/market-data/market/index-session-venues.ts +44 -0
  170. package/src/market-data/market/status.ts +7 -2
  171. package/src/market-data/market/venue-session.ts +72 -0
  172. package/src/market-data/model-dividend-yield.ts +23 -8
  173. package/src/market-data/options-alternatives.ts +39 -4
  174. package/src/market-data/published-apac-sessions.ts +40 -2
  175. package/src/market-data/quotes/export-identity.ts +76 -0
  176. package/src/market-data/quotes/freshness.ts +22 -0
  177. package/src/market-data/quotes/time.ts +42 -1
  178. package/src/market-data/realized-volatility.ts +11 -7
  179. package/src/market-data/tax-equivalent.ts +145 -27
  180. package/src/news/news-model.ts +44 -2
  181. package/src/plugins/builtin/account-management/pane.tsx +2 -2
  182. package/src/plugins/builtin/alerts/alert-engine.ts +12 -6
  183. package/src/plugins/builtin/alerts/alert-log.ts +6 -2
  184. package/src/plugins/builtin/alerts/calendar-events.ts +74 -12
  185. package/src/plugins/builtin/alerts/cli-forms.ts +11 -1
  186. package/src/plugins/builtin/alerts/cli-move.ts +234 -0
  187. package/src/plugins/builtin/alerts/cli.ts +223 -32
  188. package/src/plugins/builtin/alerts/command.ts +33 -6
  189. package/src/plugins/builtin/alerts/event-rows.ts +18 -4
  190. package/src/plugins/builtin/alerts/events-pane.tsx +6 -2
  191. package/src/plugins/builtin/alerts/events.ts +9 -0
  192. package/src/plugins/builtin/alerts/format.ts +39 -15
  193. package/src/plugins/builtin/alerts/headless.ts +30 -18
  194. package/src/plugins/builtin/alerts/history.ts +1 -0
  195. package/src/plugins/builtin/alerts/index.tsx +86 -12
  196. package/src/plugins/builtin/alerts/live.ts +2 -1
  197. package/src/plugins/builtin/alerts/move-checks.ts +161 -0
  198. package/src/plugins/builtin/alerts/move.ts +181 -0
  199. package/src/plugins/builtin/alerts/pane.tsx +50 -22
  200. package/src/plugins/builtin/alerts/price-text.ts +62 -0
  201. package/src/plugins/builtin/alerts/price.ts +17 -0
  202. package/src/plugins/builtin/alerts/quotes.ts +84 -3
  203. package/src/plugins/builtin/alerts/scheduled-check.ts +7 -1
  204. package/src/plugins/builtin/alerts/storage.ts +22 -7
  205. package/src/plugins/builtin/alerts/types.ts +25 -0
  206. package/src/plugins/builtin/analytics/risk-client.ts +60 -39
  207. package/src/plugins/builtin/analytics/risk-episodes.ts +18 -0
  208. package/src/plugins/builtin/analytics/risk-headless.ts +20 -4
  209. package/src/plugins/builtin/analytics/risk-model.ts +68 -1
  210. package/src/plugins/builtin/analytics/risk-pane.tsx +15 -3
  211. package/src/plugins/builtin/backtest/engine.ts +4 -2
  212. package/src/plugins/builtin/backtest/window.ts +3 -1
  213. package/src/plugins/builtin/broker-manager/sign-in-end.ts +1 -1
  214. package/src/plugins/builtin/central-bank-rates/client.ts +4 -0
  215. package/src/plugins/builtin/central-bank-rates/headless.ts +1 -1
  216. package/src/plugins/builtin/central-bank-rates/model.ts +18 -8
  217. package/src/plugins/builtin/central-bank-rates/pane.tsx +6 -3
  218. package/src/plugins/builtin/changelog/index.tsx +292 -101
  219. package/src/plugins/builtin/changelog/versions.ts +293 -0
  220. package/src/plugins/builtin/chart-composer/cli-options.ts +5 -0
  221. package/src/plugins/builtin/chart-composer/headless-schema.ts +17 -1
  222. package/src/plugins/builtin/chart-composer/headless.ts +2 -0
  223. package/src/plugins/builtin/chart-composer/intervention-events.ts +105 -0
  224. package/src/plugins/builtin/chart-composer/pane.tsx +21 -7
  225. package/src/plugins/builtin/chat/message/render-state.ts +2 -5
  226. package/src/plugins/builtin/cloud/askg/attached-pane.tsx +10 -5
  227. package/src/plugins/builtin/cloud/askg/controller.ts +141 -5
  228. package/src/plugins/builtin/cloud/askg/executor.ts +113 -4
  229. package/src/plugins/builtin/cloud/askg/manifest.ts +28 -13
  230. package/src/plugins/builtin/cloud/askg/model.ts +14 -4
  231. package/src/plugins/builtin/cloud/askg/pane.tsx +70 -46
  232. package/src/plugins/builtin/cloud/askg/turn-parts.tsx +70 -0
  233. package/src/plugins/builtin/cloud/terminal-relay/engine.ts +50 -130
  234. package/src/plugins/builtin/cloud/terminal-relay/policy.ts +327 -7
  235. package/src/plugins/builtin/cloud/terminal-relay/prompts.tsx +2 -1
  236. package/src/plugins/builtin/cloud/terminal-relay/redact.ts +47 -6
  237. package/src/plugins/builtin/cloud/upgrade-status-widget.tsx +9 -2
  238. package/src/plugins/builtin/commodities-energy/index.tsx +1 -3
  239. package/src/plugins/builtin/commodities-energy/view-state.ts +3 -0
  240. package/src/plugins/builtin/cot/headless.ts +14 -2
  241. package/src/plugins/builtin/crypto-board/headless.ts +82 -17
  242. package/src/plugins/builtin/crypto-board/index.tsx +24 -2
  243. package/src/plugins/builtin/crypto-board/model.ts +5 -2
  244. package/src/plugins/builtin/crypto-board/pane.tsx +4 -1
  245. package/src/plugins/builtin/debt-maturities/client.ts +111 -6
  246. package/src/plugins/builtin/debt-maturities/headless.ts +84 -1
  247. package/src/plugins/builtin/debt-maturities/model.ts +97 -14
  248. package/src/plugins/builtin/debt-maturities/pane.tsx +165 -15
  249. package/src/plugins/builtin/debt-maturities/series.ts +3 -1
  250. package/src/plugins/builtin/dividend-yield/client.ts +22 -6
  251. package/src/plugins/builtin/dividend-yield/headless.ts +113 -46
  252. package/src/plugins/builtin/dividend-yield/model.ts +5 -2
  253. package/src/plugins/builtin/dividend-yield/pane.tsx +6 -3
  254. package/src/plugins/builtin/dividend-yield/ranking-reads.ts +11 -4
  255. package/src/plugins/builtin/dividend-yield/ranking.ts +113 -18
  256. package/src/plugins/builtin/dividend-yield/types.ts +2 -0
  257. package/src/plugins/builtin/dividend-yield/view.ts +3 -0
  258. package/src/plugins/builtin/earnings/index.tsx +2 -2
  259. package/src/plugins/builtin/econ/calendar-model.ts +21 -3
  260. package/src/plugins/builtin/econ/detail-view.tsx +5 -3
  261. package/src/plugins/builtin/econ/figures.ts +13 -0
  262. package/src/plugins/builtin/econ/fred-catalog.ts +6 -3
  263. package/src/plugins/builtin/econ/index.tsx +5 -3
  264. package/src/plugins/builtin/econ/types.ts +5 -0
  265. package/src/plugins/builtin/equity-screener/footer.ts +45 -0
  266. package/src/plugins/builtin/equity-screener/pane.tsx +4 -18
  267. package/src/plugins/builtin/equity-screener/ticker-check.tsx +2 -1
  268. package/src/plugins/builtin/fixed-income/model.ts +1 -0
  269. package/src/plugins/builtin/futures/index.tsx +25 -4
  270. package/src/plugins/builtin/futures/model.ts +28 -32
  271. package/src/plugins/builtin/futures/series.ts +4 -3
  272. package/src/plugins/builtin/futures/table.tsx +17 -10
  273. package/src/plugins/builtin/futures/use-board-terms.ts +3 -3
  274. package/src/plugins/builtin/futures-curve/model.ts +3 -10
  275. package/src/plugins/builtin/help/function-card.tsx +2 -1
  276. package/src/plugins/builtin/help/function-index.ts +1 -0
  277. package/src/plugins/builtin/help/index.tsx +3 -3
  278. package/src/plugins/builtin/help/keybindings-editor.tsx +18 -4
  279. package/src/plugins/builtin/insider/client.ts +31 -14
  280. package/src/plugins/builtin/insider/signals-model.ts +2 -7
  281. package/src/plugins/builtin/iv-history/headless.ts +1 -2
  282. package/src/plugins/builtin/iv-history/model.ts +33 -23
  283. package/src/plugins/builtin/iv-history/screen-pane.tsx +0 -3
  284. package/src/plugins/builtin/kelly-sizer/headless.ts +64 -16
  285. package/src/plugins/builtin/kelly-sizer/history.ts +37 -28
  286. package/src/plugins/builtin/kelly-sizer/pane.tsx +43 -10
  287. package/src/plugins/builtin/kelly-sizer/sections.tsx +7 -2
  288. package/src/plugins/builtin/kelly-sizer/units.ts +29 -0
  289. package/src/plugins/builtin/layout-manager/index.tsx +8 -8
  290. package/src/plugins/builtin/news/headless.ts +2 -2
  291. package/src/plugins/builtin/news/index.tsx +10 -16
  292. package/src/plugins/builtin/news/overview-headlines.tsx +117 -0
  293. package/src/plugins/builtin/news/ticker-news.ts +35 -0
  294. package/src/plugins/builtin/news/wire/news/detail-view.tsx +8 -6
  295. package/src/plugins/builtin/news/wire/news/row.ts +49 -0
  296. package/src/plugins/builtin/news/wire/news/table.tsx +9 -20
  297. package/src/plugins/builtin/options/analytics.ts +7 -2
  298. package/src/plugins/builtin/options/live-quotes.ts +6 -1
  299. package/src/plugins/builtin/options/table.ts +3 -2
  300. package/src/plugins/builtin/options/view.tsx +11 -9
  301. package/src/plugins/builtin/options-scenario/client.ts +3 -0
  302. package/src/plugins/builtin/options-scenario/headless.ts +1 -1
  303. package/src/plugins/builtin/perps/client.ts +5 -4
  304. package/src/plugins/builtin/perps/headless.ts +134 -124
  305. package/src/plugins/builtin/perps/markets-section.tsx +7 -4
  306. package/src/plugins/builtin/perps/model.ts +8 -4
  307. package/src/plugins/builtin/perps/open-market.ts +4 -4
  308. package/src/plugins/builtin/perps/venue-markets.ts +3 -6
  309. package/src/plugins/builtin/plugin-marketplace/pane.tsx +11 -11
  310. package/src/plugins/builtin/portfolio-list/cell-version.ts +1 -0
  311. package/src/plugins/builtin/portfolio-list/cli/bulk-symbols.ts +34 -10
  312. package/src/plugins/builtin/portfolio-list/cli/period-report.ts +28 -2
  313. package/src/plugins/builtin/portfolio-list/cli/portfolio-command.ts +7 -3
  314. package/src/plugins/builtin/portfolio-list/cli/render.ts +66 -22
  315. package/src/plugins/builtin/portfolio-list/grid.tsx +5 -3
  316. package/src/plugins/builtin/portfolio-list/pane/data.ts +34 -1
  317. package/src/plugins/builtin/portfolio-list/pane/index.tsx +6 -0
  318. package/src/plugins/builtin/portfolio-list/pane/streaming.ts +15 -6
  319. package/src/plugins/builtin/portfolio-list/quick-add/resolution.ts +19 -7
  320. package/src/plugins/builtin/portfolio-list/summary/index.tsx +3 -1
  321. package/src/plugins/builtin/portfolio-list/table.tsx +30 -4
  322. package/src/plugins/builtin/realized-vol/evidence.ts +33 -6
  323. package/src/plugins/builtin/realized-vol/fx-proxy.ts +135 -0
  324. package/src/plugins/builtin/realized-vol/headless.ts +44 -8
  325. package/src/plugins/builtin/realized-vol/model.ts +9 -5
  326. package/src/plugins/builtin/realized-vol/pane.tsx +49 -15
  327. package/src/plugins/builtin/research/event-model.ts +9 -1
  328. package/src/plugins/builtin/research/event-sources.ts +22 -0
  329. package/src/plugins/builtin/research/headless.ts +3 -3
  330. package/src/plugins/builtin/sec/headless.ts +48 -6
  331. package/src/plugins/builtin/sec/index.tsx +6 -4
  332. package/src/plugins/builtin/sec/model.ts +4 -1
  333. package/src/plugins/builtin/shared/cloud-upgrade.ts +27 -3
  334. package/src/plugins/builtin/shared/earnings-calendar.ts +2 -0
  335. package/src/plugins/builtin/shared/market-cap-bands.ts +12 -0
  336. package/src/plugins/builtin/shared/report-freshness.ts +3 -1
  337. package/src/plugins/builtin/shared/use-quote-board.ts +5 -3
  338. package/src/plugins/builtin/shared/volatility/options.ts +63 -2
  339. package/src/plugins/builtin/social-mentions/headless.ts +72 -3
  340. package/src/plugins/builtin/social-mentions/index.tsx +8 -4
  341. package/src/plugins/builtin/social-mentions/lock-note.ts +6 -2
  342. package/src/plugins/builtin/social-mentions/outliers-client.ts +101 -0
  343. package/src/plugins/builtin/social-mentions/outliers-model.ts +162 -0
  344. package/src/plugins/builtin/social-mentions/outliers-names.ts +51 -0
  345. package/src/plugins/builtin/social-mentions/outliers.tsx +276 -0
  346. package/src/plugins/builtin/social-mentions/pane.tsx +32 -3
  347. package/src/plugins/builtin/supply-chain/graph-pane.tsx +2 -2
  348. package/src/plugins/builtin/thirteenf/api.ts +36 -2
  349. package/src/plugins/builtin/thirteenf/data.ts +4 -1
  350. package/src/plugins/builtin/thirteenf/headless.ts +14 -6
  351. package/src/plugins/builtin/thirteenf/model.ts +56 -1
  352. package/src/plugins/builtin/thirteenf/pane.tsx +8 -8
  353. package/src/plugins/builtin/thirteenf/report-notes.ts +11 -0
  354. package/src/plugins/builtin/thirteenf/table.ts +2 -1
  355. package/src/plugins/builtin/thirteenf/types.ts +6 -0
  356. package/src/plugins/builtin/ticker-detail/data-panes/historical-prices.tsx +23 -3
  357. package/src/plugins/builtin/ticker-detail/financials/model.ts +5 -0
  358. package/src/plugins/builtin/ticker-detail/headless-schema.ts +2 -1
  359. package/src/plugins/builtin/ticker-detail/headless.ts +21 -66
  360. package/src/plugins/builtin/ticker-detail/index.tsx +5 -0
  361. package/src/plugins/builtin/ticker-detail/overview/components.tsx +67 -6
  362. package/src/plugins/builtin/ticker-detail/overview/model.ts +6 -4
  363. package/src/plugins/builtin/ticker-detail/overview/pane.tsx +15 -0
  364. package/src/plugins/builtin/ticker-detail/overview/tax-equivalent.ts +69 -0
  365. package/src/plugins/builtin/ticker-detail/overview-tab.tsx +69 -19
  366. package/src/plugins/builtin/ticker-detail/pane.tsx +7 -2
  367. package/src/plugins/builtin/ticker-detail/quote-monitor/card.tsx +47 -24
  368. package/src/plugins/builtin/ticker-detail/quote-monitor/export.ts +46 -0
  369. package/src/plugins/builtin/ticker-detail/quote-monitor/index.tsx +20 -1
  370. package/src/plugins/builtin/ticker-detail/quote-monitor/rows.ts +120 -0
  371. package/src/plugins/builtin/ticker-detail/research-tabs.ts +1 -5
  372. package/src/plugins/builtin/ticker-detail/settings.ts +6 -6
  373. package/src/plugins/builtin/treasury-auctions/cache.ts +85 -19
  374. package/src/plugins/builtin/treasury-auctions/index.tsx +22 -11
  375. package/src/plugins/builtin/treasury-auctions/model.ts +23 -0
  376. package/src/plugins/builtin/treasury-auctions/treasury-direct.ts +128 -0
  377. package/src/plugins/builtin/world-indices/client.ts +2 -0
  378. package/src/plugins/compat.ts +15 -0
  379. package/src/plugins/host-link.ts +6 -1
  380. package/src/plugins/installer.ts +53 -3
  381. package/src/portfolio/column-values.ts +14 -4
  382. package/src/portfolio/listed-symbol.ts +78 -0
  383. package/src/portfolio/real-return.ts +172 -0
  384. package/src/public/__snapshots__/public-api.test.ts.snap +1 -0
  385. package/src/remote/resources.ts +12 -1
  386. package/src/remote/schema.ts +1 -0
  387. package/src/remote/semantic-helpers.ts +29 -1
  388. package/src/remote/semantic-tree.tsx +32 -15
  389. package/src/renderers/browser/config-host.ts +56 -15
  390. package/src/renderers/browser/main.tsx +3 -1
  391. package/src/renderers/browser/ui-host.tsx +1 -0
  392. package/src/renderers/cloudflare/http-proxy.ts +1 -0
  393. package/src/renderers/cloudflare/worker.ts +16 -1
  394. package/src/renderers/dom/boot-frame.ts +2 -2
  395. package/src/renderers/dom/data-table/row.tsx +4 -1
  396. package/src/renderers/dom/desktop/controls.tsx +4 -4
  397. package/src/renderers/dom/desktop/dialog-actions.tsx +60 -41
  398. package/src/renderers/dom/dom-ui-host.tsx +3 -1
  399. package/src/renderers/dom/host/input.tsx +4 -1
  400. package/src/renderers/dom/host/tabs.tsx +10 -1
  401. package/src/renderers/dom/styles.css +73 -19
  402. package/src/renderers/electrobun/bun/desktop/app-name.ts +1 -1
  403. package/src/renderers/opentui/host.tsx +2 -1
  404. package/src/renderers/share/layout-view.tsx +1 -1
  405. package/src/sources/gloomberb-cloud/fred-series.ts +12 -0
  406. package/src/sources/gloomberb-cloud/index.ts +31 -2
  407. package/src/sources/gloomberb-cloud/news.ts +35 -12
  408. package/src/sources/gloomberb-cloud/normalizers.ts +29 -3
  409. package/src/sources/provider-router/cached-routes.ts +19 -7
  410. package/src/state/opening-ticker-panes.ts +47 -0
  411. package/src/state/pane-table-export-registry.ts +19 -6
  412. package/src/test-support/cli-context.ts +2 -0
  413. package/src/test-support/preload.ts +8 -1
  414. package/src/theme/colors.ts +9 -1
  415. package/src/theme/themes.ts +62 -15
  416. package/src/theme/tone-contrast.ts +40 -0
  417. package/src/theme/ui-tokens.ts +23 -3
  418. package/src/tickers/batched-lookups.ts +57 -8
  419. package/src/tickers/company-name-listing.ts +156 -14
  420. package/src/tickers/company-name.ts +30 -6
  421. package/src/tickers/instrument-kind.ts +23 -3
  422. package/src/tickers/list.ts +7 -0
  423. package/src/tickers/search/home-listing.ts +31 -9
  424. package/src/tickers/search/index.ts +13 -3
  425. package/src/tickers/search/listing-index.ts +558 -0
  426. package/src/tickers/search/major-listings.chunk.ts +10 -0
  427. package/src/tickers/search/major-listings.json +3346 -0
  428. package/src/tickers/search/ranking.ts +68 -1
  429. package/src/tickers/search/types.ts +4 -0
  430. package/src/tickers/terminal-codes.ts +26 -1
  431. package/src/time-series/calendar-month-returns.ts +47 -0
  432. package/src/time-series/currency-conversion.ts +130 -0
  433. package/src/time-series/hooks.ts +2 -0
  434. package/src/time-series/price-comparison.ts +34 -11
  435. package/src/time-series/resolve-context.ts +3 -0
  436. package/src/time-series/resolve.ts +14 -2
  437. package/src/time-series/spec.ts +1 -0
  438. package/src/time-series/studies/indicators.ts +4 -1
  439. package/src/time-series/types.ts +8 -0
  440. package/src/types/config.ts +13 -0
  441. package/src/types/context-menu.ts +2 -0
  442. package/src/types/data-provider.ts +28 -0
  443. package/src/types/financials.ts +20 -2
  444. package/src/types/headless.ts +12 -0
  445. package/src/types/plugin-commands.ts +140 -0
  446. package/src/types/plugin-context.ts +125 -0
  447. package/src/types/plugin-contributions.ts +55 -0
  448. package/src/types/plugin-definition.ts +234 -0
  449. package/src/types/plugin-notifications.ts +38 -0
  450. package/src/types/plugin-pane-settings.ts +114 -0
  451. package/src/types/plugin-pane-templates.ts +160 -0
  452. package/src/types/plugin-panes.ts +221 -0
  453. package/src/types/plugin-reports.ts +35 -0
  454. package/src/types/plugin-shared.ts +14 -0
  455. package/src/types/plugin-state.ts +71 -0
  456. package/src/types/plugin.ts +14 -1169
  457. package/src/ui/host.tsx +8 -0
  458. package/src/ui/index.tsx +14 -3
  459. package/src/updater/github-releases.ts +23 -0
  460. package/src/utils/cli-output.ts +22 -9
  461. package/src/utils/datetime-format.ts +17 -3
  462. package/src/utils/display-number.ts +15 -0
  463. package/src/utils/double-escape-close.ts +61 -16
  464. package/src/utils/float32-price.ts +24 -0
  465. package/src/utils/forward-dividend.ts +81 -16
  466. package/src/utils/fx-market-hours.ts +11 -0
  467. package/src/utils/plugin-proxy-hosts.json +2 -1
  468. package/src/utils/price-history.ts +7 -6
  469. package/src/utils/report-timing.ts +62 -0
  470. package/src/utils/sec-filings.ts +32 -0
  471. package/src/utils/utc-time.ts +5 -0
@@ -1,6 +1,5 @@
1
- import type { ReactNode } from "react";
2
- import type { AppTickerRepositoryPort } from "../core/app-service-ports";
3
- import type { HeadlessPaneArgumentDef, HeadlessPaneContext, HeadlessPaneDefinition, HeadlessPaneFreshness, HeadlessPaneOptionDef } from "./headless";
1
+ // The plugin API (`gloomberb/types/plugin`). The declarations live in the plugin-*.ts files beside this
2
+ // one, grouped by domain; this file only re-exports them, so every import path keeps resolving.
4
3
 
5
4
  export type {
6
5
  HeadlessArgumentExpansion,
@@ -32,1170 +31,16 @@ export type {
32
31
  HeadlessShotState,
33
32
  HeadlessSnapshotResult,
34
33
  } from "./headless";
35
- import type { ConnectionHealthRegistry } from "../core/connection-health";
36
- import type { PluginEvents } from "../plugins/event-bus";
37
- import type { PluginLogger } from "../utils/debug-log";
38
- import type { BrokerAdapter } from "./broker";
39
- import type { PluginCapability } from "../capabilities";
40
- import type { SeriesDefinition } from "../series/types";
41
- import type { CliGlobalOptions } from "../cli/options";
42
- import type { CliResult, CliResultRenderOptions } from "../cli/result";
43
- import type { ContextMenuContext, ContextMenuItem } from "./context-menu";
44
- import type {
45
- AppConfig,
46
- BrokerInstanceConfig,
47
- ColumnConfig,
48
- LayoutConfig,
49
- PaneBinding,
50
- PaneInstanceConfig,
51
- } from "./config";
52
- import type { DataProvider } from "./data-provider";
53
- import type { TickerFinancials } from "./financials";
54
- import type { CachePolicy, PersistedResourceValue } from "./persistence";
55
- import type { TickerRecord } from "./ticker";
56
- import type { BrokerContractRef, InstrumentSearchResult, TickerInstrumentKind, TickerListingRef } from "./instrument";
57
- import type { SyncContributor, SyncTransport } from "../sync/types";
58
-
59
34
  export type { TickerInstrumentKind } from "./instrument";
60
-
61
- /**
62
- * Named render slots. The host renders only `status:widget`; the other names
63
- * are never drawn and are kept so existing plugins still type-check.
64
- */
65
- export interface GloomSlots {
66
- /** @deprecated Never rendered. Use `ctx.registerTickerResearchTab`. */
67
- "ticker-research:tab": { ticker: TickerRecord; financials: TickerFinancials | null };
68
- /** @deprecated Never rendered. Use `ctx.registerTickerResearchTab`. */
69
- "ticker-research:section": { ticker: TickerRecord; financials: TickerFinancials | null };
70
- /** @deprecated Never rendered. Use `ctx.registerColumn`. */
71
- "list:column": { ticker: TickerRecord; financials: TickerFinancials | null };
72
- /** @deprecated Never rendered. Use `ctx.registerCommandBarSearchProvider`. */
73
- "command:extra": { query: string };
74
- /** @deprecated Never rendered. Use `ctx.registerCommand`. */
75
- "command:preset": Record<string, never>;
76
- "status:widget": Record<string, never>;
77
- /** @deprecated Never rendered. Declare settings with `configSchema`. */
78
- "config:section": Record<string, never>;
79
- /** @deprecated Never called. Subscribe with `ctx.on("ticker:refreshed")`. */
80
- "data:post-refresh": { ticker: string; financials: TickerFinancials };
81
- /** @deprecated Never called. Contribute data with an `asset-data` capability. */
82
- "data:enricher": { ticker: TickerRecord };
83
- }
84
-
85
- export interface PaneProps {
86
- paneId: string;
87
- paneType: string;
88
- focused: boolean;
89
- width: number;
90
- height: number;
91
- close?: () => void;
92
- }
93
-
94
- export type PaneSharePrivateFields = true | readonly string[];
95
-
96
- export interface PanePortableShareDef {
97
- /** Fields excluded before pane configuration or state leaves the device. */
98
- private?: {
99
- title?: boolean;
100
- params?: PaneSharePrivateFields;
101
- settings?: PaneSharePrivateFields;
102
- state?: PaneSharePrivateFields;
103
- };
104
- /**
105
- * Rewrites the instance before it leaves the device, on every publish. The
106
- * receiver has none of the sender's local ticker records, so anything
107
- * resolved through them (a listing's venue, for example) must be pinned into
108
- * the instance here; a layout published to the gallery passes none.
109
- */
110
- prepare?(pane: PaneInstanceConfig, context: {
111
- tickers: ReadonlyMap<string, TickerRecord>;
112
- /** The moment the pane's layout tab has its crosshair pinned at, so a link opens there. */
113
- pinnedTime?: number;
114
- }): PaneInstanceConfig;
115
- }
116
-
117
- /** What covers a pane when a report of it is refused: see `PaneDef.reportLockNote`. */
118
- export interface PaneLock {
119
- /** Sign-in is the wall of a session that is missing or unverified; pro the one of a plan without access. */
120
- gate: "sign-in" | "pro";
121
- /** The first symbol the report was asked for, or null. */
122
- symbol: string | null;
123
- /** The function code the report was run for, for a pane that serves several (EM and GUID). */
124
- token?: string;
125
- /** The session is signed in and its email is not verified yet. */
126
- verifyEmail?: boolean;
127
- /**
128
- * Reads data as the report does, so a note can check that a free route it
129
- * would name has data for the symbol before naming it. Absent where nothing
130
- * can be read.
131
- */
132
- context?: HeadlessPaneContext;
133
- }
134
-
135
- export interface PaneDef {
136
- id: string;
137
- name: string;
138
- icon?: string;
139
- component: (props: PaneProps) => ReactNode;
140
- defaultPosition: "left" | "right";
141
- defaultWidth?: string;
142
- defaultFloatingSize?: { width: number; height: number };
143
- defaultMode?: "docked" | "floating";
144
- /** Pane publishes its selected symbol as pane-state `cursorSymbol`, so ticker panes can follow it. */
145
- tickerSource?: boolean;
146
- /**
147
- * Pane shows one ticker read through its binding (`usePaneTicker`, `usePaneTickerIdentity`), so
148
- * its pane menu offers "Link to" each visible list, scanner, and other single-ticker pane, and
149
- * it then follows that pane's selection. A function decides per instance (a chart with one
150
- * security, not a comparison). A follower must never write its own `cursorSymbol`: that would
151
- * win over the binding.
152
- */
153
- tickerFollower?: boolean | ((pane: PaneInstanceConfig) => boolean);
154
- /**
155
- * A single-ticker pane that keeps its ticker somewhere besides its binding (a chart's series)
156
- * moves it here when ticker search changes the ticker the pane shows. The host has already set
157
- * the binding and the title; `previous` is the ticker the pane showed until now.
158
- */
159
- retargetTicker?(pane: PaneInstanceConfig, symbol: string, previous: string | null): PaneInstanceConfig;
160
- /**
161
- * Instrument kinds this pane has data for, such as `["equity"]` for company
162
- * data, as a research tab declares them. Bound to a ticker of another known
163
- * kind (an index, an ETF), the pane says so in place of its data, and `fn`
164
- * and `shot` answer before loading. Omit when every ticker has it.
165
- */
166
- instruments?: readonly TickerInstrumentKind[];
167
- /**
168
- * For a pane type that two or more functions open (ERN and EVTS): the settings that say
169
- * what a window shows, as against how (a range, a toggle, a column choice). Opening a
170
- * function again focuses a window whose binding, params and settings match what the
171
- * function opens; a window with a setting of its own that is not listed here is still that
172
- * window, and one with a listed setting the function does not set belongs to another
173
- * function and is left alone. Without it, a pane type opened by several functions is
174
- * matched on its settings exactly, and a window that picked up any setting is not found.
175
- * An empty list says binding and params alone name the window.
176
- */
177
- identitySettings?: readonly string[];
178
- /**
179
- * The title a saved window of this pane has, from its params and settings,
180
- * for lists that name windows without rendering them (the Layouts browser).
181
- * A pane that titles itself by what it shows ("Curve \u00b7 BZ") gives the same
182
- * title here, so two of its windows are told apart before either is opened.
183
- */
184
- instanceTitle?(pane: PaneInstanceConfig): string | null;
185
- /** Renderer-neutral data model used by CLI functions, automation, and hosted tools. */
186
- headless?: HeadlessPaneDefinition;
187
- /**
188
- * Source and status a rendered-view report (`fn` on a pane without a
189
- * `headless` model) cites, when "Gloom Cloud" with the state the footer
190
- * shows would be wrong: local data, a calculator, filed records.
191
- */
192
- reportFreshness?: Pick<HeadlessPaneFreshness, "source" | "status" | "basis" | "local">;
193
- /**
194
- * Options a rendered-view report takes (`fn OMON AAPL --strikes 10`):
195
- * each sets the pane setting of its key, is checked by its `normalize`, and
196
- * is listed with its example by `gloom catalog`.
197
- */
198
- reportOptions?: readonly PaneReportOptionDef[];
199
- /**
200
- * A rendered-view report that takes its `reportOptions` and nothing else:
201
- * any other option is refused with the ones it takes (`fn FUT --bogus 1`),
202
- * as a `headless` report refuses one, instead of being set as a pane
203
- * setting of that name.
204
- */
205
- reportOptionsOnly?: boolean;
206
- /**
207
- * What a rendered-view report takes after the function, for a pane whose
208
- * template reads it with no shortcut to say so (X Feed's query): the
209
- * catalog lists it, and `fn` refuses an argument from a function that
210
- * declares none here, in its shortcut or in a `headless` model.
211
- */
212
- reportArgument?: Pick<HeadlessPaneArgumentDef, "kind" | "placeholder" | "description" | "optional"> & {
213
- /**
214
- * The argument names something the pane opens by its own id (the story
215
- * pane's story id), never a symbol: `fn` does not look it up as a ticker.
216
- * A query (X Feed's) leaves it unset and keeps its ticker reading.
217
- */
218
- identifier?: boolean;
219
- };
220
- /**
221
- * Lines a rendered-view report prints above its table, from the settings it
222
- * ran with: what the default view leaves out and how to see more. `--json`
223
- * carries them in `data.metadata.notices`.
224
- */
225
- reportNotices?(settings: Readonly<Record<string, unknown>>): string[];
226
- /**
227
- * What a rendered-view report prints in place of the pane when a sign-in
228
- * wall or the Pro lock covers all of it: what is locked, what can still be
229
- * read without it and where, and how to unlock it. A `headless` pane's report
230
- * prints it when the server refuses the read (401, 402 or 403). Without it
231
- * the report prints the wall's own words, or the refusal. Either way it cites
232
- * no source, since nothing was read. A free route it names must have data
233
- * for the symbol (`lock.context` reads it), so the note may resolve later.
234
- */
235
- reportLockNote?(lock: PaneLock): string | Promise<string>;
236
- /**
237
- * The sign-in wall covers the whole pane whenever there is no Gloom Cloud
238
- * session (ASKG): a rendered-view report without one prints its
239
- * `reportLockNote` at once rather than render the wall to read it.
240
- */
241
- signInWall?: boolean;
242
- /**
243
- * What a rendered-view report needs before it shows anything, such as a
244
- * sign-in: `gloom catalog` lists it under Requires, as it does a
245
- * `headless` model's `discovery.dataRequirements`.
246
- */
247
- reportRequirements?: readonly string[];
248
- /**
249
- * A `shot` without `--height` grows to the pane's natural height, up to the
250
- * height limit, so a fixed board (FUT) shows every row instead of cutting
251
- * the last ones. Leave it off for long or paged lists; a pane with tabs
252
- * answers for the instance shown, so only its fixed board's tab grows.
253
- */
254
- shotFitsRows?: true | ((pane: PaneInstanceConfig) => boolean);
255
- /**
256
- * A report of the pane grows to the whole text of the page its reader has
257
- * open (a docs page), so it is not cut at the first screen. A list the reader
258
- * opens from keeps its height.
259
- */
260
- shotFitsReader?: true;
261
- /** Add an Excel-compatible CSV action for the pane's single active DataTable. */
262
- tableExport?: true;
263
- settings?: PaneSettingsDef | ((context: PaneSettingsContext) => PaneSettingsDef | null);
264
- /** Portable sharing is public by default; list the few pane-owned fields that must remain local. */
265
- portableShare?: PanePortableShareDef;
266
- /**
267
- * The person's own data the pane shows, so copying a public link to it,
268
- * posting its picture in a bug report and attaching it to an Ask Gloom
269
- * question ask first. A function decides
270
- * per instance from what it shows now (a chat pane on a public channel, a
271
- * quote of a ticker not held), and a function that returns null opts that
272
- * instance out. Leave it off for market data. A pane that says nothing is
273
- * still asked about when its plugin connects a broker (`holdings`) or the
274
- * pane keeps fields private when shared (`portableShare.private`,
275
- * `personal`), for plugins written before this field existed; declare it
276
- * to say exactly what the pane shows.
277
- */
278
- personalData?: PanePersonalData | ((context: PanePersonalDataContext) => PanePersonalData | null);
279
- /**
280
- * Compact controls surfaced next to the pane title. A key references a
281
- * toggle field in settings, or a two-option select field when `onValue` is set.
282
- */
283
- quickSettings?: readonly PaneQuickSettingDef[];
284
- }
285
-
286
- /**
287
- * Kinds of personal data a pane can show: `holdings` (positions, balances,
288
- * orders, profit and loss), `account` (account numbers, email, plan),
289
- * `messages` (private conversations) and `personal` (the person's own data
290
- * of a kind the pane does not name).
291
- */
292
- export type PanePersonalData = "holdings" | "account" | "messages" | "personal";
293
-
294
- /**
295
- * An option of a rendered-view report, which sets the pane setting of its key,
296
- * or of `settingKey` when the flag reads better than the setting's name
297
- * (`--columns` for `optionColumnIds`); with `pluginState`, the pane state the
298
- * view reads it from (a workspace's tab), and the setting too when it also
299
- * names a `settingKey`.
300
- */
301
- export interface PaneReportOptionDef extends HeadlessPaneOptionDef {
302
- /** The value's name in the catalog's flag, `--currencies <codes>`; the type when absent. */
303
- placeholder?: string;
304
- /** The option in use as typed after the function, such as `--currencies USD,ZAR,NGN`; the catalog shows it as an example. */
305
- example?: string;
306
- /** Checks a typed value and returns it as the pane reads it; throws an Error that names what is wrong. */
307
- normalize?(value: string): string;
308
- }
309
-
310
- export interface PaneQuickSettingDef {
311
- type: "toggle";
312
- key: string;
313
- icon: "zap" | "sqrt";
314
- label?: string;
315
- /**
316
- * For a two-option select field: the option the control turns on. Turning
317
- * it off picks the field's other option.
318
- */
319
- onValue?: string;
320
- /**
321
- * Shows the control only where it changes something, for a setting that
322
- * applies to some of what the pane can show. The field stays in the
323
- * settings dialog either way.
324
- */
325
- visible?: (context: PaneSettingsContext) => boolean;
326
- }
327
-
328
- export interface PaneSettingsContext {
329
- config: AppConfig;
330
- layout: LayoutConfig;
331
- paneId: string;
332
- paneType: string;
333
- pane: PaneInstanceConfig;
334
- settings: Record<string, unknown>;
335
- paneState: Record<string, unknown>;
336
- activeTicker: string | null;
337
- activeCollectionId: string | null;
338
- }
339
-
340
- /** What `PaneDef.personalData` decides from: the pane's settings context and the tickers with their positions. */
341
- export interface PanePersonalDataContext extends PaneSettingsContext {
342
- tickers: ReadonlyMap<string, TickerRecord>;
343
- }
344
-
345
- export interface PaneSettingOption {
346
- value: string;
347
- label: string;
348
- description?: string;
349
- }
350
-
351
- interface PaneSettingFieldBase {
352
- key: string;
353
- label: string;
354
- description?: string;
355
- storage?: "pane" | "plugin";
356
- /** Keys in the same storage scope that should be reset when this value changes. */
357
- clearOnChange?: string[];
358
- }
359
-
360
- interface PaneSettingToggleField extends PaneSettingFieldBase {
361
- type: "toggle";
362
- }
363
-
364
- export interface PaneSettingTextField extends PaneSettingFieldBase {
365
- type: "text";
366
- placeholder?: string;
367
- }
368
-
369
- interface PaneSettingSelectField extends PaneSettingFieldBase {
370
- type: "select";
371
- options: PaneSettingOption[];
372
- }
373
-
374
- interface PaneSettingMultiSelectField extends PaneSettingFieldBase {
375
- type: "multi-select";
376
- options: PaneSettingOption[];
377
- /** A long list: a filter box, each description beside its label. */
378
- searchable?: boolean;
379
- }
380
-
381
- interface PaneSettingOrderedMultiSelectField extends PaneSettingFieldBase {
382
- type: "ordered-multi-select";
383
- options: PaneSettingOption[];
384
- /** A long list: a filter box, each description beside its label and each selection's position. */
385
- searchable?: boolean;
386
- }
387
-
388
- /** What an action row says of its own action (docs/pane-conventions.md, "Row messages"). */
389
- export interface PaneSettingRowNote {
390
- /** A short state, where the row's action label is: `Connecting…`, `Sign-in failed`. */
391
- status: string;
392
- /** The full reason or the next step, in place of the row's description. */
393
- text?: string;
394
- tone: "warning" | "negative";
395
- }
396
-
397
- export interface PaneSettingActionContext extends PaneSettingsContext {
398
- surface: "pane-dialog" | "command-bar";
399
- close(): void;
400
- openCommandBar(query?: string): void;
401
- notify(notification: AppNotificationRequest): void;
402
- /**
403
- * Says on the row the action runs from what it is doing or what stopped it,
404
- * or clears that with null. A success the row's own description and label
405
- * show once they change needs no note. False once the row is off screen
406
- * (the dialog closed, or the action removed its own field): say it with
407
- * `notify` then, as a row that has left a list is a toast. Older hosts do
408
- * not pass it.
409
- */
410
- setRowNote?(note: PaneSettingRowNote | null): boolean;
411
- }
412
-
413
- export type PaneSettingActionHandler = (
414
- context: PaneSettingActionContext,
415
- ) => void | Promise<void>;
416
-
417
- export type PaneSettingActionField = Omit<PaneSettingFieldBase, "storage" | "clearOnChange"> & {
418
- type: "action";
419
- actionId: string;
420
- actionLabel?: string;
421
- disabled?: boolean;
422
- action: PaneSettingActionHandler;
423
- };
424
-
425
- export type PaneSettingField =
426
- | PaneSettingToggleField
427
- | PaneSettingTextField
428
- | PaneSettingSelectField
429
- | PaneSettingMultiSelectField
430
- | PaneSettingOrderedMultiSelectField
431
- | PaneSettingActionField;
432
-
433
- export interface PaneSettingsDef {
434
- title?: string;
435
- values?: Record<string, unknown>;
436
- fields: PaneSettingField[];
437
- applyValue?: (
438
- settings: Record<string, unknown>,
439
- field: PaneSettingField,
440
- value: unknown,
441
- context: PaneSettingsContext,
442
- ) => Record<string, unknown> | Promise<Record<string, unknown>>;
443
- }
444
-
445
- export interface PaneTemplateContext {
446
- config: AppConfig;
447
- layout: LayoutConfig;
448
- focusedPaneId: string | null;
449
- activeTicker: string | null;
450
- activeInstrument?: BrokerContractRef | null;
451
- activeListing?: TickerListingRef;
452
- activeCollectionId: string | null;
453
- }
454
-
455
- /** One value a shortcut argument accepts: `value` is typed after the prefix, `label` says what it is. */
456
- export interface ShortcutArgOption {
457
- value: string;
458
- label: string;
459
- }
460
-
461
- /** Why a typed argument opens nothing: the row's text, and the line under it saying what to type instead. */
462
- export interface ShortcutArgError {
463
- message: string;
464
- detail?: string;
465
- }
466
-
467
- interface PaneTemplateShortcut {
468
- prefix: string;
469
- /** Other mnemonics for the same view (FFIP for WIRP). They open it when typed but are not listed as separate rows. */
470
- aliases?: readonly string[];
471
- /** Keep this shortcut executable when typed, but omit its pane from command-bar browse rows. Defaults to true. */
472
- showInBrowse?: boolean;
473
- /**
474
- * What the shortcut takes after the prefix. Left out, it takes the argument
475
- * the template's `headless` definition declares, as `gloom catalog` lists it.
476
- */
477
- argPlaceholder?: string;
478
- argKind?: "text" | "ticker" | "ticker-list";
479
- /**
480
- * For a ticker list, entries kept as typed instead of resolved as tickers:
481
- * CORR keeps map series (`GEO:HORMUZ`) beside its tickers.
482
- */
483
- keepArgToken?: (token: string) => boolean;
484
- argOptional?: boolean;
485
- /**
486
- * The argument is a company the function reports on (CDS, TRACE): with
487
- * none typed, the command bar opens it on the ticker in focus, and with no
488
- * ticker in focus market-wide. `<ticker> <code>` opens it too.
489
- */
490
- focusedIssuer?: boolean;
491
- /**
492
- * With no argument typed and none to infer from the active ticker, open
493
- * the pane without one instead of asking for it (ERN alone is the market
494
- * board). Without it an optional argument still falls back to the form.
495
- */
496
- openWithoutArg?: boolean;
497
- /**
498
- * Named values the argument accepts, for an argument mostly drawn from a
499
- * small set (a statistic, a futures root). The command-bar assistant picks
500
- * from it instead of guessing the text; the command may accept others too.
501
- */
502
- argOptions?: () => readonly ShortcutArgOption[];
503
- /**
504
- * Why a typed argument opens nothing, or null when it opens the view:
505
- * `PF Nope` names no portfolio or watchlist. The command bar shows it in
506
- * place of the function's row, and the pane does not open for it.
507
- */
508
- argError?: (arg: string, context: PaneTemplateContext) => ShortcutArgError | null;
509
- }
510
-
511
- export interface PaneTemplateCreateOptions {
512
- arg?: string;
513
- values?: Record<string, string>;
514
- symbol?: string | null;
515
- symbols?: string[] | null;
516
- ticker?: TickerRecord | null;
517
- searchResult?: InstrumentSearchResult | null;
518
- instrument?: BrokerContractRef | null;
519
- listing?: TickerListingRef;
520
- /** Template-owned, validated data restored from a public pane share. */
521
- shareData?: unknown;
522
- }
523
-
524
- export interface PaneTemplateInstanceConfig {
525
- instanceId?: string;
526
- title?: string;
527
- binding?: PaneBinding;
528
- params?: Record<string, string>;
529
- settings?: Record<string, unknown>;
530
- placement?: "default" | "docked" | "floating";
531
- relativeToPaneId?: string;
532
- relativePosition?: "left" | "right" | "above" | "below";
533
- }
534
-
535
- export interface PaneTemplatePublicShareContext {
536
- pane: PaneInstanceConfig;
537
- paneState: Record<string, unknown>;
538
- }
539
-
540
- export interface PaneTemplatePublicShareSnapshot {
541
- title: string;
542
- description?: string;
543
- data: Record<string, unknown>;
544
- }
545
-
546
- export interface PaneTemplatePublicShareDef {
547
- serialize(context: PaneTemplatePublicShareContext): PaneTemplatePublicShareSnapshot | null;
548
- restore(data: Record<string, unknown>): PaneTemplateCreateOptions | null;
549
- }
550
-
551
- export interface PaneTemplateDef {
552
- id: string;
553
- paneId: string;
554
- label: string;
555
- description: string;
556
- keywords?: string[];
557
- shortcut?: PaneTemplateShortcut;
558
- /**
559
- * False leaves the function out of every list and search of functions
560
- * (command-bar browse, search and assistant, Help, `gloom catalog` and
561
- * search, the plugin directory, chat suggestions) while typing its code
562
- * still opens it, `fn` and `shot` still run it and its help still answers.
563
- * ATTN until it publishes (attention/listing.ts).
564
- */
565
- listed?: boolean;
566
- /** Template-specific headless model. Takes precedence over the pane-level model. */
567
- headless?: HeadlessPaneDefinition;
568
- /**
569
- * A one-ticker template whose pane also opens on several at once (DVD's
570
- * ranking): `fn` and `shot` pass a typed list (`shot DVD KO JNJ`) to
571
- * createInstance as `symbols`. Any other one-ticker template gets the list
572
- * as it always has, in `symbol` and `arg`.
573
- */
574
- opensTickerList?: boolean;
575
- /**
576
- * Source and status of the view this template opens, for a template that
577
- * opens one view of a pane hosting several (Fixed Income's Issuer Debt).
578
- * Captures and rendered-view reports merge it over the pane's own
579
- * `reportFreshness`: each field set here wins, the rest are the pane's. So
580
- * they date the filings on screen, not the issuer's stock quote.
581
- */
582
- reportFreshness?: Pick<HeadlessPaneFreshness, "source" | "status" | "basis" | "local">;
583
- wizard?: WizardStep[];
584
- canCreate?: (context: PaneTemplateContext, options?: PaneTemplateCreateOptions) => boolean;
585
- /**
586
- * Settings shown by catalog discovery without running createInstance. Supply
587
- * these when opening a pane needs live data or has side effects. An empty
588
- * object means there are no settings to describe before the pane is opened.
589
- * When omitted, discovery derives settings from createInstance as before.
590
- */
591
- catalogSettings?: Record<string, unknown>;
592
- createInstance?: (
593
- context: PaneTemplateContext,
594
- options?: PaneTemplateCreateOptions,
595
- ) => PaneTemplateInstanceConfig | null | Promise<PaneTemplateInstanceConfig | null>;
596
- /** Legacy v1 restoration or an explicit transformed snapshot; normal pane shares use portableShare. */
597
- publicShare?: PaneTemplatePublicShareDef;
598
- }
599
-
600
- export interface WizardStep {
601
- key: string;
602
- label: string;
603
- placeholder?: string;
604
- defaultValue?: string;
605
- required?: boolean;
606
- type?: "text" | "password" | "info" | "select" | "number" | "textarea";
607
- options?: Array<{ label: string; value: string }>;
608
- /** Shown only while the earlier answer holds the value; with several, while every one does. */
609
- dependsOn?: { key: string; value: string } | ReadonlyArray<{ key: string; value: string }>;
610
- /** Later wizard values to clear when this selection changes from its default. */
611
- clearOnChange?: string[];
612
- body?: string[];
613
- }
614
-
615
- export interface CommandShortcutArgContext {
616
- activeTicker: string | null;
617
- }
618
-
619
- interface CommandShortcutArgDef {
620
- placeholder?: string;
621
- kind?: "text" | "ticker" | "ticker-list";
622
- parse?: (
623
- arg: string,
624
- context: CommandShortcutArgContext,
625
- ) => Record<string, string>;
626
- }
627
-
628
- export interface CommandResultDef {
629
- id: string;
630
- label: string;
631
- detail?: string;
632
- category?: string;
633
- /** Short tag drawn left of the label, as on a search provider's row. Six characters at most. */
634
- badge?: string;
635
- /** Drawn muted after the label, e.g. a person's full name after their @username. */
636
- name?: string;
637
- right?: string;
638
- keywords?: string[];
639
- current?: boolean;
640
- disabled?: boolean;
641
- execute: () => void | Promise<void>;
642
- }
643
-
644
- export interface CommandBarResultLineSegment {
645
- text: string;
646
- emphasis?: "match" | "muted";
647
- }
648
-
649
- export interface CommandBarResultLine {
650
- segments: CommandBarResultLineSegment[];
651
- }
652
-
653
- export interface CommandBarResultDef {
654
- id: string;
655
- label: string;
656
- detail?: string;
657
- /** Rendered under the label. Each entry is one additional row. */
658
- lines?: CommandBarResultLine[];
659
- category?: string;
660
- /** Short tag drawn left of the label, e.g. a document type. Six characters at most. */
661
- badge?: string;
662
- /** Drawn muted after the label, e.g. a person's full name after their @username. */
663
- name?: string;
664
- right?: string;
665
- keywords?: string[];
666
- disabled?: boolean;
667
- execute: () => void | Promise<void>;
668
- }
669
-
670
- export interface CommandBarSearchContext {
671
- activeTicker: string | null;
672
- activeCollectionId: string | null;
673
- }
674
-
675
- export interface CommandBarSearchProvider {
676
- id: string;
677
- /** Section heading for these rows, e.g. "Documents". */
678
- category: string;
679
- /** Sort position of the section. Higher sinks. Navigation sections are negative; use a positive value to sit below them. */
680
- priority?: number;
681
- /** Skip the provider below this length. Default 3. */
682
- minQueryLength?: number;
683
- /** Default 300. Ignored by `match`. */
684
- debounceMs?: number;
685
- /**
686
- * How long `provide` may take once it starts, in ms. Default 8000. Past it
687
- * the bar aborts `signal`, drops a late answer and stops showing Searching.
688
- * Ignored by `match`.
689
- */
690
- timeoutMs?: number;
691
- /**
692
- * Codes (`CHAT`) after which the provider is still asked, typed alone or
693
- * with text after them, with the whole query. Every other provider stays
694
- * quiet once a code claims the text.
695
- */
696
- shortcuts?: readonly string[];
697
- provide(
698
- query: string,
699
- context: CommandBarSearchContext,
700
- signal: AbortSignal,
701
- ): Promise<CommandBarResultDef[]>;
702
- /**
703
- * Rows from what the app already holds in memory. When set, the bar calls
704
- * this instead of `provide`, as it renders and on every keystroke, so it
705
- * must be cheap: no request, no waiting. Its rows are ranked with the bar's
706
- * own matches as they are typed and sit under Suggested in the empty bar.
707
- * Keep `provide` answering the same rows for older versions of the app.
708
- */
709
- match?(query: string, context: CommandBarSearchContext): CommandBarResultDef[];
710
- }
711
-
712
- interface CliHelpColumn {
713
- header: string;
714
- align?: "left" | "right" | "center";
715
- width?: number;
716
- }
717
-
718
- interface CliCommandHelpSection {
719
- title: string;
720
- columns?: CliHelpColumn[];
721
- rows?: string[][];
722
- lines?: string[];
723
- }
724
-
725
- interface CliCommandHelpOption {
726
- /** Flag spelling with its value, e.g. `--range <range>`. */
727
- flags: string;
728
- description: string;
729
- }
730
-
731
- interface CliCommandHelp {
732
- /** Heading `gloom help` lists the command under. Plugin commands without one share a plugin heading. */
733
- group?: string;
734
- /** Invocations without the leading `gloomberb`, e.g. `quote <symbol...>`. */
735
- usage?: string[];
736
- options?: CliCommandHelpOption[];
737
- /** Complete invocations without the leading `gloomberb`. */
738
- examples?: string[];
739
- /** Extra blocks shown only in the command's own help (`gloom help <command>`). */
740
- sections?: CliCommandHelpSection[];
741
- }
742
-
743
- interface CliLaunchEnvironment {
744
- terminalWidth: number;
745
- terminalHeight: number;
746
- }
747
-
748
- /**
749
- * The resume state the app writes at exit and reads at startup. A plugin whose
750
- * CLI command launches the UI seeds it so the pane opens on what was asked for
751
- * rather than on what the last session left behind.
752
- */
753
- export type { AppSessionSnapshot } from "../core/state/session-persistence";
754
-
755
- export interface CliLaunchConfigResult<TLaunchState = unknown> {
756
- config: AppConfig;
757
- launchState?: TLaunchState;
758
- }
759
-
760
- export interface CliLaunchRequest<TLaunchState = unknown> {
761
- applyConfig(config: AppConfig, env: CliLaunchEnvironment): CliLaunchConfigResult<TLaunchState>;
762
- applySessionSnapshot?(
763
- config: AppConfig,
764
- snapshot: import("../core/state/session-persistence").AppSessionSnapshot | null,
765
- launchState: TLaunchState | undefined,
766
- ): import("../core/state/session-persistence").AppSessionSnapshot;
767
- }
768
-
769
- export type CliDispatchResult =
770
- | { kind: "handled" }
771
- | { kind: "launch-ui"; request: CliLaunchRequest }
772
- | { kind: "unhandled" };
773
-
774
- export interface CliCommandContext {
775
- initConfigData(): Promise<import("../cli/types").ConfigContext>;
776
- initMarketData(): Promise<import("../cli/types").MarketContext>;
777
- initServices(): Promise<import("../cli/types").CliServicesContext>;
778
- cliOptions: CliGlobalOptions;
779
- plugins: GloomPlugin[];
780
- fail(message: string, details?: string): never;
781
- closeAndFail(
782
- persistence: import("../data/app-persistence").AppPersistence,
783
- message: string,
784
- details?: string,
785
- ): never;
786
- output: {
787
- cliStyles: typeof import("../utils/cli-output").cliStyles;
788
- colorBySign: typeof import("../utils/cli-output").colorBySign;
789
- renderSection: typeof import("../utils/cli-output").renderSection;
790
- renderStat: typeof import("../utils/cli-output").renderStat;
791
- renderStats: typeof import("../utils/cli-output").renderStats;
792
- renderTable: typeof import("../utils/cli-output").renderTable;
793
- };
794
- printResult<T, Row extends Record<string, unknown> = Record<string, unknown>>(
795
- result: CliResult<T>,
796
- options?: CliResultRenderOptions<T, Row>,
797
- ): void;
798
- log: PluginLogger;
799
- }
800
-
801
- export interface CliCommandDef {
802
- name: string;
803
- aliases?: string[];
804
- description: string;
805
- help?: CliCommandHelp;
806
- execute(args: string[], ctx: CliCommandContext): void | CliDispatchResult | Promise<void | CliDispatchResult>;
807
- }
808
-
809
- export interface CommandDef {
810
- id: string;
811
- label: string;
812
- keywords: string[];
813
- shortcut?: string;
814
- shortcutArg?: CommandShortcutArgDef;
815
- buildResults?: (arg: string) => CommandResultDef[];
816
- execute: (values?: Record<string, string>) => void | Promise<void>;
817
- category: "navigation" | "data" | "portfolio" | "config";
818
- description?: string;
819
- wizard?: WizardStep[];
820
- confirm?: CommandConfirmDef | ((context: CommandConfirmContext) => CommandConfirmDef | null);
821
- /** @deprecated Ignored: a wizard always opens as one form with every step at once. */
822
- wizardLayout?: "steps" | "form";
823
- hidden?: () => boolean;
824
- }
825
-
826
- interface CommandConfirmContext {
827
- config: AppConfig;
828
- layout: LayoutConfig;
829
- activeTicker: string | null;
830
- activeCollectionId: string | null;
831
- }
832
-
833
- interface CommandConfirmDef {
834
- title: string;
835
- body: string[];
836
- confirmLabel?: string;
837
- cancelLabel?: string;
838
- tone?: "default" | "danger";
839
- }
840
-
841
- export interface CustomColumnDef extends ColumnConfig {
842
- render: (ticker: TickerRecord, financials: TickerFinancials | null) => string;
843
- }
844
-
845
- export interface TickerResearchTabProps {
846
- width: number;
847
- height: number;
848
- focused: boolean;
849
- onCapture: (capturing: boolean) => void;
850
- }
851
-
852
- interface TickerResearchTabVisibilityContext {
853
- config: AppConfig;
854
- ticker: TickerRecord | null;
855
- financials: TickerFinancials | null | undefined;
856
- hasOptionsChain: boolean;
857
- /** Resolved from the quote, broker contract and saved type; `equity` when nothing says otherwise. */
858
- instrumentKind: TickerInstrumentKind;
859
- }
860
-
861
- export interface TickerResearchTabDef {
862
- id: string;
863
- name: string;
864
- order: number;
865
- component: (props: TickerResearchTabProps) => ReactNode;
866
- /**
867
- * Instrument kinds this tab has data for, such as `["equity"]` for company
868
- * filings. Omit when every ticker has it (chart, news, notes).
869
- */
870
- instruments?: readonly TickerInstrumentKind[];
871
- /** Narrower checks than `instruments`: a US listing, an options chain, a connected broker. */
872
- isVisible?: (context: TickerResearchTabVisibilityContext) => boolean;
873
- }
874
-
875
- export interface KeyboardShortcut {
876
- id: string;
877
- key: string;
878
- ctrl?: boolean;
879
- shift?: boolean;
880
- description: string;
881
- execute: () => void;
882
- }
883
-
884
- export interface TickerAction {
885
- id: string;
886
- label: string;
887
- keywords: string[];
888
- filter?: (ticker: TickerRecord) => boolean;
889
- execute: (ticker: TickerRecord, financials: TickerFinancials | null) => void | Promise<void>;
890
- }
891
-
892
- export interface ContextMenuProviderDef {
893
- id: string;
894
- order?: number;
895
- contexts?: ContextMenuContext["kind"][];
896
- getItems(context: ContextMenuContext): ContextMenuItem[] | null | undefined;
897
- }
898
-
899
- export interface PluginPersistence {
900
- getState<T = unknown>(key: string, options?: { schemaVersion?: number }): T | null;
901
- setState(key: string, value: unknown, options?: { schemaVersion?: number }): void;
902
- deleteState(key: string): void;
903
- getResource<T = unknown>(
904
- kind: string,
905
- key: string,
906
- options?: { sourceKey?: string; schemaVersion?: number; allowExpired?: boolean },
907
- ): PersistedResourceValue<T> | null;
908
- setResource<T = unknown>(
909
- kind: string,
910
- key: string,
911
- value: T,
912
- options: {
913
- cachePolicy: CachePolicy;
914
- sourceKey?: string;
915
- schemaVersion?: number;
916
- provenance?: unknown;
917
- },
918
- ): PersistedResourceValue<T>;
919
- deleteResource(kind: string, key: string, options?: { sourceKey?: string }): void;
920
- }
921
-
922
- export interface PluginResumeState {
923
- getState<T = unknown>(key: string, options?: { schemaVersion?: number }): T | null;
924
- setState(key: string, value: unknown, options?: { schemaVersion?: number }): void;
925
- deleteState(key: string): void;
926
- getPaneState<T = unknown>(paneId: string, key: string): T | null;
927
- setPaneState(paneId: string, key: string, value: unknown): void;
928
- deletePaneState(paneId: string, key: string): void;
929
- }
930
-
931
- export interface PluginConfigState {
932
- get<T = unknown>(key: string): T | null;
933
- set(key: string, value: unknown): Promise<void>;
934
- delete(key: string): Promise<void>;
935
- keys(): string[];
936
- }
937
-
938
- export interface PluginTeamStateEntry<T> {
939
- value: T;
940
- revision: number;
941
- updatedBy: string;
942
- updatedAt: string;
943
- }
944
-
945
- /**
946
- * Plugin-owned data shared with a team, keyed per plugin. Writes take the
947
- * revision they expect and fail when a teammate wrote first, so nothing is
948
- * overwritten silently. Scoped to the active team unless a teamId is given.
949
- */
950
- export interface PluginTeamState {
951
- activeTeamId(): string | null;
952
- get<T>(key: string, options?: { teamId?: string }): Promise<PluginTeamStateEntry<T> | null>;
953
- list<T>(options?: { teamId?: string }): Promise<Array<PluginTeamStateEntry<T> & { key: string }>>;
954
- set<T>(key: string, value: T, options?: { teamId?: string; expectRevision?: number }): Promise<{ revision: number }>;
955
- delete(key: string, options?: { teamId?: string }): Promise<void>;
956
- subscribe<T>(
957
- key: string,
958
- listener: (entry: PluginTeamStateEntry<T> | null) => void,
959
- options?: { teamId?: string },
960
- ): () => void;
961
- }
962
-
963
- export interface PluginPaneSettingsState {
964
- get<T = unknown>(paneId: string, key: string): T | null;
965
- set(paneId: string, key: string, value: unknown): Promise<void>;
966
- delete(paneId: string, key: string): Promise<void>;
967
- }
968
-
969
- export type AppNotificationType = "info" | "success" | "error";
970
- type AppDesktopNotificationMode = "never" | "when-inactive" | "always";
971
-
972
- export interface AppNotificationDelivery {
973
- toastVisible: boolean;
974
- desktopRequested: boolean;
975
- }
976
-
977
- export interface AppNotificationRequest {
978
- title?: string;
979
- body: string;
980
- subtitle?: string;
981
- duration?: number;
982
- type?: AppNotificationType;
983
- toast?: boolean;
984
- /** If true, in-app toast stays visible until user dismisses it */
985
- persistent?: boolean;
986
- desktop?: AppDesktopNotificationMode;
987
- /** macOS sound name (e.g., "Glass", "Ping", "Hero"). Ignored on other platforms. */
988
- sound?: string;
989
- action?: {
990
- label: string;
991
- onClick: () => void;
992
- };
993
- /**
994
- * What a built-in notice is about, so the Unread list can keep it after the
995
- * toast is gone and open it again: `price:<alertId>`, `catalyst:<eventId>`,
996
- * `econ:<eventId>`, `team:<cardId>` or `scan:<paneId>`. Other values are not kept.
997
- */
998
- refId?: string;
999
- /** Rendered next to `action`. Use for a dismissing counterpart such as snooze. */
1000
- secondaryAction?: {
1001
- label: string;
1002
- onClick: () => void;
1003
- };
1004
- /** Runs once, when the in-app toast is first drawn. Not called when `toast` is false. */
1005
- onShown?: () => void;
1006
- }
1007
-
1008
- export interface BrokerInstanceUpdateOptions {
1009
- label?: string;
1010
- enabled?: boolean;
1011
- replaceConfig?: boolean;
1012
- /** Keep this connection's data on this device, out of Gloom Cloud sync (`BrokerInstanceConfig.localOnly`). */
1013
- localOnly?: boolean;
1014
- }
1015
-
1016
- export interface BrokerInstanceCreateOptions {
1017
- /** Keep the new connection's data on this device from the start, before its first import. */
1018
- localOnly?: boolean;
1019
- }
1020
-
1021
- export interface PinTickerOptions {
1022
- floating?: boolean;
1023
- paneType?: string;
1024
- forceNewPane?: boolean;
1025
- /** Preserve a contract explicitly selected from instrument search. */
1026
- instrument?: BrokerContractRef | null;
1027
- listing?: TickerListingRef;
1028
- /** Select this research tab once the requested ticker has resolved. */
1029
- tabId?: string;
1030
- /** Merge this state into the resolved research pane when selecting `tabId`. */
1031
- tabState?: Record<string, unknown>;
1032
- }
1033
-
1034
- export interface GloomPluginContext {
1035
- registerPane(pane: PaneDef): void;
1036
- /** Returns a disposer; templates added after setup (team views) use it. */
1037
- registerPaneTemplate(template: PaneTemplateDef): () => void;
1038
- registerCommand(command: CommandDef): void;
1039
- registerCommandBarSearchProvider(provider: CommandBarSearchProvider): () => void;
1040
- registerColumn(column: CustomColumnDef): void;
1041
- registerBroker(broker: BrokerAdapter): void;
1042
- registerCapability(capability: PluginCapability): void;
1043
- registerTickerResearchTab(tab: TickerResearchTabDef): void;
1044
- registerShortcut(shortcut: KeyboardShortcut): void;
1045
- registerTickerAction(action: TickerAction): void;
1046
- registerContextMenuProvider(provider: ContextMenuProviderDef): void;
1047
- /**
1048
- * Adds a series to the data catalog and the chart composer, at any time
1049
- * after setup starts (after loading a list, say). Throws when the definition
1050
- * is invalid or its id is taken; the returned function removes it again.
1051
- */
1052
- registerSeries(series: SeriesDefinition): () => void;
1053
- registerSyncContributor(contributor: SyncContributor): () => void;
1054
- registerSyncTransport(transport: SyncTransport): () => void;
1055
- watchNewsQuery?(
1056
- query: import("./news-source").NewsQuery,
1057
- listener: (state: import("./news-source").NewsQueryState) => void,
1058
- ): () => void;
1059
-
1060
- getData(ticker: string): TickerFinancials | null;
1061
- getTicker(ticker: string): TickerRecord | null;
1062
- getConfig(): import("./config").AppConfig;
1063
- /** Resolve a broker registered by another plugin, without connecting it. */
1064
- getBrokerAdapter?(brokerType: string): BrokerAdapter | null;
1065
- getPaneDef(paneId: string): PaneDef | undefined;
1066
-
1067
- readonly marketData: DataProvider;
1068
- readonly connectionHealth: ConnectionHealthRegistry;
1069
- readonly tickerRepository: AppTickerRepositoryPort;
1070
- readonly persistence: PluginPersistence;
1071
- readonly log: PluginLogger;
1072
- readonly resume: PluginResumeState;
1073
- readonly configState: PluginConfigState;
1074
- readonly paneSettings: PluginPaneSettingsState;
1075
- readonly teamState: PluginTeamState;
1076
-
1077
- createBrokerInstance(brokerType: string, label: string, values: Record<string, unknown>, options?: BrokerInstanceCreateOptions): Promise<BrokerInstanceConfig>;
1078
- updateBrokerInstance(instanceId: string, values: Record<string, unknown>, options?: BrokerInstanceUpdateOptions): Promise<void>;
1079
- syncBrokerInstance(instanceId: string): Promise<void>;
1080
- removeBrokerInstance(instanceId: string): Promise<void>;
1081
-
1082
- selectTicker(symbol: string, paneId?: string): void;
1083
- /** Focus the leftmost or rightmost docked pane. */
1084
- switchPanel(panel: "left" | "right"): void;
1085
- switchTab(tabId: string, paneId?: string): void;
1086
- openCommandBar(query?: string): void;
1087
- showPane(paneId: string): void;
1088
- createPaneFromTemplate(templateId: string, options?: PaneTemplateCreateOptions): void;
1089
- hidePane(paneId: string): void;
1090
- focusPane(paneId: string): void;
1091
- pinTicker(symbol: string, options?: PinTickerOptions): void;
1092
- navigateTicker(symbol: string, options?: { sourcePaneId?: string | null }): void;
1093
- openPaneSettings(paneId?: string): void;
1094
- /** Shares a pane instance (the focused pane when omitted): copies a live link to it. */
1095
- sharePane(paneId?: string): void;
1096
-
1097
- on<K extends keyof PluginEvents>(event: K, handler: (payload: PluginEvents[K]) => void): () => void;
1098
- emit<K extends keyof PluginEvents>(event: K, payload: PluginEvents[K]): void;
1099
-
1100
- notify(notification: AppNotificationRequest): AppNotificationDelivery | void;
1101
- }
1102
-
1103
- /**
1104
- * Where a plugin can actually run.
1105
- *
1106
- * `cli` and `tui` run in Bun and may use Node APIs. `desktop` runs in the
1107
- * Electrobun view. `web` runs in the browser at term.gloom.sh, which rules out
1108
- * Node builtins entirely — a plugin opening a TCP socket (IBKR Gateway) can
1109
- * never be web-capable, no matter what it declares.
1110
- *
1111
- * Plugins may declare this, but the registry derives it from a static import
1112
- * scan and overwrites the declaration. Treat an author-supplied value as a hint.
1113
- */
1114
- export type PluginTarget = "cli" | "tui" | "desktop" | "web";
1115
-
1116
- export const ALL_PLUGIN_TARGETS: readonly PluginTarget[] = ["cli", "tui", "desktop", "web"];
1117
-
1118
- /**
1119
- * One setting a plugin needs from the user before it is useful, such as an API
1120
- * key. Values are stored in the plugin's `configState` under `key`.
1121
- */
1122
- export interface PluginConfigField {
1123
- key: string;
1124
- label: string;
1125
- type?: "text" | "password" | "number" | "select";
1126
- /** Shown under the field. Say where to get the value, not what the plugin does. */
1127
- description?: string;
1128
- placeholder?: string;
1129
- defaultValue?: string;
1130
- /** The plugin counts as "needs setup" while a required field is empty. Default true. */
1131
- required?: boolean;
1132
- options?: Array<{ label: string; value: string }>;
1133
- }
1134
-
1135
- export interface GloomPlugin {
1136
- id: string;
1137
- /**
1138
- * Where this plugin's saved state lives: its `pluginConfig` entry, its resume
1139
- * state, and the per-pane state its panes write. Defaults to `id`.
1140
- *
1141
- * Set it when a plugin is renamed, or moves out of this repository under a
1142
- * new id, so the threads, tabs, and defaults a user already has stay theirs.
1143
- * Everything else (the toggle, the marketplace, seeding) keys off `id`.
1144
- */
1145
- stateId?: string;
1146
- name: string;
1147
- version: string;
1148
- description?: string;
1149
- toggleable?: boolean;
1150
- order?: number;
1151
- cliCommands?: CliCommandDef[];
1152
- /** Defaults to every target when omitted. */
1153
- targets?: readonly PluginTarget[];
1154
- /**
1155
- * Third-party hosts the plugin fetches from, as bare domains
1156
- * (`"api.example.com"`; a parent domain also covers its subdomains).
1157
- *
1158
- * Terminal and desktop reach anything, so this is informational there and
1159
- * is what the plugin directory shows under "Network access". On the web the
1160
- * browser cannot call a host that sends no CORS headers, so the hosted app
1161
- * proxies exactly the hosts the bundled plugins declare here and refuses
1162
- * the rest. A plugin that leaves a host out works on the desktop and fails
1163
- * on the web.
1164
- *
1165
- * Hosts reached by a plugin's dependencies count too: declare every host
1166
- * contacted on the plugin's behalf, including authentication endpoints.
1167
- */
1168
- hosts?: readonly string[];
1169
- /** Shown in the marketplace pane and on the website. */
1170
- homepage?: string;
1171
- /**
1172
- * Settings the plugin cannot work without. Declaring them gives the plugin a
1173
- * "Set up <name>" command, a form the marketplace opens from its `s` key, and
1174
- * a `needs setup` status until every required field has a value. Read the
1175
- * values back with `ctx.configState.get(key)`.
1176
- */
1177
- configSchema?: PluginConfigField[];
1178
- /**
1179
- * Overrides the default readiness rule (every required `configSchema` field
1180
- * has a value) for plugins whose setup is not a plain form, such as a broker
1181
- * login or a file that must exist.
1182
- */
1183
- isConfigured?(values: Record<string, unknown>): boolean;
1184
-
1185
- setup?(ctx: GloomPluginContext): void | Promise<void>;
1186
- dispose?(): void;
1187
-
1188
- panes?: PaneDef[];
1189
- paneTemplates?: PaneTemplateDef[];
1190
- broker?: BrokerAdapter;
1191
- capabilities?: PluginCapability[];
1192
- /**
1193
- * Series the plugin adds to the data catalog, chartable against any other
1194
- * catalog entry. A definition that fails validation is skipped and logged;
1195
- * `ctx.registerSeries` adds series later and throws instead.
1196
- */
1197
- series?: readonly SeriesDefinition[];
1198
- slots?: Partial<{
1199
- [K in keyof GloomSlots]: (props: GloomSlots[K]) => ReactNode;
1200
- }>;
1201
- }
35
+ export { ALL_PLUGIN_TARGETS } from "./plugin-definition";
36
+ export type * from "./plugin-commands";
37
+ export type * from "./plugin-context";
38
+ export type * from "./plugin-contributions";
39
+ export type * from "./plugin-definition";
40
+ export type * from "./plugin-notifications";
41
+ export type * from "./plugin-pane-settings";
42
+ export type * from "./plugin-pane-templates";
43
+ export type * from "./plugin-panes";
44
+ export type * from "./plugin-reports";
45
+ export type * from "./plugin-shared";
46
+ export type * from "./plugin-state";