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:
@@ -0,0 +1,43 @@
|
||||
import { HandlerContext } from './types';
|
||||
import { _parseCalEventAttrs } from '../attrParsers';
|
||||
|
||||
export async function applyCalendarActions(ctx: HandlerContext): Promise<void> {
|
||||
const { aiMessage, report } = ctx;
|
||||
let match: RegExpExecArray | null;
|
||||
// Action 8: Create Calendar Event (OAuth) — agent 가 회의록·작업 분석 후 일정 자동 생성.
|
||||
// 형식: <create_calendar_event title="..." start="2026-05-21T14:00" duration="60" location="...">설명</create_calendar_event>
|
||||
// 속성: title (필수), start (필수, ISO 'YYYY-MM-DDTHH:MM' 또는 timezone 포함),
|
||||
// end | duration (분, default 60), location, all_day (true/false)
|
||||
const calRegex = /<create_calendar_event\b([^>]*)>([\s\S]*?)<\/create_calendar_event>/gi;
|
||||
while ((match = calRegex.exec(aiMessage)) !== null) {
|
||||
const attrs = _parseCalEventAttrs(match[1]);
|
||||
const desc = match[2].trim();
|
||||
if (!attrs.title || !attrs.start) {
|
||||
report.push(`❌ Calendar Event: title / start 누락`);
|
||||
continue;
|
||||
}
|
||||
try {
|
||||
const { createCalendarEvent } = await import('../../features/calendar');
|
||||
const r = await createCalendarEvent(ctx.context, {
|
||||
title: attrs.title,
|
||||
start: attrs.start,
|
||||
end: attrs.end,
|
||||
durationMinutes: attrs.duration,
|
||||
location: attrs.location,
|
||||
description: desc || undefined,
|
||||
allDay: attrs.allDay,
|
||||
});
|
||||
if (r.ok) {
|
||||
report.push(`📅 Calendar Event Created: ${r.event.title} (${r.event.startIso})`);
|
||||
// chatHistory 에 결과 주입 — agent 가 다음 답변에서 link 인용 가능.
|
||||
ctx.chatHistory.push({
|
||||
role: 'system',
|
||||
content: `[Calendar event created] ${r.event.title} · ${r.event.startIso}\nLink: ${r.event.htmlLink}`,
|
||||
internal: true,
|
||||
});
|
||||
} else {
|
||||
report.push(`❌ Calendar Event Failed: ${r.error}`);
|
||||
}
|
||||
} catch (err: any) { report.push(`❌ Calendar Event Error: ${err?.message ?? String(err)}`); }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user