@spfunctions/cli 1.7.19 → 1.7.22

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 (180) hide show
  1. package/dist/101.index.js +1 -0
  2. package/dist/12.index.js +1 -0
  3. package/dist/160.index.js +1 -0
  4. package/dist/174.index.js +1 -0
  5. package/dist/278.index.js +6 -0
  6. package/dist/582.index.js +1 -0
  7. package/dist/641.index.js +324 -0
  8. package/dist/669.index.js +1 -0
  9. package/dist/722.index.js +1 -0
  10. package/dist/788.index.js +1 -0
  11. package/dist/816.index.js +12 -0
  12. package/dist/830.index.js +1 -0
  13. package/dist/921.index.js +1 -0
  14. package/dist/index.js +1 -833
  15. package/package.json +5 -2
  16. package/dist/cache.d.ts +0 -6
  17. package/dist/cache.js +0 -31
  18. package/dist/cache.test.d.ts +0 -1
  19. package/dist/cache.test.js +0 -73
  20. package/dist/client.d.ts +0 -56
  21. package/dist/client.js +0 -205
  22. package/dist/client.test.d.ts +0 -1
  23. package/dist/client.test.js +0 -89
  24. package/dist/commands/agent.d.ts +0 -20
  25. package/dist/commands/agent.js +0 -4119
  26. package/dist/commands/announcements.d.ts +0 -3
  27. package/dist/commands/announcements.js +0 -28
  28. package/dist/commands/augment.d.ts +0 -12
  29. package/dist/commands/augment.js +0 -56
  30. package/dist/commands/balance.d.ts +0 -3
  31. package/dist/commands/balance.js +0 -17
  32. package/dist/commands/book.d.ts +0 -17
  33. package/dist/commands/book.js +0 -220
  34. package/dist/commands/cancel.d.ts +0 -5
  35. package/dist/commands/cancel.js +0 -41
  36. package/dist/commands/context.d.ts +0 -6
  37. package/dist/commands/context.js +0 -208
  38. package/dist/commands/create.d.ts +0 -7
  39. package/dist/commands/create.js +0 -42
  40. package/dist/commands/dashboard.d.ts +0 -14
  41. package/dist/commands/dashboard.js +0 -215
  42. package/dist/commands/delta.d.ts +0 -16
  43. package/dist/commands/delta.js +0 -115
  44. package/dist/commands/edges.d.ts +0 -26
  45. package/dist/commands/edges.js +0 -246
  46. package/dist/commands/evaluate.d.ts +0 -4
  47. package/dist/commands/evaluate.js +0 -30
  48. package/dist/commands/explore.d.ts +0 -14
  49. package/dist/commands/explore.js +0 -116
  50. package/dist/commands/feed.d.ts +0 -13
  51. package/dist/commands/feed.js +0 -73
  52. package/dist/commands/fills.d.ts +0 -4
  53. package/dist/commands/fills.js +0 -29
  54. package/dist/commands/forecast.d.ts +0 -4
  55. package/dist/commands/forecast.js +0 -53
  56. package/dist/commands/get.d.ts +0 -5
  57. package/dist/commands/get.js +0 -98
  58. package/dist/commands/heartbeat.d.ts +0 -20
  59. package/dist/commands/heartbeat.js +0 -73
  60. package/dist/commands/history.d.ts +0 -3
  61. package/dist/commands/history.js +0 -38
  62. package/dist/commands/liquidity.d.ts +0 -14
  63. package/dist/commands/liquidity.js +0 -378
  64. package/dist/commands/list.d.ts +0 -5
  65. package/dist/commands/list.js +0 -38
  66. package/dist/commands/login.d.ts +0 -10
  67. package/dist/commands/login.js +0 -98
  68. package/dist/commands/markets.d.ts +0 -10
  69. package/dist/commands/markets.js +0 -39
  70. package/dist/commands/milestones.d.ts +0 -8
  71. package/dist/commands/milestones.js +0 -56
  72. package/dist/commands/orders.d.ts +0 -4
  73. package/dist/commands/orders.js +0 -28
  74. package/dist/commands/performance.d.ts +0 -11
  75. package/dist/commands/performance.js +0 -250
  76. package/dist/commands/positions.d.ts +0 -19
  77. package/dist/commands/positions.js +0 -294
  78. package/dist/commands/prompt.d.ts +0 -13
  79. package/dist/commands/prompt.js +0 -35
  80. package/dist/commands/publish.d.ts +0 -15
  81. package/dist/commands/publish.js +0 -39
  82. package/dist/commands/query.d.ts +0 -15
  83. package/dist/commands/query.js +0 -132
  84. package/dist/commands/rfq.d.ts +0 -5
  85. package/dist/commands/rfq.js +0 -35
  86. package/dist/commands/scan.d.ts +0 -11
  87. package/dist/commands/scan.js +0 -230
  88. package/dist/commands/schedule.d.ts +0 -3
  89. package/dist/commands/schedule.js +0 -38
  90. package/dist/commands/settlements.d.ts +0 -6
  91. package/dist/commands/settlements.js +0 -50
  92. package/dist/commands/setup.d.ts +0 -24
  93. package/dist/commands/setup.js +0 -700
  94. package/dist/commands/signal.d.ts +0 -6
  95. package/dist/commands/signal.js +0 -32
  96. package/dist/commands/strategies.d.ts +0 -11
  97. package/dist/commands/strategies.js +0 -130
  98. package/dist/commands/telegram.d.ts +0 -15
  99. package/dist/commands/telegram.js +0 -125
  100. package/dist/commands/trade.d.ts +0 -12
  101. package/dist/commands/trade.js +0 -112
  102. package/dist/commands/watch.d.ts +0 -19
  103. package/dist/commands/watch.js +0 -157
  104. package/dist/commands/whatif.d.ts +0 -17
  105. package/dist/commands/whatif.js +0 -209
  106. package/dist/commands/x.d.ts +0 -28
  107. package/dist/commands/x.js +0 -167
  108. package/dist/config.d.ts +0 -55
  109. package/dist/config.js +0 -139
  110. package/dist/config.test.d.ts +0 -1
  111. package/dist/config.test.js +0 -138
  112. package/dist/index.d.ts +0 -20
  113. package/dist/kalshi.d.ts +0 -144
  114. package/dist/kalshi.js +0 -498
  115. package/dist/polymarket.d.ts +0 -237
  116. package/dist/polymarket.js +0 -353
  117. package/dist/polymarket.test.d.ts +0 -1
  118. package/dist/polymarket.test.js +0 -424
  119. package/dist/share.d.ts +0 -4
  120. package/dist/share.js +0 -27
  121. package/dist/skills/loader.d.ts +0 -19
  122. package/dist/skills/loader.js +0 -86
  123. package/dist/telegram/agent-bridge.d.ts +0 -15
  124. package/dist/telegram/agent-bridge.js +0 -573
  125. package/dist/telegram/bot.d.ts +0 -10
  126. package/dist/telegram/bot.js +0 -297
  127. package/dist/telegram/commands.d.ts +0 -11
  128. package/dist/telegram/commands.js +0 -120
  129. package/dist/telegram/format.d.ts +0 -11
  130. package/dist/telegram/format.js +0 -51
  131. package/dist/telegram/format.test.d.ts +0 -1
  132. package/dist/telegram/format.test.js +0 -73
  133. package/dist/telegram/poller.d.ts +0 -6
  134. package/dist/telegram/poller.js +0 -32
  135. package/dist/topics.d.ts +0 -17
  136. package/dist/topics.js +0 -102
  137. package/dist/topics.test.d.ts +0 -1
  138. package/dist/topics.test.js +0 -131
  139. package/dist/tui/border.d.ts +0 -33
  140. package/dist/tui/border.js +0 -87
  141. package/dist/tui/chart.d.ts +0 -19
  142. package/dist/tui/chart.js +0 -117
  143. package/dist/tui/dashboard.d.ts +0 -9
  144. package/dist/tui/dashboard.js +0 -814
  145. package/dist/tui/layout.d.ts +0 -16
  146. package/dist/tui/layout.js +0 -41
  147. package/dist/tui/screen.d.ts +0 -33
  148. package/dist/tui/screen.js +0 -102
  149. package/dist/tui/state.d.ts +0 -40
  150. package/dist/tui/state.js +0 -36
  151. package/dist/tui/widgets/commandbar.d.ts +0 -8
  152. package/dist/tui/widgets/commandbar.js +0 -82
  153. package/dist/tui/widgets/detail.d.ts +0 -9
  154. package/dist/tui/widgets/detail.js +0 -151
  155. package/dist/tui/widgets/edges.d.ts +0 -4
  156. package/dist/tui/widgets/edges.js +0 -34
  157. package/dist/tui/widgets/liquidity.d.ts +0 -9
  158. package/dist/tui/widgets/liquidity.js +0 -142
  159. package/dist/tui/widgets/orders.d.ts +0 -4
  160. package/dist/tui/widgets/orders.js +0 -37
  161. package/dist/tui/widgets/portfolio.d.ts +0 -4
  162. package/dist/tui/widgets/portfolio.js +0 -59
  163. package/dist/tui/widgets/signals.d.ts +0 -4
  164. package/dist/tui/widgets/signals.js +0 -31
  165. package/dist/tui/widgets/statusbar.d.ts +0 -8
  166. package/dist/tui/widgets/statusbar.js +0 -72
  167. package/dist/tui/widgets/thesis.d.ts +0 -4
  168. package/dist/tui/widgets/thesis.js +0 -66
  169. package/dist/tui/widgets/trade.d.ts +0 -9
  170. package/dist/tui/widgets/trade.js +0 -117
  171. package/dist/tui/widgets/upcoming.d.ts +0 -4
  172. package/dist/tui/widgets/upcoming.js +0 -41
  173. package/dist/tui/widgets/whatif.d.ts +0 -7
  174. package/dist/tui/widgets/whatif.js +0 -113
  175. package/dist/types/output.d.ts +0 -412
  176. package/dist/types/output.js +0 -9
  177. package/dist/utils.d.ts +0 -52
  178. package/dist/utils.js +0 -146
  179. package/dist/utils.test.d.ts +0 -1
  180. package/dist/utils.test.js +0 -111
@@ -1,113 +0,0 @@
1
- "use strict";
2
- /**
3
- * What-if view — scenario analysis with BEFORE/AFTER comparison
4
- */
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.renderWhatif = renderWhatif;
7
- const border_js_1 = require("../border.js");
8
- const HIGHLIGHT_BG = (0, border_js_1.bgRgb)(25, 25, 30);
9
- function renderWhatif(screen, region, state) {
10
- (0, border_js_1.drawBorder)(screen, region, 'WHAT-IF SCENARIO');
11
- const x = region.col + 2;
12
- const w = region.width - 4;
13
- let line = 1;
14
- if (!state.whatifResult) {
15
- screen.write(region.row + line, x, 'No what-if data. Press "w" from overview to start.', border_js_1.CLR.dim);
16
- return;
17
- }
18
- const result = state.whatifResult;
19
- const scenarios = result.scenarios || result.overrides || [];
20
- const halfW = Math.floor(w / 2) - 2;
21
- // ── Top: Scenario list with cursor ──
22
- screen.write(region.row + line, x, 'Scenarios:', border_js_1.CLR.title);
23
- line++;
24
- if (scenarios.length === 0) {
25
- screen.write(region.row + line, x, ' (no scenarios available)', border_js_1.CLR.dim);
26
- line += 2;
27
- }
28
- else {
29
- for (let i = 0; i < scenarios.length; i++) {
30
- if (line >= region.height - 8)
31
- break;
32
- const sc = scenarios[i];
33
- const selected = state.whatifScenarioIndex === i;
34
- const marker = selected ? '\u25B8 ' : ' ';
35
- const name = sc.name || sc.description || sc.nodeId || `Scenario ${i + 1}`;
36
- const bg = selected ? HIGHLIGHT_BG : '';
37
- screen.write(region.row + line, x, (0, border_js_1.fit)(`${marker}${name}`, w), selected ? border_js_1.CLR.white : border_js_1.CLR.text, bg);
38
- line++;
39
- }
40
- line++;
41
- }
42
- // ── Divider ──
43
- for (let c = x; c < x + w; c++) {
44
- screen.write(region.row + line, c, '─', border_js_1.CLR.borderDim);
45
- }
46
- line++;
47
- // ── Bottom: BEFORE vs AFTER comparison ──
48
- const beforeCol = x;
49
- const afterCol = x + halfW + 3;
50
- // Headers
51
- screen.write(region.row + line, beforeCol, (0, border_js_1.fit)('BEFORE', halfW), border_js_1.CLR.title);
52
- screen.write(region.row + line, afterCol, (0, border_js_1.fit)('AFTER', halfW), border_js_1.CLR.title);
53
- line++;
54
- const before = result.before || result.current || {};
55
- const after = result.after || result.proposed || {};
56
- // Confidence
57
- const confBefore = before.confidence != null ? `${Math.round(before.confidence * 100)}%` : '?%';
58
- const confAfter = after.confidence != null ? `${Math.round(after.confidence * 100)}%` : '?%';
59
- const confDelta = (after.confidence ?? 0) - (before.confidence ?? 0);
60
- const confDeltaStr = confDelta >= 0 ? `+${Math.round(confDelta * 100)}%` : `${Math.round(confDelta * 100)}%`;
61
- screen.writeStyled(region.row + line, beforeCol, [
62
- { text: 'Confidence: ', fg: border_js_1.CLR.dim },
63
- { text: confBefore, fg: border_js_1.CLR.text },
64
- ]);
65
- screen.writeStyled(region.row + line, afterCol, [
66
- { text: 'Confidence: ', fg: border_js_1.CLR.dim },
67
- { text: confAfter, fg: border_js_1.CLR.text },
68
- { text: ` (${confDeltaStr})`, fg: confDelta >= 0 ? border_js_1.CLR.green : border_js_1.CLR.red },
69
- ]);
70
- line++;
71
- // Edge changes
72
- const beforeEdges = before.edges || [];
73
- const afterEdges = after.edges || [];
74
- screen.write(region.row + line, beforeCol, 'Edges:', border_js_1.CLR.dim);
75
- screen.write(region.row + line, afterCol, 'Edges:', border_js_1.CLR.dim);
76
- line++;
77
- const maxEdgeRows = Math.min(Math.max(beforeEdges.length, afterEdges.length), region.height - line - 3);
78
- for (let i = 0; i < maxEdgeRows; i++) {
79
- const be = beforeEdges[i];
80
- const ae = afterEdges[i];
81
- if (be) {
82
- const name = (be.market || be.ticker || '').slice(0, halfW - 10);
83
- const edgeStr = `${be.edge >= 0 ? '+' : ''}${be.edge}`;
84
- screen.writeStyled(region.row + line, beforeCol, [
85
- { text: (0, border_js_1.fit)(name, halfW - 8), fg: border_js_1.CLR.text },
86
- { text: (0, border_js_1.fit)(edgeStr, 6, 'right'), fg: be.edge >= 0 ? border_js_1.CLR.green : border_js_1.CLR.red },
87
- ]);
88
- }
89
- if (ae) {
90
- const name = (ae.market || ae.ticker || '').slice(0, halfW - 10);
91
- const edgeStr = `${ae.edge >= 0 ? '+' : ''}${ae.edge}`;
92
- const delta = ae.edgeDelta ?? (ae.edge - (be?.edge ?? 0));
93
- const deltaStr = delta >= 0 ? `+${delta}` : `${delta}`;
94
- screen.writeStyled(region.row + line, afterCol, [
95
- { text: (0, border_js_1.fit)(name, halfW - 14), fg: border_js_1.CLR.text },
96
- { text: (0, border_js_1.fit)(edgeStr, 6, 'right'), fg: ae.edge >= 0 ? border_js_1.CLR.green : border_js_1.CLR.red },
97
- { text: (0, border_js_1.fit)(deltaStr, 6, 'right'), fg: delta >= 0 ? border_js_1.CLR.green : border_js_1.CLR.red },
98
- ]);
99
- }
100
- line++;
101
- }
102
- // P&L impact summary
103
- if (line < region.height - 2) {
104
- line++;
105
- const pnlImpact = result.pnlImpact ?? result.pnl_impact;
106
- if (pnlImpact != null) {
107
- screen.writeStyled(region.row + line, x, [
108
- { text: 'P&L Impact: ', fg: border_js_1.CLR.dim },
109
- { text: `${pnlImpact >= 0 ? '+' : ''}$${Math.abs(pnlImpact).toFixed(2)}`, fg: pnlImpact >= 0 ? border_js_1.CLR.green : border_js_1.CLR.red },
110
- ]);
111
- }
112
- }
113
- }
@@ -1,412 +0,0 @@
1
- /**
2
- * Stable JSON output schemas for all SF CLI commands.
3
- *
4
- * IMPORTANT: These types define the contract that --share and sf watch depend on.
5
- * Breaking changes here cascade to the share renderer and watch differ.
6
- * Add fields freely; removing or renaming fields is a breaking change.
7
- */
8
- export type Venue = 'kalshi' | 'polymarket';
9
- export interface MarketItem {
10
- venue: Venue;
11
- ticker: string;
12
- title: string;
13
- yesAsk: number;
14
- lastPrice: number;
15
- volume24h: number;
16
- liquidity: number;
17
- seriesTicker?: string;
18
- }
19
- export interface TraditionalMarket {
20
- symbol: string;
21
- name: string;
22
- price: number;
23
- changePct: number;
24
- change1d?: number;
25
- }
26
- export interface EdgeItem {
27
- marketId: string;
28
- market: string;
29
- venue: Venue;
30
- direction: string;
31
- marketPrice: number;
32
- thesisPrice: number;
33
- edge: number;
34
- executableEdge: number | null;
35
- spread: number | null;
36
- liquidityScore: string | null;
37
- thesisId: string;
38
- position: {
39
- side: string;
40
- quantity: number;
41
- avgPrice: number;
42
- currentValue: number;
43
- pnl: number;
44
- totalCost: number;
45
- } | null;
46
- }
47
- export interface ThesisSummary {
48
- id: string;
49
- status: string;
50
- confidence: number | null;
51
- updatedAt: string;
52
- title: string;
53
- rawThesis?: string;
54
- slug?: string;
55
- edgeCount?: number;
56
- }
57
- export interface CausalNode {
58
- id: string;
59
- label: string;
60
- probability: number;
61
- depth?: number;
62
- children?: CausalNode[];
63
- }
64
- export interface EvaluationSummary {
65
- evaluatedAt: string;
66
- summary: string;
67
- confidence: number;
68
- confidenceDelta: number;
69
- model?: string;
70
- thesisTitle?: string;
71
- thesisSlug?: string;
72
- }
73
- /** sf scan "keywords" --json */
74
- export type ScanOutput = MarketItem[];
75
- /** sf query "question" --json */
76
- export interface QueryOutput {
77
- query: string;
78
- answer: string;
79
- keyFactors?: string[];
80
- kalshi?: Array<{
81
- title: string;
82
- ticker: string;
83
- price: number;
84
- volume: number;
85
- }>;
86
- polymarket?: Array<{
87
- title: string;
88
- slug: string;
89
- price: number;
90
- volume: number;
91
- }>;
92
- x?: Array<{
93
- author: string;
94
- text: string;
95
- url: string;
96
- likes: number;
97
- retweets?: number;
98
- }>;
99
- traditional?: TraditionalMarket[];
100
- theses?: Array<{
101
- title: string;
102
- slug: string;
103
- confidence: number;
104
- edges: number;
105
- }>;
106
- content?: Array<{
107
- type: string;
108
- title: string;
109
- url: string;
110
- snippet?: string;
111
- }>;
112
- meta?: {
113
- sources?: string[];
114
- latencyMs?: number;
115
- };
116
- }
117
- /** sf context --json (no thesis ID — global context) */
118
- export interface GlobalContextOutput {
119
- scannedAt?: string;
120
- meta?: {
121
- totalMarkets: number;
122
- kalshiMarkets: number;
123
- polymarketMarkets: number;
124
- };
125
- traditional?: TraditionalMarket[];
126
- highlights?: Array<{
127
- title: string;
128
- detail: string;
129
- relatedTickers?: string[];
130
- suggestedAction?: string;
131
- }>;
132
- categories?: Array<{
133
- name: string;
134
- description: string;
135
- marketCount: number;
136
- totalVolume24h: number;
137
- topMovers?: Array<{
138
- venue: string;
139
- price: number;
140
- change24h: number;
141
- title: string;
142
- ticker: string;
143
- whyInteresting?: string;
144
- }>;
145
- mostLiquid?: Array<{
146
- venue: string;
147
- price: number;
148
- spread: number;
149
- volume24h: number;
150
- title: string;
151
- }>;
152
- }>;
153
- edges?: Array<{
154
- price: number;
155
- edge: number;
156
- title: string;
157
- thesisSlug: string;
158
- venue: string;
159
- }>;
160
- signals?: EvaluationSummary[];
161
- }
162
- /** sf context <id> --json (thesis-specific context) */
163
- export interface ThesisContextOutput {
164
- thesis: string;
165
- rawThesis?: string;
166
- confidence: number | null;
167
- status: string;
168
- updatedAt?: string;
169
- causalTree?: {
170
- nodes: CausalNode[];
171
- };
172
- edges?: Array<{
173
- marketId: string;
174
- market: string;
175
- marketTitle?: string;
176
- marketPrice: number;
177
- thesisPrice: number;
178
- edge: number;
179
- edgeSize?: number;
180
- direction: string;
181
- venue: string;
182
- orderbook?: {
183
- spread: number;
184
- liquidityScore: string;
185
- };
186
- }>;
187
- lastEvaluation?: {
188
- evaluatedAt: string;
189
- summary: string;
190
- model: string;
191
- positionRecommendations?: Array<{
192
- positionId: string;
193
- recommendation: string;
194
- reason: string;
195
- }>;
196
- };
197
- edgeMeta?: {
198
- lastRescanAt: string;
199
- };
200
- }
201
- /** sf edges --json */
202
- export interface EdgesOutput {
203
- totalEdges: number;
204
- displayed: number;
205
- thesesScanned: number;
206
- edges: EdgeItem[];
207
- }
208
- /** sf list --json */
209
- export type ListOutput = ThesisSummary[];
210
- /** sf markets --json */
211
- export interface MarketsOutput {
212
- snapshotAt: string;
213
- markets: TraditionalMarket[];
214
- }
215
- /** sf positions --json */
216
- export interface PositionsOutput {
217
- kalshiConfigured: boolean;
218
- polymarketConfigured: boolean;
219
- positions: Array<{
220
- ticker: string;
221
- side: string;
222
- quantity: number;
223
- average_price_paid: number;
224
- current_value?: number;
225
- unrealized_pnl?: number;
226
- total_cost?: number;
227
- }>;
228
- polymarketPositions: Array<{
229
- title?: string;
230
- slug?: string;
231
- outcome?: string;
232
- size?: number;
233
- avgPrice?: number;
234
- curPrice?: number;
235
- cashPnl?: number;
236
- }>;
237
- edges: Array<EdgeItem & {
238
- thesisId: string;
239
- }>;
240
- }
241
- /** sf explore --json (list mode, no slug) */
242
- export interface ExploreListOutput {
243
- theses: Array<{
244
- slug: string;
245
- confidence: number | null;
246
- impliedReturn?: number;
247
- status: string;
248
- title: string;
249
- }>;
250
- }
251
- /** sf explore <slug> --json (detail mode) */
252
- export interface ExploreDetailOutput {
253
- thesis: {
254
- title: string;
255
- slug: string;
256
- confidence: number | null;
257
- status: string;
258
- publishedAt?: string;
259
- description?: string;
260
- };
261
- causalTree?: {
262
- nodes: CausalNode[];
263
- };
264
- impliedReturns?: {
265
- avgReturnPct: number;
266
- winRate: number;
267
- winners: number;
268
- losers: number;
269
- trackedSince?: string;
270
- edges: Array<{
271
- market: string;
272
- entryPrice: number;
273
- currentPrice: number;
274
- returnPct: number;
275
- }>;
276
- };
277
- confidenceHistory?: EvaluationSummary[];
278
- edges?: Array<{
279
- market: string;
280
- marketPrice: number;
281
- thesisPrice: number;
282
- edge: number;
283
- orderbook?: {
284
- liquidityScore: string;
285
- };
286
- }>;
287
- }
288
- /** sf balance --json */
289
- export interface BalanceOutput {
290
- available: number;
291
- total: number;
292
- currency: string;
293
- }
294
- /** sf orders --json */
295
- export type OrdersOutput = Array<{
296
- orderId: string;
297
- ticker: string;
298
- side: string;
299
- type: string;
300
- price: number;
301
- quantity: number;
302
- remainingQuantity: number;
303
- status: string;
304
- createdAt: string;
305
- }>;
306
- /** sf fills --json */
307
- export type FillsOutput = Array<{
308
- tradeId: string;
309
- ticker: string;
310
- side: string;
311
- price: number;
312
- count: number;
313
- createdAt: string;
314
- }>;
315
- /** sf performance --json */
316
- export interface PerformanceOutput {
317
- totalPnl: number;
318
- realizedPnl: number;
319
- unrealizedPnl: number;
320
- winRate: number;
321
- trades: number;
322
- positions: Array<{
323
- ticker: string;
324
- side: string;
325
- entryPrice: number;
326
- currentPrice: number;
327
- pnl: number;
328
- returnPct: number;
329
- }>;
330
- }
331
- /** sf feed --json */
332
- export type FeedOutput = EvaluationSummary[];
333
- /** sf milestones --json */
334
- export type MilestonesOutput = Array<{
335
- date: string;
336
- ticker: string;
337
- title: string;
338
- category?: string;
339
- }>;
340
- /** sf history <ticker> --json */
341
- export type HistoryOutput = Array<{
342
- ts: string;
343
- price: number;
344
- volume?: number;
345
- }>;
346
- /** sf forecast <event> --json */
347
- export interface ForecastOutput {
348
- event: string;
349
- markets: Array<{
350
- ticker: string;
351
- title: string;
352
- price: number;
353
- impliedProb: number;
354
- }>;
355
- distribution?: {
356
- p10: number;
357
- p25: number;
358
- p50: number;
359
- p75: number;
360
- p90: number;
361
- };
362
- }
363
- /** sf liquidity --json */
364
- export interface LiquidityOutput {
365
- markets: Array<{
366
- ticker: string;
367
- title: string;
368
- venue: Venue;
369
- spread: number;
370
- bidDepth: number;
371
- askDepth: number;
372
- score: string;
373
- }>;
374
- }
375
- /** sf book <ticker> --json */
376
- export interface BookOutput {
377
- ticker: string;
378
- bids: Array<{
379
- price: number;
380
- quantity: number;
381
- }>;
382
- asks: Array<{
383
- price: number;
384
- quantity: number;
385
- }>;
386
- spread: number;
387
- midPrice: number;
388
- }
389
- /** Wrapper used by --share to store snapshots */
390
- export interface ShareSnapshot {
391
- command: string;
392
- args: string[];
393
- timestamp: string;
394
- data: unknown;
395
- version: string;
396
- }
397
- /** Change event emitted by sf watch */
398
- export interface WatchChangeEvent {
399
- type: 'edge_change' | 'new_contract' | 'removed_contract' | 'price_move';
400
- timestamp: string;
401
- market: string;
402
- venue: Venue;
403
- before?: {
404
- price: number;
405
- edge?: number;
406
- };
407
- after: {
408
- price: number;
409
- edge?: number;
410
- };
411
- delta: number;
412
- }
@@ -1,9 +0,0 @@
1
- "use strict";
2
- /**
3
- * Stable JSON output schemas for all SF CLI commands.
4
- *
5
- * IMPORTANT: These types define the contract that --share and sf watch depend on.
6
- * Breaking changes here cascade to the share renderer and watch differ.
7
- * Add fields freely; removing or renaming fields is a breaking change.
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
package/dist/utils.d.ts DELETED
@@ -1,52 +0,0 @@
1
- /**
2
- * CLI formatting utilities
3
- *
4
- * ANSI escape codes only — no chalk dependency.
5
- */
6
- export declare const c: {
7
- readonly reset: "\u001B[0m";
8
- readonly bold: "\u001B[1m";
9
- readonly dim: "\u001B[2m";
10
- readonly red: "\u001B[31m";
11
- readonly green: "\u001B[32m";
12
- readonly yellow: "\u001B[33m";
13
- readonly blue: "\u001B[34m";
14
- readonly magenta: "\u001B[35m";
15
- readonly cyan: "\u001B[36m";
16
- readonly white: "\u001B[37m";
17
- readonly gray: "\u001B[90m";
18
- };
19
- /** Format a number as volume string: 1234567 → "1.2M", 12345 → "12K" */
20
- export declare function vol(n: number | string | null | undefined): string;
21
- /** Format a dollar amount as cents: 0.55 → "55¢" */
22
- export declare function cents(n: number | string | null | undefined): string;
23
- /** Format a probability as percentage: 0.82 → "82%" */
24
- export declare function pct(n: number | string | null | undefined): string;
25
- /** Format a confidence delta with arrow: +0.10 → "↑ +10%", -0.05 → "↓ -5%" */
26
- export declare function delta(n: number): string;
27
- /** Format ISO date string to short form: "2026-03-12T11:13:00Z" → "Mar 12 11:13" */
28
- export declare function shortDate(iso: string | null | undefined): string;
29
- /** Pad/truncate a string to exact width */
30
- export declare function pad(s: string, width: number): string;
31
- /** Right-align a string to exact width */
32
- export declare function rpad(s: string, width: number): string;
33
- /** Print a horizontal rule */
34
- export declare function hr(width?: number): void;
35
- /** Print an error and exit */
36
- export declare function die(msg: string): never;
37
- /**
38
- * Print an error with an actionable suggestion.
39
- * Use instead of bare console.error for user-facing errors.
40
- */
41
- export declare function errorWithHint(message: string, hint?: string): void;
42
- /**
43
- * Print an empty state message with a next-action CTA.
44
- * Use when a command returns zero results.
45
- */
46
- export declare function emptyState(thing: string, nextAction?: string): void;
47
- /** Print a section header */
48
- export declare function header(title: string): void;
49
- /** Truncate a string with ellipsis */
50
- export declare function trunc(s: string, maxLen: number): string;
51
- /** Short ID: first 8 chars of a UUID */
52
- export declare function shortId(id: string): string;