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

@@ -13,8 +13,9 @@
.cli-manager-grid {
display: grid;
grid-template-columns: 1fr 1fr;
grid-template-columns: 1.2fr 0.8fr;
gap: 1.25rem;
align-items: start;
}
@media (max-width: 768px) {
@@ -46,12 +47,15 @@
display: flex;
align-items: center;
justify-content: space-between;
padding: 0.875rem 1rem;
padding: 0.625rem 0.75rem;
border-bottom: 1px solid hsl(var(--border));
background: hsl(var(--muted) / 0.3);
}
.cli-status-header h3 {
display: flex;
align-items: center;
gap: 0.5rem;
font-size: 0.8125rem;
font-weight: 600;
color: hsl(var(--foreground));
@@ -59,30 +63,57 @@
letter-spacing: -0.01em;
}
.cli-status-header h3 i {
color: hsl(var(--muted-foreground));
}
.cli-tools-grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 0.625rem;
padding: 0.875rem;
gap: 0.5rem;
padding: 0.5rem 0.625rem;
}
.cli-tool-card {
padding: 0.875rem 0.75rem;
padding: 0.625rem 0.5rem;
border-radius: 0.5rem;
background: hsl(var(--background));
text-align: center;
border: 1px solid hsl(var(--border));
border: 1.5px solid hsl(var(--border));
transition: all 0.2s ease;
}
.cli-tool-card.available {
border-color: hsl(var(--success) / 0.4);
background: hsl(var(--success) / 0.03);
background: hsl(var(--background));
}
.cli-tool-card.available:hover {
border-color: hsl(var(--success) / 0.6);
background: hsl(var(--success) / 0.06);
box-shadow: 0 2px 8px hsl(var(--foreground) / 0.08);
}
/* Tool-specific border colors */
.cli-tool-card.tool-gemini.available {
border-color: hsl(210 80% 55% / 0.5);
}
.cli-tool-card.tool-gemini.available:hover {
border-color: hsl(210 80% 55% / 0.7);
}
.cli-tool-card.tool-qwen.available {
border-color: hsl(280 70% 55% / 0.5);
}
.cli-tool-card.tool-qwen.available:hover {
border-color: hsl(280 70% 55% / 0.7);
}
.cli-tool-card.tool-codex.available {
border-color: hsl(142 71% 45% / 0.5);
}
.cli-tool-card.tool-codex.available:hover {
border-color: hsl(142 71% 45% / 0.7);
}
.cli-tool-card.unavailable {
@@ -94,8 +125,8 @@
display: flex;
align-items: center;
justify-content: center;
gap: 0.5rem;
margin-bottom: 0.375rem;
gap: 0.375rem;
margin-bottom: 0.1875rem;
}
.cli-tool-status {
@@ -134,7 +165,7 @@
.cli-tool-info {
font-size: 0.6875rem;
margin-bottom: 0.5rem;
margin-bottom: 0.3125rem;
color: hsl(var(--muted-foreground));
}
@@ -222,6 +253,9 @@
}
.cli-history-header h3 {
display: flex;
align-items: center;
gap: 0.5rem;
font-size: 0.8125rem;
font-weight: 600;
color: hsl(var(--foreground));
@@ -229,6 +263,10 @@
letter-spacing: -0.01em;
}
.cli-history-header h3 i {
color: hsl(var(--muted-foreground));
}
.cli-history-controls {
display: flex;
align-items: center;
@@ -683,7 +721,7 @@
/* CCW Install Content */
.ccw-install-content {
padding: 0.875rem;
padding: 0.5rem 0.625rem;
}
/* CCW Empty State */
@@ -727,7 +765,7 @@
.ccw-carousel-card {
flex: 0 0 100%;
min-width: 0;
padding: 1rem;
padding: 0.625rem 0.75rem;
background: hsl(var(--background));
border: 1px solid hsl(var(--border));
border-radius: 0.5rem;
@@ -744,18 +782,28 @@
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 0.75rem;
margin-bottom: 0.375rem;
}
.ccw-card-header-right {
display: flex;
align-items: center;
gap: 0.375rem;
}
.ccw-card-mode {
display: flex;
align-items: center;
gap: 0.5rem;
gap: 0.375rem;
font-weight: 600;
font-size: 0.875rem;
font-size: 0.8125rem;
color: hsl(var(--foreground));
}
.btn-icon-sm {
padding: 0.25rem;
}
.ccw-card-mode.global {
color: hsl(var(--primary));
}
@@ -776,13 +824,13 @@
/* Carousel Card Path */
.ccw-card-path {
font-size: 0.75rem;
font-size: 0.6875rem;
color: hsl(var(--muted-foreground));
font-family: 'SF Mono', 'Consolas', 'Liberation Mono', monospace;
background: hsl(var(--muted) / 0.5);
padding: 0.5rem 0.625rem;
padding: 0.3125rem 0.5rem;
border-radius: 0.375rem;
margin-bottom: 0.75rem;
margin-bottom: 0.375rem;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
@@ -791,10 +839,9 @@
/* Carousel Card Meta */
.ccw-card-meta {
display: flex;
gap: 1rem;
font-size: 0.6875rem;
gap: 0.75rem;
font-size: 0.625rem;
color: hsl(var(--muted-foreground));
margin-bottom: 0.75rem;
}
.ccw-card-meta span {
@@ -803,14 +850,7 @@
gap: 0.25rem;
}
/* Carousel Card Actions */
.ccw-card-actions {
display: flex;
justify-content: flex-end;
gap: 0.375rem;
padding-top: 0.75rem;
border-top: 1px solid hsl(var(--border));
}
/* Carousel Card Actions - moved to header */
/* Carousel Navigation Buttons */
.ccw-carousel-btn {
@@ -844,7 +884,7 @@
display: flex;
justify-content: center;
gap: 0.5rem;
margin-top: 0.75rem;
margin-top: 0.5rem;
}
.ccw-carousel-dot {