@weavelogic/knowledge-graph-agent 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +203 -4
- package/dist/cli/commands/analyze.d.ts +12 -0
- package/dist/cli/commands/analyze.d.ts.map +1 -0
- package/dist/cli/commands/analyze.js +269 -0
- package/dist/cli/commands/analyze.js.map +1 -0
- package/dist/cli/commands/convert.d.ts +15 -0
- package/dist/cli/commands/convert.d.ts.map +1 -0
- package/dist/cli/commands/convert.js +203 -0
- package/dist/cli/commands/convert.js.map +1 -0
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +13 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/generators/docs-analyzer.d.ts +75 -0
- package/dist/generators/docs-analyzer.d.ts.map +1 -0
- package/dist/generators/docs-analyzer.js +567 -0
- package/dist/generators/docs-analyzer.js.map +1 -0
- package/dist/generators/docs-convert.d.ts +91 -0
- package/dist/generators/docs-convert.d.ts.map +1 -0
- package/dist/generators/docs-convert.js +474 -0
- package/dist/generators/docs-convert.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import { Command } from "commander";
|
|
2
|
+
import chalk from "chalk";
|
|
3
|
+
import ora from "ora";
|
|
4
|
+
import { existsSync } from "fs";
|
|
5
|
+
import { join } from "path";
|
|
6
|
+
import { convertDocs, addFrontmatter, validateFrontmatter } from "../../generators/docs-convert.js";
|
|
7
|
+
import { validateProjectRoot } from "../../core/security.js";
|
|
8
|
+
function createConvertCommand() {
|
|
9
|
+
const command = new Command("convert");
|
|
10
|
+
command.description("Convert existing docs to weave-nn structure");
|
|
11
|
+
command.command("docs").description("Convert existing documentation to docs-nn/ with proper structure").option("-p, --path <path>", "Project root path", ".").option("-s, --source <dir>", "Source docs directory", "docs").option("-t, --target <dir>", "Target directory", "docs-nn").option("--no-auto-category", "Disable auto-categorization").option("-f, --force", "Overwrite existing files").option("--dry-run", "Show what would be done without making changes").action(async (options) => {
|
|
12
|
+
const spinner = ora("Converting documentation...").start();
|
|
13
|
+
try {
|
|
14
|
+
const projectRoot = validateProjectRoot(options.path);
|
|
15
|
+
const sourceDir = options.source;
|
|
16
|
+
const targetDir = options.target;
|
|
17
|
+
if (!existsSync(join(projectRoot, sourceDir))) {
|
|
18
|
+
spinner.fail(`Source directory not found: ${sourceDir}`);
|
|
19
|
+
console.log(chalk.gray(" Specify source with --source <dir>"));
|
|
20
|
+
process.exit(1);
|
|
21
|
+
}
|
|
22
|
+
if (options.dryRun) {
|
|
23
|
+
spinner.text = "Analyzing documentation (dry run)...";
|
|
24
|
+
}
|
|
25
|
+
const result = await convertDocs({
|
|
26
|
+
sourceDir,
|
|
27
|
+
targetDir,
|
|
28
|
+
projectRoot,
|
|
29
|
+
preserveOriginal: true,
|
|
30
|
+
force: options.force,
|
|
31
|
+
autoCategory: options.autoCategory !== false,
|
|
32
|
+
dryRun: options.dryRun
|
|
33
|
+
});
|
|
34
|
+
if (result.success) {
|
|
35
|
+
if (options.dryRun) {
|
|
36
|
+
spinner.succeed("Dry run complete!");
|
|
37
|
+
} else {
|
|
38
|
+
spinner.succeed("Documentation converted!");
|
|
39
|
+
}
|
|
40
|
+
} else {
|
|
41
|
+
spinner.warn("Conversion completed with errors");
|
|
42
|
+
}
|
|
43
|
+
console.log();
|
|
44
|
+
console.log(chalk.white(" Summary:"));
|
|
45
|
+
console.log(chalk.gray(` Source: ${sourceDir}/`));
|
|
46
|
+
console.log(chalk.gray(` Target: ${targetDir}/`));
|
|
47
|
+
console.log(chalk.green(` Converted: ${result.filesConverted}`));
|
|
48
|
+
console.log(chalk.yellow(` Skipped: ${result.filesSkipped}`));
|
|
49
|
+
console.log(chalk.gray(` Total: ${result.filesProcessed}`));
|
|
50
|
+
if (result.converted.length > 0 && result.converted.length <= 10) {
|
|
51
|
+
console.log();
|
|
52
|
+
console.log(chalk.white(" Converted files:"));
|
|
53
|
+
result.converted.forEach(({ source, target, type }) => {
|
|
54
|
+
console.log(chalk.gray(` ${source}`));
|
|
55
|
+
console.log(chalk.cyan(` → ${target}`) + chalk.gray(` [${type}]`));
|
|
56
|
+
});
|
|
57
|
+
} else if (result.converted.length > 10) {
|
|
58
|
+
console.log();
|
|
59
|
+
console.log(chalk.white(" Sample conversions:"));
|
|
60
|
+
result.converted.slice(0, 5).forEach(({ source, target, type }) => {
|
|
61
|
+
console.log(chalk.gray(` ${source}`));
|
|
62
|
+
console.log(chalk.cyan(` → ${target}`) + chalk.gray(` [${type}]`));
|
|
63
|
+
});
|
|
64
|
+
console.log(chalk.gray(` ... and ${result.converted.length - 5} more`));
|
|
65
|
+
}
|
|
66
|
+
if (result.errors.length > 0) {
|
|
67
|
+
console.log();
|
|
68
|
+
console.log(chalk.red(" Errors:"));
|
|
69
|
+
result.errors.slice(0, 5).forEach((err) => {
|
|
70
|
+
console.log(chalk.gray(` - ${err}`));
|
|
71
|
+
});
|
|
72
|
+
if (result.errors.length > 5) {
|
|
73
|
+
console.log(chalk.gray(` ... and ${result.errors.length - 5} more`));
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
if (!options.dryRun && result.filesConverted > 0) {
|
|
77
|
+
console.log();
|
|
78
|
+
console.log(chalk.cyan("Next steps:"));
|
|
79
|
+
console.log(chalk.white(` 1. Review ${targetDir}/ structure`));
|
|
80
|
+
console.log(chalk.white(" 2. Run: kg graph --docs " + targetDir));
|
|
81
|
+
console.log(chalk.white(" 3. Run: kg stats"));
|
|
82
|
+
}
|
|
83
|
+
console.log();
|
|
84
|
+
} catch (error) {
|
|
85
|
+
spinner.fail("Conversion failed");
|
|
86
|
+
console.error(chalk.red(String(error)));
|
|
87
|
+
process.exit(1);
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
return command;
|
|
91
|
+
}
|
|
92
|
+
function createFrontmatterCommand() {
|
|
93
|
+
const command = new Command("frontmatter");
|
|
94
|
+
command.description("Manage frontmatter in markdown files");
|
|
95
|
+
command.command("add [target]").description("Add frontmatter to files missing it").option("-p, --path <path>", "Project root path", ".").option("-t, --type <type>", "Node type (concept, technical, feature, service, guide, standard, integration)").option("-s, --status <status>", "Status (draft, active, deprecated, archived)", "active").option("--tags <tags>", "Comma-separated tags").option("-f, --force", "Overwrite existing frontmatter").option("--dry-run", "Show what would be done").action(async (target, options) => {
|
|
96
|
+
const spinner = ora("Adding frontmatter...").start();
|
|
97
|
+
try {
|
|
98
|
+
const projectRoot = validateProjectRoot(options.path);
|
|
99
|
+
const targetPath = target || "docs";
|
|
100
|
+
const tags = options.tags ? options.tags.split(",").map((t) => t.trim()) : [];
|
|
101
|
+
const result = await addFrontmatter({
|
|
102
|
+
target: targetPath,
|
|
103
|
+
projectRoot,
|
|
104
|
+
type: options.type,
|
|
105
|
+
status: options.status,
|
|
106
|
+
tags,
|
|
107
|
+
force: options.force,
|
|
108
|
+
dryRun: options.dryRun
|
|
109
|
+
});
|
|
110
|
+
if (result.success) {
|
|
111
|
+
spinner.succeed(options.dryRun ? "Dry run complete!" : "Frontmatter added!");
|
|
112
|
+
} else {
|
|
113
|
+
spinner.warn("Completed with errors");
|
|
114
|
+
}
|
|
115
|
+
console.log();
|
|
116
|
+
console.log(chalk.white(" Summary:"));
|
|
117
|
+
console.log(chalk.green(` Updated: ${result.filesUpdated}`));
|
|
118
|
+
console.log(chalk.yellow(` Skipped: ${result.filesSkipped}`));
|
|
119
|
+
console.log(chalk.gray(` Total: ${result.filesProcessed}`));
|
|
120
|
+
if (result.errors.length > 0) {
|
|
121
|
+
console.log();
|
|
122
|
+
console.log(chalk.red(" Errors:"));
|
|
123
|
+
result.errors.forEach((err) => {
|
|
124
|
+
console.log(chalk.gray(` - ${err}`));
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
console.log();
|
|
128
|
+
} catch (error) {
|
|
129
|
+
spinner.fail("Failed to add frontmatter");
|
|
130
|
+
console.error(chalk.red(String(error)));
|
|
131
|
+
process.exit(1);
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
command.command("validate [target]").description("Validate frontmatter in markdown files").option("-p, --path <path>", "Project root path", ".").action(async (target, options) => {
|
|
135
|
+
const spinner = ora("Validating frontmatter...").start();
|
|
136
|
+
try {
|
|
137
|
+
const projectRoot = validateProjectRoot(options.path);
|
|
138
|
+
const targetPath = target || "docs";
|
|
139
|
+
const result = await validateFrontmatter(targetPath, projectRoot);
|
|
140
|
+
spinner.succeed("Validation complete!");
|
|
141
|
+
console.log();
|
|
142
|
+
console.log(chalk.white(" Frontmatter Validation:"));
|
|
143
|
+
console.log(chalk.green(` Valid: ${result.valid}`));
|
|
144
|
+
console.log(chalk.red(` Invalid: ${result.invalid}`));
|
|
145
|
+
console.log(chalk.yellow(` Missing: ${result.missing}`));
|
|
146
|
+
if (result.issues.length > 0) {
|
|
147
|
+
console.log();
|
|
148
|
+
console.log(chalk.yellow(" Issues found:"));
|
|
149
|
+
result.issues.slice(0, 10).forEach(({ file, issues }) => {
|
|
150
|
+
console.log(chalk.white(` ${file}`));
|
|
151
|
+
issues.forEach((issue) => {
|
|
152
|
+
console.log(chalk.gray(` - ${issue}`));
|
|
153
|
+
});
|
|
154
|
+
});
|
|
155
|
+
if (result.issues.length > 10) {
|
|
156
|
+
console.log(chalk.gray(` ... and ${result.issues.length - 10} more files`));
|
|
157
|
+
}
|
|
158
|
+
console.log();
|
|
159
|
+
console.log(chalk.cyan("Fix with: ") + chalk.white("kg frontmatter add <target>"));
|
|
160
|
+
}
|
|
161
|
+
console.log();
|
|
162
|
+
} catch (error) {
|
|
163
|
+
spinner.fail("Validation failed");
|
|
164
|
+
console.error(chalk.red(String(error)));
|
|
165
|
+
process.exit(1);
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
command.command("update [target]").description("Update/regenerate frontmatter (overwrites existing)").option("-p, --path <path>", "Project root path", ".").option("-t, --type <type>", "Force specific node type").option("--dry-run", "Show what would be done").action(async (target, options) => {
|
|
169
|
+
const spinner = ora("Updating frontmatter...").start();
|
|
170
|
+
try {
|
|
171
|
+
const projectRoot = validateProjectRoot(options.path);
|
|
172
|
+
const targetPath = target || "docs";
|
|
173
|
+
const result = await addFrontmatter({
|
|
174
|
+
target: targetPath,
|
|
175
|
+
projectRoot,
|
|
176
|
+
type: options.type,
|
|
177
|
+
force: true,
|
|
178
|
+
dryRun: options.dryRun
|
|
179
|
+
});
|
|
180
|
+
if (result.success) {
|
|
181
|
+
spinner.succeed(options.dryRun ? "Dry run complete!" : "Frontmatter updated!");
|
|
182
|
+
} else {
|
|
183
|
+
spinner.warn("Completed with errors");
|
|
184
|
+
}
|
|
185
|
+
console.log();
|
|
186
|
+
console.log(chalk.green(` Updated: ${result.filesUpdated} files`));
|
|
187
|
+
if (result.errors.length > 0) {
|
|
188
|
+
console.log(chalk.red(` Errors: ${result.errors.length}`));
|
|
189
|
+
}
|
|
190
|
+
console.log();
|
|
191
|
+
} catch (error) {
|
|
192
|
+
spinner.fail("Failed to update frontmatter");
|
|
193
|
+
console.error(chalk.red(String(error)));
|
|
194
|
+
process.exit(1);
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
return command;
|
|
198
|
+
}
|
|
199
|
+
export {
|
|
200
|
+
createConvertCommand,
|
|
201
|
+
createFrontmatterCommand
|
|
202
|
+
};
|
|
203
|
+
//# sourceMappingURL=convert.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convert.js","sources":["../../../src/cli/commands/convert.ts"],"sourcesContent":["/**\n * Convert Command\n *\n * Convert existing documentation to weave-nn structure.\n */\n\nimport { Command } from 'commander';\nimport chalk from 'chalk';\nimport ora from 'ora';\nimport { existsSync } from 'fs';\nimport { join } from 'path';\nimport {\n convertDocs,\n addFrontmatter,\n validateFrontmatter,\n} from '../../generators/docs-convert.js';\nimport { validateProjectRoot, validateDocsPath } from '../../core/security.js';\n\n/**\n * Create convert command\n */\nexport function createConvertCommand(): Command {\n const command = new Command('convert');\n\n command\n .description('Convert existing docs to weave-nn structure');\n\n // Main convert subcommand\n command\n .command('docs')\n .description('Convert existing documentation to docs-nn/ with proper structure')\n .option('-p, --path <path>', 'Project root path', '.')\n .option('-s, --source <dir>', 'Source docs directory', 'docs')\n .option('-t, --target <dir>', 'Target directory', 'docs-nn')\n .option('--no-auto-category', 'Disable auto-categorization')\n .option('-f, --force', 'Overwrite existing files')\n .option('--dry-run', 'Show what would be done without making changes')\n .action(async (options) => {\n const spinner = ora('Converting documentation...').start();\n\n try {\n const projectRoot = validateProjectRoot(options.path);\n const sourceDir = options.source;\n const targetDir = options.target;\n\n // Check source exists\n if (!existsSync(join(projectRoot, sourceDir))) {\n spinner.fail(`Source directory not found: ${sourceDir}`);\n console.log(chalk.gray(' Specify source with --source <dir>'));\n process.exit(1);\n }\n\n if (options.dryRun) {\n spinner.text = 'Analyzing documentation (dry run)...';\n }\n\n const result = await convertDocs({\n sourceDir,\n targetDir,\n projectRoot,\n preserveOriginal: true,\n force: options.force,\n autoCategory: options.autoCategory !== false,\n dryRun: options.dryRun,\n });\n\n if (result.success) {\n if (options.dryRun) {\n spinner.succeed('Dry run complete!');\n } else {\n spinner.succeed('Documentation converted!');\n }\n } else {\n spinner.warn('Conversion completed with errors');\n }\n\n console.log();\n console.log(chalk.white(' Summary:'));\n console.log(chalk.gray(` Source: ${sourceDir}/`));\n console.log(chalk.gray(` Target: ${targetDir}/`));\n console.log(chalk.green(` Converted: ${result.filesConverted}`));\n console.log(chalk.yellow(` Skipped: ${result.filesSkipped}`));\n console.log(chalk.gray(` Total: ${result.filesProcessed}`));\n\n if (result.converted.length > 0 && result.converted.length <= 10) {\n console.log();\n console.log(chalk.white(' Converted files:'));\n result.converted.forEach(({ source, target, type }) => {\n console.log(chalk.gray(` ${source}`));\n console.log(chalk.cyan(` → ${target}`) + chalk.gray(` [${type}]`));\n });\n } else if (result.converted.length > 10) {\n console.log();\n console.log(chalk.white(' Sample conversions:'));\n result.converted.slice(0, 5).forEach(({ source, target, type }) => {\n console.log(chalk.gray(` ${source}`));\n console.log(chalk.cyan(` → ${target}`) + chalk.gray(` [${type}]`));\n });\n console.log(chalk.gray(` ... and ${result.converted.length - 5} more`));\n }\n\n if (result.errors.length > 0) {\n console.log();\n console.log(chalk.red(' Errors:'));\n result.errors.slice(0, 5).forEach(err => {\n console.log(chalk.gray(` - ${err}`));\n });\n if (result.errors.length > 5) {\n console.log(chalk.gray(` ... and ${result.errors.length - 5} more`));\n }\n }\n\n if (!options.dryRun && result.filesConverted > 0) {\n console.log();\n console.log(chalk.cyan('Next steps:'));\n console.log(chalk.white(` 1. Review ${targetDir}/ structure`));\n console.log(chalk.white(' 2. Run: kg graph --docs ' + targetDir));\n console.log(chalk.white(' 3. Run: kg stats'));\n }\n\n console.log();\n\n } catch (error) {\n spinner.fail('Conversion failed');\n console.error(chalk.red(String(error)));\n process.exit(1);\n }\n });\n\n return command;\n}\n\n/**\n * Create frontmatter command\n */\nexport function createFrontmatterCommand(): Command {\n const command = new Command('frontmatter');\n\n command\n .description('Manage frontmatter in markdown files');\n\n // Add frontmatter\n command\n .command('add [target]')\n .description('Add frontmatter to files missing it')\n .option('-p, --path <path>', 'Project root path', '.')\n .option('-t, --type <type>', 'Node type (concept, technical, feature, service, guide, standard, integration)')\n .option('-s, --status <status>', 'Status (draft, active, deprecated, archived)', 'active')\n .option('--tags <tags>', 'Comma-separated tags')\n .option('-f, --force', 'Overwrite existing frontmatter')\n .option('--dry-run', 'Show what would be done')\n .action(async (target, options) => {\n const spinner = ora('Adding frontmatter...').start();\n\n try {\n const projectRoot = validateProjectRoot(options.path);\n const targetPath = target || 'docs';\n\n const tags = options.tags ? options.tags.split(',').map((t: string) => t.trim()) : [];\n\n const result = await addFrontmatter({\n target: targetPath,\n projectRoot,\n type: options.type,\n status: options.status,\n tags,\n force: options.force,\n dryRun: options.dryRun,\n });\n\n if (result.success) {\n spinner.succeed(options.dryRun ? 'Dry run complete!' : 'Frontmatter added!');\n } else {\n spinner.warn('Completed with errors');\n }\n\n console.log();\n console.log(chalk.white(' Summary:'));\n console.log(chalk.green(` Updated: ${result.filesUpdated}`));\n console.log(chalk.yellow(` Skipped: ${result.filesSkipped}`));\n console.log(chalk.gray(` Total: ${result.filesProcessed}`));\n\n if (result.errors.length > 0) {\n console.log();\n console.log(chalk.red(' Errors:'));\n result.errors.forEach(err => {\n console.log(chalk.gray(` - ${err}`));\n });\n }\n\n console.log();\n\n } catch (error) {\n spinner.fail('Failed to add frontmatter');\n console.error(chalk.red(String(error)));\n process.exit(1);\n }\n });\n\n // Validate frontmatter\n command\n .command('validate [target]')\n .description('Validate frontmatter in markdown files')\n .option('-p, --path <path>', 'Project root path', '.')\n .action(async (target, options) => {\n const spinner = ora('Validating frontmatter...').start();\n\n try {\n const projectRoot = validateProjectRoot(options.path);\n const targetPath = target || 'docs';\n\n const result = await validateFrontmatter(targetPath, projectRoot);\n\n spinner.succeed('Validation complete!');\n\n console.log();\n console.log(chalk.white(' Frontmatter Validation:'));\n console.log(chalk.green(` Valid: ${result.valid}`));\n console.log(chalk.red(` Invalid: ${result.invalid}`));\n console.log(chalk.yellow(` Missing: ${result.missing}`));\n\n if (result.issues.length > 0) {\n console.log();\n console.log(chalk.yellow(' Issues found:'));\n result.issues.slice(0, 10).forEach(({ file, issues }) => {\n console.log(chalk.white(` ${file}`));\n issues.forEach(issue => {\n console.log(chalk.gray(` - ${issue}`));\n });\n });\n if (result.issues.length > 10) {\n console.log(chalk.gray(` ... and ${result.issues.length - 10} more files`));\n }\n\n console.log();\n console.log(chalk.cyan('Fix with: ') + chalk.white('kg frontmatter add <target>'));\n }\n\n console.log();\n\n } catch (error) {\n spinner.fail('Validation failed');\n console.error(chalk.red(String(error)));\n process.exit(1);\n }\n });\n\n // Update frontmatter (force mode)\n command\n .command('update [target]')\n .description('Update/regenerate frontmatter (overwrites existing)')\n .option('-p, --path <path>', 'Project root path', '.')\n .option('-t, --type <type>', 'Force specific node type')\n .option('--dry-run', 'Show what would be done')\n .action(async (target, options) => {\n const spinner = ora('Updating frontmatter...').start();\n\n try {\n const projectRoot = validateProjectRoot(options.path);\n const targetPath = target || 'docs';\n\n const result = await addFrontmatter({\n target: targetPath,\n projectRoot,\n type: options.type,\n force: true,\n dryRun: options.dryRun,\n });\n\n if (result.success) {\n spinner.succeed(options.dryRun ? 'Dry run complete!' : 'Frontmatter updated!');\n } else {\n spinner.warn('Completed with errors');\n }\n\n console.log();\n console.log(chalk.green(` Updated: ${result.filesUpdated} files`));\n\n if (result.errors.length > 0) {\n console.log(chalk.red(` Errors: ${result.errors.length}`));\n }\n\n console.log();\n\n } catch (error) {\n spinner.fail('Failed to update frontmatter');\n console.error(chalk.red(String(error)));\n process.exit(1);\n }\n });\n\n return command;\n}\n"],"names":[],"mappings":";;;;;;;AAqBO,SAAS,uBAAgC;AAC9C,QAAM,UAAU,IAAI,QAAQ,SAAS;AAErC,UACG,YAAY,6CAA6C;AAG5D,UACG,QAAQ,MAAM,EACd,YAAY,kEAAkE,EAC9E,OAAO,qBAAqB,qBAAqB,GAAG,EACpD,OAAO,sBAAsB,yBAAyB,MAAM,EAC5D,OAAO,sBAAsB,oBAAoB,SAAS,EAC1D,OAAO,sBAAsB,6BAA6B,EAC1D,OAAO,eAAe,0BAA0B,EAChD,OAAO,aAAa,gDAAgD,EACpE,OAAO,OAAO,YAAY;AACzB,UAAM,UAAU,IAAI,6BAA6B,EAAE,MAAA;AAEnD,QAAI;AACF,YAAM,cAAc,oBAAoB,QAAQ,IAAI;AACpD,YAAM,YAAY,QAAQ;AAC1B,YAAM,YAAY,QAAQ;AAG1B,UAAI,CAAC,WAAW,KAAK,aAAa,SAAS,CAAC,GAAG;AAC7C,gBAAQ,KAAK,+BAA+B,SAAS,EAAE;AACvD,gBAAQ,IAAI,MAAM,KAAK,sCAAsC,CAAC;AAC9D,gBAAQ,KAAK,CAAC;AAAA,MAChB;AAEA,UAAI,QA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d,cAAQ,KAAK,8BAA8B;AAC3C,cAAQ,MAAM,MAAM,IAAI,OAAO,KAAK,CAAC,CAAC;AACtC,cAAQ,KAAK,CAAC;AAAA,IAChB;AAAA,EACF,CAAC;AAEH,SAAO;AACT;"}
|
package/dist/cli/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAiBpC;;GAEG;AACH,wBAAgB,SAAS,IAAI,OAAO,CAuDnC"}
|
package/dist/cli/index.js
CHANGED
|
@@ -7,7 +7,9 @@ import { createClaudeCommand } from "./commands/claude.js";
|
|
|
7
7
|
import { createSyncCommand } from "./commands/sync.js";
|
|
8
8
|
import { createStatsCommand } from "./commands/stats.js";
|
|
9
9
|
import { createSearchCommand } from "./commands/search.js";
|
|
10
|
-
|
|
10
|
+
import { createConvertCommand, createFrontmatterCommand } from "./commands/convert.js";
|
|
11
|
+
import { createAnalyzeCommand } from "./commands/analyze.js";
|
|
12
|
+
const VERSION = "0.2.0";
|
|
11
13
|
function createCLI() {
|
|
12
14
|
const program = new Command();
|
|
13
15
|
program.name("kg").description("Knowledge Graph Agent - Generate and manage knowledge graphs for Claude Code").version(VERSION, "-v, --version", "Display version number");
|
|
@@ -22,6 +24,9 @@ function createCLI() {
|
|
|
22
24
|
program.addCommand(createSyncCommand());
|
|
23
25
|
program.addCommand(createStatsCommand());
|
|
24
26
|
program.addCommand(createSearchCommand());
|
|
27
|
+
program.addCommand(createConvertCommand());
|
|
28
|
+
program.addCommand(createFrontmatterCommand());
|
|
29
|
+
program.addCommand(createAnalyzeCommand());
|
|
25
30
|
program.action(() => {
|
|
26
31
|
console.log(chalk.cyan.bold("\n Knowledge Graph Agent\n"));
|
|
27
32
|
console.log(chalk.gray(" Generate and manage knowledge graphs for Claude Code\n"));
|
|
@@ -31,6 +36,13 @@ function createCLI() {
|
|
|
31
36
|
console.log(chalk.gray(" $ kg graph # Generate knowledge graph"));
|
|
32
37
|
console.log(chalk.gray(" $ kg claude update # Update CLAUDE.md"));
|
|
33
38
|
console.log(chalk.gray(" $ kg sync # Sync with claude-flow\n"));
|
|
39
|
+
console.log(chalk.white(" Migration & Analysis:"));
|
|
40
|
+
console.log(chalk.gray(" $ kg analyze # Analyze & migrate to knowledge graph"));
|
|
41
|
+
console.log(chalk.gray(" $ kg analyze deep # Deep analysis with claude-flow"));
|
|
42
|
+
console.log(chalk.gray(" $ kg analyze report # Generate analysis report"));
|
|
43
|
+
console.log(chalk.gray(" $ kg convert docs # Convert docs/ → docs-nn/"));
|
|
44
|
+
console.log(chalk.gray(" $ kg frontmatter add # Add frontmatter to files"));
|
|
45
|
+
console.log(chalk.gray(" $ kg frontmatter validate # Validate frontmatter\n"));
|
|
34
46
|
console.log(chalk.white(" Commands:"));
|
|
35
47
|
program.commands.forEach((cmd) => {
|
|
36
48
|
console.log(chalk.cyan(` ${cmd.name().padEnd(20)}`), chalk.gray(cmd.description() || ""));
|
package/dist/cli/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/cli/index.ts"],"sourcesContent":["/**\n * Knowledge Graph Agent CLI\n *\n * Main CLI setup and command registration.\n */\n\nimport { Command } from 'commander';\nimport chalk from 'chalk';\nimport { createInitCommand } from './commands/init.js';\nimport { createGraphCommand } from './commands/graph.js';\nimport { createDocsCommand } from './commands/docs.js';\nimport { createClaudeCommand } from './commands/claude.js';\nimport { createSyncCommand } from './commands/sync.js';\nimport { createStatsCommand } from './commands/stats.js';\nimport { createSearchCommand } from './commands/search.js';\n\n/**\n * CLI version\n */\nconst VERSION = '0.
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/cli/index.ts"],"sourcesContent":["/**\n * Knowledge Graph Agent CLI\n *\n * Main CLI setup and command registration.\n */\n\nimport { Command } from 'commander';\nimport chalk from 'chalk';\nimport { createInitCommand } from './commands/init.js';\nimport { createGraphCommand } from './commands/graph.js';\nimport { createDocsCommand } from './commands/docs.js';\nimport { createClaudeCommand } from './commands/claude.js';\nimport { createSyncCommand } from './commands/sync.js';\nimport { createStatsCommand } from './commands/stats.js';\nimport { createSearchCommand } from './commands/search.js';\nimport { createConvertCommand, createFrontmatterCommand } from './commands/convert.js';\nimport { createAnalyzeCommand } from './commands/analyze.js';\n\n/**\n * CLI version\n */\nconst VERSION = '0.2.0';\n\n/**\n * Create and configure the CLI program\n */\nexport function createCLI(): Command {\n const program = new Command();\n\n program\n .name('kg')\n .description('Knowledge Graph Agent - Generate and manage knowledge graphs for Claude Code')\n .version(VERSION, '-v, --version', 'Display version number');\n\n // Configure help\n program.configureHelp({\n sortSubcommands: true,\n sortOptions: true,\n });\n\n // Add commands\n program.addCommand(createInitCommand());\n program.addCommand(createGraphCommand());\n program.addCommand(createDocsCommand());\n program.addCommand(createClaudeCommand());\n program.addCommand(createSyncCommand());\n program.addCommand(createStatsCommand());\n program.addCommand(createSearchCommand());\n program.addCommand(createConvertCommand());\n program.addCommand(createFrontmatterCommand());\n program.addCommand(createAnalyzeCommand());\n\n // Default action (show help)\n program.action(() => {\n console.log(chalk.cyan.bold('\\n Knowledge Graph Agent\\n'));\n console.log(chalk.gray(' Generate and manage knowledge graphs for Claude Code\\n'));\n\n console.log(chalk.white(' Quick Start:'));\n console.log(chalk.gray(' $ kg init # Initialize knowledge graph'));\n console.log(chalk.gray(' $ kg docs init # Initialize docs directory'));\n console.log(chalk.gray(' $ kg graph # Generate knowledge graph'));\n console.log(chalk.gray(' $ kg claude update # Update CLAUDE.md'));\n console.log(chalk.gray(' $ kg sync # Sync with claude-flow\\n'));\n\n console.log(chalk.white(' Migration & Analysis:'));\n console.log(chalk.gray(' $ kg analyze # Analyze & migrate to knowledge graph'));\n console.log(chalk.gray(' $ kg analyze deep # Deep analysis with claude-flow'));\n console.log(chalk.gray(' $ kg analyze report # Generate analysis report'));\n console.log(chalk.gray(' $ kg convert docs # Convert docs/ → docs-nn/'));\n console.log(chalk.gray(' $ kg frontmatter add # Add frontmatter to files'));\n console.log(chalk.gray(' $ kg frontmatter validate # Validate frontmatter\\n'));\n\n console.log(chalk.white(' Commands:'));\n program.commands.forEach(cmd => {\n console.log(chalk.cyan(` ${cmd.name().padEnd(20)}`), chalk.gray(cmd.description() || ''));\n });\n\n console.log('\\n Run', chalk.cyan('kg <command> --help'), 'for more information\\n');\n });\n\n return program;\n}\n"],"names":[],"mappings":";;;;;;;;;;;AAqBA,MAAM,UAAU;AAKT,SAAS,YAAqB;AACnC,QAAM,UAAU,IAAI,QAAA;AAEpB,UACG,KAAK,IAAI,EACT,YAAY,8EAA8E,EAC1F,QAAQ,SAAS,iBAAiB,wBAAwB;AAG7D,UAAQ,cAAc;AAAA,IACpB,iBAAiB;AAAA,IACjB,aAAa;AAAA,EAAA,CACd;AAGD,UAAQ,WAAW,mBAAmB;AACtC,UAAQ,WAAW,oBAAoB;AACvC,UAAQ,WAAW,mBAAmB;AACtC,UAAQ,WAAW,qBAAqB;AACxC,UAAQ,WAAW,mBAAmB;AACtC,UAAQ,WAAW,oBAAoB;AACvC,UAAQ,WAAW,qBAAqB;AACxC,UAAQ,WAAW,sBAAsB;AACzC,UAAQ,WAAW,0BAA0B;AAC7C,UAAQ,WAAW,sBAAsB;AAGzC,UAAQ,OAAO,MAAM;AACnB,YAAQ,IAAI,MAAM,KAAK,KAAK,6BAA6B,CAAC;AAC1D,YAAQ,IAAI,MAAM,KAAK,0DAA0D,CAAC;AAElF,YAAQ,IAAI,MAAM,MAAM,gBAAgB,CAAC;AACzC,YAAQ,IAAI,MAAM,KAAK,6DAA6D,CAAC;AACrF,YAAQ,IAAI,MAAM,KAAK,4DAA4D,CAAC;AACpF,YAAQ,IAAI,MAAM,KAAK,2DAA2D,CAAC;AACnF,YAAQ,IAAI,MAAM,KAAK,mDAAmD,CAAC;AAC3E,YAAQ,IAAI,MAAM,KAAK,0DAA0D,CAAC;AAElF,YAAQ,IAAI,MAAM,MAAM,yBAAyB,CAAC;AAClD,YAAQ,IAAI,MAAM,KAAK,uEAAuE,CAAC;AAC/F,YAAQ,IAAI,MAAM,KAAK,iEAAiE,CAAC;AACzF,YAAQ,IAAI,MAAM,KAAK,2DAA2D,CAAC;AACnF,YAAQ,IAAI,MAAM,KAAK,2DAA2D,CAAC;AACnF,YAAQ,IAAI,MAAM,KAAK,2DAA2D,CAAC;AACnF,YAAQ,IAAI,MAAM,KAAK,yDAAyD,CAAC;AAEjF,YAAQ,IAAI,MAAM,MAAM,aAAa,CAAC;AACtC,YAAQ,SAAS,QAAQ,CAAA,QAAO;AAC9B,cAAQ,IAAI,MAAM,KAAK,OAAO,IAAI,OAAO,OAAO,EAAE,CAAC,EAAE,GAAG,MAAM,KAAK,IAAI,YAAA,KAAiB,EAAE,CAAC;AAAA,IAC7F,CAAC;AAED,YAAQ,IAAI,WAAW,MAAM,KAAK,qBAAqB,GAAG,wBAAwB;AAAA,EACpF,CAAC;AAED,SAAO;AACT;"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Docs Analyzer
|
|
3
|
+
*
|
|
4
|
+
* Advanced documentation analyzer that uses claude-flow to create
|
|
5
|
+
* comprehensive knowledge graph documentation with proper structure,
|
|
6
|
+
* wikilinks, frontmatter, and tags following Obsidian conventions.
|
|
7
|
+
*/
|
|
8
|
+
import type { NodeType } from '../core/types.js';
|
|
9
|
+
/**
|
|
10
|
+
* Analyzer options
|
|
11
|
+
*/
|
|
12
|
+
export interface AnalyzerOptions {
|
|
13
|
+
/** Source directory with existing docs */
|
|
14
|
+
sourceDir: string;
|
|
15
|
+
/** Target directory (default: docs-nn) */
|
|
16
|
+
targetDir?: string;
|
|
17
|
+
/** Project root for path resolution */
|
|
18
|
+
projectRoot: string;
|
|
19
|
+
/** Use claude-flow for deep analysis */
|
|
20
|
+
useClaudeFlow?: boolean;
|
|
21
|
+
/** Create MOC (Map of Content) files */
|
|
22
|
+
createMOC?: boolean;
|
|
23
|
+
/** Link back to original docs */
|
|
24
|
+
linkOriginal?: boolean;
|
|
25
|
+
/** Maximum depth for analysis */
|
|
26
|
+
maxDepth?: number;
|
|
27
|
+
/** Dry run - show what would be done */
|
|
28
|
+
dryRun?: boolean;
|
|
29
|
+
/** Verbose output */
|
|
30
|
+
verbose?: boolean;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Analyzed document
|
|
34
|
+
*/
|
|
35
|
+
export interface AnalyzedDoc {
|
|
36
|
+
/** Original file path */
|
|
37
|
+
originalPath: string;
|
|
38
|
+
/** New file path in docs-nn */
|
|
39
|
+
newPath: string;
|
|
40
|
+
/** Document title */
|
|
41
|
+
title: string;
|
|
42
|
+
/** Detected node type */
|
|
43
|
+
type: NodeType;
|
|
44
|
+
/** Extracted tags */
|
|
45
|
+
tags: string[];
|
|
46
|
+
/** Related documents (wikilinks) */
|
|
47
|
+
related: string[];
|
|
48
|
+
/** Key concepts extracted */
|
|
49
|
+
concepts: string[];
|
|
50
|
+
/** Areas needing research */
|
|
51
|
+
researchNeeded: string[];
|
|
52
|
+
/** TODOs found or generated */
|
|
53
|
+
todos: string[];
|
|
54
|
+
/** Summary/description */
|
|
55
|
+
summary: string;
|
|
56
|
+
/** Category path in structure */
|
|
57
|
+
category: string;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Analyzer result
|
|
61
|
+
*/
|
|
62
|
+
export interface AnalyzerResult {
|
|
63
|
+
success: boolean;
|
|
64
|
+
filesAnalyzed: number;
|
|
65
|
+
filesCreated: number;
|
|
66
|
+
mocFilesCreated: number;
|
|
67
|
+
errors: string[];
|
|
68
|
+
analyzed: AnalyzedDoc[];
|
|
69
|
+
structure: Map<string, string[]>;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Analyze and migrate documentation to weave-nn structure
|
|
73
|
+
*/
|
|
74
|
+
export declare function analyzeDocs(options: AnalyzerOptions): Promise<AnalyzerResult>;
|
|
75
|
+
//# sourceMappingURL=docs-analyzer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"docs-analyzer.d.ts","sourceRoot":"","sources":["../../src/generators/docs-analyzer.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAOH,OAAO,KAAK,EAAE,QAAQ,EAA+B,MAAM,kBAAkB,CAAC;AAE9E;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,0CAA0C;IAC1C,SAAS,EAAE,MAAM,CAAC;IAClB,0CAA0C;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uCAAuC;IACvC,WAAW,EAAE,MAAM,CAAC;IACpB,wCAAwC;IACxC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,wCAAwC;IACxC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,iCAAiC;IACjC,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,iCAAiC;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,wCAAwC;IACxC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,qBAAqB;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,yBAAyB;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,+BAA+B;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,qBAAqB;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,yBAAyB;IACzB,IAAI,EAAE,QAAQ,CAAC;IACf,qBAAqB;IACrB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,oCAAoC;IACpC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,6BAA6B;IAC7B,QAAQ,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