stellavault 0.3.0 → 0.4.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/Autonomous_Knowledge_Foundry.pdf +0 -0
- package/CHANGELOG.md +60 -0
- package/README.md +140 -95
- package/package.json +1 -1
- package/packages/cli/dist/commands/ask-cmd.d.ts +4 -0
- package/packages/cli/dist/commands/ask-cmd.js +35 -0
- package/packages/cli/dist/commands/autopilot-cmd.d.ts +4 -0
- package/packages/cli/dist/commands/autopilot-cmd.js +76 -0
- package/packages/cli/dist/commands/compile-cmd.d.ts +6 -0
- package/packages/cli/dist/commands/compile-cmd.js +30 -0
- package/packages/cli/dist/commands/digest-cmd.d.ts +1 -0
- package/packages/cli/dist/commands/digest-cmd.js +57 -0
- package/packages/cli/dist/commands/fleeting-cmd.d.ts +4 -0
- package/packages/cli/dist/commands/fleeting-cmd.js +45 -0
- package/packages/cli/dist/commands/graph-cmd.js +13 -1
- package/packages/cli/dist/commands/ingest-cmd.d.ts +9 -0
- package/packages/cli/dist/commands/ingest-cmd.js +131 -0
- package/packages/cli/dist/commands/init-cmd.js +39 -1
- package/packages/cli/dist/commands/lint-cmd.d.ts +2 -0
- package/packages/cli/dist/commands/lint-cmd.js +61 -0
- package/packages/cli/dist/index.js +46 -1
- package/packages/cli/package.json +1 -1
- package/packages/core/dist/api/server.js +284 -0
- package/packages/core/dist/i18n/note-strings.d.ts +5 -0
- package/packages/core/dist/i18n/note-strings.js +94 -0
- package/packages/core/dist/index.d.ts +9 -0
- package/packages/core/dist/index.js +5 -0
- package/packages/core/dist/intelligence/ask-engine.d.ts +23 -0
- package/packages/core/dist/intelligence/ask-engine.js +108 -0
- package/packages/core/dist/intelligence/ingest-pipeline.d.ts +31 -0
- package/packages/core/dist/intelligence/ingest-pipeline.js +192 -0
- package/packages/core/dist/intelligence/knowledge-lint.d.ts +27 -0
- package/packages/core/dist/intelligence/knowledge-lint.js +132 -0
- package/packages/core/dist/intelligence/wiki-compiler.d.ts +30 -0
- package/packages/core/dist/intelligence/wiki-compiler.js +222 -0
- package/packages/core/dist/intelligence/youtube-extractor.d.ts +29 -0
- package/packages/core/dist/intelligence/youtube-extractor.js +311 -0
- package/packages/core/dist/intelligence/zettelkasten.d.ts +59 -0
- package/packages/core/dist/intelligence/zettelkasten.js +234 -0
- package/packages/core/dist/mcp/server.d.ts +2 -0
- package/packages/core/dist/mcp/server.js +18 -1
- package/packages/core/dist/mcp/tools/agentic-graph.d.ts +6 -0
- package/packages/core/dist/mcp/tools/agentic-graph.js +35 -7
- package/packages/core/dist/mcp/tools/ask.d.ts +29 -0
- package/packages/core/dist/mcp/tools/ask.js +40 -0
- package/packages/core/package.json +5 -1
|
@@ -29,6 +29,10 @@ export declare function createAgenticGraphTools(store: VectorStore, embedder: Em
|
|
|
29
29
|
type: string;
|
|
30
30
|
description: string;
|
|
31
31
|
};
|
|
32
|
+
autoLink: {
|
|
33
|
+
type: string;
|
|
34
|
+
description: string;
|
|
35
|
+
};
|
|
32
36
|
sourceTitle?: undefined;
|
|
33
37
|
targetTitle?: undefined;
|
|
34
38
|
context?: undefined;
|
|
@@ -41,6 +45,7 @@ export declare function createAgenticGraphTools(store: VectorStore, embedder: Em
|
|
|
41
45
|
tags?: string[];
|
|
42
46
|
type?: string;
|
|
43
47
|
folder?: string;
|
|
48
|
+
autoLink?: boolean;
|
|
44
49
|
}): Promise<{
|
|
45
50
|
content: {
|
|
46
51
|
type: "text";
|
|
@@ -70,6 +75,7 @@ export declare function createAgenticGraphTools(store: VectorStore, embedder: Em
|
|
|
70
75
|
tags?: undefined;
|
|
71
76
|
type?: undefined;
|
|
72
77
|
folder?: undefined;
|
|
78
|
+
autoLink?: undefined;
|
|
73
79
|
};
|
|
74
80
|
required: string[];
|
|
75
81
|
};
|
|
@@ -6,20 +6,42 @@ export function createAgenticGraphTools(store, embedder, vaultPath) {
|
|
|
6
6
|
return [
|
|
7
7
|
{
|
|
8
8
|
name: 'create-knowledge-node',
|
|
9
|
-
description: 'Create a
|
|
9
|
+
description: 'Create a wiki-quality knowledge note in the vault. Auto-finds related documents, generates backlinks, and adds concept tags. The note is saved with proper frontmatter and cross-references.',
|
|
10
10
|
inputSchema: {
|
|
11
11
|
type: 'object',
|
|
12
12
|
properties: {
|
|
13
13
|
title: { type: 'string', description: 'Note title' },
|
|
14
14
|
content: { type: 'string', description: 'Note content (markdown)' },
|
|
15
15
|
tags: { type: 'array', items: { type: 'string' }, description: 'Tags for categorization' },
|
|
16
|
-
type: { type: 'string', description: 'Note type: note, decision, insight, summary' },
|
|
16
|
+
type: { type: 'string', description: 'Note type: note, decision, insight, summary, wiki' },
|
|
17
17
|
folder: { type: 'string', description: 'Vault subfolder (default: 01_Knowledge)' },
|
|
18
|
+
autoLink: { type: 'boolean', description: 'Auto-discover and add links to related notes (default: true)' },
|
|
18
19
|
},
|
|
19
20
|
required: ['title', 'content'],
|
|
20
21
|
},
|
|
21
22
|
async handler(args) {
|
|
22
|
-
const { title, content, tags = [], type = 'note', folder = '01_Knowledge' } = args;
|
|
23
|
+
const { title, content, tags = [], type = 'note', folder = '01_Knowledge', autoLink = true } = args;
|
|
24
|
+
// 관련 문서 자동 탐색
|
|
25
|
+
let relatedSection = '';
|
|
26
|
+
if (autoLink) {
|
|
27
|
+
try {
|
|
28
|
+
const docs = await store.getAllDocuments();
|
|
29
|
+
const titleWords = title.toLowerCase().split(/\s+/).filter(w => w.length > 3);
|
|
30
|
+
const related = docs
|
|
31
|
+
.filter(d => {
|
|
32
|
+
const dTitle = d.title.toLowerCase();
|
|
33
|
+
return titleWords.some(w => dTitle.includes(w)) ||
|
|
34
|
+
tags.some(t => d.tags.includes(t));
|
|
35
|
+
})
|
|
36
|
+
.slice(0, 5);
|
|
37
|
+
if (related.length > 0) {
|
|
38
|
+
relatedSection = '\n\n## Related Notes\n' +
|
|
39
|
+
related.map(r => `- [[${r.title}]]`).join('\n') +
|
|
40
|
+
'\n';
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
catch { /* skip auto-link on error */ }
|
|
44
|
+
}
|
|
23
45
|
// frontmatter 생성
|
|
24
46
|
const date = new Date().toISOString().slice(0, 10);
|
|
25
47
|
const fm = [
|
|
@@ -32,17 +54,23 @@ export function createAgenticGraphTools(store, embedder, vaultPath) {
|
|
|
32
54
|
`auto_generated: true`,
|
|
33
55
|
'---',
|
|
34
56
|
].join('\n');
|
|
35
|
-
const fullContent = `${fm}\n\n# ${title}\n\n${content}`;
|
|
36
|
-
// vault에 파일 저장
|
|
57
|
+
const fullContent = `${fm}\n\n# ${title}\n\n${content}${relatedSection}`;
|
|
58
|
+
// vault에 파일 저장 (path traversal 방지)
|
|
37
59
|
const safeTitle = title.replace(/[<>:"/\\|?*]/g, '').replace(/\s+/g, ' ').trim().slice(0, 80);
|
|
38
60
|
const dir = join(vaultPath, folder);
|
|
39
|
-
mkdirSync(dir, { recursive: true });
|
|
40
61
|
const filePath = join(dir, `${safeTitle}.md`);
|
|
62
|
+
const resolvedPath = require('node:path').resolve(filePath);
|
|
63
|
+
const resolvedVault = require('node:path').resolve(vaultPath);
|
|
64
|
+
if (!resolvedPath.startsWith(resolvedVault)) {
|
|
65
|
+
return { content: [{ type: 'text', text: 'Error: invalid folder path.' }] };
|
|
66
|
+
}
|
|
67
|
+
mkdirSync(dir, { recursive: true });
|
|
41
68
|
writeFileSync(filePath, fullContent, 'utf-8');
|
|
69
|
+
const relatedCount = relatedSection ? relatedSection.split('\n').filter(l => l.startsWith('- ')).length : 0;
|
|
42
70
|
return {
|
|
43
71
|
content: [{
|
|
44
72
|
type: 'text',
|
|
45
|
-
text: `Created
|
|
73
|
+
text: `Created wiki-quality note: "${title}" at ${folder}/${safeTitle}.md\nTags: ${tags.join(', ') || 'none'}\nType: ${type}\nAuto-linked: ${relatedCount} related notes\n\nThe note will appear in the graph after next index.`,
|
|
46
74
|
}],
|
|
47
75
|
};
|
|
48
76
|
},
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { SearchEngine } from '../../search/index.js';
|
|
2
|
+
export declare function createAskTool(searchEngine: SearchEngine, vaultPath: string): {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
inputSchema: {
|
|
6
|
+
type: "object";
|
|
7
|
+
properties: {
|
|
8
|
+
question: {
|
|
9
|
+
type: "string";
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
save: {
|
|
13
|
+
type: "boolean";
|
|
14
|
+
description: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
required: readonly ["question"];
|
|
18
|
+
};
|
|
19
|
+
handler: (args: {
|
|
20
|
+
question: string;
|
|
21
|
+
save?: boolean;
|
|
22
|
+
}) => Promise<{
|
|
23
|
+
content: {
|
|
24
|
+
type: "text";
|
|
25
|
+
text: string;
|
|
26
|
+
}[];
|
|
27
|
+
}>;
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=ask.d.ts.map
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// MCP Tool: ask — Q&A with auto-filing to vault
|
|
2
|
+
import { askVault } from '../../intelligence/ask-engine.js';
|
|
3
|
+
export function createAskTool(searchEngine, vaultPath) {
|
|
4
|
+
return {
|
|
5
|
+
name: 'ask',
|
|
6
|
+
description: 'Ask a question about your knowledge base. Searches vault using hybrid AI search (BM25 + vector + RRF), returns structured results with sources. Use the results to compose your own AI-powered answer. Optionally saves as a new note.',
|
|
7
|
+
inputSchema: {
|
|
8
|
+
type: 'object',
|
|
9
|
+
properties: {
|
|
10
|
+
question: {
|
|
11
|
+
type: 'string',
|
|
12
|
+
description: 'The question to ask about your knowledge',
|
|
13
|
+
},
|
|
14
|
+
save: {
|
|
15
|
+
type: 'boolean',
|
|
16
|
+
description: 'Save the answer as a new note in the vault (default: false)',
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
required: ['question'],
|
|
20
|
+
},
|
|
21
|
+
handler: async (args) => {
|
|
22
|
+
const result = await askVault(searchEngine, args.question, {
|
|
23
|
+
limit: 10,
|
|
24
|
+
save: args.save ?? false,
|
|
25
|
+
vaultPath,
|
|
26
|
+
});
|
|
27
|
+
const text = [
|
|
28
|
+
result.answer,
|
|
29
|
+
'',
|
|
30
|
+
result.savedTo ? `Saved to: ${result.savedTo}` : '',
|
|
31
|
+
'',
|
|
32
|
+
`Sources: ${result.sources.length} documents found`,
|
|
33
|
+
].filter(Boolean).join('\n');
|
|
34
|
+
return {
|
|
35
|
+
content: [{ type: 'text', text }],
|
|
36
|
+
};
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=ask.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stellavault/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Stellavault core engine — indexer, hybrid search, vector store, MCP server",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -9,6 +9,10 @@
|
|
|
9
9
|
".": {
|
|
10
10
|
"import": "./dist/index.js",
|
|
11
11
|
"types": "./dist/index.d.ts"
|
|
12
|
+
},
|
|
13
|
+
"./intelligence/youtube-extractor": {
|
|
14
|
+
"import": "./dist/intelligence/youtube-extractor.js",
|
|
15
|
+
"types": "./dist/intelligence/youtube-extractor.d.ts"
|
|
12
16
|
}
|
|
13
17
|
},
|
|
14
18
|
"scripts": {
|