gloomberb 0.15.7 → 0.16.0

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 (524) hide show
  1. package/README.md +11 -2
  2. package/package.json +1 -1
  3. package/src/api-client/app-attention.ts +147 -0
  4. package/src/api-client/attention.ts +26 -0
  5. package/src/api-client/awards.ts +215 -0
  6. package/src/api-client/catalysts.ts +160 -0
  7. package/src/api-client/chat.ts +137 -14
  8. package/src/api-client/company-kpis.ts +153 -0
  9. package/src/api-client/cpi.ts +52 -0
  10. package/src/api-client/credit-documents.ts +107 -0
  11. package/src/api-client/data.ts +192 -3
  12. package/src/api-client/distress.ts +164 -0
  13. package/src/api-client/doe.ts +75 -0
  14. package/src/api-client/equity-screener.ts +11 -0
  15. package/src/api-client/exposure.ts +202 -0
  16. package/src/api-client/gpu.ts +93 -0
  17. package/src/api-client/hiring.ts +110 -0
  18. package/src/api-client/index.ts +78 -3
  19. package/src/api-client/normalizers.ts +31 -1
  20. package/src/api-client/paths.ts +3 -0
  21. package/src/api-client/perps.ts +127 -0
  22. package/src/api-client/power.ts +148 -0
  23. package/src/api-client/request.ts +58 -1
  24. package/src/api-client/research-activity.ts +172 -13
  25. package/src/api-client/socket.ts +75 -27
  26. package/src/api-client/supply-chain-graph.ts +40 -0
  27. package/src/api-client/supply-chain.ts +98 -0
  28. package/src/api-client/telemetry.ts +29 -0
  29. package/src/api-client/themes.ts +28 -0
  30. package/src/api-client/types.ts +33 -1
  31. package/src/api-client/wall-experiments.ts +100 -0
  32. package/src/api-client/wall-summary.ts +49 -0
  33. package/src/api-client/web-experiments.ts +136 -0
  34. package/src/app/pane-runtime/plugin-bindings.ts +5 -0
  35. package/src/app/pane-runtime/ticker-open-runtime.ts +8 -2
  36. package/src/app/runtime/update.ts +13 -1
  37. package/src/cli/commands/system.ts +2 -0
  38. package/src/cli/desktop-pane-shot.ts +3 -4
  39. package/src/cli/pane-functions/data.ts +78 -0
  40. package/src/cli/pane-functions/financial-ratio-shot.ts +160 -0
  41. package/src/cli/pane-functions/function-help.ts +220 -8
  42. package/src/cli/pane-functions/headless.ts +4 -0
  43. package/src/cli/pane-functions/screenshot-evidence.ts +21 -0
  44. package/src/cli/pane-functions/screenshot.ts +49 -5
  45. package/src/components/chart/composite/composite-chart.tsx +15 -2
  46. package/src/components/chart/composite/format.ts +24 -11
  47. package/src/components/chart/composite/rasterizer.ts +67 -16
  48. package/src/components/chart/composite/scene.ts +53 -2
  49. package/src/components/chart/composite/session-shading.ts +3 -2
  50. package/src/components/chart/composite/text-renderer.ts +52 -1
  51. package/src/components/chart/composite/time-axis.ts +100 -30
  52. package/src/components/chart/composite/tools.ts +2 -1
  53. package/src/components/chart/composite/types.ts +4 -0
  54. package/src/components/chart-table/index.ts +1 -0
  55. package/src/components/chart-table/layout.ts +15 -0
  56. package/src/components/command-bar/action-runtime.ts +1 -0
  57. package/src/components/command-bar/commands/direct/index.ts +32 -0
  58. package/src/components/command-bar/commands/registry.ts +7 -0
  59. package/src/components/command-bar/pane-templates/items.ts +11 -0
  60. package/src/components/command-bar/pane-templates/workflow.ts +19 -4
  61. package/src/components/command-bar/routes/root/command-items.ts +6 -0
  62. package/src/components/command-bar/routes/root/provider-search.ts +2 -0
  63. package/src/components/command-bar/routes/root/results.ts +64 -0
  64. package/src/components/command-bar/routes/root/runtime.ts +8 -0
  65. package/src/components/command-bar/routes/ticker-search/results.ts +89 -24
  66. package/src/components/command-bar/routes/ticker-search/route.ts +2 -0
  67. package/src/components/command-bar/surface/index.tsx +15 -0
  68. package/src/components/command-bar/view-model.ts +3 -0
  69. package/src/components/command-bar/workflow/collection-actions.ts +9 -7
  70. package/src/components/command-bar/workflow/ops.ts +19 -0
  71. package/src/components/command-bar/workflow/tickers.ts +5 -0
  72. package/src/components/company-logo.tsx +15 -2
  73. package/src/components/data-table/table-pane.ts +2 -1
  74. package/src/components/index.ts +1 -0
  75. package/src/components/layout/detached-pane-shell.tsx +12 -1
  76. package/src/components/layout/missing-pane.tsx +87 -23
  77. package/src/components/layout/pane/footer/index.tsx +64 -18
  78. package/src/components/layout/pane/footer/model.ts +85 -0
  79. package/src/components/layout/pane/sidebar.tsx +19 -1
  80. package/src/components/layout/shell/index.tsx +38 -28
  81. package/src/components/layout/shell/pane/management-shortcuts.ts +13 -1
  82. package/src/components/layout/status-bar.tsx +93 -28
  83. package/src/components/layout/status-widget-space.ts +72 -0
  84. package/src/components/onboarding/first-run-workspace.ts +8 -2
  85. package/src/components/onboarding/onboarding-wizard.tsx +35 -16
  86. package/src/components/onboarding/portfolio-step/positions-panel.tsx +14 -5
  87. package/src/components/onboarding/wizard-model.ts +13 -5
  88. package/src/components/onboarding/wizard-positions.ts +56 -7
  89. package/src/components/price-performance.tsx +31 -34
  90. package/src/components/ui/data-table/index.tsx +11 -8
  91. package/src/components/ui/display.tsx +15 -6
  92. package/src/components/ui/fields.tsx +5 -0
  93. package/src/components/ui/figure.tsx +94 -0
  94. package/src/components/ui/header-case.ts +25 -3
  95. package/src/components/ui/icon.tsx +3 -1
  96. package/src/components/ui/message-composer.tsx +8 -1
  97. package/src/components/ui/query-bar.tsx +8 -1
  98. package/src/components/ui/ratio-bar.tsx +84 -0
  99. package/src/components/ui/toggle.tsx +3 -1
  100. package/src/components/use-scrollbox-layout.ts +17 -0
  101. package/src/core/state/app/layout.ts +35 -1
  102. package/src/core/state/app/state.ts +15 -0
  103. package/src/core/state/app/types.ts +1 -0
  104. package/src/data/config/store/normalize.ts +24 -0
  105. package/src/i18n/es.ts +2 -0
  106. package/src/i18n/ja.ts +2 -0
  107. package/src/i18n/ko.ts +2 -0
  108. package/src/i18n/zh-cn.ts +2 -0
  109. package/src/i18n/zh-tw.ts +2 -0
  110. package/src/layout-marketplace/pane-imagery.ts +1 -0
  111. package/src/market-data/coordinator/entries.ts +13 -0
  112. package/src/market-data/coordinator/financials.ts +33 -8
  113. package/src/market-data/market/freshness.ts +16 -5
  114. package/src/market-data/market/trading-sessions.ts +65 -1
  115. package/src/market-data/published-cn-sessions.ts +25 -0
  116. package/src/market-data/published-nse-sessions.ts +20 -0
  117. package/src/news/aggregator.ts +4 -0
  118. package/src/plugins/builtin/account-management/model.ts +6 -1
  119. package/src/plugins/builtin/account-management/pane.tsx +36 -25
  120. package/src/plugins/builtin/alerts/catalysts.ts +77 -0
  121. package/src/plugins/builtin/alerts/events-pane.tsx +3 -0
  122. package/src/plugins/builtin/alerts/events.ts +10 -4
  123. package/src/plugins/builtin/alerts/history-pane.tsx +1 -1
  124. package/src/plugins/builtin/alerts/history.ts +1 -0
  125. package/src/plugins/builtin/alerts/index.tsx +6 -0
  126. package/src/plugins/builtin/alerts/research-builder.ts +10 -3
  127. package/src/plugins/builtin/alerts/research-rules.ts +15 -1
  128. package/src/plugins/builtin/analytics/risk-client.ts +15 -3
  129. package/src/plugins/builtin/analytics/risk-headless.ts +123 -18
  130. package/src/plugins/builtin/attention/client.ts +80 -0
  131. package/src/plugins/builtin/attention/evidence.ts +30 -0
  132. package/src/plugins/builtin/attention/headless.ts +33 -0
  133. package/src/plugins/builtin/attention/index.tsx +18 -0
  134. package/src/plugins/builtin/attention/model.ts +59 -0
  135. package/src/plugins/builtin/attention/pane.tsx +211 -0
  136. package/src/plugins/builtin/attention/trending.tsx +59 -0
  137. package/src/plugins/builtin/awards/alerts.ts +32 -0
  138. package/src/plugins/builtin/awards/client.ts +82 -0
  139. package/src/plugins/builtin/awards/detail.tsx +107 -0
  140. package/src/plugins/builtin/awards/evidence.ts +36 -0
  141. package/src/plugins/builtin/awards/headless.ts +55 -0
  142. package/src/plugins/builtin/awards/index.tsx +20 -0
  143. package/src/plugins/builtin/awards/model.ts +42 -0
  144. package/src/plugins/builtin/awards/pane.tsx +263 -0
  145. package/src/plugins/builtin/catalysts/client.ts +28 -0
  146. package/src/plugins/builtin/catalysts/detail.tsx +88 -0
  147. package/src/plugins/builtin/catalysts/evidence.ts +47 -0
  148. package/src/plugins/builtin/catalysts/headless.ts +42 -0
  149. package/src/plugins/builtin/catalysts/history.ts +26 -0
  150. package/src/plugins/builtin/catalysts/index.tsx +29 -0
  151. package/src/plugins/builtin/catalysts/model.ts +135 -0
  152. package/src/plugins/builtin/catalysts/pane.tsx +159 -0
  153. package/src/plugins/builtin/chart-composer/cli-options.ts +4 -0
  154. package/src/plugins/builtin/chart-composer/headless-schema.ts +6 -0
  155. package/src/plugins/builtin/chart-composer/index.tsx +8 -1
  156. package/src/plugins/builtin/chart-composer/pane.tsx +28 -1
  157. package/src/plugins/builtin/chat/attachments/desktop.tsx +610 -0
  158. package/src/plugins/builtin/chat/attachments/files.ts +45 -0
  159. package/src/plugins/builtin/chat/attachments/model.ts +164 -0
  160. package/src/plugins/builtin/chat/attachments/terminal.tsx +72 -0
  161. package/src/plugins/builtin/chat/attachments/transfer.ts +165 -0
  162. package/src/plugins/builtin/chat/content/channel-navigation.ts +13 -12
  163. package/src/plugins/builtin/chat/content/composer-runtime.ts +25 -4
  164. package/src/plugins/builtin/chat/content/composer.tsx +46 -4
  165. package/src/plugins/builtin/chat/content/footer.tsx +46 -8
  166. package/src/plugins/builtin/chat/content/index.tsx +263 -62
  167. package/src/plugins/builtin/chat/content/layout-metrics.ts +10 -2
  168. package/src/plugins/builtin/chat/content/open-targets.ts +17 -3
  169. package/src/plugins/builtin/chat/content/scroll.ts +7 -1
  170. package/src/plugins/builtin/chat/content/shortcuts.ts +36 -11
  171. package/src/plugins/builtin/chat/content/snapshot.ts +3 -0
  172. package/src/plugins/builtin/chat/content/transcript.tsx +17 -1
  173. package/src/plugins/builtin/chat/content/types.ts +7 -0
  174. package/src/plugins/builtin/chat/controller/attachments.ts +213 -0
  175. package/src/plugins/builtin/chat/controller/connections.ts +3 -1
  176. package/src/plugins/builtin/chat/controller/index.ts +114 -2
  177. package/src/plugins/builtin/chat/controller/lifecycle.ts +9 -0
  178. package/src/plugins/builtin/chat/controller/messages.ts +35 -2
  179. package/src/plugins/builtin/chat/controller/send.ts +128 -25
  180. package/src/plugins/builtin/chat/controller/state.ts +12 -1
  181. package/src/plugins/builtin/chat/controller/utils.ts +7 -5
  182. package/src/plugins/builtin/chat/controller/view.ts +2 -0
  183. package/src/plugins/builtin/chat/index.tsx +21 -0
  184. package/src/plugins/builtin/chat/layout.ts +9 -4
  185. package/src/plugins/builtin/chat/message/desktop.tsx +55 -20
  186. package/src/plugins/builtin/chat/message/header.tsx +30 -5
  187. package/src/plugins/builtin/chat/message/inline-tokens.tsx +9 -0
  188. package/src/plugins/builtin/chat/message/pending-send.ts +35 -0
  189. package/src/plugins/builtin/chat/message/profile-popover.tsx +5 -1
  190. package/src/plugins/builtin/chat/message/render-state.ts +12 -2
  191. package/src/plugins/builtin/chat/message/terminal.tsx +51 -4
  192. package/src/plugins/builtin/chat/message/types.ts +6 -1
  193. package/src/plugins/builtin/chat/pane-state.ts +59 -1
  194. package/src/plugins/builtin/chat/profile-popover.ts +50 -1
  195. package/src/plugins/builtin/chat/sidebar.tsx +8 -3
  196. package/src/plugins/builtin/chat/status-widget.tsx +29 -12
  197. package/src/plugins/builtin/chat/unread-inbox-pane.tsx +143 -0
  198. package/src/plugins/builtin/chat/unread-inbox.ts +91 -0
  199. package/src/plugins/builtin/clinical-trials/client.ts +237 -0
  200. package/src/plugins/builtin/clinical-trials/index.tsx +74 -0
  201. package/src/plugins/builtin/clinical-trials/pane.tsx +225 -0
  202. package/src/plugins/builtin/clinical-trials/types.ts +2 -0
  203. package/src/plugins/builtin/cloud/askg/controller.ts +37 -6
  204. package/src/plugins/builtin/cloud/askg/executor.ts +59 -44
  205. package/src/plugins/builtin/cloud/askg/host.ts +8 -1
  206. package/src/plugins/builtin/cloud/askg/manifest.ts +29 -2
  207. package/src/plugins/builtin/cloud/askg/model.ts +47 -13
  208. package/src/plugins/builtin/cloud/askg/notes.ts +100 -0
  209. package/src/plugins/builtin/cloud/askg/pane.tsx +50 -14
  210. package/src/plugins/builtin/cloud/askg/protocol.ts +39 -1
  211. package/src/plugins/builtin/cloud/askg/result-budget.ts +156 -0
  212. package/src/plugins/builtin/cloud/askg/user-data.ts +89 -0
  213. package/src/plugins/builtin/cloud/auth-actions.tsx +55 -31
  214. package/src/plugins/builtin/cloud/plugin.tsx +4 -1
  215. package/src/plugins/builtin/cloud/team/pane-sections.tsx +10 -1
  216. package/src/plugins/builtin/cloud/team/pane.tsx +3 -2
  217. package/src/plugins/builtin/cloud/thesis/board-pane.tsx +2 -2
  218. package/src/plugins/builtin/cloud/thesis/detail.tsx +1 -1
  219. package/src/plugins/builtin/cloud/thesis/ticker-tab.tsx +2 -2
  220. package/src/plugins/builtin/cloud/trial-offer-status-widget.tsx +202 -0
  221. package/src/plugins/builtin/cloud/upgrade-command.ts +1 -1
  222. package/src/plugins/builtin/cloud/upgrade-dialog.tsx +29 -3
  223. package/src/plugins/builtin/cloud/upgrade-status-widget.tsx +1 -1
  224. package/src/plugins/builtin/cloud-tweets/table.tsx +1 -1
  225. package/src/plugins/builtin/comment-letters/client.ts +342 -0
  226. package/src/plugins/builtin/comment-letters/index.tsx +74 -0
  227. package/src/plugins/builtin/comment-letters/pane.tsx +295 -0
  228. package/src/plugins/builtin/comment-letters/types.ts +43 -0
  229. package/src/plugins/builtin/company-attention/app-rank.tsx +79 -0
  230. package/src/plugins/builtin/company-attention/client.ts +69 -0
  231. package/src/plugins/builtin/company-attention/evidence.ts +45 -0
  232. package/src/plugins/builtin/company-attention/headless.ts +47 -0
  233. package/src/plugins/builtin/company-attention/index.tsx +30 -0
  234. package/src/plugins/builtin/company-attention/model.ts +129 -0
  235. package/src/plugins/builtin/company-attention/pane.tsx +183 -0
  236. package/src/plugins/builtin/company-kpis/client.ts +92 -0
  237. package/src/plugins/builtin/company-kpis/headless.ts +32 -0
  238. package/src/plugins/builtin/company-kpis/index.tsx +26 -0
  239. package/src/plugins/builtin/company-kpis/model.ts +124 -0
  240. package/src/plugins/builtin/company-kpis/pane.tsx +226 -0
  241. package/src/plugins/builtin/company-kpis/related.ts +11 -0
  242. package/src/plugins/builtin/company-kpis/screenshot-evidence.ts +44 -0
  243. package/src/plugins/builtin/composite-plugins.ts +34 -0
  244. package/src/plugins/builtin/correlation/history.ts +4 -1
  245. package/src/plugins/builtin/correlation/index.tsx +139 -80
  246. package/src/plugins/builtin/correlation/matrix/pair-chart.tsx +48 -0
  247. package/src/plugins/builtin/correlation/matrix/selection.ts +77 -0
  248. package/src/plugins/builtin/correlation/relationship/model.ts +2 -2
  249. package/src/plugins/builtin/cpi/client.ts +66 -0
  250. package/src/plugins/builtin/cpi/headless.ts +78 -0
  251. package/src/plugins/builtin/cpi/index.tsx +31 -0
  252. package/src/plugins/builtin/cpi/model.ts +198 -0
  253. package/src/plugins/builtin/cpi/pane.tsx +157 -0
  254. package/src/plugins/builtin/credit-documents/client.ts +99 -0
  255. package/src/plugins/builtin/credit-documents/detail.tsx +109 -0
  256. package/src/plugins/builtin/credit-documents/evidence.ts +64 -0
  257. package/src/plugins/builtin/credit-documents/gauge.tsx +55 -0
  258. package/src/plugins/builtin/credit-documents/headless.ts +40 -0
  259. package/src/plugins/builtin/credit-documents/index.tsx +19 -0
  260. package/src/plugins/builtin/credit-documents/model.ts +336 -0
  261. package/src/plugins/builtin/credit-documents/pane.tsx +185 -0
  262. package/src/plugins/builtin/custom-view/view-spec.ts +14 -2
  263. package/src/plugins/builtin/debt-maturities/pane.tsx +1 -0
  264. package/src/plugins/builtin/dividend-yield/pane.tsx +1 -1
  265. package/src/plugins/builtin/doe/client.ts +73 -0
  266. package/src/plugins/builtin/doe/headless.ts +93 -0
  267. package/src/plugins/builtin/doe/index.tsx +41 -0
  268. package/src/plugins/builtin/doe/model.ts +215 -0
  269. package/src/plugins/builtin/doe/pane.tsx +148 -0
  270. package/src/plugins/builtin/doe/range-bar.tsx +45 -0
  271. package/src/plugins/builtin/earnings/board.tsx +3 -0
  272. package/src/plugins/builtin/earnings/index.tsx +2 -0
  273. package/src/plugins/builtin/earnings-calls/pane.tsx +7 -1
  274. package/src/plugins/builtin/earnings-calls/transcript-view.tsx +7 -7
  275. package/src/plugins/builtin/earnings-ripple/client.ts +60 -0
  276. package/src/plugins/builtin/earnings-ripple/headless.ts +35 -0
  277. package/src/plugins/builtin/earnings-ripple/index.tsx +35 -0
  278. package/src/plugins/builtin/earnings-ripple/model.ts +98 -0
  279. package/src/plugins/builtin/earnings-ripple/pane.tsx +103 -0
  280. package/src/plugins/builtin/equity-screener/client.ts +1 -1
  281. package/src/plugins/builtin/equity-screener/criterion-editor.tsx +1 -1
  282. package/src/plugins/builtin/equity-screener/model.ts +74 -9
  283. package/src/plugins/builtin/equity-screener/pane.tsx +2 -0
  284. package/src/plugins/builtin/estimate-revisions/pane.tsx +3 -0
  285. package/src/plugins/builtin/executives/pane.tsx +7 -5
  286. package/src/plugins/builtin/exposure/charts.tsx +66 -0
  287. package/src/plugins/builtin/exposure/client.ts +53 -0
  288. package/src/plugins/builtin/exposure/drivers.ts +29 -0
  289. package/src/plugins/builtin/exposure/editor.tsx +61 -0
  290. package/src/plugins/builtin/exposure/evidence.ts +39 -0
  291. package/src/plugins/builtin/exposure/headless.ts +51 -0
  292. package/src/plugins/builtin/exposure/holdings.ts +56 -0
  293. package/src/plugins/builtin/exposure/index.tsx +13 -0
  294. package/src/plugins/builtin/exposure/model.ts +104 -0
  295. package/src/plugins/builtin/exposure/pane.tsx +247 -0
  296. package/src/plugins/builtin/fear-greed/charts.tsx +1 -1
  297. package/src/plugins/builtin/fear-greed/pane.tsx +2 -9
  298. package/src/plugins/builtin/filing-events/pane.tsx +2 -1
  299. package/src/plugins/builtin/gpu/board.tsx +163 -0
  300. package/src/plugins/builtin/gpu/changes.tsx +94 -0
  301. package/src/plugins/builtin/gpu/client.ts +130 -0
  302. package/src/plugins/builtin/gpu/equities.tsx +112 -0
  303. package/src/plugins/builtin/gpu/headless.ts +67 -0
  304. package/src/plugins/builtin/gpu/history.tsx +140 -0
  305. package/src/plugins/builtin/gpu/index.tsx +18 -0
  306. package/src/plugins/builtin/gpu/ladder.tsx +127 -0
  307. package/src/plugins/builtin/gpu/model.ts +317 -0
  308. package/src/plugins/builtin/gpu/pane.tsx +63 -0
  309. package/src/plugins/builtin/help/index.tsx +19 -2
  310. package/src/plugins/builtin/holders/pane.tsx +5 -9
  311. package/src/plugins/builtin/insider/detail.tsx +119 -0
  312. package/src/plugins/builtin/insider/display.ts +221 -0
  313. package/src/plugins/builtin/insider/headless.ts +24 -3
  314. package/src/plugins/builtin/insider/index.tsx +206 -108
  315. package/src/plugins/builtin/insider/insider-data.ts +31 -3
  316. package/src/plugins/builtin/insider/model.ts +53 -4
  317. package/src/plugins/builtin/insider/table-model.ts +226 -0
  318. package/src/plugins/builtin/insider/table.tsx +79 -0
  319. package/src/plugins/builtin/iv-history/screen-pane.tsx +1 -1
  320. package/src/plugins/builtin/jobs/pane.tsx +14 -7
  321. package/src/plugins/builtin/kelly-sizer/pane.tsx +1 -1
  322. package/src/plugins/builtin/macro-day/client.ts +50 -0
  323. package/src/plugins/builtin/macro-day/headless.ts +51 -0
  324. package/src/plugins/builtin/macro-day/index.tsx +21 -0
  325. package/src/plugins/builtin/macro-day/model.ts +137 -0
  326. package/src/plugins/builtin/macro-day/pane.tsx +118 -0
  327. package/src/plugins/builtin/macro-day/releases.ts +58 -0
  328. package/src/plugins/builtin/market-halts/model.ts +30 -17
  329. package/src/plugins/builtin/market-halts/pane.tsx +15 -21
  330. package/src/plugins/builtin/market-heatmap/data.ts +1 -1
  331. package/src/plugins/builtin/market-heatmap/index.tsx +198 -50
  332. package/src/plugins/builtin/market-heatmap/portfolio.ts +220 -0
  333. package/src/plugins/builtin/market-movers/index.tsx +1 -0
  334. package/src/plugins/builtin/market-movers/session-body.tsx +5 -2
  335. package/src/plugins/builtin/mna/distress/client.ts +326 -0
  336. package/src/plugins/builtin/mna/distress/detail.tsx +247 -0
  337. package/src/plugins/builtin/mna/distress/headless.ts +257 -0
  338. package/src/plugins/builtin/mna/distress/model.ts +427 -0
  339. package/src/plugins/builtin/mna/distress/pane.tsx +606 -0
  340. package/src/plugins/builtin/mna/index.tsx +15 -0
  341. package/src/plugins/builtin/mna/pane.tsx +42 -1
  342. package/src/plugins/builtin/news/index.tsx +62 -16
  343. package/src/plugins/builtin/news/wire/filter-articles.ts +54 -0
  344. package/src/plugins/builtin/news/wire/index.tsx +37 -3
  345. package/src/plugins/builtin/news/wire/industry-pane.tsx +29 -13
  346. package/src/plugins/builtin/news/wire/mutes.ts +253 -0
  347. package/src/plugins/builtin/news/wire/news/command-bar-search.ts +117 -0
  348. package/src/plugins/builtin/news/wire/news/footer.ts +4 -0
  349. package/src/plugins/builtin/news/wire/news/list-search.ts +34 -0
  350. package/src/plugins/builtin/news/wire/news/pop-out.tsx +158 -0
  351. package/src/plugins/builtin/news/wire/news/preset-pane.tsx +64 -19
  352. package/src/plugins/builtin/openfda/client.ts +300 -0
  353. package/src/plugins/builtin/openfda/index.tsx +71 -0
  354. package/src/plugins/builtin/openfda/pane.tsx +382 -0
  355. package/src/plugins/builtin/openfda/types.ts +76 -0
  356. package/src/plugins/builtin/options/footer.ts +1 -0
  357. package/src/plugins/builtin/options/view.tsx +1 -1
  358. package/src/plugins/builtin/options-calculator/pane.tsx +0 -1
  359. package/src/plugins/builtin/options-positioning/index.tsx +4 -2
  360. package/src/plugins/builtin/options-positioning/pane.tsx +1 -1
  361. package/src/plugins/builtin/pe-band/client.ts +61 -0
  362. package/src/plugins/builtin/pe-band/headless.ts +51 -0
  363. package/src/plugins/builtin/pe-band/index.tsx +20 -0
  364. package/src/plugins/builtin/pe-band/model.ts +267 -0
  365. package/src/plugins/builtin/pe-band/pane.tsx +159 -0
  366. package/src/plugins/builtin/perps/client.ts +66 -0
  367. package/src/plugins/builtin/perps/equity-row.tsx +28 -0
  368. package/src/plugins/builtin/perps/headless.ts +34 -0
  369. package/src/plugins/builtin/perps/index.tsx +14 -0
  370. package/src/plugins/builtin/perps/model.ts +58 -0
  371. package/src/plugins/builtin/perps/pane.tsx +185 -0
  372. package/src/plugins/builtin/plugin-marketplace/pane.tsx +0 -1
  373. package/src/plugins/builtin/portfolio-list/cli/render.ts +177 -87
  374. package/src/plugins/builtin/portfolio-list/cli/watchlist-command.ts +6 -20
  375. package/src/plugins/builtin/portfolio-list/command-bar.ts +6 -2
  376. package/src/plugins/builtin/portfolio-list/headless.ts +237 -0
  377. package/src/plugins/builtin/portfolio-list/index.tsx +2 -0
  378. package/src/plugins/builtin/portfolio-list/mutations.ts +70 -1
  379. package/src/plugins/builtin/portfolio-list/pane/data.ts +17 -0
  380. package/src/plugins/builtin/portfolio-list/pane/index.tsx +88 -5
  381. package/src/plugins/builtin/portfolio-list/pane/remove-ticker.ts +85 -0
  382. package/src/plugins/builtin/portfolio-list/pane/streaming.ts +18 -12
  383. package/src/plugins/builtin/portfolio-list/quick-add/index.tsx +6 -0
  384. package/src/plugins/builtin/power/client.ts +100 -0
  385. package/src/plugins/builtin/power/detail.tsx +82 -0
  386. package/src/plugins/builtin/power/evidence.ts +56 -0
  387. package/src/plugins/builtin/power/generation.tsx +37 -0
  388. package/src/plugins/builtin/power/headless.ts +43 -0
  389. package/src/plugins/builtin/power/index.tsx +16 -0
  390. package/src/plugins/builtin/power/model.ts +89 -0
  391. package/src/plugins/builtin/power/pane.tsx +209 -0
  392. package/src/plugins/builtin/power/query.ts +25 -0
  393. package/src/plugins/builtin/relative-rotation/pane.tsx +3 -3
  394. package/src/plugins/builtin/research/analyst-pane.tsx +1 -1
  395. package/src/plugins/builtin/research/corporate-actions-pane.tsx +13 -4
  396. package/src/plugins/builtin/research/equity-diagnostic-pane.tsx +11 -9
  397. package/src/plugins/builtin/research-search/pane.tsx +21 -7
  398. package/src/plugins/builtin/revenue-breakdown/pane.tsx +1 -1
  399. package/src/plugins/builtin/reverse-dcf/client.ts +35 -0
  400. package/src/plugins/builtin/reverse-dcf/headless.ts +44 -0
  401. package/src/plugins/builtin/reverse-dcf/index.tsx +20 -0
  402. package/src/plugins/builtin/reverse-dcf/model.ts +87 -0
  403. package/src/plugins/builtin/reverse-dcf/pane.tsx +107 -0
  404. package/src/plugins/builtin/risk-factors/pane.tsx +6 -5
  405. package/src/plugins/builtin/scanner/denied.tsx +4 -2
  406. package/src/plugins/builtin/scanner/feed.ts +1 -0
  407. package/src/plugins/builtin/scanner/flow-pane.tsx +3 -2
  408. package/src/plugins/builtin/scanner/hilo-pane.tsx +1 -1
  409. package/src/plugins/builtin/seasonality/client.ts +4 -1
  410. package/src/plugins/builtin/sec/command-bar-search.ts +217 -0
  411. package/src/plugins/builtin/sec/forms.ts +54 -0
  412. package/src/plugins/builtin/sec/headless.ts +31 -5
  413. package/src/plugins/builtin/sec/index.tsx +67 -11
  414. package/src/plugins/builtin/sec/model.ts +35 -5
  415. package/src/plugins/builtin/sectors/headless.ts +1 -0
  416. package/src/plugins/builtin/sectors/index.tsx +72 -26
  417. package/src/plugins/builtin/shared/cloud-upgrade.ts +143 -39
  418. package/src/plugins/builtin/shared/pro-feature-wall.tsx +8 -4
  419. package/src/plugins/builtin/shared/research-cells.tsx +107 -0
  420. package/src/plugins/builtin/shared/series-list-detail.tsx +5 -1
  421. package/src/plugins/builtin/shared/ticker-request.ts +1 -1
  422. package/src/plugins/builtin/shared/wall-teaser-catalog.ts +80 -0
  423. package/src/plugins/builtin/shared/wall-teaser.tsx +192 -0
  424. package/src/plugins/builtin/shared/wall-view-lifecycle.ts +43 -0
  425. package/src/plugins/builtin/short-interest/index.tsx +31 -0
  426. package/src/plugins/builtin/short-interest/watch-client.ts +70 -0
  427. package/src/plugins/builtin/short-interest/watch-headless.ts +49 -0
  428. package/src/plugins/builtin/short-interest/watch-model.ts +185 -0
  429. package/src/plugins/builtin/short-interest/watch-pane.tsx +169 -0
  430. package/src/plugins/builtin/short-volume/pane.tsx +1 -1
  431. package/src/plugins/builtin/social-mentions/pane.tsx +1 -1
  432. package/src/plugins/builtin/supply-chain/client.ts +104 -0
  433. package/src/plugins/builtin/supply-chain/disclosure-quote.tsx +17 -0
  434. package/src/plugins/builtin/supply-chain/evidence.ts +88 -0
  435. package/src/plugins/builtin/supply-chain/flow-layout.ts +133 -0
  436. package/src/plugins/builtin/supply-chain/flow.tsx +323 -0
  437. package/src/plugins/builtin/supply-chain/graph-client.ts +83 -0
  438. package/src/plugins/builtin/supply-chain/graph-evidence.ts +25 -0
  439. package/src/plugins/builtin/supply-chain/graph-model.ts +45 -0
  440. package/src/plugins/builtin/supply-chain/graph-pane.tsx +218 -0
  441. package/src/plugins/builtin/supply-chain/graph.tsx +163 -0
  442. package/src/plugins/builtin/supply-chain/headless.ts +105 -0
  443. package/src/plugins/builtin/supply-chain/index.tsx +17 -0
  444. package/src/plugins/builtin/supply-chain/model.ts +145 -0
  445. package/src/plugins/builtin/supply-chain/pane.tsx +276 -0
  446. package/src/plugins/builtin/supply-chain/row-evidence.tsx +96 -0
  447. package/src/plugins/builtin/supply-chain/trust.ts +34 -0
  448. package/src/plugins/builtin/themes/client.ts +39 -0
  449. package/src/plugins/builtin/themes/headless.ts +38 -0
  450. package/src/plugins/builtin/themes/model.ts +92 -0
  451. package/src/plugins/builtin/themes/pane.tsx +125 -0
  452. package/src/plugins/builtin/thirteenf/pane.tsx +6 -15
  453. package/src/plugins/builtin/ticker-detail/data-panes/historical-prices.tsx +5 -6
  454. package/src/plugins/builtin/ticker-detail/data-panes/returns-model.ts +201 -0
  455. package/src/plugins/builtin/ticker-detail/data-panes/returns-pane.tsx +327 -0
  456. package/src/plugins/builtin/ticker-detail/financials/period-end-history.ts +5 -2
  457. package/src/plugins/builtin/ticker-detail/financials/ratios.ts +60 -12
  458. package/src/plugins/builtin/ticker-detail/financials/tab.tsx +2 -1
  459. package/src/plugins/builtin/ticker-detail/headless.ts +7 -2
  460. package/src/plugins/builtin/ticker-detail/index.tsx +22 -0
  461. package/src/plugins/builtin/ticker-detail/overview/components.tsx +53 -30
  462. package/src/plugins/builtin/ticker-detail/overview/pane.tsx +2 -0
  463. package/src/plugins/builtin/ticker-detail/overview-tab.tsx +112 -47
  464. package/src/plugins/builtin/ticker-detail/pane.tsx +50 -6
  465. package/src/plugins/builtin/ticker-detail/quote-monitor/card.tsx +21 -42
  466. package/src/plugins/builtin/ticker-detail/quote-monitor/index.tsx +3 -0
  467. package/src/plugins/builtin/time-sales/pane.tsx +1 -1
  468. package/src/plugins/builtin/world-indices/indices.ts +1 -0
  469. package/src/plugins/catalog-browser.ts +40 -0
  470. package/src/plugins/catalog-manifest.ts +3 -0
  471. package/src/plugins/catalog-ui.ts +6 -0
  472. package/src/plugins/current-target.ts +0 -9
  473. package/src/public/__snapshots__/public-api.test.ts.snap +1 -0
  474. package/src/renderers/browser/cloud-transport.ts +66 -1
  475. package/src/renderers/browser/main.tsx +2 -0
  476. package/src/renderers/dom/data-table/row.tsx +2 -0
  477. package/src/renderers/dom/desktop/controls.tsx +38 -25
  478. package/src/renderers/dom/desktop/icons.tsx +8 -0
  479. package/src/renderers/dom/host/chart-surface.tsx +36 -2
  480. package/src/renderers/dom/host/focus-scope.ts +11 -1
  481. package/src/renderers/dom/styles.css +28 -0
  482. package/src/renderers/electrobun/view/backend-rpc.ts +3 -2
  483. package/src/renderers/electrobun/view/cli-pane-shot-entry.tsx +1 -1
  484. package/src/renderers/electrobun/view/http-fetch.ts +2 -0
  485. package/src/renderers/electrobun/view/main.tsx +3 -1
  486. package/src/renderers/electrobun/view/rpc-timeout.ts +59 -0
  487. package/src/renderers/opentui/start.tsx +3 -0
  488. package/src/shares/api.ts +3 -1
  489. package/src/sources/gloomberb-cloud/index.ts +47 -13
  490. package/src/sources/history-result.ts +1 -0
  491. package/src/sources/history-retention.ts +16 -0
  492. package/src/sources/provider-router/history.ts +4 -2
  493. package/src/sources/sec-edgar/identity.ts +36 -0
  494. package/src/sources/sec-edgar.ts +1 -34
  495. package/src/state/app/context/index.tsx +8 -0
  496. package/src/sync/core-contributors.ts +20 -2
  497. package/src/telemetry/attention-counts.ts +164 -0
  498. package/src/telemetry/live-config.ts +7 -0
  499. package/src/test-support/rpc-loopback.ts +7 -3
  500. package/src/test-support/shell-pane-keys.tsx +34 -0
  501. package/src/tickers/instrument-kind.ts +12 -6
  502. package/src/tickers/open-target.ts +1 -1
  503. package/src/tickers/search/asset-classes.ts +91 -0
  504. package/src/tickers/search/index.ts +62 -15
  505. package/src/tickers/search/ranking.ts +22 -3
  506. package/src/tickers/search/upsert.ts +4 -1
  507. package/src/time-series/live-bars.ts +8 -3
  508. package/src/time-series/resolve.ts +224 -17
  509. package/src/time-series/spec.ts +1 -0
  510. package/src/time-series/types.ts +9 -1
  511. package/src/types/config.ts +23 -1
  512. package/src/types/data-provider.ts +2 -0
  513. package/src/types/headless.ts +17 -0
  514. package/src/types/price-history.ts +2 -0
  515. package/src/ui/host.tsx +6 -0
  516. package/src/utils/double-escape-close.ts +20 -0
  517. package/src/utils/exchanges.ts +1 -0
  518. package/src/utils/html-entities.ts +15 -0
  519. package/src/utils/http-proxy-response.ts +44 -7
  520. package/src/utils/plugin-proxy-hosts.json +3 -0
  521. package/src/utils/price-history.ts +35 -1
  522. package/src/utils/sec.ts +21 -2
  523. package/src/utils/text-wrap.ts +13 -8
  524. package/src/utils/zoned-date-time.ts +67 -0
@@ -0,0 +1,89 @@
1
+ import type { AppConfig } from "../../../../types/config";
2
+ import type { TickerRecord } from "../../../../types/ticker";
3
+ import type { BrokerAccount } from "../../../../types/trading";
4
+ import { describePortfolioTab } from "../../analytics/portfolio-selection";
5
+ import type { ASKGUserData } from "./protocol";
6
+
7
+ /** The bounds the platform accepts; more is cut here rather than refused there. */
8
+ const MAX_PORTFOLIOS = 30;
9
+ const MAX_WATCHLISTS = 30;
10
+ const MAX_BROKER_ACCOUNTS = 20;
11
+ const MAX_ID_LENGTH = 80;
12
+ const MAX_NAME_LENGTH = 60;
13
+
14
+ interface UserDataSource {
15
+ config: Pick<AppConfig, "portfolios" | "watchlists" | "brokerInstances">;
16
+ /** Accounts each broker connection reported, keyed by broker instance id. */
17
+ brokerAccounts?: Readonly<Record<string, readonly BrokerAccount[]>>;
18
+ /** Local tickers, for watchlist sizes. */
19
+ tickers?: Iterable<TickerRecord>;
20
+ }
21
+
22
+ /** An id is used verbatim by a tool, so one too long to send is left out, not cut. */
23
+ function usableId(id: string | undefined): string | null {
24
+ const trimmed = id?.trim() ?? "";
25
+ return trimmed && trimmed.length <= MAX_ID_LENGTH ? trimmed : null;
26
+ }
27
+
28
+ function displayName(name: string | undefined, fallback: string): string {
29
+ const line = (name ?? "").replace(/\s+/g, " ").trim() || fallback;
30
+ return Array.from(line).slice(0, MAX_NAME_LENGTH).join("");
31
+ }
32
+
33
+ function watchlistCounts(tickers: Iterable<TickerRecord> | undefined): Map<string, number> | null {
34
+ if (!tickers) return null;
35
+ const counts = new Map<string, number>();
36
+ for (const ticker of tickers) {
37
+ for (const id of ticker.metadata.watchlists) counts.set(id, (counts.get(id) ?? 0) + 1);
38
+ }
39
+ return counts;
40
+ }
41
+
42
+ /**
43
+ * What Gloom needs to call tools on the user's own data: each portfolio,
44
+ * watchlist and broker account by the id tools take and the name the user
45
+ * sees. Undefined when there is nothing to send.
46
+ */
47
+ export function buildASKGUserData({ config, brokerAccounts, tickers }: UserDataSource): ASKGUserData | undefined {
48
+ const portfolios = config.portfolios.flatMap((portfolio) => {
49
+ const id = usableId(portfolio.id);
50
+ if (!id) return [];
51
+ return [{
52
+ id,
53
+ name: displayName(describePortfolioTab(portfolio, config.brokerInstances), id),
54
+ kind: portfolio.brokerId || portfolio.brokerInstanceId ? "broker" as const : "manual" as const,
55
+ }];
56
+ }).slice(0, MAX_PORTFOLIOS);
57
+
58
+ const counts = watchlistCounts(tickers);
59
+ const watchlists = config.watchlists.flatMap((watchlist) => {
60
+ const id = usableId(watchlist.id);
61
+ if (!id) return [];
62
+ // A team list's tickers live on the server, so a local count would read as empty.
63
+ const count = counts && !watchlist.teamId ? counts.get(id) ?? 0 : null;
64
+ return [{ id, name: displayName(watchlist.name, id), ...(count == null ? {} : { count }) }];
65
+ }).slice(0, MAX_WATCHLISTS);
66
+
67
+ const accounts = config.brokerInstances.flatMap((instance) => (
68
+ (brokerAccounts?.[instance.id] ?? []).flatMap((account) => {
69
+ const id = usableId(account.accountId);
70
+ if (!id) return [];
71
+ const named = account.name?.trim() && account.name.trim() !== account.accountId ? account.name : null;
72
+ const portfolioId = usableId(config.portfolios.find((portfolio) => (
73
+ portfolio.brokerInstanceId === instance.id && portfolio.brokerAccountId === account.accountId
74
+ ))?.id);
75
+ return [{
76
+ id,
77
+ name: displayName(named ?? `${instance.label} ${account.accountId}`, id),
78
+ ...(portfolioId ? { portfolioId } : {}),
79
+ }];
80
+ })
81
+ )).slice(0, MAX_BROKER_ACCOUNTS);
82
+
83
+ const userData: ASKGUserData = {
84
+ ...(portfolios.length ? { portfolios } : {}),
85
+ ...(watchlists.length ? { watchlists } : {}),
86
+ ...(accounts.length ? { brokerAccounts: accounts } : {}),
87
+ };
88
+ return Object.keys(userData).length ? userData : undefined;
89
+ }
@@ -18,6 +18,8 @@ import { t, tf } from "../../../i18n";
18
18
  import { useCloudPlanAction, useCloudUpgradeAction } from "../shared/cloud-upgrade";
19
19
  import { requestAuthDialog } from "./auth-dialog";
20
20
  import type { AccountMode } from "./auth-model";
21
+ import { recordWallCtaClicked } from "../../../api-client/research-activity";
22
+ import { WallTeaser } from "../shared/wall-teaser";
21
23
 
22
24
  function openAuth(
23
25
  openCommandBar: (query?: string) => void,
@@ -68,6 +70,12 @@ export function InlineAuthActions({ showSignup = true, variant = "buttons" }: In
68
70
  }
69
71
 
70
72
  export interface SignInWallProps {
73
+ /** A fixed, content-free id for this wall, ending in -signin. */
74
+ placement: string;
75
+ width?: number;
76
+ height?: number;
77
+ symbol?: string | null;
78
+ exchange?: string;
71
79
  /**
72
80
  * Finishes the headline: "Sign in to {action}." / "Verify your email to
73
81
  * {action}.". A lowercase verb phrase, no trailing period.
@@ -80,33 +88,47 @@ export interface SignInWallProps {
80
88
  }
81
89
 
82
90
  /** The account wall for a pane body that cannot render until the account is right. */
83
- export function SignInWall({ action, needsVerification = false, hint }: SignInWallProps) {
91
+ export function SignInWall({ placement, action, needsVerification = false, hint, width = 0, height = 0, symbol, exchange }: SignInWallProps) {
84
92
  const { openCommandBar } = usePluginAppActions();
93
+ const title = needsVerification
94
+ ? tf("Verify your email to {action}.", { action: t(action) })
95
+ : tf("Sign in to {action}.", { action: t(action) });
96
+ const authenticate = (mode: "login" | "signup") => {
97
+ recordWallCtaClicked(placement, mode);
98
+ openAuth(openCommandBar, mode);
99
+ };
85
100
 
86
101
  return (
87
- <Box flexDirection="column" paddingX={1} paddingY={1} data-gloom-ui="sign-in-wall">
88
- <EmptyState
89
- title={needsVerification
90
- ? tf("Verify your email to {action}.", { action: t(action) })
91
- : tf("Sign in to {action}.", { action: t(action) })}
92
- hint={hint}
93
- actions={needsVerification ? (
94
- <Button
95
- label={t("Resend Verification Email")}
96
- onPress={() => openCommandBar("Resend Verification Email")}
97
- />
98
- ) : (
99
- <>
100
- <Button label={t("Log in")} variant="primary" onPress={() => openAuth(openCommandBar, "login")} />
101
- <Button label={t("Sign up free")} variant="secondary" onPress={() => openAuth(openCommandBar, "signup")} />
102
- </>
103
- )}
104
- />
105
- </Box>
102
+ <WallTeaser experiment="wall_teaser_signin" placement={placement} title={title} message={hint}
103
+ width={width} height={height} symbol={symbol} exchange={exchange}>
104
+ <Box flexDirection="column" paddingX={1} paddingY={1} data-gloom-ui="sign-in-wall">
105
+ <EmptyState
106
+ title={title}
107
+ hint={hint}
108
+ actions={needsVerification ? (
109
+ <Button
110
+ label={t("Resend Verification Email")}
111
+ onPress={() => openCommandBar("Resend Verification Email")}
112
+ />
113
+ ) : (
114
+ <>
115
+ <Button label={t("Log in")} variant="primary" onPress={() => authenticate("login")} />
116
+ <Button label={t("Sign up free")} variant="secondary" onPress={() => authenticate("signup")} />
117
+ </>
118
+ )}
119
+ />
120
+ </Box>
121
+ </WallTeaser>
106
122
  );
107
123
  }
108
124
 
109
125
  export interface ProWallProps {
126
+ width: number;
127
+ height: number;
128
+ symbol?: string | null;
129
+ exchange?: string;
130
+ /** The upgrade intent's placement id, e.g. "jobs-wall"; see `CloudUpgradeOptions.placement`. */
131
+ placement: string;
110
132
  /** The headline, e.g. "Hiring data is part of Gloom Cloud Pro." */
111
133
  title: string;
112
134
  /** What Pro unlocks here. */
@@ -114,19 +136,21 @@ export interface ProWallProps {
114
136
  }
115
137
 
116
138
  /** The upgrade wall for a pane body that needs Pro; Manage account covers a plan the account already has. */
117
- export function ProWall({ title, message }: ProWallProps) {
118
- const openUpgrade = useCloudUpgradeAction();
139
+ export function ProWall({ placement, title, message, width, height, symbol, exchange }: ProWallProps) {
140
+ const openUpgrade = useCloudUpgradeAction(placement);
119
141
  const openPlan = useCloudPlanAction();
120
142
  // The status body carries the pane inset that a bare EmptyState lacks.
121
143
  return (
122
- <PaneStatusBody
123
- empty
124
- emptyTitle={title}
125
- emptyMessage={message}
126
- actions={<>
127
- <Button label={t("Upgrade to Pro")} onPress={openUpgrade} />
128
- <Button label={t("Manage account")} variant="secondary" onPress={openPlan} />
129
- </>}
130
- />
144
+ <WallTeaser placement={placement} title={title} message={message} width={width} height={height} symbol={symbol} exchange={exchange}>
145
+ <PaneStatusBody
146
+ empty
147
+ emptyTitle={title}
148
+ emptyMessage={message}
149
+ actions={<>
150
+ <Button label={t("Upgrade to Pro")} onPress={openUpgrade} />
151
+ <Button label={t("Manage account")} variant="secondary" onPress={openPlan} />
152
+ </>}
153
+ />
154
+ </WallTeaser>
131
155
  );
132
156
  }
@@ -16,6 +16,7 @@ import { askGloomQuestion } from "./askg/pending-question";
16
16
  import { registerCloudAuthCommands } from "./auth-commands";
17
17
  import { registerCloudUpgradeCommand } from "./upgrade-command";
18
18
  import { CloudUpgradeStatusWidget } from "./upgrade-status-widget";
19
+ import { registerTrialOfferCommand, TrialOfferStatusWidget } from "./trial-offer-status-widget";
19
20
  import { CloudVerificationStatusWidget } from "./verification-status-widget";
20
21
  import { createPublicPaneShare } from "../shared/public-pane";
21
22
  import { teamModule } from "./team/module";
@@ -38,19 +39,21 @@ function createCloudDataModule(): PluginModule {
38
39
  };
39
40
  }
40
41
 
41
- /** Sign-in and upgrade commands, and the email verification and upgrade prompts. */
42
+ /** Sign-in and upgrade commands, and the email verification, upgrade and trial prompts. */
42
43
  const cloudAccountModule: PluginModule = {
43
44
  slots: {
44
45
  "status:widget": () => (
45
46
  <>
46
47
  <CloudVerificationStatusWidget />
47
48
  <CloudUpgradeStatusWidget />
49
+ <TrialOfferStatusWidget />
48
50
  </>
49
51
  ),
50
52
  },
51
53
  setup: (ctx) => {
52
54
  registerCloudAuthCommands(ctx);
53
55
  registerCloudUpgradeCommand(ctx);
56
+ registerTrialOfferCommand(ctx);
54
57
  },
55
58
  };
56
59
 
@@ -8,6 +8,7 @@ import type {
8
8
  import { Button } from "../../../../components";
9
9
  import { colors } from "../../../../theme/colors";
10
10
  import { Box, Text, TextAttributes } from "../../../../ui";
11
+ import { WallTeaser } from "../../shared/wall-teaser";
11
12
  import {
12
13
  canInviteToTeam,
13
14
  canManageTeam,
@@ -458,6 +459,7 @@ export function SettingsSection({
458
459
  export function CreateTeamForm({
459
460
  draft,
460
461
  width,
462
+ height,
461
463
  busy,
462
464
  hasPro,
463
465
  onChange,
@@ -467,6 +469,7 @@ export function CreateTeamForm({
467
469
  }: {
468
470
  draft: TeamDraft;
469
471
  width: number;
472
+ height: number;
470
473
  busy: boolean;
471
474
  hasPro: boolean;
472
475
  onChange: (draft: TeamDraft) => void;
@@ -475,7 +478,7 @@ export function CreateTeamForm({
475
478
  onUpgrade: () => void;
476
479
  }) {
477
480
  const problem = draftProblem(draft);
478
- return (
481
+ const form = (
479
482
  <Box flexDirection="column" gap={1} width={width}>
480
483
  {/* The "New team" tab above already names this form. */}
481
484
  <Muted width={width}>
@@ -499,4 +502,10 @@ export function CreateTeamForm({
499
502
  </Box>
500
503
  </Box>
501
504
  );
505
+ // Preserve room for the editable name, short name, accent and Upgrade action.
506
+ return hasPro ? form : (
507
+ <WallTeaser placement="team" width={width} height={Math.max(0, height - 10)}>
508
+ {form}
509
+ </WallTeaser>
510
+ );
502
511
  }
@@ -184,7 +184,7 @@ function InvitationBanner({
184
184
  export function TeamPane({ focused, width, height, close }: PaneProps) {
185
185
  const { createPaneFromTemplate, notify } = usePluginAppActions();
186
186
  const rendererHost = useRendererHost();
187
- const openUpgrade = useCloudUpgradeAction();
187
+ const openUpgrade = useCloudUpgradeAction("team");
188
188
  const plan = usePlanAccess();
189
189
  const { nativePaneChrome } = useUiCapabilities();
190
190
  const snapshot = useSyncExternalStore(
@@ -588,7 +588,7 @@ export function TeamPane({ focused, width, height, close }: PaneProps) {
588
588
  } : null);
589
589
 
590
590
  if (!signedIn) {
591
- return <SignInWall action="use teams" />;
591
+ return <SignInWall placement="team-signin" width={width} height={height} action="use teams" />;
592
592
  }
593
593
 
594
594
  const contentWidth = Math.max(24, width - 2);
@@ -647,6 +647,7 @@ export function TeamPane({ focused, width, height, close }: PaneProps) {
647
647
  <CreateTeamForm
648
648
  draft={createDraft}
649
649
  width={contentWidth}
650
+ height={Math.max(1, bodyHeight - 1)}
650
651
  busy={busy === "create"}
651
652
  hasPro={plan.hasProAccess}
652
653
  onChange={setCreateDraft}
@@ -123,7 +123,7 @@ export function ThesisBoardPane({ focused, width, height }: PaneProps) {
123
123
  const dialog = useDialog();
124
124
  const { notify } = usePluginAppActions();
125
125
  const plan = usePlanAccess();
126
- const openUpgrade = useCloudUpgradeAction();
126
+ const openUpgrade = useCloudUpgradeAction("thesis-board");
127
127
  const snapshot = useSyncExternalStore((onChange) => thesisStore.subscribe(onChange), () => thesisStore.getSnapshot());
128
128
  const teams = useSyncExternalStore((onChange) => teamStore.subscribe(onChange), () => teamStore.getSnapshot()).teams;
129
129
  const signedIn = useSyncExternalStore((onChange) => apiClient.subscribeCurrentUser(onChange), () => apiClient.isVerified());
@@ -377,7 +377,7 @@ export function ThesisBoardPane({ focused, width, height }: PaneProps) {
377
377
  const handleDetailKeyDown = useCallback((_event: DataTableKeyEvent) => false, []);
378
378
 
379
379
  if (!signedIn) {
380
- return <SignInWall action="keep investment theses" hint="Theses are stored in Gloom Cloud so they follow you and your team." />;
380
+ return <SignInWall placement="thesis-board-signin" action="keep investment theses" hint="Theses are stored in Gloom Cloud so they follow you and your team." />;
381
381
  }
382
382
  if (!snapshot.loaded && snapshot.theses.length === 0) {
383
383
  return <PaneStatusBody loading={snapshot.loading} error={snapshot.error} subject="Theses" />;
@@ -147,7 +147,7 @@ export function ThesisDetail({ thesis, width, height, focused, footerId, onDelet
147
147
  const dialog = useDialog();
148
148
  const { notify } = usePluginAppActions();
149
149
  const plan = usePlanAccess();
150
- const openUpgrade = useCloudUpgradeAction();
150
+ const openUpgrade = useCloudUpgradeAction("thesis-detail");
151
151
  const [signals, setSignals] = useState<ThesisSignal[]>([]);
152
152
  const [selectedId, setSelectedId] = useState<string | null>(null);
153
153
  const [busy, setBusy] = useState(false);
@@ -27,7 +27,7 @@ export function ThesisTickerTab({ focused, width, height }: TickerResearchTabPro
27
27
  const dialog = useDialog();
28
28
  const { notify } = usePluginAppActions();
29
29
  const plan = usePlanAccess();
30
- const openUpgrade = useCloudUpgradeAction();
30
+ const openUpgrade = useCloudUpgradeAction("thesis-tab");
31
31
  const snapshot = useSyncExternalStore((onChange) => thesisStore.subscribe(onChange), () => thesisStore.getSnapshot());
32
32
  const teams = useSyncExternalStore((onChange) => teamStore.subscribe(onChange), () => teamStore.getSnapshot()).teams;
33
33
  const signedIn = useSyncExternalStore((onChange) => apiClient.subscribeCurrentUser(onChange), () => apiClient.isVerified());
@@ -96,7 +96,7 @@ export function ThesisTickerTab({ focused, width, height }: TickerResearchTabPro
96
96
 
97
97
  if (!ticker) return <EmptyState title="No ticker selected." hint="Select a ticker to see its thesis." />;
98
98
  if (!signedIn) {
99
- return <SignInWall action="keep a thesis on this ticker" hint="Theses are stored in Gloom Cloud so they follow you and your team." />;
99
+ return <SignInWall placement="thesis-ticker-signin" action="keep a thesis on this ticker" hint="Theses are stored in Gloom Cloud so they follow you and your team." />;
100
100
  }
101
101
  if (!active) {
102
102
  return (
@@ -0,0 +1,202 @@
1
+ /**
2
+ * The web terminal's Pro trial offer, the `offer` arm of the
3
+ * `web_terminal_trial_offer` experiment: one line in the status bar for
4
+ * signed-out visitors on term.gloom.sh once the terminal has been on screen
5
+ * for a little while. The web terminal never offers the trial on its own
6
+ * otherwise, since onboarding is off there.
7
+ *
8
+ * The arm is asked for when the offer would show, in both arms, and that is
9
+ * the exposure (`exposeWebExperiment`); the control shows nothing. The line
10
+ * sits beside the signed-out Log in, where signed-in free accounts see
11
+ * "delayed data · upgrade", and never covers the terminal. Like the other
12
+ * status bar chips it takes no keyboard focus: its tooltip names UPGRADE, and
13
+ * the Hide Pro Trial Offer command hides it. Hiding keeps it away for 14 days.
14
+ * Where the status bar has no room for it, as on a phone, it never shows and
15
+ * neither arm is counted.
16
+ */
17
+ import { useCallback, useEffect, useRef, useState } from "react";
18
+ import { apiClient } from "../../../api-client";
19
+ import { usePlanAccess } from "../../../api-client/plan-access";
20
+ import { exposeWebExperiment } from "../../../api-client/research-activity";
21
+ import { Button } from "../../../components/ui/button";
22
+ import { IconButton } from "../../../components/ui/icon";
23
+ import { t, tf } from "../../../i18n";
24
+ import { useAppLanguage } from "../../../i18n/react";
25
+ import {
26
+ STATUS_WIDGET_COLUMNS,
27
+ useStatusWidgetClaim,
28
+ useStatusWidgetRoom,
29
+ } from "../../../components/layout/status-widget-space";
30
+ import { displayWidth } from "../../../utils/format";
31
+ import { useAppVisible } from "../../../state/app/activity";
32
+ import { useThemeColors } from "../../../theme/theme-context";
33
+ import type { GloomPluginContext } from "../../../types/plugin";
34
+ import { Box, Span, Text, useCommandBarShortcut } from "../../../ui";
35
+ import { getCurrentPluginTarget } from "../../current-target";
36
+ import { usePluginState } from "../../runtime";
37
+ import { useCloudUpgradeAction } from "../shared/cloud-upgrade";
38
+
39
+ export const TRIAL_OFFER_EXPERIMENT = "web_terminal_trial_offer";
40
+ /**
41
+ * On-screen time before the offer would show. Short enough that most
42
+ * visitors reach it, which the test needs to read in weeks rather than months.
43
+ */
44
+ const TRIAL_OFFER_DELAY_MS = 6_000;
45
+ const TRIAL_OFFER_SNOOZE_MS = 14 * 24 * 60 * 60 * 1000;
46
+ const DEFAULT_TRIAL_DAYS = 7;
47
+ /** The hide button and the gap after the line. */
48
+ const OFFER_CHROME_COLUMNS = 4;
49
+ const DISMISS_COMMAND = "Hide Pro Trial Offer";
50
+ /** The offer's `upgrade_intent` placement. */
51
+ const TRIAL_OFFER_PLACEMENT = "web-terminal-offer";
52
+
53
+ /** Hides the offer that is showing; null while none is. For the command bar. */
54
+ let hideShowingOffer: (() => void) | null = null;
55
+
56
+ function isTrialOfferSnoozed(dismissedAt: number | null, now = Date.now()): boolean {
57
+ return dismissedAt !== null && now - dismissedAt < TRIAL_OFFER_SNOOZE_MS;
58
+ }
59
+
60
+ interface TrialOfferCopy {
61
+ lead: string;
62
+ trial: string;
63
+ columns: number;
64
+ }
65
+
66
+ function offerCopy(lead: string, trialDays: number): TrialOfferCopy {
67
+ const trial = tf("{days} days free", { days: trialDays });
68
+ return { lead, trial, columns: displayWidth(`${lead} · ${trial}`) + OFFER_CHROME_COLUMNS };
69
+ }
70
+
71
+ /**
72
+ * What Pro adds and how long it is free, as long as the status bar has room
73
+ * for beside its other widgets; null when not even the short line fits, as on
74
+ * a phone, where the bar is full already.
75
+ */
76
+ function trialOfferCopy(trialDays: number, widgetRoom: number): TrialOfferCopy | null {
77
+ const spare = widgetRoom - STATUS_WIDGET_COLUMNS;
78
+ const full = offerCopy(t("Real-time quotes and news with Pro"), trialDays);
79
+ if (spare >= full.columns) return full;
80
+ const short = offerCopy(t("Real-time data with Pro"), trialDays);
81
+ return spare >= short.columns ? short : null;
82
+ }
83
+
84
+ interface TrialOfferStatusWidgetProps {
85
+ /** Asks for the arm and counts the exposure; replaced in tests. */
86
+ expose?: (experiment: string) => Promise<string | null>;
87
+ delayMs?: number;
88
+ }
89
+
90
+ export function TrialOfferStatusWidget(props: TrialOfferStatusWidgetProps) {
91
+ if (getCurrentPluginTarget() !== "web") return null;
92
+ return <WebTrialOffer {...props} />;
93
+ }
94
+
95
+ type OfferState = "waiting" | "asking" | "shown" | "done";
96
+
97
+ function WebTrialOffer({ expose = exposeWebExperiment, delayMs = TRIAL_OFFER_DELAY_MS }: TrialOfferStatusWidgetProps) {
98
+ useAppLanguage();
99
+ const colors = useThemeColors();
100
+ const access = usePlanAccess();
101
+ const onScreen = useAppVisible();
102
+ const widgetRoom = useStatusWidgetRoom();
103
+ const openUpgrade = useCloudUpgradeAction(TRIAL_OFFER_PLACEMENT);
104
+ // The status bar takes no keyboard focus; the line names the commands instead.
105
+ const commandBarKey = useCommandBarShortcut();
106
+ const [dismissedAt, setDismissedAt] = usePluginState<number | null>("trial-offer-dismissed-at", null);
107
+ const [state, setState] = useState<OfferState>("waiting");
108
+ const [trialDays, setTrialDays] = useState(DEFAULT_TRIAL_DAYS);
109
+ const onScreenMs = useRef(0);
110
+ const dismissedAtRef = useRef(dismissedAt);
111
+ dismissedAtRef.current = dismissedAt;
112
+ const signedOut = !access.signedIn;
113
+ const copy = trialOfferCopy(trialDays, widgetRoom);
114
+ // Where the line cannot fit it could not show, so neither arm is asked.
115
+ const fits = trialOfferCopy(DEFAULT_TRIAL_DAYS, widgetRoom) !== null;
116
+
117
+ // Counts only the time the terminal is on screen with room for the line, so
118
+ // a tab opened in the background does not show the offer the moment someone
119
+ // switches to it.
120
+ useEffect(() => {
121
+ if (state !== "waiting" || !signedOut || !onScreen || !fits) return;
122
+ const startedAt = Date.now();
123
+ const timer = setTimeout(() => {
124
+ setState("asking");
125
+ void expose(TRIAL_OFFER_EXPERIMENT).then(async (variant) => {
126
+ if (variant !== "offer" || isTrialOfferSnoozed(dismissedAtRef.current) || apiClient.isSignedIn()) {
127
+ setState("done");
128
+ return;
129
+ }
130
+ const pricing = await apiClient.getCloudPricing().catch(() => null);
131
+ if (pricing && pricing.trialDays > 0) setTrialDays(pricing.trialDays);
132
+ setState("shown");
133
+ });
134
+ }, Math.max(0, delayMs - onScreenMs.current));
135
+ return () => {
136
+ clearTimeout(timer);
137
+ onScreenMs.current += Date.now() - startedAt;
138
+ };
139
+ }, [delayMs, expose, fits, onScreen, signedOut, state]);
140
+
141
+ const showing = state === "shown" && signedOut && !isTrialOfferSnoozed(dismissedAt) && copy !== null;
142
+ // The version chip and the desktop link give way to the line.
143
+ useStatusWidgetClaim("trial-offer", showing && copy ? copy.columns : 0);
144
+ const hide = useCallback(() => {
145
+ setDismissedAt(Date.now());
146
+ setState("done");
147
+ }, [setDismissedAt]);
148
+
149
+ useEffect(() => {
150
+ if (!showing) return;
151
+ hideShowingOffer = hide;
152
+ return () => {
153
+ if (hideShowingOffer === hide) hideShowingOffer = null;
154
+ };
155
+ }, [hide, showing]);
156
+
157
+ if (!showing || !copy) return null;
158
+
159
+ const label = `${copy.lead} · ${copy.trial}`;
160
+ return (
161
+ <Box flexDirection="row" alignItems="center" paddingRight={1} data-gloom-role="trial-offer">
162
+ <Button
163
+ label={label}
164
+ title={tf("Try Pro free for {days} days ({key}, then {command})", {
165
+ days: trialDays,
166
+ key: commandBarKey,
167
+ command: "UPGRADE",
168
+ })}
169
+ variant="plain"
170
+ compact
171
+ stopPropagation
172
+ onPress={() => openUpgrade()}
173
+ >
174
+ <Text fg={colors.text}>
175
+ {`${copy.lead} · `}
176
+ <Span fg={colors.positive}>{copy.trial}</Span>
177
+ </Text>
178
+ </Button>
179
+ <IconButton
180
+ icon="close"
181
+ label={t("Hide the Pro offer")}
182
+ title={tf("Hide for 14 days ({key}, then {command})", { key: commandBarKey, command: DISMISS_COMMAND })}
183
+ onPress={hide}
184
+ />
185
+ </Box>
186
+ );
187
+ }
188
+
189
+ /** The keyboard way to hide the offer, listed only while it shows. */
190
+ export function registerTrialOfferCommand(ctx: GloomPluginContext): void {
191
+ ctx.registerCommand({
192
+ id: "cloud-hide-trial-offer",
193
+ label: DISMISS_COMMAND,
194
+ description: "Hide the Pro trial offer in the status bar for 14 days",
195
+ keywords: ["hide", "dismiss", "offer", "trial", "pro"],
196
+ category: "config",
197
+ hidden: () => !hideShowingOffer,
198
+ execute: () => {
199
+ hideShowingOffer?.();
200
+ },
201
+ });
202
+ }
@@ -17,7 +17,7 @@ export function registerCloudUpgradeCommand(ctx: GloomPluginContext): void {
17
17
  hidden: () => resolvePlanAccess(apiClient.getCurrentUser()).isPayingPro,
18
18
  execute: () => {
19
19
  const openUpgrade = () => {
20
- if (openCloudUpgradeUrl()) return;
20
+ if (openCloudUpgradeUrl("command")) return;
21
21
  // No renderer-backed opener yet: fall back to the in-app billing surface.
22
22
  requestAccountManagementTab("pro");
23
23
  ctx.showPane("account-management");
@@ -19,13 +19,13 @@ import {
19
19
  formatCloudPrice,
20
20
  formatTrialEnd,
21
21
  monthsFreeYearly,
22
+ trialDaysOf,
22
23
  } from "../account-management/model";
23
24
 
24
25
  const CONTENT_WIDTH = 64;
25
26
  /** Border plus padding the terminal dialog host draws around the content. */
26
27
  const TERMINAL_DIALOG_CHROME = 6;
27
28
  const FEATURE_LABEL_WIDTH = 16;
28
- const DEFAULT_TRIAL_DAYS = 7;
29
29
  const MS_PER_DAY = 24 * 60 * 60 * 1000;
30
30
 
31
31
  /** What the account can buy right now. Null fields mean the server could not say. */
@@ -66,7 +66,7 @@ export function upgradeDialogCopy(
66
66
  }
67
67
  const price = formatCloudPrice(offer.pricing, interval);
68
68
  if (offer.trialAvailable === true) {
69
- const days = offer.pricing?.trialDays ?? DEFAULT_TRIAL_DAYS;
69
+ const days = trialDaysOf(offer.pricing);
70
70
  const firstCharge = formatTrialEnd(new Date(now.getTime() + days * MS_PER_DAY));
71
71
  return {
72
72
  title: tf("Try Pro free for {days} days", { days }),
@@ -88,6 +88,31 @@ export function upgradeDialogCopy(
88
88
  };
89
89
  }
90
90
 
91
+ export interface ProStepCopy {
92
+ confirmLabel: string;
93
+ /** The line under the price. */
94
+ note: string;
95
+ }
96
+
97
+ /**
98
+ * Onboarding's Pro step makes the pitch itself and opens checkout without the
99
+ * sheet, so it keeps the sheet's rule: the free trial and "$0 today" only when
100
+ * the server confirmed this account still has its trial.
101
+ */
102
+ export function proStepCopy(offer: UpgradeOffer | null): ProStepCopy {
103
+ if (offer?.trialAvailable === true) {
104
+ const days = trialDaysOf(offer.pricing);
105
+ return {
106
+ confirmLabel: tf("Start {days}-day free trial", { days }),
107
+ note: tf("$0 today, free for {days} days. Card required. Cancel anytime.", { days }),
108
+ };
109
+ }
110
+ return {
111
+ confirmLabel: t("Continue to checkout"),
112
+ note: offer?.trialAvailable === false ? t("Billed today. Cancel anytime.") : t("Card required. Cancel anytime."),
113
+ };
114
+ }
115
+
91
116
  /** Ranked like the onboarding Pro step: the data first, then what reads it. */
92
117
  const PRO_FEATURES: Array<{ label: string; value: string }> = [
93
118
  { label: "Real-time data", value: "Free runs 15 min behind on quotes, 12 h on news" },
@@ -96,7 +121,8 @@ const PRO_FEATURES: Array<{ label: string; value: string }> = [
96
121
  { label: "Flow and X", value: "Options flow, the X feed and sentiment" },
97
122
  ];
98
123
 
99
- async function loadUpgradeOffer(): Promise<UpgradeOffer> {
124
+ /** Pricing and this account's trial and billing state; never rejects, unknowns come back null. */
125
+ export async function loadUpgradeOffer(): Promise<UpgradeOffer> {
100
126
  const [pricing, account] = await Promise.allSettled([
101
127
  apiClient.getCloudPricing(),
102
128
  apiClient.getCloudAccountPlan(),
@@ -19,7 +19,7 @@ interface CloudUpgradeStatusWidgetProps {
19
19
  */
20
20
  export function CloudUpgradeStatusWidget({ controller = chatController }: CloudUpgradeStatusWidgetProps) {
21
21
  useAppLanguage();
22
- const openUpgrade = useCloudUpgradeAction();
22
+ const openUpgrade = useCloudUpgradeAction("status-widget");
23
23
  const openPlan = useCloudPlanAction();
24
24
  // The status bar takes no keyboard focus; the chip names the command instead.
25
25
  const commandBarKey = useCommandBarShortcut();
@@ -488,7 +488,7 @@ export function TweetSearchTable({
488
488
  // header over "sign in" would read as a live, empty feed. A feed's search
489
489
  // bar stays above it so the query and the `/` hint still have a field.
490
490
  if (rows.length === 0 && error && isAuthError(error)) {
491
- const wall = <SignInWall action="search X" needsVerification={/verification/i.test(error)} />;
491
+ const wall = <SignInWall placement="x-search-signin" action="search X" needsVerification={/verification/i.test(error)} />;
492
492
  if (!rootBefore) return wall;
493
493
  return (
494
494
  <Box flexDirection="column" width={width} height={height}>