source dump of claude code
1import type { SettingSource } from 'src/utils/settings/constants.js'
2import type { AgentDefinition } from '../../tools/AgentTool/loadAgentsDir.js'
3
4export const AGENT_PATHS = {
5 FOLDER_NAME: '.claude',
6 AGENTS_DIR: 'agents',
7} as const
8
9// Base types for common patterns
10type WithPreviousMode = { previousMode: ModeState }
11type WithAgent = { agent: AgentDefinition }
12
13// Simplified state type using intersection types
14export type ModeState =
15 | { mode: 'main-menu' }
16 | { mode: 'list-agents'; source: SettingSource | 'all' | 'built-in' }
17 | ({ mode: 'agent-menu' } & WithAgent & WithPreviousMode)
18 | ({ mode: 'view-agent' } & WithAgent & WithPreviousMode)
19 | { mode: 'create-agent' }
20 | ({ mode: 'edit-agent' } & WithAgent & WithPreviousMode)
21 | ({ mode: 'delete-confirm' } & WithAgent & WithPreviousMode)
22
23export type AgentValidationResult = {
24 isValid: boolean
25 warnings: string[]
26 errors: string[]
27}