diff --git a/docs/cli/commands.md b/docs/cli/commands.md index 0b475188..5327aeea 100644 --- a/docs/cli/commands.md +++ b/docs/cli/commands.md @@ -122,9 +122,9 @@ Slash commands provide meta-level control over the CLI itself. - **`create`**: - **Description:** Launch an interactive wizard to create a new subagent. The wizard guides you through location selection, AI-powered prompt generation, tool selection, and visual customization. - **Usage:** `/agents create` - - **`list`**: + - **`manage`**: - **Description:** Open an interactive management dialog to view, edit, and delete existing subagents. Shows both project-level and user-level agents. - - **Usage:** `/agents list` + - **Usage:** `/agents manage` - **Storage Locations:** - **Project-level:** `.qwen/agents/` (shared with team, takes precedence) - **User-level:** `~/.qwen/agents/` (personal agents, available across projects) diff --git a/docs/subagents.md b/docs/subagents.md index 34a9fa93..415df7ce 100644 --- a/docs/subagents.md +++ b/docs/subagents.md @@ -39,10 +39,10 @@ Subagents are independent AI assistants that: Follow the guided wizard to create a specialized agent. -2. **List existing agents**: +2. **Manage existing agents**: ``` - /agents list + /agents manage ``` View and manage your configured subagents. @@ -77,14 +77,14 @@ Creates a new subagent through a guided step wizard. /agents create ``` -#### `/agents list` +#### `/agents manage` Opens an interactive management dialog for viewing and managing existing subagents. **Usage:** ``` -/agents list +/agents manage ``` ### Storage Locations diff --git a/packages/cli/src/ui/commands/agentsCommand.ts b/packages/cli/src/ui/commands/agentsCommand.ts index b0781c3c..b3cebe80 100644 --- a/packages/cli/src/ui/commands/agentsCommand.ts +++ b/packages/cli/src/ui/commands/agentsCommand.ts @@ -12,7 +12,7 @@ export const agentsCommand: SlashCommand = { kind: CommandKind.BUILT_IN, subCommands: [ { - name: 'list', + name: 'manage', description: 'Manage existing subagents (view, edit, delete).', kind: CommandKind.BUILT_IN, action: (): OpenDialogActionReturn => ({ diff --git a/packages/cli/src/ui/components/subagents/create/CreationSummary.tsx b/packages/cli/src/ui/components/subagents/create/CreationSummary.tsx index 81683892..97024b64 100644 --- a/packages/cli/src/ui/components/subagents/create/CreationSummary.tsx +++ b/packages/cli/src/ui/components/subagents/create/CreationSummary.tsx @@ -100,9 +100,9 @@ export function CreationSummary({ state.location, ]); - const toolsDisplay = Array.isArray(state.selectedTools) - ? state.selectedTools.join(', ') - : '*'; + // If no tools explicitly selected, it means "all tools" for this agent + const toolsDisplay = + state.selectedTools.length === 0 ? '*' : state.selectedTools.join(', '); // Common method to save subagent configuration const saveSubagent = useCallback(async (): Promise => { @@ -225,12 +225,14 @@ export function CreationSummary({ - Name: - {state.generatedName} + Name: + + {state.generatedName} + - Location: + Location: {state.location === 'project' ? 'Project Level (.qwen/agents/)' @@ -239,21 +241,19 @@ export function CreationSummary({ - Tools: + Tools: {toolsDisplay} {shouldShowColor(state.color) && ( - Color: - {` ${state.generatedName} `} + Color: + {state.color} )} - Description: + Description: @@ -262,7 +262,7 @@ export function CreationSummary({ - System Prompt: + System Prompt: diff --git a/packages/cli/src/ui/components/subagents/create/DescriptionInput.tsx b/packages/cli/src/ui/components/subagents/create/DescriptionInput.tsx index b69200e6..a4387397 100644 --- a/packages/cli/src/ui/components/subagents/create/DescriptionInput.tsx +++ b/packages/cli/src/ui/components/subagents/create/DescriptionInput.tsx @@ -6,6 +6,7 @@ import { useState, useCallback, useRef } from 'react'; import { Box, Text } from 'ink'; +import Spinner from 'ink-spinner'; import { WizardStepProps, WizardAction } from '../types.js'; import { sanitizeInput } from '../utils.js'; import { Config, subagentGenerator } from '@qwen-code/qwen-code-core'; @@ -239,8 +240,11 @@ export function DescriptionInput({ {state.isGenerating ? ( + + + - ⏳ Generating subagent configuration... + Generating subagent configuration... ) : ( diff --git a/packages/cli/src/ui/components/subagents/view/ActionSelectionStep.tsx b/packages/cli/src/ui/components/subagents/manage/ActionSelectionStep.tsx similarity index 100% rename from packages/cli/src/ui/components/subagents/view/ActionSelectionStep.tsx rename to packages/cli/src/ui/components/subagents/manage/ActionSelectionStep.tsx diff --git a/packages/cli/src/ui/components/subagents/view/AgentDeleteStep.tsx b/packages/cli/src/ui/components/subagents/manage/AgentDeleteStep.tsx similarity index 100% rename from packages/cli/src/ui/components/subagents/view/AgentDeleteStep.tsx rename to packages/cli/src/ui/components/subagents/manage/AgentDeleteStep.tsx diff --git a/packages/cli/src/ui/components/subagents/view/AgentEditStep.tsx b/packages/cli/src/ui/components/subagents/manage/AgentEditStep.tsx similarity index 100% rename from packages/cli/src/ui/components/subagents/view/AgentEditStep.tsx rename to packages/cli/src/ui/components/subagents/manage/AgentEditStep.tsx diff --git a/packages/cli/src/ui/components/subagents/view/AgentSelectionStep.tsx b/packages/cli/src/ui/components/subagents/manage/AgentSelectionStep.tsx similarity index 100% rename from packages/cli/src/ui/components/subagents/view/AgentSelectionStep.tsx rename to packages/cli/src/ui/components/subagents/manage/AgentSelectionStep.tsx diff --git a/packages/cli/src/ui/components/subagents/view/AgentViewerStep.tsx b/packages/cli/src/ui/components/subagents/manage/AgentViewerStep.tsx similarity index 77% rename from packages/cli/src/ui/components/subagents/view/AgentViewerStep.tsx rename to packages/cli/src/ui/components/subagents/manage/AgentViewerStep.tsx index 28d20c00..66532586 100644 --- a/packages/cli/src/ui/components/subagents/view/AgentViewerStep.tsx +++ b/packages/cli/src/ui/components/subagents/manage/AgentViewerStep.tsx @@ -30,33 +30,31 @@ export const AgentViewerStep = ({ selectedAgent }: AgentViewerStepProps) => { - File Path: + File Path: {agent.filePath} - Tools: + Tools: {toolsDisplay} {shouldShowColor(agent.color) && ( - Color: - {` ${agent.name} `} + Color: + {agent.color} )} - Description: + Description: {agent.description} - System Prompt: + System Prompt: {agent.systemPrompt} diff --git a/packages/cli/src/ui/components/subagents/view/AgentsManagerDialog.tsx b/packages/cli/src/ui/components/subagents/manage/AgentsManagerDialog.tsx similarity index 96% rename from packages/cli/src/ui/components/subagents/view/AgentsManagerDialog.tsx rename to packages/cli/src/ui/components/subagents/manage/AgentsManagerDialog.tsx index e988b6ee..e68167d4 100644 --- a/packages/cli/src/ui/components/subagents/view/AgentsManagerDialog.tsx +++ b/packages/cli/src/ui/components/subagents/manage/AgentsManagerDialog.tsx @@ -16,6 +16,7 @@ import { ColorSelector } from '../create/ColorSelector.js'; import { MANAGEMENT_STEPS } from '../types.js'; import { Colors } from '../../../colors.js'; import { theme } from '../../../semantic-colors.js'; +import { getColorForDisplay, shouldShowColor } from '../utils.js'; import { Config, SubagentConfig } from '@qwen-code/qwen-code-core'; interface AgentsManagerDialogProps { @@ -166,9 +167,19 @@ export function AgentsManagerDialog({ } }; + // Use agent color for the Agent Viewer header + const headerColor = + currentStep === MANAGEMENT_STEPS.AGENT_VIEWER && + selectedAgent && + shouldShowColor(selectedAgent.color) + ? getColorForDisplay(selectedAgent.color) + : undefined; + return ( - {getStepHeaderText()} + + {getStepHeaderText()} + ); }, [getCurrentStep, selectedAgent]); diff --git a/packages/cli/src/ui/components/subagents/runtime/AgentExecutionDisplay.tsx b/packages/cli/src/ui/components/subagents/runtime/AgentExecutionDisplay.tsx index 6f0e08b4..1025f636 100644 --- a/packages/cli/src/ui/components/subagents/runtime/AgentExecutionDisplay.tsx +++ b/packages/cli/src/ui/components/subagents/runtime/AgentExecutionDisplay.tsx @@ -171,7 +171,10 @@ const TaskPromptSection: React.FC<{ Task Detail: {shouldTruncate && displayMode === 'default' && ( - Showing the first 10 lines. + + {' '} + Showing the first {MAX_TASK_PROMPT_LINES} lines. + )} diff --git a/packages/core/src/subagents/index.ts b/packages/core/src/subagents/index.ts index 11968026..2b0468a9 100644 --- a/packages/core/src/subagents/index.ts +++ b/packages/core/src/subagents/index.ts @@ -16,8 +16,7 @@ * - Runtime conversion functions integrated into the manager * - Manager class for CRUD operations on subagent files * - * The implementation follows the Markdown + YAML frontmatter format specified - * in the Claude Code product manual, with storage at both project and user levels. + * The implementation follows the Markdown + YAML frontmatter format , with storage at both project and user levels. */ // Core types and interfaces