SmartX: Updated command labels to /smartx in filtered list
This commit is contained in:
@@ -737,10 +737,10 @@ const loadRecentProjects = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// ═══════════════════════════════════════════════════════════════
|
// ═══════════════════════════════════════════════════════════════
|
||||||
// POWER FEATURE 1: TODO TRACKER
|
// POWER FEATURE 1: TODO TRACKER
|
||||||
// Parses TODO/FIXME comments from project files
|
// Parses TODO/FIXME comments from project files
|
||||||
// ═══════════════════════════════════════════════════════════════
|
// ═══════════════════════════════════════════════════════════════
|
||||||
const parseTodos = (projectPath) => {
|
const parseTodos = (projectPath) => {
|
||||||
const todos = [];
|
const todos = [];
|
||||||
const extensions = ['.js', '.ts', '.jsx', '.tsx', '.py', '.md', '.mjs'];
|
const extensions = ['.js', '.ts', '.jsx', '.tsx', '.py', '.md', '.mjs'];
|
||||||
const todoPattern = /(?:\/\/|#|<!--)\s*(TODO|FIXME|HACK|XXX):?\s*(.+)/gi;
|
const todoPattern = /(?:\/\/|#|<!--)\s*(TODO|FIXME|HACK|XXX):?\s*(.+)/gi;
|
||||||
@@ -779,14 +779,14 @@ const loadRecentProjects = () => {
|
|||||||
scanDir(projectPath);
|
scanDir(projectPath);
|
||||||
}
|
}
|
||||||
return todos.slice(0, 20); // Limit to 20 TODOs
|
return todos.slice(0, 20); // Limit to 20 TODOs
|
||||||
};
|
};
|
||||||
|
|
||||||
// POWER FEATURE 2: MANAGED TODO LIST
|
// POWER FEATURE 2: MANAGED TODO LIST
|
||||||
// Personal task list that users can add/maintain
|
// Personal task list that users can add/maintain
|
||||||
// ═══════════════════════════════════════════════════════════════
|
// ═══════════════════════════════════════════════════════════════
|
||||||
const TODO_FILE = '.opencode/todos.json';
|
const TODO_FILE = '.opencode/todos.json';
|
||||||
|
|
||||||
const loadTodoList = (projectPath) => {
|
const loadTodoList = (projectPath) => {
|
||||||
try {
|
try {
|
||||||
const todoFilePath = path.join(projectPath || process.cwd(), TODO_FILE);
|
const todoFilePath = path.join(projectPath || process.cwd(), TODO_FILE);
|
||||||
if (fs.existsSync(todoFilePath)) {
|
if (fs.existsSync(todoFilePath)) {
|
||||||
@@ -795,9 +795,9 @@ const loadRecentProjects = () => {
|
|||||||
}
|
}
|
||||||
} catch (e) { /* ignore */ }
|
} catch (e) { /* ignore */ }
|
||||||
return [];
|
return [];
|
||||||
};
|
};
|
||||||
|
|
||||||
const saveTodoList = (projectPath, todos) => {
|
const saveTodoList = (projectPath, todos) => {
|
||||||
try {
|
try {
|
||||||
const todoDir = path.join(projectPath || process.cwd(), '.opencode');
|
const todoDir = path.join(projectPath || process.cwd(), '.opencode');
|
||||||
if (!fs.existsSync(todoDir)) {
|
if (!fs.existsSync(todoDir)) {
|
||||||
@@ -806,7 +806,7 @@ const loadRecentProjects = () => {
|
|||||||
const todoFilePath = path.join(projectPath || process.cwd(), TODO_FILE);
|
const todoFilePath = path.join(projectPath || process.cwd(), TODO_FILE);
|
||||||
fs.writeFileSync(todoFilePath, JSON.stringify(todos, null, 2));
|
fs.writeFileSync(todoFilePath, JSON.stringify(todos, null, 2));
|
||||||
} catch (e) { /* ignore */ }
|
} catch (e) { /* ignore */ }
|
||||||
};
|
};
|
||||||
|
|
||||||
// ═══════════════════════════════════════════════════════════════
|
// ═══════════════════════════════════════════════════════════════
|
||||||
// POWER FEATURE 2: THEME SYSTEM
|
// POWER FEATURE 2: THEME SYSTEM
|
||||||
@@ -1050,8 +1050,8 @@ const SmoothCounter = ({ value }) => {
|
|||||||
return h(Text, { color: 'white' }, displayValue.toLocaleString());
|
return h(Text, { color: 'white' }, displayValue.toLocaleString());
|
||||||
};
|
};
|
||||||
|
|
||||||
// Component: TypewriterText - Clean text reveal for streaming (Opencode style)
|
// Component: TypewriterText - Clean text reveal for streaming (Opencode style)
|
||||||
const TypewriterText = ({ children, speed = 25 }) => {
|
const TypewriterText = ({ children, speed = 25 }) => {
|
||||||
const fullText = String(children || '');
|
const fullText = String(children || '');
|
||||||
const [displayText, setDisplayText] = useState('');
|
const [displayText, setDisplayText] = useState('');
|
||||||
const positionRef = useRef(0);
|
const positionRef = useRef(0);
|
||||||
@@ -1096,7 +1096,7 @@ const SmoothCounter = ({ value }) => {
|
|||||||
const displayWithCursor = displayText + (Math.floor(Date.now() / 500) % 2 ? '|' : ' ');
|
const displayWithCursor = displayText + (Math.floor(Date.now() / 500) % 2 ? '|' : ' ');
|
||||||
|
|
||||||
return h(Text, { wrap: 'wrap' }, displayWithCursor);
|
return h(Text, { wrap: 'wrap' }, displayWithCursor);
|
||||||
};
|
};
|
||||||
|
|
||||||
// Component: FadeInBox - Animated fade-in wrapper (simulates fade with opacity chars)
|
// Component: FadeInBox - Animated fade-in wrapper (simulates fade with opacity chars)
|
||||||
const FadeInBox = ({ children, delay = 0 }) => {
|
const FadeInBox = ({ children, delay = 0 }) => {
|
||||||
@@ -1405,7 +1405,7 @@ const ArtifactBlock = ({ content, isStreaming }) => {
|
|||||||
// DISCORD-STYLE CODE CARD
|
// DISCORD-STYLE CODE CARD
|
||||||
// Code blocks with header bar, language label, and distinct styling
|
// Code blocks with header bar, language label, and distinct styling
|
||||||
// ═══════════════════════════════════════════════════════════════
|
// ═══════════════════════════════════════════════════════════════
|
||||||
const CodeCard = ({ language, filename, content, width, isStreaming }) => {
|
const CodeCard = ({ language, filename, content, width, isStreaming }) => {
|
||||||
const lineCount = content.split('\n').length;
|
const lineCount = content.split('\n').length;
|
||||||
const [isExpanded, setIsExpanded] = useState(false);
|
const [isExpanded, setIsExpanded] = useState(false);
|
||||||
|
|
||||||
@@ -1467,7 +1467,7 @@ const ArtifactBlock = ({ content, isStreaming }) => {
|
|||||||
h(Text, { color: 'cyan', dimColor: true }, isExpanded ? '▼ collapse' : '▶ expand ')
|
h(Text, { color: 'cyan', dimColor: true }, isExpanded ? '▼ collapse' : '▶ expand ')
|
||||||
) : null
|
) : null
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// ═══════════════════════════════════════════════════════════════
|
// ═══════════════════════════════════════════════════════════════
|
||||||
@@ -1520,9 +1520,9 @@ const UserCard = ({ content, width }) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
// AGENT CARD - Opencode-style clean streaming
|
// AGENT CARD - Opencode-style clean streaming
|
||||||
// Text-focused with minimal styling, clean left gutter
|
// Text-focused with minimal styling, clean left gutter
|
||||||
const AgentCard = ({ content, isStreaming, width }) => {
|
const AgentCard = ({ content, isStreaming, width }) => {
|
||||||
const contentWidth = width ? width - 4 : undefined; // Account for left gutter and spacing
|
const contentWidth = width ? width - 4 : undefined; // Account for left gutter and spacing
|
||||||
|
|
||||||
return h(Box, {
|
return h(Box, {
|
||||||
@@ -1560,7 +1560,7 @@ const UserCard = ({ content, width }) => {
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
// ERROR CARD - Red gutter, no border
|
// ERROR CARD - Red gutter, no border
|
||||||
const ErrorCard = ({ content, width }) => {
|
const ErrorCard = ({ content, width }) => {
|
||||||
@@ -1600,9 +1600,9 @@ const MessageCard = ({ role, content, meta, isStreaming, width }) => {
|
|||||||
// UI COMPONENTS
|
// UI COMPONENTS
|
||||||
// ═══════════════════════════════════════════════════════════════
|
// ═══════════════════════════════════════════════════════════════
|
||||||
|
|
||||||
// HELPER: Flatten messages into atomic blocks for granular scrolling
|
// HELPER: Flatten messages into atomic blocks for granular scrolling
|
||||||
// This enables the "3-4 line portion" look and prevents cutoff of long messages
|
// This enables the "3-4 line portion" look and prevents cutoff of long messages
|
||||||
const flattenMessagesToBlocks = (messages) => {
|
const flattenMessagesToBlocks = (messages) => {
|
||||||
const blocks = [];
|
const blocks = [];
|
||||||
let globalId = 0; // Global counter to ensure unique keys
|
let globalId = 0; // Global counter to ensure unique keys
|
||||||
|
|
||||||
@@ -1683,7 +1683,7 @@ const MessageCard = ({ role, content, meta, isStreaming, width }) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
return blocks;
|
return blocks;
|
||||||
};
|
};
|
||||||
|
|
||||||
// ═══════════════════════════════════════════════════════════════
|
// ═══════════════════════════════════════════════════════════════
|
||||||
// SCROLLABLE CHAT - Virtual Viewport Engine
|
// SCROLLABLE CHAT - Virtual Viewport Engine
|
||||||
@@ -1776,7 +1776,7 @@ const LegacyScrollableChat = ({ messages, viewHeight, width, isActive = true, is
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const ScrollableChat = ({ messages, viewHeight, width, isActive = true, isStreaming = false }) => {
|
const ScrollableChat = ({ messages, viewHeight, width, isActive = true, isStreaming = false }) => {
|
||||||
// Flatten messages into scrollable blocks
|
// Flatten messages into scrollable blocks
|
||||||
// Memoize to prevent expensive re-parsing on every cursor blink
|
// Memoize to prevent expensive re-parsing on every cursor blink
|
||||||
const blocks = useMemo(() => flattenMessagesToBlocks(messages), [messages]);
|
const blocks = useMemo(() => flattenMessagesToBlocks(messages), [messages]);
|
||||||
@@ -1863,7 +1863,7 @@ const LegacyScrollableChat = ({ messages, viewHeight, width, isActive = true, is
|
|||||||
h(Text, { color: 'yellow' }, `⚠ PAUSED - Press ↓ to resume`)
|
h(Text, { color: 'yellow' }, `⚠ PAUSED - Press ↓ to resume`)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
// Message Item Component
|
// Message Item Component
|
||||||
const MessageItem = ({ role, content, blocks = [], index }) => {
|
const MessageItem = ({ role, content, blocks = [], index }) => {
|
||||||
@@ -2131,15 +2131,15 @@ const ModelSelector = ({
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
// ═══════════════════════════════════════════════════════════════
|
// ═══════════════════════════════════════════════════════════════
|
||||||
// VIEWPORT MESSAGE - Unified Message Protocol Renderer (Alt)
|
// VIEWPORT MESSAGE - Unified Message Protocol Renderer (Alt)
|
||||||
// Supports meta field for consistent styling
|
// Supports meta field for consistent styling
|
||||||
// ═══════════════════════════════════════════════════════════════
|
// ═══════════════════════════════════════════════════════════════
|
||||||
// ═══════════════════════════════════════════════════════════════
|
// ═══════════════════════════════════════════════════════════════
|
||||||
// VIEWPORT MESSAGE - Unified Message Protocol Renderer (Alt)
|
// VIEWPORT MESSAGE - Unified Message Protocol Renderer (Alt)
|
||||||
// Supports meta field for consistent styling
|
// Supports meta field for consistent styling
|
||||||
// ═══════════════════════════════════════════════════════════════
|
// ═══════════════════════════════════════════════════════════════
|
||||||
const ViewportMessage = ({ role, content, meta, width = 80, isFirst = true, isLast = true, type = 'text', blocks = [], isStreaming = false }) => {
|
const ViewportMessage = ({ role, content, meta, width = 80, isFirst = true, isLast = true, type = 'text', blocks = [], isStreaming = false }) => {
|
||||||
// PRO API: Use ChatBubble for everything
|
// PRO API: Use ChatBubble for everything
|
||||||
|
|
||||||
// For Assistant, we handle code blocks separately if they exist?
|
// For Assistant, we handle code blocks separately if they exist?
|
||||||
@@ -3956,8 +3956,8 @@ This gives the user a chance to refine requirements before implementation.
|
|||||||
{ label: '/clear Clear Session', value: '/clear' },
|
{ label: '/clear Clear Session', value: '/clear' },
|
||||||
// SmartX Engine toggle
|
// SmartX Engine toggle
|
||||||
soloMode
|
soloMode
|
||||||
? { label: '/solo off SmartX Engine → OFF', value: '/smartx off' }
|
? { label: '/smartx off SmartX → OFF', value: '/smartx off' }
|
||||||
: { label: '/solo on SmartX Engine → ON', value: '/smartx on' },
|
: { label: '/smartx on SmartX → ON', value: '/smartx on' },
|
||||||
// Auto-Approve toggle
|
// Auto-Approve toggle
|
||||||
autoApprove
|
autoApprove
|
||||||
? { label: '/auto Auto-Approve → OFF', value: '/auto' }
|
? { label: '/auto Auto-Approve → OFF', value: '/auto' }
|
||||||
|
|||||||
Reference in New Issue
Block a user