@su-record/vibe 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -6
- package/bin/vibe +20 -2
- package/package.json +5 -6
- package/scripts/install-mcp.js +16 -6
- package/mcp/dist/__tests__/complexity.test.js +0 -126
- package/mcp/dist/__tests__/memory.test.js +0 -120
- package/mcp/dist/__tests__/python-dart-complexity.test.js +0 -146
- package/mcp/dist/index.js +0 -230
- package/mcp/dist/lib/ContextCompressor.js +0 -305
- package/mcp/dist/lib/MemoryManager.js +0 -334
- package/mcp/dist/lib/ProjectCache.js +0 -126
- package/mcp/dist/lib/PythonParser.js +0 -241
- package/mcp/dist/tools/browser/browserPool.js +0 -76
- package/mcp/dist/tools/browser/browserUtils.js +0 -135
- package/mcp/dist/tools/browser/inspectNetworkRequests.js +0 -140
- package/mcp/dist/tools/browser/monitorConsoleLogs.js +0 -97
- package/mcp/dist/tools/convention/analyzeComplexity.js +0 -248
- package/mcp/dist/tools/convention/applyQualityRules.js +0 -102
- package/mcp/dist/tools/convention/checkCouplingCohesion.js +0 -233
- package/mcp/dist/tools/convention/complexityMetrics.js +0 -133
- package/mcp/dist/tools/convention/dartComplexity.js +0 -117
- package/mcp/dist/tools/convention/getCodingGuide.js +0 -64
- package/mcp/dist/tools/convention/languageDetector.js +0 -50
- package/mcp/dist/tools/convention/pythonComplexity.js +0 -109
- package/mcp/dist/tools/convention/suggestImprovements.js +0 -257
- package/mcp/dist/tools/convention/validateCodeQuality.js +0 -177
- package/mcp/dist/tools/memory/autoSaveContext.js +0 -79
- package/mcp/dist/tools/memory/database.js +0 -123
- package/mcp/dist/tools/memory/deleteMemory.js +0 -39
- package/mcp/dist/tools/memory/listMemories.js +0 -38
- package/mcp/dist/tools/memory/memoryConfig.js +0 -27
- package/mcp/dist/tools/memory/memorySQLite.js +0 -138
- package/mcp/dist/tools/memory/memoryUtils.js +0 -34
- package/mcp/dist/tools/memory/migrate.js +0 -113
- package/mcp/dist/tools/memory/prioritizeMemory.js +0 -109
- package/mcp/dist/tools/memory/recallMemory.js +0 -40
- package/mcp/dist/tools/memory/restoreSessionContext.js +0 -69
- package/mcp/dist/tools/memory/saveMemory.js +0 -34
- package/mcp/dist/tools/memory/searchMemories.js +0 -37
- package/mcp/dist/tools/memory/startSession.js +0 -100
- package/mcp/dist/tools/memory/updateMemory.js +0 -46
- package/mcp/dist/tools/planning/analyzeRequirements.js +0 -166
- package/mcp/dist/tools/planning/createUserStories.js +0 -119
- package/mcp/dist/tools/planning/featureRoadmap.js +0 -202
- package/mcp/dist/tools/planning/generatePrd.js +0 -156
- package/mcp/dist/tools/prompt/analyzePrompt.js +0 -145
- package/mcp/dist/tools/prompt/enhancePrompt.js +0 -105
- package/mcp/dist/tools/semantic/findReferences.js +0 -195
- package/mcp/dist/tools/semantic/findSymbol.js +0 -200
- package/mcp/dist/tools/thinking/analyzeProblem.js +0 -50
- package/mcp/dist/tools/thinking/breakDownProblem.js +0 -140
- package/mcp/dist/tools/thinking/createThinkingChain.js +0 -39
- package/mcp/dist/tools/thinking/formatAsPlan.js +0 -73
- package/mcp/dist/tools/thinking/stepByStepAnalysis.js +0 -58
- package/mcp/dist/tools/thinking/thinkAloudProcess.js +0 -75
- package/mcp/dist/tools/time/getCurrentTime.js +0 -61
- package/mcp/dist/tools/ui/previewUiAscii.js +0 -232
- package/mcp/dist/types/tool.js +0 -2
- package/mcp/package.json +0 -53
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
// Semantic code analysis tool - Find Symbol (v1.3)
|
|
2
|
-
// With ProjectCache for 25x performance improvement
|
|
3
|
-
import { Node } from 'ts-morph';
|
|
4
|
-
import * as path from 'path';
|
|
5
|
-
import { PythonParser } from '../../lib/PythonParser.js';
|
|
6
|
-
import { ProjectCache } from '../../lib/ProjectCache.js';
|
|
7
|
-
import { readFile } from 'fs/promises';
|
|
8
|
-
export const findSymbolDefinition = {
|
|
9
|
-
name: 'find_symbol',
|
|
10
|
-
description: '함수 찾아|클래스 어디|변수 위치|find function|where is|locate - Find symbol definitions',
|
|
11
|
-
inputSchema: {
|
|
12
|
-
type: 'object',
|
|
13
|
-
properties: {
|
|
14
|
-
symbolName: { type: 'string', description: 'Name of the symbol to find' },
|
|
15
|
-
projectPath: { type: 'string', description: 'Project directory path' },
|
|
16
|
-
symbolType: {
|
|
17
|
-
type: 'string',
|
|
18
|
-
enum: ['all', 'function', 'class', 'interface', 'variable', 'type'],
|
|
19
|
-
description: 'Type of symbol to search for'
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
required: ['symbolName', 'projectPath']
|
|
23
|
-
},
|
|
24
|
-
annotations: {
|
|
25
|
-
title: 'Find Symbol',
|
|
26
|
-
audience: ['user', 'assistant']
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
export async function findSymbol(args) {
|
|
30
|
-
const { symbolName, projectPath, symbolType = 'all' } = args;
|
|
31
|
-
try {
|
|
32
|
-
// Use cached project for performance
|
|
33
|
-
const projectCache = ProjectCache.getInstance();
|
|
34
|
-
const project = projectCache.getOrCreate(projectPath);
|
|
35
|
-
const symbols = [];
|
|
36
|
-
// Check for Python files
|
|
37
|
-
const glob = await import('glob');
|
|
38
|
-
const pythonFiles = glob.globSync(path.join(projectPath, '**/*.py'), {
|
|
39
|
-
ignore: ['**/node_modules/**', '**/.git/**', '**/venv/**', '**/__pycache__/**']
|
|
40
|
-
});
|
|
41
|
-
// Parse Python files
|
|
42
|
-
for (const pyFile of pythonFiles) {
|
|
43
|
-
try {
|
|
44
|
-
const content = await readFile(pyFile, 'utf-8');
|
|
45
|
-
const pythonSymbols = await PythonParser.findSymbols(content);
|
|
46
|
-
for (const pySymbol of pythonSymbols) {
|
|
47
|
-
if (pySymbol.name.includes(symbolName) &&
|
|
48
|
-
(symbolType === 'all' || symbolType === pySymbol.kind)) {
|
|
49
|
-
symbols.push({
|
|
50
|
-
name: pySymbol.name,
|
|
51
|
-
kind: pySymbol.kind,
|
|
52
|
-
filePath: pyFile,
|
|
53
|
-
line: pySymbol.line,
|
|
54
|
-
column: pySymbol.column,
|
|
55
|
-
preview: pySymbol.docstring?.substring(0, 100) || `${pySymbol.kind} ${pySymbol.name}`
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
catch (error) {
|
|
61
|
-
// Skip files that can't be parsed
|
|
62
|
-
console.error(`Error parsing Python file ${pyFile}:`, error);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
// Search through all source files
|
|
66
|
-
for (const sourceFile of project.getSourceFiles()) {
|
|
67
|
-
const filePath = sourceFile.getFilePath();
|
|
68
|
-
// Skip node_modules and other irrelevant paths
|
|
69
|
-
if (filePath.includes('node_modules') || filePath.includes('.git')) {
|
|
70
|
-
continue;
|
|
71
|
-
}
|
|
72
|
-
// Find matching symbols based on type
|
|
73
|
-
sourceFile.forEachDescendant((node) => {
|
|
74
|
-
const nodeSymbol = extractSymbolInfo(node, symbolName, symbolType);
|
|
75
|
-
if (nodeSymbol) {
|
|
76
|
-
const start = node.getStartLinePos();
|
|
77
|
-
const pos = sourceFile.getLineAndColumnAtPos(start);
|
|
78
|
-
symbols.push({
|
|
79
|
-
name: nodeSymbol.name,
|
|
80
|
-
kind: nodeSymbol.kind,
|
|
81
|
-
filePath: filePath,
|
|
82
|
-
line: pos.line,
|
|
83
|
-
column: pos.column,
|
|
84
|
-
preview: node.getText().substring(0, 100)
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
// Sort by relevance (exact matches first)
|
|
90
|
-
symbols.sort((a, b) => {
|
|
91
|
-
const aExact = a.name === symbolName ? 0 : 1;
|
|
92
|
-
const bExact = b.name === symbolName ? 0 : 1;
|
|
93
|
-
return aExact - bExact;
|
|
94
|
-
});
|
|
95
|
-
return {
|
|
96
|
-
content: [{
|
|
97
|
-
type: 'text',
|
|
98
|
-
text: `Found ${symbols.length} symbols:\n${symbols.slice(0, 20).map(s => `${s.name} (${s.kind}) - ${s.filePath}:${s.line}`).join('\n')}`
|
|
99
|
-
}]
|
|
100
|
-
};
|
|
101
|
-
}
|
|
102
|
-
catch (error) {
|
|
103
|
-
return {
|
|
104
|
-
content: [{
|
|
105
|
-
type: 'text',
|
|
106
|
-
text: `Error finding symbol: ${error instanceof Error ? error.message : 'Unknown error'}`
|
|
107
|
-
}]
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
function extractSymbolInfo(node, symbolName, symbolType) {
|
|
112
|
-
const kind = node.getKind();
|
|
113
|
-
// Function declarations and expressions
|
|
114
|
-
if (symbolType === 'all' || symbolType === 'function') {
|
|
115
|
-
if (Node.isFunctionDeclaration(node) || Node.isMethodDeclaration(node)) {
|
|
116
|
-
const name = node.getName();
|
|
117
|
-
if (name && name.includes(symbolName)) {
|
|
118
|
-
return { name, kind: 'function' };
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
if (Node.isVariableDeclaration(node)) {
|
|
122
|
-
const name = node.getName();
|
|
123
|
-
const initializer = node.getInitializer();
|
|
124
|
-
if (name && name.includes(symbolName) &&
|
|
125
|
-
(Node.isArrowFunction(initializer) || Node.isFunctionExpression(initializer))) {
|
|
126
|
-
return { name, kind: 'function' };
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
// Class declarations
|
|
131
|
-
if (symbolType === 'all' || symbolType === 'class') {
|
|
132
|
-
if (Node.isClassDeclaration(node)) {
|
|
133
|
-
const name = node.getName();
|
|
134
|
-
if (name && name.includes(symbolName)) {
|
|
135
|
-
return { name, kind: 'class' };
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
// Interface declarations
|
|
140
|
-
if (symbolType === 'all' || symbolType === 'interface') {
|
|
141
|
-
if (Node.isInterfaceDeclaration(node)) {
|
|
142
|
-
const name = node.getName();
|
|
143
|
-
if (name && name.includes(symbolName)) {
|
|
144
|
-
return { name, kind: 'interface' };
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
// Type aliases
|
|
149
|
-
if (symbolType === 'all' || symbolType === 'type') {
|
|
150
|
-
if (Node.isTypeAliasDeclaration(node)) {
|
|
151
|
-
const name = node.getName();
|
|
152
|
-
if (name && name.includes(symbolName)) {
|
|
153
|
-
return { name, kind: 'type' };
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
// Variables
|
|
158
|
-
if (symbolType === 'all' || symbolType === 'variable') {
|
|
159
|
-
if (Node.isVariableDeclaration(node)) {
|
|
160
|
-
const name = node.getName();
|
|
161
|
-
const initializer = node.getInitializer();
|
|
162
|
-
if (name && name.includes(symbolName) &&
|
|
163
|
-
!Node.isArrowFunction(initializer) && !Node.isFunctionExpression(initializer)) {
|
|
164
|
-
return { name, kind: 'variable' };
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
return null;
|
|
169
|
-
}
|
|
170
|
-
function generateSummary(symbols, query) {
|
|
171
|
-
if (symbols.length === 0) {
|
|
172
|
-
return `No symbols found matching "${query}"`;
|
|
173
|
-
}
|
|
174
|
-
const byKind = {};
|
|
175
|
-
symbols.forEach(s => {
|
|
176
|
-
byKind[s.kind] = (byKind[s.kind] || 0) + 1;
|
|
177
|
-
});
|
|
178
|
-
const summary = Object.entries(byKind)
|
|
179
|
-
.map(([kind, count]) => `${count} ${kind}${count > 1 ? 's' : ''}`)
|
|
180
|
-
.join(', ');
|
|
181
|
-
return `Found ${symbols.length} symbols: ${summary}`;
|
|
182
|
-
}
|
|
183
|
-
function formatSymbolResults(result) {
|
|
184
|
-
let output = `# Symbol Search Results\n\n`;
|
|
185
|
-
output += `**Query:** ${result.query}\n`;
|
|
186
|
-
output += `**Type:** ${result.type}\n`;
|
|
187
|
-
output += `**Results:** ${result.resultsCount} symbols found\n\n`;
|
|
188
|
-
if (result.symbols.length === 0) {
|
|
189
|
-
output += `No symbols found matching "${result.query}".\n`;
|
|
190
|
-
return output;
|
|
191
|
-
}
|
|
192
|
-
output += `## Found Symbols\n\n`;
|
|
193
|
-
result.symbols.forEach((symbol, index) => {
|
|
194
|
-
output += `### ${index + 1}. ${symbol.name} (${symbol.kind})\n`;
|
|
195
|
-
output += `**Location:** ${symbol.filePath}:${symbol.line}:${symbol.column}\n`;
|
|
196
|
-
output += `**Preview:**\n\`\`\`typescript\n${symbol.preview}\n\`\`\`\n\n`;
|
|
197
|
-
});
|
|
198
|
-
output += `\n## Summary\n${result.summary}`;
|
|
199
|
-
return output;
|
|
200
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
// Sequential thinking tool - completely independent
|
|
2
|
-
export const analyzeProblemDefinition = {
|
|
3
|
-
name: 'analyze_problem',
|
|
4
|
-
description: '문제 분석|어떻게 접근|분석해줘|analyze this|how to approach|break this down - Break down complex problem into structured steps',
|
|
5
|
-
inputSchema: {
|
|
6
|
-
type: 'object',
|
|
7
|
-
properties: {
|
|
8
|
-
problem: { type: 'string', description: 'Problem to analyze' },
|
|
9
|
-
domain: { type: 'string', description: 'Problem domain' }
|
|
10
|
-
},
|
|
11
|
-
required: ['problem']
|
|
12
|
-
},
|
|
13
|
-
annotations: {
|
|
14
|
-
title: 'Analyze Problem',
|
|
15
|
-
audience: ['user', 'assistant']
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
export async function analyzeProblem(args) {
|
|
19
|
-
const { problem, domain = 'general' } = args;
|
|
20
|
-
const problemAnalysis = {
|
|
21
|
-
action: 'analyze_problem',
|
|
22
|
-
problem,
|
|
23
|
-
domain,
|
|
24
|
-
analysis: {
|
|
25
|
-
breakdown: [
|
|
26
|
-
'Define the problem clearly',
|
|
27
|
-
'Identify key constraints and requirements',
|
|
28
|
-
'Break down into smaller sub-problems',
|
|
29
|
-
'Determine solution approach',
|
|
30
|
-
'Plan implementation steps'
|
|
31
|
-
],
|
|
32
|
-
considerations: [
|
|
33
|
-
'What are the inputs and expected outputs?',
|
|
34
|
-
'Are there any edge cases to consider?',
|
|
35
|
-
'What are the performance requirements?',
|
|
36
|
-
'How will this integrate with existing systems?'
|
|
37
|
-
],
|
|
38
|
-
nextSteps: [
|
|
39
|
-
'Research existing solutions',
|
|
40
|
-
'Create detailed implementation plan',
|
|
41
|
-
'Identify potential risks and mitigation strategies',
|
|
42
|
-
'Define success criteria'
|
|
43
|
-
]
|
|
44
|
-
},
|
|
45
|
-
status: 'success'
|
|
46
|
-
};
|
|
47
|
-
return {
|
|
48
|
-
content: [{ type: 'text', text: `Problem: ${problem}\nDomain: ${domain}\n\nBreakdown:\n${problemAnalysis.analysis.breakdown.map((b, i) => `${i + 1}. ${b}`).join('\n')}\n\nConsiderations:\n${problemAnalysis.analysis.considerations.map(c => `- ${c}`).join('\n')}\n\nNext Steps:\n${problemAnalysis.analysis.nextSteps.map(n => `- ${n}`).join('\n')}` }]
|
|
49
|
-
};
|
|
50
|
-
}
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
// Sequential thinking tool - completely independent
|
|
2
|
-
import { Project, ScriptKind } from "ts-morph";
|
|
3
|
-
const AST_PROJECT = new Project({
|
|
4
|
-
useInMemoryFileSystem: true,
|
|
5
|
-
compilerOptions: { allowJs: true, skipLibCheck: true }
|
|
6
|
-
});
|
|
7
|
-
export const breakDownProblemDefinition = {
|
|
8
|
-
name: 'break_down_problem',
|
|
9
|
-
description: '나눠서|단계별로|세분화|break down|divide|split into parts - Break complex problems into sub-problems',
|
|
10
|
-
inputSchema: {
|
|
11
|
-
type: 'object',
|
|
12
|
-
properties: {
|
|
13
|
-
problem: { type: 'string', description: 'Complex problem to break down' },
|
|
14
|
-
maxDepth: { type: 'number', description: 'Maximum breakdown depth' },
|
|
15
|
-
approach: { type: 'string', description: 'Breakdown approach', enum: ['sequential', 'hierarchical', 'dependency-based'] }
|
|
16
|
-
},
|
|
17
|
-
required: ['problem']
|
|
18
|
-
},
|
|
19
|
-
annotations: {
|
|
20
|
-
title: 'Break Down Problem',
|
|
21
|
-
audience: ['user', 'assistant']
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
export async function breakDownProblem(args) {
|
|
25
|
-
const { problem: breakdownProblem, maxDepth = 3, approach = 'hierarchical' } = args;
|
|
26
|
-
// 코드로 추정되는 입력이면 AST 기반 구조 분해 시도
|
|
27
|
-
let codeStructureSubProblems = null;
|
|
28
|
-
if (breakdownProblem.includes('function') || breakdownProblem.includes('class') || breakdownProblem.includes('=>')) {
|
|
29
|
-
try {
|
|
30
|
-
const sourceFile = AST_PROJECT.createSourceFile('temp.ts', breakdownProblem, {
|
|
31
|
-
overwrite: true,
|
|
32
|
-
scriptKind: ScriptKind.TS
|
|
33
|
-
});
|
|
34
|
-
const funcs = sourceFile.getFunctions();
|
|
35
|
-
const classes = sourceFile.getClasses();
|
|
36
|
-
const vars = sourceFile.getVariableDeclarations();
|
|
37
|
-
codeStructureSubProblems = [];
|
|
38
|
-
funcs.forEach((f, i) => {
|
|
39
|
-
codeStructureSubProblems.push({
|
|
40
|
-
id: `codeFunc${i + 1}`,
|
|
41
|
-
title: `함수 분석: ${f.getName() || '익명함수'}`,
|
|
42
|
-
description: f.getText().slice(0, 100) + (f.getText().length > 100 ? '...' : ''),
|
|
43
|
-
complexity: 'medium',
|
|
44
|
-
priority: 'high',
|
|
45
|
-
dependencies: []
|
|
46
|
-
});
|
|
47
|
-
});
|
|
48
|
-
classes.forEach((c, i) => {
|
|
49
|
-
codeStructureSubProblems.push({
|
|
50
|
-
id: `codeClass${i + 1}`,
|
|
51
|
-
title: `클래스 분석: ${c.getName() || '익명클래스'}`,
|
|
52
|
-
description: c.getText().slice(0, 100) + (c.getText().length > 100 ? '...' : ''),
|
|
53
|
-
complexity: 'high',
|
|
54
|
-
priority: 'high',
|
|
55
|
-
dependencies: []
|
|
56
|
-
});
|
|
57
|
-
});
|
|
58
|
-
vars.forEach((v, i) => {
|
|
59
|
-
codeStructureSubProblems.push({
|
|
60
|
-
id: `codeVar${i + 1}`,
|
|
61
|
-
title: `변수 분석: ${v.getName()}`,
|
|
62
|
-
description: v.getText().slice(0, 100) + (v.getText().length > 100 ? '...' : ''),
|
|
63
|
-
complexity: 'low',
|
|
64
|
-
priority: 'medium',
|
|
65
|
-
dependencies: []
|
|
66
|
-
});
|
|
67
|
-
});
|
|
68
|
-
if (codeStructureSubProblems.length === 0)
|
|
69
|
-
codeStructureSubProblems = null;
|
|
70
|
-
}
|
|
71
|
-
catch (e) {
|
|
72
|
-
codeStructureSubProblems = null;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
const generateSubProblems = (parentProblem, depth, maxDepth) => {
|
|
76
|
-
if (depth >= maxDepth)
|
|
77
|
-
return null;
|
|
78
|
-
const subProblems = [
|
|
79
|
-
{
|
|
80
|
-
id: `${depth}.1`,
|
|
81
|
-
title: `Understanding ${parentProblem}`,
|
|
82
|
-
description: `Analyze and understand the core aspects of ${parentProblem}`,
|
|
83
|
-
complexity: 'low',
|
|
84
|
-
priority: 'high',
|
|
85
|
-
dependencies: []
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
id: `${depth}.2`,
|
|
89
|
-
title: `Planning solution for ${parentProblem}`,
|
|
90
|
-
description: `Create detailed plan to solve ${parentProblem}`,
|
|
91
|
-
complexity: 'medium',
|
|
92
|
-
priority: 'high',
|
|
93
|
-
dependencies: [`${depth}.1`]
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
id: `${depth}.3`,
|
|
97
|
-
title: `Implementing solution for ${parentProblem}`,
|
|
98
|
-
description: `Execute the planned solution for ${parentProblem}`,
|
|
99
|
-
complexity: 'high',
|
|
100
|
-
priority: 'medium',
|
|
101
|
-
dependencies: [`${depth}.2`]
|
|
102
|
-
}
|
|
103
|
-
];
|
|
104
|
-
if (depth < maxDepth - 1) {
|
|
105
|
-
subProblems.forEach((subProblem) => {
|
|
106
|
-
subProblem.subProblems = generateSubProblems(subProblem.title, depth + 1, maxDepth);
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
return subProblems;
|
|
110
|
-
};
|
|
111
|
-
const problemBreakdown = {
|
|
112
|
-
action: 'break_down_problem',
|
|
113
|
-
problem: breakdownProblem,
|
|
114
|
-
approach,
|
|
115
|
-
maxDepth,
|
|
116
|
-
breakdown: {
|
|
117
|
-
rootProblem: {
|
|
118
|
-
id: '0',
|
|
119
|
-
title: breakdownProblem,
|
|
120
|
-
description: `Root problem: ${breakdownProblem}`,
|
|
121
|
-
complexity: 'high',
|
|
122
|
-
subProblems: codeStructureSubProblems || generateSubProblems(breakdownProblem, 1, maxDepth)
|
|
123
|
-
}
|
|
124
|
-
},
|
|
125
|
-
executionOrder: approach === 'dependency-based' ?
|
|
126
|
-
['Understanding phase', 'Planning phase', 'Implementation phase'] :
|
|
127
|
-
approach === 'sequential' ?
|
|
128
|
-
['Step 1', 'Step 2', 'Step 3', '...'] :
|
|
129
|
-
['Top-level analysis', 'Mid-level breakdown', 'Detailed tasks'],
|
|
130
|
-
status: 'success'
|
|
131
|
-
};
|
|
132
|
-
const formatSubProblems = (subs, indent = 0) => {
|
|
133
|
-
if (!subs)
|
|
134
|
-
return '';
|
|
135
|
-
return subs.map(s => `${' '.repeat(indent)}- ${s.title} (${s.complexity}, ${s.priority})${s.subProblems ? '\n' + formatSubProblems(s.subProblems, indent + 1) : ''}`).join('\n');
|
|
136
|
-
};
|
|
137
|
-
return {
|
|
138
|
-
content: [{ type: 'text', text: `Problem: ${breakdownProblem}\nApproach: ${approach}\nMax Depth: ${maxDepth}\n\nBreakdown:\n${formatSubProblems(problemBreakdown.breakdown.rootProblem.subProblems)}\n\nExecution: ${problemBreakdown.executionOrder.join(' → ')}` }]
|
|
139
|
-
};
|
|
140
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
// Sequential thinking tool - completely independent
|
|
2
|
-
export const createThinkingChainDefinition = {
|
|
3
|
-
name: 'create_thinking_chain',
|
|
4
|
-
description: '생각 과정|사고 흐름|연쇄적으로|thinking process|chain of thought|reasoning chain - Create sequential thinking chain',
|
|
5
|
-
inputSchema: {
|
|
6
|
-
type: 'object',
|
|
7
|
-
properties: {
|
|
8
|
-
topic: { type: 'string', description: 'Topic to think about' },
|
|
9
|
-
steps: { type: 'number', description: 'Number of thinking steps' }
|
|
10
|
-
},
|
|
11
|
-
required: ['topic']
|
|
12
|
-
},
|
|
13
|
-
annotations: {
|
|
14
|
-
title: 'Create Thinking Chain',
|
|
15
|
-
audience: ['user', 'assistant']
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
export async function createThinkingChain(args) {
|
|
19
|
-
const { topic, steps = 5 } = args;
|
|
20
|
-
const thinkingChain = {
|
|
21
|
-
action: 'create_thinking_chain',
|
|
22
|
-
topic,
|
|
23
|
-
steps,
|
|
24
|
-
chain: Array.from({ length: steps }, (_, i) => ({
|
|
25
|
-
step: i + 1,
|
|
26
|
-
title: `Step ${i + 1}: Analyze ${topic}`,
|
|
27
|
-
content: `Think about ${topic} from perspective ${i + 1}`,
|
|
28
|
-
questions: [
|
|
29
|
-
`What are the key aspects of ${topic}?`,
|
|
30
|
-
`How does this relate to the overall problem?`,
|
|
31
|
-
`What are the potential implications?`
|
|
32
|
-
]
|
|
33
|
-
})),
|
|
34
|
-
status: 'success'
|
|
35
|
-
};
|
|
36
|
-
return {
|
|
37
|
-
content: [{ type: 'text', text: `Topic: ${topic}\nSteps: ${steps}\n\n${thinkingChain.chain.map(s => `${s.step}. ${s.title}\n ${s.content}\n Q: ${s.questions.join(', ')}`).join('\n\n')}` }]
|
|
38
|
-
};
|
|
39
|
-
}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
// Sequential thinking tool - completely independent
|
|
2
|
-
export const formatAsPlanDefinition = {
|
|
3
|
-
name: 'format_as_plan',
|
|
4
|
-
description: '계획으로|정리해줘|체크리스트|format as plan|make a plan|organize this|checklist - Format content into clear plans',
|
|
5
|
-
inputSchema: {
|
|
6
|
-
type: 'object',
|
|
7
|
-
properties: {
|
|
8
|
-
content: { type: 'string', description: 'Content to format as a plan' },
|
|
9
|
-
priority: { type: 'string', description: 'Default priority level', enum: ['high', 'medium', 'low'] },
|
|
10
|
-
includeTimeEstimates: { type: 'boolean', description: 'Include time estimates for each step' },
|
|
11
|
-
includeCheckboxes: { type: 'boolean', description: 'Include checkboxes for tracking progress' }
|
|
12
|
-
},
|
|
13
|
-
required: ['content']
|
|
14
|
-
},
|
|
15
|
-
annotations: {
|
|
16
|
-
title: 'Format as Plan',
|
|
17
|
-
audience: ['user', 'assistant']
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
export async function formatAsPlan(args) {
|
|
21
|
-
const { content: planContent, priority = 'medium', includeTimeEstimates = true, includeCheckboxes = true } = args;
|
|
22
|
-
// Parse content into actionable steps
|
|
23
|
-
const sentences = planContent.split(/[.!?]+/).filter(s => s.trim().length > 10);
|
|
24
|
-
const planSteps = sentences.map((sentence, index) => {
|
|
25
|
-
const stepNumber = index + 1;
|
|
26
|
-
const cleanSentence = sentence.trim();
|
|
27
|
-
// Estimate time based on content complexity
|
|
28
|
-
let timeEstimate = '5min';
|
|
29
|
-
if (cleanSentence.length > 100)
|
|
30
|
-
timeEstimate = '15min';
|
|
31
|
-
else if (cleanSentence.length > 50)
|
|
32
|
-
timeEstimate = '10min';
|
|
33
|
-
// Detect priority keywords
|
|
34
|
-
let stepPriority = priority;
|
|
35
|
-
if (cleanSentence.match(/urgent|critical|important|first|must/i))
|
|
36
|
-
stepPriority = 'high';
|
|
37
|
-
else if (cleanSentence.match(/later|eventually|nice|optional/i))
|
|
38
|
-
stepPriority = 'low';
|
|
39
|
-
// Format step
|
|
40
|
-
let formattedStep = includeCheckboxes ? `${stepNumber}. □ ` : `${stepNumber}. `;
|
|
41
|
-
formattedStep += cleanSentence;
|
|
42
|
-
if (includeTimeEstimates)
|
|
43
|
-
formattedStep += ` (${stepPriority.toUpperCase()}, ${timeEstimate})`;
|
|
44
|
-
return {
|
|
45
|
-
number: stepNumber,
|
|
46
|
-
content: cleanSentence,
|
|
47
|
-
priority: stepPriority,
|
|
48
|
-
timeEstimate,
|
|
49
|
-
formatted: formattedStep
|
|
50
|
-
};
|
|
51
|
-
});
|
|
52
|
-
// Calculate total time
|
|
53
|
-
const totalMinutes = planSteps.reduce((total, step) => {
|
|
54
|
-
const minutes = parseInt(step.timeEstimate.replace('min', ''));
|
|
55
|
-
return total + minutes;
|
|
56
|
-
}, 0);
|
|
57
|
-
const planResult = {
|
|
58
|
-
action: 'format_as_plan',
|
|
59
|
-
originalContent: planContent,
|
|
60
|
-
formattedPlan: planSteps.map((s) => s.formatted).join('\n'),
|
|
61
|
-
steps: planSteps.length,
|
|
62
|
-
totalEstimatedTime: `${totalMinutes} minutes`,
|
|
63
|
-
breakdown: {
|
|
64
|
-
high: planSteps.filter((s) => s.priority === 'high').length,
|
|
65
|
-
medium: planSteps.filter((s) => s.priority === 'medium').length,
|
|
66
|
-
low: planSteps.filter((s) => s.priority === 'low').length
|
|
67
|
-
},
|
|
68
|
-
status: 'success'
|
|
69
|
-
};
|
|
70
|
-
return {
|
|
71
|
-
content: [{ type: 'text', text: `${planResult.formattedPlan}\n\nTotal: ${planResult.totalEstimatedTime} | Priority: ${planResult.breakdown.high}H ${planResult.breakdown.medium}M ${planResult.breakdown.low}L` }]
|
|
72
|
-
};
|
|
73
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
// Sequential thinking tool - completely independent
|
|
2
|
-
export const stepByStepAnalysisDefinition = {
|
|
3
|
-
name: 'step_by_step_analysis',
|
|
4
|
-
description: '단계별|차근차근|하나씩|step by step|one by one|gradually - Perform detailed step-by-step analysis',
|
|
5
|
-
inputSchema: {
|
|
6
|
-
type: 'object',
|
|
7
|
-
properties: {
|
|
8
|
-
task: { type: 'string', description: 'Task to analyze step by step' },
|
|
9
|
-
context: { type: 'string', description: 'Additional context for the task' },
|
|
10
|
-
detailLevel: { type: 'string', description: 'Level of detail', enum: ['basic', 'detailed', 'comprehensive'] }
|
|
11
|
-
},
|
|
12
|
-
required: ['task']
|
|
13
|
-
},
|
|
14
|
-
annotations: {
|
|
15
|
-
title: 'Step-by-Step Analysis',
|
|
16
|
-
audience: ['user', 'assistant']
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
export async function stepByStepAnalysis(args) {
|
|
20
|
-
const { task, context = '', detailLevel = 'detailed' } = args;
|
|
21
|
-
const stepCount = detailLevel === 'basic' ? 3 : detailLevel === 'detailed' ? 5 : 7;
|
|
22
|
-
const stepAnalysis = {
|
|
23
|
-
action: 'step_by_step_analysis',
|
|
24
|
-
task,
|
|
25
|
-
context,
|
|
26
|
-
detailLevel,
|
|
27
|
-
steps: Array.from({ length: stepCount }, (_, i) => {
|
|
28
|
-
const stepNum = i + 1;
|
|
29
|
-
return {
|
|
30
|
-
stepNumber: stepNum,
|
|
31
|
-
title: `Step ${stepNum}: ${task} - Phase ${stepNum}`,
|
|
32
|
-
description: `Detailed analysis of ${task} in step ${stepNum}`,
|
|
33
|
-
actions: [
|
|
34
|
-
`Analyze requirements for step ${stepNum}`,
|
|
35
|
-
`Identify dependencies and prerequisites`,
|
|
36
|
-
`Execute the planned actions`,
|
|
37
|
-
`Validate results and check for issues`,
|
|
38
|
-
`Prepare for next step`
|
|
39
|
-
],
|
|
40
|
-
checkpoints: [
|
|
41
|
-
`Verify step ${stepNum} requirements are met`,
|
|
42
|
-
`Confirm outputs are as expected`,
|
|
43
|
-
`Check for any blocking issues`
|
|
44
|
-
],
|
|
45
|
-
estimatedTime: detailLevel === 'comprehensive' ? `${stepNum * 10} minutes` : `${stepNum * 5} minutes`
|
|
46
|
-
};
|
|
47
|
-
}),
|
|
48
|
-
summary: {
|
|
49
|
-
totalSteps: stepCount,
|
|
50
|
-
estimatedTotalTime: detailLevel === 'comprehensive' ? `${stepCount * 35} minutes` : `${stepCount * 20} minutes`,
|
|
51
|
-
complexity: detailLevel === 'basic' ? 'low' : detailLevel === 'detailed' ? 'medium' : 'high'
|
|
52
|
-
},
|
|
53
|
-
status: 'success'
|
|
54
|
-
};
|
|
55
|
-
return {
|
|
56
|
-
content: [{ type: 'text', text: `Task: ${task}\nDetail: ${detailLevel}\nSteps: ${stepCount}\n\n${stepAnalysis.steps.map(s => `Step ${s.stepNumber}: ${s.title}\n Time: ${s.estimatedTime}\n Actions: ${s.actions.join(', ')}\n Checkpoints: ${s.checkpoints.join(', ')}`).join('\n\n')}\n\nTotal Time: ${stepAnalysis.summary.estimatedTotalTime} | Complexity: ${stepAnalysis.summary.complexity}` }]
|
|
57
|
-
};
|
|
58
|
-
}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
// Sequential thinking tool - completely independent
|
|
2
|
-
export const thinkAloudProcessDefinition = {
|
|
3
|
-
name: 'think_aloud_process',
|
|
4
|
-
description: '생각해봐|고민해봐|어떻게 생각해|think about it|let me think|reasoning - Generate think-aloud reasoning process',
|
|
5
|
-
inputSchema: {
|
|
6
|
-
type: 'object',
|
|
7
|
-
properties: {
|
|
8
|
-
scenario: { type: 'string', description: 'Scenario or problem to think through' },
|
|
9
|
-
perspective: { type: 'string', description: 'Thinking perspective', enum: ['analytical', 'creative', 'systematic', 'critical'] },
|
|
10
|
-
verbosity: { type: 'string', description: 'Verbosity level', enum: ['concise', 'moderate', 'verbose'] }
|
|
11
|
-
},
|
|
12
|
-
required: ['scenario']
|
|
13
|
-
},
|
|
14
|
-
annotations: {
|
|
15
|
-
title: 'Think Aloud',
|
|
16
|
-
audience: ['user', 'assistant']
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
export async function thinkAloudProcess(args) {
|
|
20
|
-
const { scenario, perspective = 'analytical', verbosity = 'moderate' } = args;
|
|
21
|
-
const thoughtCount = verbosity === 'concise' ? 3 : verbosity === 'moderate' ? 5 : 8;
|
|
22
|
-
const thinkAloudProcess = {
|
|
23
|
-
action: 'think_aloud_process',
|
|
24
|
-
scenario,
|
|
25
|
-
perspective,
|
|
26
|
-
verbosity,
|
|
27
|
-
thoughtProcess: Array.from({ length: thoughtCount }, (_, i) => {
|
|
28
|
-
const thoughtNum = i + 1;
|
|
29
|
-
let thoughtStyle = '';
|
|
30
|
-
switch (perspective) {
|
|
31
|
-
case 'analytical':
|
|
32
|
-
thoughtStyle = `Analyzing: Let me examine ${scenario} systematically...`;
|
|
33
|
-
break;
|
|
34
|
-
case 'creative':
|
|
35
|
-
thoughtStyle = `Brainstorming: What if I approach ${scenario} differently...`;
|
|
36
|
-
break;
|
|
37
|
-
case 'systematic':
|
|
38
|
-
thoughtStyle = `Step ${thoughtNum}: Following systematic approach to ${scenario}...`;
|
|
39
|
-
break;
|
|
40
|
-
case 'critical':
|
|
41
|
-
thoughtStyle = `Questioning: What assumptions am I making about ${scenario}...`;
|
|
42
|
-
break;
|
|
43
|
-
}
|
|
44
|
-
return {
|
|
45
|
-
stepNumber: thoughtNum,
|
|
46
|
-
thought: thoughtStyle,
|
|
47
|
-
reasoning: `In step ${thoughtNum}, I need to consider the implications of ${scenario} from a ${perspective} perspective`,
|
|
48
|
-
questions: [
|
|
49
|
-
`What do I know about this aspect of ${scenario}?`,
|
|
50
|
-
`What don't I know yet?`,
|
|
51
|
-
`What should I explore next?`
|
|
52
|
-
],
|
|
53
|
-
conclusions: [
|
|
54
|
-
`Based on current analysis...`,
|
|
55
|
-
`This leads me to think that...`,
|
|
56
|
-
`Next I should focus on...`
|
|
57
|
-
],
|
|
58
|
-
confidence: Math.min(95, 60 + (thoughtNum * 5))
|
|
59
|
-
};
|
|
60
|
-
}),
|
|
61
|
-
metacognition: {
|
|
62
|
-
thinkingStyle: perspective,
|
|
63
|
-
processEffectiveness: verbosity === 'verbose' ? 'highly detailed' : verbosity === 'moderate' ? 'balanced' : 'efficient',
|
|
64
|
-
nextSteps: [
|
|
65
|
-
'Review thinking process for gaps',
|
|
66
|
-
'Validate conclusions against evidence',
|
|
67
|
-
'Plan concrete actions based on analysis'
|
|
68
|
-
]
|
|
69
|
-
},
|
|
70
|
-
status: 'success'
|
|
71
|
-
};
|
|
72
|
-
return {
|
|
73
|
-
content: [{ type: 'text', text: `Scenario: ${scenario}\nPerspective: ${perspective}\nThoughts: ${thoughtCount}\n${thinkAloudProcess.thoughtProcess.map((t, i) => `${i + 1}. ${t.thought} (confidence: ${t.confidence}%)`).join('\n')}\n\nNext: ${thinkAloudProcess.metacognition.nextSteps.join(', ')}` }]
|
|
74
|
-
};
|
|
75
|
-
}
|