feat: Enhance CLI components with icons and improve file editing capabilities

- Added icons to the CLI History and CLI Tools headers for better UI representation.
- Updated CLI Status component to include tool-specific classes for styling.
- Refactored CCW Install Panel to improve layout and functionality, including upgrade and uninstall buttons.
- Enhanced the edit-file tool with new features:
  - Support for creating parent directories when writing files.
  - Added dryRun mode for previewing changes without modifying files.
  - Implemented a unified diff output for changes made.
  - Enabled multi-edit support in update mode.
- Introduced a new Smart Search Tool with multiple search modes (auto, exact, fuzzy, semantic, graph) and intent classification.
- Created a Write File Tool to handle file creation and overwriting with backup options.
This commit is contained in:
catlog22
2025-12-11 23:06:47 +08:00
parent 15c5cd5f6e
commit e8f1caa219
13 changed files with 1087 additions and 113 deletions

View File

@@ -331,6 +331,13 @@ async function copyDirectory(src, dest, manifest = null, excludeDirs = []) {
*/
function getVersion() {
try {
// First try root package.json (parent of ccw)
const rootPkgPath = join(getSourceDir(), 'package.json');
if (existsSync(rootPkgPath)) {
const pkg = JSON.parse(readFileSync(rootPkgPath, 'utf8'));
if (pkg.version) return pkg.version;
}
// Fallback to ccw package.json
const pkgPath = join(getPackageRoot(), 'package.json');
const pkg = JSON.parse(readFileSync(pkgPath, 'utf8'));
return pkg.version || '1.0.0';

View File

@@ -32,6 +32,13 @@ function getSourceDir() {
*/
function getVersion() {
try {
// First try root package.json (parent of ccw)
const rootPkgPath = join(getSourceDir(), 'package.json');
if (existsSync(rootPkgPath)) {
const pkg = JSON.parse(readFileSync(rootPkgPath, 'utf8'));
if (pkg.version) return pkg.version;
}
// Fallback to ccw package.json
const pkgPath = join(getPackageRoot(), 'package.json');
const pkg = JSON.parse(readFileSync(pkgPath, 'utf8'));
return pkg.version || '1.0.0';