@knowledgine/cli 0.6.1 → 0.6.3
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/dist/CLAUDE.md +7 -0
- package/dist/commands/benchmark.d.ts +6 -0
- package/dist/commands/benchmark.d.ts.map +1 -0
- package/dist/commands/benchmark.js +136 -0
- package/dist/commands/benchmark.js.map +1 -0
- package/dist/commands/deprecation-check.d.ts +1 -0
- package/dist/commands/deprecation-check.d.ts.map +1 -1
- package/dist/commands/deprecation-check.js +23 -5
- package/dist/commands/deprecation-check.js.map +1 -1
- package/dist/commands/doctor.d.ts +23 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +600 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/explain.d.ts.map +1 -1
- package/dist/commands/explain.js +4 -1
- package/dist/commands/explain.js.map +1 -1
- package/dist/commands/ingest.d.ts +1 -0
- package/dist/commands/ingest.d.ts.map +1 -1
- package/dist/commands/ingest.js +142 -2
- package/dist/commands/ingest.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +2 -0
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/search.d.ts +2 -1
- package/dist/commands/search.d.ts.map +1 -1
- package/dist/commands/search.js +54 -14
- package/dist/commands/search.js.map +1 -1
- package/dist/commands/serve.d.ts +1 -0
- package/dist/commands/serve.d.ts.map +1 -1
- package/dist/commands/serve.js +16 -1
- package/dist/commands/serve.js.map +1 -1
- package/dist/commands/setup.d.ts.map +1 -1
- package/dist/commands/setup.js +8 -0
- package/dist/commands/setup.js.map +1 -1
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +5 -2
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/suggest.d.ts.map +1 -1
- package/dist/commands/suggest.js +12 -0
- package/dist/commands/suggest.js.map +1 -1
- package/dist/commands/upgrade.d.ts +1 -0
- package/dist/commands/upgrade.d.ts.map +1 -1
- package/dist/commands/upgrade.js +99 -2
- package/dist/commands/upgrade.js.map +1 -1
- package/dist/index.js +45 -10
- package/dist/index.js.map +1 -1
- package/dist/lib/entity-extractor.d.ts +17 -0
- package/dist/lib/entity-extractor.d.ts.map +1 -0
- package/dist/lib/entity-extractor.js +22 -0
- package/dist/lib/entity-extractor.js.map +1 -0
- package/dist/lib/formatter.d.ts.map +1 -1
- package/dist/lib/formatter.js +13 -8
- package/dist/lib/formatter.js.map +1 -1
- package/dist/templates/skills/knowledgine-explain/references.d.ts +2 -0
- package/dist/templates/skills/knowledgine-explain/references.d.ts.map +1 -0
- package/dist/templates/skills/knowledgine-explain/references.js +183 -0
- package/dist/templates/skills/knowledgine-explain/references.js.map +1 -0
- package/dist/templates/skills/knowledgine-explain/skill-md.d.ts +2 -0
- package/dist/templates/skills/knowledgine-explain/skill-md.d.ts.map +1 -0
- package/dist/templates/skills/knowledgine-explain/skill-md.js +89 -0
- package/dist/templates/skills/knowledgine-explain/skill-md.js.map +1 -0
- package/dist/templates/skills/knowledgine-recall/references.d.ts +2 -0
- package/dist/templates/skills/knowledgine-recall/references.d.ts.map +1 -0
- package/dist/templates/skills/knowledgine-recall/references.js +207 -0
- package/dist/templates/skills/knowledgine-recall/references.js.map +1 -0
- package/dist/templates/skills/knowledgine-recall/skill-md.d.ts +2 -0
- package/dist/templates/skills/knowledgine-recall/skill-md.d.ts.map +1 -0
- package/dist/templates/skills/knowledgine-recall/skill-md.js +86 -0
- package/dist/templates/skills/knowledgine-recall/skill-md.js.map +1 -0
- package/dist/templates/skills/knowledgine-suggest/references.d.ts +2 -0
- package/dist/templates/skills/knowledgine-suggest/references.d.ts.map +1 -0
- package/dist/templates/skills/knowledgine-suggest/references.js +121 -0
- package/dist/templates/skills/knowledgine-suggest/references.js.map +1 -0
- package/dist/templates/skills/knowledgine-suggest/skill-md.d.ts +2 -0
- package/dist/templates/skills/knowledgine-suggest/skill-md.d.ts.map +1 -0
- package/dist/templates/skills/knowledgine-suggest/skill-md.js +94 -0
- package/dist/templates/skills/knowledgine-suggest/skill-md.js.map +1 -0
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -20,6 +20,8 @@ import { registerFeedbackSuggestCommand } from "./commands/feedback-suggest.js";
|
|
|
20
20
|
import { registerServeCommand } from "./commands/serve.js";
|
|
21
21
|
import { deprecationCheckCommand } from "./commands/deprecation-check.js";
|
|
22
22
|
import { undeprecateCommand } from "./commands/undeprecate.js";
|
|
23
|
+
import { doctorCommand } from "./commands/doctor.js";
|
|
24
|
+
import { benchmarkCommand } from "./commands/benchmark.js";
|
|
23
25
|
import { createOutputErrorHandler } from "./lib/unknown-command-handler.js";
|
|
24
26
|
const program = new Command();
|
|
25
27
|
program
|
|
@@ -27,13 +29,16 @@ program
|
|
|
27
29
|
.description("Developer Knowledge Infrastructure - Extract structured knowledge from your codebase")
|
|
28
30
|
.version(`v${VERSION} (node ${process.version})`)
|
|
29
31
|
.addHelpText("after", `
|
|
30
|
-
|
|
31
|
-
1. knowledgine init --path
|
|
32
|
-
2. knowledgine
|
|
33
|
-
3. knowledgine
|
|
32
|
+
Quick Start:
|
|
33
|
+
1. knowledgine init --path . Index your files
|
|
34
|
+
2. knowledgine ingest --all --path . Ingest from all sources
|
|
35
|
+
3. knowledgine search "query" Search your knowledge base
|
|
34
36
|
|
|
35
|
-
|
|
36
|
-
knowledgine
|
|
37
|
+
MCP Integration:
|
|
38
|
+
1. knowledgine init --path .
|
|
39
|
+
2. knowledgine ingest --all --path .
|
|
40
|
+
3. knowledgine setup --target claude-code
|
|
41
|
+
4. knowledgine start --path .
|
|
37
42
|
|
|
38
43
|
Run 'knowledgine <command> --help' for more information on a command.`);
|
|
39
44
|
program
|
|
@@ -91,14 +96,22 @@ program
|
|
|
91
96
|
Example:
|
|
92
97
|
knowledgine status --path ~/notes`)
|
|
93
98
|
.action(statusCommand);
|
|
99
|
+
// Top-level stats alias (shortcut for tool stats)
|
|
100
|
+
program
|
|
101
|
+
.command("stats")
|
|
102
|
+
.description("Show knowledge base statistics (alias for status)")
|
|
103
|
+
.option("--path <dir>", "Root directory to check")
|
|
104
|
+
.action(statusCommand);
|
|
94
105
|
program
|
|
95
106
|
.command("upgrade")
|
|
96
107
|
.description("Upgrade knowledgine capabilities")
|
|
97
108
|
.option("--semantic", "Enable semantic search (download model + generate embeddings)")
|
|
109
|
+
.option("--reindex", "Delete and regenerate all embeddings (use after switching embedding models)")
|
|
98
110
|
.option("--path <dir>", "Root directory")
|
|
99
111
|
.addHelpText("after", `
|
|
100
|
-
|
|
101
|
-
knowledgine upgrade --semantic --path ~/notes
|
|
112
|
+
Examples:
|
|
113
|
+
knowledgine upgrade --semantic --path ~/notes
|
|
114
|
+
knowledgine upgrade --reindex`)
|
|
102
115
|
.action(upgradeCommand);
|
|
103
116
|
program
|
|
104
117
|
.command("ingest")
|
|
@@ -119,6 +132,7 @@ program
|
|
|
119
132
|
.option("--observe", "Run Observer/Reflector agents after ingestion")
|
|
120
133
|
.option("--no-observe", "Skip Observer/Reflector agents")
|
|
121
134
|
.option("--observe-limit <n>", "Max notes to process with Observer", parseInt)
|
|
135
|
+
.option("--no-embeddings", "Skip embedding generation after ingest (semantic search will not work for these notes)")
|
|
122
136
|
.addHelpText("after", `
|
|
123
137
|
Examples:
|
|
124
138
|
knowledgine ingest --source markdown --path ~/notes
|
|
@@ -191,10 +205,11 @@ program
|
|
|
191
205
|
.command("search <query>")
|
|
192
206
|
.description("Search indexed notes")
|
|
193
207
|
.option("--demo", "Search in demo notes")
|
|
194
|
-
.option("--mode <mode>", "Search mode: keyword, semantic, hybrid
|
|
208
|
+
.option("--mode <mode>", "Search mode: keyword, semantic, hybrid (default: auto-detect)")
|
|
195
209
|
.option("--limit <n>", "Maximum results", "20")
|
|
196
210
|
.option("--format <format>", "Output format: json, table, plain", "plain")
|
|
197
|
-
.option("--related
|
|
211
|
+
.option("--related", "Find related notes (uses query as note ID or entity name)")
|
|
212
|
+
.option("--related-entity <name>", "Explicitly specify entity name for related search")
|
|
198
213
|
.option("--related-file <path>", "Find related notes by file path")
|
|
199
214
|
.option("--path <dir>", "Root directory")
|
|
200
215
|
.option("--no-fallback", "Exit with error if requested search mode is unavailable (instead of falling back to keyword)")
|
|
@@ -208,6 +223,7 @@ program
|
|
|
208
223
|
limit: Number(opts.limit),
|
|
209
224
|
format: opts.format,
|
|
210
225
|
related: opts.related,
|
|
226
|
+
relatedEntity: opts.relatedEntity,
|
|
211
227
|
relatedFile: opts.relatedFile,
|
|
212
228
|
path: opts.path,
|
|
213
229
|
fallback: opts.fallback,
|
|
@@ -250,12 +266,31 @@ program
|
|
|
250
266
|
.option("--path <dir>", "Root directory")
|
|
251
267
|
.option("--apply", "Apply deprecation (default: dry-run)")
|
|
252
268
|
.option("--threshold <n>", "Similarity threshold (0-1, default: 0.8)", "0.8")
|
|
269
|
+
.option("--exclude-translations", "Exclude translation files (.po, .xlf) from comparison")
|
|
253
270
|
.action(deprecationCheckCommand);
|
|
254
271
|
program
|
|
255
272
|
.command("undeprecate <noteId>")
|
|
256
273
|
.description("Restore a deprecated note to active status")
|
|
257
274
|
.option("--path <dir>", "Root directory")
|
|
258
275
|
.action(undeprecateCommand);
|
|
276
|
+
program
|
|
277
|
+
.command("doctor")
|
|
278
|
+
.description("Run comprehensive health checks on your knowledge base")
|
|
279
|
+
.option("--path <dir>", "Root directory to check")
|
|
280
|
+
.option("--fix", "Automatically fix issues where possible")
|
|
281
|
+
.addHelpText("after", `
|
|
282
|
+
Example:
|
|
283
|
+
knowledgine doctor --path ~/notes`)
|
|
284
|
+
.action(doctorCommand);
|
|
285
|
+
program
|
|
286
|
+
.command("benchmark")
|
|
287
|
+
.description("Run benchmarks on the knowledge base")
|
|
288
|
+
.option("--path <dir>", "Root directory")
|
|
289
|
+
.option("--semantic", "Analyze semantic score distribution (requires embeddings)")
|
|
290
|
+
.addHelpText("after", `
|
|
291
|
+
Example:
|
|
292
|
+
knowledgine benchmark --semantic --path ~/notes`)
|
|
293
|
+
.action(benchmarkCommand);
|
|
259
294
|
program.showSuggestionAfterError(true);
|
|
260
295
|
program.configureOutput({
|
|
261
296
|
outputError: createOutputErrorHandler(() => program.commands.map((c) => c.name())),
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AACjF,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,sBAAsB,EACtB,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AACpG,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,8BAA8B,EAAE,MA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,WAAW,CAAC;KACpB,WAAW,CAAC,sCAAsC,CAAC;KACnD,MAAM,CAAC,cAAc,EAAE,gBAAgB,CAAC;KACxC,MAAM,CAAC,YAAY,EAAE,2DAA2D,CAAC;KACjF,WAAW,CACV,OAAO,EACP;;kDAE8C,CAC/C;KACA,MAAM,CAAC,gBAAgB,CAAC,CAAC;AAE5B,OAAO,CAAC,wBAAwB,CAAC,IAAI,CAAC,CAAC;AACvC,OAAO,CAAC,eAAe,CAAC;IACtB,WAAW,EAAE,wBAAwB,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;CACnF,CAAC,CAAC;AAEH,6EAA6E;AAC7E,OAAO,CAAC,EAAE,CAAC,mBAAmB,EAAE,CAAC,KAAK,EAAE,EAAE;IACxC,OAAO,CAAC,KAAK,CAAC,UAAU,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;IACzC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC;AAEH,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { KnowledgeRepository, GraphRepository } from "@knowledgine/core";
|
|
2
|
+
export interface PostIngestSummary {
|
|
3
|
+
totalNotes: number;
|
|
4
|
+
processedNotes: number;
|
|
5
|
+
totalEntities: number;
|
|
6
|
+
totalRelations: number;
|
|
7
|
+
totalPatterns: number;
|
|
8
|
+
errors: number;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* 全ノートに対してパターン抽出、エンティティ抽出、関係推論をバッチ実行する。
|
|
12
|
+
* init コマンドから ingest パイプライン経由でノートが保存された後に呼ばれる。
|
|
13
|
+
*
|
|
14
|
+
* @deprecated 新規コードは IncrementalExtractor を直接使用してください
|
|
15
|
+
*/
|
|
16
|
+
export declare function postIngestProcessing(repository: KnowledgeRepository, graphRepository: GraphRepository, onProgress?: (current: number, total: number) => void): Promise<PostIngestSummary>;
|
|
17
|
+
//# sourceMappingURL=entity-extractor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entity-extractor.d.ts","sourceRoot":"","sources":["../../src/lib/entity-extractor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAwB,MAAM,mBAAmB,CAAC;AAE/F,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;;GAKG;AACH,wBAAsB,oBAAoB,CACxC,UAAU,EAAE,mBAAmB,EAC/B,eAAe,EAAE,eAAe,EAChC,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,GACpD,OAAO,CAAC,iBAAiB,CAAC,CAe5B"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { KnowledgeRepository, GraphRepository, IncrementalExtractor } from "@knowledgine/core";
|
|
2
|
+
/**
|
|
3
|
+
* 全ノートに対してパターン抽出、エンティティ抽出、関係推論をバッチ実行する。
|
|
4
|
+
* init コマンドから ingest パイプライン経由でノートが保存された後に呼ばれる。
|
|
5
|
+
*
|
|
6
|
+
* @deprecated 新規コードは IncrementalExtractor を直接使用してください
|
|
7
|
+
*/
|
|
8
|
+
export async function postIngestProcessing(repository, graphRepository, onProgress) {
|
|
9
|
+
const allNoteIds = repository.getAllNoteIds();
|
|
10
|
+
const totalNotes = allNoteIds.length;
|
|
11
|
+
const incrementalExtractor = new IncrementalExtractor(repository, graphRepository);
|
|
12
|
+
const summary = await incrementalExtractor.process(allNoteIds, onProgress);
|
|
13
|
+
return {
|
|
14
|
+
totalNotes,
|
|
15
|
+
processedNotes: summary.processedNotes,
|
|
16
|
+
totalEntities: summary.totalEntities,
|
|
17
|
+
totalRelations: summary.totalRelations,
|
|
18
|
+
totalPatterns: summary.totalPatterns,
|
|
19
|
+
errors: summary.errors,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=entity-extractor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entity-extractor.js","sourceRoot":"","sources":["../../src/lib/entity-extractor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAW/F;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,UAA+B,EAC/B,eAAgC,EAChC,UAAqD;IAErD,MAAM,UAAU,GAAG,UAAU,CAAC,aAAa,EAAE,CAAC;IAC9C,MAAM,UAAU,GAAG,UAAU,CAAC,MAAM,CAAC;IAErC,MAAM,oBAAoB,GAAG,IAAI,oBAAoB,CAAC,UAAU,EAAE,eAAe,CAAC,CAAC;IACnF,MAAM,OAAO,GAAG,MAAM,oBAAoB,CAAC,OAAO,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;IAE3E,OAAO;QACL,UAAU;QACV,cAAc,EAAE,OAAO,CAAC,cAAc;QACtC,aAAa,EAAE,OAAO,CAAC,aAAa;QACpC,cAAc,EAAE,OAAO,CAAC,cAAc;QACtC,aAAa,EAAE,OAAO,CAAC,aAAa;QACpC,MAAM,EAAE,OAAO,CAAC,MAAM;KACvB,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatter.d.ts","sourceRoot":"","sources":["../../src/lib/formatter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,iBAAiB,EACjB,WAAW,EACX,oBAAoB,EACrB,MAAM,mBAAmB,CAAC;AAG3B,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC;AAEtD,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,qBAAqB,CAAC,SAAS,CAAC,EACzC,MAAM,EAAE,YAAY,GACnB,MAAM,CAeR;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,iBAAiB,EAAE,MAAM,EAAE,YAAY,GAAG,MAAM,CAsB1F;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,YAAY,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"formatter.d.ts","sourceRoot":"","sources":["../../src/lib/formatter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,iBAAiB,EACjB,WAAW,EACX,oBAAoB,EACrB,MAAM,mBAAmB,CAAC;AAG3B,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC;AAEtD,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,qBAAqB,CAAC,SAAS,CAAC,EACzC,MAAM,EAAE,YAAY,GACnB,MAAM,CAeR;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,iBAAiB,EAAE,MAAM,EAAE,YAAY,GAAG,MAAM,CAsB1F;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,YAAY,GAAG,MAAM,CAyC5E;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,oBAAoB,EAAE,MAAM,EAAE,YAAY,GAAG,MAAM,CAazF"}
|
package/dist/lib/formatter.js
CHANGED
|
@@ -43,13 +43,24 @@ export function formatStats(stats, format) {
|
|
|
43
43
|
if (format === "json") {
|
|
44
44
|
return JSON.stringify(stats, null, 2);
|
|
45
45
|
}
|
|
46
|
+
const embeddingsGenerated = stats.embeddingStatus.notesWithoutEmbeddings !== null
|
|
47
|
+
? stats.totalNotes - stats.embeddingStatus.notesWithoutEmbeddings
|
|
48
|
+
: null;
|
|
49
|
+
const embeddingCoverage = embeddingsGenerated !== null && stats.totalNotes > 0
|
|
50
|
+
? Math.round((embeddingsGenerated / stats.totalNotes) * 100)
|
|
51
|
+
: null;
|
|
52
|
+
const embeddingDisplay = embeddingsGenerated !== null && embeddingCoverage !== null
|
|
53
|
+
? `${embeddingsGenerated}/${stats.totalNotes} (${embeddingCoverage}%)`
|
|
54
|
+
: stats.embeddingStatus.available
|
|
55
|
+
? "enabled"
|
|
56
|
+
: "disabled";
|
|
46
57
|
if (format === "plain") {
|
|
47
58
|
return [
|
|
48
59
|
`Notes: ${stats.totalNotes}`,
|
|
49
60
|
`Patterns: ${stats.totalPatterns}`,
|
|
50
61
|
`Links: ${stats.totalLinks}`,
|
|
51
62
|
`Pairs: ${stats.totalPairs}`,
|
|
52
|
-
`Embeddings: ${
|
|
63
|
+
`Embeddings: ${embeddingDisplay}`,
|
|
53
64
|
].join("\n");
|
|
54
65
|
}
|
|
55
66
|
// table
|
|
@@ -58,14 +69,8 @@ export function formatStats(stats, format) {
|
|
|
58
69
|
["Total Patterns", colors.info(String(stats.totalPatterns))],
|
|
59
70
|
["Total Links", colors.info(String(stats.totalLinks))],
|
|
60
71
|
["Total Pairs", colors.info(String(stats.totalPairs))],
|
|
61
|
-
["Embeddings
|
|
72
|
+
["Embeddings", colors.info(embeddingDisplay)],
|
|
62
73
|
];
|
|
63
|
-
if (stats.embeddingStatus.notesWithoutEmbeddings !== null) {
|
|
64
|
-
rows.push([
|
|
65
|
-
"Notes Without Embeddings",
|
|
66
|
-
colors.info(String(stats.embeddingStatus.notesWithoutEmbeddings)),
|
|
67
|
-
]);
|
|
68
|
-
}
|
|
69
74
|
if (stats.graphStats) {
|
|
70
75
|
rows.push(["Graph Entities", colors.info(String(stats.graphStats.totalEntities))]);
|
|
71
76
|
rows.push(["Graph Relations", colors.info(String(stats.graphStats.totalRelations))]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatter.js","sourceRoot":"","sources":["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KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAC5C,MAAM,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;IAC7F,OAAO,WAAW,CAAC,EAAE,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;AAC7D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"references.d.ts","sourceRoot":"","sources":["../../../../src/templates/skills/knowledgine-explain/references.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAsL7C,CAAC"}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
export const REFERENCES = {
|
|
2
|
+
"entity-types.md": `# Entity Types
|
|
3
|
+
|
|
4
|
+
The entity types recognized and extracted by knowledgine from knowledge base content.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Core Entity Types
|
|
9
|
+
|
|
10
|
+
| Type | Description | Examples |
|
|
11
|
+
|------|-------------|---------|
|
|
12
|
+
| \`technology\` | Libraries, frameworks, tools, languages | \`SQLite\`, \`TypeScript\`, \`Node.js\`, \`Zod\` |
|
|
13
|
+
| \`concept\` | Abstract ideas, patterns, architectural concepts | \`caching\`, \`ESM\`, \`FTS5\`, \`semantic search\` |
|
|
14
|
+
| \`project\` | Projects, repositories, products | \`knowledgine\`, \`claude-code\` |
|
|
15
|
+
| \`person\` | Authors, contributors, contacts | Team members, external contributors |
|
|
16
|
+
| \`component\` | Code components, classes, modules | \`KnowledgeRepository\`, \`IngestEngine\` |
|
|
17
|
+
| \`command\` | CLI commands or API operations | \`knowledgine init\`, \`capture_knowledge\` |
|
|
18
|
+
| \`file\` | Source files and paths | \`packages/core/src/config/config-loader.ts\` |
|
|
19
|
+
| \`error\` | Named error types or error messages | \`SQLITE_CONSTRAINT\`, \`ENOENT\` |
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Searching for Entities
|
|
24
|
+
|
|
25
|
+
### By exact name
|
|
26
|
+
\`\`\`
|
|
27
|
+
search_entities(query: "SQLite")
|
|
28
|
+
search_entities(query: "KnowledgeRepository")
|
|
29
|
+
\`\`\`
|
|
30
|
+
|
|
31
|
+
### By type + name
|
|
32
|
+
\`\`\`
|
|
33
|
+
search_entities(query: "technology sqlite")
|
|
34
|
+
search_entities(query: "concept caching")
|
|
35
|
+
\`\`\`
|
|
36
|
+
|
|
37
|
+
### By partial name
|
|
38
|
+
\`\`\`
|
|
39
|
+
search_entities(query: "Knowledge") // matches KnowledgeRepository, knowledgine, etc.
|
|
40
|
+
\`\`\`
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Entity Extraction Quality
|
|
45
|
+
|
|
46
|
+
Entities are extracted automatically from note content using NLP. The quality depends
|
|
47
|
+
on the clarity of the notes. If you notice missing or incorrect entities, use
|
|
48
|
+
\`knowledgine-feedback\` to report them.
|
|
49
|
+
|
|
50
|
+
**Common extraction issues**:
|
|
51
|
+
- Abbreviations (TS → TypeScript may not be linked)
|
|
52
|
+
- Generic words that happen to be class names (Table, Manager)
|
|
53
|
+
- Multi-word entities where only part is captured
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Using Entities for Exploration
|
|
58
|
+
|
|
59
|
+
Entities serve as navigation hubs in the knowledge graph. A technology entity like
|
|
60
|
+
\`SQLite\` connects to every note that mentions SQLite, allowing you to traverse from
|
|
61
|
+
the entity to all related bug fixes, design decisions, and patterns.
|
|
62
|
+
|
|
63
|
+
**Exploration pattern**:
|
|
64
|
+
\`\`\`
|
|
65
|
+
1. search_entities(query: "SQLite") → get entity ID
|
|
66
|
+
2. get_entity_graph(entityId: "<id>") → see all connections
|
|
67
|
+
3. find_related(noteId: "<connected note id>") → traverse outward
|
|
68
|
+
\`\`\`
|
|
69
|
+
`,
|
|
70
|
+
"graph-navigation.md": `# Graph Navigation
|
|
71
|
+
|
|
72
|
+
How to traverse the knowledge graph effectively using \`get_entity_graph\` and
|
|
73
|
+
\`find_related\`.
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## Knowledge Graph Structure
|
|
78
|
+
|
|
79
|
+
The knowledge graph has two node types:
|
|
80
|
+
|
|
81
|
+
- **Notes** — Individual knowledge entries (bug fixes, decisions, patterns, etc.)
|
|
82
|
+
- **Entities** — Named things extracted from notes (technologies, concepts, people)
|
|
83
|
+
|
|
84
|
+
**Edge types**:
|
|
85
|
+
- Note → Entity: "this note mentions this entity"
|
|
86
|
+
- Entity → Note: "this entity appears in these notes"
|
|
87
|
+
- Note → Note: "these notes share entities" (implicit through entity connections)
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## get_entity_graph
|
|
92
|
+
|
|
93
|
+
Returns the entity and all notes it appears in, plus related entities.
|
|
94
|
+
|
|
95
|
+
\`\`\`
|
|
96
|
+
get_entity_graph(entityId: "123")
|
|
97
|
+
// Returns: { entity, notes: [...], relatedEntities: [...] }
|
|
98
|
+
|
|
99
|
+
get_entity_graph(entityName: "SQLite")
|
|
100
|
+
// Look up entity by name then return graph
|
|
101
|
+
\`\`\`
|
|
102
|
+
|
|
103
|
+
**Use this when you want to**:
|
|
104
|
+
- See every note about a specific technology or concept
|
|
105
|
+
- Discover which other entities co-appear with this entity
|
|
106
|
+
- Get an overview before doing deeper traversal
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## find_related
|
|
111
|
+
|
|
112
|
+
Returns notes related to a starting point (note or file path) via shared entities.
|
|
113
|
+
|
|
114
|
+
\`\`\`
|
|
115
|
+
find_related(noteId: "abc123", limit: 10, maxHops: 2)
|
|
116
|
+
find_related(filePath: "src/commands/setup.ts", limit: 10)
|
|
117
|
+
\`\`\`
|
|
118
|
+
|
|
119
|
+
**Parameters**:
|
|
120
|
+
- \`noteId\` or \`filePath\`: Starting point for traversal
|
|
121
|
+
- \`limit\`: Maximum notes to return
|
|
122
|
+
- \`maxHops\`: How many edge-traversal steps to allow (1–3)
|
|
123
|
+
|
|
124
|
+
### maxHops Guide
|
|
125
|
+
|
|
126
|
+
| maxHops | Meaning | When to use |
|
|
127
|
+
|---------|---------|-------------|
|
|
128
|
+
| 1 | Only notes that share a direct entity with the starting note | Focused lookup |
|
|
129
|
+
| 2 | Notes 2 hops away (share an entity with a 1-hop note) | Default, good balance |
|
|
130
|
+
| 3 | Notes 3 hops away | Open-ended exploration, large graph |
|
|
131
|
+
|
|
132
|
+
**Higher maxHops returns more results but with lower average relevance.** Start at 1
|
|
133
|
+
or 2 and increase only if the results are too sparse.
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
## Navigation Patterns
|
|
138
|
+
|
|
139
|
+
### Pattern 1: Technology Deep Dive
|
|
140
|
+
|
|
141
|
+
\`\`\`
|
|
142
|
+
// Understand everything in the knowledge base about TypeScript
|
|
143
|
+
1. search_entities(query: "TypeScript") → { id: "42", name: "TypeScript" }
|
|
144
|
+
2. get_entity_graph(entityId: "42")
|
|
145
|
+
→ 15 notes mention TypeScript
|
|
146
|
+
→ related entities: ESM, tsconfig, type-safety
|
|
147
|
+
3. find_related(noteId: "<top note id>", maxHops: 2)
|
|
148
|
+
→ Surface adjacent notes
|
|
149
|
+
\`\`\`
|
|
150
|
+
|
|
151
|
+
### Pattern 2: Component History
|
|
152
|
+
|
|
153
|
+
\`\`\`
|
|
154
|
+
// Understand the history of the setup command
|
|
155
|
+
1. search_entities(query: "setupCommand") → entity
|
|
156
|
+
2. get_entity_graph(entityId: "<id>") → notes about setupCommand
|
|
157
|
+
3. Filter for design-decision and refactoring notes
|
|
158
|
+
4. Read chronologically to understand evolution
|
|
159
|
+
\`\`\`
|
|
160
|
+
|
|
161
|
+
### Pattern 3: Cross-Area Connections
|
|
162
|
+
|
|
163
|
+
\`\`\`
|
|
164
|
+
// Find connections between two components
|
|
165
|
+
1. get_entity_graph(entityName: "IngestEngine") → set A of notes + entities
|
|
166
|
+
2. get_entity_graph(entityName: "KnowledgeRepository") → set B
|
|
167
|
+
3. Inspect overlap in relatedEntities to find bridges
|
|
168
|
+
\`\`\`
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
## Interpreting Results
|
|
173
|
+
|
|
174
|
+
When \`get_entity_graph\` returns many notes, prioritize by tag:
|
|
175
|
+
|
|
176
|
+
| Priority | Tags |
|
|
177
|
+
|----------|------|
|
|
178
|
+
| High | \`design-decision\`, \`bug-fix\`, \`troubleshooting\` |
|
|
179
|
+
| Medium | \`pattern\`, \`refactoring\`, \`external-knowledge\` |
|
|
180
|
+
| Lower | Untagged notes |
|
|
181
|
+
`,
|
|
182
|
+
};
|
|
183
|
+
//# sourceMappingURL=references.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"references.js","sourceRoot":"","sources":["../../../../src/templates/skills/knowledgine-explain/references.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,UAAU,GAA2B;IAChD,iBAAiB,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmEpB;IAEC,qBAAqB,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+GxB;CACA,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const SKILL_MD = "---\nname: knowledgine-explain\ndescription: >\n Explore entities, knowledge graph connections, and design history for unfamiliar\n components. Invoke when exploring code you did not write, tracing the history of a\n design decision, or understanding how a named entity (technology, library, project,\n person) relates to other parts of the knowledge base.\n---\n# knowledgine-explain\n\n## Purpose\n\nTrace the knowledge graph to understand why things are the way they are. Explain uses\nentity search and graph traversal to surface the full context around a component or\nconcept \u2014 not just what exists, but how it connects to other parts of the system and\nwhat decisions shaped it.\n\n## When to Use\n\n- **Exploring unfamiliar code** \u2014 Who wrote what and why? What decisions shaped this?\n- **Understanding design rationale** \u2014 What alternatives were considered?\n- **Tracing knowledge provenance** \u2014 Where did this pattern or approach come from?\n- **Auditing a technology choice** \u2014 Why is this library used here?\n- **Understanding relationships** \u2014 How do components A and B relate?\n\n## When NOT to Use\n\n- When you just need to find a specific past solution (use knowledgine-recall instead)\n- When the entity does not exist in the knowledge base yet\n- For trivial well-known concepts with no project-specific context\n\n## How to Explain (MCP Tools)\n\n### Step 1: Search for entities\n\n```\nsearch_entities(\n query: string, // Entity name, technology, concept, or person\n limit?: number // Max results (default 10)\n)\n```\n\n### Step 2: Explore entity graph\n\n```\nget_entity_graph(\n entityId?: string, // ID from search_entities result\n entityName?: string // Or search by name directly\n)\n```\n\n### Step 3: Find related notes\n\n```\nfind_related(\n noteId?: string, // A relevant note ID found in earlier steps\n filePath?: string, // Or a relevant file path\n limit?: number,\n maxHops?: number // 1\u20133, default 2\n)\n```\n\n## How to Explain (CLI Alternative)\n\n```bash\nknowledgine explain \"<entity name or concept>\"\n```\n\n## Step-by-Step Instructions\n\n1. **Identify the subject** \u2014 What entity, component, or concept do you want to understand?\n2. **Search for the entity** \u2014 Call `search_entities` with the subject name\n3. **Inspect the entity graph** \u2014 Call `get_entity_graph` with the entity ID\n4. **Traverse related notes** \u2014 Call `find_related` for notes that mention this entity\n5. **Synthesize findings** \u2014 Summarize what you learned about the entity's history and connections\n\n## Best Practices\n\n- Start with `search_entities` to discover the exact entity name as stored in the knowledge base\n- Use `get_entity_graph` to map the neighborhood before diving into individual notes\n- Increase `maxHops` gradually \u2014 start at 1, go to 2 or 3 if the immediate neighborhood is sparse\n- Look specifically for notes tagged `design-decision` \u2014 they explain the \"why\"\n\n## Reference Files\n\n- See `entity-types.md` for the entity taxonomy used in knowledgine\n- See `graph-navigation.md` for how to traverse the knowledge graph effectively\n";
|
|
2
|
+
//# sourceMappingURL=skill-md.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skill-md.d.ts","sourceRoot":"","sources":["../../../../src/templates/skills/knowledgine-explain/skill-md.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,wnGAuFpB,CAAC"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
export const SKILL_MD = `---
|
|
2
|
+
name: knowledgine-explain
|
|
3
|
+
description: >
|
|
4
|
+
Explore entities, knowledge graph connections, and design history for unfamiliar
|
|
5
|
+
components. Invoke when exploring code you did not write, tracing the history of a
|
|
6
|
+
design decision, or understanding how a named entity (technology, library, project,
|
|
7
|
+
person) relates to other parts of the knowledge base.
|
|
8
|
+
---
|
|
9
|
+
# knowledgine-explain
|
|
10
|
+
|
|
11
|
+
## Purpose
|
|
12
|
+
|
|
13
|
+
Trace the knowledge graph to understand why things are the way they are. Explain uses
|
|
14
|
+
entity search and graph traversal to surface the full context around a component or
|
|
15
|
+
concept — not just what exists, but how it connects to other parts of the system and
|
|
16
|
+
what decisions shaped it.
|
|
17
|
+
|
|
18
|
+
## When to Use
|
|
19
|
+
|
|
20
|
+
- **Exploring unfamiliar code** — Who wrote what and why? What decisions shaped this?
|
|
21
|
+
- **Understanding design rationale** — What alternatives were considered?
|
|
22
|
+
- **Tracing knowledge provenance** — Where did this pattern or approach come from?
|
|
23
|
+
- **Auditing a technology choice** — Why is this library used here?
|
|
24
|
+
- **Understanding relationships** — How do components A and B relate?
|
|
25
|
+
|
|
26
|
+
## When NOT to Use
|
|
27
|
+
|
|
28
|
+
- When you just need to find a specific past solution (use knowledgine-recall instead)
|
|
29
|
+
- When the entity does not exist in the knowledge base yet
|
|
30
|
+
- For trivial well-known concepts with no project-specific context
|
|
31
|
+
|
|
32
|
+
## How to Explain (MCP Tools)
|
|
33
|
+
|
|
34
|
+
### Step 1: Search for entities
|
|
35
|
+
|
|
36
|
+
\`\`\`
|
|
37
|
+
search_entities(
|
|
38
|
+
query: string, // Entity name, technology, concept, or person
|
|
39
|
+
limit?: number // Max results (default 10)
|
|
40
|
+
)
|
|
41
|
+
\`\`\`
|
|
42
|
+
|
|
43
|
+
### Step 2: Explore entity graph
|
|
44
|
+
|
|
45
|
+
\`\`\`
|
|
46
|
+
get_entity_graph(
|
|
47
|
+
entityId?: string, // ID from search_entities result
|
|
48
|
+
entityName?: string // Or search by name directly
|
|
49
|
+
)
|
|
50
|
+
\`\`\`
|
|
51
|
+
|
|
52
|
+
### Step 3: Find related notes
|
|
53
|
+
|
|
54
|
+
\`\`\`
|
|
55
|
+
find_related(
|
|
56
|
+
noteId?: string, // A relevant note ID found in earlier steps
|
|
57
|
+
filePath?: string, // Or a relevant file path
|
|
58
|
+
limit?: number,
|
|
59
|
+
maxHops?: number // 1–3, default 2
|
|
60
|
+
)
|
|
61
|
+
\`\`\`
|
|
62
|
+
|
|
63
|
+
## How to Explain (CLI Alternative)
|
|
64
|
+
|
|
65
|
+
\`\`\`bash
|
|
66
|
+
knowledgine explain "<entity name or concept>"
|
|
67
|
+
\`\`\`
|
|
68
|
+
|
|
69
|
+
## Step-by-Step Instructions
|
|
70
|
+
|
|
71
|
+
1. **Identify the subject** — What entity, component, or concept do you want to understand?
|
|
72
|
+
2. **Search for the entity** — Call \`search_entities\` with the subject name
|
|
73
|
+
3. **Inspect the entity graph** — Call \`get_entity_graph\` with the entity ID
|
|
74
|
+
4. **Traverse related notes** — Call \`find_related\` for notes that mention this entity
|
|
75
|
+
5. **Synthesize findings** — Summarize what you learned about the entity's history and connections
|
|
76
|
+
|
|
77
|
+
## Best Practices
|
|
78
|
+
|
|
79
|
+
- Start with \`search_entities\` to discover the exact entity name as stored in the knowledge base
|
|
80
|
+
- Use \`get_entity_graph\` to map the neighborhood before diving into individual notes
|
|
81
|
+
- Increase \`maxHops\` gradually — start at 1, go to 2 or 3 if the immediate neighborhood is sparse
|
|
82
|
+
- Look specifically for notes tagged \`design-decision\` — they explain the "why"
|
|
83
|
+
|
|
84
|
+
## Reference Files
|
|
85
|
+
|
|
86
|
+
- See \`entity-types.md\` for the entity taxonomy used in knowledgine
|
|
87
|
+
- See \`graph-navigation.md\` for how to traverse the knowledge graph effectively
|
|
88
|
+
`;
|
|
89
|
+
//# sourceMappingURL=skill-md.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skill-md.js","sourceRoot":"","sources":["../../../../src/templates/skills/knowledgine-explain/skill-md.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,QAAQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuFvB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"references.d.ts","sourceRoot":"","sources":["../../../../src/templates/skills/knowledgine-recall/references.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CA8M7C,CAAC"}
|