Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions .claude/settings.local.json

This file was deleted.

3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ dist
node_modules
.vscode-test/
*.vsix
backup
backup
.claude/
39 changes: 39 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,45 @@ 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.

## [1.2.1] - 2026-01-05

### 🚀 Features Added

#### **User Commands Discovery**
- Commands now discovered from both global (`~/.claude/commands/`) and project (`.claude/commands/`) folders
- Different icons distinguish command sources: 📂 for project commands, 👤 for global commands
- Project commands override global commands with the same name
- Duplicate detection with visual warning showing which commands exist in both locations

#### **Sync .claude Folder**
- New "Sync Now" button in Settings to refresh user commands
- Instantly re-scans both global and project `.claude/commands/` folders
- Visual feedback with success/error status messages

#### **AskUserQuestion Tool Support**
- Full UI support for Claude's `AskUserQuestion` tool
- Purple-themed question cards with multiple choice options
- Support for single and multi-select questions
- "Other" option with custom text input
- Smooth animations and visual feedback

#### **Plan Mode Improvements**
- Fixed plan mode state synchronization when ExitPlanMode is allowed
- UI toggle now correctly syncs to OFF when plan mode exits

#### **Version Badge**
- Extension version now displayed in header
- Easy visibility of current installed version

### 🐛 Bug Fixes
- **Critical**: Fixed `tool_use_id` field naming mismatch in control_response messages (was sending `toolUseID` instead of `tool_use_id`)
- Fixed plan mode toggle not syncing when Claude exits plan mode via ExitPlanMode tool

### 🔧 Technical Improvements
- Renamed "Custom Commands" section to "User Commands" to avoid confusion with user-created snippets
- Added cross-platform build script (`build.js`) with version prompting
- Improved command discovery with proper deduplication logic

## [1.1.0] - 2025-12-06

### 🚀 Features Added
Expand Down
159 changes: 159 additions & 0 deletions build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
#!/usr/bin/env node

/**
* Build script for Claude Code Chat VS Code Extension
* Cross-platform (Windows/Mac/Linux)
* Prompts for version bump before building
*/

const { execSync } = require('child_process');
const readline = require('readline');
const fs = require('fs');
const path = require('path');

// Colors for console output
const colors = {
reset: '\x1b[0m',
red: '\x1b[31m',
green: '\x1b[32m',
yellow: '\x1b[33m',
blue: '\x1b[34m',
cyan: '\x1b[36m'
};

function log(message, color = 'reset') {
console.log(`${colors[color]}${message}${colors.reset}`);
}

function exec(command, options = {}) {
try {
return execSync(command, {
stdio: options.silent ? 'pipe' : 'inherit',
encoding: 'utf8',
...options
});
} catch (error) {
if (!options.ignoreError) {
log(`Error executing: ${command}`, 'red');
process.exit(1);
}
return null;
}
}

function getPackageVersion() {
const pkg = JSON.parse(fs.readFileSync('package.json', 'utf8'));
return pkg.version;
}

function prompt(question) {
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});

return new Promise(resolve => {
rl.question(question, answer => {
rl.close();
resolve(answer.trim());
});
});
}

function calculateNewVersion(current, type) {
const [major, minor, patch] = current.split('.').map(Number);
switch (type) {
case 'major': return `${major + 1}.0.0`;
case 'minor': return `${major}.${minor + 1}.0`;
case 'patch': return `${major}.${minor}.${patch + 1}`;
default: return current;
}
}

async function main() {
console.log('');
log('================================', 'blue');
log(' Claude Code Chat Build Tool', 'blue');
log('================================', 'blue');
console.log('');

const currentVersion = getPackageVersion();
log(`Current version: ${currentVersion}`, 'green');
console.log('');

// Show version bump options
console.log('How would you like to bump the version?');
console.log('');
log(` 1) patch (${currentVersion} -> ${calculateNewVersion(currentVersion, 'patch')}) - Bug fixes`, 'yellow');
log(` 2) minor (${currentVersion} -> ${calculateNewVersion(currentVersion, 'minor')}) - New features`, 'yellow');
log(` 3) major (${currentVersion} -> ${calculateNewVersion(currentVersion, 'major')}) - Breaking changes`, 'yellow');
log(` 4) skip - Keep current version`, 'yellow');
log(` 5) custom - Enter version manually`, 'yellow');
console.log('');

const choice = await prompt('Select option [1-5]: ');

let newVersion = currentVersion;

switch (choice) {
case '1':
log('Bumping patch version...', 'yellow');
exec('npm version patch --no-git-tag-version');
newVersion = getPackageVersion();
break;
case '2':
log('Bumping minor version...', 'yellow');
exec('npm version minor --no-git-tag-version');
newVersion = getPackageVersion();
break;
case '3':
log('Bumping major version...', 'yellow');
exec('npm version major --no-git-tag-version');
newVersion = getPackageVersion();
break;
case '4':
log('Keeping current version...', 'yellow');
break;
case '5':
const customVersion = await prompt('Enter custom version (e.g., 1.2.3): ');
if (!/^\d+\.\d+\.\d+$/.test(customVersion)) {
log('Invalid version format. Use semantic versioning (e.g., 1.2.3)', 'red');
process.exit(1);
}
log(`Setting version to ${customVersion}...`, 'yellow');
exec(`npm version ${customVersion} --no-git-tag-version`);
newVersion = customVersion;
break;
default:
log('Invalid option. Exiting.', 'red');
process.exit(1);
}

console.log('');
log(`Building version: ${newVersion}`, 'green');
console.log('');

// Compile TypeScript
log('Compiling TypeScript...', 'yellow');
exec('npm run compile');

// Build the VSIX
log('Packaging VSIX...', 'yellow');
exec('npx vsce package');

const outputName = `claude-code-chat-${newVersion}.vsix`;

console.log('');
log('================================', 'green');
log(' Build Complete!', 'green');
log('================================', 'green');
console.log('');
log(`Output: ${outputName}`, 'blue');
log(`Version: ${newVersion}`, 'green');
console.log('');
}

main().catch(err => {
log(`Build failed: ${err.message}`, 'red');
process.exit(1);
});
98 changes: 98 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
#!/bin/bash

# Build script for Claude Code Chat VS Code Extension
# Prompts for version bump before building

set -e

# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color

# Get current version from package.json
CURRENT_VERSION=$(node -p "require('./package.json').version")

echo -e "${BLUE}================================${NC}"
echo -e "${BLUE} Claude Code Chat Build Tool${NC}"
echo -e "${BLUE}================================${NC}"
echo ""
echo -e "Current version: ${GREEN}${CURRENT_VERSION}${NC}"
echo ""

# Prompt for version bump
echo "How would you like to bump the version?"
echo ""
echo -e " ${YELLOW}1)${NC} patch (${CURRENT_VERSION} -> x.x.+1) - Bug fixes"
echo -e " ${YELLOW}2)${NC} minor (${CURRENT_VERSION} -> x.+1.0) - New features"
echo -e " ${YELLOW}3)${NC} major (${CURRENT_VERSION} -> +1.0.0) - Breaking changes"
echo -e " ${YELLOW}4)${NC} skip - Keep current version"
echo -e " ${YELLOW}5)${NC} custom - Enter version manually"
echo ""
read -p "Select option [1-5]: " choice

case $choice in
1)
echo -e "${YELLOW}Bumping patch version...${NC}"
npm version patch --no-git-tag-version
;;
2)
echo -e "${YELLOW}Bumping minor version...${NC}"
npm version minor --no-git-tag-version
;;
3)
echo -e "${YELLOW}Bumping major version...${NC}"
npm version major --no-git-tag-version
;;
4)
echo -e "${YELLOW}Keeping current version...${NC}"
;;
5)
read -p "Enter custom version (e.g., 1.2.3): " custom_version
if [[ ! $custom_version =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo -e "${RED}Invalid version format. Use semantic versioning (e.g., 1.2.3)${NC}"
exit 1
fi
echo -e "${YELLOW}Setting version to ${custom_version}...${NC}"
npm version "$custom_version" --no-git-tag-version
;;
*)
echo -e "${RED}Invalid option. Exiting.${NC}"
exit 1
;;
esac

# Get the new version
NEW_VERSION=$(node -p "require('./package.json').version")
OUTPUT_NAME="claude-code-chat-${NEW_VERSION}.vsix"

echo ""
echo -e "Building version: ${GREEN}${NEW_VERSION}${NC}"
echo ""

# Compile TypeScript
echo -e "${YELLOW}Compiling TypeScript...${NC}"
npm run compile

# Build the VSIX
echo -e "${YELLOW}Packaging VSIX...${NC}"
npx vsce package

echo ""
echo -e "${GREEN}================================${NC}"
echo -e "${GREEN} Build Complete!${NC}"
echo -e "${GREEN}================================${NC}"
echo ""
echo -e "Output: ${BLUE}${OUTPUT_NAME}${NC}"
echo -e "Version: ${GREEN}${NEW_VERSION}${NC}"
echo ""

# Ask if user wants to build Open VSIX version too
read -p "Also build Open VSIX version? [y/N]: " build_open_vsix
if [[ $build_open_vsix =~ ^[Yy]$ ]]; then
echo ""
echo -e "${YELLOW}Building Open VSIX version...${NC}"
bash build/open-vsix/build.sh
fi
5 changes: 4 additions & 1 deletion build/open-vsix/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
set -e

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
VERSION="1.1.0"
PROJECT_DIR="$(cd "${SCRIPT_DIR}/../.." && pwd)"

# Read version from package.json (no hardcoding!)
VERSION=$(node -p "require('${PROJECT_DIR}/package.json').version")
OUTPUT_NAME="vsix-claude-code-chat-${VERSION}.vsix"

echo "Building Open VSIX version ${VERSION}..."
Expand Down
8 changes: 6 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading