forked from sanbuphy/learn-coding-agent
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
27 lines (23 loc) · 915 Bytes
/
Copy pathtypes.ts
File metadata and controls
27 lines (23 loc) · 915 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import type { SettingSource } from 'src/utils/settings/constants.js'
import type { AgentDefinition } from '../../tools/AgentTool/loadAgentsDir.js'
export const AGENT_PATHS = {
FOLDER_NAME: '.claude',
AGENTS_DIR: 'agents',
} as const
// Base types for common patterns
type WithPreviousMode = { previousMode: ModeState }
type WithAgent = { agent: AgentDefinition }
// Simplified state type using intersection types
export type ModeState =
| { mode: 'main-menu' }
| { mode: 'list-agents'; source: SettingSource | 'all' | 'built-in' }
| ({ mode: 'agent-menu' } & WithAgent & WithPreviousMode)
| ({ mode: 'view-agent' } & WithAgent & WithPreviousMode)
| { mode: 'create-agent' }
| ({ mode: 'edit-agent' } & WithAgent & WithPreviousMode)
| ({ mode: 'delete-confirm' } & WithAgent & WithPreviousMode)
export type AgentValidationResult = {
isValid: boolean
warnings: string[]
errors: string[]
}