centaurus-cli 2.5.2 → 2.6.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 (310) hide show
  1. package/dist/cli-adapter.d.ts +6 -0
  2. package/dist/cli-adapter.d.ts.map +1 -1
  3. package/dist/cli-adapter.js +215 -29
  4. package/dist/cli-adapter.js.map +1 -1
  5. package/dist/commands/CommandParser.js +2 -2
  6. package/dist/commands/CommandParser.js.map +1 -1
  7. package/dist/config/defaultConfig.js +1 -1
  8. package/dist/config/defaultConfig.js.map +1 -1
  9. package/dist/config/models.d.ts +50 -5
  10. package/dist/config/models.d.ts.map +1 -1
  11. package/dist/config/models.js +144 -20
  12. package/dist/config/models.js.map +1 -1
  13. package/dist/config/types.d.ts +3 -0
  14. package/dist/config/types.d.ts.map +1 -1
  15. package/dist/config/types.js +3 -1
  16. package/dist/config/types.js.map +1 -1
  17. package/dist/index.js +9 -0
  18. package/dist/index.js.map +1 -1
  19. package/dist/services/ai-service-client.d.ts +8 -2
  20. package/dist/services/ai-service-client.d.ts.map +1 -1
  21. package/dist/services/ai-service-client.js +2 -1
  22. package/dist/services/ai-service-client.js.map +1 -1
  23. package/dist/services/environment-context-injector.d.ts +69 -0
  24. package/dist/services/environment-context-injector.d.ts.map +1 -0
  25. package/dist/services/environment-context-injector.js +198 -0
  26. package/dist/services/environment-context-injector.js.map +1 -0
  27. package/dist/tools/ToolRegistry.d.ts.map +1 -1
  28. package/dist/tools/ToolRegistry.js +120 -26
  29. package/dist/tools/ToolRegistry.js.map +1 -1
  30. package/dist/tools/command.d.ts.map +1 -1
  31. package/dist/tools/command.js +30 -6
  32. package/dist/tools/command.js.map +1 -1
  33. package/dist/tools/file-ops.d.ts.map +1 -1
  34. package/dist/tools/file-ops.js +70 -23
  35. package/dist/tools/file-ops.js.map +1 -1
  36. package/dist/tools/find-files.d.ts +47 -0
  37. package/dist/tools/find-files.d.ts.map +1 -0
  38. package/dist/tools/find-files.js +190 -0
  39. package/dist/tools/find-files.js.map +1 -0
  40. package/dist/tools/get-diff.d.ts +45 -0
  41. package/dist/tools/get-diff.d.ts.map +1 -0
  42. package/dist/tools/get-diff.js +138 -0
  43. package/dist/tools/get-diff.js.map +1 -0
  44. package/dist/tools/grep-search.d.ts +85 -0
  45. package/dist/tools/grep-search.d.ts.map +1 -0
  46. package/dist/tools/grep-search.js +497 -0
  47. package/dist/tools/grep-search.js.map +1 -0
  48. package/dist/tools/inspect-symbol.d.ts +27 -0
  49. package/dist/tools/inspect-symbol.d.ts.map +1 -0
  50. package/dist/tools/inspect-symbol.js +259 -0
  51. package/dist/tools/inspect-symbol.js.map +1 -0
  52. package/dist/tools/validation.d.ts +49 -0
  53. package/dist/tools/validation.d.ts.map +1 -0
  54. package/dist/tools/validation.js +125 -0
  55. package/dist/tools/validation.js.map +1 -0
  56. package/dist/types/index.d.ts +13 -0
  57. package/dist/types/index.d.ts.map +1 -1
  58. package/dist/ui/components/App.d.ts +3 -0
  59. package/dist/ui/components/App.d.ts.map +1 -1
  60. package/dist/ui/components/App.js +272 -72
  61. package/dist/ui/components/App.js.map +1 -1
  62. package/dist/ui/components/ContextWindowIndicator.d.ts +8 -0
  63. package/dist/ui/components/ContextWindowIndicator.d.ts.map +1 -0
  64. package/dist/ui/components/ContextWindowIndicator.js +34 -0
  65. package/dist/ui/components/ContextWindowIndicator.js.map +1 -0
  66. package/dist/ui/components/FontRecommendation.d.ts +1 -0
  67. package/dist/ui/components/FontRecommendation.d.ts.map +1 -0
  68. package/dist/ui/components/FontRecommendation.js +1 -0
  69. package/dist/ui/components/FontRecommendation.js.map +1 -0
  70. package/dist/ui/components/InputBox.d.ts +2 -0
  71. package/dist/ui/components/InputBox.d.ts.map +1 -1
  72. package/dist/ui/components/InputBox.js +9 -4
  73. package/dist/ui/components/InputBox.js.map +1 -1
  74. package/dist/ui/components/MarkdownRenderer.d.ts.map +1 -1
  75. package/dist/ui/components/MarkdownRenderer.js +34 -9
  76. package/dist/ui/components/MarkdownRenderer.js.map +1 -1
  77. package/dist/ui/components/MessageDisplay.d.ts.map +1 -1
  78. package/dist/ui/components/MessageDisplay.js +9 -2
  79. package/dist/ui/components/MessageDisplay.js.map +1 -1
  80. package/dist/ui/components/StreamingMessageDisplay.d.ts.map +1 -1
  81. package/dist/ui/components/StreamingMessageDisplay.js +11 -3
  82. package/dist/ui/components/StreamingMessageDisplay.js.map +1 -1
  83. package/dist/ui/components/ThinkingDisplay.d.ts +12 -0
  84. package/dist/ui/components/ThinkingDisplay.d.ts.map +1 -0
  85. package/dist/ui/components/ThinkingDisplay.js +41 -0
  86. package/dist/ui/components/ThinkingDisplay.js.map +1 -0
  87. package/dist/utils/markdown-parser.d.ts +4 -0
  88. package/dist/utils/markdown-parser.d.ts.map +1 -1
  89. package/dist/utils/markdown-parser.js +15 -1
  90. package/dist/utils/markdown-parser.js.map +1 -1
  91. package/dist/utils/version-checker.d.ts.map +1 -1
  92. package/dist/utils/version-checker.js +3 -31
  93. package/dist/utils/version-checker.js.map +1 -1
  94. package/package.json +6 -5
  95. package/README.md +0 -501
  96. package/dist/ai/provider-factory.d.ts +0 -6
  97. package/dist/ai/provider-factory.d.ts.map +0 -1
  98. package/dist/ai/provider-factory.js +0 -27
  99. package/dist/ai/provider-factory.js.map +0 -1
  100. package/dist/ai/providers/base.d.ts +0 -25
  101. package/dist/ai/providers/base.d.ts.map +0 -1
  102. package/dist/ai/providers/base.js +0 -9
  103. package/dist/ai/providers/base.js.map +0 -1
  104. package/dist/ai/providers/gemini.d.ts +0 -34
  105. package/dist/ai/providers/gemini.d.ts.map +0 -1
  106. package/dist/ai/providers/gemini.js +0 -146
  107. package/dist/ai/providers/gemini.js.map +0 -1
  108. package/dist/commands/view-duplication-logs.d.ts +0 -5
  109. package/dist/commands/view-duplication-logs.d.ts.map +0 -1
  110. package/dist/commands/view-duplication-logs.js +0 -14
  111. package/dist/commands/view-duplication-logs.js.map +0 -1
  112. package/dist/context/__tests__/command-detector.test.d.ts +0 -14
  113. package/dist/context/__tests__/command-detector.test.d.ts.map +0 -1
  114. package/dist/context/__tests__/command-detector.test.js +0 -318
  115. package/dist/context/__tests__/command-detector.test.js.map +0 -1
  116. package/dist/context/__tests__/context-manager.test.d.ts +0 -16
  117. package/dist/context/__tests__/context-manager.test.d.ts.map +0 -1
  118. package/dist/context/__tests__/context-manager.test.js +0 -375
  119. package/dist/context/__tests__/context-manager.test.js.map +0 -1
  120. package/dist/context/__tests__/error-handling.test.d.ts +0 -15
  121. package/dist/context/__tests__/error-handling.test.d.ts.map +0 -1
  122. package/dist/context/__tests__/error-handling.test.js +0 -447
  123. package/dist/context/__tests__/error-handling.test.js.map +0 -1
  124. package/dist/context/handlers/__tests__/docker-handler.test.d.ts +0 -13
  125. package/dist/context/handlers/__tests__/docker-handler.test.d.ts.map +0 -1
  126. package/dist/context/handlers/__tests__/docker-handler.test.js +0 -285
  127. package/dist/context/handlers/__tests__/docker-handler.test.js.map +0 -1
  128. package/dist/context/handlers/__tests__/ssh-handler.test.d.ts +0 -13
  129. package/dist/context/handlers/__tests__/ssh-handler.test.d.ts.map +0 -1
  130. package/dist/context/handlers/__tests__/ssh-handler.test.js +0 -251
  131. package/dist/context/handlers/__tests__/ssh-handler.test.js.map +0 -1
  132. package/dist/context/handlers/__tests__/wsl-handler.test.d.ts +0 -7
  133. package/dist/context/handlers/__tests__/wsl-handler.test.d.ts.map +0 -1
  134. package/dist/context/handlers/__tests__/wsl-handler.test.js +0 -331
  135. package/dist/context/handlers/__tests__/wsl-handler.test.js.map +0 -1
  136. package/dist/index-custom.d.ts +0 -3
  137. package/dist/index-custom.d.ts.map +0 -1
  138. package/dist/index-custom.js +0 -65
  139. package/dist/index-custom.js.map +0 -1
  140. package/dist/prompts/system-prompt.d.ts +0 -47
  141. package/dist/prompts/system-prompt.d.ts.map +0 -1
  142. package/dist/prompts/system-prompt.js +0 -377
  143. package/dist/prompts/system-prompt.js.map +0 -1
  144. package/dist/providers/GoogleProvider.d.ts +0 -26
  145. package/dist/providers/GoogleProvider.d.ts.map +0 -1
  146. package/dist/providers/GoogleProvider.js +0 -313
  147. package/dist/providers/GoogleProvider.js.map +0 -1
  148. package/dist/providers/Provider.d.ts +0 -114
  149. package/dist/providers/Provider.d.ts.map +0 -1
  150. package/dist/providers/Provider.js +0 -44
  151. package/dist/providers/Provider.js.map +0 -1
  152. package/dist/services/__tests__/ai-context-injector.test.d.ts +0 -15
  153. package/dist/services/__tests__/ai-context-injector.test.d.ts.map +0 -1
  154. package/dist/services/__tests__/ai-context-injector.test.js +0 -326
  155. package/dist/services/__tests__/ai-context-injector.test.js.map +0 -1
  156. package/dist/src/context/types.js +0 -27
  157. package/dist/src/services/ai-context-injector.js +0 -96
  158. package/dist/src/services/ai-service-client.js +0 -270
  159. package/dist/src/services/api-client.js +0 -349
  160. package/dist/src/tools/types.js +0 -1
  161. package/dist/src/types/index.js +0 -1
  162. package/dist/test/context/types.js +0 -27
  163. package/dist/test/services/__tests__/ai-context-injector.test.js +0 -325
  164. package/dist/test/services/ai-context-injector.js +0 -96
  165. package/dist/test/services/ai-service-client.js +0 -270
  166. package/dist/test/services/api-client.js +0 -349
  167. package/dist/test/tools/types.js +0 -1
  168. package/dist/test/types/index.js +0 -1
  169. package/dist/test-ai-context-injector.js +0 -97
  170. package/dist/tests/automated-verification.d.ts +0 -27
  171. package/dist/tests/automated-verification.d.ts.map +0 -1
  172. package/dist/tests/automated-verification.js +0 -359
  173. package/dist/tests/automated-verification.js.map +0 -1
  174. package/dist/tests/integration-tests.d.ts +0 -50
  175. package/dist/tests/integration-tests.d.ts.map +0 -1
  176. package/dist/tests/integration-tests.js +0 -648
  177. package/dist/tests/integration-tests.js.map +0 -1
  178. package/dist/tools/file-ops-test.d.ts +0 -6
  179. package/dist/tools/file-ops-test.d.ts.map +0 -1
  180. package/dist/tools/file-ops-test.js +0 -197
  181. package/dist/tools/file-ops-test.js.map +0 -1
  182. package/dist/ui/DisplayHistory.d.ts +0 -53
  183. package/dist/ui/DisplayHistory.d.ts.map +0 -1
  184. package/dist/ui/DisplayHistory.js +0 -82
  185. package/dist/ui/DisplayHistory.js.map +0 -1
  186. package/dist/ui/clack-ui.d.ts +0 -83
  187. package/dist/ui/clack-ui.d.ts.map +0 -1
  188. package/dist/ui/clack-ui.js +0 -304
  189. package/dist/ui/clack-ui.js.map +0 -1
  190. package/dist/ui/components/DisplayItemRenderer.d.ts +0 -18
  191. package/dist/ui/components/DisplayItemRenderer.d.ts.map +0 -1
  192. package/dist/ui/components/DisplayItemRenderer.js +0 -53
  193. package/dist/ui/components/DisplayItemRenderer.js.map +0 -1
  194. package/dist/ui/components/DynamicMessage.d.ts +0 -13
  195. package/dist/ui/components/DynamicMessage.d.ts.map +0 -1
  196. package/dist/ui/components/DynamicMessage.js +0 -27
  197. package/dist/ui/components/DynamicMessage.js.map +0 -1
  198. package/dist/ui/components/FileViewerScreen.d.ts +0 -14
  199. package/dist/ui/components/FileViewerScreen.d.ts.map +0 -1
  200. package/dist/ui/components/FileViewerScreen.js +0 -74
  201. package/dist/ui/components/FileViewerScreen.js.map +0 -1
  202. package/dist/ui/components/ScrollableContent.d.ts +0 -7
  203. package/dist/ui/components/ScrollableContent.d.ts.map +0 -1
  204. package/dist/ui/components/ScrollableContent.js +0 -6
  205. package/dist/ui/components/ScrollableContent.js.map +0 -1
  206. package/dist/ui/components/ScrollableMessageList.d.ts +0 -10
  207. package/dist/ui/components/ScrollableMessageList.d.ts.map +0 -1
  208. package/dist/ui/components/ScrollableMessageList.js +0 -133
  209. package/dist/ui/components/ScrollableMessageList.js.map +0 -1
  210. package/dist/ui/components/ScrollableScreen.d.ts +0 -9
  211. package/dist/ui/components/ScrollableScreen.d.ts.map +0 -1
  212. package/dist/ui/components/ScrollableScreen.js +0 -22
  213. package/dist/ui/components/ScrollableScreen.js.map +0 -1
  214. package/dist/ui/components/StaticMessageHistory.d.ts +0 -14
  215. package/dist/ui/components/StaticMessageHistory.d.ts.map +0 -1
  216. package/dist/ui/components/StaticMessageHistory.js +0 -19
  217. package/dist/ui/components/StaticMessageHistory.js.map +0 -1
  218. package/dist/ui/components/code-block.d.ts +0 -10
  219. package/dist/ui/components/code-block.d.ts.map +0 -1
  220. package/dist/ui/components/code-block.js +0 -74
  221. package/dist/ui/components/code-block.js.map +0 -1
  222. package/dist/ui/components/confirm-prompt.d.ts +0 -12
  223. package/dist/ui/components/confirm-prompt.d.ts.map +0 -1
  224. package/dist/ui/components/confirm-prompt.js +0 -104
  225. package/dist/ui/components/confirm-prompt.js.map +0 -1
  226. package/dist/ui/components/diff-viewer.d.ts +0 -9
  227. package/dist/ui/components/diff-viewer.d.ts.map +0 -1
  228. package/dist/ui/components/diff-viewer.js +0 -57
  229. package/dist/ui/components/diff-viewer.js.map +0 -1
  230. package/dist/ui/components/input-box.d.ts +0 -18
  231. package/dist/ui/components/input-box.d.ts.map +0 -1
  232. package/dist/ui/components/input-box.js +0 -157
  233. package/dist/ui/components/input-box.js.map +0 -1
  234. package/dist/ui/components/keyboard-help.d.ts +0 -7
  235. package/dist/ui/components/keyboard-help.d.ts.map +0 -1
  236. package/dist/ui/components/keyboard-help.js +0 -43
  237. package/dist/ui/components/keyboard-help.js.map +0 -1
  238. package/dist/ui/components/loading-indicator.d.ts +0 -3
  239. package/dist/ui/components/loading-indicator.d.ts.map +0 -1
  240. package/dist/ui/components/loading-indicator.js +0 -42
  241. package/dist/ui/components/loading-indicator.js.map +0 -1
  242. package/dist/ui/components/message-display.d.ts +0 -7
  243. package/dist/ui/components/message-display.d.ts.map +0 -1
  244. package/dist/ui/components/message-display.js +0 -104
  245. package/dist/ui/components/message-display.js.map +0 -1
  246. package/dist/ui/components/misc.d.ts +0 -28
  247. package/dist/ui/components/misc.d.ts.map +0 -1
  248. package/dist/ui/components/misc.js +0 -128
  249. package/dist/ui/components/misc.js.map +0 -1
  250. package/dist/ui/components/select-prompt.d.ts +0 -13
  251. package/dist/ui/components/select-prompt.d.ts.map +0 -1
  252. package/dist/ui/components/select-prompt.js +0 -42
  253. package/dist/ui/components/select-prompt.js.map +0 -1
  254. package/dist/ui/components/status-bar.d.ts +0 -11
  255. package/dist/ui/components/status-bar.d.ts.map +0 -1
  256. package/dist/ui/components/status-bar.js +0 -47
  257. package/dist/ui/components/status-bar.js.map +0 -1
  258. package/dist/ui/components/tool-execution.d.ts +0 -3
  259. package/dist/ui/components/tool-execution.d.ts.map +0 -1
  260. package/dist/ui/components/tool-execution.js +0 -374
  261. package/dist/ui/components/tool-execution.js.map +0 -1
  262. package/dist/ui/components/tool-result.d.ts +0 -11
  263. package/dist/ui/components/tool-result.d.ts.map +0 -1
  264. package/dist/ui/components/tool-result.js +0 -58
  265. package/dist/ui/components/tool-result.js.map +0 -1
  266. package/dist/ui/components/welcome-banner.d.ts +0 -3
  267. package/dist/ui/components/welcome-banner.d.ts.map +0 -1
  268. package/dist/ui/components/welcome-banner.js +0 -46
  269. package/dist/ui/components/welcome-banner.js.map +0 -1
  270. package/dist/ui/hooks/useDisplayHistory.d.ts +0 -13
  271. package/dist/ui/hooks/useDisplayHistory.d.ts.map +0 -1
  272. package/dist/ui/hooks/useDisplayHistory.js +0 -45
  273. package/dist/ui/hooks/useDisplayHistory.js.map +0 -1
  274. package/dist/ui/render-engine.d.ts +0 -69
  275. package/dist/ui/render-engine.d.ts.map +0 -1
  276. package/dist/ui/render-engine.js +0 -197
  277. package/dist/ui/render-engine.js.map +0 -1
  278. package/dist/ui/terminal/TerminalRenderer.d.ts +0 -84
  279. package/dist/ui/terminal/TerminalRenderer.d.ts.map +0 -1
  280. package/dist/ui/terminal/TerminalRenderer.js +0 -154
  281. package/dist/ui/terminal/TerminalRenderer.js.map +0 -1
  282. package/dist/ui/terminal/TerminalUI.d.ts +0 -139
  283. package/dist/ui/terminal/TerminalUI.d.ts.map +0 -1
  284. package/dist/ui/terminal/TerminalUI.js +0 -430
  285. package/dist/ui/terminal/TerminalUI.js.map +0 -1
  286. package/dist/ui/terminal/VirtualChatBuffer.d.ts +0 -32
  287. package/dist/ui/terminal/VirtualChatBuffer.d.ts.map +0 -1
  288. package/dist/ui/terminal/VirtualChatBuffer.js +0 -37
  289. package/dist/ui/terminal/VirtualChatBuffer.js.map +0 -1
  290. package/dist/ui/terminal-kit-base.d.ts +0 -117
  291. package/dist/ui/terminal-kit-base.d.ts.map +0 -1
  292. package/dist/ui/terminal-kit-base.js +0 -188
  293. package/dist/ui/terminal-kit-base.js.map +0 -1
  294. package/dist/ui/utils/duplication-detector.d.ts +0 -32
  295. package/dist/ui/utils/duplication-detector.d.ts.map +0 -1
  296. package/dist/ui/utils/duplication-detector.js +0 -227
  297. package/dist/ui/utils/duplication-detector.js.map +0 -1
  298. package/dist/ui/utils/duplication-logger.d.ts +0 -21
  299. package/dist/ui/utils/duplication-logger.d.ts.map +0 -1
  300. package/dist/ui/utils/duplication-logger.js +0 -85
  301. package/dist/ui/utils/duplication-logger.js.map +0 -1
  302. package/dist/ui/utils/terminal-scanner.d.ts +0 -19
  303. package/dist/ui/utils/terminal-scanner.d.ts.map +0 -1
  304. package/dist/ui/utils/terminal-scanner.js +0 -217
  305. package/dist/ui/utils/terminal-scanner.js.map +0 -1
  306. package/dist/version.d.ts +0 -2
  307. package/dist/version.d.ts.map +0 -1
  308. package/dist/version.js +0 -3
  309. package/dist/version.js.map +0 -1
  310. package/scripts/generate-version.js +0 -25
@@ -1,133 +0,0 @@
1
- import React, { useState, useEffect, useRef, useMemo } from 'react';
2
- import { Box, useInput, useStdin, Text } from 'ink';
3
- import { MessageDisplay } from './MessageDisplay.js';
4
- export const ScrollableMessageList = ({ messages, maxScrollback = 500, viewportHeight = 20 }) => {
5
- const [scrollOffset, setScrollOffset] = useState(0);
6
- const [isScrolledToBottom, setIsScrolledToBottom] = useState(true);
7
- const { stdin, setRawMode } = useStdin();
8
- const prevMessagesLengthRef = useRef(messages.length);
9
- // Limit messages to max scrollback
10
- const limitedMessages = useMemo(() => {
11
- return messages.slice(-maxScrollback);
12
- }, [messages, maxScrollback]);
13
- const totalMessages = limitedMessages.length;
14
- const maxScrollOffset = Math.max(0, totalMessages - viewportHeight);
15
- // Auto-scroll to bottom when new messages arrive (only if already at bottom)
16
- useEffect(() => {
17
- if (messages.length > prevMessagesLengthRef.current) {
18
- if (isScrolledToBottom) {
19
- setScrollOffset(Math.max(0, messages.slice(-maxScrollback).length - viewportHeight));
20
- }
21
- prevMessagesLengthRef.current = messages.length;
22
- }
23
- }, [messages, isScrolledToBottom, viewportHeight, maxScrollback]);
24
- // Check if we're at the bottom
25
- useEffect(() => {
26
- const atBottom = scrollOffset >= maxScrollOffset;
27
- setIsScrolledToBottom(atBottom);
28
- }, [scrollOffset, maxScrollOffset]);
29
- // Keyboard input handling
30
- useInput((input, key) => {
31
- // Don't handle input if there are too few messages to scroll
32
- if (totalMessages <= viewportHeight)
33
- return;
34
- if (key.upArrow) {
35
- setScrollOffset(prev => Math.max(0, prev - 1));
36
- }
37
- else if (key.downArrow) {
38
- setScrollOffset(prev => Math.min(maxScrollOffset, prev + 1));
39
- }
40
- else if (key.pageUp) {
41
- setScrollOffset(prev => Math.max(0, prev - viewportHeight));
42
- }
43
- else if (key.pageDown) {
44
- setScrollOffset(prev => Math.min(maxScrollOffset, prev + viewportHeight));
45
- }
46
- else if (input === 'g' || input === 'G') {
47
- // Home - go to top
48
- if (input === 'g') {
49
- setScrollOffset(0);
50
- }
51
- // End - go to bottom
52
- if (input === 'G') {
53
- setScrollOffset(maxScrollOffset);
54
- }
55
- }
56
- });
57
- // Mouse wheel support
58
- useEffect(() => {
59
- if (!stdin || typeof setRawMode !== 'function')
60
- return;
61
- // Enable mouse tracking (X11 mouse protocol)
62
- process.stdout.write('\x1b[?1000h'); // Enable mouse button events
63
- process.stdout.write('\x1b[?1003h'); // Enable all mouse events
64
- process.stdout.write('\x1b[?1015h'); // Enable urxvt mouse mode
65
- process.stdout.write('\x1b[?1006h'); // Enable SGR mouse mode
66
- const handleData = (data) => {
67
- const str = data.toString('utf8');
68
- // Parse SGR mouse format: \x1b[<b;x;y;M or m
69
- // Wheel up: button 64, Wheel down: button 65
70
- const sgrMatch = str.match(/\x1b\[<(\d+);(\d+);(\d+)([Mm])/);
71
- if (sgrMatch) {
72
- const button = parseInt(sgrMatch[1], 10);
73
- const action = sgrMatch[4];
74
- if (action === 'M') { // Mouse button press
75
- if (button === 64) {
76
- // Scroll up (wheel up)
77
- setScrollOffset(prev => Math.max(0, prev - 3));
78
- }
79
- else if (button === 65) {
80
- // Scroll down (wheel down)
81
- setScrollOffset(prev => Math.min(maxScrollOffset, prev + 3));
82
- }
83
- }
84
- }
85
- // Fallback: Parse X10 mouse format: \x1b[Mbxy
86
- if (str.startsWith('\x1b[M') && str.length >= 6) {
87
- const cb = str.charCodeAt(3) - 32;
88
- // Wheel up: 64, Wheel down: 65
89
- if (cb === 64) {
90
- setScrollOffset(prev => Math.max(0, prev - 3));
91
- }
92
- else if (cb === 65) {
93
- setScrollOffset(prev => Math.min(maxScrollOffset, prev + 3));
94
- }
95
- }
96
- };
97
- stdin.on('data', handleData);
98
- return () => {
99
- // Disable mouse tracking on cleanup
100
- process.stdout.write('\x1b[?1000l');
101
- process.stdout.write('\x1b[?1003l');
102
- process.stdout.write('\x1b[?1015l');
103
- process.stdout.write('\x1b[?1006l');
104
- stdin.off('data', handleData);
105
- };
106
- }, [stdin, setRawMode, maxScrollOffset]);
107
- // Calculate visible messages
108
- const visibleMessages = useMemo(() => {
109
- const start = scrollOffset;
110
- const end = Math.min(totalMessages, scrollOffset + viewportHeight);
111
- return limitedMessages.slice(start, end);
112
- }, [limitedMessages, scrollOffset, viewportHeight, totalMessages]);
113
- // Scrollbar indicator
114
- const showScrollbar = totalMessages > viewportHeight;
115
- const scrollbarPosition = maxScrollOffset > 0
116
- ? Math.round((scrollOffset / maxScrollOffset) * (viewportHeight - 1))
117
- : 0;
118
- return (React.createElement(Box, { flexDirection: "row", width: "100%" },
119
- React.createElement(Box, { flexDirection: "column", flexGrow: 1, marginY: 1 },
120
- visibleMessages.map((msg) => (React.createElement(MessageDisplay, { key: msg.id, message: msg }))),
121
- totalMessages > viewportHeight && !isScrolledToBottom && (React.createElement(Box, { marginTop: 1 },
122
- React.createElement(Text, { dimColor: true },
123
- "\u2193 ",
124
- totalMessages - (scrollOffset + viewportHeight),
125
- " more messages below (\u2193/PgDn/G)"))),
126
- totalMessages > viewportHeight && scrollOffset > 0 && (React.createElement(Box, null,
127
- React.createElement(Text, { dimColor: true },
128
- "\u2191 ",
129
- scrollOffset,
130
- " messages above (\u2191/PgUp/g)")))),
131
- showScrollbar && (React.createElement(Box, { flexDirection: "column", marginLeft: 1, width: 1 }, Array.from({ length: viewportHeight }).map((_, i) => (React.createElement(Text, { key: i, dimColor: true }, i === scrollbarPosition ? '█' : '│')))))));
132
- };
133
- //# sourceMappingURL=ScrollableMessageList.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ScrollableMessageList.js","sourceRoot":"","sources":["../../../src/ui/components/ScrollableMessageList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACpE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AASrD,MAAM,CAAC,MAAM,qBAAqB,GAAyC,CAAC,EAC1E,QAAQ,EACR,aAAa,GAAG,GAAG,EACnB,cAAc,GAAG,EAAE,EACpB,EAAE,EAAE;IACH,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IACpD,MAAM,CAAC,kBAAkB,EAAE,qBAAqB,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IACnE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,GAAG,QAAQ,EAAE,CAAC;IACzC,MAAM,qBAAqB,GAAG,MAAM,CAAC,QAAQ,C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C"}
@@ -1,9 +0,0 @@
1
- import React from 'react';
2
- /**
3
- * ScrollableScreen component that uses alternate screen buffer with scrolling enabled
4
- * This prevents seeing duplicate renders while allowing scrollback within the current session
5
- */
6
- export declare const ScrollableScreen: React.FC<{
7
- children: React.ReactNode;
8
- }>;
9
- //# sourceMappingURL=ScrollableScreen.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ScrollableScreen.d.ts","sourceRoot":"","sources":["../../../src/ui/components/ScrollableScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,CAkBpE,CAAC"}
@@ -1,22 +0,0 @@
1
- import React from 'react';
2
- import { Box } from 'ink';
3
- /**
4
- * ScrollableScreen component that uses alternate screen buffer with scrolling enabled
5
- * This prevents seeing duplicate renders while allowing scrollback within the current session
6
- */
7
- export const ScrollableScreen = ({ children }) => {
8
- React.useEffect(() => {
9
- // Enter alternate screen buffer
10
- process.stdout.write('\x1B[?1049h');
11
- // Enable scrolling in the alternate buffer
12
- process.stdout.write('\x1B[?7h'); // Enable line wrap
13
- // Clear screen and home cursor
14
- process.stdout.write('\x1B[2J\x1B[H');
15
- return () => {
16
- // Exit alternate screen buffer on unmount
17
- process.stdout.write('\x1B[?1049l');
18
- };
19
- }, []);
20
- return React.createElement(Box, { flexDirection: "column" }, children);
21
- };
22
- //# sourceMappingURL=ScrollableScreen.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ScrollableScreen.js","sourceRoot":"","sources":["../../../src/ui/components/ScrollableScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAA4C,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IACxF,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,gCAAgC;QAChC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;QAEpC,2CAA2C;QAC3C,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,mBAAmB;QAErD,+BAA+B;QAC/B,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;QAEtC,OAAO,GAAG,EAAE;YACV,0CAA0C;YAC1C,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;QACtC,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,oBAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,IAAE,QAAQ,CAAO,CAAC;AACtD,CAAC,CAAC"}
@@ -1,14 +0,0 @@
1
- import React from 'react';
2
- import { Message } from '../../types/index.js';
3
- interface StaticMessageHistoryProps {
4
- messages: Message[];
5
- }
6
- /**
7
- * Renders completed messages using Ink's Static component.
8
- * These messages are "frozen" and never re-render.
9
- * This is the key to preventing UI duplication - once a message is rendered
10
- * in Static, it's written to stdout and frozen forever.
11
- */
12
- export declare const StaticMessageHistory: React.FC<StaticMessageHistoryProps>;
13
- export {};
14
- //# sourceMappingURL=StaticMessageHistory.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"StaticMessageHistory.d.ts","sourceRoot":"","sources":["../../../src/ui/components/StaticMessageHistory.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAG/C,UAAU,yBAAyB;IACjC,QAAQ,EAAE,OAAO,EAAE,CAAC;CACrB;AAED;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,yBAAyB,CAcnE,CAAC"}
@@ -1,19 +0,0 @@
1
- import React from 'react';
2
- import { Static } from 'ink';
3
- import { MessageDisplay } from './MessageDisplay.js';
4
- /**
5
- * Renders completed messages using Ink's Static component.
6
- * These messages are "frozen" and never re-render.
7
- * This is the key to preventing UI duplication - once a message is rendered
8
- * in Static, it's written to stdout and frozen forever.
9
- */
10
- export const StaticMessageHistory = React.memo(({ messages }) => {
11
- // Static component ensures these items never re-render
12
- // They are written to stdout once and frozen
13
- return (React.createElement(Static, { items: messages }, (message) => (React.createElement(MessageDisplay, { key: message.id, message: message }))));
14
- }, (prevProps, nextProps) => {
15
- // Return true to SKIP re-render, false to re-render
16
- // Only re-render when messages array actually changes (new messages added)
17
- return prevProps.messages === nextProps.messages;
18
- });
19
- //# sourceMappingURL=StaticMessageHistory.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"StaticMessageHistory.js","sourceRoot":"","sources":["../../../src/ui/components/StaticMessageHistory.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAE7B,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAMrD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAwC,KAAK,CAAC,IAAI,CAAC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IACnG,uDAAuD;IACvD,6CAA6C;IAC7C,OAAO,CACL,oBAAC,MAAM,IAAC,KAAK,EAAE,QAAQ,IACpB,CAAC,OAAO,EAAE,EAAE,CAAC,CACZ,oBAAC,cAAc,IAAC,GAAG,EAAE,OAAO,CAAC,EAAE,EAAE,OAAO,EAAE,OAAO,GAAI,CACtD,CACM,CACV,CAAC;AACJ,CAAC,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,EAAE;IAC1B,oDAAoD;IACpD,2EAA2E;IAC3E,OAAO,SAAS,CAAC,QAAQ,KAAK,SAAS,CAAC,QAAQ,CAAC;AACnD,CAAC,CAAC,CAAC"}
@@ -1,10 +0,0 @@
1
- export interface CodeBlockOptions {
2
- x: number;
3
- y: number;
4
- width: number;
5
- code: string;
6
- language?: string;
7
- title?: string;
8
- }
9
- export declare function renderCodeBlock(options: CodeBlockOptions): number;
10
- //# sourceMappingURL=code-block.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"code-block.d.ts","sourceRoot":"","sources":["../../../src/ui/components/code-block.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,gBAAgB;IAC/B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAKD,wBAAgB,eAAe,CAAC,OAAO,EAAE,gBAAgB,GAAG,MAAM,CAoFjE"}
@@ -1,74 +0,0 @@
1
- import { screenBuffer, createColorAttr, colors, drawBox, truncate } from '../terminal-kit-base.js';
2
- // Render a code block with line numbers
3
- // Format: LineNum │ Code
4
- // Max 20 lines, truncated with message
5
- export function renderCodeBlock(options) {
6
- const { x, y, width, code, language = 'text', title } = options;
7
- const lines = code.split('\n');
8
- const MAX_LINES = 20;
9
- const truncated = lines.length > MAX_LINES;
10
- const displayLines = truncated ? lines.slice(0, MAX_LINES) : lines;
11
- // Calculate height
12
- let height = 3; // Border + title + border
13
- height += displayLines.length; // Code lines
14
- if (truncated)
15
- height += 1; // Truncation message
16
- // Draw rounded border with dark blue color
17
- drawBox({
18
- x,
19
- y,
20
- width,
21
- height,
22
- borderStyle: 'rounded',
23
- borderColor: colors.border, // #003b59
24
- });
25
- let currentY = y + 1;
26
- // Title with icon if provided
27
- if (title) {
28
- const titleAttr = createColorAttr(colors.primary, true); // Cyan, bold
29
- const langAttr = createColorAttr(colors.dimmed); // Gray
30
- let titleText = `📄 ${title}`;
31
- if (language) {
32
- titleText += ` `;
33
- }
34
- screenBuffer.put({ x: x + 2, y: currentY, attr: titleAttr }, titleText);
35
- if (language) {
36
- screenBuffer.put({
37
- x: x + 2 + titleText.length,
38
- y: currentY,
39
- attr: langAttr
40
- }, `(${language})`);
41
- }
42
- currentY += 2; // Title + empty line
43
- }
44
- // Render code lines with line numbers
45
- const lineNumAttr = createColorAttr(colors.dimmed); // Gray
46
- const codeAttr = createColorAttr(colors.text); // White
47
- const maxLineNumWidth = 3; // Pad to 3 chars
48
- for (let i = 0; i < displayLines.length; i++) {
49
- const lineNum = (i + 1).toString().padStart(maxLineNumWidth, ' ');
50
- const line = displayLines[i];
51
- // Line number
52
- screenBuffer.put({ x: x + 2, y: currentY, attr: lineNumAttr }, lineNum + ' │ ');
53
- // Code (truncate if too long for width)
54
- const codeWidth = width - 2 - maxLineNumWidth - 5; // Border + line num + separator + padding
55
- const truncatedLine = truncate(line, codeWidth);
56
- screenBuffer.put({
57
- x: x + 2 + maxLineNumWidth + 3,
58
- y: currentY,
59
- attr: codeAttr
60
- }, truncatedLine);
61
- currentY++;
62
- }
63
- // Truncation message if needed
64
- if (truncated) {
65
- currentY++; // Empty line before message
66
- const truncMsg = `... (${lines.length - MAX_LINES} more lines)`;
67
- const truncAttr = createColorAttr(colors.dimmed, false, true); // Dimmed
68
- screenBuffer.put({ x: x + 2, y: currentY, attr: truncAttr }, truncMsg);
69
- currentY++;
70
- }
71
- // Return total height + bottom margin
72
- return height + 1;
73
- }
74
- //# sourceMappingURL=code-block.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"code-block.js","sourceRoot":"","sources":["../../../src/ui/components/code-block.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,EAAE,OAAO,EAAO,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAWxG,wCAAwC;AACxC,yBAAyB;AACzB,uCAAuC;AACvC,MAAM,UAAU,eAAe,CAAC,OAAyB;IACvD,MAAM,EAAE,CAAC,EAAE,CAA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AAe,GAAG,CAAC;YAC9B,CAAC,EAAE,QAAQ;YACX,IAAI,EAAE,QAAQ;SACf,EAAE,aAAa,CAAC,CAAC;QAElB,QAAQ,EAAE,CAAC;IACb,CAAC;IAED,+BAA+B;IAC/B,IAAI,SAAS,EAAE,CAAC;QACd,QAAQ,EAAE,CAAC,CAAC,4BAA4B;QACxC,MAAM,QAAQ,GAAG,QAAQ,KAAK,CAAC,MAAM,GAAG,SAAS,cAAc,CAAC;QAChE,MAAM,SAAS,GAAG,eAAe,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,SAAS;QAExE,YAAY,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,QAAQ,CAAC,CAAC;QACvE,QAAQ,EAAE,CAAC;IACb,CAAC;IAED,sCAAsC;IACtC,OAAO,MAAM,GAAG,CAAC,CAAC;AACpB,CAAC"}
@@ -1,12 +0,0 @@
1
- export interface ConfirmPromptOptions {
2
- x: number;
3
- y: number;
4
- width: number;
5
- message: string;
6
- showFeedbackOption?: boolean;
7
- }
8
- type PromptOption = 'yes' | 'no' | 'feedback';
9
- export declare function renderConfirmPrompt(options: ConfirmPromptOptions, selected?: PromptOption): number;
10
- export declare function waitForConfirmation(options: ConfirmPromptOptions): Promise<'yes' | 'no' | 'feedback' | null>;
11
- export {};
12
- //# sourceMappingURL=confirm-prompt.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"confirm-prompt.d.ts","sourceRoot":"","sources":["../../../src/ui/components/confirm-prompt.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,oBAAoB;IACnC,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED,KAAK,YAAY,GAAG,KAAK,GAAG,IAAI,GAAG,UAAU,CAAC;AAG9C,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,oBAAoB,EAC7B,QAAQ,GAAE,YAAoB,GAC7B,MAAM,CAgER;AAGD,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,KAAK,GAAG,IAAI,GAAG,UAAU,GAAG,IAAI,CAAC,CA8D3C"}
@@ -1,104 +0,0 @@
1
- import { term, ensureScreenBuffer, createColorAttr, colors, drawBox, render } from '../terminal-kit-base.js';
2
- // Render the prompt (static parts)
3
- export function renderConfirmPrompt(options, selected = 'yes') {
4
- const { x, y, width, message, showFeedbackOption = false } = options;
5
- const height = 6; // Border + empty + message + empty + options + border
6
- // Draw rounded border with orange color
7
- drawBox({
8
- x,
9
- y,
10
- width,
11
- height,
12
- borderStyle: 'rounded',
13
- borderColor: colors.warning, // #ffaa00 (Orange)
14
- });
15
- let currentY = y + 1;
16
- // Empty line
17
- currentY++;
18
- // Message with warning icon
19
- const buffer = ensureScreenBuffer();
20
- const messageAttr = createColorAttr(colors.warning, true); // Orange, bold
21
- const messageText = `⚠️ ${message}`;
22
- buffer.put({ x: x + 2, y: currentY, attr: messageAttr }, messageText);
23
- currentY += 2; // Message + empty line
24
- // Options row
25
- let optionsX = x + 2;
26
- // Yes option
27
- const yesSelected = selected === 'yes';
28
- const yesAttr = createColorAttr(yesSelected ? colors.success : colors.dimmed, yesSelected);
29
- const yesPrefix = yesSelected ? '▶ ' : ' ';
30
- buffer.put({ x: optionsX, y: currentY, attr: yesAttr }, yesPrefix + '[Y]es');
31
- optionsX += (yesPrefix + '[Y]es').length + 4; // Add spacing
32
- // No option
33
- const noSelected = selected === 'no';
34
- const noAttr = createColorAttr(noSelected ? colors.error : colors.dimmed, noSelected);
35
- const noPrefix = noSelected ? '▶ ' : ' ';
36
- buffer.put({ x: optionsX, y: currentY, attr: noAttr }, noPrefix + '[N]o');
37
- optionsX += (noPrefix + '[N]o').length + 4;
38
- // Feedback option (if enabled)
39
- if (showFeedbackOption) {
40
- const feedbackSelected = selected === 'feedback';
41
- const feedbackAttr = createColorAttr(feedbackSelected ? colors.primary : colors.dimmed, feedbackSelected);
42
- const feedbackPrefix = feedbackSelected ? '▶ ' : ' ';
43
- buffer.put({ x: optionsX, y: currentY, attr: feedbackAttr }, feedbackPrefix + '[F]eedback');
44
- }
45
- // Return height + bottom margin
46
- return height + 1;
47
- }
48
- // Wait for user input and return selected option
49
- export async function waitForConfirmation(options) {
50
- let selected = 'yes';
51
- const showFeedback = options.showFeedbackOption || false;
52
- const validOptions = showFeedback
53
- ? ['yes', 'no', 'feedback']
54
- : ['yes', 'no'];
55
- return new Promise((resolve) => {
56
- // Render initial state
57
- renderConfirmPrompt(options, selected);
58
- render(); // Actually draw to screen!
59
- // Listen for key events
60
- const cleanup = term.on('key', (name) => {
61
- // Handle arrow keys for navigation
62
- if (name === 'LEFT' || name === 'RIGHT') {
63
- const currentIdx = validOptions.indexOf(selected);
64
- const nextIdx = name === 'LEFT'
65
- ? (currentIdx - 1 + validOptions.length) % validOptions.length
66
- : (currentIdx + 1) % validOptions.length;
67
- selected = validOptions[nextIdx];
68
- // Re-render with new selection
69
- renderConfirmPrompt(options, selected);
70
- render(); // Actually draw to screen!
71
- return;
72
- }
73
- // Handle direct key presses
74
- if (name === 'y' || name === 'Y') {
75
- cleanup();
76
- resolve('yes');
77
- return;
78
- }
79
- if (name === 'n' || name === 'N') {
80
- cleanup();
81
- resolve('no');
82
- return;
83
- }
84
- if (showFeedback && (name === 'f' || name === 'F')) {
85
- cleanup();
86
- resolve('feedback');
87
- return;
88
- }
89
- // Handle Enter to confirm current selection
90
- if (name === 'ENTER') {
91
- cleanup();
92
- resolve(selected);
93
- return;
94
- }
95
- // Handle Ctrl+C to exit
96
- if (name === 'CTRL_C') {
97
- cleanup();
98
- process.exit(0);
99
- return;
100
- }
101
- });
102
- });
103
- }
104
- //# sourceMappingURL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AC,MAAM,CAAC;gBAC3C,QAAQ,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC;gBAEjC,+BAA+B;gBAC/B,mBAAmB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;gBACvC,MAAM,EAAE,CAAC,CAAC,2BAA2B;gBACrC,OAAO;YACT,CAAC;YAED,4BAA4B;YAC5B,IAAI,IAAI,KAAK,GAAG,IAAI,IAAI,KAAK,GAAG,EAAE,CAAC;gBACjC,OAAO,EAAE,CAAC;gBACV,OAAO,CAAC,KAAK,CAAC,CAAC;gBACf,OAAO;YACT,CAAC;YAED,IAAI,IAAI,KAAK,GAAG,IAAI,IAAI,KAAK,GAAG,EAAE,CAAC;gBACjC,OAAO,EAAE,CAAC;gBACV,OAAO,CAAC,IAAI,CAAC,CAAC;gBACd,OAAO;YACT,CAAC;YAED,IAAI,YAAY,IAAI,CAAC,IAAI,KAAK,GAAG,IAAI,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC;gBACnD,OAAO,EAAE,CAAC;gBACV,OAAO,CAAC,UAAU,CAAC,CAAC;gBACpB,OAAO;YACT,CAAC;YAED,4CAA4C;YAC5C,IAAI,IAAI,KAAK,OAAO,EAAE,CAAC;gBACrB,OAAO,EAAE,CAAC;gBACV,OAAO,CAAC,QAAQ,CAAC,CAAC;gBAClB,OAAO;YACT,CAAC;YAED,wBAAwB;YACxB,IAAI,IAAI,KAAK,QAAQ,EAAE,CAAC;gBACtB,OAAO,EAAE,CAAC;gBACV,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;gBAChB,OAAO;YACT,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -1,9 +0,0 @@
1
- export interface DiffViewerOptions {
2
- x: number;
3
- y: number;
4
- width: number;
5
- diff: string;
6
- filePath: string;
7
- }
8
- export declare function renderDiffViewer(options: DiffViewerOptions): number;
9
- //# sourceMappingURL=diff-viewer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"diff-viewer.d.ts","sourceRoot":"","sources":["../../../src/ui/components/diff-viewer.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,iBAAiB;IAChC,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB;AAgBD,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,iBAAiB,GAAG,MAAM,CAiDnE"}
@@ -1,57 +0,0 @@
1
- import { screenBuffer, createColorAttr, colors, drawBox, truncate } from '../terminal-kit-base.js';
2
- // Get line color based on diff prefix
3
- function getLineColor(line) {
4
- if (line.startsWith('+')) {
5
- return colors.success; // #00cc66 (Green)
6
- }
7
- else if (line.startsWith('-')) {
8
- return colors.error; // #ff3366 (Red)
9
- }
10
- else if (line.startsWith('@@')) {
11
- return colors.primary; // #00ccff (Cyan)
12
- }
13
- else {
14
- return colors.text; // #ffffff (White)
15
- }
16
- }
17
- // Render diff viewer with colored lines
18
- export function renderDiffViewer(options) {
19
- const { x, y, width, diff, filePath } = options;
20
- const lines = diff.split('\n');
21
- // Calculate height
22
- const height = 3 + lines.length; // Border + header + lines + border
23
- // Draw rounded border with orange color
24
- drawBox({
25
- x,
26
- y,
27
- width,
28
- height,
29
- borderStyle: 'rounded',
30
- borderColor: colors.warning, // #ffaa00 (Orange)
31
- });
32
- let currentY = y + 1;
33
- // Header: "Changes to: {filePath}"
34
- const headerLabelAttr = createColorAttr(colors.warning, true); // Orange, bold
35
- const filePathAttr = createColorAttr(colors.text); // White
36
- const headerLabel = 'Changes to: ';
37
- screenBuffer.put({ x: x + 2, y: currentY, attr: headerLabelAttr }, headerLabel);
38
- screenBuffer.put({
39
- x: x + 2 + headerLabel.length,
40
- y: currentY,
41
- attr: filePathAttr
42
- }, truncate(filePath, width - headerLabel.length - 6));
43
- currentY += 2; // Header + empty line
44
- // Render diff lines with appropriate colors
45
- for (const line of lines) {
46
- const lineColor = getLineColor(line);
47
- const lineAttr = createColorAttr(lineColor);
48
- // Truncate line if too long
49
- const maxLineWidth = width - 4; // Account for borders and padding
50
- const truncatedLine = truncate(line, maxLineWidth);
51
- screenBuffer.put({ x: x + 2, y: currentY, attr: lineAttr }, truncatedLine);
52
- currentY++;
53
- }
54
- // Return total height + bottom margin
55
- return height + 1;
56
- }
57
- //# sourceMappingURL=diff-viewer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"diff-viewer.js","sourceRoot":"","sources":["../../../src/ui/components/diff-viewer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAUnG,sCAAsC;AACtC,SAAS,YAAY,CAAC,IAAY;IAChC,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QACzB,OAAO,MAAM,CAAC,OAAO,CAAC,CAAC,kBAAkB;IAC3C,CAAC;SAAM,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QAChC,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC,gBAAgB;IACvC,CAAC;SAAM,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QACjC,OAAO,MAAM,CAAC,OAAO,CAAC,CAAC,iBAAiB;IAC1C,CAAC;SAAM,CAAC;QACN,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,kBAAkB;IACxC,CAAC;AACH,CAAC;AAED,wCAAwC;AACxC,MAAM,UAAU,gBAAgB,CAAC,OAA0B;IACzD,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC;IAEhD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAE/B,mBAAmB;IACnB,MAAM,MA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YAAY,CAAC,CAAC;QAEnD,YAAY,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,aAAa,CAAC,CAAC;QAC3E,QAAQ,EAAE,CAAC;IACb,CAAC;IAED,sCAAsC;IACtC,OAAO,MAAM,GAAG,CAAC,CAAC;AACpB,CAAC"}
@@ -1,18 +0,0 @@
1
- export interface InputBoxOptions {
2
- x: number;
3
- y: number;
4
- width: number;
5
- model: string;
6
- autoAcceptMode: boolean;
7
- placeholder?: string;
8
- }
9
- export interface InputBoxCallbacks {
10
- onSubmit: (value: string) => void;
11
- onToggleAutoAccept: () => void;
12
- onExit: () => void;
13
- }
14
- export declare function renderInputBox(options: InputBoxOptions): void;
15
- export declare function getInput(x: number, y: number, width: number, placeholder: string, callbacks: InputBoxCallbacks): Promise<string>;
16
- export declare function clearInputField(x: number, y: number, width: number): void;
17
- export declare function showPlaceholder(x: number, y: number, width: number, placeholder: string): void;
18
- //# sourceMappingURL=input-box.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"input-box.d.ts","sourceRoot":"","sources":["../../../src/ui/components/input-box.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,eAAe;IAC9B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,OAAO,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,kBAAkB,EAAE,MAAM,IAAI,CAAC;IAC/B,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB;AAGD,wBAAgB,cAAc,CAAC,OAAO,EAAE,eAAe,QA8EtD;AAGD,wBAAsB,QAAQ,CAC5B,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,iBAAiB,GAC3B,OAAO,CAAC,MAAM,CAAC,CAyEjB;AAGD,wBAAgB,eAAe,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QASlE;AAGD,wBAAgB,eAAe,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,QAYvF"}