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:
@@ -1,6 +1,15 @@
|
||||
import { ProjectProfile } from './types';
|
||||
|
||||
export function buildProjectChronicleGuardContext(project: ProjectProfile | null): string {
|
||||
export interface BuildGuardOptions {
|
||||
/** true 면 4-section 보일러플레이트 (요청 요약 / 사용자 의도 추론 / 프로젝트 기록 대상 확인 / 핵심 확인 질문) 와
|
||||
* visible-heading 요구 사항을 *생략*. 짧은 follow-up / 정정 / 확인 turn 에서 응답을 자연스럽게 유지하기 위함. */
|
||||
suppressTemplate?: boolean;
|
||||
}
|
||||
|
||||
export function buildProjectChronicleGuardContext(
|
||||
project: ProjectProfile | null,
|
||||
options: BuildGuardOptions = {},
|
||||
): string {
|
||||
const hasUsableProject = !!project?.recordRoot?.trim();
|
||||
const projectLines = project ? [
|
||||
`Project selection status: selected`,
|
||||
@@ -14,9 +23,23 @@ export function buildProjectChronicleGuardContext(project: ProjectProfile | null
|
||||
'No active record project is selected. Before writing records, ask the user to select or create one.'
|
||||
];
|
||||
|
||||
return [
|
||||
...projectLines,
|
||||
const templateLines = options.suppressTemplate ? [
|
||||
// 짧은 follow-up / 정정 / 확인 turn — 보일러플레이트 헤더 강제 안 함.
|
||||
'This turn is a short follow-up / correction / acknowledgement to the previous answer.',
|
||||
'',
|
||||
'Do NOT emit `## 요청 요약`, `## 사용자 의도 추론`, `## 프로젝트 기록 대상 확인`, `## 핵심 확인 질문`, or `## 간단 요약` headings — they belong on first-turn idea/feature requests, not on follow-ups.',
|
||||
'',
|
||||
'CRITICAL — DO NOT MINIMIZE TO ONE ECHO LINE EITHER.',
|
||||
'사용자가 추가한 정보는 *직전 결론의 의미를 바꾼다* — 그것을 어떻게 바꾸는지 명시적으로 풀어야 한다. 사용자의 말을 그대로 한 문장으로 다시 말하는 것 (echo/parrot) 은 가장 나쁜 응답이다.',
|
||||
'',
|
||||
'Required structure (3-5 plain sentences, no `##` headings, no bullet lists):',
|
||||
' Sentence 1: 새 정보가 직전 결론의 어떤 부분을 약화/강화/뒤집는지.',
|
||||
' Sentence 2: 그 결과 결론을 어떻게 수정/유지하는지 ("결론 수정: …" 또는 "결론 유지 — 왜냐하면 …").',
|
||||
' Sentence 3-5: 그 수정/유지의 *근거* 또는 다음에 확인할 구체적 한 가지.',
|
||||
'',
|
||||
'Response length sanity check: 응답이 사용자 메시지보다 짧으면 거의 확실히 잘못된 응답이다.',
|
||||
'',
|
||||
] : [
|
||||
'This guard is active for project ideas, feature requests, architecture proposals, implementation planning, and design decisions.',
|
||||
'',
|
||||
'Required response order for new ideas or feature requests:',
|
||||
@@ -34,6 +57,12 @@ export function buildProjectChronicleGuardContext(project: ProjectProfile | null
|
||||
'12. Put Vector DB, relational DB, knowledge graph, semantic search, and complex automation only under "Later expansion" unless the user explicitly asks for them now.',
|
||||
'13. End with "Candidate records for this discussion" and list planning, discussions, decisions, development, bugs, or retrospectives paths as candidates.',
|
||||
'',
|
||||
];
|
||||
|
||||
return [
|
||||
...projectLines,
|
||||
'',
|
||||
...templateLines,
|
||||
'Decision policy:',
|
||||
'- Do not mark a decision as accepted until the user confirms it.',
|
||||
'- Before confirmation, call decisions "candidates" or "pending".',
|
||||
@@ -62,7 +91,9 @@ export function buildProjectChronicleGuardContext(project: ProjectProfile | null
|
||||
'- If the user is using the tool to organize their thinking, reflect the shape of their uncertainty and turn it into 1-2 concrete choices.',
|
||||
'- Keep the top conclusion calm and short so the user can understand the answer before reading the long version.',
|
||||
'- Prefer short paragraphs with blank lines between numbered sections. Avoid starting most lines with `*` or `-` bullets.',
|
||||
'- Use visible markdown headings such as `## 간단 요약`, `## 요청 요약`, `## 상세 답변`, `## 사용자 의도 추론`, and `## 핵심 확인 질문` for major sections.',
|
||||
...(options.suppressTemplate
|
||||
? ['- 헤더 (`##`) 사용 금지 — 이 turn 은 짧은 follow-up 이라 자연 문장으로만 답해라.']
|
||||
: ['- Use visible markdown headings such as `## 간단 요약`, `## 요청 요약`, `## 상세 답변`, `## 사용자 의도 추론`, and `## 핵심 확인 질문` for major sections.']),
|
||||
'- Avoid grand phrases like advanced cognitive architecture, compounding knowledge, perfect graph, or ultimate knowledge distiller.',
|
||||
'- When the user wants low dependency, keep the first proposal to Markdown, JSON, local files, and explicit user save actions.',
|
||||
'- Do not jump directly to large architectures. Narrow direction before expanding.',
|
||||
|
||||
Reference in New Issue
Block a user