feat: v2.2.92 → v2.2.158 — god-file 분해 + Stocks feature + 대화 연속성

R56–R59: agent.ts 2731→1529줄 god-file 분해 (25 modules)
  · attrParsers + LLM 메서드 8개 (callNonStreaming, streamChatOnce 등)
  · executeActions 415줄 → 8 handler 그룹 (file/run/list/brain/calendar/sheets/tasks)
  · handlePrompt 1100줄 → 7 phase 모듈 (system prompt + budget + autoContinue 등)

R50–R55: extension.ts 1145→349줄 (telegram/settings/provider commands 분리)

Stocks feature 신규: /stocks slash command (v2.2.152~158)
  · .astra/stocks.json 저장소 + Yahoo Finance 현재가 갱신
  · 8 키워드 필터 (ROE/성장성/유동성/수익성/영업효율/기술력/안정성/PBR)
  · Naver 시가총액 페이지 JSON API (m.stock.naver.com) 발굴
  · LLM Top 5 매력도 분석 + Telegram 자동 보고서
  · KST 09:00/15:00 watcher 자동 모니터링

대화 연속성 (v2.2.150~157):
  · [PRIOR TURN CONCLUSION] block 으로 직전 결론 anchor
  · thin follow-up 분류 → boilerplate 헤더 suppression
  · slash 명령 결과 chatHistory mirror (capture wrapper)
  · echo/parrot 금지 system prompt rule

기타: /stocks 슬래시 자동완성 dropdown UI, Naver JSON API 전환 (cheerio 제거)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
g1nation
2026-05-25 09:59:32 +09:00
parent 4153f640c2
commit 0a97324f1b
149 changed files with 14628 additions and 6927 deletions
+17 -6
View File
@@ -853,24 +853,35 @@ export class AgentEngine {
* Fast-path 휴리스틱: prompt 가 "쪼갤 필요 없는 단순 케이스" 인지 즉시 판정.
* 명백할 때만 true — 애매한 중간 길이는 false 로 반환해 outline LLM 이 판정하게 위임.
*
* 단순 기준:
* - 길이 < 200자
* - 본문 첨부 신호 (코드 펜스, 긴 빈줄, --- 구분선)
* - 분석/리서치 키워드 없음 (분석/리서치/조사/보고서/심층/설계/기획/꼼꼼히/상세히)
* 단순 기준 (v2 — 키워드와 길이 *결합* 로 완화):
* - 길이 ≥ 400자 → 무조건 chunked (긴 입력은 분할 가치 있음)
* - 본문 첨부 신호 → 무조건 chunked
* - 분석/리서치 키워드 *있고* 길이 ≥ 80자 → chunked
* - 분석/리서치 키워드 있어도 *80자 미만* → fast-path (예: "이 함수 분석해줘", "리뷰 요청")
* - 키워드 없고 길이 < 400자 → fast-path
*
* 이전 v1 은 키워드 1개만 있어도 200자 미만이면 무조건 chunked → "5줄 코드 리뷰해줘"
* 같은 짧은 케이스도 7회 LLM 호출했음. v2 는 *키워드 + 길이* 결합으로 진짜 무거운
* 케이스만 chunked.
*/
public static isObviouslySimple(prompt: string): boolean {
if (!prompt) return false;
const trimmed = prompt.trim();
if (trimmed.length === 0) return false;
if (trimmed.length >= 200) return false;
// 본문 첨부 신호: 코드 펜스 / 긴 빈줄 / 마크다운 구분선 / 인용 다수.
const hasAttachment = /```|\n\n\n|^---$|^> .*\n> /m.test(trimmed);
if (hasAttachment) return false;
// 매우 긴 입력은 키워드 무관하게 chunked.
if (trimmed.length >= 400) return false;
// 분석/구조화 키워드.
const heavyKeyword = /(분석|리서치|조사|보고서|심층|상세히|꼼꼼히|기획|설계|아키텍처|리뷰|review|analyz|research|deep\s*analysis|strategy|proposal|보고|요약해서\s*정리)/i;
if (heavyKeyword.test(trimmed)) return false;
const hasKeyword = heavyKeyword.test(trimmed);
// 키워드 있고 입력이 길면(≥80자) chunked. 짧으면 (예: "이거 분석해줘") fast-path.
if (hasKeyword && trimmed.length >= 80) return false;
return true;
}