codeep 1.1.8 → 1.1.10

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.
@@ -6,17 +6,5 @@ interface MessageListProps {
6
6
  scrollOffset?: number;
7
7
  terminalHeight?: number;
8
8
  }
9
- /**
10
- * Message list WITHOUT Static component
11
- *
12
- * We removed the Static component because:
13
- * - Static preserves content in terminal scroll history even after unmount
14
- * - This causes ghost/duplicate content when switching screens
15
- * - The trade-off is that messages will re-render on each update
16
- * - We mitigate this with memoization at the individual message level
17
- *
18
- * NOTE: This is a temporary solution until we implement a custom renderer
19
- * like Claude CLI uses (DEC Mode 2026 / synchronized output).
20
- */
21
9
  export declare const MessageList: React.FC<MessageListProps>;
22
10
  export {};
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { memo, useMemo } from 'react';
3
- import { Box } from 'ink';
3
+ import { Box, Text } from 'ink';
4
4
  import { MessageView } from './Message.js';
5
5
  import { StreamingMessage } from './StreamingMessage.js';
6
6
  /**
@@ -21,9 +21,22 @@ MemoizedMessage.displayName = 'MemoizedMessage';
21
21
  * NOTE: This is a temporary solution until we implement a custom renderer
22
22
  * like Claude CLI uses (DEC Mode 2026 / synchronized output).
23
23
  */
24
+ // Maximum number of messages to render at once
25
+ // This prevents performance issues and flickering with large chat histories
26
+ const MAX_VISIBLE_MESSAGES = 20;
24
27
  export const MessageList = memo(({ messages, streamingContent, }) => {
28
+ // Virtualization: only render the last N messages to prevent flickering
29
+ // Older messages are still in history but not rendered
30
+ const visibleMessages = useMemo(() => {
31
+ if (messages.length <= MAX_VISIBLE_MESSAGES) {
32
+ return messages;
33
+ }
34
+ return messages.slice(-MAX_VISIBLE_MESSAGES);
35
+ }, [messages]);
36
+ // Calculate how many messages are hidden
37
+ const hiddenCount = messages.length - visibleMessages.length;
25
38
  // Memoize the messages array rendering
26
- const renderedMessages = useMemo(() => (messages.map((msg, index) => (_jsx(MemoizedMessage, { msg: msg, index: index }, `msg-${index}-${msg.role}`)))), [messages]);
27
- return (_jsxs(Box, { flexDirection: "column", children: [renderedMessages, streamingContent && (_jsx(StreamingMessage, { content: streamingContent }))] }));
39
+ const renderedMessages = useMemo(() => (visibleMessages.map((msg, index) => (_jsx(MemoizedMessage, { msg: msg, index: hiddenCount + index }, `msg-${hiddenCount + index}-${msg.role}`)))), [visibleMessages, hiddenCount]);
40
+ return (_jsxs(Box, { flexDirection: "column", children: [hiddenCount > 0 && (_jsx(Box, { marginBottom: 1, children: _jsxs(Text, { color: "gray", children: ["... ", hiddenCount, " earlier message(s) hidden ..."] }) })), renderedMessages, streamingContent && (_jsx(StreamingMessage, { content: streamingContent }))] }));
28
41
  });
29
42
  MessageList.displayName = 'MessageList';
package/dist/index.js CHANGED
@@ -34,5 +34,36 @@ Contact: info@codeep.dev
34
34
  }
35
35
  // Clear screen on start
36
36
  console.clear();
37
- // Render app
38
- render(_jsx(App, {}));
37
+ // Enable synchronized output (DEC mode 2026) for compatible terminals
38
+ // This tells the terminal to buffer output and display it all at once
39
+ const SYNC_START = '\x1b[?2026h';
40
+ const SYNC_END = '\x1b[?2026l';
41
+ // Wrap stdout.write to add synchronized output
42
+ const originalWrite = process.stdout.write.bind(process.stdout);
43
+ let syncEnabled = false;
44
+ // Check if terminal likely supports DEC 2026 (modern terminals)
45
+ const termProgram = process.env.TERM_PROGRAM || '';
46
+ const supportsSync = ['ghostty', 'wezterm', 'kitty', 'alacritty', 'iTerm.app', 'vscode'].some(t => termProgram.toLowerCase().includes(t.toLowerCase())) || process.env.TERM?.includes('256color');
47
+ if (supportsSync) {
48
+ process.stdout.write = ((chunk, encoding, callback) => {
49
+ if (typeof chunk === 'string' && chunk.length > 100 && !syncEnabled) {
50
+ // For larger outputs, use synchronized rendering
51
+ syncEnabled = true;
52
+ originalWrite(SYNC_START);
53
+ const result = originalWrite(chunk, encoding, () => {
54
+ originalWrite(SYNC_END);
55
+ syncEnabled = false;
56
+ if (typeof callback === 'function')
57
+ callback();
58
+ });
59
+ return result;
60
+ }
61
+ return originalWrite(chunk, encoding, callback);
62
+ });
63
+ }
64
+ // Render app with optimized settings
65
+ render(_jsx(App, {}), {
66
+ // Limit frames per second to reduce CPU usage and flickering
67
+ // Default is undefined (no limit), we set to 30fps
68
+ patchConsole: false, // Don't patch console - we handle output ourselves
69
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeep",
3
- "version": "1.1.8",
3
+ "version": "1.1.10",
4
4
  "description": "AI-powered coding assistant built for the terminal. Multiple LLM providers, project-aware context, and a seamless development workflow.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -36,8 +36,6 @@
36
36
  },
37
37
  "homepage": "https://codeep.dev",
38
38
  "dependencies": {
39
- "@types/prompts": "^2.4.9",
40
- "chalk": "^5.6.2",
41
39
  "clipboardy": "^4.0.0",
42
40
  "conf": "^12.0.0",
43
41
  "ink": "^4.4.1",
@@ -45,8 +43,6 @@
45
43
  "ink-text-input": "^5.0.1",
46
44
  "keytar": "^7.9.0",
47
45
  "open": "^10.0.0",
48
- "ora": "^9.2.0",
49
- "prompts": "^2.4.2",
50
46
  "react": "^18.2.0",
51
47
  "readline": "^1.3.0"
52
48
  },