- Change field names to snake_case (user_id, collected_info, last_recommendation, created_at, updated_at, expires_at)
- Extract system prompts to constants (SERVER_EXPERT_PROMPT, SERVER_REVIEW_PROMPT)
- Add __PASSTHROUGH__/__SESSION_END__ marker support
- Change handler signature to match other agents (db, userId, userMessage, env, options)
- Add helper functions for consistency (createServerSession, isSessionExpired, addMessageToSession, hasServerSession)
- Update saveSe rverSession signature to not need userId separately
- Rename tools constant from serverExpertTools to serverExpertTools (camelCase)
- Change AI call parameter order for consistency
- Add performance logging
- Update openai-service.ts routing to use hasServerSession
- Update server-tool.ts to use new session creation helpers
- Update message-handler.ts and api/chat.ts field references
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Create troubleshoot_sessions table in D1
- Replace KV session storage with D1
- Unify field names to snake_case (user_id, collected_info, created_at, updated_at, expires_at)
- Add __PASSTHROUGH__/__SESSION_END__ marker support
- Change handler signature to match domain/deposit pattern
- Extract system prompt to constant TROUBLESHOOT_EXPERT_PROMPT
- Add hasTroubleshootSession() for routing
- Update openai-service.ts to use new D1-based functions
- Update troubleshoot-tool.ts to use D1 instead of KV
- Add TroubleshootSessionStatus type
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add deposit session routing to openai-service.ts
- Convert deposit-tool to agent trigger (delegate to deposit-agent)
- Update CLAUDE.md with new agent architecture
Changes:
- openai-service.ts: Import and check hasDepositSession, route to processDepositConsultation
- deposit-tool.ts: Convert action → natural language → delegate to Deposit Agent
- CLAUDE.md: Update Core Services, Function Calling Tools, Data Layer, Deposit System sections
All tests passing (192/195), dev server starts successfully.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Import domain agent functions
- Add domain session check before main AI processing
- Route to domain agent when session exists
- Handle __PASSTHROUGH__ for non-domain messages
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Create src/agents/ directory for agent modules
- Move server-agent.ts to new location
- Update import paths in all dependent files:
- openai-service.ts
- tools/server-tool.ts
- routes/handlers/message-handler.ts
- routes/api/chat.ts
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Enhance OpenAI message types with tool_calls support
- Improve security validation and rate limiting
- Update utility tools and weather tool
- Minor fixes in deposit-agent and domain-register
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add server-agent.ts with 30-year senior architect persona
- Implement KV-based session management for multi-turn conversations
- Add search_trends (Brave Search) and lookup_framework_docs (Context7) tools
- Function Calling support with max 3 tool calls per request
- Auto-infer tech stack and expected users from use case/scale
- Prohibit competitor provider mentions (AWS, GCP, Azure, etc.)
- Simplify main AI system prompt, delegate complex logic to expert AI
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove Queue-based server provisioning (moved to cloud-orchestrator)
- Add manage_server tool with Service Binding to Cloud Orchestrator
- Add CDN cache hit rate estimation based on tech_stack
- Always display bandwidth info (show "포함 범위 내" when no overage)
- Add language auto-detection (ko, ja, zh, en)
- Update system prompt to always call tools fresh
- Add Server System documentation to CLAUDE.md
BREAKING: Server provisioning now requires cloud-orchestrator service
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Security:
- Add token+secret auth to /setup-webhook and /webhook-info endpoints
- Disable /api/test in production environment (ENVIRONMENT=production)
Performance:
- Add retryWithBackoff to weather-tool (maxRetries: 2)
- Add KV caching to executeLookupDocs (1h TTL)
Code Quality:
- Centralize error messages in src/constants/messages.ts
- Update 5 files to use centralized error constants
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Type Safety Improvements:
- Add isErrorResult() type guard for API responses (domain-tool.ts)
- Replace `any` with `unknown` in executeTool args (tools/index.ts)
- Add JSON.parse error handling in function calling (openai-service.ts)
- Fix nullable price handling with nullish coalescing
- Add array type guard for nameservers validation
Code Quality Improvements:
- Extract convertNamecheapDate() to eliminate duplicate functions
- Move hardcoded bank account info to environment variables
- Add JSDoc documentation to executeDepositFunction
- Fix unused variables in optimistic-lock.ts
- Handle Error.captureStackTrace for Workers environment
All TypeScript strict mode checks now pass.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Phase 5-3 모니터링 강화 작업의 통합을 완료했습니다.
변경사항:
- Logger 통합: console.log를 구조화된 로깅으로 전환 (9개 파일)
- JSON 기반 로그, 환경별 자동 전환 (개발/프로덕션)
- 타입 안전성 보장, 성능 측정 타이머 내장
- Metrics 통합: 실시간 성능 모니터링 시스템 연결 (3개 파일)
- Circuit Breaker 상태 추적 (api_call_count, error_count, state)
- Retry 재시도 횟수 추적 (retry_count)
- OpenAI API 응답 시간 측정 (api_call_duration)
- 알림 통합: 장애 자동 알림 시스템 구현 (2개 파일)
- Circuit Breaker OPEN 상태 → 관리자 Telegram 알림
- 재시도 실패 → 관리자 Telegram 알림
- Rate Limiting 적용 (1시간에 1회)
- 문서 업데이트:
- CLAUDE.md: coder 에이전트 설명 강화 (20년+ 시니어 전문가)
- README.md, docs/: 아키텍처 문서 추가
영향받은 파일: 16개 (수정 14개, 신규 2개)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
보안 개선:
- API 키 하드코딩 제거 (NAMECHEAP_API_KEY_INTERNAL)
- CORS 정책: * → hosting.anvil.it.com 제한
- /health 엔드포인트 DB 정보 노출 방지
- Rate Limiting 인메모리 Map → Cloudflare KV 전환
- 분산 환경 일관성 보장
- 재시작 후에도 유지
- 자동 만료 (TTL)
문서:
- CLAUDE.md Security 섹션 추가
- KV Namespace 설정 가이드 추가
- 배포/마이그레이션 가이드 추가
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- 도메인 등록 인라인 버튼 확인 플로우 (domain-register.ts)
- manage_domain에 cheapest action 추가 (가장 저렴한 TLD TOP 15)
- 24시간 경과 입금 대기 자동 취소 Cron (UTC 15:00)
- 거래 내역 한글 라벨 + description 표시
- CLAUDE.md 문서 업데이트
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Email Routing에서 수신한 이메일 파싱 수정
- Quoted-Printable UTF-8 디코딩 함수 추가
- HTML <br/> 태그를 줄바꿈으로 변환
- SMS 키워드 위치 기반 본문 추출
- 레거시 코드 삭제
- /api/bank-notification 엔드포인트 제거 (Email Routing으로 대체)
- BANK_API_SECRET 관련 코드 및 문서 제거
- DEPOSIT_AGENT_ID 제거 (Assistants API → 코드 직접 처리)
- CLI 테스트 클라이언트 개선
- .env 파일 자동 로드 지원
- WEBHOOK_SECRET 환경변수 불필요
- 문서 업데이트
- NAMECHEAP_API_KEY 설명 명확화 (래퍼 인증 키)
- CLI 테스트 섹션 추가
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Replace OpenAI Assistants API with direct function calling (AI Gateway)
- Add action-based parameters to manage_deposit tool (like manage_domain)
- Export executeDepositFunction for direct use in openai-service.ts
- Add formatDepositResult function for consistent response formatting
- Remove DEPOSIT_AGENT_ID dependency (no longer needed)
- Update CLAUDE.md documentation
Benefits:
- Bypasses regional restrictions via AI Gateway
- 100% consistent response formatting
- No Assistants API costs
- Faster execution (no thread creation)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- OpenAI API 호출을 AI Gateway 경유로 변경
- 지역 제한 (403 unsupported_country_region_territory) 해결
- Gateway: telegram-bot (d8e5997eb4040f8b489f09095c0f623c)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
주요 변경:
- Domain Agent 제거, 코드 직접 처리로 전환
- suggest_domains: 등록 가능 도메인만 표시, 10개 미만 시 재시도
- search_web: 한글 검색어 자동 영문 번역 (GPT-4o-mini)
- WHOIS: raw 데이터 파싱으로 상세 정보 추출
- 가격 조회: API 필드명 수정 (register_krw → krw)
- 동적 도구 로딩 시스템 추가
- 문서 정리 및 업데이트
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
## 검색 API 교체
- DuckDuckGo Instant Answer API → Brave Search API
- 실제 웹 검색 결과 반환 (제목, 설명, URL)
- Vault에 API 키 저장 (secret/brave-search)
- Free AI 플랜: 2,000 queries/월
## 시스템 프롬프트 개선
- 검색 도구 사용 조건 명시 (최신 정보, 실시간 가격 등)
- 도구 description에 트리거 키워드 추가
## 입금 알림 개선
- 자동 매칭 성공 시 사용자에게 Telegram 알림 전송
- tryAutoMatch() 반환값에 userId, amount 추가
## 문서 업데이트
- Function Calling Tools 테이블에 트리거 키워드 컬럼 추가
- AI 시스템 프롬프트 섹션 추가
- Deposit Agent 프롬프트 수정 방법 문서화
- 자동 알림 시스템 섹션 추가
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- POST /api/bank-notification 엔드포인트 추가
- 하나은행 Web발신 SMS 패턴 파싱 지원
- Gmail message_id 기반 중복 방지
- BANK_API_SECRET 인증 추가
- deposit_transactions 자동 매칭 구현
- 문서 업데이트 (CLAUDE.md, README.md)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Namecheap API가 미국 형식(08/01/2026)을 반환하여 AI가 1월 8일로 오해석
- ISO 형식(2026-08-01)으로 변환하여 명확한 날짜 표시
- list_domains, get_domain_info에 날짜 변환 적용
- 문서에 WHOIS API 서버 정보 및 ccSLD 미지원 안내 추가
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- get_domain_info 민감정보 필터링 (계정 ID 제거)
- whois_lookup 도구 추가 (Domain Agent)
- .it.com ccSLD WHOIS 미지원 안내 추가
- domain-agent tools.ts에 whois_lookup 추가
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Vercel Serverless로 WHOIS API 서버 구축
- 모든 TLD 지원 (TCP 포트 43 직접 연결)
- RDAP 대신 raw WHOIS 사용으로 안정성 향상
- AI가 raw 응답 파싱
WHOIS API: whois-api-kappa-inoutercoms-projects.vercel.app
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- get_price: ccSLD(it.com, uk.com 등) 가격 조회 지원
- check_domains: 도메인 가용성 확인 기능 추가
- whois_lookup: 공개 RDAP API로 WHOIS 조회 (com/net/org/io/me/info/biz)
- 읽기 작업(get_domain_info, get_nameservers)은 누구나 조회 가능
- 한국어 질문 시 원화(KRW)만 표시하도록 개선
- README.md, CLAUDE.md 도메인 관리 문서 추가
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- manage_domain Function Calling 도구 추가
- OpenAI Assistants API 기반 Domain Agent 연동
- Namecheap API 호출 (도메인 목록, 네임서버 관리 등)
- user_domains 테이블로 사용자별 도메인 권한 관리
- 타임스탬프 검증 비활성화 (WEBHOOK_SECRET으로 충분)
- CLAUDE.md 프로젝트 문서 추가
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- OpenAI GPT-4o-mini with Function Calling
- Cloudflare D1 for user profiles and message buffer
- Sliding window (3 summaries max) for infinite context
- Tools: weather, search, time, calculator
- Workers AI fallback support
- Webhook security with rate limiting
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>