gloomberb 0.19.6 → 0.20.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 (137) hide show
  1. package/LICENSE +0 -4
  2. package/package.json +6 -5
  3. package/patches/electrobun-devkit@2.0.5.patch +148 -0
  4. package/src/api-client/bond-trades.ts +59 -0
  5. package/src/api-client/data.ts +21 -0
  6. package/src/api-client/index.ts +2 -0
  7. package/src/api-client/types/account.ts +86 -0
  8. package/src/api-client/types/assist.ts +32 -0
  9. package/src/api-client/types/auth.ts +63 -0
  10. package/src/api-client/types/billing.ts +54 -0
  11. package/src/api-client/types/chat.ts +180 -0
  12. package/src/api-client/types/congress.ts +107 -0
  13. package/src/api-client/types/credit.ts +110 -0
  14. package/src/api-client/types/econ.ts +158 -0
  15. package/src/api-client/types/equity-diagnostic.ts +73 -0
  16. package/src/api-client/types/filings-and-calls.ts +350 -0
  17. package/src/api-client/types/index.ts +25 -0
  18. package/src/api-client/types/jobs.ts +147 -0
  19. package/src/api-client/types/market.ts +122 -0
  20. package/src/api-client/types/news.ts +91 -0
  21. package/src/api-client/types/notes-and-theses.ts +172 -0
  22. package/src/api-client/types/quotes.ts +28 -0
  23. package/src/api-client/types/scanners.ts +125 -0
  24. package/src/api-client/types/screener.ts +65 -0
  25. package/src/api-client/types/search.ts +107 -0
  26. package/src/api-client/types/sync.ts +14 -0
  27. package/src/api-client/types/team-collections.ts +43 -0
  28. package/src/api-client/types/team-views.ts +32 -0
  29. package/src/api-client/types/teams.ts +135 -0
  30. package/src/api-client/types/ticker-data.ts +57 -0
  31. package/src/api-client/types/tweets.ts +59 -0
  32. package/src/api-client/types/world-venues.ts +23 -0
  33. package/src/app/runtime/desktop-deeplink.ts +41 -6
  34. package/src/app/star-prompt/status-line.tsx +1 -1
  35. package/src/app.tsx +1 -7
  36. package/src/architecture/ui-tokens-allowlist.json +0 -8
  37. package/src/cli/commands/ticker.ts +17 -4
  38. package/src/cli/desktop-pane-shot-browser.ts +69 -3
  39. package/src/cli/pane-functions/catalog.ts +3 -1
  40. package/src/components/chart/composite/use-composite-chart-keyboard.ts +11 -2
  41. package/src/components/data-table/export.ts +4 -1
  42. package/src/components/layout/detached-pane-shell.tsx +10 -37
  43. package/src/components/layout/double-escape-close.ts +90 -0
  44. package/src/components/layout/header.tsx +3 -2
  45. package/src/components/layout/market-summary.ts +6 -3
  46. package/src/components/layout/pane/footer/index.tsx +2 -6
  47. package/src/components/layout/pane/footer/model.ts +6 -12
  48. package/src/components/layout/shell/active-drag.ts +53 -11
  49. package/src/components/layout/shell/drag/magnets.ts +128 -19
  50. package/src/components/layout/shell/pane/actions.ts +6 -2
  51. package/src/components/layout/shell/pane/management-shortcuts.ts +13 -51
  52. package/src/components/layout/status-bar.tsx +4 -78
  53. package/src/components/layout/status-widget-space.ts +5 -5
  54. package/src/components/onboarding/portfolio-step/positions-panel.tsx +1 -1
  55. package/src/components/ui/data-table/index.tsx +5 -1
  56. package/src/components/ui/data-table/render-cell.ts +19 -0
  57. package/src/components/ui/delayed-mark.tsx +59 -7
  58. package/src/components/ui/icon.tsx +1 -8
  59. package/src/components/ui/menu.tsx +6 -1
  60. package/src/i18n/es.ts +3 -3
  61. package/src/i18n/ja.ts +3 -3
  62. package/src/i18n/ko.ts +3 -3
  63. package/src/i18n/zh-cn.ts +3 -3
  64. package/src/i18n/zh-tw.ts +3 -3
  65. package/src/plugins/builtin/chat/content/composer.tsx +21 -27
  66. package/src/plugins/builtin/chat/content/index.tsx +31 -3
  67. package/src/plugins/builtin/chat/content/shortcuts.ts +4 -2
  68. package/src/plugins/builtin/chat/content/snapshot.ts +0 -3
  69. package/src/plugins/builtin/cloud/auth-actions.tsx +51 -23
  70. package/src/plugins/builtin/cloud/trial-offer-status-widget.tsx +3 -3
  71. package/src/plugins/builtin/cloud/upgrade-status-widget.tsx +32 -25
  72. package/src/plugins/builtin/congress-trades/model.ts +2 -1
  73. package/src/plugins/builtin/congress-trades/pane.tsx +3 -0
  74. package/src/plugins/builtin/custom-view/index.tsx +1 -1
  75. package/src/plugins/builtin/custom-view/loader.ts +85 -8
  76. package/src/plugins/builtin/custom-view/view-spec.ts +28 -0
  77. package/src/plugins/builtin/equity-screener/criterion-editor.tsx +13 -4
  78. package/src/plugins/builtin/equity-screener/headless.ts +33 -1
  79. package/src/plugins/builtin/equity-screener/model.ts +58 -15
  80. package/src/plugins/builtin/equity-screener/pane.tsx +36 -6
  81. package/src/plugins/builtin/executives/format.ts +5 -4
  82. package/src/plugins/builtin/executives/pane.tsx +1 -1
  83. package/src/plugins/builtin/help/index.tsx +55 -1
  84. package/src/plugins/builtin/insider/model.ts +30 -2
  85. package/src/plugins/builtin/jobs/model.ts +2 -2
  86. package/src/plugins/builtin/mna/model.ts +2 -2
  87. package/src/plugins/builtin/notes/files.ts +2 -0
  88. package/src/plugins/builtin/notes/owner.tsx +20 -1
  89. package/src/plugins/builtin/notes/quick-notes-pane.tsx +22 -4
  90. package/src/plugins/builtin/notes/store.ts +6 -1
  91. package/src/plugins/builtin/portfolio-list/header.tsx +1 -1
  92. package/src/plugins/builtin/research/corporate-actions-pane.tsx +29 -25
  93. package/src/plugins/builtin/series-inventory.ts +1 -0
  94. package/src/plugins/builtin/shared/earnings-report.ts +7 -2
  95. package/src/plugins/builtin/shared/use-quote-board.ts +85 -46
  96. package/src/plugins/builtin/short-interest/headless.ts +1 -1
  97. package/src/plugins/builtin/short-interest/model.ts +15 -6
  98. package/src/plugins/builtin/short-interest/types.ts +2 -0
  99. package/src/plugins/builtin/thirteenf/overlap-pane.tsx +3 -0
  100. package/src/plugins/builtin/thirteenf/pane.tsx +3 -0
  101. package/src/plugins/builtin/ticker-detail/overview/model.ts +5 -3
  102. package/src/plugins/builtin/ticker-detail/overview-tab.tsx +4 -4
  103. package/src/plugins/builtin/trace-bonds/detail.tsx +198 -0
  104. package/src/plugins/builtin/trace-bonds/headless.ts +62 -4
  105. package/src/plugins/builtin/trace-bonds/history.ts +155 -0
  106. package/src/plugins/builtin/trace-bonds/pane.tsx +64 -5
  107. package/src/plugins/installer.ts +16 -3
  108. package/src/plugins/plugin-names.ts +11 -2
  109. package/src/remote/controller.ts +9 -2
  110. package/src/remote/schema.ts +2 -1
  111. package/src/renderers/cloudflare/http-proxy.ts +67 -8
  112. package/src/renderers/cloudflare/proxy-session.ts +1 -1
  113. package/src/renderers/cloudflare/worker.ts +29 -2
  114. package/src/renderers/dom/desktop/icons.tsx +0 -2
  115. package/src/renderers/dom/styles.css +0 -3
  116. package/src/renderers/electrobun/bun/desktop/install-records.ts +59 -0
  117. package/src/renderers/electrobun/bun/desktop/installer-folder.ts +208 -592
  118. package/src/renderers/electrobun/bun/desktop/macos-objc.ts +14 -0
  119. package/src/renderers/electrobun/bun/desktop/update.ts +1 -1
  120. package/src/renderers/electrobun/bun/index.ts +19 -13
  121. package/src/renderers/electrobun/bun/window/create.ts +23 -3
  122. package/src/renderers/electrobun/bun/window/electrobun-window-host.ts +4 -4
  123. package/src/renderers/electrobun/bun/window/events.ts +4 -4
  124. package/src/renderers/electrobun/bun/window/frame.ts +2 -1
  125. package/src/renderers/electrobun/bun/window/native-min-size.ts +322 -0
  126. package/src/renderers/electrobun/view/backend-rpc.ts +1 -1
  127. package/src/sources/gloomberb-cloud/index.ts +5 -7
  128. package/src/sources/provider-router/batches.ts +18 -3
  129. package/src/sources/provider-router/financials.ts +18 -4
  130. package/src/types/data-provider.ts +14 -0
  131. package/src/types/financials.ts +15 -3
  132. package/src/types/headless.ts +2 -0
  133. package/src/utils/double-escape-close.ts +38 -16
  134. package/src/utils/format.ts +23 -3
  135. package/src/utils/price-earnings.ts +18 -0
  136. package/patches/electrobun@1.18.1.patch +0 -633
  137. package/src/api-client/types.ts +0 -2441
@@ -0,0 +1,180 @@
1
+ import type { ChatPaneLink } from "../chat-pane-link";
2
+ import type { PublicPortfolioAnalytics } from "./account";
3
+
4
+ /**
5
+ * What stands behind a chat account. `discord` is a person on the Gloom
6
+ * Discord who has not linked a Gloom account: a ghost with no profile, no DMs.
7
+ * A server that predates the field leaves it out, which reads as a human.
8
+ */
9
+ export type ChatAccountType = "human" | "managed_llm" | "discord";
10
+
11
+ /** Where a message was written. A message without one came from the app. */
12
+ export type ChatMessageOrigin = "app" | "discord";
13
+
14
+ /** A badge an account earns in chat: `team` for Gloom staff, `pro` with Pro access. */
15
+ export type ChatUserBadge = "team" | "pro";
16
+
17
+ export interface ChatUserSummary {
18
+ id: string;
19
+ /** A person, a managed assistant (Gloombot), or a Discord user bridged into public channels. */
20
+ accountType?: ChatAccountType;
21
+ username: string | null;
22
+ displayName: string;
23
+ bio?: string | null;
24
+ company?: string | null;
25
+ title?: string | null;
26
+ profilePublic?: boolean;
27
+ acceptUnknownDms?: boolean;
28
+ portfolioAnalytics?: PublicPortfolioAnalytics | null;
29
+ /** Badges the account earns. A server that predates them, or a person with none, leaves this out. */
30
+ badges?: ChatUserBadge[];
31
+ /**
32
+ * The person's current offset from UTC in minutes, as their app last
33
+ * reported it: left out while they keep their local time hidden.
34
+ */
35
+ utcOffsetMinutes?: number;
36
+ /** The desks (equities, options, ...) the person chose to show; left out unless they did. */
37
+ desks?: string[];
38
+ }
39
+
40
+ /**
41
+ * An image in a chat message, as the server stored it: `width`, `height`,
42
+ * `size` and `mime` describe the stored copy, not the upload. `url` opens in an
43
+ * <img> without headers; signed links last one to two hours, and a fresh copy
44
+ * of the message carries a fresh one.
45
+ */
46
+ export interface ChatAttachment {
47
+ id: string;
48
+ mime: string;
49
+ width: number;
50
+ height: number;
51
+ size: number;
52
+ url: string;
53
+ }
54
+
55
+ /** Someone who reacted, as a reaction lists the first few. */
56
+ export interface ChatReactionUser {
57
+ id: string;
58
+ username: string | null;
59
+ displayName: string;
60
+ accountType?: ChatAccountType | null;
61
+ }
62
+
63
+ /**
64
+ * One emoji on a message: how many reacted, whether you did, and the first
65
+ * few who did, oldest first. `emoji` is the character, or `:name:` for a
66
+ * custom Discord server emoji.
67
+ */
68
+ export interface ChatReaction {
69
+ emoji: string;
70
+ count: number;
71
+ me: boolean;
72
+ users?: ChatReactionUser[];
73
+ }
74
+
75
+ /** A message's reactions as they stand after a change, from the `chat.reactions` frame or a reaction request. */
76
+ export interface ChatReactionsUpdate {
77
+ channelId: string;
78
+ messageId: string;
79
+ reactions: ChatReaction[];
80
+ }
81
+
82
+ export interface ChatMessage {
83
+ id: string;
84
+ channelId: string;
85
+ content: string;
86
+ replyToId: string | null;
87
+ createdAt: string;
88
+ editedAt?: string | null;
89
+ user: ChatUserSummary;
90
+ origin?: ChatMessageOrigin;
91
+ replyTo?: {
92
+ content: string;
93
+ user: { id?: string; username: string };
94
+ /** Images on the quoted message. */
95
+ attachmentCount?: number;
96
+ } | null;
97
+ /** Images in display order. A server that predates them leaves this out. */
98
+ attachments?: ChatAttachment[];
99
+ /**
100
+ * Emoji reactions in the order they first appeared. Message lists from a
101
+ * server that knows reactions always carry it; a live copy of a message
102
+ * (an edit) leaves it out, and the reactions held stay.
103
+ */
104
+ reactions?: ChatReaction[];
105
+ /**
106
+ * Only on the author's copy of a public message whose images are still being
107
+ * checked ("pending") or could not be checked ("failed"). Nobody else has the
108
+ * message yet.
109
+ */
110
+ attachmentReview?: "pending" | "failed";
111
+ /** What the message opens in the terminal (a Gloom Wire story or calendar). Only the server sets it. */
112
+ paneLink?: ChatPaneLink;
113
+ /**
114
+ * An announcement Gloom posted, drawn as one. Only the server sets it, and
115
+ * only on one that still stands: a retracted announcement is the removal
116
+ * placeholder without it.
117
+ */
118
+ announcement?: true;
119
+ clientStatus?: "sending" | "failed";
120
+ clientError?: string | null;
121
+ /** The idempotency key a local send went out with, so a retry repeats it. */
122
+ clientMessageId?: string;
123
+ }
124
+
125
+ /** Whether this account is tied to a person on the Gloom Discord, and whether its public messages go there. */
126
+ export interface ChatDiscordLink {
127
+ linked: boolean;
128
+ discordUsername?: string;
129
+ mirror: boolean;
130
+ /** False when the server has linking switched off. A server that predates the field is available. */
131
+ available: boolean;
132
+ }
133
+
134
+ export interface ChatChannel {
135
+ id: string;
136
+ name: string;
137
+ kind?: "public" | "direct" | "group" | "team";
138
+ created_at: string;
139
+ teamId?: string;
140
+ dmUser?: ChatUserSummary | null;
141
+ members?: ChatUserSummary[];
142
+ /**
143
+ * When the newest message you can see in a direct or group conversation was
144
+ * sent; null when it has none. Absent from channels of other kinds and from
145
+ * servers that do not report it.
146
+ */
147
+ lastMessageAt?: string | null;
148
+ }
149
+
150
+ /** Minimal identities scoped by the server to this channel and existing DMs. */
151
+ export interface ChatMentionCandidate {
152
+ id: string;
153
+ username: string;
154
+ displayName: string | null;
155
+ channelActivityAt: string | null;
156
+ conversationActivityAt: string | null;
157
+ }
158
+
159
+ export interface ChatChannelState {
160
+ channelId: string;
161
+ notificationsEnabled: boolean;
162
+ lastReadMessageId: string | null;
163
+ unreadCount: number;
164
+ }
165
+
166
+ export interface ChatNotification {
167
+ id: string;
168
+ type: "reply" | "mention" | "channel";
169
+ channelId: string;
170
+ messageId: string;
171
+ createdAt: string;
172
+ message: ChatMessage;
173
+ }
174
+
175
+ export interface ChatStateResponse {
176
+ channels: ChatChannel[];
177
+ onlineCount: number;
178
+ channelStates: ChatChannelState[];
179
+ notifications: ChatNotification[];
180
+ }
@@ -0,0 +1,107 @@
1
+ type CloudCongressTradeSide = "BUY" | "SELL" | "EXCHANGE" | "OTHER";
2
+
3
+ export interface CloudCongressTradePayload {
4
+ id: string;
5
+ chamber: "house" | "senate";
6
+ filingId: string;
7
+ docId: string;
8
+ memberName: string;
9
+ stateDistrict: string;
10
+ filingDate: string;
11
+ transactionDate: string | null;
12
+ notificationDate: string | null;
13
+ lagDays: number | null;
14
+ side: CloudCongressTradeSide;
15
+ transactionType: string;
16
+ ticker: string | null;
17
+ assetName: string;
18
+ assetType: string | null;
19
+ owner: string;
20
+ rawOwner: string;
21
+ amount: string;
22
+ amountLow: number | null;
23
+ amountHigh: number | null;
24
+ capGainsOver200: boolean | null;
25
+ filingStatus: string | null;
26
+ subholdingOf: string | null;
27
+ description: string | null;
28
+ sourceUrl: string;
29
+ returnSinceTx?: number | null;
30
+ returnSinceFiling?: number | null;
31
+ /** SPY's return over the same days as returnSinceTx, percent. */
32
+ spyReturnSinceTx?: number | null;
33
+ spyReturnSinceFiling?: number | null;
34
+ /** returnSinceTx less spyReturnSinceTx, percentage points. */
35
+ excessSinceTx?: number | null;
36
+ excessSinceFiling?: number | null;
37
+ returnAsOf?: string | null;
38
+ party?: string | null;
39
+ committees?: string[];
40
+ }
41
+
42
+ export interface CloudCongressMemberPayload {
43
+ id: string;
44
+ memberName: string;
45
+ stateDistrict: string;
46
+ tradeCount: number;
47
+ buyCount: number;
48
+ sellCount: number;
49
+ exchangeCount: number;
50
+ otherCount: number;
51
+ estimatedLow: number | null;
52
+ estimatedHigh: number | null;
53
+ lastFilingDate: string | null;
54
+ avgLagDays: number | null;
55
+ medianReturn?: number | null;
56
+ /** Median of the trades' excessSinceFiling. */
57
+ medianExcessSinceFiling?: number | null;
58
+ buyHitRate?: number | null;
59
+ pricedTradeCount?: number;
60
+ pricedBuyCount?: number;
61
+ excessTradeCount?: number;
62
+ party?: string | null;
63
+ committees?: string[];
64
+ }
65
+
66
+ export interface CloudCongressTickerPayload {
67
+ ticker: string;
68
+ tradeCount: number;
69
+ buyCount: number;
70
+ sellCount: number;
71
+ exchangeCount: number;
72
+ otherCount: number;
73
+ memberCount: number;
74
+ memberIds: string[];
75
+ estimatedLow: number | null;
76
+ estimatedHigh: number | null;
77
+ lastFilingDate: string | null;
78
+ }
79
+
80
+ export interface CloudCongressHousePayload {
81
+ asOf: string;
82
+ /** "all" pages both chambers' filings as one date-ordered index. */
83
+ chamber: "house" | "senate" | "all";
84
+ source: "house-clerk" | "senate-efd" | "congress";
85
+ year: number;
86
+ indexUpdatedAt: string | null;
87
+ filingsScanned: number;
88
+ /** Filings in the window the server could read. */
89
+ filingsParsed?: number;
90
+ /** Filings the source refused; the server retries them on its own schedule. */
91
+ filingsFailed?: number;
92
+ /** Filings left unread because the server's daily document budget is spent. */
93
+ filingsPending?: number;
94
+ /** Scanned Senate paper filings: listed and linked, not read. */
95
+ filingsPaper?: number;
96
+ /** The merged feed could not reach the Senate source; this window is House only. */
97
+ senateUnavailable?: boolean;
98
+ filingCount: number;
99
+ filingOffset?: number;
100
+ hasMore?: boolean;
101
+ hasMoreFilings?: boolean;
102
+ nextOffset?: number;
103
+ nextFilingOffset?: number;
104
+ trades: CloudCongressTradePayload[];
105
+ members: CloudCongressMemberPayload[];
106
+ tickers?: CloudCongressTickerPayload[];
107
+ }
@@ -0,0 +1,110 @@
1
+ import type { CreditLevelKind } from "../credit-boards";
2
+
3
+ /** One publicly disseminated single-name CDS transaction report. */
4
+ export interface CloudCdsTradePayload {
5
+ disseminationId: string;
6
+ originalDisseminationId: string | null;
7
+ actionType: string;
8
+ eventTimestamp: string;
9
+ executionTimestamp: string | null;
10
+ effectiveDate: string | null;
11
+ expirationDate: string | null;
12
+ maturityDate: string | null;
13
+ issuerName: string | null;
14
+ underlierId: string | null;
15
+ underlierIdSource: string | null;
16
+ upi: string | null;
17
+ upiFisn: string | null;
18
+ upiUnderlierName: string | null;
19
+ notionalAmount: number | null;
20
+ /** Reported notional is a regulatory cap, so the real trade was at least this size. */
21
+ notionalCapped: boolean;
22
+ notionalCurrency: string | null;
23
+ fixedRate: number | null;
24
+ reportedSpread: number | null;
25
+ /** Unit of `reportedSpread`, e.g. basis points or percent. */
26
+ spreadNotation: string | null;
27
+ upfrontAmount: number | null;
28
+ upfrontCurrency: string | null;
29
+ }
30
+
31
+ export interface CloudCdsResponse {
32
+ source: string;
33
+ asOf: string | null;
34
+ trades: CloudCdsTradePayload[];
35
+ }
36
+
37
+ /** One New York trade date of an issuer's on-the-run 5Y spread. */
38
+ export interface CloudCdsHistoryPointPayload {
39
+ date: string;
40
+ /** Median of the day's prints in basis points. */
41
+ spreadBp: number;
42
+ prints: number;
43
+ /** Prints that reported the spread; the rest were converted from their upfront. */
44
+ reported: number;
45
+ /** The contract on the run that day, e.g. "2031-12-20". */
46
+ maturity: string;
47
+ /** For a line quoted upfront: that day's level in points on the line's coupon. */
48
+ upfrontPts?: number;
49
+ /** The day's trades, or the settlement price on a day without enough of them (`prints` 0). */
50
+ kind?: CreditLevelKind;
51
+ }
52
+
53
+ /**
54
+ * Past 2,000bp a name is quoted in points upfront on its running coupon, the
55
+ * level and its moves alike; `spreadBp` and the bp moves stay beside them.
56
+ * Absent from servers before it, which read as `spread`.
57
+ */
58
+ interface CloudCdsUpfrontQuote {
59
+ quote?: "spread" | "upfront";
60
+ /** The line's running coupon, bp. */
61
+ couponBp?: number | null;
62
+ upfrontPts?: number | null;
63
+ change1WPts?: number | null;
64
+ change1MPts?: number | null;
65
+ }
66
+
67
+ export interface CloudCdsHistoryResponse extends CloudCdsUpfrontQuote {
68
+ source: string;
69
+ /** The matched reference entity, or null when nothing on the tape matched. */
70
+ issuer: string | null;
71
+ tenor: string;
72
+ currency: string | null;
73
+ asOf: string | null;
74
+ points: CloudCdsHistoryPointPayload[];
75
+ /**
76
+ * The last point's move over a week and a month in bp, on one contract and
77
+ * chained through the contract before across a roll, as the index board's.
78
+ * Null without a comparable level, or once the level is more than 5 trading
79
+ * days behind the tape; absent from servers before them.
80
+ */
81
+ change1W?: number | null;
82
+ change1M?: number | null;
83
+ /**
84
+ * Why the line has no level in the month to its newest print, when one
85
+ * cause explains it: `upfront-side-unknown` when the prints carry an
86
+ * upfront without the side that paid it and nothing else places the level.
87
+ */
88
+ noLevelReason?: string | null;
89
+ }
90
+
91
+ /** An issuer's latest 5Y level: the last point of its history over the last month. */
92
+ export interface CloudCdsLevelPayload extends CloudCdsUpfrontQuote {
93
+ /** The reference entity as the history response names it. */
94
+ issuer: string;
95
+ spreadBp: number;
96
+ date: string;
97
+ /** As the history response's last point. */
98
+ kind?: CreditLevelKind;
99
+ /** As the history response's moves for the same name. */
100
+ change1W?: number | null;
101
+ change1M?: number | null;
102
+ }
103
+
104
+ export interface CloudCdsLevelsResponse {
105
+ source: string;
106
+ tenor: string;
107
+ asOf: string | null;
108
+ /** Every issuer traded in the last month whose 5Y line has a level in it. */
109
+ levels: CloudCdsLevelPayload[];
110
+ }
@@ -0,0 +1,158 @@
1
+ type CloudEconImpact = "high" | "medium" | "low";
2
+
3
+ export interface CloudEconEventPayload {
4
+ id: string;
5
+ date: string;
6
+ time: string;
7
+ country: string;
8
+ event: string;
9
+ actual: string | null;
10
+ forecast: string | null;
11
+ prior: string | null;
12
+ impact: CloudEconImpact;
13
+ /** Rows the calendar adds beside its feeds: a central bank's kept decision or a statistics office's listed release. */
14
+ kind?: "central-bank-decision" | "statistics-release";
15
+ /** The publisher's own clock time and its IANA zone; null when it states no time. */
16
+ localTime?: string | null;
17
+ timeZone?: string;
18
+ /** Why a row has no time, when its publisher states none. */
19
+ timeNote?: string | null;
20
+ priorAsOf?: string | null;
21
+ referencePeriod?: string | null;
22
+ /** Who publishes the release (Freddie Mac for the 30-year mortgage rate), and its page when one is named. */
23
+ source?: { name: string; url?: string };
24
+ /**
25
+ * The indicator this release is of, the same from one release to the next
26
+ * (`us-unemployment-rate` on every month's row), where `id` names the one
27
+ * row. Absent from a server that names none; exports leave the column empty.
28
+ */
29
+ indicatorId?: string | null;
30
+ /**
31
+ * Where the forecast (the consensus) was read from, `week-feed` or
32
+ * `release-calendar`, and when that feed was read. Absent on a row with no
33
+ * forecast and on one kept before the read was recorded.
34
+ */
35
+ consensus?: { source: string; readAt: string } | null;
36
+ }
37
+
38
+ /** One currency's short-term rate, as GET /cloud/econ/short-rates serves it. */
39
+ export interface CloudShortRate {
40
+ currency: string;
41
+ /** "SOFR", "TIIE 28d". */
42
+ name: string;
43
+ /** "overnight" or the term the rate is for. */
44
+ tenor: string;
45
+ tenorDays: number;
46
+ /** Days in the year the rate is quoted over. */
47
+ dayCountBasis: 360 | 365;
48
+ publisher: string;
49
+ sourceUrl: string;
50
+ /** Percent a year; null when it could not be read. */
51
+ value: number | null;
52
+ /** The day the rate is for. */
53
+ asOf: string | null;
54
+ fetchedAt: string | null;
55
+ stale: boolean;
56
+ unavailableReason: string | null;
57
+ }
58
+
59
+ export interface CloudShortRatesPayload {
60
+ generatedAt: string;
61
+ rates: CloudShortRate[];
62
+ }
63
+
64
+ /** CPI, payrolls and FOMC statement days as published, as GET /cloud/econ/release-days serves them. */
65
+ export interface CloudMacroReleaseDaysPayload {
66
+ /** When the publishers' pages were read, ISO. */
67
+ checkedAt: string;
68
+ /** The last New York day the lists are complete for. */
69
+ coveredThrough: string;
70
+ sources: string[];
71
+ /** New York dates, oldest first. Brazil's IPCA days when the server can vouch for them. */
72
+ releases: Record<"cpi" | "jobs" | "fomc", string[]> & { ipca?: string[] };
73
+ /** Each kind's figures by New York release day, for the days they are known. */
74
+ figures?: Partial<Record<"cpi" | "jobs" | "fomc" | "ipca", Record<string, {
75
+ event: string;
76
+ actual: string | null;
77
+ forecast: string | null;
78
+ prior: string | null;
79
+ /** Above the consensus (hot), below it (cool), at it (in-line); null without both. */
80
+ surprise: "hot" | "cool" | "in-line" | null;
81
+ }>>>;
82
+ }
83
+
84
+ export interface CloudFredObservationPayload {
85
+ date: string;
86
+ value: number | null;
87
+ /**
88
+ * Who published a value FRED does not list yet, such as a Treasury yield
89
+ * Gloom Cloud read from the Treasury first. Absent on FRED's own values.
90
+ */
91
+ publisher?: string;
92
+ /** When that publisher's value was first read, ISO in UTC. */
93
+ publishedAt?: string;
94
+ /**
95
+ * The day FRED's source released this value (`YYYY-MM-DD`), on the newest
96
+ * observation of a weekly to annual series: September's permits are dated
97
+ * 1 Sep and were released 20 Oct. Absent on daily series and older points.
98
+ */
99
+ releasedOn?: string;
100
+ }
101
+
102
+ export interface CloudFredSeriesInfoPayload {
103
+ id: string;
104
+ title: string;
105
+ units: string;
106
+ frequency: string;
107
+ seasonalAdjustment: string;
108
+ source: string;
109
+ notes: string;
110
+ lastUpdated?: string;
111
+ observationStart?: string;
112
+ observationEnd?: string;
113
+ }
114
+
115
+ export interface CloudFredSeriesPayload {
116
+ observations: CloudFredObservationPayload[];
117
+ info: CloudFredSeriesInfoPayload | null;
118
+ fetchedAt?: string;
119
+ stale?: boolean;
120
+ coverage?: { observations: "available"; info: "available" | "unavailable" };
121
+ }
122
+
123
+ /** The FRED series Gloom Cloud serves, from `GET /cloud/econ/series`; any other id is refused. */
124
+ export interface CloudFredSeriesCatalogPayload {
125
+ series: Array<{ id: string; title?: string | null; group?: string | null }>;
126
+ }
127
+
128
+ /**
129
+ * One month of Robert Shiller's dataset. FRED carries no long-run S&P earnings,
130
+ * so this is what every earnings-based valuation ratio is built from.
131
+ */
132
+ interface CloudShillerObservationPayload {
133
+ date: string;
134
+ price: number | null;
135
+ dividend: number | null;
136
+ earnings: number | null;
137
+ cpi: number | null;
138
+ longRate: number | null;
139
+ cape: number | null;
140
+ /** CAPE earnings yield over the real 10-year rate; Shiller's equity risk premium. */
141
+ excessCapeYield: number | null;
142
+ }
143
+
144
+ export interface CloudShillerPayload {
145
+ observations: CloudShillerObservationPayload[];
146
+ sourceUrl: string;
147
+ fetchedAt: string;
148
+ }
149
+
150
+ export interface CloudYieldPointPayload {
151
+ maturity: string;
152
+ maturityYears: number;
153
+ yield: number | null;
154
+ /** FRED observation date. Absent on servers older than the field. */
155
+ asOf?: string | null;
156
+ fetchedAt?: string;
157
+ stale?: boolean;
158
+ }
@@ -0,0 +1,73 @@
1
+ /** Cache reuse policy for one Equity Diagnostic request. */
2
+ export type CloudEquityDiagnosticMode = "cache-first" | "refresh";
3
+
4
+ export type CloudEquityDiagnosticFindingKind =
5
+ "red_flag" | "green_flag" | "anomaly";
6
+
7
+ /** 3 is the most severe. */
8
+ type CloudEquityDiagnosticSeverity = 1 | 2 | 3;
9
+
10
+ export interface CloudEquityDiagnosticFinding {
11
+ id: string;
12
+ kind: CloudEquityDiagnosticFindingKind;
13
+ severity: CloudEquityDiagnosticSeverity;
14
+ confidence: number;
15
+ title: string;
16
+ /** What the data says, with no reading attached. */
17
+ observation: string;
18
+ /** What the observation may mean; kept apart from the observation on purpose. */
19
+ interpretation: string;
20
+ /** Ids into `evidence`; unresolved ids are dropped by the client. */
21
+ evidenceIds: string[];
22
+ }
23
+
24
+ export interface CloudEquityDiagnosticCoverage {
25
+ dataset: string;
26
+ status: "available" | "no_data" | "unsupported" | "failed";
27
+ asOf?: string;
28
+ provider?: string;
29
+ note?: string;
30
+ }
31
+
32
+ /** The server owns citation URLs; the client never builds them. */
33
+ export interface CloudEquityDiagnosticEvidence {
34
+ id: string;
35
+ dataset: string;
36
+ label: string;
37
+ asOf?: string;
38
+ provider?: string;
39
+ url?: string;
40
+ }
41
+
42
+ interface CloudEquityDiagnosticPending {
43
+ status: "generating";
44
+ retryAfterMs: number;
45
+ }
46
+
47
+ export interface CloudEquityDiagnosticResponse {
48
+ schemaVersion: 1;
49
+ access: "preview" | "full";
50
+ symbol: string;
51
+ exchange: string;
52
+ companyName?: string;
53
+ status: "complete" | "partial" | "insufficient_data";
54
+ verdict: "risk_skewed" | "balanced" | "opportunity_skewed" | "unclear";
55
+ summary: string;
56
+ confidence: number;
57
+ findings: CloudEquityDiagnosticFinding[];
58
+ watchItems: string[];
59
+ coverage: CloudEquityDiagnosticCoverage[];
60
+ evidence: CloudEquityDiagnosticEvidence[];
61
+ generatedAt: string;
62
+ expiresAt: string;
63
+ /** Before this instant a `refresh` request may still answer from cache. */
64
+ refreshAllowedAt: string;
65
+ cached: boolean;
66
+ stale: boolean;
67
+ promptVersion: 1;
68
+ /** The model that answered. Diagnostic only: never rendered to the user. */
69
+ model: string;
70
+ }
71
+
72
+ export type CloudEquityDiagnosticResult =
73
+ CloudEquityDiagnosticPending | CloudEquityDiagnosticResponse;