refactor: extract shared utilities, protocol constants, and retry loop
Phase 3: provider-retry.ts — shared Claude rotation loop (SSOT) - retryClaudeWithRotation extracted from message-agent-executor + task-scheduler - ~200 lines of duplicated retry logic removed Phase 4: types.ts — AgentOutputPhase + VisiblePhase unified Phase 5: types.ts — AgentConfig extended with claudeThinking/claudeThinkingBudget Utilities (utils.ts): - getErrorMessage: 14 occurrences of instanceof Error pattern → 1 function - readJsonFile/writeJsonFile: 19 occurrences of JSON+fs pattern → 2 functions - fetchWithTimeout: 3 occurrences of AbortController pattern → 1 function - formatElapsedKorean: deduplicated from task-watch-status + message-turn-controller Protocol (agent-protocol.ts): - OUTPUT_START/END_MARKER centralized (runners keep local copies with SSOT reference) - IMAGE_TAG_RE, IPC constants documented Runner: show "대화 요약 중..." progress message during auto-compact Net: -137 lines, 354/354 tests passing
This commit is contained in:
12
src/types.ts
12
src/types.ts
@@ -5,10 +5,22 @@ export interface AgentConfig {
|
||||
codexEffort?: string;
|
||||
claudeModel?: string;
|
||||
claudeEffort?: string;
|
||||
claudeThinking?: 'adaptive' | 'enabled' | 'disabled';
|
||||
claudeThinkingBudget?: number;
|
||||
}
|
||||
|
||||
export type AgentType = 'claude-code' | 'codex';
|
||||
|
||||
/** Phase of agent output as emitted by the runner. */
|
||||
export type AgentOutputPhase =
|
||||
| 'progress'
|
||||
| 'final'
|
||||
| 'tool-activity'
|
||||
| 'intermediate';
|
||||
|
||||
/** Phase as visible in the UI (mapped from AgentOutputPhase). */
|
||||
export type VisiblePhase = 'silent' | 'progress' | 'final';
|
||||
|
||||
export interface RegisteredGroup {
|
||||
name: string;
|
||||
folder: string;
|
||||
|
||||
Reference in New Issue
Block a user