using System.Text.Json.Serialization; namespace AxCopilot.Models; // 기타 설정 모델 클래스 public class WorkspaceProfile { [JsonPropertyName("name")] public string Name { get; set; } = ""; [JsonPropertyName("windows")] public List Windows { get; set; } = new(); [JsonPropertyName("createdAt")] public DateTime CreatedAt { get; set; } = DateTime.Now; } public class WindowSnapshot { [JsonPropertyName("exe")] public string Exe { get; set; } = ""; [JsonPropertyName("title")] public string Title { get; set; } = ""; [JsonPropertyName("rect")] public WindowRect Rect { get; set; } = new(); [JsonPropertyName("showCmd")] public string ShowCmd { get; set; } = "Normal"; // Normal | Minimized | Maximized [JsonPropertyName("monitor")] public int Monitor { get; set; } = 0; } public class WindowRect { [JsonPropertyName("x")] public int X { get; set; } [JsonPropertyName("y")] public int Y { get; set; } [JsonPropertyName("width")] public int Width { get; set; } [JsonPropertyName("height")] public int Height { get; set; } } public class AliasEntry { [JsonPropertyName("key")] public string Key { get; set; } = ""; [JsonPropertyName("type")] public string Type { get; set; } = "url"; // url | folder | app | batch | api | clipboard [JsonPropertyName("target")] public string Target { get; set; } = ""; [JsonPropertyName("description")] public string? Description { get; set; } [JsonPropertyName("showWindow")] public bool ShowWindow { get; set; } = false; [JsonPropertyName("adapter")] public string? Adapter { get; set; } [JsonPropertyName("query")] public string? Query { get; set; } } public class ClipboardTransformer { [JsonPropertyName("key")] public string Key { get; set; } = ""; [JsonPropertyName("type")] public string Type { get; set; } = "regex"; // regex | script [JsonPropertyName("pattern")] public string? Pattern { get; set; } [JsonPropertyName("replace")] public string? Replace { get; set; } [JsonPropertyName("command")] public string? Command { get; set; } [JsonPropertyName("timeout")] public int Timeout { get; set; } = 5000; [JsonPropertyName("description")] public string? Description { get; set; } } public class ApiAdapter { [JsonPropertyName("id")] public string Id { get; set; } = ""; [JsonPropertyName("baseUrl")] public string BaseUrl { get; set; } = ""; [JsonPropertyName("credentialKey")] public string CredentialKey { get; set; } = ""; } public class PluginEntry { [JsonPropertyName("path")] public string Path { get; set; } = ""; [JsonPropertyName("enabled")] public bool Enabled { get; set; } = true; } // ─── 스니펫 ─────────────────────────────────────────────────────────────────── public class SnippetEntry { [JsonPropertyName("key")] public string Key { get; set; } = ""; // 트리거 키워드 (예: addr, sig) [JsonPropertyName("name")] public string Name { get; set; } = ""; // 표시 이름 [JsonPropertyName("content")] public string Content { get; set; } = ""; // 확장될 전체 텍스트 } // ─── 퀵링크 ────────────────────────────────────────────────────────────────── /// /// 파라미터 퀵링크 항목. /// 예: keyword="maps", urlTemplate="https://map.naver.com/p/search/{0}" /// 사용: ql maps 강남역 → URL에 "강남역" 치환 후 브라우저 열기 /// public class QuickLinkEntry { [JsonPropertyName("keyword")] public string Keyword { get; set; } = ""; // 트리거 키워드 [JsonPropertyName("name")] public string Name { get; set; } = ""; // 표시 이름 [JsonPropertyName("urlTemplate")] public string UrlTemplate { get; set; } = ""; // {0}, {1} 또는 {query} 플레이스홀더 [JsonPropertyName("description")] public string Description { get; set; } = ""; // 설명 } // ─── AI 스니펫 템플릿 ───────────────────────────────────────────────────────── /// /// AI 스니펫 템플릿 항목. /// 예: keyword="email", prompt="다음 상황에 맞는 업무 이메일 작성: {0}" /// 사용: ai email 프로젝트 일정 변경 안내 → AI가 이메일 초안 생성 /// public class AiSnippetTemplate { [JsonPropertyName("keyword")] public string Keyword { get; set; } = ""; [JsonPropertyName("name")] public string Name { get; set; } = ""; [JsonPropertyName("prompt")] public string Prompt { get; set; } = ""; // {0}, {query} 플레이스홀더 지원 } // ─── 클립보드 히스토리 ──────────────────────────────────────────────────────── public class ClipboardHistorySettings { [JsonPropertyName("enabled")] public bool Enabled { get; set; } = true; [JsonPropertyName("maxItems")] public int MaxItems { get; set; } = 50; [JsonPropertyName("excludePatterns")] public List ExcludePatterns { get; set; } = new() { @"^\d{4}[\s\-]?\d{4}[\s\-]?\d{4}[\s\-]?\d{4}$", // 카드번호 @"^(?:\d{1,3}\.){3}\d{1,3}$" // IP 주소 }; /// 이미지 클립보드 항목에서 OCR 텍스트를 자동 추출하여 검색에 활용 (Windows OCR, 로컬 처리) [JsonPropertyName("enableOcrSearch")] public bool EnableOcrSearch { get; set; } = true; } // ─── 시스템 명령 ────────────────────────────────────────────────────────────── public class SystemCommandSettings { [JsonPropertyName("showLock")] public bool ShowLock { get; set; } = true; [JsonPropertyName("showSleep")] public bool ShowSleep { get; set; } = true; [JsonPropertyName("showRestart")] public bool ShowRestart { get; set; } = true; [JsonPropertyName("showShutdown")] public bool ShowShutdown { get; set; } = true; [JsonPropertyName("showHibernate")] public bool ShowHibernate { get; set; } = false; [JsonPropertyName("showLogout")] public bool ShowLogout { get; set; } = true; [JsonPropertyName("showRecycleBin")] public bool ShowRecycleBin { get; set; } = true; /// /// 시스템 명령 별칭. key = 기본 명령어(lock/sleep 등), value = 사용자 정의 별칭 목록. /// 예: { "lock": ["잠금", "l"] } → /잠금, /l 로도 실행 가능 /// [JsonPropertyName("commandAliases")] public Dictionary> CommandAliases { get; set; } = new(); } // ─── 스크린 캡처 설정 ────────────────────────────────────────────────────────── public class ScreenCaptureSettings { /// 캡처 명령어 프리픽스. 기본값 "cap". [JsonPropertyName("prefix")] public string Prefix { get; set; } = "cap"; /// 런처를 열지 않고 글로벌 단축키로 캡처하는 기능 활성화 여부. [JsonPropertyName("globalHotkeyEnabled")] public bool GlobalHotkeyEnabled { get; set; } = false; /// 글로벌 캡처 단축키 문자열. 기본값 "PrintScreen". [JsonPropertyName("globalHotkey")] public string GlobalHotkey { get; set; } = "PrintScreen"; /// 글로벌 캡처 단축키 실행 모드. screen|window|region. [JsonPropertyName("globalHotkeyMode")] public string GlobalHotkeyMode { get; set; } = "screen"; /// 스크롤 캡처 프레임 간 대기 시간(ms). 기본값 120. [JsonPropertyName("scrollDelayMs")] public int ScrollDelayMs { get; set; } = 120; } // ─── 전용 핫키 ──────────────────────────────────────────────────────────────── /// /// 항목별 글로벌 전용 핫키 할당. /// Hotkey: "Ctrl+Alt+1" 형식, Target: 실행 대상 경로/URL/명령어, Label: 표시 이름. /// public class HotkeyAssignment { [JsonPropertyName("hotkey")] public string Hotkey { get; set; } = ""; [JsonPropertyName("target")] public string Target { get; set; } = ""; [JsonPropertyName("label")] public string Label { get; set; } = ""; /// 실행 타입. app | url | folder | command. 기본 app. [JsonPropertyName("type")] public string Type { get; set; } = "app"; } // ─── 앱 세션 스냅 ──────────────────────────────────────────────────────────────── /// /// 앱 세션: 여러 앱을 지정 레이아웃으로 한번에 실행하는 세트. /// session 핸들러로 저장/로드/실행합니다. /// public class AppSession { [JsonPropertyName("name")] public string Name { get; set; } = ""; [JsonPropertyName("description")] public string Description { get; set; } = ""; [JsonPropertyName("apps")] public List Apps { get; set; } = new(); [JsonPropertyName("createdAt")] public DateTime CreatedAt { get; set; } = DateTime.Now; } /// /// 세션 내 개별 앱 항목. 실행 경로·인자·스냅 위치를 지정합니다. /// public class SessionApp { [JsonPropertyName("path")] public string Path { get; set; } = ""; [JsonPropertyName("args")] public string Arguments { get; set; } = ""; /// 표시 이름. 비어 있으면 파일명을 사용합니다. [JsonPropertyName("label")] public string Label { get; set; } = ""; /// /// 스냅 위치. left / right / tl / tr / bl / br / full / center / /// third-l / third-c / third-r / two3-l / two3-r / none /// [JsonPropertyName("snap")] public string SnapPosition { get; set; } = "full"; /// 이 앱을 실행하기 전 대기 시간(ms). 기본값 0. [JsonPropertyName("delayMs")] public int DelayMs { get; set; } = 0; } // ─── 자동화 스케줄러 ───────────────────────────────────────────────────────────── /// /// 자동화 스케줄 항목. /// 지정 시각에 앱 실행 또는 알림을 자동으로 발생시킵니다. /// public class ScheduleEntry { [JsonPropertyName("id")] public string Id { get; set; } = Guid.NewGuid().ToString("N")[..8]; [JsonPropertyName("name")] public string Name { get; set; } = ""; [JsonPropertyName("enabled")] public bool Enabled { get; set; } = true; // ─── 트리거 ─────────────────────────────────────────────────────────── /// 실행 주기. daily | weekdays | weekly | once [JsonPropertyName("triggerType")] public string TriggerType { get; set; } = "daily"; /// 실행 시각 (HH:mm 형식). 예: "09:00" [JsonPropertyName("triggerTime")] public string TriggerTime { get; set; } = "09:00"; /// weekly 트리거: 요일 목록. 0=일, 1=월 … 6=토 [JsonPropertyName("weekDays")] public List WeekDays { get; set; } = new(); /// once 트리거: 실행 날짜 (yyyy-MM-dd). 한 번만 실행 후 비활성화. [JsonPropertyName("triggerDate")] public string? TriggerDate { get; set; } // ─── 액션 ───────────────────────────────────────────────────────────── /// 실행 동작 유형. app | notification [JsonPropertyName("actionType")] public string ActionType { get; set; } = "app"; /// 앱 경로 또는 알림 메시지 본문 [JsonPropertyName("actionTarget")] public string ActionTarget { get; set; } = ""; /// 앱 실행 시 추가 인자 [JsonPropertyName("actionArgs")] public string ActionArgs { get; set; } = ""; // ─── 상태 ───────────────────────────────────────────────────────────── [JsonPropertyName("lastRun")] public DateTime? LastRun { get; set; } // ─── 조건 (L6-4) ───────────────────────────────────────────────────── /// /// 실행 조건: 특정 프로세스가 실행 중이어야(또는 아니어야) 트리거를 발화합니다. /// 비어 있으면 조건 없음. /// [JsonPropertyName("conditionProcess")] public string ConditionProcess { get; set; } = ""; /// /// true=해당 프로세스가 실행 중일 때만 발화. /// false=해당 프로세스가 실행 중이지 않을 때만 발화. /// [JsonPropertyName("conditionProcessMustRun")] public bool ConditionProcessMustRun { get; set; } = true; } // ─── 런처 매크로 (L6-2) ───────────────────────────────────────────────────────── /// /// 런처 명령 시퀀스를 저장하는 매크로 항목. /// macro 핸들러로 생성·편집·실행합니다. /// public class MacroEntry { [JsonPropertyName("id")] public string Id { get; set; } = Guid.NewGuid().ToString("N")[..8]; [JsonPropertyName("name")] public string Name { get; set; } = ""; [JsonPropertyName("description")] public string Description { get; set; } = ""; [JsonPropertyName("steps")] public List Steps { get; set; } = new(); [JsonPropertyName("createdAt")] public DateTime CreatedAt { get; set; } = DateTime.Now; } /// /// 매크로 단일 단계. /// public class MacroStep { /// 실행 유형. app | url | folder | notification | cmd [JsonPropertyName("type")] public string Type { get; set; } = "app"; /// 앱 경로 / URL / 폴더 경로 / 알림 메시지 / PowerShell 명령 [JsonPropertyName("target")] public string Target { get; set; } = ""; /// 추가 인자 (app 유형 전용) [JsonPropertyName("args")] public string Args { get; set; } = ""; /// 표시 이름 [JsonPropertyName("label")] public string Label { get; set; } = ""; /// 이 단계 실행 전 대기 시간(ms). 기본값 500. [JsonPropertyName("delayMs")] public int DelayMs { get; set; } = 500; } // ─── SSH 퀵 커넥트 호스트 ───────────────────────────────────────────────────── /// /// SSH 퀵 커넥트 호스트 항목. ssh 핸들러로 저장·연결합니다. /// public class SshHostEntry { [JsonPropertyName("id")] public string Id { get; set; } = Guid.NewGuid().ToString(); /// 표시 이름 (예: "dev-server", "prod-web") [JsonPropertyName("name")] public string Name { get; set; } = ""; /// 호스트 주소 (IP 또는 도메인) [JsonPropertyName("host")] public string Host { get; set; } = ""; /// SSH 포트. 기본값 22. [JsonPropertyName("port")] public int Port { get; set; } = 22; /// SSH 사용자명 [JsonPropertyName("user")] public string User { get; set; } = ""; /// 메모 (예: "운영서버", "DB 전용") [JsonPropertyName("note")] public string Note { get; set; } = ""; } // ─── 잠금 해제 알림 설정 ─────────────────────────────────────────────────────── public class ReminderSettings { /// 기능 활성화 여부. 기본값 false. [JsonPropertyName("enabled")] public bool Enabled { get; set; } = false; /// 팝업 표시 위치. top-left | top-right | bottom-left | bottom-right [JsonPropertyName("corner")] public string Corner { get; set; } = "bottom-right"; /// 알림 간격(분). 30 | 60 | 120 | 180 | 240 [JsonPropertyName("intervalMinutes")] public int IntervalMinutes { get; set; } = 60; /// 팝업 자동 닫힘 시간(초). 기본값 15. (5/10/15/20/30/60/120/180) [JsonPropertyName("displaySeconds")] public int DisplaySeconds { get; set; } = 15; /// 알림 콘텐츠 카테고리 활성화 목록. [JsonPropertyName("enabledCategories")] public List EnabledCategories { get; set; } = new() { "motivational" }; }