vibe-coding-mcp 2.3.0
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 +179 -0
- package/dist/__tests__/collectCodeContext.test.d.ts +2 -0
- package/dist/__tests__/collectCodeContext.test.d.ts.map +1 -0
- package/dist/__tests__/collectCodeContext.test.js +139 -0
- package/dist/__tests__/collectCodeContext.test.js.map +1 -0
- package/dist/__tests__/createSessionLog.test.d.ts +2 -0
- package/dist/__tests__/createSessionLog.test.d.ts.map +1 -0
- package/dist/__tests__/createSessionLog.test.js +130 -0
- package/dist/__tests__/createSessionLog.test.js.map +1 -0
- package/dist/__tests__/generateDevDocument.test.d.ts +2 -0
- package/dist/__tests__/generateDevDocument.test.d.ts.map +1 -0
- package/dist/__tests__/generateDevDocument.test.js +174 -0
- package/dist/__tests__/generateDevDocument.test.js.map +1 -0
- package/dist/__tests__/normalizeForPlatform.test.d.ts +2 -0
- package/dist/__tests__/normalizeForPlatform.test.d.ts.map +1 -0
- package/dist/__tests__/normalizeForPlatform.test.js +171 -0
- package/dist/__tests__/normalizeForPlatform.test.js.map +1 -0
- package/dist/__tests__/publishDocument.test.d.ts +2 -0
- package/dist/__tests__/publishDocument.test.d.ts.map +1 -0
- package/dist/__tests__/publishDocument.test.js +93 -0
- package/dist/__tests__/publishDocument.test.js.map +1 -0
- package/dist/__tests__/summarizeDesignDecisions.test.d.ts +2 -0
- package/dist/__tests__/summarizeDesignDecisions.test.d.ts.map +1 -0
- package/dist/__tests__/summarizeDesignDecisions.test.js +158 -0
- package/dist/__tests__/summarizeDesignDecisions.test.js.map +1 -0
- package/dist/core/cache.d.ts +39 -0
- package/dist/core/cache.d.ts.map +1 -0
- package/dist/core/cache.js +112 -0
- package/dist/core/cache.js.map +1 -0
- package/dist/core/config.d.ts +30 -0
- package/dist/core/config.d.ts.map +1 -0
- package/dist/core/config.js +90 -0
- package/dist/core/config.js.map +1 -0
- package/dist/core/errors.d.ts +52 -0
- package/dist/core/errors.d.ts.map +1 -0
- package/dist/core/errors.js +99 -0
- package/dist/core/errors.js.map +1 -0
- package/dist/core/logger.d.ts +57 -0
- package/dist/core/logger.d.ts.map +1 -0
- package/dist/core/logger.js +114 -0
- package/dist/core/logger.js.map +1 -0
- package/dist/core/schemas.d.ts +690 -0
- package/dist/core/schemas.d.ts.map +1 -0
- package/dist/core/schemas.js +136 -0
- package/dist/core/schemas.js.map +1 -0
- package/dist/core/security.d.ts +28 -0
- package/dist/core/security.d.ts.map +1 -0
- package/dist/core/security.js +103 -0
- package/dist/core/security.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +168 -0
- package/dist/index.js.map +1 -0
- package/dist/platforms/confluence.d.ts +13 -0
- package/dist/platforms/confluence.d.ts.map +1 -0
- package/dist/platforms/confluence.js +178 -0
- package/dist/platforms/confluence.js.map +1 -0
- package/dist/platforms/discord.d.ts +54 -0
- package/dist/platforms/discord.d.ts.map +1 -0
- package/dist/platforms/discord.js +176 -0
- package/dist/platforms/discord.js.map +1 -0
- package/dist/platforms/github-wiki.d.ts +3 -0
- package/dist/platforms/github-wiki.d.ts.map +1 -0
- package/dist/platforms/github-wiki.js +120 -0
- package/dist/platforms/github-wiki.js.map +1 -0
- package/dist/platforms/notion.d.ts +3 -0
- package/dist/platforms/notion.d.ts.map +1 -0
- package/dist/platforms/notion.js +205 -0
- package/dist/platforms/notion.js.map +1 -0
- package/dist/platforms/obsidian.d.ts +3 -0
- package/dist/platforms/obsidian.d.ts.map +1 -0
- package/dist/platforms/obsidian.js +43 -0
- package/dist/platforms/obsidian.js.map +1 -0
- package/dist/platforms/slack.d.ts +21 -0
- package/dist/platforms/slack.d.ts.map +1 -0
- package/dist/platforms/slack.js +217 -0
- package/dist/platforms/slack.js.map +1 -0
- package/dist/stdio.d.ts +6 -0
- package/dist/stdio.d.ts.map +1 -0
- package/dist/stdio.js +98 -0
- package/dist/stdio.js.map +1 -0
- package/dist/tools/analyzeCode.d.ts +65 -0
- package/dist/tools/analyzeCode.d.ts.map +1 -0
- package/dist/tools/analyzeCode.js +113 -0
- package/dist/tools/analyzeCode.js.map +1 -0
- package/dist/tools/collectCodeContext.d.ts +86 -0
- package/dist/tools/collectCodeContext.d.ts.map +1 -0
- package/dist/tools/collectCodeContext.js +275 -0
- package/dist/tools/collectCodeContext.js.map +1 -0
- package/dist/tools/createSessionLog.d.ts +79 -0
- package/dist/tools/createSessionLog.d.ts.map +1 -0
- package/dist/tools/createSessionLog.js +160 -0
- package/dist/tools/createSessionLog.js.map +1 -0
- package/dist/tools/generateDevDocument.d.ts +216 -0
- package/dist/tools/generateDevDocument.d.ts.map +1 -0
- package/dist/tools/generateDevDocument.js +659 -0
- package/dist/tools/generateDevDocument.js.map +1 -0
- package/dist/tools/normalizeForPlatform.d.ts +95 -0
- package/dist/tools/normalizeForPlatform.d.ts.map +1 -0
- package/dist/tools/normalizeForPlatform.js +340 -0
- package/dist/tools/normalizeForPlatform.js.map +1 -0
- package/dist/tools/publishDocument.d.ts +60 -0
- package/dist/tools/publishDocument.d.ts.map +1 -0
- package/dist/tools/publishDocument.js +117 -0
- package/dist/tools/publishDocument.js.map +1 -0
- package/dist/tools/summarizeDesignDecisions.d.ts +82 -0
- package/dist/tools/summarizeDesignDecisions.d.ts.map +1 -0
- package/dist/tools/summarizeDesignDecisions.js +361 -0
- package/dist/tools/summarizeDesignDecisions.js.map +1 -0
- package/dist/types/index.d.ts +63 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/astParser.d.ts +55 -0
- package/dist/utils/astParser.d.ts.map +1 -0
- package/dist/utils/astParser.js +333 -0
- package/dist/utils/astParser.js.map +1 -0
- package/dist/utils/i18n.d.ts +67 -0
- package/dist/utils/i18n.d.ts.map +1 -0
- package/dist/utils/i18n.js +193 -0
- package/dist/utils/i18n.js.map +1 -0
- package/dist/utils/markdown.d.ts +9 -0
- package/dist/utils/markdown.d.ts.map +1 -0
- package/dist/utils/markdown.js +99 -0
- package/dist/utils/markdown.js.map +1 -0
- package/dist/utils/mermaidGenerator.d.ts +69 -0
- package/dist/utils/mermaidGenerator.d.ts.map +1 -0
- package/dist/utils/mermaidGenerator.js +315 -0
- package/dist/utils/mermaidGenerator.js.map +1 -0
- package/package.json +66 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 코드 분석 도구
|
|
3
|
+
* AST 파싱을 통한 고급 코드 분석 및 다이어그램 생성
|
|
4
|
+
*/
|
|
5
|
+
import { CodeAnalysis } from '../utils/astParser.js';
|
|
6
|
+
export interface AnalyzeCodeInput {
|
|
7
|
+
code: string;
|
|
8
|
+
language?: string;
|
|
9
|
+
filename?: string;
|
|
10
|
+
generateDiagrams?: boolean;
|
|
11
|
+
diagramTypes?: ('class' | 'flowchart' | 'dependency' | 'all')[];
|
|
12
|
+
}
|
|
13
|
+
export interface AnalyzeCodeOutput {
|
|
14
|
+
analysis: CodeAnalysis;
|
|
15
|
+
diagrams?: {
|
|
16
|
+
type: string;
|
|
17
|
+
diagram: string;
|
|
18
|
+
}[];
|
|
19
|
+
summary: {
|
|
20
|
+
totalFunctions: number;
|
|
21
|
+
totalClasses: number;
|
|
22
|
+
totalImports: number;
|
|
23
|
+
complexity: number;
|
|
24
|
+
exportedItems: number;
|
|
25
|
+
dependencies: string[];
|
|
26
|
+
};
|
|
27
|
+
insights: string[];
|
|
28
|
+
}
|
|
29
|
+
export declare function analyzeCodeTool(input: AnalyzeCodeInput): AnalyzeCodeOutput;
|
|
30
|
+
export declare const analyzeCodeSchema: {
|
|
31
|
+
name: string;
|
|
32
|
+
description: string;
|
|
33
|
+
inputSchema: {
|
|
34
|
+
type: string;
|
|
35
|
+
properties: {
|
|
36
|
+
code: {
|
|
37
|
+
type: string;
|
|
38
|
+
description: string;
|
|
39
|
+
};
|
|
40
|
+
language: {
|
|
41
|
+
type: string;
|
|
42
|
+
enum: string[];
|
|
43
|
+
description: string;
|
|
44
|
+
};
|
|
45
|
+
filename: {
|
|
46
|
+
type: string;
|
|
47
|
+
description: string;
|
|
48
|
+
};
|
|
49
|
+
generateDiagrams: {
|
|
50
|
+
type: string;
|
|
51
|
+
description: string;
|
|
52
|
+
};
|
|
53
|
+
diagramTypes: {
|
|
54
|
+
type: string;
|
|
55
|
+
items: {
|
|
56
|
+
type: string;
|
|
57
|
+
enum: string[];
|
|
58
|
+
};
|
|
59
|
+
description: string;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
required: string[];
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
//# sourceMappingURL=analyzeCode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analyzeCode.d.ts","sourceRoot":"","sources":["../../src/tools/analyzeCode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAe,YAAY,EAAE,MAAM,uBAAuB,CAAC;AASlE,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,YAAY,CAAC,EAAE,CAAC,OAAO,GAAG,WAAW,GAAG,YAAY,GAAG,KAAK,CAAC,EAAE,CAAC;CACjE;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,YAAY,CAAC;IACvB,QAAQ,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC/C,OAAO,EAAE;QACP,cAAc,EAAE,MAAM,CAAC;QACvB,YAAY,EAAE,MAAM,CAAC;QACrB,YAAY,EAAE,MAAM,CAAC;QACrB,UAAU,EAAE,MAAM,CAAC;QACnB,aAAa,EAAE,MAAM,CAAC;QACtB,YAAY,EAAE,MAAM,EAAE,CAAC;KACxB,CAAC;IACF,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,gBAAgB,GAAG,iBAAiB,CAkF1E;AAED,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkC7B,CAAC"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 코드 분석 도구
|
|
3
|
+
* AST 파싱을 통한 고급 코드 분석 및 다이어그램 생성
|
|
4
|
+
*/
|
|
5
|
+
import { analyzeCode } from '../utils/astParser.js';
|
|
6
|
+
import { generateClassDiagram, generateFlowchart, generateDependencyGraph } from '../utils/mermaidGenerator.js';
|
|
7
|
+
export function analyzeCodeTool(input) {
|
|
8
|
+
const { code, language, filename = 'unknown', generateDiagrams = true, diagramTypes = ['all'] } = input;
|
|
9
|
+
// AST 분석 수행
|
|
10
|
+
const analysis = analyzeCode(code, language);
|
|
11
|
+
// 요약 생성
|
|
12
|
+
const summary = {
|
|
13
|
+
totalFunctions: analysis.functions.length,
|
|
14
|
+
totalClasses: analysis.classes.length,
|
|
15
|
+
totalImports: analysis.imports.length,
|
|
16
|
+
complexity: analysis.complexity,
|
|
17
|
+
exportedItems: analysis.exports.length,
|
|
18
|
+
dependencies: analysis.dependencies
|
|
19
|
+
};
|
|
20
|
+
// 인사이트 생성
|
|
21
|
+
const insights = [];
|
|
22
|
+
// 복잡도 분석
|
|
23
|
+
if (analysis.complexity > 20) {
|
|
24
|
+
insights.push(`High complexity (${analysis.complexity}): Consider breaking down into smaller functions`);
|
|
25
|
+
}
|
|
26
|
+
else if (analysis.complexity > 10) {
|
|
27
|
+
insights.push(`Moderate complexity (${analysis.complexity}): Code is reasonably structured`);
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
insights.push(`Low complexity (${analysis.complexity}): Code is simple and easy to maintain`);
|
|
31
|
+
}
|
|
32
|
+
// 함수 분석
|
|
33
|
+
const asyncFunctions = analysis.functions.filter(f => f.async);
|
|
34
|
+
if (asyncFunctions.length > 0) {
|
|
35
|
+
insights.push(`Found ${asyncFunctions.length} async function(s): ${asyncFunctions.map(f => f.name).join(', ')}`);
|
|
36
|
+
}
|
|
37
|
+
// 클래스 분석
|
|
38
|
+
const exportedClasses = analysis.classes.filter(c => c.exported);
|
|
39
|
+
if (exportedClasses.length > 0) {
|
|
40
|
+
insights.push(`Exported ${exportedClasses.length} class(es): ${exportedClasses.map(c => c.name).join(', ')}`);
|
|
41
|
+
}
|
|
42
|
+
// 의존성 분석
|
|
43
|
+
if (analysis.dependencies.length > 10) {
|
|
44
|
+
insights.push(`High dependency count (${analysis.dependencies.length}): Consider reducing external dependencies`);
|
|
45
|
+
}
|
|
46
|
+
// 다이어그램 생성
|
|
47
|
+
let diagrams;
|
|
48
|
+
if (generateDiagrams) {
|
|
49
|
+
diagrams = [];
|
|
50
|
+
const shouldGenerate = (type) => diagramTypes.includes('all') || diagramTypes.includes(type);
|
|
51
|
+
if (shouldGenerate('class') && analysis.classes.length > 0) {
|
|
52
|
+
diagrams.push({
|
|
53
|
+
type: 'class',
|
|
54
|
+
diagram: generateClassDiagram(analysis.classes)
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
if (shouldGenerate('flowchart') && analysis.functions.length > 0) {
|
|
58
|
+
diagrams.push({
|
|
59
|
+
type: 'flowchart',
|
|
60
|
+
diagram: generateFlowchart(analysis.functions)
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
if (shouldGenerate('dependency') && analysis.imports.length > 0) {
|
|
64
|
+
const depAnalyses = [{ filename, analysis }];
|
|
65
|
+
diagrams.push({
|
|
66
|
+
type: 'dependency',
|
|
67
|
+
diagram: generateDependencyGraph(depAnalyses)
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return {
|
|
72
|
+
analysis,
|
|
73
|
+
diagrams,
|
|
74
|
+
summary,
|
|
75
|
+
insights
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
export const analyzeCodeSchema = {
|
|
79
|
+
name: 'muse_analyze_code',
|
|
80
|
+
description: 'Performs deep code analysis using AST parsing. Extracts functions, classes, imports, and generates Mermaid diagrams for visualization.',
|
|
81
|
+
inputSchema: {
|
|
82
|
+
type: 'object',
|
|
83
|
+
properties: {
|
|
84
|
+
code: {
|
|
85
|
+
type: 'string',
|
|
86
|
+
description: 'The source code to analyze'
|
|
87
|
+
},
|
|
88
|
+
language: {
|
|
89
|
+
type: 'string',
|
|
90
|
+
enum: ['typescript', 'javascript', 'python', 'go'],
|
|
91
|
+
description: 'Programming language (auto-detected if not provided)'
|
|
92
|
+
},
|
|
93
|
+
filename: {
|
|
94
|
+
type: 'string',
|
|
95
|
+
description: 'Optional filename for context'
|
|
96
|
+
},
|
|
97
|
+
generateDiagrams: {
|
|
98
|
+
type: 'boolean',
|
|
99
|
+
description: 'Generate Mermaid diagrams (default: true)'
|
|
100
|
+
},
|
|
101
|
+
diagramTypes: {
|
|
102
|
+
type: 'array',
|
|
103
|
+
items: {
|
|
104
|
+
type: 'string',
|
|
105
|
+
enum: ['class', 'flowchart', 'dependency', 'all']
|
|
106
|
+
},
|
|
107
|
+
description: 'Types of diagrams to generate (default: all)'
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
required: ['code']
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
//# sourceMappingURL=analyzeCode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analyzeCode.js","sourceRoot":"","sources":["../../src/tools/analyzeCode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAgB,MAAM,uBAAuB,CAAC;AAClE,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EAEjB,uBAAuB,EAExB,MAAM,8BAA8B,CAAC;AAwBtC,MAAM,UAAU,eAAe,CAAC,KAAuB;IACrD,MAAM,EAAE,IAAI,EAAE,QAAQ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YAAY,EAAE,KAAK,CAAC;iBAClD;gBACD,WAAW,EAAE,8CAA8C;aAC5D;SACF;QACD,QAAQ,EAAE,CAAC,MAAM,CAAC;KACnB;CACF,CAAC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { CodeBlock, CodeContext } from '../types/index.js';
|
|
2
|
+
export interface CollectCodeContextInput {
|
|
3
|
+
codeBlocks?: CodeBlock[];
|
|
4
|
+
rawText?: string;
|
|
5
|
+
conversationSummary: string;
|
|
6
|
+
tags?: string[];
|
|
7
|
+
autoDetectLanguage?: boolean;
|
|
8
|
+
removeDuplicates?: boolean;
|
|
9
|
+
includeStats?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface CodeStats {
|
|
12
|
+
totalBlocks: number;
|
|
13
|
+
totalLines: number;
|
|
14
|
+
languageBreakdown: Record<string, number>;
|
|
15
|
+
averageLinesPerBlock: number;
|
|
16
|
+
}
|
|
17
|
+
export interface CollectCodeContextOutput {
|
|
18
|
+
context: CodeContext;
|
|
19
|
+
stats?: CodeStats;
|
|
20
|
+
warnings?: string[];
|
|
21
|
+
}
|
|
22
|
+
export declare function collectCodeContext(input: CollectCodeContextInput): CollectCodeContextOutput;
|
|
23
|
+
export declare const collectCodeContextSchema: {
|
|
24
|
+
name: string;
|
|
25
|
+
description: string;
|
|
26
|
+
inputSchema: {
|
|
27
|
+
type: string;
|
|
28
|
+
properties: {
|
|
29
|
+
codeBlocks: {
|
|
30
|
+
type: string;
|
|
31
|
+
description: string;
|
|
32
|
+
items: {
|
|
33
|
+
type: string;
|
|
34
|
+
properties: {
|
|
35
|
+
language: {
|
|
36
|
+
type: string;
|
|
37
|
+
description: string;
|
|
38
|
+
};
|
|
39
|
+
code: {
|
|
40
|
+
type: string;
|
|
41
|
+
description: string;
|
|
42
|
+
};
|
|
43
|
+
filename: {
|
|
44
|
+
type: string;
|
|
45
|
+
description: string;
|
|
46
|
+
};
|
|
47
|
+
description: {
|
|
48
|
+
type: string;
|
|
49
|
+
description: string;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
required: string[];
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
rawText: {
|
|
56
|
+
type: string;
|
|
57
|
+
description: string;
|
|
58
|
+
};
|
|
59
|
+
conversationSummary: {
|
|
60
|
+
type: string;
|
|
61
|
+
description: string;
|
|
62
|
+
};
|
|
63
|
+
tags: {
|
|
64
|
+
type: string;
|
|
65
|
+
items: {
|
|
66
|
+
type: string;
|
|
67
|
+
};
|
|
68
|
+
description: string;
|
|
69
|
+
};
|
|
70
|
+
autoDetectLanguage: {
|
|
71
|
+
type: string;
|
|
72
|
+
description: string;
|
|
73
|
+
};
|
|
74
|
+
removeDuplicates: {
|
|
75
|
+
type: string;
|
|
76
|
+
description: string;
|
|
77
|
+
};
|
|
78
|
+
includeStats: {
|
|
79
|
+
type: string;
|
|
80
|
+
description: string;
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
required: string[];
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
//# sourceMappingURL=collectCodeContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collectCodeContext.d.ts","sourceRoot":"","sources":["../../src/tools/collectCodeContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAI3D,MAAM,WAAW,uBAAuB;IACtC,UAAU,CAAC,EAAE,SAAS,EAAE,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,SAAS;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1C,oBAAoB,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,WAAW,wBAAwB;IACvC,OAAO,EAAE,WAAW,CAAC;IACrB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AA6LD,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,GAAG,wBAAwB,CA2D3F;AAED,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgDpC,CAAC"}
|
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
import { generateId, getCurrentTimestamp, extractCodeBlocks } from '../utils/markdown.js';
|
|
2
|
+
import { hashCode } from '../core/cache.js';
|
|
3
|
+
// 언어 감지를 위한 패턴
|
|
4
|
+
const languagePatterns = {
|
|
5
|
+
typescript: [
|
|
6
|
+
/^import\s+.*\s+from\s+['"].*['"];?$/m,
|
|
7
|
+
/:\s*(string|number|boolean|any|void|never)\b/,
|
|
8
|
+
/interface\s+\w+/,
|
|
9
|
+
/type\s+\w+\s*=/,
|
|
10
|
+
/<\w+>/
|
|
11
|
+
],
|
|
12
|
+
javascript: [
|
|
13
|
+
/^const\s+\w+\s*=/m,
|
|
14
|
+
/^let\s+\w+\s*=/m,
|
|
15
|
+
/^function\s+\w+\s*\(/m,
|
|
16
|
+
/=>\s*{/,
|
|
17
|
+
/require\s*\(/
|
|
18
|
+
],
|
|
19
|
+
python: [
|
|
20
|
+
/^def\s+\w+\s*\(/m,
|
|
21
|
+
/^class\s+\w+.*:/m,
|
|
22
|
+
/^import\s+\w+$/m,
|
|
23
|
+
/^from\s+\w+\s+import/m,
|
|
24
|
+
/:\s*$/m
|
|
25
|
+
],
|
|
26
|
+
java: [
|
|
27
|
+
/public\s+(class|interface|enum)/,
|
|
28
|
+
/private\s+\w+\s+\w+;/,
|
|
29
|
+
/System\.out\.println/,
|
|
30
|
+
/@Override/
|
|
31
|
+
],
|
|
32
|
+
go: [
|
|
33
|
+
/^package\s+\w+$/m,
|
|
34
|
+
/^func\s+\w+\s*\(/m,
|
|
35
|
+
/^import\s+\(/m,
|
|
36
|
+
/:=\s*/
|
|
37
|
+
],
|
|
38
|
+
rust: [
|
|
39
|
+
/^fn\s+\w+/m,
|
|
40
|
+
/^use\s+\w+/m,
|
|
41
|
+
/^let\s+mut\s+/m,
|
|
42
|
+
/impl\s+\w+/,
|
|
43
|
+
/->.*{$/m
|
|
44
|
+
],
|
|
45
|
+
sql: [
|
|
46
|
+
/^SELECT\s+/im,
|
|
47
|
+
/^INSERT\s+INTO/im,
|
|
48
|
+
/^CREATE\s+TABLE/im,
|
|
49
|
+
/^UPDATE\s+\w+\s+SET/im
|
|
50
|
+
],
|
|
51
|
+
html: [
|
|
52
|
+
/^<!DOCTYPE\s+html>/i,
|
|
53
|
+
/<html.*>/i,
|
|
54
|
+
/<div.*>/i,
|
|
55
|
+
/<\/\w+>/
|
|
56
|
+
],
|
|
57
|
+
css: [
|
|
58
|
+
/^\s*\.\w+\s*{/m,
|
|
59
|
+
/^\s*#\w+\s*{/m,
|
|
60
|
+
/:\s*(flex|grid|block|none);/,
|
|
61
|
+
/@media\s+/
|
|
62
|
+
],
|
|
63
|
+
json: [
|
|
64
|
+
/^\s*{\s*".*":/m,
|
|
65
|
+
/^\s*\[\s*{/m
|
|
66
|
+
],
|
|
67
|
+
yaml: [
|
|
68
|
+
/^\w+:\s*$/m,
|
|
69
|
+
/^\s+-\s+\w+:/m
|
|
70
|
+
],
|
|
71
|
+
bash: [
|
|
72
|
+
/^#!/,
|
|
73
|
+
/^\s*echo\s+/m,
|
|
74
|
+
/\$\{?\w+\}?/,
|
|
75
|
+
/^\s*if\s+\[/m
|
|
76
|
+
],
|
|
77
|
+
markdown: [
|
|
78
|
+
/^#\s+/m,
|
|
79
|
+
/^\*\*.*\*\*/m,
|
|
80
|
+
/^\[.*\]\(.*\)/m
|
|
81
|
+
]
|
|
82
|
+
};
|
|
83
|
+
// 언어 자동 감지
|
|
84
|
+
function detectLanguage(code) {
|
|
85
|
+
const scores = {};
|
|
86
|
+
for (const [lang, patterns] of Object.entries(languagePatterns)) {
|
|
87
|
+
scores[lang] = 0;
|
|
88
|
+
for (const pattern of patterns) {
|
|
89
|
+
if (pattern.test(code)) {
|
|
90
|
+
scores[lang]++;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
const maxScore = Math.max(...Object.values(scores));
|
|
95
|
+
if (maxScore === 0)
|
|
96
|
+
return 'text';
|
|
97
|
+
const detectedLang = Object.entries(scores).find(([, score]) => score === maxScore);
|
|
98
|
+
return detectedLang ? detectedLang[0] : 'text';
|
|
99
|
+
}
|
|
100
|
+
// 파일명 추론
|
|
101
|
+
function inferFilename(code, language) {
|
|
102
|
+
const extensions = {
|
|
103
|
+
typescript: '.ts',
|
|
104
|
+
javascript: '.js',
|
|
105
|
+
python: '.py',
|
|
106
|
+
java: '.java',
|
|
107
|
+
go: '.go',
|
|
108
|
+
rust: '.rs',
|
|
109
|
+
sql: '.sql',
|
|
110
|
+
html: '.html',
|
|
111
|
+
css: '.css',
|
|
112
|
+
json: '.json',
|
|
113
|
+
yaml: '.yaml',
|
|
114
|
+
bash: '.sh',
|
|
115
|
+
markdown: '.md'
|
|
116
|
+
};
|
|
117
|
+
// 클래스나 함수명에서 파일명 추론
|
|
118
|
+
const classMatch = code.match(/(?:class|interface)\s+(\w+)/);
|
|
119
|
+
if (classMatch) {
|
|
120
|
+
return classMatch[1] + (extensions[language] || '.txt');
|
|
121
|
+
}
|
|
122
|
+
const funcMatch = code.match(/(?:function|def|fn|func)\s+(\w+)/);
|
|
123
|
+
if (funcMatch) {
|
|
124
|
+
return funcMatch[1] + (extensions[language] || '.txt');
|
|
125
|
+
}
|
|
126
|
+
return undefined;
|
|
127
|
+
}
|
|
128
|
+
// 중복 제거
|
|
129
|
+
function removeDuplicateBlocks(blocks) {
|
|
130
|
+
const seen = new Set();
|
|
131
|
+
return blocks.filter(block => {
|
|
132
|
+
const hash = hashCode(block.code);
|
|
133
|
+
if (seen.has(hash))
|
|
134
|
+
return false;
|
|
135
|
+
seen.add(hash);
|
|
136
|
+
return true;
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
// 통계 계산
|
|
140
|
+
function calculateStats(blocks) {
|
|
141
|
+
const languageBreakdown = {};
|
|
142
|
+
let totalLines = 0;
|
|
143
|
+
for (const block of blocks) {
|
|
144
|
+
const lines = block.code.split('\n').length;
|
|
145
|
+
totalLines += lines;
|
|
146
|
+
languageBreakdown[block.language] = (languageBreakdown[block.language] || 0) + 1;
|
|
147
|
+
}
|
|
148
|
+
return {
|
|
149
|
+
totalBlocks: blocks.length,
|
|
150
|
+
totalLines,
|
|
151
|
+
languageBreakdown,
|
|
152
|
+
averageLinesPerBlock: blocks.length > 0 ? Math.round(totalLines / blocks.length) : 0
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
// 입력 검증
|
|
156
|
+
function validateInput(input) {
|
|
157
|
+
const warnings = [];
|
|
158
|
+
if (!input.conversationSummary || input.conversationSummary.trim().length === 0) {
|
|
159
|
+
warnings.push('Conversation summary is empty');
|
|
160
|
+
}
|
|
161
|
+
if (!input.codeBlocks && !input.rawText) {
|
|
162
|
+
warnings.push('No code blocks or raw text provided');
|
|
163
|
+
}
|
|
164
|
+
if (input.codeBlocks) {
|
|
165
|
+
for (let i = 0; i < input.codeBlocks.length; i++) {
|
|
166
|
+
const block = input.codeBlocks[i];
|
|
167
|
+
if (!block.code || block.code.trim().length === 0) {
|
|
168
|
+
warnings.push(`Code block ${i + 1} is empty`);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
return warnings;
|
|
173
|
+
}
|
|
174
|
+
export function collectCodeContext(input) {
|
|
175
|
+
const warnings = validateInput(input);
|
|
176
|
+
let blocks = [];
|
|
177
|
+
// 직접 제공된 코드 블록이 있으면 사용
|
|
178
|
+
if (input.codeBlocks && input.codeBlocks.length > 0) {
|
|
179
|
+
blocks = input.codeBlocks.map(block => ({
|
|
180
|
+
...block,
|
|
181
|
+
language: block.language || (input.autoDetectLanguage !== false ? detectLanguage(block.code) : 'text'),
|
|
182
|
+
filename: block.filename || inferFilename(block.code, block.language || 'text')
|
|
183
|
+
}));
|
|
184
|
+
}
|
|
185
|
+
// rawText가 있으면 코드 블록 추출
|
|
186
|
+
else if (input.rawText) {
|
|
187
|
+
const extracted = extractCodeBlocks(input.rawText);
|
|
188
|
+
blocks = extracted.map(block => ({
|
|
189
|
+
...block,
|
|
190
|
+
language: block.language || (input.autoDetectLanguage !== false ? detectLanguage(block.code) : 'text'),
|
|
191
|
+
filename: block.filename || inferFilename(block.code, block.language || 'text')
|
|
192
|
+
}));
|
|
193
|
+
}
|
|
194
|
+
// 중복 제거
|
|
195
|
+
if (input.removeDuplicates !== false && blocks.length > 0) {
|
|
196
|
+
const originalCount = blocks.length;
|
|
197
|
+
blocks = removeDuplicateBlocks(blocks);
|
|
198
|
+
if (blocks.length < originalCount) {
|
|
199
|
+
warnings.push(`Removed ${originalCount - blocks.length} duplicate code block(s)`);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
// 태그 자동 추출 (언어 기반)
|
|
203
|
+
const autoTags = new Set(input.tags || []);
|
|
204
|
+
for (const block of blocks) {
|
|
205
|
+
if (block.language && block.language !== 'text') {
|
|
206
|
+
autoTags.add(block.language);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
const context = {
|
|
210
|
+
sessionId: generateId(),
|
|
211
|
+
timestamp: getCurrentTimestamp(),
|
|
212
|
+
codeBlocks: blocks,
|
|
213
|
+
conversationSummary: input.conversationSummary?.trim() || '',
|
|
214
|
+
tags: Array.from(autoTags)
|
|
215
|
+
};
|
|
216
|
+
const result = { context };
|
|
217
|
+
// 통계 포함
|
|
218
|
+
if (input.includeStats !== false && blocks.length > 0) {
|
|
219
|
+
result.stats = calculateStats(blocks);
|
|
220
|
+
}
|
|
221
|
+
if (warnings.length > 0) {
|
|
222
|
+
result.warnings = warnings;
|
|
223
|
+
}
|
|
224
|
+
return result;
|
|
225
|
+
}
|
|
226
|
+
export const collectCodeContextSchema = {
|
|
227
|
+
name: 'muse_collect_code_context',
|
|
228
|
+
description: 'Collects code blocks and conversation summaries into a structured context for documentation. Supports automatic language detection, duplicate removal, and statistics.',
|
|
229
|
+
inputSchema: {
|
|
230
|
+
type: 'object',
|
|
231
|
+
properties: {
|
|
232
|
+
codeBlocks: {
|
|
233
|
+
type: 'array',
|
|
234
|
+
description: 'Array of code blocks with language and code content',
|
|
235
|
+
items: {
|
|
236
|
+
type: 'object',
|
|
237
|
+
properties: {
|
|
238
|
+
language: { type: 'string', description: 'Programming language (auto-detected if not provided)' },
|
|
239
|
+
code: { type: 'string', description: 'Code content' },
|
|
240
|
+
filename: { type: 'string', description: 'Optional filename (auto-inferred if not provided)' },
|
|
241
|
+
description: { type: 'string', description: 'Optional description of the code' }
|
|
242
|
+
},
|
|
243
|
+
required: ['code']
|
|
244
|
+
}
|
|
245
|
+
},
|
|
246
|
+
rawText: {
|
|
247
|
+
type: 'string',
|
|
248
|
+
description: 'Raw text containing code blocks to extract (alternative to codeBlocks)'
|
|
249
|
+
},
|
|
250
|
+
conversationSummary: {
|
|
251
|
+
type: 'string',
|
|
252
|
+
description: 'Summary of the conversation or context'
|
|
253
|
+
},
|
|
254
|
+
tags: {
|
|
255
|
+
type: 'array',
|
|
256
|
+
items: { type: 'string' },
|
|
257
|
+
description: 'Optional tags for categorization (language tags auto-added)'
|
|
258
|
+
},
|
|
259
|
+
autoDetectLanguage: {
|
|
260
|
+
type: 'boolean',
|
|
261
|
+
description: 'Automatically detect programming language (default: true)'
|
|
262
|
+
},
|
|
263
|
+
removeDuplicates: {
|
|
264
|
+
type: 'boolean',
|
|
265
|
+
description: 'Remove duplicate code blocks (default: true)'
|
|
266
|
+
},
|
|
267
|
+
includeStats: {
|
|
268
|
+
type: 'boolean',
|
|
269
|
+
description: 'Include code statistics in output (default: true)'
|
|
270
|
+
}
|
|
271
|
+
},
|
|
272
|
+
required: ['conversationSummary']
|
|
273
|
+
}
|
|
274
|
+
};
|
|
275
|
+
//# sourceMappingURL=collectCodeContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collectCodeContext.js","sourceRoot":"","sources":["../../src/tools/collectCodeContext.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC1F,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAyB5C,eAAe;AACf,MAAM,gBAAgB,GAA6B;IACjD,UAAU,EAAE;QACV,sCAAsC;QACtC,8CAA8C;QAC9C,iBAAiB;QACjB,gBAAgB;QAChB,OAAO;KACR;IACD,UAAU,EAAE;QACV,mBAAmB;QACnB,iBAAiB;QACjB,uBAAuB;QACvB,QAAQ;QACR,cAAc;KACf;IACD,MAAM,EAAE;QACN,kBAAkB;QAClB,kBAAkB;QAClB,iBAAiB;QACjB,uBAAuB;QACvB,QAAQ;KACT;IACD,IAAI,EAAE;QACJ,iCAAiC;QACjC,sBAAsB;QACtB,sBAAsB;QACtB,WAAW;KACZ;IACD,EAAE,EAAE;QACF,kBAAkB;QAClB,mBAAmB;QACnB,eAAe;QACf,OAAO;KACR;IACD,IAAI,EAAE;QACJ,YAAY;QACZ,aAAa;QACb,gBAAgB;QAChB,YAAY;QACZ,SAAS;KACV;IACD,GAAG,EAAE;QACH,cAAc;QACd,kBAAkB;QAClB,mBAAmB;QACnB,uBAAuB;KACxB;IACD,IAAI,EAAE;QACJ,qBAAqB;QACrB,WAAW;QACX,UAAU;QACV,SAAS;KACV;IACD,GAAG,EAAE;QACH,gBAAgB;QAChB,eAAe;QACf,6BAA6B;QAC7B,WAAW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ACzE;YACD,gBAAgB,EAAE;gBAChB,IAAI,EAAE,SAAS;gBACf,WAAW,EAAE,8CAA8C;aAC5D;YACD,YAAY,EAAE;gBACZ,IAAI,EAAE,SAAS;gBACf,WAAW,EAAE,mDAAmD;aACjE;SACF;QACD,QAAQ,EAAE,CAAC,qBAAqB,CAAC;KAClC;CACF,CAAC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { SessionLog, CodeContext, DesignDecision, SessionLogOptions } from '../types/index.js';
|
|
2
|
+
export interface CreateSessionLogInput {
|
|
3
|
+
title: string;
|
|
4
|
+
summary: string;
|
|
5
|
+
codeContexts?: CodeContext[];
|
|
6
|
+
designDecisions?: DesignDecision[];
|
|
7
|
+
duration?: number;
|
|
8
|
+
tags?: string[];
|
|
9
|
+
options?: SessionLogOptions;
|
|
10
|
+
}
|
|
11
|
+
export interface CreateSessionLogOutput {
|
|
12
|
+
sessionLog: SessionLog;
|
|
13
|
+
filePath?: string;
|
|
14
|
+
content: string;
|
|
15
|
+
}
|
|
16
|
+
export declare function createSessionLog(input: CreateSessionLogInput): Promise<CreateSessionLogOutput>;
|
|
17
|
+
export declare const createSessionLogSchema: {
|
|
18
|
+
name: string;
|
|
19
|
+
description: string;
|
|
20
|
+
inputSchema: {
|
|
21
|
+
type: string;
|
|
22
|
+
properties: {
|
|
23
|
+
title: {
|
|
24
|
+
type: string;
|
|
25
|
+
description: string;
|
|
26
|
+
};
|
|
27
|
+
summary: {
|
|
28
|
+
type: string;
|
|
29
|
+
description: string;
|
|
30
|
+
};
|
|
31
|
+
codeContexts: {
|
|
32
|
+
type: string;
|
|
33
|
+
description: string;
|
|
34
|
+
items: {
|
|
35
|
+
type: string;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
designDecisions: {
|
|
39
|
+
type: string;
|
|
40
|
+
description: string;
|
|
41
|
+
items: {
|
|
42
|
+
type: string;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
duration: {
|
|
46
|
+
type: string;
|
|
47
|
+
description: string;
|
|
48
|
+
};
|
|
49
|
+
tags: {
|
|
50
|
+
type: string;
|
|
51
|
+
items: {
|
|
52
|
+
type: string;
|
|
53
|
+
};
|
|
54
|
+
description: string;
|
|
55
|
+
};
|
|
56
|
+
options: {
|
|
57
|
+
type: string;
|
|
58
|
+
properties: {
|
|
59
|
+
logType: {
|
|
60
|
+
type: string;
|
|
61
|
+
enum: string[];
|
|
62
|
+
description: string;
|
|
63
|
+
};
|
|
64
|
+
outputPath: {
|
|
65
|
+
type: string;
|
|
66
|
+
description: string;
|
|
67
|
+
};
|
|
68
|
+
format: {
|
|
69
|
+
type: string;
|
|
70
|
+
enum: string[];
|
|
71
|
+
description: string;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
required: string[];
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
//# sourceMappingURL=createSessionLog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createSessionLog.d.ts","sourceRoot":"","sources":["../../src/tools/createSessionLog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAM/F,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,WAAW,EAAE,CAAC;IAC7B,eAAe,CAAC,EAAE,cAAc,EAAE,CAAC;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,CAAC,EAAE,iBAAiB,CAAC;CAC7B;AAED,MAAM,WAAW,sBAAsB;IACrC,UAAU,EAAE,UAAU,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,wBAAsB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAkDpG;AAqED,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuDlC,CAAC"}
|