@su-record/vibe 2.5.11 → 2.5.13
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/CLAUDE.md +243 -0
- package/LICENSE +21 -21
- package/README.md +262 -262
- package/agents/architect-low.md +41 -41
- package/agents/architect-medium.md +59 -59
- package/agents/architect.md +80 -80
- package/agents/build-error-resolver.md +115 -115
- package/agents/compounder.md +261 -261
- package/agents/diagrammer.md +178 -178
- package/agents/e2e-tester.md +266 -266
- package/agents/explorer-low.md +42 -42
- package/agents/explorer-medium.md +59 -59
- package/agents/explorer.md +48 -48
- package/agents/implementer-low.md +43 -43
- package/agents/implementer-medium.md +52 -52
- package/agents/implementer.md +54 -54
- package/agents/refactor-cleaner.md +143 -143
- package/agents/research/best-practices-agent.md +189 -189
- package/agents/research/codebase-patterns-agent.md +147 -147
- package/agents/research/framework-docs-agent.md +178 -178
- package/agents/research/security-advisory-agent.md +203 -203
- package/agents/review/architecture-reviewer.md +107 -107
- package/agents/review/complexity-reviewer.md +116 -116
- package/agents/review/data-integrity-reviewer.md +88 -88
- package/agents/review/git-history-reviewer.md +103 -103
- package/agents/review/performance-reviewer.md +86 -86
- package/agents/review/python-reviewer.md +150 -150
- package/agents/review/rails-reviewer.md +139 -139
- package/agents/review/react-reviewer.md +144 -144
- package/agents/review/security-reviewer.md +80 -80
- package/agents/review/simplicity-reviewer.md +140 -140
- package/agents/review/test-coverage-reviewer.md +116 -116
- package/agents/review/typescript-reviewer.md +127 -127
- package/agents/searcher.md +54 -54
- package/agents/simplifier.md +120 -120
- package/agents/tester.md +49 -49
- package/agents/ui-previewer.md +129 -129
- package/commands/vibe.analyze.md +356 -356
- package/commands/vibe.reason.md +329 -329
- package/commands/vibe.review.md +326 -326
- package/commands/vibe.run.md +1117 -1051
- package/commands/vibe.spec.md +1058 -1058
- package/commands/vibe.utils.md +353 -296
- package/commands/vibe.verify.md +375 -375
- package/dist/cli/collaborator.js +52 -52
- package/dist/cli/detect.js +32 -32
- package/dist/cli/index.js +102 -102
- package/dist/cli/llm.js +144 -144
- package/dist/cli/mcp.d.ts +49 -0
- package/dist/cli/mcp.d.ts.map +1 -0
- package/dist/cli/mcp.js +169 -0
- package/dist/cli/mcp.js.map +1 -0
- package/dist/cli/postinstall.js +180 -2
- package/dist/cli/postinstall.js.map +1 -1
- package/dist/cli/setup/GlobalInstaller.d.ts +24 -0
- package/dist/cli/setup/GlobalInstaller.d.ts.map +1 -0
- package/dist/cli/setup/GlobalInstaller.js +130 -0
- package/dist/cli/setup/GlobalInstaller.js.map +1 -0
- package/dist/cli/setup/LanguageDetector.d.ts +16 -0
- package/dist/cli/setup/LanguageDetector.d.ts.map +1 -0
- package/dist/cli/setup/LanguageDetector.js +49 -0
- package/dist/cli/setup/LanguageDetector.js.map +1 -0
- package/dist/cli/setup/LegacyMigration.d.ts +25 -0
- package/dist/cli/setup/LegacyMigration.d.ts.map +1 -0
- package/dist/cli/setup/LegacyMigration.js +162 -0
- package/dist/cli/setup/LegacyMigration.js.map +1 -0
- package/dist/cli/setup/ProjectSetup.d.ts +30 -0
- package/dist/cli/setup/ProjectSetup.d.ts.map +1 -0
- package/dist/cli/setup/ProjectSetup.js +238 -0
- package/dist/cli/setup/ProjectSetup.js.map +1 -0
- package/dist/cli/setup/index.d.ts +14 -0
- package/dist/cli/setup/index.d.ts.map +1 -0
- package/dist/cli/setup/index.js +18 -0
- package/dist/cli/setup/index.js.map +1 -0
- package/dist/cli/setup.d.ts +10 -77
- package/dist/cli/setup.d.ts.map +1 -1
- package/dist/cli/setup.js +15 -592
- package/dist/cli/setup.js.map +1 -1
- package/dist/lib/DeepInit.d.ts +0 -2
- package/dist/lib/DeepInit.d.ts.map +1 -1
- package/dist/lib/DeepInit.js +24 -26
- package/dist/lib/DeepInit.js.map +1 -1
- package/dist/lib/IterationTracker.d.ts +0 -2
- package/dist/lib/IterationTracker.d.ts.map +1 -1
- package/dist/lib/IterationTracker.js +11 -13
- package/dist/lib/IterationTracker.js.map +1 -1
- package/dist/lib/ModelRouter.d.ts +0 -2
- package/dist/lib/ModelRouter.d.ts.map +1 -1
- package/dist/lib/ModelRouter.js +0 -2
- package/dist/lib/ModelRouter.js.map +1 -1
- package/dist/lib/OrchestrateWorkflow.d.ts +1 -3
- package/dist/lib/OrchestrateWorkflow.d.ts.map +1 -1
- package/dist/lib/OrchestrateWorkflow.js +1 -3
- package/dist/lib/OrchestrateWorkflow.js.map +1 -1
- package/dist/lib/PythonParser.js +108 -108
- package/dist/lib/SkillFrontmatter.d.ts +0 -2
- package/dist/lib/SkillFrontmatter.d.ts.map +1 -1
- package/dist/lib/SkillFrontmatter.js +28 -30
- package/dist/lib/SkillFrontmatter.js.map +1 -1
- package/dist/lib/SkillQualityGate.d.ts +0 -2
- package/dist/lib/SkillQualityGate.d.ts.map +1 -1
- package/dist/lib/SkillQualityGate.js +9 -11
- package/dist/lib/SkillQualityGate.js.map +1 -1
- package/dist/lib/SkillRepository.d.ts +117 -0
- package/dist/lib/SkillRepository.d.ts.map +1 -0
- package/dist/lib/SkillRepository.js +477 -0
- package/dist/lib/SkillRepository.js.map +1 -0
- package/dist/lib/UltraQA.d.ts +0 -2
- package/dist/lib/UltraQA.d.ts.map +1 -1
- package/dist/lib/UltraQA.js +77 -79
- package/dist/lib/UltraQA.js.map +1 -1
- package/dist/lib/gemini-mcp.d.ts +10 -0
- package/dist/lib/gemini-mcp.d.ts.map +1 -0
- package/dist/lib/gemini-mcp.js +353 -0
- package/dist/lib/gemini-mcp.js.map +1 -0
- package/dist/lib/gpt-api.js +4 -4
- package/dist/lib/gpt-mcp.d.ts +10 -0
- package/dist/lib/gpt-mcp.d.ts.map +1 -0
- package/dist/lib/gpt-mcp.js +352 -0
- package/dist/lib/gpt-mcp.js.map +1 -0
- package/dist/lib/llm/auth/ApiKeyManager.d.ts +21 -0
- package/dist/lib/llm/auth/ApiKeyManager.d.ts.map +1 -0
- package/dist/lib/llm/auth/ApiKeyManager.js +43 -0
- package/dist/lib/llm/auth/ApiKeyManager.js.map +1 -0
- package/dist/lib/llm/auth/ConfigManager.d.ts +29 -0
- package/dist/lib/llm/auth/ConfigManager.d.ts.map +1 -0
- package/dist/lib/llm/auth/ConfigManager.js +67 -0
- package/dist/lib/llm/auth/ConfigManager.js.map +1 -0
- package/dist/lib/llm/auth/index.d.ts +25 -0
- package/dist/lib/llm/auth/index.d.ts.map +1 -0
- package/dist/lib/llm/auth/index.js +83 -0
- package/dist/lib/llm/auth/index.js.map +1 -0
- package/dist/lib/llm/index.d.ts +10 -0
- package/dist/lib/llm/index.d.ts.map +1 -0
- package/dist/lib/llm/index.js +12 -0
- package/dist/lib/llm/index.js.map +1 -0
- package/dist/lib/llm/types.d.ts +96 -0
- package/dist/lib/llm/types.d.ts.map +1 -0
- package/dist/lib/llm/types.js +17 -0
- package/dist/lib/llm/types.js.map +1 -0
- package/dist/lib/llm/utils/index.d.ts +6 -0
- package/dist/lib/llm/utils/index.d.ts.map +1 -0
- package/dist/lib/llm/utils/index.js +6 -0
- package/dist/lib/llm/utils/index.js.map +1 -0
- package/dist/lib/llm/utils/retry.d.ts +25 -0
- package/dist/lib/llm/utils/retry.d.ts.map +1 -0
- package/dist/lib/llm/utils/retry.js +72 -0
- package/dist/lib/llm/utils/retry.js.map +1 -0
- package/dist/lib/llm/utils/stream.d.ts +13 -0
- package/dist/lib/llm/utils/stream.d.ts.map +1 -0
- package/dist/lib/llm/utils/stream.js +110 -0
- package/dist/lib/llm/utils/stream.js.map +1 -0
- package/dist/lib/memory/KnowledgeGraph.js +4 -4
- package/dist/lib/memory/MemorySearch.js +20 -20
- package/dist/lib/memory/MemoryStorage.js +64 -64
- package/dist/orchestrator/AgentExecutor.d.ts +23 -0
- package/dist/orchestrator/AgentExecutor.d.ts.map +1 -0
- package/dist/orchestrator/AgentExecutor.js +231 -0
- package/dist/orchestrator/AgentExecutor.js.map +1 -0
- package/dist/orchestrator/AgentManager.d.ts +73 -0
- package/dist/orchestrator/AgentManager.d.ts.map +1 -0
- package/dist/orchestrator/AgentManager.js +184 -0
- package/dist/orchestrator/AgentManager.js.map +1 -0
- package/dist/orchestrator/LLMCluster.d.ts +70 -0
- package/dist/orchestrator/LLMCluster.d.ts.map +1 -0
- package/dist/orchestrator/LLMCluster.js +91 -0
- package/dist/orchestrator/LLMCluster.js.map +1 -0
- package/dist/orchestrator/MultiLlmResearch.d.ts +27 -0
- package/dist/orchestrator/MultiLlmResearch.d.ts.map +1 -0
- package/dist/orchestrator/MultiLlmResearch.js +145 -0
- package/dist/orchestrator/MultiLlmResearch.js.map +1 -0
- package/dist/orchestrator/SessionStore.d.ts +41 -0
- package/dist/orchestrator/SessionStore.d.ts.map +1 -0
- package/dist/orchestrator/SessionStore.js +117 -0
- package/dist/orchestrator/SessionStore.js.map +1 -0
- package/dist/orchestrator/SmartRouter.d.ts +68 -0
- package/dist/orchestrator/SmartRouter.d.ts.map +1 -0
- package/dist/orchestrator/SmartRouter.js +256 -0
- package/dist/orchestrator/SmartRouter.js.map +1 -0
- package/dist/orchestrator/backgroundAgent.d.ts +10 -28
- package/dist/orchestrator/backgroundAgent.d.ts.map +1 -1
- package/dist/orchestrator/backgroundAgent.js +11 -346
- package/dist/orchestrator/backgroundAgent.js.map +1 -1
- package/dist/orchestrator/index.d.ts +3 -0
- package/dist/orchestrator/index.d.ts.map +1 -1
- package/dist/orchestrator/index.js +4 -0
- package/dist/orchestrator/index.js.map +1 -1
- package/dist/orchestrator/orchestrator.d.ts +19 -154
- package/dist/orchestrator/orchestrator.d.ts.map +1 -1
- package/dist/orchestrator/orchestrator.js +90 -514
- package/dist/orchestrator/orchestrator.js.map +1 -1
- package/dist/orchestrator/parallelResearch.d.ts +5 -12
- package/dist/orchestrator/parallelResearch.d.ts.map +1 -1
- package/dist/orchestrator/parallelResearch.js +10 -193
- package/dist/orchestrator/parallelResearch.js.map +1 -1
- package/dist/tools/analytics/getUsageAnalytics.d.ts +10 -0
- package/dist/tools/analytics/getUsageAnalytics.d.ts.map +1 -0
- package/dist/tools/analytics/getUsageAnalytics.js +246 -0
- package/dist/tools/analytics/getUsageAnalytics.js.map +1 -0
- package/dist/tools/analytics/index.d.ts +5 -0
- package/dist/tools/analytics/index.d.ts.map +1 -0
- package/dist/tools/analytics/index.js +5 -0
- package/dist/tools/analytics/index.js.map +1 -0
- package/dist/tools/convention/analyzeComplexity.test.js +115 -115
- package/dist/tools/convention/getCodingGuide.d.ts +7 -0
- package/dist/tools/convention/getCodingGuide.d.ts.map +1 -0
- package/dist/tools/convention/getCodingGuide.js +69 -0
- package/dist/tools/convention/getCodingGuide.js.map +1 -0
- package/dist/tools/convention/validateCodeQuality.test.js +104 -104
- package/dist/tools/index.d.ts +2 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +2 -0
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/planning/analyzeRequirements.d.ts +9 -0
- package/dist/tools/planning/analyzeRequirements.d.ts.map +1 -0
- package/dist/tools/planning/analyzeRequirements.js +171 -0
- package/dist/tools/planning/analyzeRequirements.js.map +1 -0
- package/dist/tools/planning/createUserStories.d.ts +9 -0
- package/dist/tools/planning/createUserStories.d.ts.map +1 -0
- package/dist/tools/planning/createUserStories.js +124 -0
- package/dist/tools/planning/createUserStories.js.map +1 -0
- package/dist/tools/planning/featureRoadmap.d.ts +10 -0
- package/dist/tools/planning/featureRoadmap.d.ts.map +1 -0
- package/dist/tools/planning/featureRoadmap.js +207 -0
- package/dist/tools/planning/featureRoadmap.js.map +1 -0
- package/dist/tools/planning/generatePrd.d.ts +11 -0
- package/dist/tools/planning/generatePrd.d.ts.map +1 -0
- package/dist/tools/planning/generatePrd.js +161 -0
- package/dist/tools/planning/generatePrd.js.map +1 -0
- package/dist/tools/planning/index.d.ts +8 -0
- package/dist/tools/planning/index.d.ts.map +1 -0
- package/dist/tools/planning/index.js +8 -0
- package/dist/tools/planning/index.js.map +1 -0
- package/dist/tools/prompt/analyzePrompt.d.ts +7 -0
- package/dist/tools/prompt/analyzePrompt.d.ts.map +1 -0
- package/dist/tools/prompt/analyzePrompt.js +150 -0
- package/dist/tools/prompt/analyzePrompt.js.map +1 -0
- package/dist/tools/prompt/enhancePrompt.d.ts +8 -0
- package/dist/tools/prompt/enhancePrompt.d.ts.map +1 -0
- package/dist/tools/prompt/enhancePrompt.js +110 -0
- package/dist/tools/prompt/enhancePrompt.js.map +1 -0
- package/dist/tools/prompt/enhancePromptGemini.d.ts +8 -0
- package/dist/tools/prompt/enhancePromptGemini.d.ts.map +1 -0
- package/dist/tools/prompt/enhancePromptGemini.js +332 -0
- package/dist/tools/prompt/enhancePromptGemini.js.map +1 -0
- package/dist/tools/prompt/index.d.ts +7 -0
- package/dist/tools/prompt/index.d.ts.map +1 -0
- package/dist/tools/prompt/index.js +7 -0
- package/dist/tools/prompt/index.js.map +1 -0
- package/dist/tools/reasoning/applyReasoningFramework.d.ts +8 -0
- package/dist/tools/reasoning/applyReasoningFramework.d.ts.map +1 -0
- package/dist/tools/reasoning/applyReasoningFramework.js +266 -0
- package/dist/tools/reasoning/applyReasoningFramework.js.map +1 -0
- package/dist/tools/reasoning/index.d.ts +5 -0
- package/dist/tools/reasoning/index.d.ts.map +1 -0
- package/dist/tools/reasoning/index.js +5 -0
- package/dist/tools/reasoning/index.js.map +1 -0
- package/dist/tools/thinking/analyzeProblem.d.ts +7 -0
- package/dist/tools/thinking/analyzeProblem.d.ts.map +1 -0
- package/dist/tools/thinking/analyzeProblem.js +55 -0
- package/dist/tools/thinking/analyzeProblem.js.map +1 -0
- package/dist/tools/thinking/breakDownProblem.d.ts +8 -0
- package/dist/tools/thinking/breakDownProblem.d.ts.map +1 -0
- package/dist/tools/thinking/breakDownProblem.js +145 -0
- package/dist/tools/thinking/breakDownProblem.js.map +1 -0
- package/dist/tools/thinking/createThinkingChain.d.ts +7 -0
- package/dist/tools/thinking/createThinkingChain.d.ts.map +1 -0
- package/dist/tools/thinking/createThinkingChain.js +44 -0
- package/dist/tools/thinking/createThinkingChain.js.map +1 -0
- package/dist/tools/thinking/formatAsPlan.d.ts +9 -0
- package/dist/tools/thinking/formatAsPlan.d.ts.map +1 -0
- package/dist/tools/thinking/formatAsPlan.js +78 -0
- package/dist/tools/thinking/formatAsPlan.js.map +1 -0
- package/dist/tools/thinking/index.d.ts +10 -0
- package/dist/tools/thinking/index.d.ts.map +1 -0
- package/dist/tools/thinking/index.js +10 -0
- package/dist/tools/thinking/index.js.map +1 -0
- package/dist/tools/thinking/stepByStepAnalysis.d.ts +8 -0
- package/dist/tools/thinking/stepByStepAnalysis.d.ts.map +1 -0
- package/dist/tools/thinking/stepByStepAnalysis.js +63 -0
- package/dist/tools/thinking/stepByStepAnalysis.js.map +1 -0
- package/dist/tools/thinking/thinkAloudProcess.d.ts +8 -0
- package/dist/tools/thinking/thinkAloudProcess.d.ts.map +1 -0
- package/dist/tools/thinking/thinkAloudProcess.js +80 -0
- package/dist/tools/thinking/thinkAloudProcess.js.map +1 -0
- package/hooks/hooks.json +222 -222
- package/hooks/scripts/code-check.js +22 -22
- package/hooks/scripts/code-review.js +22 -22
- package/hooks/scripts/complexity.js +22 -22
- package/hooks/scripts/compound.js +23 -23
- package/hooks/scripts/context-save.js +33 -33
- package/hooks/scripts/generate-brand-assets.js +472 -0
- package/hooks/scripts/hud-multiline.js +262 -264
- package/hooks/scripts/hud-status.js +291 -293
- package/hooks/scripts/keyword-detector.js +214 -216
- package/hooks/scripts/llm-orchestrate.js +171 -171
- package/hooks/scripts/post-edit.js +97 -97
- package/hooks/scripts/post-tool-verify.js +210 -212
- package/hooks/scripts/pre-tool-guard.js +125 -127
- package/hooks/scripts/recall.js +22 -22
- package/hooks/scripts/session-start.js +30 -30
- package/hooks/scripts/skill-injector.js +191 -193
- package/hooks/scripts/utils.js +97 -97
- package/languages/csharp-unity.md +515 -515
- package/languages/gdscript-godot.md +470 -470
- package/languages/ruby-rails.md +489 -489
- package/languages/typescript-angular.md +433 -433
- package/languages/typescript-astro.md +416 -416
- package/languages/typescript-electron.md +406 -406
- package/languages/typescript-nestjs.md +524 -524
- package/languages/typescript-svelte.md +407 -407
- package/languages/typescript-tauri.md +365 -365
- package/package.json +83 -83
- package/skills/brand-assets.md +141 -0
- package/skills/commerce-patterns.md +361 -0
- package/skills/context7-usage.md +102 -102
- package/skills/e2e-commerce.md +304 -0
- package/skills/frontend-design.md +92 -0
- package/skills/git-worktree.md +181 -181
- package/skills/parallel-research.md +77 -77
- package/skills/priority-todos.md +239 -239
- package/skills/seo-checklist.md +244 -0
- package/skills/tool-fallback.md +190 -190
- package/skills/vibe-capabilities.md +161 -161
- package/vibe/constitution.md +227 -227
- package/vibe/rules/core/communication-guide.md +98 -98
- package/vibe/rules/core/development-philosophy.md +52 -52
- package/vibe/rules/core/quick-start.md +102 -102
- package/vibe/rules/quality/bdd-contract-testing.md +393 -393
- package/vibe/rules/quality/checklist.md +276 -276
- package/vibe/rules/quality/testing-strategy.md +440 -440
- package/vibe/rules/standards/anti-patterns.md +541 -541
- package/vibe/rules/standards/code-structure.md +291 -291
- package/vibe/rules/standards/complexity-metrics.md +313 -313
- package/vibe/rules/standards/naming-conventions.md +198 -198
- package/vibe/setup.sh +31 -31
- package/vibe/templates/constitution-template.md +252 -252
- package/vibe/templates/contract-backend-template.md +526 -526
- package/vibe/templates/contract-frontend-template.md +599 -599
- package/vibe/templates/feature-template.md +96 -96
- package/vibe/templates/spec-template.md +221 -221
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
// v2.0 - Get usage analytics and telemetry
|
|
2
|
+
import { MemoryManager } from '../../lib/MemoryManager.js';
|
|
3
|
+
export const getUsageAnalyticsDefinition = {
|
|
4
|
+
name: 'get_usage_analytics',
|
|
5
|
+
description: `도구 사용 분석 및 통계를 조회합니다.
|
|
6
|
+
|
|
7
|
+
키워드: 분석, 통계, 사용량, analytics, statistics, usage
|
|
8
|
+
|
|
9
|
+
**제공 정보:**
|
|
10
|
+
- 메모리 사용 통계
|
|
11
|
+
- 카테고리별 분포
|
|
12
|
+
- 시간별 사용 패턴
|
|
13
|
+
- 그래프 관계 통계
|
|
14
|
+
|
|
15
|
+
사용 예시:
|
|
16
|
+
- "사용 통계 보여줘"
|
|
17
|
+
- "메모리 분석"`,
|
|
18
|
+
inputSchema: {
|
|
19
|
+
type: 'object',
|
|
20
|
+
properties: {
|
|
21
|
+
type: {
|
|
22
|
+
type: 'string',
|
|
23
|
+
description: '분석 유형',
|
|
24
|
+
enum: ['memory', 'graph', 'all']
|
|
25
|
+
},
|
|
26
|
+
timeRange: {
|
|
27
|
+
type: 'string',
|
|
28
|
+
description: '시간 범위',
|
|
29
|
+
enum: ['1d', '7d', '30d', 'all']
|
|
30
|
+
},
|
|
31
|
+
detailed: {
|
|
32
|
+
type: 'boolean',
|
|
33
|
+
description: '상세 정보 포함 여부 (기본값: false)'
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
annotations: {
|
|
38
|
+
title: 'Get Usage Analytics',
|
|
39
|
+
audience: ['user', 'assistant'],
|
|
40
|
+
readOnlyHint: true,
|
|
41
|
+
destructiveHint: false,
|
|
42
|
+
idempotentHint: true,
|
|
43
|
+
openWorldHint: false
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
export async function getUsageAnalytics(args) {
|
|
47
|
+
try {
|
|
48
|
+
const { type = 'all', timeRange = 'all', detailed = false } = args;
|
|
49
|
+
const memoryManager = MemoryManager.getInstance();
|
|
50
|
+
let output = '## Hi-AI 사용 분석\n\n';
|
|
51
|
+
// Memory statistics
|
|
52
|
+
if (type === 'memory' || type === 'all') {
|
|
53
|
+
output += await generateMemoryStats(memoryManager, timeRange, detailed);
|
|
54
|
+
}
|
|
55
|
+
// Graph statistics
|
|
56
|
+
if (type === 'graph' || type === 'all') {
|
|
57
|
+
output += await generateGraphStats(memoryManager, detailed);
|
|
58
|
+
}
|
|
59
|
+
// System info
|
|
60
|
+
output += `---\n### 시스템 정보\n\n`;
|
|
61
|
+
output += `- **Hi-AI 버전**: 2.0.0\n`;
|
|
62
|
+
output += `- **분석 시간**: ${new Date().toLocaleString('ko-KR')}\n`;
|
|
63
|
+
output += `- **시간 범위**: ${getTimeRangeLabel(timeRange)}\n`;
|
|
64
|
+
return {
|
|
65
|
+
content: [{
|
|
66
|
+
type: 'text',
|
|
67
|
+
text: output
|
|
68
|
+
}]
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
catch (error) {
|
|
72
|
+
return {
|
|
73
|
+
content: [{
|
|
74
|
+
type: 'text',
|
|
75
|
+
text: `✗ 분석 오류: ${error instanceof Error ? error.message : '알 수 없는 오류'}`
|
|
76
|
+
}]
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
async function generateMemoryStats(memoryManager, timeRange, detailed) {
|
|
81
|
+
const stats = memoryManager.getStats();
|
|
82
|
+
const allMemories = memoryManager.list();
|
|
83
|
+
let output = '### 메모리 통계\n\n';
|
|
84
|
+
output += `- **총 메모리 수**: ${stats.total}개\n`;
|
|
85
|
+
output += `- **카테고리 수**: ${Object.keys(stats.byCategory).length}개\n\n`;
|
|
86
|
+
// Category distribution
|
|
87
|
+
output += `#### 카테고리별 분포\n\n`;
|
|
88
|
+
const sortedCategories = Object.entries(stats.byCategory)
|
|
89
|
+
.sort((a, b) => b[1] - a[1]);
|
|
90
|
+
for (const [category, count] of sortedCategories) {
|
|
91
|
+
const percentage = ((count / stats.total) * 100).toFixed(1);
|
|
92
|
+
const bar = '█'.repeat(Math.round(count / stats.total * 20));
|
|
93
|
+
output += `- **${category}**: ${count}개 (${percentage}%) ${bar}\n`;
|
|
94
|
+
}
|
|
95
|
+
output += '\n';
|
|
96
|
+
// Time analysis
|
|
97
|
+
if (allMemories.length > 0) {
|
|
98
|
+
output += `#### 시간 분석\n\n`;
|
|
99
|
+
const now = new Date();
|
|
100
|
+
const filterDate = getFilterDate(timeRange);
|
|
101
|
+
const recentMemories = filterDate
|
|
102
|
+
? allMemories.filter(m => new Date(m.timestamp) >= filterDate)
|
|
103
|
+
: allMemories;
|
|
104
|
+
// Group by day
|
|
105
|
+
const byDay = {};
|
|
106
|
+
for (const memory of recentMemories) {
|
|
107
|
+
const day = memory.timestamp.substring(0, 10);
|
|
108
|
+
byDay[day] = (byDay[day] || 0) + 1;
|
|
109
|
+
}
|
|
110
|
+
const sortedDays = Object.entries(byDay)
|
|
111
|
+
.sort((a, b) => b[0].localeCompare(a[0]))
|
|
112
|
+
.slice(0, 7);
|
|
113
|
+
if (sortedDays.length > 0) {
|
|
114
|
+
output += `**최근 일별 활동**:\n`;
|
|
115
|
+
for (const [day, count] of sortedDays) {
|
|
116
|
+
const bar = '▓'.repeat(Math.min(count, 20));
|
|
117
|
+
output += `- ${day}: ${count}개 ${bar}\n`;
|
|
118
|
+
}
|
|
119
|
+
output += '\n';
|
|
120
|
+
}
|
|
121
|
+
// Priority distribution
|
|
122
|
+
const priorityCounts = {};
|
|
123
|
+
for (const memory of allMemories) {
|
|
124
|
+
const priority = memory.priority || 0;
|
|
125
|
+
priorityCounts[priority] = (priorityCounts[priority] || 0) + 1;
|
|
126
|
+
}
|
|
127
|
+
if (Object.keys(priorityCounts).length > 1) {
|
|
128
|
+
output += `**우선순위 분포**:\n`;
|
|
129
|
+
for (const [priority, count] of Object.entries(priorityCounts).sort((a, b) => Number(b[0]) - Number(a[0]))) {
|
|
130
|
+
output += `- 우선순위 ${priority}: ${count}개\n`;
|
|
131
|
+
}
|
|
132
|
+
output += '\n';
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
// Detailed info
|
|
136
|
+
if (detailed && allMemories.length > 0) {
|
|
137
|
+
output += `#### 상세 정보\n\n`;
|
|
138
|
+
// Most recently accessed
|
|
139
|
+
const byAccess = [...allMemories]
|
|
140
|
+
.sort((a, b) => new Date(b.lastAccessed).getTime() - new Date(a.lastAccessed).getTime())
|
|
141
|
+
.slice(0, 5);
|
|
142
|
+
output += `**최근 접근한 메모리**:\n`;
|
|
143
|
+
for (const memory of byAccess) {
|
|
144
|
+
output += `- \`${memory.key}\` (${formatDate(memory.lastAccessed)})\n`;
|
|
145
|
+
}
|
|
146
|
+
output += '\n';
|
|
147
|
+
// Oldest memories
|
|
148
|
+
const oldest = [...allMemories]
|
|
149
|
+
.sort((a, b) => new Date(a.timestamp).getTime() - new Date(b.timestamp).getTime())
|
|
150
|
+
.slice(0, 5);
|
|
151
|
+
output += `**가장 오래된 메모리**:\n`;
|
|
152
|
+
for (const memory of oldest) {
|
|
153
|
+
output += `- \`${memory.key}\` (${formatDate(memory.timestamp)})\n`;
|
|
154
|
+
}
|
|
155
|
+
output += '\n';
|
|
156
|
+
}
|
|
157
|
+
return output;
|
|
158
|
+
}
|
|
159
|
+
async function generateGraphStats(memoryManager, detailed) {
|
|
160
|
+
const graph = memoryManager.getMemoryGraph();
|
|
161
|
+
let output = '### 지식 그래프 통계\n\n';
|
|
162
|
+
output += `- **노드 수**: ${graph.nodes.length}개\n`;
|
|
163
|
+
output += `- **관계 수**: ${graph.edges.length}개\n`;
|
|
164
|
+
output += `- **클러스터 수**: ${graph.clusters.length}개\n\n`;
|
|
165
|
+
if (graph.edges.length > 0) {
|
|
166
|
+
// Relation type distribution
|
|
167
|
+
const relationTypes = {};
|
|
168
|
+
for (const edge of graph.edges) {
|
|
169
|
+
relationTypes[edge.relationType] = (relationTypes[edge.relationType] || 0) + 1;
|
|
170
|
+
}
|
|
171
|
+
output += `#### 관계 유형 분포\n\n`;
|
|
172
|
+
for (const [type, count] of Object.entries(relationTypes).sort((a, b) => b[1] - a[1])) {
|
|
173
|
+
output += `- **${type}**: ${count}개\n`;
|
|
174
|
+
}
|
|
175
|
+
output += '\n';
|
|
176
|
+
// Average connections per node
|
|
177
|
+
const avgConnections = (graph.edges.length * 2 / graph.nodes.length).toFixed(2);
|
|
178
|
+
output += `- **평균 연결 수**: ${avgConnections}개/노드\n`;
|
|
179
|
+
// Most connected nodes
|
|
180
|
+
const connectionCount = {};
|
|
181
|
+
for (const edge of graph.edges) {
|
|
182
|
+
connectionCount[edge.sourceKey] = (connectionCount[edge.sourceKey] || 0) + 1;
|
|
183
|
+
connectionCount[edge.targetKey] = (connectionCount[edge.targetKey] || 0) + 1;
|
|
184
|
+
}
|
|
185
|
+
const topConnected = Object.entries(connectionCount)
|
|
186
|
+
.sort((a, b) => b[1] - a[1])
|
|
187
|
+
.slice(0, 5);
|
|
188
|
+
if (topConnected.length > 0) {
|
|
189
|
+
output += `\n**가장 많이 연결된 노드**:\n`;
|
|
190
|
+
for (const [key, count] of topConnected) {
|
|
191
|
+
output += `- \`${key}\`: ${count}개 연결\n`;
|
|
192
|
+
}
|
|
193
|
+
output += '\n';
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
// Cluster info
|
|
197
|
+
if (graph.clusters.length > 0 && detailed) {
|
|
198
|
+
output += `#### 클러스터 상세\n\n`;
|
|
199
|
+
for (let i = 0; i < Math.min(graph.clusters.length, 5); i++) {
|
|
200
|
+
const cluster = graph.clusters[i];
|
|
201
|
+
output += `**클러스터 ${i + 1}** (${cluster.length}개 노드):\n`;
|
|
202
|
+
output += `- ${cluster.slice(0, 5).join(', ')}`;
|
|
203
|
+
if (cluster.length > 5) {
|
|
204
|
+
output += ` ... 외 ${cluster.length - 5}개`;
|
|
205
|
+
}
|
|
206
|
+
output += '\n';
|
|
207
|
+
}
|
|
208
|
+
output += '\n';
|
|
209
|
+
}
|
|
210
|
+
return output;
|
|
211
|
+
}
|
|
212
|
+
function getFilterDate(timeRange) {
|
|
213
|
+
const now = new Date();
|
|
214
|
+
switch (timeRange) {
|
|
215
|
+
case '1d':
|
|
216
|
+
return new Date(now.getTime() - 24 * 60 * 60 * 1000);
|
|
217
|
+
case '7d':
|
|
218
|
+
return new Date(now.getTime() - 7 * 24 * 60 * 60 * 1000);
|
|
219
|
+
case '30d':
|
|
220
|
+
return new Date(now.getTime() - 30 * 24 * 60 * 60 * 1000);
|
|
221
|
+
default:
|
|
222
|
+
return null;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
function getTimeRangeLabel(timeRange) {
|
|
226
|
+
switch (timeRange) {
|
|
227
|
+
case '1d':
|
|
228
|
+
return '최근 24시간';
|
|
229
|
+
case '7d':
|
|
230
|
+
return '최근 7일';
|
|
231
|
+
case '30d':
|
|
232
|
+
return '최근 30일';
|
|
233
|
+
default:
|
|
234
|
+
return '전체';
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
function formatDate(dateString) {
|
|
238
|
+
try {
|
|
239
|
+
const date = new Date(dateString);
|
|
240
|
+
return date.toLocaleDateString('ko-KR');
|
|
241
|
+
}
|
|
242
|
+
catch { /* ignore: optional operation */
|
|
243
|
+
return dateString;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
//# sourceMappingURL=getUsageAnalytics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getUsageAnalytics.js","sourceRoot":"","sources":["../../../src/tools/analytics/getUsageAnalytics.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAG3C,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,MAAM,CAAC,MAAM,2BAA2B,GAAmB;IACzD,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE;;;;;;;;;;;;WAYJ;IACT,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,OAAO;gBACpB,IAAI,EAAE,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,CAAC;aACjC;YACD,SAAS,EAAE;gBACT,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,OAAO;gBACpB,IAAI,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC;aACjC;YACD,QAAQ,EAAE;gBACR,IAAI,EAAE,SAAS;gBACf,WAAW,EAAE,0BAA0B;aACxC;SACF;KACF;IACD,WAAW,EAAE;QACX,KAAK,EAAE,qBA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../../../src/tools/analytics/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/analytics/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -4,10 +4,10 @@ import { analyzeComplexity } from './analyzeComplexity.js';
|
|
|
4
4
|
describe('analyzeComplexity', () => {
|
|
5
5
|
describe('code analysis', () => {
|
|
6
6
|
it('should analyze simple code', async () => {
|
|
7
|
-
const code = `
|
|
8
|
-
function add(a, b) {
|
|
9
|
-
return a + b;
|
|
10
|
-
}
|
|
7
|
+
const code = `
|
|
8
|
+
function add(a, b) {
|
|
9
|
+
return a + b;
|
|
10
|
+
}
|
|
11
11
|
`;
|
|
12
12
|
const result = await analyzeComplexity({ code });
|
|
13
13
|
expect(result.content).toBeDefined();
|
|
@@ -15,70 +15,70 @@ function add(a, b) {
|
|
|
15
15
|
expect(result.content[0].text).toContain('Complexity');
|
|
16
16
|
});
|
|
17
17
|
it('should detect high cyclomatic complexity', async () => {
|
|
18
|
-
const code = `
|
|
19
|
-
function complex(a, b, c, d) {
|
|
20
|
-
if (a > 0) {
|
|
21
|
-
if (b > 0) {
|
|
22
|
-
if (c > 0) {
|
|
23
|
-
if (d > 0) {
|
|
24
|
-
for (let i = 0; i < 10; i++) {
|
|
25
|
-
while (true) {
|
|
26
|
-
switch (i) {
|
|
27
|
-
case 1: break;
|
|
28
|
-
case 2: break;
|
|
29
|
-
case 3: break;
|
|
30
|
-
}
|
|
31
|
-
break;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
18
|
+
const code = `
|
|
19
|
+
function complex(a, b, c, d) {
|
|
20
|
+
if (a > 0) {
|
|
21
|
+
if (b > 0) {
|
|
22
|
+
if (c > 0) {
|
|
23
|
+
if (d > 0) {
|
|
24
|
+
for (let i = 0; i < 10; i++) {
|
|
25
|
+
while (true) {
|
|
26
|
+
switch (i) {
|
|
27
|
+
case 1: break;
|
|
28
|
+
case 2: break;
|
|
29
|
+
case 3: break;
|
|
30
|
+
}
|
|
31
|
+
break;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
39
|
`;
|
|
40
40
|
const result = await analyzeComplexity({ code });
|
|
41
41
|
expect(result.content[0].text).toContain('Complexity');
|
|
42
42
|
// High complexity code should have lower score or issues
|
|
43
43
|
});
|
|
44
44
|
it('should calculate cyclomatic metrics only', async () => {
|
|
45
|
-
const code = `
|
|
46
|
-
function test() {
|
|
47
|
-
if (true) return 1;
|
|
48
|
-
return 0;
|
|
49
|
-
}
|
|
45
|
+
const code = `
|
|
46
|
+
function test() {
|
|
47
|
+
if (true) return 1;
|
|
48
|
+
return 0;
|
|
49
|
+
}
|
|
50
50
|
`;
|
|
51
51
|
const result = await analyzeComplexity({ code, metrics: 'cyclomatic' });
|
|
52
52
|
expect(result.content[0].text).toContain('Complexity');
|
|
53
53
|
});
|
|
54
54
|
it('should calculate cognitive metrics only', async () => {
|
|
55
|
-
const code = `
|
|
56
|
-
function test() {
|
|
57
|
-
if (true) {
|
|
58
|
-
for (let i = 0; i < 10; i++) {
|
|
59
|
-
console.log(i);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}
|
|
55
|
+
const code = `
|
|
56
|
+
function test() {
|
|
57
|
+
if (true) {
|
|
58
|
+
for (let i = 0; i < 10; i++) {
|
|
59
|
+
console.log(i);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
63
|
`;
|
|
64
64
|
const result = await analyzeComplexity({ code, metrics: 'cognitive' });
|
|
65
65
|
expect(result.content[0].text).toContain('Complexity');
|
|
66
66
|
});
|
|
67
67
|
it('should calculate halstead metrics only', async () => {
|
|
68
|
-
const code = `
|
|
69
|
-
const x = 1 + 2 * 3 - 4 / 5;
|
|
68
|
+
const code = `
|
|
69
|
+
const x = 1 + 2 * 3 - 4 / 5;
|
|
70
70
|
`;
|
|
71
71
|
const result = await analyzeComplexity({ code, metrics: 'halstead' });
|
|
72
72
|
expect(result.content[0].text).toContain('Complexity');
|
|
73
73
|
});
|
|
74
74
|
it('should calculate all metrics', async () => {
|
|
75
|
-
const code = `
|
|
76
|
-
function calculate(a, b) {
|
|
77
|
-
if (a > b) {
|
|
78
|
-
return a - b;
|
|
79
|
-
}
|
|
80
|
-
return b - a;
|
|
81
|
-
}
|
|
75
|
+
const code = `
|
|
76
|
+
function calculate(a, b) {
|
|
77
|
+
if (a > b) {
|
|
78
|
+
return a - b;
|
|
79
|
+
}
|
|
80
|
+
return b - a;
|
|
81
|
+
}
|
|
82
82
|
`;
|
|
83
83
|
const result = await analyzeComplexity({ code, metrics: 'all' });
|
|
84
84
|
expect(result.content[0].text).toContain('Complexity');
|
|
@@ -102,18 +102,18 @@ function calculate(a, b) {
|
|
|
102
102
|
});
|
|
103
103
|
describe('Python code detection', () => {
|
|
104
104
|
it('should detect and analyze Python code', async () => {
|
|
105
|
-
const pythonCode = `
|
|
106
|
-
def calculate(a, b):
|
|
107
|
-
if a > b:
|
|
108
|
-
return a - b
|
|
109
|
-
return b - a
|
|
110
|
-
|
|
111
|
-
class Calculator:
|
|
112
|
-
def __init__(self):
|
|
113
|
-
self.value = 0
|
|
114
|
-
|
|
115
|
-
def add(self, x):
|
|
116
|
-
self.value += x
|
|
105
|
+
const pythonCode = `
|
|
106
|
+
def calculate(a, b):
|
|
107
|
+
if a > b:
|
|
108
|
+
return a - b
|
|
109
|
+
return b - a
|
|
110
|
+
|
|
111
|
+
class Calculator:
|
|
112
|
+
def __init__(self):
|
|
113
|
+
self.value = 0
|
|
114
|
+
|
|
115
|
+
def add(self, x):
|
|
116
|
+
self.value += x
|
|
117
117
|
`;
|
|
118
118
|
const result = await analyzeComplexity({ code: pythonCode });
|
|
119
119
|
expect(result.content[0].text).toContain('Python');
|
|
@@ -121,34 +121,34 @@ class Calculator:
|
|
|
121
121
|
});
|
|
122
122
|
describe('score calculation', () => {
|
|
123
123
|
it('should give high score for simple code', async () => {
|
|
124
|
-
const simpleCode = `
|
|
125
|
-
function simple() {
|
|
126
|
-
return 42;
|
|
127
|
-
}
|
|
124
|
+
const simpleCode = `
|
|
125
|
+
function simple() {
|
|
126
|
+
return 42;
|
|
127
|
+
}
|
|
128
128
|
`;
|
|
129
129
|
const result = await analyzeComplexity({ code: simpleCode });
|
|
130
130
|
// Simple code should have good score
|
|
131
131
|
expect(result.content[0].text).toContain('Score');
|
|
132
132
|
});
|
|
133
133
|
it('should give lower score for complex code', async () => {
|
|
134
|
-
const complexCode = `
|
|
135
|
-
function veryComplex(a, b, c, d, e, f, g, h) {
|
|
136
|
-
if (a && b || c && d || e && f || g && h) {
|
|
137
|
-
for (let i = 0; i < 10; i++) {
|
|
138
|
-
for (let j = 0; j < 10; j++) {
|
|
139
|
-
if (i > j) {
|
|
140
|
-
switch (i) {
|
|
141
|
-
case 1: break;
|
|
142
|
-
case 2: break;
|
|
143
|
-
case 3: break;
|
|
144
|
-
case 4: break;
|
|
145
|
-
case 5: break;
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
}
|
|
134
|
+
const complexCode = `
|
|
135
|
+
function veryComplex(a, b, c, d, e, f, g, h) {
|
|
136
|
+
if (a && b || c && d || e && f || g && h) {
|
|
137
|
+
for (let i = 0; i < 10; i++) {
|
|
138
|
+
for (let j = 0; j < 10; j++) {
|
|
139
|
+
if (i > j) {
|
|
140
|
+
switch (i) {
|
|
141
|
+
case 1: break;
|
|
142
|
+
case 2: break;
|
|
143
|
+
case 3: break;
|
|
144
|
+
case 4: break;
|
|
145
|
+
case 5: break;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
152
|
`;
|
|
153
153
|
const result = await analyzeComplexity({ code: complexCode });
|
|
154
154
|
expect(result.content[0].text).toContain('Score');
|
|
@@ -157,46 +157,46 @@ function veryComplex(a, b, c, d, e, f, g, h) {
|
|
|
157
157
|
});
|
|
158
158
|
describe('TypeScript code analysis', () => {
|
|
159
159
|
it('should analyze TypeScript code', async () => {
|
|
160
|
-
const tsCode = `
|
|
161
|
-
interface User {
|
|
162
|
-
name: string;
|
|
163
|
-
age: number;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
function greet(user: User): string {
|
|
167
|
-
if (user.age > 18) {
|
|
168
|
-
return \`Hello, \${user.name}!\`;
|
|
169
|
-
}
|
|
170
|
-
return 'Hello!';
|
|
171
|
-
}
|
|
160
|
+
const tsCode = `
|
|
161
|
+
interface User {
|
|
162
|
+
name: string;
|
|
163
|
+
age: number;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
function greet(user: User): string {
|
|
167
|
+
if (user.age > 18) {
|
|
168
|
+
return \`Hello, \${user.name}!\`;
|
|
169
|
+
}
|
|
170
|
+
return 'Hello!';
|
|
171
|
+
}
|
|
172
172
|
`;
|
|
173
173
|
const result = await analyzeComplexity({ code: tsCode });
|
|
174
174
|
expect(result.content[0].text).toContain('Complexity');
|
|
175
175
|
});
|
|
176
176
|
it('should handle class definitions', async () => {
|
|
177
177
|
// Use explicit TypeScript syntax that won't be mistaken for Python
|
|
178
|
-
const tsCode = `
|
|
179
|
-
// TypeScript class
|
|
180
|
-
export class Calculator {
|
|
181
|
-
private value: number = 0;
|
|
182
|
-
|
|
183
|
-
public add(x: number): this {
|
|
184
|
-
this.value += x;
|
|
185
|
-
return this;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
public subtract(x: number): this {
|
|
189
|
-
if (x > this.value) {
|
|
190
|
-
throw new Error('Cannot be negative');
|
|
191
|
-
}
|
|
192
|
-
this.value -= x;
|
|
193
|
-
return this;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
public getValue(): number {
|
|
197
|
-
return this.value;
|
|
198
|
-
}
|
|
199
|
-
}
|
|
178
|
+
const tsCode = `
|
|
179
|
+
// TypeScript class
|
|
180
|
+
export class Calculator {
|
|
181
|
+
private value: number = 0;
|
|
182
|
+
|
|
183
|
+
public add(x: number): this {
|
|
184
|
+
this.value += x;
|
|
185
|
+
return this;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
public subtract(x: number): this {
|
|
189
|
+
if (x > this.value) {
|
|
190
|
+
throw new Error('Cannot be negative');
|
|
191
|
+
}
|
|
192
|
+
this.value -= x;
|
|
193
|
+
return this;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
public getValue(): number {
|
|
197
|
+
return this.value;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
200
|
`;
|
|
201
201
|
const result = await analyzeComplexity({ code: tsCode });
|
|
202
202
|
// Should analyze as TypeScript, not Python
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ToolResult, ToolDefinition } from '../../types/tool.js';
|
|
2
|
+
export declare const getCodingGuideDefinition: ToolDefinition;
|
|
3
|
+
export declare function getCodingGuide(args: {
|
|
4
|
+
name: string;
|
|
5
|
+
category?: string;
|
|
6
|
+
}): Promise<ToolResult>;
|
|
7
|
+
//# sourceMappingURL=getCodingGuide.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getCodingGuide.d.ts","sourceRoot":"","sources":["../../../src/tools/convention/getCodingGuide.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAsCjE,eAAO,MAAM,wBAAwB,EAAE,cAmBtC,CAAC;AAEF,wBAAsB,cAAc,CAAC,IAAI,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAmBnG"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
// Convention management tool - completely independent
|
|
2
|
+
import { promises as fs } from 'fs';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
const GUIDES_DIR = path.join(process.cwd(), 'guides');
|
|
5
|
+
const GUIDES_FILE = path.join(GUIDES_DIR, 'coding_guides.json');
|
|
6
|
+
async function ensureGuidesDir() {
|
|
7
|
+
try {
|
|
8
|
+
await fs.access(GUIDES_DIR);
|
|
9
|
+
}
|
|
10
|
+
catch { /* ignore: optional operation */
|
|
11
|
+
await fs.mkdir(GUIDES_DIR, { recursive: true });
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
async function loadGuides() {
|
|
15
|
+
try {
|
|
16
|
+
await ensureGuidesDir();
|
|
17
|
+
const data = await fs.readFile(GUIDES_FILE, 'utf-8');
|
|
18
|
+
return JSON.parse(data);
|
|
19
|
+
}
|
|
20
|
+
catch { /* ignore: optional operation */
|
|
21
|
+
return [];
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
async function findGuide(name) {
|
|
25
|
+
const guides = await loadGuides();
|
|
26
|
+
return guides.find(g => g.name === name);
|
|
27
|
+
}
|
|
28
|
+
export const getCodingGuideDefinition = {
|
|
29
|
+
name: 'get_coding_guide',
|
|
30
|
+
description: '가이드|규칙|컨벤션|guide|rules|convention|standards|best practices - Get coding guide',
|
|
31
|
+
inputSchema: {
|
|
32
|
+
type: 'object',
|
|
33
|
+
properties: {
|
|
34
|
+
name: { type: 'string', description: 'Guide name to retrieve' },
|
|
35
|
+
category: { type: 'string', description: 'Guide category' }
|
|
36
|
+
},
|
|
37
|
+
required: ['name']
|
|
38
|
+
},
|
|
39
|
+
annotations: {
|
|
40
|
+
title: 'Get Coding Guide',
|
|
41
|
+
audience: ['user', 'assistant'],
|
|
42
|
+
readOnlyHint: true,
|
|
43
|
+
destructiveHint: false,
|
|
44
|
+
idempotentHint: true,
|
|
45
|
+
openWorldHint: false
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
export async function getCodingGuide(args) {
|
|
49
|
+
const { name: guideName, category: guideCategory } = args;
|
|
50
|
+
try {
|
|
51
|
+
const guide = await findGuide(guideName);
|
|
52
|
+
if (guide) {
|
|
53
|
+
return {
|
|
54
|
+
content: [{ type: 'text', text: `Guide: ${guide.name}\nCategory: ${guide.category}\n\n${guide.content}\n\nTags: ${guide.tags.join(', ')} | Updated: ${guide.lastUpdated}` }]
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
return {
|
|
59
|
+
content: [{ type: 'text', text: `Guide not found: "${guideName}". Use list_coding_guides to see available guides.` }]
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
catch (error) {
|
|
64
|
+
return {
|
|
65
|
+
content: [{ type: 'text', text: `Error retrieving guide: ${error instanceof Error ? error.message : 'Unknown error'}` }]
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=getCodingGuide.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getCodingGuide.js","sourceRoot":"","sources":["../../../src/tools/convention/getCodingGuide.ts"],"names":[],"mappings":"AAAA,sDAAsD;AAEtD,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,IAAI,MAAM,MAAM,CAAC;AAaxB,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,QAAQ,CAAC,CAAC;AACtD,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,oBAAoB,CAAC,CAAC;AAEhE,KAAK,UAAU,eAAe;IAC5B,IAAI,CAAC;QACH,MAAM,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,C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