@gloom-sh/terminal 0.20.20 → 0.20.21

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 (365) hide show
  1. package/package.json +3 -1
  2. package/src/api-client/data.ts +1 -1
  3. package/src/api-client/equity-screener.ts +17 -0
  4. package/src/api-client/futures-curve.ts +5 -0
  5. package/src/api-client/market-discovery.ts +8 -0
  6. package/src/api-client/members.ts +2 -0
  7. package/src/api-client/paths.ts +3 -0
  8. package/src/api-client/perps.ts +20 -0
  9. package/src/api-client/request.ts +53 -7
  10. package/src/api-client/types/filings-and-calls.ts +2 -0
  11. package/src/app/pane-runtime/plugin-bindings.ts +6 -4
  12. package/src/app/pro-welcome/model.ts +15 -11
  13. package/src/app/pro-welcome/row.tsx +3 -3
  14. package/src/app/pro-welcome/use-pro-welcome.ts +2 -2
  15. package/src/app/runtime/startup.ts +3 -2
  16. package/src/app.tsx +3 -2
  17. package/src/capabilities/asset-data-inputs.ts +5 -0
  18. package/src/capabilities/factories.ts +8 -3
  19. package/src/capabilities/registry.ts +1 -0
  20. package/src/capabilities/types.ts +1 -0
  21. package/src/cli/commands/market.ts +68 -35
  22. package/src/cli/commands/options-chain.ts +2 -2
  23. package/src/cli/commands/overview.ts +10 -9
  24. package/src/cli/commands/ticker.ts +19 -4
  25. package/src/cli/desktop-pane-shot.ts +11 -3
  26. package/src/cli/export-source.ts +35 -2
  27. package/src/cli/glossary.ts +3 -2
  28. package/src/cli/helpers.ts +2 -1
  29. package/src/cli/history-demergers.ts +41 -10
  30. package/src/cli/history-rows.ts +3 -1
  31. package/src/cli/known-gaps.ts +21 -7
  32. package/src/cli/listing-arg.ts +22 -11
  33. package/src/cli/pane-functions/capabilities.ts +4 -9
  34. package/src/cli/pane-functions/catalog-snapshot.json +29 -29
  35. package/src/cli/pane-functions/catalog.ts +1 -18
  36. package/src/cli/pane-functions/data.ts +8 -4
  37. package/src/cli/pane-functions/financial-ratio-shot.ts +20 -5
  38. package/src/cli/pane-functions/freshness.ts +57 -12
  39. package/src/cli/pane-functions/function-help.ts +2 -2
  40. package/src/cli/pane-functions/headless.ts +6 -0
  41. package/src/cli/pane-functions/index.ts +11 -4
  42. package/src/cli/pane-functions/market-session.ts +25 -0
  43. package/src/cli/pane-functions/report-notices.ts +10 -0
  44. package/src/cli/pane-functions/resolver.ts +75 -3
  45. package/src/cli/pane-functions/screenshot-bridge.ts +1 -0
  46. package/src/cli/pane-functions/screenshot-data-evidence.ts +1 -0
  47. package/src/cli/pane-functions/screenshot-payload.ts +38 -5
  48. package/src/cli/pane-functions/screenshot-render.ts +20 -7
  49. package/src/cli/perpetual-contract.ts +14 -1
  50. package/src/cli/report-tables.ts +11 -2
  51. package/src/cli/result.ts +6 -1
  52. package/src/components/chart-table/layout.ts +8 -4
  53. package/src/components/command-bar/list/model.ts +2 -0
  54. package/src/components/command-bar/pane-templates/items.ts +5 -25
  55. package/src/components/command-bar/panel/index.tsx +7 -4
  56. package/src/components/command-bar/routes/root/provider-search.ts +4 -4
  57. package/src/components/command-bar/routes/root/results.ts +6 -2
  58. package/src/components/command-bar/routes/ticker-search/results.ts +19 -0
  59. package/src/components/command-bar/routes/ticker-search/route.ts +3 -3
  60. package/src/components/command-bar/routes/ticker-search/title.ts +23 -0
  61. package/src/components/command-bar/routing/list-state.ts +17 -5
  62. package/src/components/command-bar/selection-runtime.ts +3 -2
  63. package/src/components/command-bar/surface/index.tsx +2 -0
  64. package/src/components/command-bar/workflow/alert.ts +6 -4
  65. package/src/components/command-bar/workflow/collection-actions.ts +2 -1
  66. package/src/components/layout/pane/footer/index.tsx +1 -0
  67. package/src/components/layout/pane/footer/model.ts +20 -7
  68. package/src/components/layout/pane/title.ts +11 -2
  69. package/src/components/price-selector-dialog.tsx +8 -4
  70. package/src/components/ticker/badge/list.tsx +4 -3
  71. package/src/components/ticker/list-table-view.tsx +12 -1
  72. package/src/components/ui/query-bar.tsx +20 -14
  73. package/src/data/cached-query.ts +20 -4
  74. package/src/data/news-pane-snapshots.ts +2 -1
  75. package/src/data/plugin-cache.ts +5 -1
  76. package/src/data/saved-copies.ts +68 -2
  77. package/src/docs/snapshot.json +65 -14
  78. package/src/docs/topics.ts +11 -9
  79. package/src/i18n/es.ts +1 -0
  80. package/src/i18n/ja.ts +1 -0
  81. package/src/i18n/ko.ts +1 -0
  82. package/src/i18n/zh-cn.ts +1 -0
  83. package/src/i18n/zh-tw.ts +1 -0
  84. package/src/market-data/coordinator/index.ts +25 -5
  85. package/src/market-data/depositary-pair.ts +27 -10
  86. package/src/market-data/futures-roll-returns.ts +54 -7
  87. package/src/market-data/fx-closes.ts +14 -0
  88. package/src/market-data/market/futures-product-hours.ts +113 -0
  89. package/src/market-data/market/futures-week.ts +2 -0
  90. package/src/market-data/market/globex-day.ts +9 -2
  91. package/src/market-data/market/status.ts +32 -25
  92. package/src/market-data/market/venue-session.ts +18 -0
  93. package/src/market-data/options-alternatives.ts +49 -7
  94. package/src/market-data/perpetual-open-interest.ts +41 -0
  95. package/src/market-data/quotes/contributions.ts +4 -2
  96. package/src/market-data/quotes/export-identity.ts +11 -3
  97. package/src/market-data/quotes/freshness.ts +3 -2
  98. package/src/market-data/quotes/resolution.ts +9 -2
  99. package/src/market-data/quotes/tick-range.ts +22 -1
  100. package/src/market-data/quotes/time.ts +34 -4
  101. package/src/market-data/split-terms.ts +3 -2
  102. package/src/news/aggregator.ts +1 -0
  103. package/src/news/news-model.ts +12 -2
  104. package/src/news/types.ts +15 -0
  105. package/src/plugins/builtin/alerts/alert-engine.ts +2 -0
  106. package/src/plugins/builtin/alerts/cli-forms.ts +3 -2
  107. package/src/plugins/builtin/alerts/cli-move.ts +5 -2
  108. package/src/plugins/builtin/alerts/cli.ts +50 -25
  109. package/src/plugins/builtin/alerts/command.ts +51 -3
  110. package/src/plugins/builtin/alerts/event-rows.ts +1 -1
  111. package/src/plugins/builtin/alerts/events-pane.tsx +1 -1
  112. package/src/plugins/builtin/alerts/format.ts +67 -8
  113. package/src/plugins/builtin/alerts/headless.ts +22 -6
  114. package/src/plugins/builtin/alerts/index.tsx +26 -25
  115. package/src/plugins/builtin/alerts/move-checks.ts +1 -0
  116. package/src/plugins/builtin/alerts/pane.tsx +15 -6
  117. package/src/plugins/builtin/alerts/pro-rules.ts +9 -4
  118. package/src/plugins/builtin/alerts/quotes.ts +10 -5
  119. package/src/plugins/builtin/alerts/session.ts +28 -0
  120. package/src/plugins/builtin/alerts/types.ts +1 -0
  121. package/src/plugins/builtin/analytics/pane-model.ts +2 -1
  122. package/src/plugins/builtin/analytics/risk-model.ts +2 -2
  123. package/src/plugins/builtin/attention/headless.ts +2 -2
  124. package/src/plugins/builtin/attention/model.ts +7 -2
  125. package/src/plugins/builtin/attention/pane.tsx +2 -1
  126. package/src/plugins/builtin/awards/headless.ts +1 -1
  127. package/src/plugins/builtin/broker-trading/ticket.tsx +13 -5
  128. package/src/plugins/builtin/buildout/detail/company.tsx +0 -1
  129. package/src/plugins/builtin/buildout/detail/ui.tsx +7 -5
  130. package/src/plugins/builtin/buildout/model/normalizers.ts +0 -1
  131. package/src/plugins/builtin/buildout/model/types.ts +0 -1
  132. package/src/plugins/builtin/buildout/pane/index.tsx +9 -0
  133. package/src/plugins/builtin/buildout/pane/status.tsx +11 -0
  134. package/src/plugins/builtin/catalysts/headless.ts +1 -1
  135. package/src/plugins/builtin/chart-composer/headless.ts +14 -6
  136. package/src/plugins/builtin/chart-composer/pane.tsx +2 -1
  137. package/src/plugins/builtin/chart-composer/session-history.ts +14 -2
  138. package/src/plugins/builtin/chat/controller/index.ts +5 -3
  139. package/src/plugins/builtin/chat/controller/session-runtime.ts +18 -8
  140. package/src/plugins/builtin/chat/index.tsx +1 -1
  141. package/src/plugins/builtin/cloud/auth-actions.tsx +4 -2
  142. package/src/plugins/builtin/cloud/mcp-connect/dialog.tsx +4 -1
  143. package/src/plugins/builtin/cloud/thesis/ticker-tab.tsx +2 -1
  144. package/src/plugins/builtin/company-attention/headless.ts +2 -1
  145. package/src/plugins/builtin/company-kpis/headless.ts +1 -1
  146. package/src/plugins/builtin/correlation/headless.ts +3 -3
  147. package/src/plugins/builtin/correlation/history.ts +1 -0
  148. package/src/plugins/builtin/correlation/index.tsx +7 -5
  149. package/src/plugins/builtin/correlation/matrix/selection.ts +21 -3
  150. package/src/plugins/builtin/correlation/relationship/model.ts +5 -0
  151. package/src/plugins/builtin/correlation/relationship/pane.tsx +3 -2
  152. package/src/plugins/builtin/correlation/relationship/view-model.ts +3 -2
  153. package/src/plugins/builtin/credit-documents/headless.ts +1 -1
  154. package/src/plugins/builtin/dividend-yield/client.ts +81 -10
  155. package/src/plugins/builtin/dividend-yield/headless.ts +21 -10
  156. package/src/plugins/builtin/dividend-yield/model.ts +1 -1
  157. package/src/plugins/builtin/dividend-yield/pane.tsx +9 -5
  158. package/src/plugins/builtin/dividend-yield/ranking.ts +15 -5
  159. package/src/plugins/builtin/dividend-yield/reference-price.ts +3 -0
  160. package/src/plugins/builtin/dividend-yield/types.ts +12 -0
  161. package/src/plugins/builtin/dividend-yield/view.ts +30 -7
  162. package/src/plugins/builtin/doe/headless.ts +1 -1
  163. package/src/plugins/builtin/doe/pane.tsx +16 -7
  164. package/src/plugins/builtin/earnings-calls/data.ts +8 -5
  165. package/src/plugins/builtin/earnings-ripple/headless.ts +1 -1
  166. package/src/plugins/builtin/econ/calendar-model.ts +1 -1
  167. package/src/plugins/builtin/econ/index.tsx +26 -18
  168. package/src/plugins/builtin/equity-screener/client.ts +1 -1
  169. package/src/plugins/builtin/equity-screener/headless.ts +149 -31
  170. package/src/plugins/builtin/equity-screener/live.ts +23 -5
  171. package/src/plugins/builtin/equity-screener/model.ts +27 -12
  172. package/src/plugins/builtin/equity-screener/pane.tsx +5 -5
  173. package/src/plugins/builtin/exposure/headless.ts +1 -1
  174. package/src/plugins/builtin/exposure/holdings.ts +2 -2
  175. package/src/plugins/builtin/futures/index.tsx +29 -1
  176. package/src/plugins/builtin/futures/model.ts +93 -10
  177. package/src/plugins/builtin/futures/returns.ts +54 -1
  178. package/src/plugins/builtin/futures/table.tsx +14 -2
  179. package/src/plugins/builtin/futures/use-front-returns.ts +20 -3
  180. package/src/plugins/builtin/futures-curve/client.ts +1 -1
  181. package/src/plugins/builtin/futures-curve/headless.ts +9 -3
  182. package/src/plugins/builtin/futures-curve/model.ts +19 -5
  183. package/src/plugins/builtin/futures-curve/pane.tsx +12 -6
  184. package/src/plugins/builtin/gpu/headless.ts +1 -1
  185. package/src/plugins/builtin/gpu/model.ts +1 -1
  186. package/src/plugins/builtin/help/function-index.ts +16 -8
  187. package/src/plugins/builtin/help/functions-table.tsx +6 -4
  188. package/src/plugins/builtin/help/shortcut-model.ts +7 -2
  189. package/src/plugins/builtin/holders/headless.ts +16 -5
  190. package/src/plugins/builtin/holders/pane.tsx +43 -5
  191. package/src/plugins/builtin/insider/client.ts +118 -11
  192. package/src/plugins/builtin/insider/filing-stories.ts +36 -20
  193. package/src/plugins/builtin/insider/issuer.ts +5 -2
  194. package/src/plugins/builtin/iv-history/headless.ts +2 -0
  195. package/src/plugins/builtin/macro-day/client.ts +2 -3
  196. package/src/plugins/builtin/macro-day/comparison.ts +58 -0
  197. package/src/plugins/builtin/macro-day/headless.ts +47 -3
  198. package/src/plugins/builtin/macro-day/index.tsx +32 -9
  199. package/src/plugins/builtin/macro-day/model.ts +1 -1
  200. package/src/plugins/builtin/macro-day/pane.tsx +99 -12
  201. package/src/plugins/builtin/market-heatmap/index.tsx +2 -2
  202. package/src/plugins/builtin/market-movers/footer.ts +29 -3
  203. package/src/plugins/builtin/market-movers/headless.ts +12 -5
  204. package/src/plugins/builtin/market-movers/index.tsx +3 -3
  205. package/src/plugins/builtin/market-movers/session-body.tsx +6 -3
  206. package/src/plugins/builtin/market-valuation/detail.tsx +3 -3
  207. package/src/plugins/builtin/market-valuation/headless.ts +6 -6
  208. package/src/plugins/builtin/market-valuation/pane.tsx +2 -3
  209. package/src/plugins/builtin/market-valuation/view.ts +6 -8
  210. package/src/plugins/builtin/members/client.ts +9 -2
  211. package/src/plugins/builtin/members/headless.ts +8 -10
  212. package/src/plugins/builtin/members/model.ts +29 -17
  213. package/src/plugins/builtin/members/pane.tsx +10 -12
  214. package/src/plugins/builtin/money-markets/headless.ts +1 -1
  215. package/src/plugins/builtin/news/headless.ts +4 -0
  216. package/src/plugins/builtin/news/index.tsx +3 -1
  217. package/src/plugins/builtin/news/wire/industry-pane.tsx +2 -1
  218. package/src/plugins/builtin/news/wire/news/preset-pane.tsx +1 -1
  219. package/src/plugins/builtin/news/wire/persisted-articles.ts +8 -4
  220. package/src/plugins/builtin/notes/headless.ts +7 -0
  221. package/src/plugins/builtin/notes/index.tsx +1 -1
  222. package/src/plugins/builtin/notes/quick-notes-pane.tsx +18 -2
  223. package/src/plugins/builtin/options/view.tsx +7 -6
  224. package/src/plugins/builtin/options-positioning/headless.ts +4 -4
  225. package/src/plugins/builtin/options-positioning/pane.tsx +7 -3
  226. package/src/plugins/builtin/options-scenario/client.ts +20 -4
  227. package/src/plugins/builtin/options-scenario/headless.ts +1 -1
  228. package/src/plugins/builtin/pe-band/client.ts +5 -9
  229. package/src/plugins/builtin/pe-band/headless.ts +11 -13
  230. package/src/plugins/builtin/pe-band/model.ts +39 -60
  231. package/src/plugins/builtin/pe-band/pane.tsx +14 -15
  232. package/src/plugins/builtin/perps/equity-row.tsx +3 -1
  233. package/src/plugins/builtin/perps/freshness.ts +16 -9
  234. package/src/plugins/builtin/perps/headless.ts +4 -1
  235. package/src/plugins/builtin/perps/markets-section.tsx +16 -10
  236. package/src/plugins/builtin/perps/model.ts +33 -2
  237. package/src/plugins/builtin/perps/pane.tsx +3 -2
  238. package/src/plugins/builtin/perps/status-line.ts +12 -3
  239. package/src/plugins/builtin/perps/venue-markets.ts +38 -0
  240. package/src/plugins/builtin/plugin-marketplace/pane.tsx +4 -3
  241. package/src/plugins/builtin/portfolio-list/cell-version.ts +1 -1
  242. package/src/plugins/builtin/portfolio-list/cli/render.ts +46 -7
  243. package/src/plugins/builtin/portfolio-list/headless.ts +31 -8
  244. package/src/plugins/builtin/portfolio-list/settings.ts +3 -0
  245. package/src/plugins/builtin/portfolio-list/table.tsx +7 -1
  246. package/src/plugins/builtin/power/headless.ts +1 -1
  247. package/src/plugins/builtin/realized-vol/headless.ts +1 -1
  248. package/src/plugins/builtin/research/corporate-actions-pane.tsx +27 -13
  249. package/src/plugins/builtin/scanner/feed.ts +7 -4
  250. package/src/plugins/builtin/scanner/flow-pane.tsx +8 -4
  251. package/src/plugins/builtin/scanner/headless.ts +57 -26
  252. package/src/plugins/builtin/scanner/hilo-pane.tsx +6 -3
  253. package/src/plugins/builtin/scanner/lock-note.ts +3 -2
  254. package/src/plugins/builtin/scanner/us-session.ts +9 -0
  255. package/src/plugins/builtin/seasonality/client.ts +46 -10
  256. package/src/plugins/builtin/seasonality/headless.ts +29 -11
  257. package/src/plugins/builtin/seasonality/model.ts +101 -24
  258. package/src/plugins/builtin/seasonality/pane.tsx +10 -6
  259. package/src/plugins/builtin/sec/filing-content.ts +13 -0
  260. package/src/plugins/builtin/sec/index.tsx +16 -11
  261. package/src/plugins/builtin/sectors/client.ts +27 -5
  262. package/src/plugins/builtin/sectors/headless.ts +2 -1
  263. package/src/plugins/builtin/sectors/index.tsx +22 -10
  264. package/src/plugins/builtin/shared/cloud-resource.ts +3 -3
  265. package/src/plugins/builtin/shared/extended-print.ts +38 -0
  266. package/src/plugins/builtin/shared/pro-feature-wall.tsx +1 -1
  267. package/src/plugins/builtin/shared/report-freshness.ts +7 -3
  268. package/src/plugins/builtin/shared/scanner-capture.ts +16 -3
  269. package/src/plugins/builtin/shared/ticker-company.ts +17 -8
  270. package/src/plugins/builtin/shared/use-quote-board.ts +11 -4
  271. package/src/plugins/builtin/social-mentions/client.ts +7 -3
  272. package/src/plugins/builtin/social-mentions/outliers.tsx +9 -2
  273. package/src/plugins/builtin/thirteenf/api.ts +24 -3
  274. package/src/plugins/builtin/thirteenf/data.ts +21 -8
  275. package/src/plugins/builtin/thirteenf/headless.ts +7 -3
  276. package/src/plugins/builtin/thirteenf/signals-pane.tsx +10 -3
  277. package/src/plugins/builtin/thirteenf/signals.ts +22 -1
  278. package/src/plugins/builtin/ticker-detail/adr-pair/model.ts +4 -2
  279. package/src/plugins/builtin/ticker-detail/financials/model.ts +7 -0
  280. package/src/plugins/builtin/ticker-detail/financials/ratio-table.tsx +15 -6
  281. package/src/plugins/builtin/ticker-detail/financials/ratios.ts +5 -4
  282. package/src/plugins/builtin/ticker-detail/financials/tab.tsx +14 -5
  283. package/src/plugins/builtin/ticker-detail/headless.ts +32 -26
  284. package/src/plugins/builtin/ticker-detail/index.tsx +1 -1
  285. package/src/plugins/builtin/ticker-detail/overview/components.tsx +8 -3
  286. package/src/plugins/builtin/ticker-detail/overview/model.ts +28 -5
  287. package/src/plugins/builtin/ticker-detail/overview/pane.tsx +14 -1
  288. package/src/plugins/builtin/ticker-detail/overview-tab.tsx +9 -8
  289. package/src/plugins/builtin/ticker-detail/pane.tsx +16 -9
  290. package/src/plugins/builtin/ticker-detail/quote-monitor/card.tsx +41 -23
  291. package/src/plugins/builtin/ticker-detail/quote-monitor/rows.ts +30 -13
  292. package/src/plugins/builtin/ticker-detail/settings.ts +9 -2
  293. package/src/plugins/builtin/time-sales/headless.ts +49 -13
  294. package/src/plugins/builtin/time-sales/model.ts +2 -2
  295. package/src/plugins/builtin/time-sales/window.ts +84 -10
  296. package/src/plugins/builtin/vol-surface/charts.tsx +4 -2
  297. package/src/plugins/builtin/vol-surface/events.ts +12 -5
  298. package/src/plugins/builtin/vol-surface/headless.ts +1 -1
  299. package/src/plugins/builtin/vol-surface/pane.tsx +15 -7
  300. package/src/plugins/builtin/world-indices/footer.ts +1 -1
  301. package/src/plugins/builtin/world-venue-map/chokepoint-report.ts +3 -1
  302. package/src/plugins/builtin/world-venue-map/headless.ts +27 -13
  303. package/src/plugins/builtin/yield-curve/client.ts +3 -1
  304. package/src/plugins/duplicates.ts +60 -0
  305. package/src/plugins/loader.ts +12 -3
  306. package/src/plugins/marketplace/model.ts +10 -1
  307. package/src/portfolio/column-values.ts +52 -5
  308. package/src/react/async-resource.ts +8 -7
  309. package/src/renderers/browser/bundled-plugins.ts +2 -1
  310. package/src/renderers/dom/build-assets.ts +20 -0
  311. package/src/renderers/dom/data-table/index.tsx +36 -2
  312. package/src/renderers/dom/es2023-array-methods.ts +57 -0
  313. package/src/renderers/dom/host/surface-fit.ts +64 -13
  314. package/src/renderers/dom/styles.css +6 -1
  315. package/src/renderers/electrobun/bun/external-plugins.ts +16 -6
  316. package/src/renderers/electrobun/shared/protocol.ts +2 -0
  317. package/src/renderers/electrobun/view/cli-pane-shot-entry.tsx +31 -7
  318. package/src/renderers/electrobun/view/cli-pane-shot-frame.tsx +15 -8
  319. package/src/renderers/electrobun/view/external-plugins.ts +1 -0
  320. package/src/renderers/electrobun/view/remote/asset-data-client.ts +1 -0
  321. package/src/series/types.ts +1 -0
  322. package/src/sources/gloomberb-cloud/fred-attribution.ts +6 -5
  323. package/src/sources/gloomberb-cloud/index.ts +42 -5
  324. package/src/sources/gloomberb-cloud/news.ts +15 -2
  325. package/src/sources/gloomberb-cloud/normalizers.ts +9 -0
  326. package/src/sources/history-result.ts +2 -1
  327. package/src/sources/history-retention.ts +14 -2
  328. package/src/sources/listing-symbols.ts +1 -1
  329. package/src/sources/provider-router/cache.ts +32 -3
  330. package/src/sources/provider-router/cached-routes.ts +25 -0
  331. package/src/sources/provider-router/connection-health.ts +1 -0
  332. package/src/sources/provider-router/history.ts +2 -2
  333. package/src/sources/provider-router/index.ts +14 -0
  334. package/src/sources/provider-router/sec-filings-page.ts +25 -0
  335. package/src/sources/sec-edgar/content.ts +67 -36
  336. package/src/tickers/listing-fate.ts +28 -0
  337. package/src/tickers/search/home-listing.ts +3 -0
  338. package/src/tickers/search/index-root-lead.ts +40 -0
  339. package/src/tickers/terminal-codes.ts +7 -4
  340. package/src/time-series/base-series.ts +17 -8
  341. package/src/time-series/fundamentals/historical-valuation.ts +2 -2
  342. package/src/time-series/fundamentals/series.ts +15 -12
  343. package/src/time-series/history-acquisition.ts +2 -0
  344. package/src/time-series/market.ts +3 -1
  345. package/src/time-series/price-comparison.ts +3 -1
  346. package/src/time-series/resolve-context.ts +8 -0
  347. package/src/time-series/resolve.ts +50 -10
  348. package/src/time-series/types.ts +1 -0
  349. package/src/time-series/use-chart-resolution.ts +2 -2
  350. package/src/time-series/valuation-currency.ts +40 -12
  351. package/src/types/data-provider.ts +30 -1
  352. package/src/types/financials.ts +23 -0
  353. package/src/types/headless.ts +23 -0
  354. package/src/types/instrument.ts +1 -0
  355. package/src/utils/crypto-pair.ts +16 -0
  356. package/src/utils/exchange-announcements.ts +2 -1
  357. package/src/utils/exchange-notation.generated.ts +58 -1
  358. package/src/utils/exchanges.ts +43 -1
  359. package/src/utils/format.ts +37 -2
  360. package/src/utils/function-search.ts +38 -0
  361. package/src/utils/fuzzy-search.ts +10 -6
  362. package/src/utils/option-choice.ts +15 -0
  363. package/src/utils/price-history.ts +15 -1
  364. package/src/utils/reason-codes.ts +6 -3
  365. package/src/utils/trailing-dividend.ts +241 -28
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gloom-sh/terminal",
3
- "version": "0.20.20",
3
+ "version": "0.20.21",
4
4
  "packageManager": "bun@1.3.14",
5
5
  "description": "Market research and portfolio tracker for the terminal",
6
6
  "module": "src/public/index.ts",
@@ -65,6 +65,7 @@
65
65
  "desktop:release": "electrobun build --env=stable && bun scripts/name-desktop-artifacts.ts artifacts stable",
66
66
  "desktop:release:windows": "electrobun build --env=stable && bun scripts/name-desktop-artifacts.ts artifacts stable",
67
67
  "desktop:sync": "electrobun sync && bun run scripts/patch-electrobun-devkit.ts",
68
+ "desktop:sync:pinned": "bun scripts/electrobun-toolchain.ts sync && bun run scripts/patch-electrobun-devkit.ts",
68
69
  "docs:snapshot": "bun run scripts/update-docs-snapshot.ts",
69
70
  "listings:snapshot": "bun run scripts/update-major-listings.ts",
70
71
  "japanese-names:snapshot": "bun run scripts/update-japanese-names.ts",
@@ -146,6 +147,7 @@
146
147
  "@tanstack/react-virtual": "^3.14.2",
147
148
  "fflate": "0.8.3",
148
149
  "hls.js": "1.6.13",
150
+ "htmlparser2": "^12.0.0",
149
151
  "jimp": "1.6.1",
150
152
  "qrcode-generator": "^2.0.4",
151
153
  "react": "19.2.7",
@@ -529,7 +529,7 @@ export class CloudDataApi {
529
529
  return this.request<import("./members").FundMembersPayload>(`/cloud/members/${encodeURIComponent(fund)}`);
530
530
  }
531
531
 
532
- /** The ETFs whose latest holdings hold a US stock. */
532
+ /** The ETFs whose latest holdings hold a stock. */
533
533
  getStockFunds(symbol: string) {
534
534
  return this.request<import("./members").StockFundsPayload>(`/cloud/members/holding/${encodeURIComponent(symbol)}`);
535
535
  }
@@ -2,6 +2,12 @@
2
2
  export const KPI_FIELDS = ["kpiArr", "kpiNrrPercent", "kpiRpo", "kpiCrpo", "kpiSubscribers", "kpiDau", "kpiMau", "kpiGmv", "kpiTakeRatePercent", "kpiSameStoreSalesPercent", "kpiStores", "kpiBacklog", "kpiBookToBill", "kpiNimPercent", "kpiCet1Percent", "kpiCombinedRatioPercent", "kpiOccupancyPercent", "kpiLoadFactorPercent", "guideRevenueChangePercent", "guideEpsChangePercent"] as const;
3
3
  /** Payout ratio and dividend growth; listed only when asked (`include=dividends`), and omitted by a server from before them. */
4
4
  export const DIVIDEND_FIELDS = ["payoutRatioPercent", "dividendGrowth1YPercent", "dividendGrowth3YPercent"] as const;
5
+ /**
6
+ * The trailing dividend yield beside the forward one (`dividendYieldPercent`): DVD's Trailing yield, the last 12 months
7
+ * of distributions, specials included, on the paid history. Listed only when asked (`include=trailing-yield`), and
8
+ * omitted by a server from before it.
9
+ */
10
+ export const TRAILING_YIELD_FIELDS = ["trailingDividendYieldPercent"] as const;
5
11
  /**
6
12
  * Technical readings of the stored daily bars at the last completed session; listed only when asked
7
13
  * (`include=technical`), and omitted by a server from before them.
@@ -65,6 +71,7 @@ export const NUMERIC_FIELDS = [
65
71
  "forwardPE",
66
72
  "enterpriseToRevenue",
67
73
  "dividendYieldPercent",
74
+ ...TRAILING_YIELD_FIELDS,
68
75
  ...DIVIDEND_FIELDS,
69
76
  "revenueGrowthPercent",
70
77
  "earningsGrowthPercent",
@@ -159,6 +166,16 @@ export interface ScreenMetric {
159
166
  unit: string;
160
167
  /** Source observation date or timestamp. Never filled from collection time. */
161
168
  asOf: string | null;
169
+ /**
170
+ * When the price was printed, on a price that is the last on record rather
171
+ * than its venue's latest session's (state `stale`, with its reason).
172
+ */
173
+ printedAt?: string;
174
+ /**
175
+ * The end of the period a forecast is for (a guide for the fiscal year in
176
+ * progress): a forward date, never the as-of, which is when it was given.
177
+ */
178
+ periodEnd?: string;
162
179
  /** Latest known public filing date where supplied by the source. */
163
180
  availableAt: string | null;
164
181
  observedAt: string | null;
@@ -88,6 +88,11 @@ export interface FuturesContract {
88
88
  quoteUnit: string
89
89
  volume: number | null
90
90
  openInterest: number | null
91
+ /**
92
+ * The session `openInterest` counts (YYYY-MM-DD): exchanges publish it once a session, a day or so after, so it is
93
+ * not as of `asOf`. Null when the server cannot date a count it carried forward; absent from older servers.
94
+ */
95
+ openInterestAsOf?: string | null
91
96
  delayMinutes: number | null
92
97
  stale: boolean
93
98
  percentile: number | null
@@ -115,6 +115,14 @@ export interface DividendSummary {
115
115
  trailingEps?: number | null;
116
116
  exDividendDate: number | null;
117
117
  dividendDate: number | null;
118
+ /**
119
+ * The company's other listing (SHEL:NYSE) dividendDate is from, where this
120
+ * listing's sources state none: one distribution, paid on one day on every
121
+ * line. Absent for a listing's own date and from older servers.
122
+ */
123
+ dividendDateListing?: string;
124
+ /** The same for exDividendDate: a distribution another listing has declared ahead. */
125
+ exDividendDateListing?: string;
118
126
  currency: string | null;
119
127
  }
120
128
 
@@ -51,6 +51,8 @@ export interface StockFund {
51
51
  ticker: string; name: string; basis: "daily" | "nport"; weight: number | null; shares: number; marketValue: number | null;
52
52
  /** The stock as the fund's holdings name it. */
53
53
  holdingName: string;
54
+ holdingType?: "ordinary" | "adr";
55
+ receiptTicker?: string;
54
56
  asOf: string; filedOn: string | null; sourceUrl?: string;
55
57
  }
56
58
  /**
@@ -260,6 +260,8 @@ export type CloudSecFilingsParams = {
260
260
  offset?: number;
261
261
  /** Only these forms, each with its amendment (`8-K` is also `8-K/A`). A server that predates the filter sends every form. */
262
262
  forms?: readonly string[];
263
+ /** Also the newest filing day of each form the whole list holds (`newestByForm`), whatever the page's forms. */
264
+ newestByForm?: boolean;
263
265
  };
264
266
 
265
267
  export type CloudSecFilingParams = {
@@ -468,6 +470,7 @@ export function cloudSecFilingsPath(params: CloudSecFilingsParams): string {
468
470
  if (params.offset != null) search.set("offset", String(params.offset));
469
471
  if (params.forms?.length) search.set("form", params.forms.join(","));
470
472
  if (params.proceedsSince) search.set("proceedsSince", params.proceedsSince);
473
+ if (params.newestByForm) search.set("newestByForm", "1");
471
474
  setListingAbroad(search, abroad);
472
475
  return appendQuery("/cloud/sec/filings", search);
473
476
  }
@@ -2,6 +2,24 @@ const ASSET_CLASSES = ["stocks", "indices", "energy", "metals", "fx", "crypto",
2
2
  type AssetClass = (typeof ASSET_CLASSES)[number]
3
3
  type PerpVenue = "hyperliquid" | "binance" | "bybit" | "okx" | "deribit" | "coinbase" | "kraken" | "dydx"
4
4
 
5
+ /**
6
+ * Where a market's open interest was read, when, and how its USD figure was made: a venue can serve it from another
7
+ * endpoint than the mark (Binance's openInterest), read at another moment, or stream it, so the market's own source
8
+ * and time do not date it.
9
+ */
10
+ export interface PerpOpenInterestSource {
11
+ /** The venue endpoint, or socket, that returned it. */
12
+ url: string
13
+ /** When it was read. */
14
+ observedAt: string
15
+ /** The venue's own time for the reading; null when it gives none. */
16
+ asOf: string | null
17
+ /** The venue's own value (`venue`), contracts × mark or oracle, or USD contracts × face value; null without a USD figure. */
18
+ usdBasis: "venue" | "mark" | "oracle" | "face-value" | null
19
+ /** The stablecoin the USD figure takes at 1 USD; null when it is in USD itself. */
20
+ usdParity: string | null
21
+ }
22
+
5
23
  /** Rates and premiums are fractions, timestamps UTC; null always means unavailable. */
6
24
  interface PerpMarket {
7
25
  marketId: string
@@ -34,6 +52,8 @@ interface PerpMarket {
34
52
  nextFundingAt: string | null
35
53
  openInterestBase: number | null
36
54
  openInterestUsd: number | null
55
+ /** Absent from servers older than it, and from a market stored before it was recorded. */
56
+ openInterestSource?: PerpOpenInterestSource | null
37
57
  volume24hUsd: number | null
38
58
  maxLeverage: number | null
39
59
  isolatedOnly: boolean | null
@@ -87,6 +87,22 @@ export function marketReadLimitMs(pathname: string): number {
87
87
  const DROPPED_RETRY_MIN_MS = 100;
88
88
  const DROPPED_RETRY_SPREAD_MS = 400;
89
89
 
90
+ /**
91
+ * The text of one SEC filing. The service answers it 503 with a Retry-After
92
+ * of 2 to 600 seconds when the SEC turns it away or the service's own line
93
+ * to the SEC stays busy for five seconds (`filingTextWaitMs`).
94
+ */
95
+ const FILING_TEXT_PATH = "/cloud/sec/filing/content";
96
+ /**
97
+ * The longest Retry-After a filing text read waits out before it is asked
98
+ * once more. Four seconds lets a short SEC burst end as slower reads instead
99
+ * of rows that say they were not read, while a report of 100 filings, read
100
+ * four at a time, waits at most this long more for each round of reads the
101
+ * burst holds up. A longer Retry-After is never cut short: the read is not
102
+ * asked again, and fails as it did before.
103
+ */
104
+ const FILING_TEXT_RETRY_MAX_MS = 4_000;
105
+
90
106
  /**
91
107
  * Whether asking twice is harmless: a GET or HEAD, or a POST under the market
92
108
  * paths, which are batch reads. Writes are never sent twice: the first may
@@ -453,14 +469,36 @@ function isRestartAnswer(response: CloudApiResponse): boolean {
453
469
  }
454
470
 
455
471
  /**
456
- * Sends a read, and once more after a short pause when its connection
457
- * dropped before the answer began (`isDroppedConnection`), or the answer
458
- * says its server is going away (`isRestartAnswer`). Only once: a second
459
- * failure is the service's state, and is reported as before.
472
+ * How long a filing text read waits before it is asked once more: the
473
+ * Retry-After of its 503, in whole seconds, when that is over a second (a
474
+ * second or less is a server going away, `isRestartAnswer`) and at most
475
+ * FILING_TEXT_RETRY_MAX_MS. Null for any other answer, a longer wait, or a
476
+ * Retry-After that is no number of seconds (a date reads against this
477
+ * machine's clock, which may be off).
478
+ */
479
+ function filingTextWaitMs(path: string, response: CloudApiResponse): number | null {
480
+ if (response.status !== 503 || path.split("?")[0] !== FILING_TEXT_PATH) return null;
481
+ const retryAfter = response.headers.get("Retry-After")?.trim() ?? "";
482
+ if (!/^\d+$/.test(retryAfter)) return null;
483
+ const waitMs = Number(retryAfter) * 1000;
484
+ return waitMs > 1000 && waitMs <= FILING_TEXT_RETRY_MAX_MS ? waitMs : null;
485
+ }
486
+
487
+ /**
488
+ * Sends a read, and once more when its connection dropped before the answer
489
+ * began (`isDroppedConnection`) or the answer says its server is going away
490
+ * (`isRestartAnswer`), after a short pause; or when a filing text read is
491
+ * told to come back shortly, after the wait it was told
492
+ * (`filingTextWaitMs`). Only once in all: a second failure is the service's
493
+ * state, and is reported as before. `answered` hears that the first answer
494
+ * came, so a request waiting out its Retry-After is not taken for one that
495
+ * hung.
460
496
  */
461
497
  async function sendAgainIfCutOff(
462
498
  sendOnce: () => Promise<CloudApiResponse>,
463
499
  signal: AbortSignal | null | undefined,
500
+ path: string,
501
+ answered: () => void,
464
502
  ): Promise<CloudApiResponse> {
465
503
  let first: CloudApiResponse;
466
504
  try {
@@ -470,10 +508,17 @@ async function sendAgainIfCutOff(
470
508
  await pause(DROPPED_RETRY_MIN_MS + Math.random() * DROPPED_RETRY_SPREAD_MS, signal);
471
509
  return sendOnce();
472
510
  }
473
- if (!isRestartAnswer(first)) return first;
511
+ let waitMs: number | null;
512
+ if (isRestartAnswer(first)) {
513
+ waitMs = DROPPED_RETRY_MIN_MS + Math.random() * DROPPED_RETRY_SPREAD_MS;
514
+ } else {
515
+ waitMs = filingTextWaitMs(path, first);
516
+ if (waitMs == null) return first;
517
+ answered();
518
+ }
474
519
  // Read and drop the replaced answer's body, so its connection is released.
475
520
  first.text().catch(() => { /* Intentional ignore: this answer is replaced by the next. */ });
476
- await pause(DROPPED_RETRY_MIN_MS + Math.random() * DROPPED_RETRY_SPREAD_MS, signal);
521
+ await pause(waitMs, signal);
477
522
  return sendOnce();
478
523
  }
479
524
 
@@ -995,10 +1040,11 @@ export class CloudApiRequestTransport {
995
1040
  credentials: "include",
996
1041
  signal,
997
1042
  });
1043
+ const epoch = reachEpoch;
998
1044
  // Inside the reach check: a read that gets through on its second try was answered, not an outage.
999
1045
  const response = await this.reachService(
1000
1046
  url,
1001
- () => (repeatable ? sendAgainIfCutOff(sendOnce, signal) : sendOnce()),
1047
+ () => (repeatable ? sendAgainIfCutOff(sendOnce, signal, path, () => this.recordAnswer(epoch)) : sendOnce()),
1002
1048
  signal,
1003
1049
  isBackgroundRequest(path),
1004
1050
  );
@@ -349,6 +349,8 @@ export interface CloudSecFilingsResponse {
349
349
  nextOffset: number;
350
350
  /** The company's home line the filings are read from, when not the listing asked (a foreign line). */
351
351
  companyFrom?: CompanyFrom;
352
+ /** Asked with `newestByForm`: each form's newest filing day across the whole list. Absent from older servers. */
353
+ newestByForm?: Record<string, string>;
352
354
  }
353
355
 
354
356
  export interface CloudSecDocumentsResponse {
@@ -414,7 +414,8 @@ export function bindAppPanePluginRegistry({
414
414
  setMarketplaceHost({
415
415
  listInstalled: () => {
416
416
  const disabled = new Set(stateRef.current.config.disabledPlugins ?? []);
417
- const externalById = new Map(listExternalPlugins().map((entry) => [entry.plugin.id, entry]));
417
+ // A skipped duplicate stands in under its folder's name, which can be the id of the copy that loads.
418
+ const externalById = new Map(listExternalPlugins().filter((entry) => !entry.duplicateOf).map((entry) => [entry.plugin.id, entry]));
418
419
  const installed: InstalledPlugin[] = [];
419
420
 
420
421
  for (const plugin of pluginRegistry.allPlugins.values()) {
@@ -444,13 +445,13 @@ export function bindAppPanePluginRegistry({
444
445
  // Entries that never registered — a broken import, or a plugin this
445
446
  // renderer cannot run. They are invisible everywhere else, which is
446
447
  // exactly why the marketplace has to show them.
447
- for (const entry of externalById.values()) {
448
+ for (const entry of [...externalById.values(), ...listExternalPlugins().filter((candidate) => candidate.duplicateOf)]) {
448
449
  installed.push({
449
- id: entry.plugin.id,
450
+ id: entry.duplicateOf ? `${entry.directory ?? entry.path} (duplicate)` : entry.plugin.id,
450
451
  name: entry.plugin.name,
451
452
  version: entry.plugin.version ?? "",
452
453
  ...(entry.plugin.description ? { description: entry.plugin.description } : {}),
453
- toggleable: true,
454
+ toggleable: !entry.duplicateOf,
454
455
  enabled: !disabled.has(entry.plugin.id),
455
456
  source: "external",
456
457
  ...(entry.directory ? { directory: entry.directory, path: entry.path } : {}),
@@ -458,6 +459,7 @@ export function bindAppPanePluginRegistry({
458
459
  ...(entry.linked ? { linked: true } : {}),
459
460
  ...(entry.unsupportedTarget ? { unsupportedTarget: entry.unsupportedTarget } : {}),
460
461
  ...(entry.error ? { loadError: entry.error } : {}),
462
+ ...(entry.duplicateOf ? { duplicateOf: entry.duplicateOf } : {}),
461
463
  ...(entry.needsGloomberb ? { needsGloomberb: entry.needsGloomberb } : {}),
462
464
  ...(entry.needsRestart ? { needsRestart: true } : {}),
463
465
  });
@@ -7,12 +7,14 @@ import type { TickerRecord } from "../../types/ticker";
7
7
  import { trackedListings } from "../since-last-visit/model";
8
8
 
9
9
  /**
10
- * The row a new Pro payer sees in their first two weeks: a few Pro functions
11
- * they have not opened yet, each on one of their own tickers. Everything it
12
- * reads is already on this machine (the command bar's recent runs, the
13
- * layouts, the portfolios, watchlists and recently viewed tickers) except the
14
- * first charge's date, which the account's own plan answer carries. Nothing
15
- * about it is kept per account or sent anywhere.
10
+ * The row someone new to Pro sees, from the first day of their trial through
11
+ * two weeks after their first charge: a few Pro functions they have not
12
+ * opened yet, each on one of their own tickers. The trial is the week that
13
+ * decides whether Pro is kept, so the row is there from its first day.
14
+ * Everything it reads is already on this machine (the command bar's recent
15
+ * runs, the layouts, the portfolios, watchlists and recently viewed tickers)
16
+ * except the first charge's date, which the account's own plan answer
17
+ * carries. Nothing about it is kept per account or sent anywhere.
16
18
  */
17
19
 
18
20
  const DAY_MS = 86_400_000;
@@ -63,13 +65,15 @@ export interface ProWelcomeEligibility {
63
65
  }
64
66
 
65
67
  /**
66
- * A payer of their own Pro plan from the day of their first paid charge
67
- * through day 14. Not on a trial (no charge yet), not with Pro through a team
68
- * seat, not once dismissed, and not when the server gave no first charge.
68
+ * Someone on a trial of their own Pro plan, every day of it, and a payer of
69
+ * their own plan from the day of their first paid charge through day 14. Not
70
+ * with Pro through a team seat, not once dismissed, and for a payer not when
71
+ * the server gave no first charge.
69
72
  */
70
73
  export function proWelcomeEligible({ access, plan, dismissed, now }: ProWelcomeEligibility): boolean {
71
- if (dismissed || !access.isPayingPro || access.isTrialActive) return false;
72
- if (!plan || plan.proTeam) return false;
74
+ if (dismissed || !plan || plan.proTeam) return false;
75
+ if (access.isTrialActive) return true;
76
+ if (!access.isPayingPro) return false;
73
77
  const firstCharge = Date.parse(plan.firstChargeAt ?? "");
74
78
  if (!Number.isFinite(firstCharge)) return false;
75
79
  // A charge a moment ahead of this machine's clock is today's.
@@ -77,9 +77,9 @@ function fitTerminalRow(
77
77
  }
78
78
 
79
79
  /**
80
- * The row a new Pro payer sees under the header in their first two weeks: a
81
- * few Pro functions they have not opened, each a chip that opens it on one
82
- * of their own tickers. Dismiss puts it away for good on this machine (the
80
+ * The row someone new to Pro sees under the header, through their trial and
81
+ * their first two paid weeks: a few Pro functions they have not opened, each
82
+ * a chip that opens it on one of their own tickers. Dismiss puts it away for good on this machine (the
83
83
  * notification dismiss key too; the notification action key opens the first).
84
84
  */
85
85
  export function ProWelcomeRow({ welcome }: { welcome: ProWelcome }) {
@@ -55,7 +55,7 @@ function readDismissed(pluginState: Pick<AppPluginStateStorePort, "get">): boole
55
55
  /**
56
56
  * The first-weeks Pro row's session (see `./model.ts` for who sees it and
57
57
  * what it names). The account's plan is asked for once a session, and only
58
- * for a paying Pro account that has not dismissed the row.
58
+ * for an account on a trial or paying for Pro that has not dismissed the row.
59
59
  */
60
60
  export function useProWelcome({
61
61
  active,
@@ -95,7 +95,7 @@ export function useProWelcome({
95
95
  const asked = useRef(new Set<string>());
96
96
  const loadPlanRef = useRef(loadPlan);
97
97
  loadPlanRef.current = loadPlan;
98
- const wanted = active && initialized && ready && !dismissed && access.isPayingPro && !!accountId;
98
+ const wanted = active && initialized && ready && !dismissed && (access.isPayingPro || access.isTrialActive) && !!accountId;
99
99
 
100
100
  useEffect(() => {
101
101
  if (!wanted || !accountId || asked.current.has(accountId)) return;
@@ -192,11 +192,12 @@ export function useAppStartupRuntime({
192
192
 
193
193
  // A plugin that failed to import is otherwise silent: its panes are simply
194
194
  // absent, and the reason sits in a pane the user has no cause to open. Say
195
- // so once, with a way in. Unsupported-renderer entries are not failures.
195
+ // so once, with a way in. Unsupported-renderer entries and a second folder of
196
+ // a plugin that loads from another are not failures; the Plugins pane lists them.
196
197
  useEffect(() => {
197
198
  // Popped-out desktop panes load the same list; the main window owns the notice.
198
199
  if (!state.initialized || isDetachedWindow) return;
199
- const failed = externalPlugins.filter((entry) => entry.error && !entry.unsupportedTarget);
200
+ const failed = externalPlugins.filter((entry) => entry.error && !entry.unsupportedTarget && !entry.duplicateOf);
200
201
  if (failed.length === 0) return;
201
202
  const names = failed.map((entry) => entry.plugin.name);
202
203
  const body = failed.length === 1
package/src/app.tsx CHANGED
@@ -518,8 +518,9 @@ function AppInner({
518
518
  notify: notifyRequest,
519
519
  });
520
520
  const showSinceLastVisit = !!sinceLastVisit.recap && state.config.presentationMode !== true;
521
- // A new Pro payer's first two weeks: Pro functions they have not opened, on
522
- // their own tickers. Its own row under the strip, never part of it.
521
+ // Someone new to Pro, through the trial and the first two paid weeks: Pro
522
+ // functions they have not opened, on their own tickers. Its own row under
523
+ // the strip, never part of it.
523
524
  const proWelcome = useProWelcome({
524
525
  active: !appWideWorkElsewhere && !onboardingActive && !signInGateActive,
525
526
  pluginState: pluginRegistry.persistence.pluginState,
@@ -58,6 +58,11 @@ const ASSET_DATA_OPERATION_SPECS: Readonly<Record<string, AssetDataOperationSpec
58
58
  summary: "Recent SEC filings",
59
59
  fields: [required("ticker", "string"), optional("count", "number"), optional("exchange", "string"), optional("context", "object")],
60
60
  },
61
+ getSecFilingsPage: {
62
+ summary: "A page of SEC filings of some forms",
63
+ fields: [required("ticker", "string"), required("query", "object"), optional("exchange", "string"), optional("context", "object")],
64
+ examples: ['api invoke asset-data.asset-data-router.getSecFilingsPage \'{"ticker":"PG","query":{"forms":["4"],"limit":20}}\''],
65
+ },
61
66
  getHolders: { summary: "Institutional and fund holders", fields: LISTING },
62
67
  getAnalystResearch: { summary: "Analyst ratings and price targets", fields: LISTING },
63
68
  getCorporateActions: { summary: "Dividends, splits and reported earnings", fields: LISTING },
@@ -1,4 +1,5 @@
1
- import type { AssetDataProvider } from "../types/data-provider";
1
+ import type { AssetDataProvider, SecFilingItem } from "../types/data-provider";
2
+ import { filingContentPreview } from "../sources/sec-edgar/content";
2
3
  import { quoteMetadataFromQuote } from "../market-data/quotes/metadata";
3
4
  import { assetDataOperationContract } from "./asset-data-inputs";
4
5
  import type { NewsDataProvider } from "../types/capability-route-source";
@@ -56,6 +57,8 @@ export function assetDataProvider(provider: AssetDataProvider): AssetDataCapabil
56
57
  if (!provider.getSecFilings) throw new Error(`${provider.name} does not provide SEC filings.`);
57
58
  return provider.getSecFilings(input.ticker, input.count, input.exchange, input.context);
58
59
  }, "query"),
60
+ ...(provider.getSecFilingsPage ? { getSecFilingsPage: op((input: any) =>
61
+ provider.getSecFilingsPage!(input.ticker, input.query, input.exchange, input.context), "query") } : {}),
59
62
  getHolders: op((input: any) => {
60
63
  if (!provider.getHolders) throw new Error(`${provider.name} does not provide holders.`);
61
64
  return provider.getHolders(input.ticker, input.exchange, input.context);
@@ -77,9 +80,11 @@ export function assetDataProvider(provider: AssetDataProvider): AssetDataCapabil
77
80
  if (!provider.getSecFilingDocuments) throw new Error(`${provider.name} does not provide SEC filing documents.`);
78
81
  return provider.getSecFilingDocuments(input.filing);
79
82
  }, "query"),
80
- getSecFilingContent: op((input: any) => {
83
+ getSecFilingContent: op(async (input, { renderer }) => {
81
84
  if (!provider.getSecFilingContent) throw new Error(`${provider.name} does not provide SEC filing content.`);
82
- return provider.getSecFilingContent(input.filing);
85
+ const { filing } = input as { filing: SecFilingItem };
86
+ const raw = await provider.getSecFilingContent(filing);
87
+ return renderer ? raw : filingContentPreview(raw, filing);
83
88
  }, "query"),
84
89
  getArticleSummary: op((input: any) => provider.getArticleSummary(input.url), "query"),
85
90
  getPriceHistory: op((input: any) => provider.getPriceHistory(input.ticker, input.exchange, input.range, input.context), "query"),
@@ -109,6 +109,7 @@ export class CapabilityRegistry {
109
109
  const invoke = () => Promise.resolve(operation.handler!(input, {
110
110
  capability,
111
111
  operationId,
112
+ renderer: options.renderer,
112
113
  signal: options.signal,
113
114
  }));
114
115
  const health = this.options.connectionHealth;
@@ -26,6 +26,7 @@ export interface CapabilitySchema<T = unknown> {
26
26
  interface CapabilityHandlerContext {
27
27
  capability: PluginCapability;
28
28
  operationId: string;
29
+ renderer?: boolean;
29
30
  signal?: AbortSignal;
30
31
  }
31
32