feat(cli-tools): add effort level configuration for Claude CLI

- Introduced effort level options (low, medium, high) in the CLI tool settings.
- Updated the SettingsPage and CliToolCard components to handle effort level updates.
- Enhanced CLI command options to accept effort level via --effort parameter.
- Modified backend routes to support effort level updates in tool configurations.
- Created a new CliViewerToolbar component for improved CLI viewer interactions.
- Implemented logic to manage and display execution statuses and layouts in the CLI viewer.
This commit is contained in:
catlog22
2026-02-17 20:02:44 +08:00
parent 41c6f07ee0
commit c67bf86244
27 changed files with 696 additions and 241 deletions

View File

@@ -320,7 +320,7 @@ export async function handleCliRoutes(ctx: RouteContext): Promise<boolean> {
if (req.method === 'PUT') {
handlePostRequest(req, res, async (body: unknown) => {
try {
const updates = body as { enabled?: boolean; primaryModel?: string; secondaryModel?: string; availableModels?: string[]; tags?: string[]; envFile?: string | null; settingsFile?: string | null };
const updates = body as { enabled?: boolean; primaryModel?: string; secondaryModel?: string; availableModels?: string[]; tags?: string[]; envFile?: string | null; settingsFile?: string | null; effort?: string | null };
const updated = updateToolConfig(initialPath, tool, updates);
// Broadcast config updated event

View File

@@ -186,12 +186,9 @@ async function buildFileTree(
for (const entry of entries) {
const isDirectory = entry.isDirectory();
// Check if should be ignored
if (shouldIgnore(entry.name, gitignorePatterns, isDirectory)) {
// Allow hidden files if includeHidden is true and it's .claude or .workflow
if (!includeHidden || (!entry.name.startsWith('.claude') && !entry.name.startsWith('.workflow'))) {
continue;
}
// Check if should be ignored (pass includeHidden as showAll to skip all filtering)
if (shouldIgnore(entry.name, gitignorePatterns, isDirectory, includeHidden)) {
continue;
}
const entryPath = join(normalizedPath, entry.name);
@@ -326,17 +323,21 @@ function parseGitignore(gitignorePath: string): string[] {
* @param {string} name - File or directory name
* @param {string[]} patterns - Gitignore patterns
* @param {boolean} isDirectory - Whether the entry is a directory
* @param {boolean} showAll - When true, skip hardcoded excludes and hidden file filtering (only apply gitignore)
* @returns {boolean}
*/
function shouldIgnore(name: string, patterns: string[], isDirectory: boolean): boolean {
// Always exclude certain directories
if (isDirectory && EXPLORER_EXCLUDE_DIRS.includes(name)) {
return true;
}
function shouldIgnore(name: string, patterns: string[], isDirectory: boolean, showAll: boolean = false): boolean {
// When showAll is true, only apply gitignore patterns (skip hardcoded excludes and hidden files)
if (!showAll) {
// Always exclude certain directories
if (isDirectory && EXPLORER_EXCLUDE_DIRS.includes(name)) {
return true;
}
// Skip hidden files/directories (starting with .)
if (name.startsWith('.') && name !== '.claude' && name !== '.workflow') {
return true;
// Skip hidden files/directories (starting with .)
if (name.startsWith('.')) {
return true;
}
}
for (const pattern of patterns) {
@@ -626,6 +627,8 @@ export async function handleFilesRoutes(ctx: RouteContext): Promise<boolean> {
const maxDepth = parseInt(url.searchParams.get('maxDepth') || '6', 10);
const includeHidden = url.searchParams.get('includeHidden') === 'true';
console.log(`[Explorer] Tree request - rootPath: ${rootPath}, includeHidden: ${includeHidden}`);
const startTime = Date.now();
try {