Version 2.50.0 Release: Autonomous Turn-Based Recording and UI Streamlining

This commit is contained in:
g1nation
2026-05-03 10:07:34 +09:00
parent 70e46ab279
commit 5e3750a93e
4 changed files with 281 additions and 21 deletions
+74
View File
@@ -452,6 +452,12 @@ export class AgentExecutor {
].join('\n');
}
}
if (prompt && recentProjectKnowledgeContext) {
assistantContent = this.ensureRecentProjectKnowledgeEvidence(assistantContent, recentProjectKnowledgeContext);
}
if (prompt && localPathContext) {
assistantContent = this.ensureLocalProjectPathEvidence(assistantContent, localPathContext);
}
const traceMarkdown = secondBrainTrace
? renderSecondBrainTraceMarkdown(secondBrainTrace, !!options.secondBrainTraceDebug)
: '';
@@ -824,6 +830,74 @@ export class AgentExecutor {
}
}
private ensureRecentProjectKnowledgeEvidence(content: string, recentProjectKnowledgeContext: string): string {
const recordPath = this.extractRecentProjectKnowledgeRecordPath(recentProjectKnowledgeContext);
if (!recordPath || content.includes(recordPath)) {
return content;
}
const evidenceFiles = this.extractEvidenceFilesFromProjectKnowledge(recentProjectKnowledgeContext).slice(0, 8);
const evidenceSection = [
'## 근거',
`이번 답변은 최근 생성된 프로젝트 지식 기록과 로컬 프로젝트 구조를 기준으로 작성했습니다: \`${recordPath}\``,
evidenceFiles.length
? `확인된 근거 파일:\n${evidenceFiles.map((file) => `- \`${file}\``).join('\n')}`
: ''
].filter(Boolean).join('\n\n');
return [
content.trim(),
'',
evidenceSection
].join('\n');
}
private ensureLocalProjectPathEvidence(content: string, localPathContext: string): string {
if (!localPathContext.includes('Access: succeeded') || content.includes('## 근거')) {
return content;
}
const pathMatch = localPathContext.match(/Path:\s*(.+)/);
const projectPath = pathMatch?.[1]?.trim();
const evidenceFiles = this.extractPriorityPreviewFiles(localPathContext).slice(0, 10);
if (!projectPath && evidenceFiles.length === 0) {
return content;
}
const evidenceSection = [
'## 근거',
projectPath
? `이번 답변은 로컬 프로젝트 경로 \`${projectPath}\`에서 확인한 파일 구조와 코드 프리뷰를 기준으로 작성했습니다.`
: '이번 답변은 확인된 로컬 프로젝트 파일 구조와 코드 프리뷰를 기준으로 작성했습니다.',
evidenceFiles.length
? `확인된 근거 파일:\n${evidenceFiles.map((file) => `- \`${file}\``).join('\n')}`
: ''
].filter(Boolean).join('\n\n');
return [
content.trim(),
'',
evidenceSection
].join('\n');
}
private extractRecentProjectKnowledgeRecordPath(recentProjectKnowledgeContext: string): string | null {
return recentProjectKnowledgeContext.match(/project evidence:\s*(\/Volumes\/Data\/project\/Antigravity\/[^\s`"'<>]+\.md)/i)?.[1] || null;
}
private extractEvidenceFilesFromProjectKnowledge(recentProjectKnowledgeContext: string): string[] {
const evidenceBlock = recentProjectKnowledgeContext.match(/## Evidence Files\n([\s\S]*?)(?=\n## |\n# |$)/i)?.[1] || '';
const evidenceFiles = [...evidenceBlock.matchAll(/-\s+`([^`]+)`/g)].map((match) => match[1].trim());
if (evidenceFiles.length > 0) {
return Array.from(new Set(evidenceFiles));
}
const structureBlock = recentProjectKnowledgeContext.match(/## Confirmed Structure\n([\s\S]*?)(?=\n## |\n# |$)/i)?.[1] || '';
return Array.from(new Set([...structureBlock.matchAll(/`([^`]+)`/g)]
.map((match) => match[1].trim())
.filter((value) => /[\\/]/.test(value) || /\.[a-z0-9]+$/i.test(value))));
}
private findRecentProjectKnowledgeRecord(rootPath: string): string | null {
const fromHistory = [...this.chatHistory]
.reverse()