[Phase 17-C] 훅 이벤트 시스템 확장 및 AgentSettingsPanel 훅 UI

AgentLoopService.Skills.cs:
- RunSkillInForkAsync에 PreSkillExecute 훅 발화 추가 (LLM 호출 직전)
- RunSkillInForkAsync에 PostSkillExecute 훅 발화 추가 (응답 수신 후, fire-and-forget)

ChatWindow.WorkFolder.cs:
- SetWorkFolder()에 CwdChanged 훅 발화 추가 (작업 폴더 변경 시, fire-and-forget)
- toolInput=path로 변경된 경로 훅 컨텍스트에 전달

ChatWindow.SlashCommands.cs:
- InjectSlashCommand() 수정: 잘못된 ResolveSlashCommand/SendUserMessageAsync 호출 제거
- ShowSlashChip + SendMessageAsync 올바른 패턴으로 교체 (빌드 오류 4개 수정)

AgentSettingsPanel.xaml / .xaml.cs:
- 훅 이벤트 섹션 추가: ChkExtendedHooks 토글, HookSummaryText, BtnViewHooks, BtnOpenHookSettings
- RefreshHookSummary(): 이벤트 종류별 활성 훅 수 집계 표시
- BtnViewHooks_Click → InjectSlashCommand("/hooks") 연동
- BtnOpenHookSettings_Click → settings.dat 기본 편집기로 열기

빌드: 경고 0, 오류 0
This commit is contained in:
2026-04-04 13:34:36 +09:00
parent dab633edd5
commit d6f1e85cec
5 changed files with 188 additions and 0 deletions

View File

@@ -98,9 +98,17 @@ public partial class AgentLoopService
EmitEvent(AgentEventType.Thinking, "skill_fork",
$"[Fork] '{skill.Label}' 스킬을 격리 컨텍스트에서 실행 중...");
// Phase 17-C: PreSkillExecute 훅 발화
_ = RunExtendedEventAsync(HookEventKind.PreSkillExecute, forkMessages, ct,
toolName: skill.Name, toolInput: preparedBody);
// 도구 없이 텍스트 응답만 생성 (격리 실행)
var response = await _llm.SendAsync(forkMessages, ct);
// Phase 17-C: PostSkillExecute 훅 발화 (fire-and-forget)
_ = RunExtendedEventAsync(HookEventKind.PostSkillExecute, null, CancellationToken.None,
toolName: skill.Name, toolOutput: response ?? "");
// SkillCompleted 이벤트 로그 기록
_ = _eventLog?.AppendAsync(AgentEventLogType.SkillCompleted,
System.Text.Json.JsonSerializer.Serialize(new