using System;
using System.Collections.Generic;
using System.Text.Json.Serialization;
namespace AxCopilot.Models;
/// Phase 17-F: 에이전트 권한 설정.
public class PermissionsConfig
{
/// 권한 모드. default | acceptEdits | plan | bypassPermissions
[JsonPropertyName("mode")]
public string Mode { get; set; } = "default";
/// 허용 규칙 목록. 규칙 매칭 시 확인 없이 자동 허용.
[JsonPropertyName("allow")]
public List AllowRules { get; set; } = new();
/// 차단 규칙 목록. 규칙 매칭 시 즉시 차단.
[JsonPropertyName("deny")]
public List DenyRules { get; set; } = new();
}
/// 권한 규칙 항목 (설정 저장용).
public class PermissionRuleEntry
{
[JsonPropertyName("tool")]
public string ToolName { get; set; } = "";
[JsonPropertyName("pattern")]
public string? Pattern { get; set; }
[JsonPropertyName("behavior")]
public string Behavior { get; set; } = "allow"; // allow | deny | ask
}
/// Phase 17-B: 이벤트 로그 설정.
public class EventLogConfig
{
[JsonPropertyName("enabled")]
public bool Enabled { get; set; } = true;
[JsonPropertyName("retention_days")]
public int RetentionDays { get; set; } = 30;
}
/// Phase 17-A: Reflexion(자기성찰) 설정.
public class ReflexionConfig
{
[JsonPropertyName("enabled")]
public bool Enabled { get; set; } = true;
[JsonPropertyName("max_context_entries")]
public int MaxContextEntries { get; set; } = 5;
[JsonPropertyName("evaluate_on_success")]
public bool EvaluateOnSuccess { get; set; } = true;
}
/// Phase 17-C: 확장 훅 설정.
public class ExtendedHooksConfig
{
[JsonPropertyName("user_prompt_submit")]
public List UserPromptSubmit { get; set; } = new();
[JsonPropertyName("pre_compact")]
public List PreCompact { get; set; } = new();
[JsonPropertyName("post_compact")]
public List PostCompact { get; set; } = new();
[JsonPropertyName("file_changed")]
public List FileChanged { get; set; } = new();
[JsonPropertyName("session_start")]
public List SessionStart { get; set; } = new();
[JsonPropertyName("session_end")]
public List SessionEnd { get; set; } = new();
[JsonPropertyName("permission_request")]
public List PermissionRequest { get; set; } = new();
}
/// 확장 훅 항목 설정.
public class ExtendedHookEntryConfig
{
[JsonPropertyName("name")]
public string Name { get; set; } = "";
[JsonPropertyName("mode")]
public string Mode { get; set; } = "command"; // command | http | prompt | agent
[JsonPropertyName("matcher")]
public string? Matcher { get; set; }
[JsonPropertyName("script_path")]
public string? ScriptPath { get; set; }
[JsonPropertyName("url")]
public string? Url { get; set; }
[JsonPropertyName("prompt")]
public string? Prompt { get; set; }
[JsonPropertyName("model")]
public string? Model { get; set; }
[JsonPropertyName("enabled")]
public bool Enabled { get; set; } = true;
[JsonPropertyName("once")]
public bool Once { get; set; } = false;
[JsonPropertyName("async")]
public bool IsAsync { get; set; } = false;
[JsonPropertyName("timeout_seconds")]
public int TimeoutSeconds { get; set; } = 30;
[JsonPropertyName("status_message")]
public string? StatusMessage { get; set; }
[JsonPropertyName("watch_paths")]
public List WatchPaths { get; set; } = new();
}
/// 사용자 정의 커스텀 프리셋 (settings.json에 저장).
public class CustomPresetEntry
{
[JsonPropertyName("id")]
public string Id { get; set; } = Guid.NewGuid().ToString("N")[..8];
[JsonPropertyName("label")]
public string Label { get; set; } = "";
[JsonPropertyName("description")]
public string Description { get; set; } = "";
[JsonPropertyName("systemPrompt")]
public string SystemPrompt { get; set; } = "";
[JsonPropertyName("color")]
public string Color { get; set; } = "#6366F1";
[JsonPropertyName("symbol")]
public string Symbol { get; set; } = "\uE713";
/// 프리셋이 속하는 탭. "Chat" | "Cowork" | "Code"
[JsonPropertyName("tab")]
public string Tab { get; set; } = "Chat";
}
/// 사용자 정의 디자인 무드 (CSS 템플릿).
public class CustomMoodEntry
{
[JsonPropertyName("key")]
public string Key { get; set; } = "";
[JsonPropertyName("label")]
public string Label { get; set; } = "";
[JsonPropertyName("icon")]
public string Icon { get; set; } = "🎯";
[JsonPropertyName("description")]
public string Description { get; set; } = "";
[JsonPropertyName("css")]
public string Css { get; set; } = "";
}
/// 저장된 프롬프트 템플릿.
public class PromptTemplate
{
[JsonPropertyName("name")]
public string Name { get; set; } = "";
[JsonPropertyName("content")]
public string Content { get; set; } = "";
[JsonPropertyName("icon")]
public string Icon { get; set; } = "\uE8BD";
}
///
/// 사내 LLM 등록 모델. 별칭(UI 표시용) + 암호화된 실제 모델명.
/// 향후 멀티 에이전트에서는 특화 업무와 연결됩니다.
///
public class RegisteredModel
{
/// UI에 표시할 별칭 (예: "코드 리뷰 전용", "일반 대화")
[JsonPropertyName("alias")]
public string Alias { get; set; } = "";
/// 실제 모델명. EncryptionEnabled=true일 때 PortableEncrypt로 암호화된 Base64 값, false일 때 평문.
[JsonPropertyName("encryptedModelName")]
public string EncryptedModelName { get; set; } = "";
/// 이 모델이 연결될 서비스 타입. ollama | vllm
[JsonPropertyName("service")]
public string Service { get; set; } = "ollama";
/// 이 모델 전용 서버 엔드포인트. 비어있으면 LlmSettings의 기본 엔드포인트 사용.
[JsonPropertyName("endpoint")]
public string Endpoint { get; set; } = "";
/// 이 모델 전용 API 키. 비어있으면 LlmSettings의 기본 API 키 사용.
[JsonPropertyName("apiKey")]
public string ApiKey { get; set; } = "";
// ── CP4D (IBM Cloud Pak for Data) 인증 ──────────────────────────────
/// 인증 방식. bearer (기본) | cp4d
[JsonPropertyName("authType")]
public string AuthType { get; set; } = "bearer";
/// CP4D 인증 서버 URL (예: https://cpd-host.example.com)
[JsonPropertyName("cp4dUrl")]
public string Cp4dUrl { get; set; } = "";
/// CP4D 사용자 이름
[JsonPropertyName("cp4dUsername")]
public string Cp4dUsername { get; set; } = "";
/// CP4D 비밀번호 또는 API 키 (EncryptionEnabled=true 시 암호화 저장)
[JsonPropertyName("cp4dPassword")]
public string Cp4dPassword { get; set; } = "";
}
///
/// 자동 모델 라우팅용 모델 능력 점수.
/// 각 모델의 인텐트 카테고리별 적합도를 0.0~1.0으로 지정합니다.
/// 개발자가 하드코딩 기본값을 수정하려면 ModelRouterService.GetDefaultCapabilities()를 참조하세요.
///
public class ModelCapability
{
/// 서비스 타입. ollama | vllm | gemini | claude
[JsonPropertyName("service")]
public string Service { get; set; } = "";
/// 모델 식별자. 서비스별 모델 ID (예: "gemini-2.5-flash", "claude-sonnet-4-6")
[JsonPropertyName("model")]
public string Model { get; set; } = "";
/// UI 표시용 별칭.
[JsonPropertyName("alias")]
public string Alias { get; set; } = "";
/// 인텐트 카테고리별 적합도 점수. key=카테고리명, value=0.0~1.0
[JsonPropertyName("scores")]
public Dictionary Scores { get; set; } = new();
/// 라우팅 후보에 포함 여부.
[JsonPropertyName("enabled")]
public bool Enabled { get; set; } = true;
}
/// 에이전트 훅 설정 항목. 도구 실행 전/후 사용자 스크립트 실행.
public class AgentHookEntry
{
/// 훅 이름 (UI 표시용).
[JsonPropertyName("name")]
public string Name { get; set; } = "";
/// 대상 도구 이름. "*" = 모든 도구, 특정 도구명 = 해당 도구만.
[JsonPropertyName("toolName")]
public string ToolName { get; set; } = "*";
/// 실행 타이밍. "pre" = 도구 실행 전, "post" = 도구 실행 후.
[JsonPropertyName("timing")]
public string Timing { get; set; } = "post";
/// 실행할 스크립트 경로 (.bat, .ps1, .cmd).
[JsonPropertyName("scriptPath")]
public string ScriptPath { get; set; } = "";
/// 스크립트에 전달할 추가 인수 (선택).
[JsonPropertyName("arguments")]
public string Arguments { get; set; } = "";
/// 활성화 여부.
[JsonPropertyName("enabled")]
public bool Enabled { get; set; } = true;
}