mirror of
https://github.com/andrepimenta/claude-code-chat.git
synced 2025-12-13 05:39:46 +00:00
Compare commits
9 Commits
feature/mc
...
1.0.3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
43c1c85efb | ||
|
|
b07857bf57 | ||
|
|
c9677b6185 | ||
|
|
2053e768a8 | ||
|
|
980d19bcb2 | ||
|
|
8a581908e3 | ||
|
|
2feaed600d | ||
|
|
826c25bdd6 | ||
|
|
3e8a9630bd |
112
CHANGELOG.md
112
CHANGELOG.md
@@ -4,6 +4,118 @@ All notable changes to the "claude-code-chat" extension will be documented in th
|
|||||||
|
|
||||||
Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.
|
Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.
|
||||||
|
|
||||||
|
## [1.0.0] - 2025-01-15
|
||||||
|
|
||||||
|
### 🚀 Major Features Added
|
||||||
|
|
||||||
|
#### **Advanced Permissions Management System**
|
||||||
|
- Complete permissions framework with MCP integration for secure tool execution
|
||||||
|
- Interactive permission dialogs with detailed tool information and command previews
|
||||||
|
- "Always Allow" functionality with smart command pattern matching for common tools (npm, git, docker, etc.)
|
||||||
|
- YOLO mode for power users to skip all permission checks
|
||||||
|
- Comprehensive permissions settings UI with ability to add/remove specific permissions
|
||||||
|
- File system watcher for real-time permission request handling
|
||||||
|
- Workspace-specific permission storage and management
|
||||||
|
|
||||||
|
#### **MCP (Model Context Protocol) Server Management**
|
||||||
|
- Complete MCP server configuration interface
|
||||||
|
- Popular MCP servers gallery with one-click installation
|
||||||
|
- Custom MCP server creation with validation
|
||||||
|
- Server management (edit, delete, enable/disable)
|
||||||
|
- Automatic permissions server integration
|
||||||
|
- WSL path conversion for cross-platform compatibility
|
||||||
|
|
||||||
|
#### **Sidebar Integration & Multi-Panel Support**
|
||||||
|
- Native VS Code sidebar view with full chat functionality
|
||||||
|
- Smart panel management (auto-close main panel when sidebar opens)
|
||||||
|
- Persistent session state across panel switches
|
||||||
|
- Proper webview lifecycle management
|
||||||
|
- Activity bar integration with custom icon
|
||||||
|
|
||||||
|
#### **Image & Clipboard Enhancements**
|
||||||
|
- Drag-and-drop image support directly into chat
|
||||||
|
- Clipboard image paste functionality (Ctrl+V for screenshots)
|
||||||
|
- Multiple image selection with VS Code's native file picker
|
||||||
|
- Automatic image organization in `.claude/claude-code-chat-images/` folder
|
||||||
|
- Automatic `.gitignore` creation for image folders
|
||||||
|
- Support for PNG, JPG, JPEG, GIF, SVG, WebP, BMP formats
|
||||||
|
|
||||||
|
#### **Code Block & Syntax Improvements**
|
||||||
|
- Enhanced markdown parsing with proper code block detection
|
||||||
|
- Syntax highlighting for code blocks with language detection
|
||||||
|
- Copy-to-clipboard functionality for code blocks
|
||||||
|
- Improved inline code rendering
|
||||||
|
- Better handling of technical identifiers and underscores
|
||||||
|
|
||||||
|
### 🎨 UI/UX Improvements
|
||||||
|
|
||||||
|
#### **Settings & Configuration**
|
||||||
|
- Comprehensive settings modal with organized sections
|
||||||
|
- YOLO mode toggle with visual warnings and explanations
|
||||||
|
- Real-time settings synchronization between UI and VS Code config
|
||||||
|
- Better visual hierarchy and professional styling
|
||||||
|
- Smart configuration validation and error handling
|
||||||
|
|
||||||
|
#### **Message & Chat Interface**
|
||||||
|
- Improved message spacing and visual consistency
|
||||||
|
- Enhanced tool result display with better formatting
|
||||||
|
- Smart scrolling behavior (only auto-scroll if user is at bottom)
|
||||||
|
- Loading indicators and processing states
|
||||||
|
- Better error handling and user feedback
|
||||||
|
|
||||||
|
#### **YOLO Mode Visual Design**
|
||||||
|
- Less subtle YOLO mode section (increased opacity and size)
|
||||||
|
- Changed warning icon from ⚠️ to 🚀 for less intimidating appearance
|
||||||
|
- Soft tomato red styling that's noticeable but not scary
|
||||||
|
- Clear explanation of YOLO mode functionality
|
||||||
|
|
||||||
|
### 🔧 Technical Enhancements
|
||||||
|
|
||||||
|
#### **Session & State Management**
|
||||||
|
- Persistent session state across VS Code restarts
|
||||||
|
- Proper cleanup of resources and event listeners
|
||||||
|
- Better error handling for failed operations
|
||||||
|
- Improved memory management for large conversations
|
||||||
|
|
||||||
|
#### **Cross-Platform Compatibility**
|
||||||
|
- Enhanced WSL support with proper path conversion
|
||||||
|
- Windows-specific improvements and fixes
|
||||||
|
- Better handling of different operating system environments
|
||||||
|
- Improved subprocess management and cleanup
|
||||||
|
|
||||||
|
#### **Performance Optimizations**
|
||||||
|
- Reduced context usage with more efficient tool operations
|
||||||
|
- Better file search and workspace integration
|
||||||
|
- Optimized message handling and UI updates
|
||||||
|
- Improved extension activation and initialization times
|
||||||
|
|
||||||
|
#### **Developer Experience**
|
||||||
|
- Better error messages and debugging information
|
||||||
|
- Improved extension logging and troubleshooting
|
||||||
|
- Enhanced development workflow support
|
||||||
|
- Better TypeScript integration and type safety
|
||||||
|
|
||||||
|
### 🐛 Bug Fixes
|
||||||
|
- Fixed multiple permission prompts being sent simultaneously
|
||||||
|
- Resolved panel management issues with multiple webviews
|
||||||
|
- Fixed expand/collapse functionality for long content
|
||||||
|
- Corrected Unix timestamp parsing for usage limit messages
|
||||||
|
- Fixed WSL integration on Windows systems
|
||||||
|
- Resolved markdown parsing issues with underscores in code
|
||||||
|
- Fixed copy-paste functionality for images and code blocks
|
||||||
|
- Corrected file path handling across different platforms
|
||||||
|
|
||||||
|
### 🔄 Breaking Changes
|
||||||
|
- Permission system now requires explicit approval for tool execution (unless YOLO mode is enabled)
|
||||||
|
- Image files are now stored in `.claude/claude-code-chat-images/` instead of root directory
|
||||||
|
- MCP configuration moved to extension storage instead of global config
|
||||||
|
|
||||||
|
### 📚 Documentation & Community
|
||||||
|
- Updated README with comprehensive feature documentation
|
||||||
|
- Fixed GitHub issues link in repository
|
||||||
|
- Enhanced examples and usage guides
|
||||||
|
- Better onboarding experience for new users
|
||||||
|
|
||||||
## [0.1.3] - 2025-06-24
|
## [0.1.3] - 2025-06-24
|
||||||
|
|
||||||
### 🚀 Features Added
|
### 🚀 Features Added
|
||||||
|
|||||||
60
README.md
60
README.md
@@ -15,15 +15,16 @@ Ditch the command line and experience Claude Code like never before. This extens
|
|||||||
## ✨ **Why Choose Claude Code Chat?**
|
## ✨ **Why Choose Claude Code Chat?**
|
||||||
|
|
||||||
🖥️ **No Terminal Required** - Beautiful chat interface replaces command-line interactions
|
🖥️ **No Terminal Required** - Beautiful chat interface replaces command-line interactions
|
||||||
⏪ **Restore Checkpoints** - Undo changes and restore code to any previous state
|
⏪ **Restore Checkpoints** - Undo changes and restore code to any previous state
|
||||||
|
🔌 **MCP Server Support** - Complete Model Context Protocol server management
|
||||||
💾 **Conversation History** - Automatic conversation history and session management
|
💾 **Conversation History** - Automatic conversation history and session management
|
||||||
🎨 **VS Code Native** - Claude Code integrated directly into VS Code with native theming
|
🎨 **VS Code Native** - Claude Code integrated directly into VS Code with native theming and sidebar support
|
||||||
🧠 **Plan and Thinking modes** - Plan First and configurable Thinking modes for better results
|
🧠 **Plan and Thinking modes** - Plan First and configurable Thinking modes for better results
|
||||||
⚡ **Smart File Context and Commands** - Reference any file with simple @ mentions and / for commands
|
⚡ **Smart File/Image Context and Custom Commands** - Reference any file, copy images or screenshots, and create custom commands
|
||||||
🤖 **Model Selection** - Choose between Opus, Sonnet, or Default based on your needs
|
🤖 **Model Selection** - Choose between Opus, Sonnet, or Default based on your needs
|
||||||
🐧 **WSL Support** - Full Windows Subsystem for Linux integration and compatibility
|
🐧 **Windows/WSL Support** - Full Windows support and Windows Subsystem for Linux integration and compatibility
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -34,8 +35,9 @@ Ditch the command line and experience Claude Code like never before. This extens
|
|||||||
- No terminal required - everything through the UI
|
- No terminal required - everything through the UI
|
||||||
- Real-time streaming responses with typing indicators
|
- Real-time streaming responses with typing indicators
|
||||||
- One-click message copying with visual feedback
|
- One-click message copying with visual feedback
|
||||||
- Rich markdown support for code blocks and formatting
|
- Enhanced markdown support with syntax highlighting
|
||||||
- Auto-resizing input that grows with your content
|
- Auto-resizing input that grows with your content
|
||||||
|
- Copy-to-clipboard for code blocks
|
||||||
|
|
||||||
### ⏪ **Checkpoint & Session Management**
|
### ⏪ **Checkpoint & Session Management**
|
||||||
- **Restore Checkpoints** - Instantly undo changes and restore to any previous state
|
- **Restore Checkpoints** - Instantly undo changes and restore to any previous state
|
||||||
@@ -45,9 +47,36 @@ Ditch the command line and experience Claude Code like never before. This extens
|
|||||||
- Real-time cost and token tracking
|
- Real-time cost and token tracking
|
||||||
- Session statistics and performance metrics
|
- Session statistics and performance metrics
|
||||||
|
|
||||||
|
### 🔌 **MCP Server Management** ⭐ **NEW IN V1.0**
|
||||||
|
- **Popular Servers Gallery** - One-click installation of common MCP servers
|
||||||
|
- **Custom Server Creation** - Build and configure your own MCP servers
|
||||||
|
- **Server Management** - Edit, delete, enable/disable servers through UI
|
||||||
|
- **Automatic Integration** - Seamless permissions and tool integration
|
||||||
|
- **Cross-platform Support** - Full WSL compatibility with path conversion
|
||||||
|
|
||||||
|
### 🔒 **Advanced Permissions System** ⭐ **NEW IN V1.0**
|
||||||
|
- **Interactive Permission Dialogs** - Detailed tool information with command previews
|
||||||
|
- **Always Allow Functionality** - Smart command pattern matching for common tools (npm, git, docker)
|
||||||
|
- **YOLO Mode** - Skip all permission checks for power users
|
||||||
|
- **Workspace Permissions** - Granular control over what tools can execute
|
||||||
|
- **Real-time Permission Management** - Add/remove permissions through intuitive UI
|
||||||
|
|
||||||
|
### 🖼️ **Image & Clipboard Support** ⭐ **NEW IN V1.0**
|
||||||
|
- **Drag & Drop Images** - Simply drag images directly into the chat
|
||||||
|
- **Clipboard Paste** - Press Ctrl+V to paste screenshots and copied images
|
||||||
|
- **Multiple Image Selection** - Choose multiple images through VS Code's file picker
|
||||||
|
- **Organized Storage** - Automatic organization in `.claude/claude-code-chat-images/`
|
||||||
|
- **Format Support** - PNG, JPG, JPEG, GIF, SVG, WebP, BMP formats
|
||||||
|
|
||||||
|
### 📱 **Sidebar Integration** ⭐ **NEW IN V1.0**
|
||||||
|
- **Native VS Code Sidebar** - Full chat functionality in the sidebar panel
|
||||||
|
- **Smart Panel Management** - Automatic switching between main and sidebar views
|
||||||
|
- **Persistent Sessions** - State maintained across panel switches
|
||||||
|
- **Activity Bar Integration** - Quick access from VS Code's activity bar
|
||||||
|
|
||||||
### 📁 **Smart File Integration**
|
### 📁 **Smart File Integration**
|
||||||
- Type `@` to instantly search and reference workspace files
|
- Type `@` to instantly search and reference workspace files
|
||||||
- Image attachments via file browser
|
- Image attachments via file browser and copy-paste screeshots
|
||||||
- Lightning-fast file search across your entire project
|
- Lightning-fast file search across your entire project
|
||||||
- Seamless context preservation for multi-file discussions
|
- Seamless context preservation for multi-file discussions
|
||||||
|
|
||||||
@@ -55,6 +84,7 @@ Ditch the command line and experience Claude Code like never before. This extens
|
|||||||
- Visual dashboard showing all available Claude Code tools
|
- Visual dashboard showing all available Claude Code tools
|
||||||
- Real-time tool execution with formatted results
|
- Real-time tool execution with formatted results
|
||||||
- Process control - start, stop, and monitor operations
|
- Process control - start, stop, and monitor operations
|
||||||
|
- Smart permission system for secure tool execution
|
||||||
|
|
||||||
### 🎨 **VS Code Integration**
|
### 🎨 **VS Code Integration**
|
||||||
- Native theming that matches your editor
|
- Native theming that matches your editor
|
||||||
@@ -214,31 +244,39 @@ Example configuration in `settings.json`:
|
|||||||
- Type `@` followed by your search term to quickly reference files
|
- Type `@` followed by your search term to quickly reference files
|
||||||
- Use `@src/` to narrow down to specific directories
|
- Use `@src/` to narrow down to specific directories
|
||||||
- Reference multiple files in one message for cross-file analysis
|
- Reference multiple files in one message for cross-file analysis
|
||||||
|
- **NEW**: Copy-paste images directly into chat for visual context
|
||||||
|
- **NEW**: Paste screenshots with Ctrl+V for instant visual communication
|
||||||
|
|
||||||
### ⚡ **Productivity Boosters**
|
### ⚡ **Productivity Boosters**
|
||||||
- **Creates checkpoints automatically** before changes for safe experimentation
|
- **Creates checkpoints automatically** before changes for safe experimentation
|
||||||
- **Restore instantly** if changes don't work out as expected
|
- **Restore instantly** if changes don't work out as expected
|
||||||
|
- **NEW**: Permission system prevents accidental tool execution
|
||||||
|
- **NEW**: YOLO mode for power users who want speed over safety
|
||||||
- Use the stop button to cancel long-running operations
|
- Use the stop button to cancel long-running operations
|
||||||
- Copy message contents to reuse Claude's responses
|
- Copy message contents to reuse Claude's responses
|
||||||
- Open history panel to reference previous conversations
|
- Open history panel to reference previous conversations
|
||||||
|
- **NEW**: Sidebar integration for multi-panel workflow
|
||||||
|
|
||||||
### 🎨 **Interface Customization**
|
### 🎨 **Interface Customization**
|
||||||
- The UI automatically adapts to your VS Code theme
|
- The UI automatically adapts to your VS Code theme
|
||||||
- Messages are color-coded: Green for you, Blue for Claude
|
- Messages are color-coded: Green for you, Blue for Claude
|
||||||
- Hover over messages to reveal the copy button
|
- Hover over messages to reveal the copy button
|
||||||
|
- **NEW**: Enhanced code block rendering with syntax highlighting
|
||||||
|
- **NEW**: Copy-to-clipboard functionality for code blocks
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 🔧 **Advanced Features**
|
## 🔧 **Advanced Features**
|
||||||
|
|
||||||
### 🛠️ **Tool Integration**
|
### 🛠️ **Tool Integration**
|
||||||
Claude Code Chat provides full access to all Claude Code tools:
|
Claude Code Chat provides secure access to all Claude Code tools:
|
||||||
- **Bash** - Execute shell commands
|
- **Bash** - Execute shell commands with permission controls
|
||||||
- **File Operations** - Read, write, and edit files
|
- **File Operations** - Read, write, and edit files
|
||||||
- **Search** - Grep and glob pattern matching
|
- **Search** - Grep and glob pattern matching across workspace
|
||||||
- **Web** - Fetch and search web content
|
- **Web** - Fetch and search web content
|
||||||
- **Multi-edit** - Batch file modifications
|
- **Multi-edit** - Batch file modifications
|
||||||
- **While in Beta, all tools are enabled by default, use at your own risk!**
|
- **MCP Servers** - Extend functionality with Model Context Protocol servers
|
||||||
|
- **Permissions System** - Granular control over tool execution for security
|
||||||
|
|
||||||
### 📊 **Analytics & Monitoring**
|
### 📊 **Analytics & Monitoring**
|
||||||
- **Real-time cost tracking** - Monitor your API usage
|
- **Real-time cost tracking** - Monitor your API usage
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"name": "claude-code-chat",
|
"name": "claude-code-chat",
|
||||||
"displayName": "Claude Code Chat",
|
"displayName": "Claude Code Chat",
|
||||||
"description": "Beautiful Claude Code Chat Interface for VS Code",
|
"description": "Beautiful Claude Code Chat Interface for VS Code",
|
||||||
"version": "1.0.0",
|
"version": "1.0.3",
|
||||||
"publisher": "AndrePimenta",
|
"publisher": "AndrePimenta",
|
||||||
"author": "Andre Pimenta",
|
"author": "Andre Pimenta",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|||||||
@@ -122,7 +122,6 @@ class ClaudeChatProvider {
|
|||||||
this._initializeBackupRepo();
|
this._initializeBackupRepo();
|
||||||
this._initializeConversations();
|
this._initializeConversations();
|
||||||
this._initializeMCPConfig();
|
this._initializeMCPConfig();
|
||||||
this._initializePermissions();
|
|
||||||
|
|
||||||
// Load conversation index from workspace state
|
// Load conversation index from workspace state
|
||||||
this._conversationIndex = this._context.workspaceState.get('claude.conversationIndex', []);
|
this._conversationIndex = this._context.workspaceState.get('claude.conversationIndex', []);
|
||||||
@@ -166,6 +165,7 @@ class ClaudeChatProvider {
|
|||||||
this._panel.onDidDispose(() => this.dispose(), null, this._disposables);
|
this._panel.onDidDispose(() => this.dispose(), null, this._disposables);
|
||||||
|
|
||||||
this._setupWebviewMessageHandler(this._panel.webview);
|
this._setupWebviewMessageHandler(this._panel.webview);
|
||||||
|
this._initializePermissions();
|
||||||
|
|
||||||
// Resume session from latest conversation
|
// Resume session from latest conversation
|
||||||
const latestConversation = this._getLatestConversation();
|
const latestConversation = this._getLatestConversation();
|
||||||
@@ -305,6 +305,9 @@ class ClaudeChatProvider {
|
|||||||
case 'deleteCustomSnippet':
|
case 'deleteCustomSnippet':
|
||||||
this._deleteCustomSnippet(message.snippetId);
|
this._deleteCustomSnippet(message.snippetId);
|
||||||
return;
|
return;
|
||||||
|
case 'enableYoloMode':
|
||||||
|
this._enableYoloMode();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -342,6 +345,7 @@ class ClaudeChatProvider {
|
|||||||
this._webview.html = this._getHtmlForWebview();
|
this._webview.html = this._getHtmlForWebview();
|
||||||
|
|
||||||
this._setupWebviewMessageHandler(this._webview);
|
this._setupWebviewMessageHandler(this._webview);
|
||||||
|
this._initializePermissions();
|
||||||
|
|
||||||
// Initialize the webview
|
// Initialize the webview
|
||||||
this._initializeWebview();
|
this._initializeWebview();
|
||||||
@@ -366,6 +370,7 @@ class ClaudeChatProvider {
|
|||||||
public reinitializeWebview() {
|
public reinitializeWebview() {
|
||||||
// Only reinitialize if we have a webview (sidebar)
|
// Only reinitialize if we have a webview (sidebar)
|
||||||
if (this._webview) {
|
if (this._webview) {
|
||||||
|
this._initializePermissions();
|
||||||
this._initializeWebview();
|
this._initializeWebview();
|
||||||
// Set up message handler for the webview
|
// Set up message handler for the webview
|
||||||
this._setupWebviewMessageHandler(this._webview);
|
this._setupWebviewMessageHandler(this._webview);
|
||||||
@@ -433,9 +438,6 @@ class ClaudeChatProvider {
|
|||||||
data: 'Claude is working...'
|
data: 'Claude is working...'
|
||||||
});
|
});
|
||||||
|
|
||||||
// Call claude with the message via stdin using stream-json format
|
|
||||||
console.log('Calling Claude with message via stdin:', message);
|
|
||||||
|
|
||||||
// Build command arguments with session management
|
// Build command arguments with session management
|
||||||
const args = [
|
const args = [
|
||||||
'-p',
|
'-p',
|
||||||
@@ -462,7 +464,6 @@ class ClaudeChatProvider {
|
|||||||
// Add model selection if not using default
|
// Add model selection if not using default
|
||||||
if (this._selectedModel && this._selectedModel !== 'default') {
|
if (this._selectedModel && this._selectedModel !== 'default') {
|
||||||
args.push('--model', this._selectedModel);
|
args.push('--model', this._selectedModel);
|
||||||
console.log('Using model:', this._selectedModel);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add session resume if we have a current session
|
// Add session resume if we have a current session
|
||||||
@@ -486,8 +487,6 @@ class ClaudeChatProvider {
|
|||||||
console.log('Using WSL configuration:', { wslDistro, nodePath, claudePath });
|
console.log('Using WSL configuration:', { wslDistro, nodePath, claudePath });
|
||||||
const wslCommand = `"${nodePath}" --no-warnings --enable-source-maps "${claudePath}" ${args.join(' ')}`;
|
const wslCommand = `"${nodePath}" --no-warnings --enable-source-maps "${claudePath}" ${args.join(' ')}`;
|
||||||
|
|
||||||
console.log('wsl', ['-d', wslDistro, 'bash', '-ic', wslCommand].join(" "))
|
|
||||||
|
|
||||||
claudeProcess = cp.spawn('wsl', ['-d', wslDistro, 'bash', '-ic', wslCommand], {
|
claudeProcess = cp.spawn('wsl', ['-d', wslDistro, 'bash', '-ic', wslCommand], {
|
||||||
cwd: cwd,
|
cwd: cwd,
|
||||||
stdio: ['pipe', 'pipe', 'pipe'],
|
stdio: ['pipe', 'pipe', 'pipe'],
|
||||||
@@ -501,6 +500,7 @@ class ClaudeChatProvider {
|
|||||||
// Use native claude command
|
// Use native claude command
|
||||||
console.log('Using native Claude command');
|
console.log('Using native Claude command');
|
||||||
claudeProcess = cp.spawn('claude', args, {
|
claudeProcess = cp.spawn('claude', args, {
|
||||||
|
shell: process.platform === 'win32',
|
||||||
cwd: cwd,
|
cwd: cwd,
|
||||||
stdio: ['pipe', 'pipe', 'pipe'],
|
stdio: ['pipe', 'pipe', 'pipe'],
|
||||||
env: {
|
env: {
|
||||||
@@ -597,8 +597,6 @@ class ClaudeChatProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private _processJsonStreamData(jsonData: any) {
|
private _processJsonStreamData(jsonData: any) {
|
||||||
console.log('Received JSON data:', jsonData);
|
|
||||||
|
|
||||||
switch (jsonData.type) {
|
switch (jsonData.type) {
|
||||||
case 'system':
|
case 'system':
|
||||||
if (jsonData.subtype === 'init') {
|
if (jsonData.subtype === 'init') {
|
||||||
@@ -1098,6 +1096,12 @@ class ClaudeChatProvider {
|
|||||||
|
|
||||||
private async _initializePermissions(): Promise<void> {
|
private async _initializePermissions(): Promise<void> {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
|
if(this._permissionWatcher){
|
||||||
|
this._permissionWatcher.dispose();
|
||||||
|
this._permissionWatcher = undefined;
|
||||||
|
}
|
||||||
|
|
||||||
const storagePath = this._context.storageUri?.fsPath;
|
const storagePath = this._context.storageUri?.fsPath;
|
||||||
if (!storagePath) {return;}
|
if (!storagePath) {return;}
|
||||||
|
|
||||||
@@ -2037,15 +2041,39 @@ class ClaudeChatProvider {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private async _enableYoloMode(): Promise<void> {
|
||||||
|
try {
|
||||||
|
// Update VS Code configuration to enable YOLO mode
|
||||||
|
const config = vscode.workspace.getConfiguration('claudeCodeChat');
|
||||||
|
|
||||||
|
// Clear any global setting and set workspace setting
|
||||||
|
await config.update('permissions.yoloMode', true, vscode.ConfigurationTarget.Workspace);
|
||||||
|
|
||||||
|
console.log('YOLO Mode enabled - all future permissions will be skipped');
|
||||||
|
|
||||||
|
// Send updated settings to UI
|
||||||
|
this._sendCurrentSettings();
|
||||||
|
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Error enabling YOLO mode:', error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private async _updateSettings(settings: { [key: string]: any }): Promise<void> {
|
private async _updateSettings(settings: { [key: string]: any }): Promise<void> {
|
||||||
const config = vscode.workspace.getConfiguration('claudeCodeChat');
|
const config = vscode.workspace.getConfiguration('claudeCodeChat');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
for (const [key, value] of Object.entries(settings)) {
|
for (const [key, value] of Object.entries(settings)) {
|
||||||
await config.update(key, value, vscode.ConfigurationTarget.Global);
|
if (key === 'permissions.yoloMode') {
|
||||||
|
// YOLO mode is workspace-specific
|
||||||
|
await config.update(key, value, vscode.ConfigurationTarget.Workspace);
|
||||||
|
} else {
|
||||||
|
// Other settings are global (user-wide)
|
||||||
|
await config.update(key, value, vscode.ConfigurationTarget.Global);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
vscode.window.showInformationMessage('Settings updated successfully');
|
console.log('Settings updated:', settings);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Failed to update settings:', error);
|
console.error('Failed to update settings:', error);
|
||||||
vscode.window.showErrorMessage('Failed to update settings');
|
vscode.window.showErrorMessage('Failed to update settings');
|
||||||
|
|||||||
@@ -86,8 +86,8 @@ const styles = `
|
|||||||
/* Permission Request */
|
/* Permission Request */
|
||||||
.permission-request {
|
.permission-request {
|
||||||
margin: 4px 12px 20px 12px;
|
margin: 4px 12px 20px 12px;
|
||||||
background-color: var(--vscode-inputValidation-warningBackground);
|
background-color: rgba(252, 188, 0, 0.1);
|
||||||
border: 1px solid var(--vscode-inputValidation-warningBorder);
|
border: 1px solid rgba(252, 188, 0, 0.3);
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
padding: 16px;
|
padding: 16px;
|
||||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
||||||
@@ -107,6 +107,86 @@ const styles = `
|
|||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.permission-menu {
|
||||||
|
position: relative;
|
||||||
|
margin-left: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.permission-menu-btn {
|
||||||
|
background: none;
|
||||||
|
border: none;
|
||||||
|
color: var(--vscode-descriptionForeground);
|
||||||
|
cursor: pointer;
|
||||||
|
padding: 4px 8px;
|
||||||
|
border-radius: 4px;
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: bold;
|
||||||
|
transition: all 0.2s ease;
|
||||||
|
line-height: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.permission-menu-btn:hover {
|
||||||
|
background-color: var(--vscode-list-hoverBackground);
|
||||||
|
color: var(--vscode-foreground);
|
||||||
|
}
|
||||||
|
|
||||||
|
.permission-menu-dropdown {
|
||||||
|
position: absolute;
|
||||||
|
top: 100%;
|
||||||
|
right: 0;
|
||||||
|
background-color: var(--vscode-menu-background);
|
||||||
|
border: 1px solid var(--vscode-menu-border);
|
||||||
|
border-radius: 6px;
|
||||||
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
||||||
|
z-index: 1000;
|
||||||
|
min-width: 220px;
|
||||||
|
padding: 4px 0;
|
||||||
|
margin-top: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.permission-menu-item {
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-start;
|
||||||
|
gap: 10px;
|
||||||
|
padding: 12px 16px;
|
||||||
|
background: none;
|
||||||
|
border: none;
|
||||||
|
width: 100%;
|
||||||
|
text-align: left;
|
||||||
|
cursor: pointer;
|
||||||
|
color: var(--vscode-foreground);
|
||||||
|
transition: background-color 0.2s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.permission-menu-item:hover {
|
||||||
|
background-color: var(--vscode-list-hoverBackground);
|
||||||
|
}
|
||||||
|
|
||||||
|
.permission-menu-item .menu-icon {
|
||||||
|
font-size: 16px;
|
||||||
|
margin-top: 1px;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.permission-menu-item .menu-content {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.permission-menu-item .menu-title {
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 13px;
|
||||||
|
line-height: 1.2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.permission-menu-item .menu-subtitle {
|
||||||
|
font-size: 11px;
|
||||||
|
color: var(--vscode-descriptionForeground);
|
||||||
|
opacity: 0.8;
|
||||||
|
line-height: 1.2;
|
||||||
|
}
|
||||||
|
|
||||||
.permission-content {
|
.permission-content {
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
line-height: 1.4;
|
line-height: 1.4;
|
||||||
@@ -493,7 +573,7 @@ const styles = `
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 6px;
|
gap: 6px;
|
||||||
margin-top: 12px;
|
margin-top: 12px;
|
||||||
opacity: 0.8;
|
opacity: 1;
|
||||||
transition: opacity 0.2s ease;
|
transition: opacity 0.2s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -502,12 +582,12 @@ const styles = `
|
|||||||
}
|
}
|
||||||
|
|
||||||
.yolo-mode-section input[type="checkbox"] {
|
.yolo-mode-section input[type="checkbox"] {
|
||||||
transform: scale(0.8);
|
transform: scale(0.9);
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.yolo-mode-section label {
|
.yolo-mode-section label {
|
||||||
font-size: 10px;
|
font-size: 12px;
|
||||||
color: var(--vscode-descriptionForeground);
|
color: var(--vscode-descriptionForeground);
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
@@ -1447,13 +1527,13 @@ const styles = `
|
|||||||
|
|
||||||
.yolo-warning {
|
.yolo-warning {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
color: var(--vscode-inputValidation-errorForeground);
|
color: var(--vscode-foreground);
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
background-color: var(--vscode-inputValidation-errorBackground);
|
background-color: rgba(255, 99, 71, 0.08);
|
||||||
border: 1px solid var(--vscode-inputValidation-errorBorder);
|
border: 1px solid rgba(255, 99, 71, 0.2);
|
||||||
padding: 8px 12px;
|
padding: 8px 12px;
|
||||||
margin: 4px 12px;
|
margin: 4px 4px;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
animation: slideDown 0.3s ease;
|
animation: slideDown 0.3s ease;
|
||||||
}
|
}
|
||||||
|
|||||||
75
src/ui.ts
75
src/ui.ts
@@ -133,7 +133,7 @@ const html = `<!DOCTYPE html>
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="yoloWarning" class="yolo-warning" style="display: none;">
|
<div id="yoloWarning" class="yolo-warning" style="display: none;">
|
||||||
⚠️ Yolo Mode Active: Claude Code can execute any tool without asking.
|
⚠️ Yolo Mode Active: Claude Code will auto-approve all tool requests.
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- File picker modal -->
|
<!-- File picker modal -->
|
||||||
@@ -339,23 +339,11 @@ const html = `<!DOCTYPE html>
|
|||||||
</button>
|
</button>
|
||||||
<div class="yolo-mode-section">
|
<div class="yolo-mode-section">
|
||||||
<input type="checkbox" id="yolo-mode" onchange="updateSettings(); updateYoloWarning();">
|
<input type="checkbox" id="yolo-mode" onchange="updateSettings(); updateYoloWarning();">
|
||||||
<label for="yolo-mode">Enable Yolo Mode (Skip All Permissions)</label>
|
<label for="yolo-mode">Enable Yolo Mode (Auto-allow all permissions)</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h3 style="margin-top: 24px; margin-bottom: 16px; font-size: 14px; font-weight: 600;">Custom Slash Commands (coming soon)</h3>
|
|
||||||
<div>
|
|
||||||
<p style="font-size: 11px; color: var(--vscode-descriptionForeground); margin: 0;">
|
|
||||||
Add your own custom slash commands that will appear in the commands modal. Define shortcuts for frequently used terminal commands.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<div class="settings-group">
|
|
||||||
<div class="tool-item">
|
|
||||||
<input type="checkbox" id="custom-commands-enabled" disabled>
|
|
||||||
<label for="custom-commands-enabled">Enable Custom Commands <span style="font-style: italic; opacity: 0.7;">(Coming Soon)</span></label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -2631,7 +2619,6 @@ const html = `<!DOCTYPE html>
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'updateTokens':
|
case 'updateTokens':
|
||||||
console.log('Tokens updated in real-time:', message.data);
|
|
||||||
// Update token totals in real-time
|
// Update token totals in real-time
|
||||||
totalTokensInput = message.data.totalTokensInput || 0;
|
totalTokensInput = message.data.totalTokensInput || 0;
|
||||||
totalTokensOutput = message.data.totalTokensOutput || 0;
|
totalTokensOutput = message.data.totalTokensOutput || 0;
|
||||||
@@ -2656,12 +2643,6 @@ const html = `<!DOCTYPE html>
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'updateTotals':
|
case 'updateTotals':
|
||||||
console.log('Totals updated:', message.data);
|
|
||||||
console.log('Cost data received:', {
|
|
||||||
totalCost: message.data.totalCost,
|
|
||||||
currentCost: message.data.currentCost,
|
|
||||||
previousTotalCost: totalCost
|
|
||||||
});
|
|
||||||
// Update local tracking variables
|
// Update local tracking variables
|
||||||
totalCost = message.data.totalCost || 0;
|
totalCost = message.data.totalCost || 0;
|
||||||
totalTokensInput = message.data.totalTokensInput || 0;
|
totalTokensInput = message.data.totalTokensInput || 0;
|
||||||
@@ -2705,7 +2686,6 @@ const html = `<!DOCTYPE html>
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'showRestoreOption':
|
case 'showRestoreOption':
|
||||||
console.log('Show restore option:', message.data);
|
|
||||||
showRestoreContainer(message.data);
|
showRestoreContainer(message.data);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -2798,6 +2778,18 @@ const html = `<!DOCTYPE html>
|
|||||||
<div class="permission-header">
|
<div class="permission-header">
|
||||||
<span class="icon">🔐</span>
|
<span class="icon">🔐</span>
|
||||||
<span>Permission Required</span>
|
<span>Permission Required</span>
|
||||||
|
<div class="permission-menu">
|
||||||
|
<button class="permission-menu-btn" onclick="togglePermissionMenu('\${data.id}')" title="More options">⋮</button>
|
||||||
|
<div class="permission-menu-dropdown" id="permissionMenu-\${data.id}" style="display: none;">
|
||||||
|
<button class="permission-menu-item" onclick="enableYoloMode('\${data.id}')">
|
||||||
|
<span class="menu-icon">⚡</span>
|
||||||
|
<div class="menu-content">
|
||||||
|
<span class="menu-title">Enable YOLO Mode</span>
|
||||||
|
<span class="menu-subtitle">Auto-allow all permissions</span>
|
||||||
|
</div>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="permission-content">
|
<div class="permission-content">
|
||||||
<p>Allow <strong>\${toolName}</strong> to execute the tool call above?</p>
|
<p>Allow <strong>\${toolName}</strong> to execute the tool call above?</p>
|
||||||
@@ -2849,6 +2841,44 @@ const html = `<!DOCTYPE html>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function togglePermissionMenu(permissionId) {
|
||||||
|
const menu = document.getElementById(\`permissionMenu-\${permissionId}\`);
|
||||||
|
const isVisible = menu.style.display !== 'none';
|
||||||
|
|
||||||
|
// Close all other permission menus
|
||||||
|
document.querySelectorAll('.permission-menu-dropdown').forEach(dropdown => {
|
||||||
|
dropdown.style.display = 'none';
|
||||||
|
});
|
||||||
|
|
||||||
|
// Toggle this menu
|
||||||
|
menu.style.display = isVisible ? 'none' : 'block';
|
||||||
|
}
|
||||||
|
|
||||||
|
function enableYoloMode(permissionId) {
|
||||||
|
// Hide the menu
|
||||||
|
document.getElementById(\`permissionMenu-\${permissionId}\`).style.display = 'none';
|
||||||
|
|
||||||
|
// Send message to enable YOLO mode
|
||||||
|
vscode.postMessage({
|
||||||
|
type: 'enableYoloMode'
|
||||||
|
});
|
||||||
|
|
||||||
|
// Auto-approve this permission
|
||||||
|
respondToPermission(permissionId, true);
|
||||||
|
|
||||||
|
// Show notification
|
||||||
|
addMessage('⚡ YOLO Mode enabled! All future permissions will be automatically allowed.', 'system');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Close permission menus when clicking outside
|
||||||
|
document.addEventListener('click', function(event) {
|
||||||
|
if (!event.target.closest('.permission-menu')) {
|
||||||
|
document.querySelectorAll('.permission-menu-dropdown').forEach(dropdown => {
|
||||||
|
dropdown.style.display = 'none';
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// Session management functions
|
// Session management functions
|
||||||
function newSession() {
|
function newSession() {
|
||||||
vscode.postMessage({
|
vscode.postMessage({
|
||||||
@@ -3097,7 +3127,6 @@ const html = `<!DOCTYPE html>
|
|||||||
}
|
}
|
||||||
|
|
||||||
function loadConversation(filename) {
|
function loadConversation(filename) {
|
||||||
console.log('Loading conversation:', filename);
|
|
||||||
vscode.postMessage({
|
vscode.postMessage({
|
||||||
type: 'loadConversation',
|
type: 'loadConversation',
|
||||||
filename: filename
|
filename: filename
|
||||||
|
|||||||
Reference in New Issue
Block a user