gloomberb 0.19.6 → 0.20.1

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 (209) hide show
  1. package/LICENSE +0 -4
  2. package/package.json +6 -5
  3. package/patches/electrobun-devkit@2.0.5.patch +408 -0
  4. package/src/api-client/bond-trades.ts +59 -0
  5. package/src/api-client/crypto-markets.ts +20 -2
  6. package/src/api-client/data.ts +21 -0
  7. package/src/api-client/fund-facts.ts +23 -1
  8. package/src/api-client/index.ts +2 -0
  9. package/src/api-client/types/account.ts +86 -0
  10. package/src/api-client/types/assist.ts +32 -0
  11. package/src/api-client/types/auth.ts +63 -0
  12. package/src/api-client/types/billing.ts +54 -0
  13. package/src/api-client/types/chat.ts +180 -0
  14. package/src/api-client/types/congress.ts +107 -0
  15. package/src/api-client/types/credit.ts +110 -0
  16. package/src/api-client/types/econ.ts +158 -0
  17. package/src/api-client/types/equity-diagnostic.ts +73 -0
  18. package/src/api-client/types/filings-and-calls.ts +356 -0
  19. package/src/api-client/types/index.ts +25 -0
  20. package/src/api-client/types/jobs.ts +147 -0
  21. package/src/api-client/types/market.ts +122 -0
  22. package/src/api-client/types/news.ts +91 -0
  23. package/src/api-client/types/notes-and-theses.ts +172 -0
  24. package/src/api-client/types/quotes.ts +28 -0
  25. package/src/api-client/types/scanners.ts +125 -0
  26. package/src/api-client/types/screener.ts +65 -0
  27. package/src/api-client/types/search.ts +107 -0
  28. package/src/api-client/types/sync.ts +14 -0
  29. package/src/api-client/types/team-collections.ts +43 -0
  30. package/src/api-client/types/team-views.ts +32 -0
  31. package/src/api-client/types/teams.ts +135 -0
  32. package/src/api-client/types/ticker-data.ts +57 -0
  33. package/src/api-client/types/tweets.ts +59 -0
  34. package/src/api-client/types/world-venues.ts +23 -0
  35. package/src/app/runtime/desktop-deeplink.ts +41 -6
  36. package/src/app/runtime/plugin-seed.ts +119 -0
  37. package/src/app/runtime/startup.ts +45 -9
  38. package/src/app/star-prompt/status-line.tsx +1 -1
  39. package/src/app.tsx +2 -7
  40. package/src/architecture/ui-tokens-allowlist.json +0 -8
  41. package/src/cli/board-coins.ts +38 -5
  42. package/src/cli/commands/crypto-hints.ts +8 -1
  43. package/src/cli/commands/market.ts +29 -26
  44. package/src/cli/commands/overview.ts +13 -6
  45. package/src/cli/commands/ticker.ts +78 -18
  46. package/src/cli/company-name-hint.ts +19 -0
  47. package/src/cli/desktop-pane-shot-browser.ts +69 -3
  48. package/src/cli/entry.ts +10 -4
  49. package/src/cli/glossary.ts +25 -0
  50. package/src/cli/helpers.ts +4 -2
  51. package/src/cli/not-a-ticker.ts +26 -1
  52. package/src/cli/pane-functions/catalog.ts +3 -1
  53. package/src/cli/pane-functions/freshness.ts +45 -29
  54. package/src/cli/pane-functions/market-session.ts +14 -5
  55. package/src/cli/restore-plugins.ts +164 -51
  56. package/src/components/chart/composite/use-composite-chart-keyboard.ts +11 -2
  57. package/src/components/chart-table/header.tsx +10 -1
  58. package/src/components/chart-table/layout.ts +14 -5
  59. package/src/components/command-bar/panel/index.tsx +13 -0
  60. package/src/components/command-bar/panel/layout.ts +7 -0
  61. package/src/components/command-bar/panel/runtime.ts +1 -0
  62. package/src/components/command-bar/panel/types.ts +2 -0
  63. package/src/components/data-table/export.ts +4 -1
  64. package/src/components/layout/detached-pane-shell.tsx +10 -37
  65. package/src/components/layout/double-escape-close.ts +90 -0
  66. package/src/components/layout/header.tsx +3 -2
  67. package/src/components/layout/market-summary.ts +6 -3
  68. package/src/components/layout/pane/footer/index.tsx +2 -6
  69. package/src/components/layout/pane/footer/model.ts +6 -12
  70. package/src/components/layout/shell/active-drag.ts +53 -11
  71. package/src/components/layout/shell/drag/magnets.ts +128 -19
  72. package/src/components/layout/shell/pane/actions.ts +6 -2
  73. package/src/components/layout/shell/pane/management-shortcuts.ts +13 -51
  74. package/src/components/layout/status-bar.tsx +4 -78
  75. package/src/components/layout/status-widget-space.ts +5 -5
  76. package/src/components/onboarding/portfolio-step/positions-panel.tsx +1 -1
  77. package/src/components/ui/data-table/index.tsx +5 -1
  78. package/src/components/ui/data-table/render-cell.ts +19 -0
  79. package/src/components/ui/delayed-mark.tsx +59 -7
  80. package/src/components/ui/icon.tsx +1 -8
  81. package/src/components/ui/menu.tsx +6 -1
  82. package/src/i18n/es.ts +6 -3
  83. package/src/i18n/ja.ts +6 -3
  84. package/src/i18n/ko.ts +6 -3
  85. package/src/i18n/zh-cn.ts +6 -3
  86. package/src/i18n/zh-tw.ts +6 -3
  87. package/src/market-data/fund-facts.ts +7 -1
  88. package/src/market-data/market/change-basis.ts +20 -0
  89. package/src/market-data/market/format.ts +62 -2
  90. package/src/market-data/market/futures-week.ts +3 -1
  91. package/src/plugins/builtin/chart-composer/headless.ts +57 -17
  92. package/src/plugins/builtin/chart-composer/session-range.ts +82 -3
  93. package/src/plugins/builtin/chat/content/composer.tsx +21 -27
  94. package/src/plugins/builtin/chat/content/index.tsx +31 -3
  95. package/src/plugins/builtin/chat/content/shortcuts.ts +4 -2
  96. package/src/plugins/builtin/chat/content/snapshot.ts +0 -3
  97. package/src/plugins/builtin/cloud/auth-actions.tsx +51 -23
  98. package/src/plugins/builtin/cloud/trial-offer-status-widget.tsx +3 -3
  99. package/src/plugins/builtin/cloud/upgrade-status-widget.tsx +32 -25
  100. package/src/plugins/builtin/congress-trades/model.ts +2 -1
  101. package/src/plugins/builtin/congress-trades/pane.tsx +3 -0
  102. package/src/plugins/builtin/correlation/compute.ts +8 -2
  103. package/src/plugins/builtin/correlation/headless.ts +10 -9
  104. package/src/plugins/builtin/correlation/history.ts +30 -0
  105. package/src/plugins/builtin/correlation/matrix/model.ts +10 -10
  106. package/src/plugins/builtin/correlation/relationship/model.ts +3 -6
  107. package/src/plugins/builtin/correlation/relationship/pane.tsx +1 -2
  108. package/src/plugins/builtin/crypto-board/client.ts +6 -1
  109. package/src/plugins/builtin/crypto-board/defi-view.tsx +12 -1
  110. package/src/plugins/builtin/crypto-board/defi.ts +44 -7
  111. package/src/plugins/builtin/crypto-board/headless.ts +83 -12
  112. package/src/plugins/builtin/crypto-board/model.ts +30 -6
  113. package/src/plugins/builtin/crypto-board/pane.tsx +13 -2
  114. package/src/plugins/builtin/custom-view/index.tsx +1 -1
  115. package/src/plugins/builtin/custom-view/loader.ts +85 -8
  116. package/src/plugins/builtin/custom-view/view-spec.ts +28 -0
  117. package/src/plugins/builtin/equity-screener/criterion-editor.tsx +13 -4
  118. package/src/plugins/builtin/equity-screener/headless.ts +33 -1
  119. package/src/plugins/builtin/equity-screener/model.ts +58 -15
  120. package/src/plugins/builtin/equity-screener/pane.tsx +36 -6
  121. package/src/plugins/builtin/executives/format.ts +5 -4
  122. package/src/plugins/builtin/executives/pane.tsx +1 -1
  123. package/src/plugins/builtin/help/index.tsx +55 -1
  124. package/src/plugins/builtin/insider/model.ts +30 -2
  125. package/src/plugins/builtin/jobs/model.ts +2 -2
  126. package/src/plugins/builtin/mna/model.ts +2 -2
  127. package/src/plugins/builtin/notes/files.ts +2 -0
  128. package/src/plugins/builtin/notes/owner.tsx +20 -1
  129. package/src/plugins/builtin/notes/quick-notes-pane.tsx +22 -4
  130. package/src/plugins/builtin/notes/store.ts +6 -1
  131. package/src/plugins/builtin/perps/headless.ts +8 -2
  132. package/src/plugins/builtin/portfolio-list/header.tsx +1 -1
  133. package/src/plugins/builtin/research/corporate-actions-pane.tsx +29 -25
  134. package/src/plugins/builtin/risk-factors/index.tsx +2 -28
  135. package/src/plugins/builtin/risk-factors/lock-note.ts +58 -0
  136. package/src/plugins/builtin/risk-factors/pane.tsx +10 -3
  137. package/src/plugins/builtin/scanner/hilo-model.ts +4 -3
  138. package/src/plugins/builtin/sec/fund-facts.ts +45 -11
  139. package/src/plugins/builtin/sec/headless.ts +30 -1
  140. package/src/plugins/builtin/sec/index.tsx +26 -5
  141. package/src/plugins/builtin/series-inventory.ts +1 -0
  142. package/src/plugins/builtin/shared/earnings-report.ts +7 -2
  143. package/src/plugins/builtin/shared/pro-lock-note.ts +5 -1
  144. package/src/plugins/builtin/shared/use-quote-board.ts +85 -46
  145. package/src/plugins/builtin/short-interest/headless.ts +1 -1
  146. package/src/plugins/builtin/short-interest/model.ts +15 -6
  147. package/src/plugins/builtin/short-interest/types.ts +2 -0
  148. package/src/plugins/builtin/thirteenf/overlap-pane.tsx +3 -0
  149. package/src/plugins/builtin/thirteenf/pane.tsx +3 -0
  150. package/src/plugins/builtin/ticker-detail/overview/model.ts +19 -9
  151. package/src/plugins/builtin/ticker-detail/overview-tab.tsx +4 -4
  152. package/src/plugins/builtin/time-sales/headless.ts +23 -7
  153. package/src/plugins/builtin/time-sales/index.tsx +2 -2
  154. package/src/plugins/builtin/trace-bonds/detail.tsx +198 -0
  155. package/src/plugins/builtin/trace-bonds/headless.ts +62 -4
  156. package/src/plugins/builtin/trace-bonds/history.ts +155 -0
  157. package/src/plugins/builtin/trace-bonds/pane.tsx +64 -5
  158. package/src/plugins/extracted-plugins.ts +49 -24
  159. package/src/plugins/installer.ts +234 -32
  160. package/src/plugins/plugin-names.ts +11 -2
  161. package/src/plugins/running-installs.ts +34 -0
  162. package/src/plugins/seed-progress.ts +72 -0
  163. package/src/remote/controller.ts +9 -2
  164. package/src/remote/schema.ts +2 -1
  165. package/src/renderers/cloudflare/http-proxy.ts +67 -8
  166. package/src/renderers/cloudflare/proxy-session.ts +1 -1
  167. package/src/renderers/cloudflare/worker.ts +29 -2
  168. package/src/renderers/dom/desktop/icons.tsx +0 -2
  169. package/src/renderers/dom/styles.css +0 -3
  170. package/src/renderers/electrobun/bun/desktop/backend.ts +14 -0
  171. package/src/renderers/electrobun/bun/desktop/host-requests.ts +14 -7
  172. package/src/renderers/electrobun/bun/desktop/initialization.ts +24 -14
  173. package/src/renderers/electrobun/bun/desktop/install-records.ts +59 -0
  174. package/src/renderers/electrobun/bun/desktop/installer-folder.ts +208 -592
  175. package/src/renderers/electrobun/bun/desktop/macos-objc.ts +14 -0
  176. package/src/renderers/electrobun/bun/desktop/update.ts +1 -1
  177. package/src/renderers/electrobun/bun/index.ts +24 -13
  178. package/src/renderers/electrobun/bun/window/context-menu-thread.ts +84 -0
  179. package/src/renderers/electrobun/bun/window/create.ts +23 -3
  180. package/src/renderers/electrobun/bun/window/electrobun-window-host.ts +4 -4
  181. package/src/renderers/electrobun/bun/window/events.ts +4 -4
  182. package/src/renderers/electrobun/bun/window/frame.ts +2 -1
  183. package/src/renderers/electrobun/bun/window/native-call-thread.ts +224 -0
  184. package/src/renderers/electrobun/bun/window/native-min-size.ts +322 -0
  185. package/src/renderers/electrobun/bun/window/native-timing.ts +10 -0
  186. package/src/renderers/electrobun/bun/window/script-for-webview.ts +15 -0
  187. package/src/renderers/electrobun/bun/window/webview-script-thread.ts +82 -0
  188. package/src/renderers/electrobun/shared/protocol.ts +13 -2
  189. package/src/renderers/electrobun/view/backend-rpc.ts +8 -1
  190. package/src/renderers/electrobun/view/cli-pane-shot-frame.tsx +1 -1
  191. package/src/renderers/electrobun/view/main.tsx +4 -3
  192. package/src/renderers/opentui/start.tsx +3 -0
  193. package/src/sources/gloomberb-cloud/index.ts +5 -7
  194. package/src/sources/provider-router/batches.ts +18 -3
  195. package/src/sources/provider-router/financials.ts +18 -4
  196. package/src/telemetry/stall-reports.ts +21 -4
  197. package/src/types/data-provider.ts +14 -0
  198. package/src/types/financials.ts +15 -3
  199. package/src/types/headless.ts +2 -0
  200. package/src/utils/double-escape-close.ts +38 -16
  201. package/src/utils/format.ts +23 -3
  202. package/src/utils/main-thread-stall.ts +21 -5
  203. package/src/utils/perf-marks.ts +88 -9
  204. package/src/utils/price-earnings.ts +18 -0
  205. package/src/utils/reported-money.ts +9 -2
  206. package/src/utils/sec.ts +34 -3
  207. package/patches/electrobun@1.18.1.patch +0 -633
  208. package/src/api-client/types.ts +0 -2441
  209. package/src/plugins/seed-notice.ts +0 -20
@@ -0,0 +1,65 @@
1
+ import type { Quote } from "../../types/financials";
2
+
3
+ export type CloudMarketScreenerCategory = "gainers" | "losers" | "most-active";
4
+
5
+ /**
6
+ * What Gloom Cloud selects and ranks Gainers and Losers by: `regular` the last
7
+ * completed regular session's move, the Chg% a row shows; `extended` the
8
+ * latest print, after-hours or pre-market included. While the regular session
9
+ * trades the two are one list. A server that predates the choice ignores it
10
+ * and ranks by the latest print.
11
+ */
12
+ export type CloudMoverSession = "regular" | "extended";
13
+
14
+ /**
15
+ * A movers row's quote sessions, under the quote's field names and meaning:
16
+ * the session it was read in, the day its change is dated to, the last
17
+ * completed regular session's close and move, and an open pre-market or
18
+ * after-hours print with its move from that close. Older servers send none.
19
+ */
20
+ export type CloudMoverSessionFields = Partial<Pick<Quote,
21
+ | "marketState" | "changeSessionDate"
22
+ | "regularClose" | "regularCloseSessionDate" | "regularChange" | "regularChangePercent"
23
+ | "preMarketPrice" | "preMarketChange" | "preMarketChangePercent"
24
+ | "postMarketPrice" | "postMarketChange" | "postMarketChangePercent">>;
25
+
26
+ /** price, change and changePercent are the live print the server ranks the list by; the session fields say how it reads. */
27
+ export interface CloudMarketScreenerItem extends CloudMoverSessionFields {
28
+ rank: number;
29
+ symbol: string;
30
+ name: string;
31
+ price: number;
32
+ change: number;
33
+ changePercent: number;
34
+ previousClose?: number;
35
+ volume: number;
36
+ /** Available average volume for this listing, independent of public ranking membership. */
37
+ avgVolume?: number;
38
+ /** Observation time of the optional retained metadata. */
39
+ metadataAsOf?: string;
40
+ tradeCount?: number;
41
+ currency: string;
42
+ high52w?: number;
43
+ low52w?: number;
44
+ dayHigh?: number;
45
+ dayLow?: number;
46
+ exchange: string;
47
+ lastUpdated: number;
48
+ dataSource: "live";
49
+ /** The listing's float as the equity screener serves it; absent where it serves none. */
50
+ floatShares?: number;
51
+ /** Set with a float the source states no measurement date for: `partial`. */
52
+ floatSharesState?: "partial";
53
+ /** Why the float is partial, as the server says it. */
54
+ floatSharesReason?: string;
55
+ /** When the statistics the float is read from were retrieved (ISO). */
56
+ floatSharesRetrievedAt?: string;
57
+ }
58
+
59
+ export interface CloudMarketScreenerPayload {
60
+ providerId: "gloomberb-cloud";
61
+ category: CloudMarketScreenerCategory;
62
+ asOf: string;
63
+ stale?: boolean;
64
+ items: CloudMarketScreenerItem[];
65
+ }
@@ -0,0 +1,107 @@
1
+ export type CloudSearchDocType = "transcript" | "news" | "filing";
2
+
3
+ export type CloudSearchSort = "relevance" | "newest" | "oldest";
4
+
5
+ /**
6
+ * Per-chunk provenance. Which keys are present depends on `docType`: transcripts
7
+ * carry speaker attribution, news carries the wire source, filings carry the
8
+ * form and section. Kept as one optional-key record so an unknown docType from a
9
+ * newer server still renders instead of failing to parse.
10
+ */
11
+ export interface CloudSearchChunkMetadata {
12
+ speaker?: string;
13
+ role?: string;
14
+ company?: string;
15
+ isQa?: boolean;
16
+ startSeconds?: number;
17
+ turnIndex?: number;
18
+ source?: string;
19
+ summary?: string;
20
+ form?: string;
21
+ accession?: string;
22
+ section?: string;
23
+ }
24
+
25
+ export interface CloudSearchHit {
26
+ id: string;
27
+ docType: CloudSearchDocType;
28
+ sourceId: string;
29
+ chunkIndex: number;
30
+ ticker: string;
31
+ publishedAt: string;
32
+ title: string;
33
+ url: string;
34
+ /** Matched terms wrapped in `<mark>`, fragments joined by an ellipsis. */
35
+ snippet: string;
36
+ score: number;
37
+ metadata: CloudSearchChunkMetadata;
38
+ /**
39
+ * Chunks of this document that matched. Only sent for a distinct search,
40
+ * where the row stands for the document rather than for one chunk.
41
+ */
42
+ matchCount?: number;
43
+ }
44
+
45
+ export interface CloudSearchResponse {
46
+ hits: CloudSearchHit[];
47
+ total: number;
48
+ /** The server stopped counting past its cap, so `total` is a lower bound. */
49
+ countCapped: boolean;
50
+ hasMore: boolean;
51
+ nextOffset: number;
52
+ tookMs: number;
53
+ }
54
+
55
+ interface CloudSearchDocumentChunk {
56
+ id: string;
57
+ chunkIndex: number;
58
+ body: string;
59
+ metadata: CloudSearchChunkMetadata;
60
+ }
61
+
62
+ export interface CloudSearchDocument {
63
+ docType: CloudSearchDocType;
64
+ sourceId: string;
65
+ ticker: string;
66
+ title: string;
67
+ url: string;
68
+ publishedAt: string;
69
+ chunks: CloudSearchDocumentChunk[];
70
+ }
71
+
72
+ export interface CloudSearchDocumentResponse {
73
+ document: CloudSearchDocument;
74
+ }
75
+
76
+ export interface CloudSavedSearchFilters {
77
+ tickers?: string[];
78
+ docTypes?: CloudSearchDocType[];
79
+ sources?: string[];
80
+ from?: string;
81
+ to?: string;
82
+ }
83
+
84
+ export interface CloudSavedSearch {
85
+ id: string;
86
+ name: string;
87
+ query: string;
88
+ filters: CloudSavedSearchFilters;
89
+ alertEnabled: boolean;
90
+ alertChannels: string[];
91
+ lastRunAt: string | null;
92
+ lastMatchAt: string | null;
93
+ matchCount: number;
94
+ createdAt: string;
95
+ }
96
+
97
+ export interface CloudSavedSearchListResponse {
98
+ searches: CloudSavedSearch[];
99
+ }
100
+
101
+ export interface CloudSavedSearchInput {
102
+ name: string;
103
+ query: string;
104
+ filters?: CloudSavedSearchFilters;
105
+ alertEnabled?: boolean;
106
+ alertChannels?: string[];
107
+ }
@@ -0,0 +1,14 @@
1
+ import type { SyncSettings, SyncSnapshot } from "../../sync/types";
2
+
3
+ export interface CloudSyncSnapshotResponse {
4
+ snapshot: SyncSnapshot | null;
5
+ revision: number | null;
6
+ updatedAt: string | null;
7
+ settings: SyncSettings;
8
+ }
9
+
10
+ export interface CloudSyncPushResponse {
11
+ revision: number;
12
+ updatedAt: string;
13
+ settings: SyncSettings;
14
+ }
@@ -0,0 +1,43 @@
1
+ // Team collections
2
+
3
+ export type TeamCollectionKind = "watchlist" | "portfolio";
4
+
5
+ export interface TeamCollection {
6
+ id: string;
7
+ teamId: string;
8
+ kind: TeamCollectionKind;
9
+ name: string;
10
+ currency: string | null;
11
+ createdBy: string;
12
+ createdAt: string;
13
+ updatedAt: string;
14
+ itemCount: number;
15
+ }
16
+
17
+ export interface TeamCollectionItem {
18
+ collectionId: string;
19
+ symbol: string;
20
+ exchange: string;
21
+ quantity: number | null;
22
+ note: string | null;
23
+ /**
24
+ * A portfolio holding's purchase date (YYYY-MM-DD), its currency, and the
25
+ * rate its cost was bought at (one unit of `currency` in `costFxCurrency`).
26
+ * Null when no one has sent one; missing from a server that keeps none.
27
+ */
28
+ dateAcquired?: string | null;
29
+ currency?: string | null;
30
+ costFxRate?: number | null;
31
+ costFxCurrency?: string | null;
32
+ addedBy: string;
33
+ addedAt: string;
34
+ updatedAt: string;
35
+ }
36
+
37
+ type TeamCollectionChange =
38
+ | { change: "created"; collection: TeamCollection }
39
+ | { change: "updated"; collection: TeamCollection }
40
+ | { change: "deleted"; collectionId: string }
41
+ | { change: "item-added" | "item-updated" | "item-removed"; collectionId: string; item: TeamCollectionItem };
42
+
43
+ export type TeamCollectionEvent = TeamCollectionChange & { teamId: string; actorId: string };
@@ -0,0 +1,32 @@
1
+ // Team views and plugin state
2
+
3
+ export interface TeamView {
4
+ id: string;
5
+ teamId: string;
6
+ name: string;
7
+ revision: number;
8
+ spec: Record<string, unknown>;
9
+ createdBy: string;
10
+ author: { username: string | null; displayName: string };
11
+ createdAt: string;
12
+ updatedAt: string;
13
+ publishedAt: string;
14
+ }
15
+
16
+ export type TeamViewEvent =
17
+ | { teamId: string; actorId: string; view: TeamView }
18
+ | { teamId: string; actorId: string; viewId: string };
19
+
20
+ export interface TeamPluginStateEntry {
21
+ teamId: string;
22
+ pluginId: string;
23
+ key: string;
24
+ value: unknown;
25
+ revision: number;
26
+ updatedBy: string;
27
+ updatedAt: string;
28
+ }
29
+
30
+ export type TeamPluginStateEvent =
31
+ | { teamId: string; actorId: string; state: TeamPluginStateEntry }
32
+ | { teamId: string; actorId: string; pluginId: string; key: string; deleted: true };
@@ -0,0 +1,135 @@
1
+ const TEAM_ACCENT_COLORS = [
2
+ "amber",
3
+ "blue",
4
+ "cyan",
5
+ "green",
6
+ "magenta",
7
+ "orange",
8
+ "red",
9
+ "violet",
10
+ ] as const;
11
+
12
+ export type TeamAccentColor = (typeof TEAM_ACCENT_COLORS)[number];
13
+
14
+ export type TeamRole = "owner" | "admin" | "member";
15
+
16
+ export interface TeamSummary {
17
+ id: string;
18
+ name: string;
19
+ slug: string;
20
+ accentColor: TeamAccentColor;
21
+ shortName: string;
22
+ allowMemberInvites: boolean;
23
+ /** Seats the team can fill; a Team plan deal sets it, otherwise 25. */
24
+ memberLimit?: number;
25
+ channelId: string;
26
+ createdAt: string;
27
+ role: TeamRole;
28
+ memberCount: number;
29
+ }
30
+
31
+ export interface TeamMember {
32
+ id: string;
33
+ role: TeamRole;
34
+ joinedAt: string;
35
+ user: { id: string; username: string | null; displayName: string };
36
+ }
37
+
38
+ export interface TeamInviteLink {
39
+ token: string;
40
+ url: string;
41
+ teamId: string;
42
+ createdBy: string;
43
+ expiresAt: string;
44
+ maxUses: number | null;
45
+ uses: number;
46
+ createdAt: string;
47
+ }
48
+
49
+ /** A Better Auth organization invitation as returned by /auth/organization/* endpoints. */
50
+ export interface TeamUser {
51
+ id: string;
52
+ username: string | null;
53
+ displayName: string;
54
+ }
55
+
56
+ /** An invitation addressed to the signed-in person. */
57
+ export interface TeamReceivedInvitation {
58
+ id: string;
59
+ role: TeamRole;
60
+ expiresAt: string;
61
+ createdAt: string;
62
+ team: {
63
+ id: string;
64
+ name: string;
65
+ slug: string;
66
+ accentColor: TeamAccentColor;
67
+ shortName: string;
68
+ memberCount: number;
69
+ };
70
+ inviter: TeamUser;
71
+ }
72
+
73
+ /** An invitation a team sent; the invitee is null for addresses without an account. */
74
+ export interface TeamSentInvitation {
75
+ id: string;
76
+ status: string;
77
+ role: TeamRole;
78
+ expiresAt: string;
79
+ createdAt: string;
80
+ inviter: TeamUser;
81
+ invitee: TeamUser | null;
82
+ }
83
+
84
+ export interface TeamUpdatedEvent {
85
+ teamId: string;
86
+ change: "settings" | "members" | "channels" | "deleted";
87
+ }
88
+
89
+ export interface TeamUsernameInvitation {
90
+ id: string;
91
+ status: string;
92
+ expiresAt: string;
93
+ invitee: { id: string; username: string | null; displayName: string };
94
+ }
95
+
96
+ interface TeamActor {
97
+ id: string;
98
+ username: string | null;
99
+ displayName: string;
100
+ }
101
+
102
+ interface TeamNotificationTeam {
103
+ id: string;
104
+ name: string;
105
+ accentColor: TeamAccentColor;
106
+ shortName: string;
107
+ }
108
+
109
+ type TeamNotificationData =
110
+ | {
111
+ kind: "team-invite";
112
+ team: TeamNotificationTeam;
113
+ invitationId: string;
114
+ expiresAt: string;
115
+ inviter: TeamActor;
116
+ }
117
+ | { kind: "team-joined"; team: TeamNotificationTeam; member: TeamActor }
118
+ | {
119
+ kind: "layout-updated";
120
+ team: TeamNotificationTeam;
121
+ layoutId: string;
122
+ layoutName: string;
123
+ revision: number;
124
+ author: TeamActor;
125
+ };
126
+
127
+ type TeamNotificationType = TeamNotificationData["kind"];
128
+
129
+ export interface TeamNotification {
130
+ id: string;
131
+ type: TeamNotificationType;
132
+ channelId: string;
133
+ createdAt: string;
134
+ data: TeamNotificationData;
135
+ }
@@ -0,0 +1,57 @@
1
+ import type {
2
+ AnalystResearchData,
3
+ CorporateActionsData,
4
+ HolderData,
5
+ HolderRecord,
6
+ OptionsChain,
7
+ TickerFinancials,
8
+ } from "../../types/financials";
9
+ import type { CloudQuotePayload } from "./quotes";
10
+
11
+ export interface CloudFinancialsPayload extends Omit<TickerFinancials, "quote"> {
12
+ quote?: CloudQuotePayload;
13
+ }
14
+
15
+ export interface CloudOptionsChainPayload extends OptionsChain {
16
+ providerId: "gloomberb-cloud";
17
+ }
18
+
19
+ interface CloudHolderPayload extends HolderRecord {
20
+ providerId: "gloomberb-cloud";
21
+ ownerType: "institution";
22
+ }
23
+
24
+ export interface CloudHoldersPayload extends HolderData {
25
+ providerId: "gloomberb-cloud";
26
+ holders: CloudHolderPayload[];
27
+ }
28
+
29
+ export interface CloudAnalystResearchPayload extends AnalystResearchData {
30
+ providerId: "gloomberb-cloud";
31
+ }
32
+
33
+ export interface CloudCorporateActionsPayload extends CorporateActionsData {
34
+ providerId: "gloomberb-cloud";
35
+ }
36
+
37
+ interface CloudShortInterestPointPayload {
38
+ settlementDate: string;
39
+ shortPercentFloat?: number | null;
40
+ /** The 10-K or 10-Q cover share count known when FINRA published the settlement. Absent on servers older than the field. */
41
+ sharesOutstanding?: number;
42
+ /** YYYY-MM-DD that count was taken. */
43
+ sharesOutstandingAsOf?: string;
44
+ sharesShort: number;
45
+ previousSharesShort: number | null;
46
+ averageDailyVolume: number | null;
47
+ daysToCover: number | null;
48
+ changePercent: number | null;
49
+ revised: boolean;
50
+ }
51
+
52
+ export interface CloudShortInterestPayload {
53
+ source?: "finra" | "gloom";
54
+ symbol: string;
55
+ issueName: string | null;
56
+ points: CloudShortInterestPointPayload[];
57
+ }
@@ -0,0 +1,59 @@
1
+ interface CloudTweetUserPayload {
2
+ id: string;
3
+ userName: string;
4
+ name: string;
5
+ }
6
+
7
+ interface CloudTweetMetricsPayload {
8
+ retweets: number | null;
9
+ replies: number | null;
10
+ likes: number | null;
11
+ quotes: number | null;
12
+ views: number | null;
13
+ bookmarks: number | null;
14
+ }
15
+
16
+ interface CloudTweetMediaPayload {
17
+ type?: string;
18
+ url?: string;
19
+ mediaUrl?: string;
20
+ media_url?: string;
21
+ media_url_https?: string;
22
+ previewImageUrl?: string;
23
+ preview_image_url?: string;
24
+ }
25
+
26
+ export interface CloudTweetPayload {
27
+ id: string;
28
+ url: string;
29
+ text: string;
30
+ createdAt: string;
31
+ lang: string;
32
+ isReply: boolean;
33
+ author: CloudTweetUserPayload;
34
+ metrics: CloudTweetMetricsPayload;
35
+ media?: CloudTweetMediaPayload[];
36
+ photos?: CloudTweetMediaPayload[];
37
+ images?: CloudTweetMediaPayload[];
38
+ }
39
+
40
+ export type CloudTweetQueryType = "Latest" | "Top";
41
+
42
+ export interface CloudTweetSearchResponse {
43
+ ticker?: string;
44
+ cashtag?: string;
45
+ query: string;
46
+ queryType: CloudTweetQueryType;
47
+ since: string;
48
+ until: string;
49
+ limit: number;
50
+ offset?: number;
51
+ /** More tweets sit behind this page. Absent on servers without paging. */
52
+ hasMore?: boolean;
53
+ hours: number;
54
+ includeReplies?: boolean;
55
+ cached: boolean;
56
+ cacheTtlMs: number;
57
+ asOf: string;
58
+ tweets: CloudTweetPayload[];
59
+ }
@@ -0,0 +1,23 @@
1
+ export interface CloudWorldVenuePayload {
2
+ mic: string;
3
+ name: string;
4
+ title: string;
5
+ country: string;
6
+ countryCode: string;
7
+ city: string;
8
+ timezone: string;
9
+ latitude: number;
10
+ longitude: number;
11
+ isOpen: boolean;
12
+ timeAfterOpenSeconds?: number;
13
+ timeToOpenSeconds?: number;
14
+ timeToCloseSeconds?: number;
15
+ }
16
+
17
+ export interface CloudWorldVenueMapPayload {
18
+ providerId: "gloomberb-cloud";
19
+ checkedAt: number;
20
+ refreshAt: number;
21
+ stale?: boolean;
22
+ venues: CloudWorldVenuePayload[];
23
+ }
@@ -13,6 +13,7 @@ import type { DesktopDeepLinkBridge } from "../../types/desktop-deeplink";
13
13
  import type { DesktopWindowBridge } from "../../types/desktop-window";
14
14
  import { requestAccountManagementTab } from "../../plugins/builtin/account-management/navigation";
15
15
  import { openTeamPane } from "../../team/pane-request";
16
+ import { hasOnlyDmUsernameArgs, parseDmUsernames } from "../../plugins/builtin/chat/channels";
16
17
  import { chatController } from "../../plugins/builtin/chat/controller";
17
18
  import { getShare, type ShareRecord } from "../../shares/api";
18
19
  import { openShareLink, registerShareOpener } from "../../shares/open";
@@ -310,6 +311,23 @@ function notifySuccess(pluginRegistry: PluginRegistry, body: string): void {
310
311
  pluginRegistry.notify({ body, type: "success" });
311
312
  }
312
313
 
314
+ /**
315
+ * A link that changes something (creates an alert, adds a layout, starts a
316
+ * conversation) waits for a click on a toast that says what it asks: any web
317
+ * page can open a gloomberb:// link, and a browser told to always allow them
318
+ * asks nothing more. Links that only show something, a shared pane among
319
+ * them, run at once.
320
+ */
321
+ function askBeforeRunning(pluginRegistry: PluginRegistry, body: string, label: string, run: () => void): void {
322
+ pluginRegistry.notify({
323
+ title: "Gloom link",
324
+ body,
325
+ type: "info",
326
+ persistent: true,
327
+ action: { label, onClick: run },
328
+ });
329
+ }
330
+
313
331
  function requirePane(pluginRegistry: PluginRegistry, paneId: string, unavailableMessage: string): boolean {
314
332
  if (pluginRegistry.panes.has(paneId)) return true;
315
333
  notifyError(pluginRegistry, unavailableMessage);
@@ -585,24 +603,41 @@ export function handleDesktopDeepLink(rawUrl: string, options: DesktopDeepLinkHa
585
603
  case "open-collection":
586
604
  handleOpenCollection(action, options);
587
605
  return;
588
- case "create-alert":
589
- handleCreateAlert(action, options.pluginRegistry);
606
+ case "create-alert": {
607
+ const { symbol, condition, price } = action.values;
608
+ askBeforeRunning(options.pluginRegistry, `Create an alert for ${symbol} ${condition} ${price}?`, "Create alert", () => {
609
+ handleCreateAlert(action, options.pluginRegistry);
610
+ });
590
611
  return;
612
+ }
591
613
  case "open-chat-channel":
592
614
  handleOpenChatChannel(action, options.pluginRegistry);
593
615
  return;
594
- case "open-chat-dm":
595
- handleOpenChatDm(action, options.pluginRegistry);
616
+ case "open-chat-dm": {
617
+ // The toast names only what reads as usernames, never the link's own words.
618
+ const names = parseDmUsernames(action.participants);
619
+ if (names.length === 0 || !hasOnlyDmUsernameArgs(action.participants)) {
620
+ notifyError(options.pluginRegistry, "DM links need usernames.");
621
+ return;
622
+ }
623
+ askBeforeRunning(options.pluginRegistry, `Open a conversation with ${names.map((name) => `@${name}`).join(", ")}?`, "Open", () => {
624
+ handleOpenChatDm(action, options.pluginRegistry);
625
+ });
596
626
  return;
627
+ }
597
628
  case "open-news":
598
629
  handleOpenNews(action, options.pluginRegistry);
599
630
  return;
600
631
  case "open-share":
632
+ // Opening a shared pane only adds a view of what the person just
633
+ // clicked, so it runs at once.
601
634
  void openShareInApp(action.id, options.pluginRegistry, { retry: () => handleDesktopDeepLink(rawUrl, options) });
602
635
  return;
603
636
  case "open-layout":
604
- void handleOpenLayout(action, options).catch((error) => {
605
- notifyError(options.pluginRegistry, error instanceof Error ? error.message : "Could not open shared layout.");
637
+ askBeforeRunning(options.pluginRegistry, "Add the shared layout this link points to?", "Add layout", () => {
638
+ void handleOpenLayout(action, options).catch((error) => {
639
+ notifyError(options.pluginRegistry, error instanceof Error ? error.message : "Could not open shared layout.");
640
+ });
606
641
  });
607
642
  return;
608
643
  }