snow-ai 0.4.15 → 0.4.17

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 (351) hide show
  1. package/bundle/cli.mjs +477445 -0
  2. package/bundle/sql-wasm.wasm +0 -0
  3. package/package.json +31 -26
  4. package/dist/agents/codebaseIndexAgent.d.ts +0 -102
  5. package/dist/agents/codebaseIndexAgent.js +0 -641
  6. package/dist/agents/codebaseReviewAgent.d.ts +0 -61
  7. package/dist/agents/codebaseReviewAgent.js +0 -301
  8. package/dist/agents/compactAgent.d.ts +0 -55
  9. package/dist/agents/compactAgent.js +0 -306
  10. package/dist/agents/promptOptimizeAgent.d.ts +0 -54
  11. package/dist/agents/promptOptimizeAgent.js +0 -268
  12. package/dist/agents/reviewAgent.d.ts +0 -50
  13. package/dist/agents/reviewAgent.js +0 -265
  14. package/dist/agents/summaryAgent.d.ts +0 -57
  15. package/dist/agents/summaryAgent.js +0 -260
  16. package/dist/api/anthropic.d.ts +0 -44
  17. package/dist/api/anthropic.js +0 -598
  18. package/dist/api/chat.d.ts +0 -73
  19. package/dist/api/chat.js +0 -386
  20. package/dist/api/embedding.d.ts +0 -34
  21. package/dist/api/embedding.js +0 -80
  22. package/dist/api/gemini.d.ts +0 -31
  23. package/dist/api/gemini.js +0 -445
  24. package/dist/api/models.d.ts +0 -15
  25. package/dist/api/models.js +0 -139
  26. package/dist/api/responses.d.ts +0 -38
  27. package/dist/api/responses.js +0 -515
  28. package/dist/api/systemPrompt.d.ts +0 -4
  29. package/dist/api/systemPrompt.js +0 -408
  30. package/dist/api/types.d.ts +0 -53
  31. package/dist/api/types.js +0 -4
  32. package/dist/app.d.ts +0 -8
  33. package/dist/app.js +0 -112
  34. package/dist/cli.d.ts +0 -2
  35. package/dist/cli.js +0 -199
  36. package/dist/hooks/useAgentPicker.d.ts +0 -14
  37. package/dist/hooks/useAgentPicker.js +0 -119
  38. package/dist/hooks/useClipboard.d.ts +0 -4
  39. package/dist/hooks/useClipboard.js +0 -175
  40. package/dist/hooks/useCommandHandler.d.ts +0 -35
  41. package/dist/hooks/useCommandHandler.js +0 -346
  42. package/dist/hooks/useCommandPanel.d.ts +0 -17
  43. package/dist/hooks/useCommandPanel.js +0 -114
  44. package/dist/hooks/useConversation.d.ts +0 -49
  45. package/dist/hooks/useConversation.js +0 -1052
  46. package/dist/hooks/useFilePicker.d.ts +0 -18
  47. package/dist/hooks/useFilePicker.js +0 -224
  48. package/dist/hooks/useGlobalExit.d.ts +0 -5
  49. package/dist/hooks/useGlobalExit.js +0 -34
  50. package/dist/hooks/useGlobalNavigation.d.ts +0 -6
  51. package/dist/hooks/useGlobalNavigation.js +0 -17
  52. package/dist/hooks/useHistoryNavigation.d.ts +0 -35
  53. package/dist/hooks/useHistoryNavigation.js +0 -133
  54. package/dist/hooks/useInputBuffer.d.ts +0 -6
  55. package/dist/hooks/useInputBuffer.js +0 -45
  56. package/dist/hooks/useKeyboardInput.d.ts +0 -80
  57. package/dist/hooks/useKeyboardInput.js +0 -608
  58. package/dist/hooks/useSessionManagement.d.ts +0 -10
  59. package/dist/hooks/useSessionManagement.js +0 -43
  60. package/dist/hooks/useSessionSave.d.ts +0 -8
  61. package/dist/hooks/useSessionSave.js +0 -63
  62. package/dist/hooks/useSnapshotState.d.ts +0 -26
  63. package/dist/hooks/useSnapshotState.js +0 -28
  64. package/dist/hooks/useStreamingState.d.ts +0 -33
  65. package/dist/hooks/useStreamingState.js +0 -105
  66. package/dist/hooks/useTerminalFocus.d.ts +0 -28
  67. package/dist/hooks/useTerminalFocus.js +0 -87
  68. package/dist/hooks/useTerminalSize.d.ts +0 -4
  69. package/dist/hooks/useTerminalSize.js +0 -20
  70. package/dist/hooks/useTodoPicker.d.ts +0 -16
  71. package/dist/hooks/useTodoPicker.js +0 -94
  72. package/dist/hooks/useToolConfirmation.d.ts +0 -19
  73. package/dist/hooks/useToolConfirmation.js +0 -61
  74. package/dist/hooks/useVSCodeState.d.ts +0 -8
  75. package/dist/hooks/useVSCodeState.js +0 -81
  76. package/dist/i18n/I18nContext.d.ts +0 -14
  77. package/dist/i18n/I18nContext.js +0 -24
  78. package/dist/i18n/index.d.ts +0 -3
  79. package/dist/i18n/index.js +0 -2
  80. package/dist/i18n/lang/en.d.ts +0 -2
  81. package/dist/i18n/lang/en.js +0 -502
  82. package/dist/i18n/lang/es.d.ts +0 -2
  83. package/dist/i18n/lang/es.js +0 -502
  84. package/dist/i18n/lang/ja.d.ts +0 -2
  85. package/dist/i18n/lang/ja.js +0 -502
  86. package/dist/i18n/lang/ko.d.ts +0 -2
  87. package/dist/i18n/lang/ko.js +0 -502
  88. package/dist/i18n/lang/zh-TW.d.ts +0 -2
  89. package/dist/i18n/lang/zh-TW.js +0 -502
  90. package/dist/i18n/lang/zh.d.ts +0 -2
  91. package/dist/i18n/lang/zh.js +0 -502
  92. package/dist/i18n/translations.d.ts +0 -2
  93. package/dist/i18n/translations.js +0 -14
  94. package/dist/i18n/types.d.ts +0 -478
  95. package/dist/i18n/types.js +0 -1
  96. package/dist/mcp/aceCodeSearch.d.ts +0 -247
  97. package/dist/mcp/aceCodeSearch.js +0 -1058
  98. package/dist/mcp/bash.d.ts +0 -50
  99. package/dist/mcp/bash.js +0 -153
  100. package/dist/mcp/codebaseSearch.d.ts +0 -44
  101. package/dist/mcp/codebaseSearch.js +0 -275
  102. package/dist/mcp/filesystem.d.ts +0 -392
  103. package/dist/mcp/filesystem.js +0 -1445
  104. package/dist/mcp/ideDiagnostics.d.ts +0 -36
  105. package/dist/mcp/ideDiagnostics.js +0 -90
  106. package/dist/mcp/notebook.d.ts +0 -10
  107. package/dist/mcp/notebook.js +0 -367
  108. package/dist/mcp/subagent.d.ts +0 -37
  109. package/dist/mcp/subagent.js +0 -113
  110. package/dist/mcp/todo.d.ts +0 -46
  111. package/dist/mcp/todo.js +0 -511
  112. package/dist/mcp/types/aceCodeSearch.types.d.ts +0 -92
  113. package/dist/mcp/types/aceCodeSearch.types.js +0 -4
  114. package/dist/mcp/types/bash.types.d.ts +0 -13
  115. package/dist/mcp/types/bash.types.js +0 -4
  116. package/dist/mcp/types/filesystem.types.d.ts +0 -210
  117. package/dist/mcp/types/filesystem.types.js +0 -27
  118. package/dist/mcp/types/todo.types.d.ts +0 -27
  119. package/dist/mcp/types/todo.types.js +0 -4
  120. package/dist/mcp/types/websearch.types.d.ts +0 -30
  121. package/dist/mcp/types/websearch.types.js +0 -4
  122. package/dist/mcp/utils/aceCodeSearch/filesystem.utils.d.ts +0 -34
  123. package/dist/mcp/utils/aceCodeSearch/filesystem.utils.js +0 -146
  124. package/dist/mcp/utils/aceCodeSearch/language.utils.d.ts +0 -14
  125. package/dist/mcp/utils/aceCodeSearch/language.utils.js +0 -418
  126. package/dist/mcp/utils/aceCodeSearch/search.utils.d.ts +0 -31
  127. package/dist/mcp/utils/aceCodeSearch/search.utils.js +0 -136
  128. package/dist/mcp/utils/aceCodeSearch/symbol.utils.d.ts +0 -20
  129. package/dist/mcp/utils/aceCodeSearch/symbol.utils.js +0 -141
  130. package/dist/mcp/utils/bash/security.utils.d.ts +0 -20
  131. package/dist/mcp/utils/bash/security.utils.js +0 -34
  132. package/dist/mcp/utils/filesystem/batch-operations.utils.d.ts +0 -39
  133. package/dist/mcp/utils/filesystem/batch-operations.utils.js +0 -182
  134. package/dist/mcp/utils/filesystem/code-analysis.utils.d.ts +0 -18
  135. package/dist/mcp/utils/filesystem/code-analysis.utils.js +0 -165
  136. package/dist/mcp/utils/filesystem/match-finder.utils.d.ts +0 -16
  137. package/dist/mcp/utils/filesystem/match-finder.utils.js +0 -85
  138. package/dist/mcp/utils/filesystem/office-parser.utils.d.ts +0 -43
  139. package/dist/mcp/utils/filesystem/office-parser.utils.js +0 -163
  140. package/dist/mcp/utils/filesystem/path-fixer.utils.d.ts +0 -7
  141. package/dist/mcp/utils/filesystem/path-fixer.utils.js +0 -60
  142. package/dist/mcp/utils/filesystem/similarity.utils.d.ts +0 -22
  143. package/dist/mcp/utils/filesystem/similarity.utils.js +0 -75
  144. package/dist/mcp/utils/todo/date.utils.d.ts +0 -9
  145. package/dist/mcp/utils/todo/date.utils.js +0 -14
  146. package/dist/mcp/utils/websearch/browser.utils.d.ts +0 -8
  147. package/dist/mcp/utils/websearch/browser.utils.js +0 -58
  148. package/dist/mcp/utils/websearch/text.utils.d.ts +0 -16
  149. package/dist/mcp/utils/websearch/text.utils.js +0 -39
  150. package/dist/mcp/websearch.d.ts +0 -88
  151. package/dist/mcp/websearch.js +0 -375
  152. package/dist/test/logger-test.d.ts +0 -1
  153. package/dist/test/logger-test.js +0 -7
  154. package/dist/types/index.d.ts +0 -15
  155. package/dist/types/index.js +0 -1
  156. package/dist/ui/components/AgentPickerPanel.d.ts +0 -10
  157. package/dist/ui/components/AgentPickerPanel.js +0 -74
  158. package/dist/ui/components/ChatInput.d.ts +0 -46
  159. package/dist/ui/components/ChatInput.js +0 -379
  160. package/dist/ui/components/CommandPanel.d.ts +0 -15
  161. package/dist/ui/components/CommandPanel.js +0 -80
  162. package/dist/ui/components/DiffViewer.d.ts +0 -11
  163. package/dist/ui/components/DiffViewer.js +0 -178
  164. package/dist/ui/components/FileList.d.ts +0 -15
  165. package/dist/ui/components/FileList.js +0 -360
  166. package/dist/ui/components/FileRollbackConfirmation.d.ts +0 -8
  167. package/dist/ui/components/FileRollbackConfirmation.js +0 -108
  168. package/dist/ui/components/HelpPanel.d.ts +0 -2
  169. package/dist/ui/components/HelpPanel.js +0 -67
  170. package/dist/ui/components/MCPInfoPanel.d.ts +0 -2
  171. package/dist/ui/components/MCPInfoPanel.js +0 -108
  172. package/dist/ui/components/MCPInfoScreen.d.ts +0 -7
  173. package/dist/ui/components/MCPInfoScreen.js +0 -115
  174. package/dist/ui/components/MarkdownRenderer.d.ts +0 -6
  175. package/dist/ui/components/MarkdownRenderer.js +0 -70
  176. package/dist/ui/components/Menu.d.ts +0 -17
  177. package/dist/ui/components/Menu.js +0 -88
  178. package/dist/ui/components/MessageList.d.ts +0 -56
  179. package/dist/ui/components/MessageList.js +0 -97
  180. package/dist/ui/components/PendingMessages.d.ts +0 -13
  181. package/dist/ui/components/PendingMessages.js +0 -29
  182. package/dist/ui/components/PendingToolCalls.d.ts +0 -11
  183. package/dist/ui/components/PendingToolCalls.js +0 -35
  184. package/dist/ui/components/ScrollableSelectInput.d.ts +0 -29
  185. package/dist/ui/components/ScrollableSelectInput.js +0 -157
  186. package/dist/ui/components/SessionListPanel.d.ts +0 -7
  187. package/dist/ui/components/SessionListPanel.js +0 -175
  188. package/dist/ui/components/SessionListScreen.d.ts +0 -7
  189. package/dist/ui/components/SessionListScreen.js +0 -217
  190. package/dist/ui/components/SessionListScreenWrapper.d.ts +0 -7
  191. package/dist/ui/components/SessionListScreenWrapper.js +0 -14
  192. package/dist/ui/components/ShimmerText.d.ts +0 -9
  193. package/dist/ui/components/ShimmerText.js +0 -30
  194. package/dist/ui/components/TodoPickerPanel.d.ts +0 -14
  195. package/dist/ui/components/TodoPickerPanel.js +0 -119
  196. package/dist/ui/components/TodoTree.d.ts +0 -15
  197. package/dist/ui/components/TodoTree.js +0 -60
  198. package/dist/ui/components/ToolConfirmation.d.ts +0 -21
  199. package/dist/ui/components/ToolConfirmation.js +0 -204
  200. package/dist/ui/components/ToolResultPreview.d.ts +0 -13
  201. package/dist/ui/components/ToolResultPreview.js +0 -337
  202. package/dist/ui/components/UsagePanel.d.ts +0 -2
  203. package/dist/ui/components/UsagePanel.js +0 -394
  204. package/dist/ui/contexts/ThemeContext.d.ts +0 -13
  205. package/dist/ui/contexts/ThemeContext.js +0 -28
  206. package/dist/ui/pages/ChatScreen.d.ts +0 -6
  207. package/dist/ui/pages/ChatScreen.js +0 -1495
  208. package/dist/ui/pages/CodeBaseConfigScreen.d.ts +0 -8
  209. package/dist/ui/pages/CodeBaseConfigScreen.js +0 -350
  210. package/dist/ui/pages/ConfigScreen.d.ts +0 -8
  211. package/dist/ui/pages/ConfigScreen.js +0 -1101
  212. package/dist/ui/pages/CustomHeadersScreen.d.ts +0 -6
  213. package/dist/ui/pages/CustomHeadersScreen.js +0 -502
  214. package/dist/ui/pages/HeadlessModeScreen.d.ts +0 -7
  215. package/dist/ui/pages/HeadlessModeScreen.js +0 -381
  216. package/dist/ui/pages/LanguageSettingsScreen.d.ts +0 -7
  217. package/dist/ui/pages/LanguageSettingsScreen.js +0 -91
  218. package/dist/ui/pages/MCPConfigScreen.d.ts +0 -6
  219. package/dist/ui/pages/MCPConfigScreen.js +0 -55
  220. package/dist/ui/pages/ProxyConfigScreen.d.ts +0 -8
  221. package/dist/ui/pages/ProxyConfigScreen.js +0 -149
  222. package/dist/ui/pages/SensitiveCommandConfigScreen.d.ts +0 -7
  223. package/dist/ui/pages/SensitiveCommandConfigScreen.js +0 -271
  224. package/dist/ui/pages/SubAgentConfigScreen.d.ts +0 -9
  225. package/dist/ui/pages/SubAgentConfigScreen.js +0 -435
  226. package/dist/ui/pages/SubAgentListScreen.d.ts +0 -9
  227. package/dist/ui/pages/SubAgentListScreen.js +0 -131
  228. package/dist/ui/pages/SystemPromptConfigScreen.d.ts +0 -6
  229. package/dist/ui/pages/SystemPromptConfigScreen.js +0 -326
  230. package/dist/ui/pages/ThemeSettingsScreen.d.ts +0 -7
  231. package/dist/ui/pages/ThemeSettingsScreen.js +0 -106
  232. package/dist/ui/pages/WelcomeScreen.d.ts +0 -7
  233. package/dist/ui/pages/WelcomeScreen.js +0 -217
  234. package/dist/ui/themes/index.d.ts +0 -23
  235. package/dist/ui/themes/index.js +0 -140
  236. package/dist/utils/apiConfig.d.ts +0 -126
  237. package/dist/utils/apiConfig.js +0 -423
  238. package/dist/utils/autoCompress.d.ts +0 -15
  239. package/dist/utils/autoCompress.js +0 -24
  240. package/dist/utils/chatExporter.d.ts +0 -9
  241. package/dist/utils/chatExporter.js +0 -118
  242. package/dist/utils/checkpointManager.d.ts +0 -74
  243. package/dist/utils/checkpointManager.js +0 -181
  244. package/dist/utils/codebaseConfig.d.ts +0 -16
  245. package/dist/utils/codebaseConfig.js +0 -67
  246. package/dist/utils/codebaseDatabase.d.ts +0 -102
  247. package/dist/utils/codebaseDatabase.js +0 -333
  248. package/dist/utils/codebaseSearchEvents.d.ts +0 -16
  249. package/dist/utils/codebaseSearchEvents.js +0 -13
  250. package/dist/utils/commandExecutor.d.ts +0 -13
  251. package/dist/utils/commandExecutor.js +0 -26
  252. package/dist/utils/commands/agent.d.ts +0 -2
  253. package/dist/utils/commands/agent.js +0 -12
  254. package/dist/utils/commands/clear.d.ts +0 -2
  255. package/dist/utils/commands/clear.js +0 -12
  256. package/dist/utils/commands/compact.d.ts +0 -2
  257. package/dist/utils/commands/compact.js +0 -12
  258. package/dist/utils/commands/export.d.ts +0 -2
  259. package/dist/utils/commands/export.js +0 -12
  260. package/dist/utils/commands/help.d.ts +0 -2
  261. package/dist/utils/commands/help.js +0 -11
  262. package/dist/utils/commands/home.d.ts +0 -2
  263. package/dist/utils/commands/home.js +0 -34
  264. package/dist/utils/commands/ide.d.ts +0 -2
  265. package/dist/utils/commands/ide.js +0 -32
  266. package/dist/utils/commands/init.d.ts +0 -2
  267. package/dist/utils/commands/init.js +0 -93
  268. package/dist/utils/commands/mcp.d.ts +0 -2
  269. package/dist/utils/commands/mcp.js +0 -12
  270. package/dist/utils/commands/resume.d.ts +0 -2
  271. package/dist/utils/commands/resume.js +0 -12
  272. package/dist/utils/commands/review.d.ts +0 -2
  273. package/dist/utils/commands/review.js +0 -81
  274. package/dist/utils/commands/role.d.ts +0 -2
  275. package/dist/utils/commands/role.js +0 -37
  276. package/dist/utils/commands/todoPicker.d.ts +0 -2
  277. package/dist/utils/commands/todoPicker.js +0 -12
  278. package/dist/utils/commands/usage.d.ts +0 -2
  279. package/dist/utils/commands/usage.js +0 -12
  280. package/dist/utils/commands/yolo.d.ts +0 -2
  281. package/dist/utils/commands/yolo.js +0 -12
  282. package/dist/utils/configManager.d.ts +0 -45
  283. package/dist/utils/configManager.js +0 -303
  284. package/dist/utils/contextCompressor.d.ts +0 -16
  285. package/dist/utils/contextCompressor.js +0 -334
  286. package/dist/utils/devMode.d.ts +0 -13
  287. package/dist/utils/devMode.js +0 -54
  288. package/dist/utils/escapeHandler.d.ts +0 -79
  289. package/dist/utils/escapeHandler.js +0 -153
  290. package/dist/utils/fileDialog.d.ts +0 -9
  291. package/dist/utils/fileDialog.js +0 -74
  292. package/dist/utils/fileUtils.d.ts +0 -40
  293. package/dist/utils/fileUtils.js +0 -185
  294. package/dist/utils/historyManager.d.ts +0 -45
  295. package/dist/utils/historyManager.js +0 -159
  296. package/dist/utils/incrementalSnapshot.d.ts +0 -109
  297. package/dist/utils/incrementalSnapshot.js +0 -383
  298. package/dist/utils/index.d.ts +0 -11
  299. package/dist/utils/index.js +0 -18
  300. package/dist/utils/languageConfig.d.ts +0 -21
  301. package/dist/utils/languageConfig.js +0 -61
  302. package/dist/utils/logger.d.ts +0 -37
  303. package/dist/utils/logger.js +0 -122
  304. package/dist/utils/mcpToolsManager.d.ts +0 -52
  305. package/dist/utils/mcpToolsManager.js +0 -878
  306. package/dist/utils/messageFormatter.d.ts +0 -12
  307. package/dist/utils/messageFormatter.js +0 -115
  308. package/dist/utils/notebookManager.d.ts +0 -59
  309. package/dist/utils/notebookManager.js +0 -213
  310. package/dist/utils/patch-highlight.d.ts +0 -5
  311. package/dist/utils/patch-highlight.js +0 -23
  312. package/dist/utils/processManager.d.ts +0 -27
  313. package/dist/utils/processManager.js +0 -75
  314. package/dist/utils/proxyUtils.d.ts +0 -15
  315. package/dist/utils/proxyUtils.js +0 -50
  316. package/dist/utils/resourceMonitor.d.ts +0 -65
  317. package/dist/utils/resourceMonitor.js +0 -175
  318. package/dist/utils/retryUtils.d.ts +0 -49
  319. package/dist/utils/retryUtils.js +0 -303
  320. package/dist/utils/sensitiveCommandManager.d.ts +0 -53
  321. package/dist/utils/sensitiveCommandManager.js +0 -308
  322. package/dist/utils/sessionConverter.d.ts +0 -7
  323. package/dist/utils/sessionConverter.js +0 -306
  324. package/dist/utils/sessionManager.d.ts +0 -53
  325. package/dist/utils/sessionManager.js +0 -371
  326. package/dist/utils/subAgentConfig.d.ts +0 -50
  327. package/dist/utils/subAgentConfig.js +0 -221
  328. package/dist/utils/subAgentExecutor.d.ts +0 -40
  329. package/dist/utils/subAgentExecutor.js +0 -434
  330. package/dist/utils/terminal.d.ts +0 -5
  331. package/dist/utils/terminal.js +0 -13
  332. package/dist/utils/textBuffer.d.ts +0 -99
  333. package/dist/utils/textBuffer.js +0 -547
  334. package/dist/utils/textUtils.d.ts +0 -37
  335. package/dist/utils/textUtils.js +0 -102
  336. package/dist/utils/themeConfig.d.ts +0 -21
  337. package/dist/utils/themeConfig.js +0 -61
  338. package/dist/utils/todoPreprocessor.d.ts +0 -5
  339. package/dist/utils/todoPreprocessor.js +0 -18
  340. package/dist/utils/todoScanner.d.ts +0 -8
  341. package/dist/utils/todoScanner.js +0 -148
  342. package/dist/utils/toolDisplayConfig.d.ts +0 -16
  343. package/dist/utils/toolDisplayConfig.js +0 -47
  344. package/dist/utils/toolExecutor.d.ts +0 -37
  345. package/dist/utils/toolExecutor.js +0 -224
  346. package/dist/utils/usageLogger.d.ts +0 -11
  347. package/dist/utils/usageLogger.js +0 -114
  348. package/dist/utils/vscodeConnection.d.ts +0 -76
  349. package/dist/utils/vscodeConnection.js +0 -430
  350. package/dist/utils/workspaceSnapshot.d.ts +0 -63
  351. package/dist/utils/workspaceSnapshot.js +0 -300
@@ -1,157 +0,0 @@
1
- import React, { useState, useMemo, useEffect, useCallback } from 'react';
2
- import { Box, Text, useInput } from 'ink';
3
- function DefaultIndicator({ isSelected }) {
4
- return (React.createElement(Box, { marginRight: 1 },
5
- React.createElement(Text, { color: isSelected ? 'cyan' : 'gray' }, isSelected ? '>' : ' ')));
6
- }
7
- function DefaultItem({ label, isSelected }) {
8
- return React.createElement(Text, { color: isSelected ? 'cyan' : 'white' }, label);
9
- }
10
- export default function ScrollableSelectInput({ items, limit, initialIndex = 0, isFocused = true, indicator = DefaultIndicator, renderItem, onSelect, onHighlight, selectedValues, onToggleItem, onDeleteSelection }) {
11
- const totalItems = items.length;
12
- const windowSize = totalItems === 0 ? 0 : Math.min(Math.max(limit ?? totalItems, 1), totalItems);
13
- const selectedValueSet = useMemo(() => {
14
- if (!selectedValues) {
15
- return new Set();
16
- }
17
- if (selectedValues instanceof Set) {
18
- return selectedValues;
19
- }
20
- return new Set(selectedValues);
21
- }, [selectedValues]);
22
- const clampCursor = useCallback((value) => {
23
- if (totalItems === 0) {
24
- return 0;
25
- }
26
- if (value < 0) {
27
- return 0;
28
- }
29
- if (value > totalItems - 1) {
30
- return totalItems - 1;
31
- }
32
- return value;
33
- }, [totalItems]);
34
- const computeOffset = useCallback((currentOffset, targetCursor) => {
35
- if (totalItems === 0 || windowSize === 0) {
36
- return 0;
37
- }
38
- const maxOffset = Math.max(0, totalItems - windowSize);
39
- let nextOffset = Math.min(Math.max(currentOffset, 0), maxOffset);
40
- if (targetCursor < nextOffset) {
41
- nextOffset = targetCursor;
42
- }
43
- else if (targetCursor >= nextOffset + windowSize) {
44
- nextOffset = targetCursor - windowSize + 1;
45
- }
46
- return Math.min(Math.max(nextOffset, 0), maxOffset);
47
- }, [totalItems, windowSize]);
48
- const [cursor, setCursor] = useState(() => clampCursor(initialIndex));
49
- const [offset, setOffset] = useState(() => computeOffset(clampCursor(initialIndex), clampCursor(initialIndex)));
50
- useEffect(() => {
51
- if (totalItems === 0) {
52
- if (cursor !== 0) {
53
- setCursor(0);
54
- }
55
- if (offset !== 0) {
56
- setOffset(0);
57
- }
58
- return;
59
- }
60
- const clampedCursor = clampCursor(cursor);
61
- if (clampedCursor !== cursor) {
62
- setCursor(clampedCursor);
63
- return;
64
- }
65
- const clampedOffset = computeOffset(offset, clampedCursor);
66
- if (clampedOffset !== offset) {
67
- setOffset(clampedOffset);
68
- }
69
- }, [clampCursor, computeOffset, cursor, offset, totalItems]);
70
- const visibleItems = useMemo(() => {
71
- if (windowSize === 0) {
72
- return [];
73
- }
74
- return items.slice(offset, offset + windowSize);
75
- }, [items, offset, windowSize]);
76
- const selectedItem = totalItems === 0 ? undefined : items[cursor];
77
- useEffect(() => {
78
- if (selectedItem && onHighlight) {
79
- onHighlight(selectedItem);
80
- }
81
- }, [onHighlight, selectedItem]);
82
- const moveCursor = useCallback((direction) => {
83
- if (totalItems === 0) {
84
- return;
85
- }
86
- setCursor(previousCursor => {
87
- const nextCursor = clampCursor(previousCursor + direction);
88
- if (nextCursor === previousCursor) {
89
- return previousCursor;
90
- }
91
- setOffset(previousOffset => computeOffset(previousOffset, nextCursor));
92
- return nextCursor;
93
- });
94
- }, [clampCursor, computeOffset, totalItems]);
95
- const selectIndex = useCallback((targetIndex) => {
96
- if (totalItems === 0) {
97
- return;
98
- }
99
- const boundedIndex = clampCursor(targetIndex);
100
- setCursor(boundedIndex);
101
- setOffset(previousOffset => computeOffset(previousOffset, boundedIndex));
102
- const item = items[boundedIndex];
103
- if (item) {
104
- onSelect?.(item);
105
- }
106
- }, [clampCursor, computeOffset, items, onSelect, totalItems]);
107
- const handleInput = useCallback((input, key) => {
108
- if (!isFocused || totalItems === 0) {
109
- return;
110
- }
111
- if (key['upArrow']) {
112
- moveCursor(-1);
113
- return;
114
- }
115
- if (key['downArrow']) {
116
- moveCursor(1);
117
- return;
118
- }
119
- if (key['return'] && selectedItem) {
120
- onSelect?.(selectedItem);
121
- return;
122
- }
123
- if (input === ' ' && selectedItem) {
124
- onToggleItem?.(selectedItem);
125
- return;
126
- }
127
- if ((input === 'd' || input === 'D') && onDeleteSelection) {
128
- onDeleteSelection();
129
- return;
130
- }
131
- if (/^[1-9]$/.test(input) && windowSize > 0) {
132
- const target = Number.parseInt(input, 10) - 1;
133
- if (target >= 0 && target < visibleItems.length) {
134
- selectIndex(offset + target);
135
- }
136
- }
137
- }, [isFocused, moveCursor, offset, onDeleteSelection, onSelect, onToggleItem, selectIndex, selectedItem, totalItems, visibleItems.length, windowSize]);
138
- useInput(handleInput, { isActive: isFocused });
139
- if (windowSize === 0) {
140
- return null;
141
- }
142
- const renderRow = useCallback((row) => {
143
- if (renderItem) {
144
- return renderItem(row);
145
- }
146
- return DefaultItem(row);
147
- }, [renderItem]);
148
- return (React.createElement(Box, { flexDirection: "column" }, visibleItems.map((item, index) => {
149
- const absoluteIndex = offset + index;
150
- const isSelected = absoluteIndex === cursor;
151
- const isMarked = selectedValueSet.has(item.value);
152
- const key = (item.key ?? item.value);
153
- return (React.createElement(Box, { key: key },
154
- indicator({ isSelected }),
155
- renderRow({ ...item, isSelected, isMarked })));
156
- })));
157
- }
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- type Props = {
3
- onSelectSession: (sessionId: string) => void;
4
- onClose: () => void;
5
- };
6
- export default function SessionListPanel({ onSelectSession, onClose }: Props): React.JSX.Element;
7
- export {};
@@ -1,175 +0,0 @@
1
- import React, { useState, useEffect, useCallback } from 'react';
2
- import { Box, Text, useInput } from 'ink';
3
- import { sessionManager, } from '../../utils/sessionManager.js';
4
- export default function SessionListPanel({ onSelectSession, onClose }) {
5
- const [sessions, setSessions] = useState([]);
6
- const [loading, setLoading] = useState(true);
7
- const [selectedIndex, setSelectedIndex] = useState(0);
8
- const [scrollOffset, setScrollOffset] = useState(0);
9
- const [markedSessions, setMarkedSessions] = useState(new Set());
10
- const VISIBLE_ITEMS = 5; // Number of items to show at once
11
- // Load sessions on mount
12
- useEffect(() => {
13
- const loadSessions = async () => {
14
- setLoading(true);
15
- try {
16
- const sessionList = await sessionManager.listSessions();
17
- setSessions(sessionList);
18
- }
19
- catch (error) {
20
- console.error('Failed to load sessions:', error);
21
- setSessions([]);
22
- }
23
- finally {
24
- setLoading(false);
25
- }
26
- };
27
- void loadSessions();
28
- }, []);
29
- // Format date to relative time
30
- const formatDate = useCallback((timestamp) => {
31
- const date = new Date(timestamp);
32
- const now = new Date();
33
- const diffMs = now.getTime() - date.getTime();
34
- const diffMinutes = Math.floor(diffMs / (1000 * 60));
35
- const diffHours = Math.floor(diffMinutes / 60);
36
- const diffDays = Math.floor(diffHours / 24);
37
- if (diffMinutes < 1)
38
- return 'now';
39
- if (diffMinutes < 60)
40
- return `${diffMinutes}m`;
41
- if (diffHours < 24)
42
- return `${diffHours}h`;
43
- if (diffDays < 7)
44
- return `${diffDays}d`;
45
- return date.toLocaleDateString('en-US', { month: 'short', day: 'numeric' });
46
- }, []);
47
- // Handle keyboard input
48
- useInput((input, key) => {
49
- if (loading)
50
- return;
51
- if (key.escape) {
52
- onClose();
53
- return;
54
- }
55
- if (key.upArrow) {
56
- setSelectedIndex(prev => {
57
- const newIndex = Math.max(0, prev - 1);
58
- // Adjust scroll offset if needed
59
- if (newIndex < scrollOffset) {
60
- setScrollOffset(newIndex);
61
- }
62
- return newIndex;
63
- });
64
- return;
65
- }
66
- if (key.downArrow) {
67
- setSelectedIndex(prev => {
68
- const newIndex = Math.min(sessions.length - 1, prev + 1);
69
- // Adjust scroll offset if needed
70
- if (newIndex >= scrollOffset + VISIBLE_ITEMS) {
71
- setScrollOffset(newIndex - VISIBLE_ITEMS + 1);
72
- }
73
- return newIndex;
74
- });
75
- return;
76
- }
77
- // Space to toggle mark
78
- if (input === ' ') {
79
- const currentSession = sessions[selectedIndex];
80
- if (currentSession) {
81
- setMarkedSessions(prev => {
82
- const next = new Set(prev);
83
- if (next.has(currentSession.id)) {
84
- next.delete(currentSession.id);
85
- }
86
- else {
87
- next.add(currentSession.id);
88
- }
89
- return next;
90
- });
91
- }
92
- return;
93
- }
94
- // D to delete marked sessions
95
- if (input === 'd' || input === 'D') {
96
- if (markedSessions.size > 0) {
97
- const deleteMarked = async () => {
98
- const ids = Array.from(markedSessions);
99
- await Promise.all(ids.map(id => sessionManager.deleteSession(id)));
100
- // Reload sessions
101
- const sessionList = await sessionManager.listSessions();
102
- setSessions(sessionList);
103
- setMarkedSessions(new Set());
104
- // Reset selection if needed
105
- if (selectedIndex >= sessionList.length && sessionList.length > 0) {
106
- setSelectedIndex(sessionList.length - 1);
107
- }
108
- };
109
- void deleteMarked();
110
- }
111
- return;
112
- }
113
- if (key.return && sessions.length > 0) {
114
- const selectedSession = sessions[selectedIndex];
115
- if (selectedSession) {
116
- onSelectSession(selectedSession.id);
117
- }
118
- return;
119
- }
120
- });
121
- if (loading) {
122
- return (React.createElement(Box, { borderStyle: "round", borderColor: "cyan", paddingX: 1 },
123
- React.createElement(Text, { color: "gray", dimColor: true }, "Loading sessions...")));
124
- }
125
- if (sessions.length === 0) {
126
- return (React.createElement(Box, { borderStyle: "round", borderColor: "yellow", paddingX: 1 },
127
- React.createElement(Text, { color: "gray", dimColor: true }, "No conversations found \u2022 Press ESC to close")));
128
- }
129
- // Calculate visible sessions based on scroll offset
130
- const visibleSessions = sessions.slice(scrollOffset, scrollOffset + VISIBLE_ITEMS);
131
- const hasMore = sessions.length > scrollOffset + VISIBLE_ITEMS;
132
- const hasPrevious = scrollOffset > 0;
133
- const currentSession = sessions[selectedIndex];
134
- return (React.createElement(Box, { borderStyle: "round", borderColor: "cyan", paddingX: 1, flexDirection: "column" },
135
- React.createElement(Box, { flexDirection: "column" },
136
- React.createElement(Text, { color: "cyan", dimColor: true },
137
- "Resume (",
138
- selectedIndex + 1,
139
- "/",
140
- sessions.length,
141
- ")",
142
- currentSession && ` • ${currentSession.messageCount} msgs`,
143
- markedSessions.size > 0 && (React.createElement(Text, { color: "yellow" },
144
- " \u2022 ",
145
- markedSessions.size,
146
- " marked"))),
147
- React.createElement(Text, { color: "gray", dimColor: true }, "\u2191\u2193 navigate \u2022 Space mark \u2022 D delete \u2022 Enter select \u2022 ESC close")),
148
- hasPrevious && (React.createElement(Text, { color: "gray", dimColor: true },
149
- ' ',
150
- "\u2191 ",
151
- scrollOffset,
152
- " more above")),
153
- visibleSessions.map((session, index) => {
154
- const actualIndex = scrollOffset + index;
155
- const isSelected = actualIndex === selectedIndex;
156
- const isMarked = markedSessions.has(session.id);
157
- // Remove newlines and other whitespace characters from title
158
- const cleanTitle = (session.title || 'Untitled').replace(/[\r\n\t]+/g, ' ');
159
- const timeStr = formatDate(session.updatedAt);
160
- const truncatedLabel = cleanTitle.length > 50 ? cleanTitle.slice(0, 47) + '...' : cleanTitle;
161
- return (React.createElement(Box, { key: session.id },
162
- React.createElement(Text, { color: isMarked ? 'green' : 'gray' }, isMarked ? '✔ ' : ' '),
163
- React.createElement(Text, { color: isSelected ? 'green' : 'gray' }, isSelected ? '❯ ' : ' '),
164
- React.createElement(Text, { color: isSelected ? 'cyan' : isMarked ? 'green' : 'white' }, truncatedLabel),
165
- React.createElement(Text, { color: "gray", dimColor: true },
166
- ' ',
167
- "\u2022 ",
168
- timeStr)));
169
- }),
170
- hasMore && (React.createElement(Text, { color: "gray", dimColor: true },
171
- ' ',
172
- "\u2193 ",
173
- sessions.length - scrollOffset - VISIBLE_ITEMS,
174
- " more below"))));
175
- }
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- type Props = {
3
- onBack: () => void;
4
- onSelectSession: (sessionId: string) => void;
5
- };
6
- export default function SessionListScreen({ onBack, onSelectSession }: Props): React.JSX.Element;
7
- export {};
@@ -1,217 +0,0 @@
1
- import React, { useState, useEffect, useMemo, useCallback } from 'react';
2
- import { Box, Text, useInput, useStdout } from 'ink';
3
- import Gradient from 'ink-gradient';
4
- import { Alert } from '@inkjs/ui';
5
- import ScrollableSelectInput from './ScrollableSelectInput.js';
6
- import { sessionManager, } from '../../utils/sessionManager.js';
7
- export default function SessionListScreen({ onBack, onSelectSession }) {
8
- const [sessions, setSessions] = useState([]);
9
- const [loading, setLoading] = useState(true);
10
- const [error, setError] = useState('');
11
- const [selectedSessions, setSelectedSessions] = useState(new Set());
12
- const [actionMessage, setActionMessage] = useState(null);
13
- const { stdout } = useStdout();
14
- const loadSessions = useCallback(async () => {
15
- setLoading(true);
16
- setError('');
17
- try {
18
- const sessionList = await sessionManager.listSessions();
19
- setSessions(sessionList);
20
- setSelectedSessions(new Set());
21
- setActionMessage(null);
22
- }
23
- catch (err) {
24
- setError(err instanceof Error ? err.message : 'Failed to load sessions');
25
- }
26
- finally {
27
- setLoading(false);
28
- }
29
- }, []);
30
- useEffect(() => {
31
- void loadSessions();
32
- }, [loadSessions]);
33
- const formatDate = useCallback((timestamp) => {
34
- const date = new Date(timestamp);
35
- const now = new Date();
36
- const diffMs = now.getTime() - date.getTime();
37
- const diffHours = Math.floor(diffMs / (1000 * 60 * 60));
38
- const diffDays = Math.floor(diffHours / 24);
39
- if (diffHours < 1) {
40
- const diffMinutes = Math.floor(diffMs / (1000 * 60));
41
- return diffMinutes < 1 ? 'Just now' : `${diffMinutes}m ago`;
42
- }
43
- else if (diffHours < 24) {
44
- return `${diffHours}h ago`;
45
- }
46
- else if (diffDays < 7) {
47
- return `${diffDays}d ago`;
48
- }
49
- else {
50
- return date.toLocaleDateString();
51
- }
52
- }, []);
53
- // Create select items with truncated labels
54
- const selectItems = useMemo(() => {
55
- const terminalWidth = stdout?.columns || 80;
56
- // Reserve space for indicators (✔ + ❯ + spacing) and margins
57
- const reservedSpace = 30;
58
- const maxLabelWidth = Math.max(30, terminalWidth - reservedSpace);
59
- return sessions.map(session => {
60
- const timeString = formatDate(session.updatedAt);
61
- // Remove newlines and other whitespace characters from title
62
- const title = (session.title || 'Untitled').replace(/[\r\n\t]+/g, ' ');
63
- // Format: "Title • 5 msgs • 2h ago"
64
- const messageInfo = `${session.messageCount} msg${session.messageCount !== 1 ? 's' : ''}`;
65
- const fullLabel = `${title} • ${messageInfo} • ${timeString}`;
66
- // Truncate if too long - prioritize showing the title
67
- let truncatedLabel = fullLabel;
68
- if (fullLabel.length > maxLabelWidth) {
69
- const ellipsis = '...';
70
- const suffixLength = messageInfo.length + timeString.length + 6; // " • " x2 + "..."
71
- const availableForTitle = maxLabelWidth - suffixLength - ellipsis.length;
72
- if (availableForTitle > 10) {
73
- const truncatedTitle = title.substring(0, availableForTitle);
74
- truncatedLabel = `${truncatedTitle}${ellipsis} • ${messageInfo} • ${timeString}`;
75
- }
76
- else {
77
- // If terminal is too narrow, just truncate the whole thing
78
- truncatedLabel =
79
- fullLabel.substring(0, maxLabelWidth - ellipsis.length) + ellipsis;
80
- }
81
- }
82
- return {
83
- label: truncatedLabel,
84
- value: session.id,
85
- isMarked: selectedSessions.has(session.id),
86
- };
87
- });
88
- }, [sessions, formatDate, stdout?.columns, selectedSessions]);
89
- const handleSelect = useCallback((item) => {
90
- onSelectSession(item.value);
91
- }, [onSelectSession]);
92
- const handleToggleItem = useCallback((item) => {
93
- setSelectedSessions(previous => {
94
- const next = new Set(previous);
95
- if (next.has(item.value)) {
96
- next.delete(item.value);
97
- }
98
- else {
99
- next.add(item.value);
100
- }
101
- return next;
102
- });
103
- setActionMessage(null);
104
- }, []);
105
- const handleDeleteSelected = useCallback(async () => {
106
- if (selectedSessions.size === 0) {
107
- setActionMessage({ type: 'info', text: 'No conversations selected.' });
108
- return;
109
- }
110
- const ids = Array.from(selectedSessions);
111
- const deletionResults = await Promise.all(ids.map(async (id) => ({
112
- id,
113
- success: await sessionManager.deleteSession(id),
114
- })));
115
- const succeededIds = deletionResults
116
- .filter(result => result.success)
117
- .map(result => result.id);
118
- const failedIds = deletionResults
119
- .filter(result => !result.success)
120
- .map(result => result.id);
121
- if (succeededIds.length > 0) {
122
- setSessions(previous => previous.filter(session => !succeededIds.includes(session.id)));
123
- setSelectedSessions(previous => {
124
- const next = new Set(previous);
125
- for (const id of succeededIds) {
126
- next.delete(id);
127
- }
128
- return next;
129
- });
130
- }
131
- if (failedIds.length > 0) {
132
- setActionMessage({
133
- type: 'error',
134
- text: `Failed to delete ${failedIds.length} conversation${failedIds.length > 1 ? 's' : ''}.`,
135
- });
136
- }
137
- else if (succeededIds.length > 0) {
138
- setActionMessage({
139
- type: 'info',
140
- text: `Deleted ${succeededIds.length} conversation${succeededIds.length > 1 ? 's' : ''}.`,
141
- });
142
- }
143
- else {
144
- setActionMessage({ type: 'info', text: 'No conversations deleted.' });
145
- }
146
- }, [selectedSessions]);
147
- const handleInput = useCallback((input, key) => {
148
- if (key.escape) {
149
- onBack();
150
- return;
151
- }
152
- if (input === 'r' || input === 'R') {
153
- void loadSessions();
154
- }
155
- }, [loadSessions, onBack]);
156
- useInput(handleInput);
157
- if (loading) {
158
- return (React.createElement(Box, { flexDirection: "column", padding: 1 },
159
- React.createElement(Box, { marginBottom: 2, borderStyle: "double", borderColor: "cyan", paddingX: 2, paddingY: 1 },
160
- React.createElement(Box, { flexDirection: "column" },
161
- React.createElement(Gradient, { name: "rainbow" }, "Resume Conversation"),
162
- React.createElement(Text, { color: "gray", dimColor: true }, "Loading your conversation history...")))));
163
- }
164
- if (error) {
165
- return (React.createElement(Box, { flexDirection: "column", padding: 1 },
166
- React.createElement(Box, { marginBottom: 2, borderStyle: "double", borderColor: "red", paddingX: 2, paddingY: 1 },
167
- React.createElement(Box, { flexDirection: "column" },
168
- React.createElement(Gradient, { name: "rainbow" }, "Resume Conversation"),
169
- React.createElement(Text, { color: "gray", dimColor: true }, "Select a conversation to resume"))),
170
- React.createElement(Box, { marginBottom: 2 },
171
- React.createElement(Alert, { variant: "error" }, error)),
172
- React.createElement(Box, { flexDirection: "column" },
173
- React.createElement(Alert, { variant: "info" }, "Press Esc to return, or R to retry"))));
174
- }
175
- if (sessions.length === 0) {
176
- return (React.createElement(Box, { flexDirection: "column", padding: 1 },
177
- React.createElement(Box, { marginBottom: 2, borderStyle: "double", borderColor: "cyan", paddingX: 2, paddingY: 1 },
178
- React.createElement(Box, { flexDirection: "column" },
179
- React.createElement(Gradient, { name: "rainbow" }, "Resume Conversation"),
180
- React.createElement(Text, { color: "gray", dimColor: true }, "No conversations found"))),
181
- React.createElement(Box, { marginBottom: 2 },
182
- React.createElement(Alert, { variant: "info" }, "No previous conversations found. Start a new conversation to create your first session.")),
183
- React.createElement(Box, { flexDirection: "column" },
184
- React.createElement(Alert, { variant: "info" }, "Press Esc to return to chat"))));
185
- }
186
- // Calculate available height for the list with safer bounds
187
- const terminalHeight = stdout?.rows || 24;
188
- const headerHeight = 7; // Header box height (including borders and padding)
189
- const footerHeight = 4; // Footer info height (including margins)
190
- const availableHeight = Math.max(5, terminalHeight - headerHeight - footerHeight);
191
- const maxVisibleSessions = 10;
192
- const desiredListSize = Math.max(3, Math.min(maxVisibleSessions, availableHeight));
193
- const listLimit = Math.min(selectItems.length, desiredListSize);
194
- const containerHeight = terminalHeight > 2 ? terminalHeight - 2 : undefined;
195
- return (React.createElement(Box, { flexDirection: "column", padding: 1, height: containerHeight },
196
- React.createElement(Box, { marginBottom: 1, borderStyle: "double", borderColor: "cyan", paddingX: 2, paddingY: 1 },
197
- React.createElement(Box, { flexDirection: "column" },
198
- React.createElement(Gradient, { name: "rainbow" }, "Resume Conversation"),
199
- React.createElement(Text, { color: "gray", dimColor: true },
200
- sessions.length,
201
- " conversation",
202
- sessions.length !== 1 ? 's' : '',
203
- ' ',
204
- "available"))),
205
- React.createElement(Box, { marginBottom: 1, flexShrink: 0 },
206
- React.createElement(ScrollableSelectInput, { items: selectItems, limit: listLimit, onSelect: handleSelect, onToggleItem: handleToggleItem, onDeleteSelection: handleDeleteSelected, selectedValues: selectedSessions, indicator: ({ isSelected }) => (React.createElement(Text, { color: isSelected ? 'green' : 'gray' }, isSelected ? '❯ ' : ' ')), renderItem: ({ isSelected, isMarked, label }) => (React.createElement(Text, null,
207
- React.createElement(Text, { color: isMarked ? 'green' : 'gray' }, isMarked ? '✔ ' : ' '),
208
- React.createElement(Text, { color: isMarked ? 'green' : isSelected ? 'cyan' : 'white' }, label))) })),
209
- React.createElement(Box, { flexDirection: "column", flexShrink: 0 },
210
- actionMessage ? (React.createElement(Box, { marginBottom: 1 },
211
- React.createElement(Alert, { variant: actionMessage.type }, actionMessage.text))) : null,
212
- React.createElement(Alert, { variant: "info" },
213
- "\u2191\u2193 navigate \u2022 Space mark \u2022 D delete \u2022 Enter select \u2022 Esc return \u2022 R refresh",
214
- selectedSessions.size > 0
215
- ? ` • ${selectedSessions.size} selected`
216
- : ''))));
217
- }
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- type Props = {
3
- onBack: () => void;
4
- onSelectSession: (sessionId: string) => void;
5
- };
6
- export default function SessionListScreenWrapper({ onBack, onSelectSession }: Props): React.JSX.Element;
7
- export {};
@@ -1,14 +0,0 @@
1
- import React, { useEffect } from 'react';
2
- import SessionListScreen from './SessionListScreen.js';
3
- export default function SessionListScreenWrapper({ onBack, onSelectSession }) {
4
- useEffect(() => {
5
- process.stdout.write('\x1B[?1049h');
6
- process.stdout.write('\x1B[2J');
7
- process.stdout.write('\x1B[H');
8
- return () => {
9
- process.stdout.write('\x1B[2J');
10
- process.stdout.write('\x1B[?1049l');
11
- };
12
- }, []);
13
- return (React.createElement(SessionListScreen, { onBack: onBack, onSelectSession: onSelectSession }));
14
- }
@@ -1,9 +0,0 @@
1
- import React from 'react';
2
- interface ShimmerTextProps {
3
- text: string;
4
- }
5
- /**
6
- * ShimmerText component that displays text with a white shimmer effect flowing through yellow text
7
- */
8
- export default function ShimmerText({ text }: ShimmerTextProps): React.JSX.Element;
9
- export {};
@@ -1,30 +0,0 @@
1
- import React, { useState, useEffect } from 'react';
2
- import { Text } from 'ink';
3
- import chalk from 'chalk';
4
- /**
5
- * ShimmerText component that displays text with a white shimmer effect flowing through yellow text
6
- */
7
- export default function ShimmerText({ text }) {
8
- const [frame, setFrame] = useState(0);
9
- useEffect(() => {
10
- const interval = setInterval(() => {
11
- setFrame(prev => (prev + 1) % (text.length + 5));
12
- }, 100); // Update every 100ms for smooth animation
13
- return () => clearInterval(interval);
14
- }, [text.length]);
15
- // Build the colored text with shimmer effect
16
- let output = '';
17
- for (let i = 0; i < text.length; i++) {
18
- const char = text[i];
19
- const distance = Math.abs(i - frame);
20
- // Bright cyan shimmer in the center (distance 0-1)
21
- if (distance <= 1) {
22
- output += chalk.hex('#00FFFF')(char); // Bright cyan/aqua
23
- }
24
- // Deep blue for the rest (base color)
25
- else {
26
- output += chalk.hex('#1ACEB0')(char); // Steel blue
27
- }
28
- }
29
- return React.createElement(Text, null, output);
30
- }
@@ -1,14 +0,0 @@
1
- import React from 'react';
2
- import type { TodoItem } from '../../utils/todoScanner.js';
3
- interface Props {
4
- todos: TodoItem[];
5
- selectedIndex: number;
6
- selectedTodos: Set<string>;
7
- visible: boolean;
8
- maxHeight?: number;
9
- isLoading?: boolean;
10
- searchQuery?: string;
11
- totalCount?: number;
12
- }
13
- declare const TodoPickerPanel: React.MemoExoticComponent<({ todos, selectedIndex, selectedTodos, visible, maxHeight, isLoading, searchQuery, totalCount, }: Props) => React.JSX.Element | null>;
14
- export default TodoPickerPanel;