stellavault 0.4.4 → 0.5.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.
Files changed (265) hide show
  1. package/README.md +52 -16
  2. package/SECURITY.md +50 -0
  3. package/dist/stellavault.js +8968 -0
  4. package/package.json +70 -33
  5. package/.env.example +0 -12
  6. package/CHANGELOG.md +0 -106
  7. package/CLAUDE.md +0 -42
  8. package/CONTRIBUTING.md +0 -65
  9. package/index.html +0 -509
  10. package/packages/cli/bin/ekh.js +0 -2
  11. package/packages/cli/bin/stellavault.js +0 -2
  12. package/packages/cli/dist/commands/adr-cmd.d.ts +0 -7
  13. package/packages/cli/dist/commands/adr-cmd.js +0 -45
  14. package/packages/cli/dist/commands/ask-cmd.d.ts +0 -5
  15. package/packages/cli/dist/commands/ask-cmd.js +0 -36
  16. package/packages/cli/dist/commands/autopilot-cmd.d.ts +0 -4
  17. package/packages/cli/dist/commands/autopilot-cmd.js +0 -76
  18. package/packages/cli/dist/commands/brief-cmd.d.ts +0 -2
  19. package/packages/cli/dist/commands/brief-cmd.js +0 -82
  20. package/packages/cli/dist/commands/capture-cmd.d.ts +0 -7
  21. package/packages/cli/dist/commands/capture-cmd.js +0 -31
  22. package/packages/cli/dist/commands/card-cmd.d.ts +0 -4
  23. package/packages/cli/dist/commands/card-cmd.js +0 -26
  24. package/packages/cli/dist/commands/clip-cmd.d.ts +0 -4
  25. package/packages/cli/dist/commands/clip-cmd.js +0 -151
  26. package/packages/cli/dist/commands/cloud-cmd.d.ts +0 -4
  27. package/packages/cli/dist/commands/cloud-cmd.js +0 -64
  28. package/packages/cli/dist/commands/compile-cmd.d.ts +0 -6
  29. package/packages/cli/dist/commands/compile-cmd.js +0 -30
  30. package/packages/cli/dist/commands/contradictions-cmd.d.ts +0 -2
  31. package/packages/cli/dist/commands/contradictions-cmd.js +0 -34
  32. package/packages/cli/dist/commands/decay-cmd.d.ts +0 -2
  33. package/packages/cli/dist/commands/decay-cmd.js +0 -48
  34. package/packages/cli/dist/commands/digest-cmd.d.ts +0 -5
  35. package/packages/cli/dist/commands/digest-cmd.js +0 -136
  36. package/packages/cli/dist/commands/draft-cmd.d.ts +0 -6
  37. package/packages/cli/dist/commands/draft-cmd.js +0 -110
  38. package/packages/cli/dist/commands/duplicates-cmd.d.ts +0 -4
  39. package/packages/cli/dist/commands/duplicates-cmd.js +0 -30
  40. package/packages/cli/dist/commands/federate-cmd.d.ts +0 -5
  41. package/packages/cli/dist/commands/federate-cmd.js +0 -247
  42. package/packages/cli/dist/commands/fleeting-cmd.d.ts +0 -4
  43. package/packages/cli/dist/commands/fleeting-cmd.js +0 -45
  44. package/packages/cli/dist/commands/flush-cmd.d.ts +0 -2
  45. package/packages/cli/dist/commands/flush-cmd.js +0 -58
  46. package/packages/cli/dist/commands/gaps-cmd.d.ts +0 -2
  47. package/packages/cli/dist/commands/gaps-cmd.js +0 -33
  48. package/packages/cli/dist/commands/graph-cmd.d.ts +0 -2
  49. package/packages/cli/dist/commands/graph-cmd.js +0 -89
  50. package/packages/cli/dist/commands/index-cmd.d.ts +0 -2
  51. package/packages/cli/dist/commands/index-cmd.js +0 -57
  52. package/packages/cli/dist/commands/ingest-cmd.d.ts +0 -9
  53. package/packages/cli/dist/commands/ingest-cmd.js +0 -195
  54. package/packages/cli/dist/commands/init-cmd.d.ts +0 -2
  55. package/packages/cli/dist/commands/init-cmd.js +0 -161
  56. package/packages/cli/dist/commands/learn-cmd.d.ts +0 -2
  57. package/packages/cli/dist/commands/learn-cmd.js +0 -48
  58. package/packages/cli/dist/commands/lint-cmd.d.ts +0 -2
  59. package/packages/cli/dist/commands/lint-cmd.js +0 -61
  60. package/packages/cli/dist/commands/pack-cmd.d.ts +0 -15
  61. package/packages/cli/dist/commands/pack-cmd.js +0 -93
  62. package/packages/cli/dist/commands/review-cmd.d.ts +0 -4
  63. package/packages/cli/dist/commands/review-cmd.js +0 -107
  64. package/packages/cli/dist/commands/search-cmd.d.ts +0 -4
  65. package/packages/cli/dist/commands/search-cmd.js +0 -38
  66. package/packages/cli/dist/commands/serve-cmd.d.ts +0 -2
  67. package/packages/cli/dist/commands/serve-cmd.js +0 -14
  68. package/packages/cli/dist/commands/session-cmd.d.ts +0 -7
  69. package/packages/cli/dist/commands/session-cmd.js +0 -95
  70. package/packages/cli/dist/commands/status-cmd.d.ts +0 -2
  71. package/packages/cli/dist/commands/status-cmd.js +0 -33
  72. package/packages/cli/dist/commands/sync-cmd.d.ts +0 -5
  73. package/packages/cli/dist/commands/sync-cmd.js +0 -62
  74. package/packages/cli/dist/commands/vault-cmd.d.ts +0 -10
  75. package/packages/cli/dist/commands/vault-cmd.js +0 -54
  76. package/packages/cli/dist/index.d.ts +0 -2
  77. package/packages/cli/dist/index.js +0 -233
  78. package/packages/cli/package.json +0 -24
  79. package/packages/core/dist/api/dashboard.d.ts +0 -3
  80. package/packages/core/dist/api/dashboard.js +0 -135
  81. package/packages/core/dist/api/graph-data.d.ts +0 -11
  82. package/packages/core/dist/api/graph-data.js +0 -255
  83. package/packages/core/dist/api/pwa.d.ts +0 -3
  84. package/packages/core/dist/api/pwa.js +0 -77
  85. package/packages/core/dist/api/server.d.ts +0 -16
  86. package/packages/core/dist/api/server.js +0 -1122
  87. package/packages/core/dist/capture/voice.d.ts +0 -24
  88. package/packages/core/dist/capture/voice.js +0 -135
  89. package/packages/core/dist/cloud/index.d.ts +0 -3
  90. package/packages/core/dist/cloud/index.js +0 -2
  91. package/packages/core/dist/cloud/sync.d.ts +0 -29
  92. package/packages/core/dist/cloud/sync.js +0 -137
  93. package/packages/core/dist/config.d.ts +0 -35
  94. package/packages/core/dist/config.js +0 -63
  95. package/packages/core/dist/federation/credits.d.ts +0 -26
  96. package/packages/core/dist/federation/credits.js +0 -56
  97. package/packages/core/dist/federation/identity.d.ts +0 -14
  98. package/packages/core/dist/federation/identity.js +0 -74
  99. package/packages/core/dist/federation/index.d.ts +0 -7
  100. package/packages/core/dist/federation/index.js +0 -5
  101. package/packages/core/dist/federation/node.d.ts +0 -31
  102. package/packages/core/dist/federation/node.js +0 -216
  103. package/packages/core/dist/federation/privacy.d.ts +0 -8
  104. package/packages/core/dist/federation/privacy.js +0 -40
  105. package/packages/core/dist/federation/reputation.d.ts +0 -37
  106. package/packages/core/dist/federation/reputation.js +0 -139
  107. package/packages/core/dist/federation/search.d.ts +0 -19
  108. package/packages/core/dist/federation/search.js +0 -101
  109. package/packages/core/dist/federation/sharing.d.ts +0 -72
  110. package/packages/core/dist/federation/sharing.js +0 -246
  111. package/packages/core/dist/federation/trust.d.ts +0 -15
  112. package/packages/core/dist/federation/trust.js +0 -60
  113. package/packages/core/dist/federation/types.d.ts +0 -40
  114. package/packages/core/dist/federation/types.js +0 -3
  115. package/packages/core/dist/i18n/index.d.ts +0 -6
  116. package/packages/core/dist/i18n/index.js +0 -81
  117. package/packages/core/dist/i18n/note-strings.d.ts +0 -5
  118. package/packages/core/dist/i18n/note-strings.js +0 -94
  119. package/packages/core/dist/index.d.ts +0 -123
  120. package/packages/core/dist/index.js +0 -74
  121. package/packages/core/dist/indexer/chunker.d.ts +0 -14
  122. package/packages/core/dist/indexer/chunker.js +0 -148
  123. package/packages/core/dist/indexer/embedder.d.ts +0 -8
  124. package/packages/core/dist/indexer/embedder.js +0 -3
  125. package/packages/core/dist/indexer/index.d.ts +0 -28
  126. package/packages/core/dist/indexer/index.js +0 -74
  127. package/packages/core/dist/indexer/local-embedder.d.ts +0 -3
  128. package/packages/core/dist/indexer/local-embedder.js +0 -29
  129. package/packages/core/dist/indexer/scanner.d.ts +0 -11
  130. package/packages/core/dist/indexer/scanner.js +0 -148
  131. package/packages/core/dist/indexer/watcher.d.ts +0 -19
  132. package/packages/core/dist/indexer/watcher.js +0 -49
  133. package/packages/core/dist/intelligence/ask-engine.d.ts +0 -24
  134. package/packages/core/dist/intelligence/ask-engine.js +0 -142
  135. package/packages/core/dist/intelligence/auto-linker.d.ts +0 -19
  136. package/packages/core/dist/intelligence/auto-linker.js +0 -126
  137. package/packages/core/dist/intelligence/code-linker.d.ts +0 -20
  138. package/packages/core/dist/intelligence/code-linker.js +0 -88
  139. package/packages/core/dist/intelligence/contradiction-detector.d.ts +0 -20
  140. package/packages/core/dist/intelligence/contradiction-detector.js +0 -115
  141. package/packages/core/dist/intelligence/decay-engine.d.ts +0 -27
  142. package/packages/core/dist/intelligence/decay-engine.js +0 -190
  143. package/packages/core/dist/intelligence/draft-generator.d.ts +0 -25
  144. package/packages/core/dist/intelligence/draft-generator.js +0 -277
  145. package/packages/core/dist/intelligence/duplicate-detector.d.ts +0 -20
  146. package/packages/core/dist/intelligence/duplicate-detector.js +0 -55
  147. package/packages/core/dist/intelligence/file-extractors.d.ts +0 -13
  148. package/packages/core/dist/intelligence/file-extractors.js +0 -155
  149. package/packages/core/dist/intelligence/fsrs.d.ts +0 -43
  150. package/packages/core/dist/intelligence/fsrs.js +0 -70
  151. package/packages/core/dist/intelligence/gap-detector.d.ts +0 -25
  152. package/packages/core/dist/intelligence/gap-detector.js +0 -78
  153. package/packages/core/dist/intelligence/ingest-pipeline.d.ts +0 -32
  154. package/packages/core/dist/intelligence/ingest-pipeline.js +0 -245
  155. package/packages/core/dist/intelligence/knowledge-lint.d.ts +0 -27
  156. package/packages/core/dist/intelligence/knowledge-lint.js +0 -132
  157. package/packages/core/dist/intelligence/learning-path.d.ts +0 -31
  158. package/packages/core/dist/intelligence/learning-path.js +0 -53
  159. package/packages/core/dist/intelligence/notifications.d.ts +0 -31
  160. package/packages/core/dist/intelligence/notifications.js +0 -65
  161. package/packages/core/dist/intelligence/predictive-gaps.d.ts +0 -14
  162. package/packages/core/dist/intelligence/predictive-gaps.js +0 -74
  163. package/packages/core/dist/intelligence/semantic-versioning.d.ts +0 -37
  164. package/packages/core/dist/intelligence/semantic-versioning.js +0 -68
  165. package/packages/core/dist/intelligence/types.d.ts +0 -28
  166. package/packages/core/dist/intelligence/types.js +0 -3
  167. package/packages/core/dist/intelligence/wiki-compiler.d.ts +0 -30
  168. package/packages/core/dist/intelligence/wiki-compiler.js +0 -222
  169. package/packages/core/dist/intelligence/youtube-extractor.d.ts +0 -29
  170. package/packages/core/dist/intelligence/youtube-extractor.js +0 -321
  171. package/packages/core/dist/intelligence/zettelkasten.d.ts +0 -59
  172. package/packages/core/dist/intelligence/zettelkasten.js +0 -234
  173. package/packages/core/dist/mcp/custom-tools.d.ts +0 -29
  174. package/packages/core/dist/mcp/custom-tools.js +0 -70
  175. package/packages/core/dist/mcp/index.d.ts +0 -2
  176. package/packages/core/dist/mcp/index.js +0 -2
  177. package/packages/core/dist/mcp/server.d.ts +0 -51
  178. package/packages/core/dist/mcp/server.js +0 -174
  179. package/packages/core/dist/mcp/tools/agentic-graph.d.ts +0 -93
  180. package/packages/core/dist/mcp/tools/agentic-graph.js +0 -116
  181. package/packages/core/dist/mcp/tools/ask.d.ts +0 -29
  182. package/packages/core/dist/mcp/tools/ask.js +0 -43
  183. package/packages/core/dist/mcp/tools/brief.d.ts +0 -31
  184. package/packages/core/dist/mcp/tools/brief.js +0 -39
  185. package/packages/core/dist/mcp/tools/decay.d.ts +0 -33
  186. package/packages/core/dist/mcp/tools/decay.js +0 -32
  187. package/packages/core/dist/mcp/tools/decision-journal.d.ts +0 -78
  188. package/packages/core/dist/mcp/tools/decision-journal.js +0 -79
  189. package/packages/core/dist/mcp/tools/detect-gaps.d.ts +0 -24
  190. package/packages/core/dist/mcp/tools/detect-gaps.js +0 -47
  191. package/packages/core/dist/mcp/tools/export.d.ts +0 -29
  192. package/packages/core/dist/mcp/tools/export.js +0 -60
  193. package/packages/core/dist/mcp/tools/federated-search.d.ts +0 -29
  194. package/packages/core/dist/mcp/tools/federated-search.js +0 -36
  195. package/packages/core/dist/mcp/tools/generate-claude-md.d.ts +0 -35
  196. package/packages/core/dist/mcp/tools/generate-claude-md.js +0 -107
  197. package/packages/core/dist/mcp/tools/generate-draft.d.ts +0 -34
  198. package/packages/core/dist/mcp/tools/generate-draft.js +0 -120
  199. package/packages/core/dist/mcp/tools/get-document.d.ts +0 -35
  200. package/packages/core/dist/mcp/tools/get-document.js +0 -25
  201. package/packages/core/dist/mcp/tools/get-evolution.d.ts +0 -28
  202. package/packages/core/dist/mcp/tools/get-evolution.js +0 -70
  203. package/packages/core/dist/mcp/tools/get-related.d.ts +0 -32
  204. package/packages/core/dist/mcp/tools/get-related.js +0 -33
  205. package/packages/core/dist/mcp/tools/learning-path.d.ts +0 -23
  206. package/packages/core/dist/mcp/tools/learning-path.js +0 -45
  207. package/packages/core/dist/mcp/tools/link-code.d.ts +0 -34
  208. package/packages/core/dist/mcp/tools/link-code.js +0 -44
  209. package/packages/core/dist/mcp/tools/list-topics.d.ts +0 -15
  210. package/packages/core/dist/mcp/tools/list-topics.js +0 -18
  211. package/packages/core/dist/mcp/tools/search.d.ts +0 -39
  212. package/packages/core/dist/mcp/tools/search.js +0 -29
  213. package/packages/core/dist/mcp/tools/snapshot.d.ts +0 -47
  214. package/packages/core/dist/mcp/tools/snapshot.js +0 -84
  215. package/packages/core/dist/multi-vault/index.d.ts +0 -26
  216. package/packages/core/dist/multi-vault/index.js +0 -80
  217. package/packages/core/dist/pack/creator.d.ts +0 -21
  218. package/packages/core/dist/pack/creator.js +0 -105
  219. package/packages/core/dist/pack/exporter.d.ts +0 -4
  220. package/packages/core/dist/pack/exporter.js +0 -18
  221. package/packages/core/dist/pack/importer.d.ts +0 -10
  222. package/packages/core/dist/pack/importer.js +0 -55
  223. package/packages/core/dist/pack/index.d.ts +0 -6
  224. package/packages/core/dist/pack/index.js +0 -5
  225. package/packages/core/dist/pack/marketplace.d.ts +0 -14
  226. package/packages/core/dist/pack/marketplace.js +0 -90
  227. package/packages/core/dist/pack/pii-masker.d.ts +0 -7
  228. package/packages/core/dist/pack/pii-masker.js +0 -29
  229. package/packages/core/dist/pack/types.d.ts +0 -36
  230. package/packages/core/dist/pack/types.js +0 -3
  231. package/packages/core/dist/plugins/index.d.ts +0 -35
  232. package/packages/core/dist/plugins/index.js +0 -57
  233. package/packages/core/dist/plugins/webhooks.d.ts +0 -30
  234. package/packages/core/dist/plugins/webhooks.js +0 -79
  235. package/packages/core/dist/search/adaptive.d.ts +0 -16
  236. package/packages/core/dist/search/adaptive.js +0 -67
  237. package/packages/core/dist/search/bm25.d.ts +0 -4
  238. package/packages/core/dist/search/bm25.js +0 -10
  239. package/packages/core/dist/search/index.d.ts +0 -15
  240. package/packages/core/dist/search/index.js +0 -64
  241. package/packages/core/dist/search/rrf.d.ts +0 -7
  242. package/packages/core/dist/search/rrf.js +0 -21
  243. package/packages/core/dist/search/semantic.d.ts +0 -5
  244. package/packages/core/dist/search/semantic.js +0 -6
  245. package/packages/core/dist/store/index.d.ts +0 -3
  246. package/packages/core/dist/store/index.js +0 -2
  247. package/packages/core/dist/store/sqlite-vec.d.ts +0 -6
  248. package/packages/core/dist/store/sqlite-vec.js +0 -251
  249. package/packages/core/dist/store/types.d.ts +0 -20
  250. package/packages/core/dist/store/types.js +0 -3
  251. package/packages/core/dist/team/index.d.ts +0 -25
  252. package/packages/core/dist/team/index.js +0 -97
  253. package/packages/core/dist/types/chunk.d.ts +0 -23
  254. package/packages/core/dist/types/chunk.js +0 -3
  255. package/packages/core/dist/types/document.d.ts +0 -23
  256. package/packages/core/dist/types/document.js +0 -3
  257. package/packages/core/dist/types/graph.d.ts +0 -39
  258. package/packages/core/dist/types/graph.js +0 -3
  259. package/packages/core/dist/types/index.d.ts +0 -5
  260. package/packages/core/dist/types/index.js +0 -2
  261. package/packages/core/dist/types/search.d.ts +0 -39
  262. package/packages/core/dist/types/search.js +0 -3
  263. package/packages/core/dist/utils/retry.d.ts +0 -25
  264. package/packages/core/dist/utils/retry.js +0 -59
  265. package/packages/core/package.json +0 -67
@@ -1,120 +0,0 @@
1
- // MCP Tool: generate-draft — Claude Code에서 직접 초안 생성
2
- // Claude가 vault 컨텍스트를 받아 직접 글을 쓰도록 구조화된 재료를 반환
3
- // 비용: $0 (이미 Claude Code 세션 안)
4
- import { scanRawDirectory, extractConcepts } from '../../intelligence/wiki-compiler.js';
5
- import { loadConfig, DEFAULT_FOLDERS } from '../../config.js';
6
- import { resolve } from 'node:path';
7
- import { existsSync } from 'node:fs';
8
- export function createGenerateDraftTool(searchEngine, vaultPath) {
9
- return {
10
- name: 'generate-draft',
11
- description: 'Gather knowledge from your vault to write a draft. Returns structured context (notes, concepts, excerpts) so you can compose a blog post, report, or outline. Use this when the user asks you to "write a draft", "blog post from my notes", or "summarize my knowledge about X".',
12
- inputSchema: {
13
- type: 'object',
14
- properties: {
15
- topic: {
16
- type: 'string',
17
- description: 'Topic or keyword to focus on. Leave empty for all knowledge.',
18
- },
19
- format: {
20
- type: 'string',
21
- enum: ['blog', 'report', 'outline'],
22
- description: 'Desired output format (default: blog)',
23
- },
24
- maxSources: {
25
- type: 'number',
26
- description: 'Maximum number of source documents to include (default: 10)',
27
- },
28
- },
29
- },
30
- handler: async (args) => {
31
- const { topic, format = 'blog', maxSources = 10 } = args;
32
- const config = loadConfig();
33
- const folders = config.folders ?? DEFAULT_FOLDERS;
34
- // 1. 토픽 기반 검색 (있으면)
35
- let searchResults = [];
36
- if (topic) {
37
- const results = await searchEngine.search({ query: topic, limit: maxSources });
38
- searchResults = results.map(r => ({
39
- title: r.document?.title ?? 'Untitled',
40
- content: r.chunk?.content ?? '',
41
- filePath: r.document?.filePath ?? '',
42
- score: r.score ?? 0,
43
- }));
44
- }
45
- // 2. vault 전체 스캔 (검색 결과가 부족하면)
46
- const allDocs = [];
47
- for (const dir of [folders.fleeting, folders.literature, folders.permanent, folders.wiki]) {
48
- const fullDir = resolve(vaultPath, dir);
49
- if (existsSync(fullDir)) {
50
- const docs = scanRawDirectory(fullDir);
51
- allDocs.push(...docs);
52
- }
53
- }
54
- // 토픽 필터
55
- const relevantDocs = topic
56
- ? allDocs.filter(d => d.title.toLowerCase().includes(topic.toLowerCase()) ||
57
- d.tags.some(t => t.toLowerCase().includes(topic.toLowerCase())) ||
58
- d.content.toLowerCase().includes(topic.toLowerCase()))
59
- : allDocs;
60
- // 3. 개념 추출
61
- const concepts = extractConcepts(relevantDocs.length > 0 ? relevantDocs : allDocs);
62
- const topConcepts = [...concepts.entries()]
63
- .sort((a, b) => b[1].length - a[1].length)
64
- .slice(0, 8)
65
- .map(([name, docs]) => ({ name, documentCount: docs.length }));
66
- // 4. 발췌 준비
67
- const excerpts = (searchResults.length > 0 ? searchResults : relevantDocs.slice(0, maxSources))
68
- .map(doc => {
69
- const body = doc.content
70
- .replace(/^---[\s\S]*?---\n?/, '') // frontmatter 제거
71
- .replace(/^#+\s+.+\n/m, '') // 첫 heading 제거
72
- .trim()
73
- .slice(0, 500);
74
- return {
75
- title: doc.title,
76
- excerpt: body,
77
- filePath: doc.filePath,
78
- };
79
- })
80
- .filter(e => e.excerpt.length > 20);
81
- // 5. 구조화된 컨텍스트 반환
82
- const context = {
83
- topic: topic ?? 'All Knowledge',
84
- format,
85
- totalDocuments: relevantDocs.length || allDocs.length,
86
- concepts: topConcepts,
87
- sources: excerpts,
88
- instruction: `Use the sources above to write a ${format}. Rules:
89
- - Only use information from the provided sources
90
- - Cite sources using [[title]] wikilink format
91
- - Write in the same language as the source material
92
- - Add your analysis connecting ideas across sources
93
- - Format: ${format === 'blog' ? 'Engaging blog post with intro, body sections, conclusion' : format === 'report' ? 'Formal report with executive summary, sections, conclusion' : 'Hierarchical outline with numbered sections'}`,
94
- };
95
- const text = `# Draft Context: ${context.topic}
96
-
97
- ## Format: ${format}
98
- ## Sources: ${context.totalDocuments} documents, ${excerpts.length} excerpts
99
-
100
- ## Key Concepts
101
- ${topConcepts.map(c => `- **${c.name}** (${c.documentCount} documents)`).join('\n')}
102
-
103
- ## Source Excerpts
104
-
105
- ${excerpts.map(e => `### ${e.title}
106
- > ${e.excerpt}
107
- `).join('\n')}
108
-
109
- ## Instructions
110
- ${context.instruction}
111
-
112
- ---
113
- Please write the ${format} draft based on the context above. Save the result to the vault's _drafts/ folder.`;
114
- return {
115
- content: [{ type: 'text', text }],
116
- };
117
- },
118
- };
119
- }
120
- //# sourceMappingURL=generate-draft.js.map
@@ -1,35 +0,0 @@
1
- import type { VectorStore } from '../../store/types.js';
2
- export declare const getDocumentToolDef: {
3
- name: string;
4
- description: string;
5
- inputSchema: {
6
- type: "object";
7
- properties: {
8
- id: {
9
- type: string;
10
- description: string;
11
- };
12
- };
13
- required: string[];
14
- };
15
- };
16
- export declare function handleGetDocument(store: VectorStore, args: {
17
- id: string;
18
- }): Promise<{
19
- error: string;
20
- title?: undefined;
21
- filePath?: undefined;
22
- content?: undefined;
23
- tags?: undefined;
24
- frontmatter?: undefined;
25
- lastModified?: undefined;
26
- } | {
27
- title: string;
28
- filePath: string;
29
- content: string;
30
- tags: string[];
31
- frontmatter: Record<string, unknown>;
32
- lastModified: string;
33
- error?: undefined;
34
- }>;
35
- //# sourceMappingURL=get-document.d.ts.map
@@ -1,25 +0,0 @@
1
- export const getDocumentToolDef = {
2
- name: 'get-document',
3
- description: '문서 ID 또는 파일 경로로 전체 문서 내용을 가져옵니다.',
4
- inputSchema: {
5
- type: 'object',
6
- properties: {
7
- id: { type: 'string', description: '문서 ID 또는 파일 경로' },
8
- },
9
- required: ['id'],
10
- },
11
- };
12
- export async function handleGetDocument(store, args) {
13
- const doc = await store.getDocument(args.id);
14
- if (!doc)
15
- return { error: `Document not found: ${args.id}` };
16
- return {
17
- title: doc.title,
18
- filePath: doc.filePath,
19
- content: doc.content,
20
- tags: doc.tags,
21
- frontmatter: doc.frontmatter,
22
- lastModified: doc.lastModified,
23
- };
24
- }
25
- //# sourceMappingURL=get-document.js.map
@@ -1,28 +0,0 @@
1
- import type { VectorStore } from '../../store/types.js';
2
- export declare function createGetEvolutionTool(store: VectorStore): {
3
- name: string;
4
- description: string;
5
- inputSchema: {
6
- type: "object";
7
- properties: {
8
- topic: {
9
- type: "string";
10
- description: string;
11
- };
12
- limit: {
13
- type: "number";
14
- description: string;
15
- };
16
- };
17
- };
18
- handler: (args: {
19
- topic?: string;
20
- limit?: number;
21
- }) => Promise<{
22
- content: {
23
- type: "text";
24
- text: string;
25
- }[];
26
- }>;
27
- };
28
- //# sourceMappingURL=get-evolution.d.ts.map
@@ -1,70 +0,0 @@
1
- // Design Ref: F02 — 지식 진화 타임라인 MCP tool
2
- // Plan SC: SC-01 주제별 드리프트 반환
3
- export function createGetEvolutionTool(store) {
4
- return {
5
- name: 'get-evolution',
6
- description: 'Track semantic evolution of knowledge. Shows which topics have changed the most in meaning over time.',
7
- inputSchema: {
8
- type: 'object',
9
- properties: {
10
- topic: {
11
- type: 'string',
12
- description: 'Optional topic/tag to filter. Omit for vault-wide analysis.',
13
- },
14
- limit: {
15
- type: 'number',
16
- description: 'Max results to return (default: 10)',
17
- },
18
- },
19
- },
20
- handler: async (args) => {
21
- const limit = args.limit ?? 10;
22
- const docs = await store.getAllDocuments();
23
- const embeddings = await store.getDocumentEmbeddings();
24
- // Filter by topic/tag if provided
25
- let filteredDocs = docs;
26
- if (args.topic) {
27
- const topicLower = args.topic.toLowerCase();
28
- filteredDocs = docs.filter((d) => d.tags.some((t) => t.toLowerCase().includes(topicLower)) ||
29
- d.title.toLowerCase().includes(topicLower));
30
- }
31
- // Build embedding maps (current only — single-point, but foundation for multi-version)
32
- const currentEmbeddings = new Map();
33
- const titles = new Map();
34
- for (const doc of filteredDocs) {
35
- const emb = embeddings.get(doc.id);
36
- if (emb) {
37
- currentEmbeddings.set(doc.id, emb);
38
- titles.set(doc.id, doc.title);
39
- }
40
- }
41
- // For now, use modification time as proxy for "evolution"
42
- // Sort by most recently modified with content changes
43
- const recentlyChanged = filteredDocs
44
- .filter((d) => d.lastModified)
45
- .sort((a, b) => new Date(b.lastModified).getTime() - new Date(a.lastModified).getTime())
46
- .slice(0, limit)
47
- .map((d) => ({
48
- documentId: d.id,
49
- title: d.title,
50
- lastModified: d.lastModified,
51
- tags: d.tags.slice(0, 5),
52
- daysSinceModified: Math.round((Date.now() - new Date(d.lastModified).getTime()) / 86400000),
53
- }));
54
- return {
55
- content: [{
56
- type: 'text',
57
- text: JSON.stringify({
58
- topic: args.topic ?? 'all',
59
- totalDocuments: filteredDocs.length,
60
- recentlyEvolved: recentlyChanged,
61
- summary: recentlyChanged.length > 0
62
- ? `최근 변화가 가장 큰 문서: "${recentlyChanged[0].title}" (${recentlyChanged[0].daysSinceModified}일 전 수정)`
63
- : '분석할 문서가 없습니다.',
64
- }, null, 2),
65
- }],
66
- };
67
- },
68
- };
69
- }
70
- //# sourceMappingURL=get-evolution.js.map
@@ -1,32 +0,0 @@
1
- import type { SearchEngine } from '../../search/index.js';
2
- import type { VectorStore } from '../../store/types.js';
3
- export declare const getRelatedToolDef: {
4
- name: string;
5
- description: string;
6
- inputSchema: {
7
- type: "object";
8
- properties: {
9
- id: {
10
- type: string;
11
- description: string;
12
- };
13
- limit: {
14
- type: string;
15
- description: string;
16
- };
17
- };
18
- required: string[];
19
- };
20
- };
21
- export declare function handleGetRelated(store: VectorStore, searchEngine: SearchEngine, args: {
22
- id: string;
23
- limit?: number;
24
- }): Promise<{
25
- title: string;
26
- filePath: string;
27
- score: number;
28
- tags: string[];
29
- }[] | {
30
- error: string;
31
- }>;
32
- //# sourceMappingURL=get-related.d.ts.map
@@ -1,33 +0,0 @@
1
- export const getRelatedToolDef = {
2
- name: 'get-related',
3
- description: '특정 문서와 의미적으로 관련된 문서들을 반환합니다.',
4
- inputSchema: {
5
- type: 'object',
6
- properties: {
7
- id: { type: 'string', description: '기준 문서 ID 또는 파일 경로' },
8
- limit: { type: 'number', description: '반환할 관련 문서 수 (기본: 5)' },
9
- },
10
- required: ['id'],
11
- },
12
- };
13
- export async function handleGetRelated(store, searchEngine, args) {
14
- const doc = await store.getDocument(args.id);
15
- if (!doc)
16
- return { error: `Document not found: ${args.id}` };
17
- // 문서 제목+내용 일부를 쿼리로 사용하여 관련 문서 검색
18
- const query = `${doc.title} ${doc.content.slice(0, 200)}`;
19
- const results = await searchEngine.search({
20
- query,
21
- limit: (args.limit ?? 5) + 1, // 자기 자신 제외용 +1
22
- });
23
- return results
24
- .filter(r => r.document.id !== args.id)
25
- .slice(0, args.limit ?? 5)
26
- .map(r => ({
27
- title: r.document.title,
28
- filePath: r.document.filePath,
29
- score: Math.round(r.score * 1000) / 1000,
30
- tags: r.document.tags,
31
- }));
32
- }
33
- //# sourceMappingURL=get-related.js.map
@@ -1,23 +0,0 @@
1
- import type { VectorStore } from '../../store/types.js';
2
- export declare function createLearningPathTool(store: VectorStore): {
3
- name: string;
4
- description: string;
5
- inputSchema: {
6
- type: "object";
7
- properties: {
8
- limit: {
9
- type: string;
10
- description: string;
11
- };
12
- };
13
- };
14
- handler(args: {
15
- limit?: number;
16
- }): Promise<{
17
- content: {
18
- type: "text";
19
- text: string;
20
- }[];
21
- }>;
22
- };
23
- //# sourceMappingURL=learning-path.d.ts.map
@@ -1,45 +0,0 @@
1
- // MCP Tool: get-learning-path (F-A11)
2
- import { DecayEngine } from '../../intelligence/decay-engine.js';
3
- import { detectKnowledgeGaps } from '../../intelligence/gap-detector.js';
4
- import { generateLearningPath } from '../../intelligence/learning-path.js';
5
- export function createLearningPathTool(store) {
6
- return {
7
- name: 'get-learning-path',
8
- description: 'Generate a personalized learning path based on knowledge decay and gaps. Returns prioritized list of what to review, explore, or bridge.',
9
- inputSchema: {
10
- type: 'object',
11
- properties: {
12
- limit: { type: 'number', description: 'Max items to return (default: 10)' },
13
- },
14
- },
15
- async handler(args) {
16
- const limit = args.limit ?? 10;
17
- const db = store.getDb();
18
- if (!db)
19
- return { content: [{ type: 'text', text: 'Database not available' }] };
20
- const decayEngine = new DecayEngine(db);
21
- const decayReport = await decayEngine.computeAll();
22
- let gaps = [];
23
- try {
24
- const gapReport = await detectKnowledgeGaps(store);
25
- gaps = gapReport.gaps ?? [];
26
- }
27
- catch { /* ignore */ }
28
- const path = generateLearningPath({ decayReport, gaps }, limit);
29
- const lines = [
30
- `🎯 Learning Path (${path.items.length} items, ~${path.summary.estimatedMinutes}min)`,
31
- '',
32
- ];
33
- for (const item of path.items) {
34
- const icon = item.category === 'review' ? '📖' : item.category === 'bridge' ? '🌉' : '🔭';
35
- lines.push(`${icon} [${item.priority}] ${item.title} (${item.score}pt)`);
36
- lines.push(` ${item.reason}`);
37
- }
38
- if (path.items.length === 0) {
39
- lines.push('All clear! Knowledge is in great shape.');
40
- }
41
- return { content: [{ type: 'text', text: lines.join('\n') }] };
42
- },
43
- };
44
- }
45
- //# sourceMappingURL=learning-path.js.map
@@ -1,34 +0,0 @@
1
- import type { SearchEngine } from '../../search/index.js';
2
- export declare function createLinkCodeTool(searchEngine: SearchEngine): {
3
- name: string;
4
- description: string;
5
- inputSchema: {
6
- type: "object";
7
- properties: {
8
- filePath: {
9
- type: "string";
10
- description: string;
11
- };
12
- content: {
13
- type: "string";
14
- description: string;
15
- };
16
- limit: {
17
- type: "number";
18
- description: string;
19
- };
20
- };
21
- required: readonly ["filePath"];
22
- };
23
- handler: (args: {
24
- filePath: string;
25
- content?: string;
26
- limit?: number;
27
- }) => Promise<{
28
- content: {
29
- type: "text";
30
- text: string;
31
- }[];
32
- }>;
33
- };
34
- //# sourceMappingURL=link-code.d.ts.map
@@ -1,44 +0,0 @@
1
- // Design Ref: F15 — 코드-지식 링커 MCP tool
2
- // Plan SC: SC-03 코드 파일에서 관련 노트 매칭
3
- import { linkCodeToKnowledge } from '../../intelligence/code-linker.js';
4
- export function createLinkCodeTool(searchEngine) {
5
- return {
6
- name: 'link-code',
7
- description: 'Find knowledge notes related to a code file. Extracts keywords from file path and content, then searches the knowledge base.',
8
- inputSchema: {
9
- type: 'object',
10
- properties: {
11
- filePath: {
12
- type: 'string',
13
- description: 'Path to the code file (e.g., src/auth/middleware.ts)',
14
- },
15
- content: {
16
- type: 'string',
17
- description: 'Optional: code file content for deeper keyword extraction',
18
- },
19
- limit: {
20
- type: 'number',
21
- description: 'Max related notes to return (default: 5)',
22
- },
23
- },
24
- required: ['filePath'],
25
- },
26
- handler: async (args) => {
27
- const result = await linkCodeToKnowledge(searchEngine, args.filePath, args.content, args.limit ?? 5);
28
- return {
29
- content: [{
30
- type: 'text',
31
- text: JSON.stringify({
32
- filePath: result.filePath,
33
- extractedKeywords: result.keywords,
34
- relatedNotes: result.relatedNotes,
35
- summary: result.relatedNotes.length > 0
36
- ? `"${result.filePath}" 관련 노트 ${result.relatedNotes.length}개 발견. 최상위: "${result.relatedNotes[0].title}"`
37
- : `"${result.filePath}"에 대한 관련 노트를 찾지 못했습니다.`,
38
- }, null, 2),
39
- }],
40
- };
41
- },
42
- };
43
- }
44
- //# sourceMappingURL=link-code.js.map
@@ -1,15 +0,0 @@
1
- import type { VectorStore } from '../../store/types.js';
2
- export declare const listTopicsToolDef: {
3
- name: string;
4
- description: string;
5
- inputSchema: {
6
- type: "object";
7
- properties: {};
8
- };
9
- };
10
- export declare function handleListTopics(store: VectorStore): Promise<{
11
- topics: import("../../index.js").TopicInfo[];
12
- totalDocuments: number;
13
- totalChunks: number;
14
- }>;
15
- //# sourceMappingURL=list-topics.d.ts.map
@@ -1,18 +0,0 @@
1
- export const listTopicsToolDef = {
2
- name: 'list-topics',
3
- description: '지식 베이스의 전체 토픽/태그 목록과 문서 수를 반환합니다.',
4
- inputSchema: {
5
- type: 'object',
6
- properties: {},
7
- },
8
- };
9
- export async function handleListTopics(store) {
10
- const topics = await store.getTopics();
11
- const stats = await store.getStats();
12
- return {
13
- topics,
14
- totalDocuments: stats.documentCount,
15
- totalChunks: stats.chunkCount,
16
- };
17
- }
18
- //# sourceMappingURL=list-topics.js.map
@@ -1,39 +0,0 @@
1
- import type { SearchEngine } from '../../search/index.js';
2
- export declare const searchToolDef: {
3
- name: string;
4
- description: string;
5
- inputSchema: {
6
- type: "object";
7
- properties: {
8
- query: {
9
- type: string;
10
- description: string;
11
- };
12
- limit: {
13
- type: string;
14
- description: string;
15
- };
16
- tags: {
17
- type: string;
18
- items: {
19
- type: string;
20
- };
21
- description: string;
22
- };
23
- };
24
- required: string[];
25
- };
26
- };
27
- export declare function handleSearch(searchEngine: SearchEngine, args: {
28
- query: string;
29
- limit?: number;
30
- tags?: string[];
31
- }): Promise<{
32
- title: string;
33
- filePath: string;
34
- heading: string;
35
- content: string;
36
- score: number;
37
- tags: string[];
38
- }[]>;
39
- //# sourceMappingURL=search.d.ts.map
@@ -1,29 +0,0 @@
1
- export const searchToolDef = {
2
- name: 'search',
3
- description: '개인 지식 베이스에서 관련 문서/청크를 검색합니다. 자연어 쿼리와 키워드 모두 지원합니다.',
4
- inputSchema: {
5
- type: 'object',
6
- properties: {
7
- query: { type: 'string', description: '검색 쿼리 (자연어 또는 키워드)' },
8
- limit: { type: 'number', description: '반환할 결과 수 (기본: 5)' },
9
- tags: { type: 'array', items: { type: 'string' }, description: '태그 필터' },
10
- },
11
- required: ['query'],
12
- },
13
- };
14
- export async function handleSearch(searchEngine, args) {
15
- const results = await searchEngine.search({
16
- query: args.query,
17
- limit: args.limit ?? 5,
18
- tags: args.tags,
19
- });
20
- return results.map(r => ({
21
- title: r.document.title,
22
- filePath: r.document.filePath,
23
- heading: r.chunk.heading,
24
- content: r.chunk.content,
25
- score: Math.round(r.score * 1000) / 1000,
26
- tags: r.document.tags,
27
- }));
28
- }
29
- //# sourceMappingURL=search.js.map
@@ -1,47 +0,0 @@
1
- import type { SearchEngine } from '../../search/index.js';
2
- export declare const createSnapshotToolDef: {
3
- name: string;
4
- description: string;
5
- inputSchema: {
6
- type: "object";
7
- properties: {
8
- name: {
9
- type: string;
10
- description: string;
11
- };
12
- queries: {
13
- type: string;
14
- items: {
15
- type: string;
16
- };
17
- description: string;
18
- };
19
- };
20
- required: string[];
21
- };
22
- };
23
- export declare const loadSnapshotToolDef: {
24
- name: string;
25
- description: string;
26
- inputSchema: {
27
- type: "object";
28
- properties: {
29
- name: {
30
- type: string;
31
- description: string;
32
- };
33
- };
34
- required: string[];
35
- };
36
- };
37
- export declare function handleCreateSnapshot(searchEngine: SearchEngine, args: {
38
- name: string;
39
- queries: string[];
40
- }): Promise<{
41
- saved: string;
42
- resultCount: number;
43
- }>;
44
- export declare function handleLoadSnapshot(args: {
45
- name: string;
46
- }): Promise<any>;
47
- //# sourceMappingURL=snapshot.d.ts.map