Version 2.55.0 Release: Rebranding to Astra
This commit is contained in:
+58
-10
@@ -207,7 +207,7 @@ export class AgentExecutor {
|
||||
|
||||
// Decide whether to use Multi-Agent Workflow (for complex requests)
|
||||
const isComplex = prompt && (prompt.length > 100 || /(분석|보고서|설계|기획|정리)/.test(prompt));
|
||||
if (isComplex && loopDepth === 0 && multiAgentEnabled) {
|
||||
if (isComplex && loopDepth === 0 && multiAgentEnabled && !this.isAstraModeArchitectureQuestion(prompt)) {
|
||||
return this.executeMultiAgentWorkflow(prompt!, modelName, options);
|
||||
}
|
||||
|
||||
@@ -293,6 +293,12 @@ export class AgentExecutor {
|
||||
if (projectBriefContext) {
|
||||
contextBlock += `\n\n${projectBriefContext}`;
|
||||
}
|
||||
const modeArchitectureContext = prompt && loopDepth === 0
|
||||
? this.buildAstraModeArchitectureContext(prompt)
|
||||
: '';
|
||||
if (modeArchitectureContext) {
|
||||
contextBlock += `\n\n${modeArchitectureContext}`;
|
||||
}
|
||||
|
||||
// 2. Setup History
|
||||
if (prompt !== null) {
|
||||
@@ -792,6 +798,40 @@ export class AgentExecutor {
|
||||
return /(어떤\s*거?\s*같|어때|어떻게\s*생각|의견|판단|방향|설계|아키텍처|구조|자비스|생각.*정리|갈림길|architecture|design|direction|opinion|think|judge)/i.test(prompt);
|
||||
}
|
||||
|
||||
private isAstraModeArchitectureQuestion(prompt: string): boolean {
|
||||
const mentionsGuard = /\bguard\b|가드|Guard|Chronicle Guard|Project Chronicle/i.test(prompt);
|
||||
const mentionsMultiAgent = /\bMA\b|multi[-\s]?agent|멀티\s*에이전트|다중\s*에이전트|Planner|Researcher|Writer/i.test(prompt);
|
||||
const asksDecision = /(분리|통합|모드|사용|좋을까|맞을까|구조|설계|아키텍처|의견|판단|어때|어떤\s*거?\s*같|separate|combine|mode|architecture|design|opinion)/i.test(prompt);
|
||||
return asksDecision && mentionsGuard && mentionsMultiAgent;
|
||||
}
|
||||
|
||||
private buildAstraModeArchitectureContext(prompt: string): string {
|
||||
if (!this.isAstraModeArchitectureQuestion(prompt)) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return [
|
||||
'[ASTRA MODE ARCHITECTURE DECISION CONTEXT]',
|
||||
'The user is asking about Astra itself, specifically whether Guard mode and MA/Multi-Agent mode should remain separate.',
|
||||
'',
|
||||
'Confirmed implementation facts from the current codebase:',
|
||||
'- Guard is currently exposed as a sidebar toggle, but it defaults to enabled in the webview UI.',
|
||||
'- Guard context is built by buildProjectChronicleGuardContext(activeProject) and passed into AgentExecutor as designerContext.',
|
||||
'- In the normal single-agent path, designerContext is injected into the system prompt as [PROJECT CHRONICLE GUARD].',
|
||||
'- In the Multi-Agent path, designerContext is appended as Project Chronicle Guard context for the workflow manager.',
|
||||
'- Multi-Agent is controlled by the g1nation.multiAgentEnabled config and is only used for complex prompts.',
|
||||
'- Current risk: when Multi-Agent starts, it returns early before the normal path builds local project preflight, Second Brain Trace, recent project knowledge context, and thinking-partner context.',
|
||||
'',
|
||||
'Product decision guidance:',
|
||||
'- Do not treat Guard and MA as two equal user-facing modes.',
|
||||
'- Guard should be an always-on policy/context layer: project target, evidence discipline, record hygiene, tone, and decision logging.',
|
||||
'- MA should be an optional execution strategy chosen automatically for genuinely complex tasks.',
|
||||
'- Recommended UX: hide or de-emphasize the Guard toggle, show it as Auto/On by default, and let Astra route between single-agent and MA internally.',
|
||||
'- Recommended answer: give a clear verdict that separating them as peer modes is not ideal; separate them internally by responsibility instead.',
|
||||
'- Mention the concrete risk that MA can currently bypass richer context assembly, so unifying the context preparation before routing is the next engineering step.'
|
||||
].join('\n');
|
||||
}
|
||||
|
||||
private buildJarvisProjectBriefContext(prompt: string, localPathContext: string, recentProjectKnowledgeContext: string): string {
|
||||
if (!this.isThinkingPartnerRequest(prompt)) {
|
||||
return '';
|
||||
@@ -1102,6 +1142,7 @@ export class AgentExecutor {
|
||||
private buildProjectKnowledgeFallbackAnswer(localPathContext: string, record?: { filePath: string; relativePath: string } | null): string {
|
||||
const pathMatch = localPathContext.match(/Path:\s*(.+)/);
|
||||
const projectPath = pathMatch?.[1]?.trim() || '제공된 로컬 프로젝트 경로';
|
||||
const projectDisplayName = this.getProjectDisplayName(projectPath);
|
||||
const treeMatch = localPathContext.match(/Scanned tree:\n([\s\S]*?)(?:\nPriority file previews:|$)/);
|
||||
const treePreview = treeMatch?.[1]?.trim().split('\n').slice(0, 18).join('\n') || '';
|
||||
const priorityMatches = this.extractPriorityPreviewFiles(localPathContext).slice(0, 10);
|
||||
@@ -1123,10 +1164,10 @@ export class AgentExecutor {
|
||||
'',
|
||||
'## 바로 만들 지식 초안',
|
||||
'```markdown',
|
||||
'# ConnectAI Project Knowledge Overview',
|
||||
`# ${projectDisplayName} Project Knowledge Overview`,
|
||||
'',
|
||||
'## Purpose',
|
||||
'ConnectAI는 VS Code 안에서 로컬 AI 에이전트, Second Brain, 프로젝트 기록, 에이전트 스킬을 연결하는 개발 보조 프로젝트다.',
|
||||
`${projectDisplayName}는 VS Code 안에서 로컬 AI 에이전트, Second Brain, 프로젝트 기록, 에이전트 스킬을 연결하는 개발 보조 프로젝트다.`,
|
||||
'',
|
||||
'## Confirmed Structure',
|
||||
'- `src/agent.ts`: 에이전트 실행, 로컬 경로 프리플라이트, Second Brain Trace, 액션 실행 흐름의 중심.',
|
||||
@@ -1140,7 +1181,7 @@ export class AgentExecutor {
|
||||
'- 전체 아키텍처는 파일 구조와 일부 프리뷰 기준으로 파악 가능하지만, 세부 동작 지식은 `src/agent.ts`, `src/sidebarProvider.ts`, `secondBrainTrace.ts`, `projectChronicle` 순서로 심화 분석해 보강해야 한다.',
|
||||
'',
|
||||
'## Recommended Next Record',
|
||||
'- `docs/records/ConnectAI/development/YYYY-MM-DD_connectai_project_knowledge_overview.md`',
|
||||
`- \`docs/records/${path.basename(projectPath)}/development/YYYY-MM-DD_${projectDisplayName.toLowerCase()}_project_knowledge_overview.md\``,
|
||||
'```',
|
||||
'',
|
||||
'## 다음 액션',
|
||||
@@ -1170,8 +1211,9 @@ export class AgentExecutor {
|
||||
|
||||
try {
|
||||
const projectName = path.basename(projectPath);
|
||||
const projectDisplayName = this.getProjectDisplayName(projectPath);
|
||||
const today = new Date().toISOString().slice(0, 10);
|
||||
const slug = projectName.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-|-$/g, '') || 'project';
|
||||
const slug = projectDisplayName.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-|-$/g, '') || 'project';
|
||||
const relativePath = path.join('docs', 'records', projectName, 'development', `${today}_${slug}_project_knowledge_overview.md`);
|
||||
const filePath = path.join(projectPath, relativePath);
|
||||
fs.mkdirSync(path.dirname(filePath), { recursive: true });
|
||||
@@ -1187,19 +1229,20 @@ export class AgentExecutor {
|
||||
const pathMatch = localPathContext.match(/Path:\s*(.+)/);
|
||||
const projectPath = pathMatch?.[1]?.trim() || 'Unknown project path';
|
||||
const projectName = path.basename(projectPath);
|
||||
const projectDisplayName = this.getProjectDisplayName(projectPath);
|
||||
const treeMatch = localPathContext.match(/Scanned tree:\n([\s\S]*?)(?:\nPriority file previews:|$)/);
|
||||
const treePreview = treeMatch?.[1]?.trim().split('\n').slice(0, 80).join('\n') || '';
|
||||
const priorityFiles = this.extractPriorityPreviewFiles(localPathContext);
|
||||
|
||||
return [
|
||||
`# ${projectName} Project Knowledge Overview`,
|
||||
`# ${projectDisplayName} Project Knowledge Overview`,
|
||||
'',
|
||||
`Date: ${new Date().toISOString()}`,
|
||||
`Project: ${projectName}`,
|
||||
`Project: ${projectDisplayName}`,
|
||||
`Repository: \`${projectPath}\``,
|
||||
'',
|
||||
'## Purpose',
|
||||
`${projectName}는 VS Code 안에서 로컬 AI 에이전트, Second Brain, 프로젝트 기록, 에이전트 스킬을 연결하는 개발 보조 프로젝트다.`,
|
||||
`${projectDisplayName}는 VS Code 안에서 로컬 AI 에이전트, Second Brain, 프로젝트 기록, 에이전트 스킬을 연결하는 개발 보조 프로젝트다.`,
|
||||
'',
|
||||
'## Confirmed Structure',
|
||||
'- `src/agent.ts`: 에이전트 실행, 로컬 경로 프리플라이트, Second Brain Trace, 액션 실행 흐름의 중심.',
|
||||
@@ -1227,6 +1270,11 @@ export class AgentExecutor {
|
||||
].join('\n');
|
||||
}
|
||||
|
||||
private getProjectDisplayName(projectPath: string): string {
|
||||
const projectName = path.basename(projectPath);
|
||||
return /^connectai$/i.test(projectName) ? 'Astra' : projectName;
|
||||
}
|
||||
|
||||
private listProjectTree(root: string, current: string, depth: number, maxDepth: number, limit: number): string {
|
||||
if (limit <= 0 || depth > maxDepth) {
|
||||
return '';
|
||||
@@ -1646,7 +1694,7 @@ export class AgentExecutor {
|
||||
const cmd = match[1].trim();
|
||||
try {
|
||||
const safeCmd = sanitizeCommand(cmd);
|
||||
const terminal = vscode.window.terminals.find(t => t.name === 'G1nation Terminal') || vscode.window.createTerminal({ name: 'G1nation Terminal', cwd: rootPath });
|
||||
const terminal = vscode.window.terminals.find(t => t.name === 'Astra Terminal') || vscode.window.createTerminal({ name: 'Astra Terminal', cwd: rootPath });
|
||||
terminal.show();
|
||||
terminal.sendText(safeCmd);
|
||||
report.push(`🚀 Executed: ${safeCmd}`);
|
||||
@@ -1766,7 +1814,7 @@ export class AgentExecutor {
|
||||
try {
|
||||
const { execSync } = require('child_process');
|
||||
execSync(`git add .`, { cwd: brainDir });
|
||||
execSync(`git commit -m "[G1nation] Knowledge Update"`, { cwd: brainDir });
|
||||
execSync(`git commit -m "[Astra] Knowledge Update"`, { cwd: brainDir });
|
||||
execSync(`git push`, { cwd: brainDir });
|
||||
} catch (err) {
|
||||
logError('Second Brain sync failed.', err);
|
||||
|
||||
Reference in New Issue
Block a user