@weavelogic/knowledge-graph-agent 0.8.5 → 0.8.7
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/cli/commands/docs.d.ts.map +1 -1
- package/dist/cli/commands/docs.js +3 -2
- package/dist/cli/commands/docs.js.map +1 -1
- package/dist/generators/doc-generator-agents.d.ts +1 -0
- package/dist/generators/doc-generator-agents.d.ts.map +1 -1
- package/dist/generators/doc-generator-agents.js +197 -7
- package/dist/generators/doc-generator-agents.js.map +1 -1
- package/dist/node_modules/@typescript-eslint/types/dist/index.js +1 -1
- package/dist/node_modules/@typescript-eslint/visitor-keys/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/docs.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAOpC;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,OAAO,
|
|
1
|
+
{"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/docs.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAOpC;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,OAAO,CAoM3C"}
|
|
@@ -7,7 +7,7 @@ import { validateProjectRoot, validateDocsPath } from "../../core/security.js";
|
|
|
7
7
|
function createDocsCommand() {
|
|
8
8
|
const command = new Command("docs");
|
|
9
9
|
command.description("Documentation management commands");
|
|
10
|
-
command.command("init").description("Initialize documentation directory with weave-nn structure").option("-p, --path <path>", "Project root path", ".").option("-d, --docs <path>", "Docs directory path", "docs").option("-t, --template <template>", "Template to use (default, minimal)").option("--no-examples", "Skip example files").option("--no-detect", "Skip framework detection").option("-f, --force", "Overwrite existing files").option("-g, --generate", "Generate documents using expert agents").option("--parallel", "Run agent generation in parallel").option("--dry-run", "Show what would be generated without creating files").option("-v, --verbose", "Show detailed agent output").action(async (options) => {
|
|
10
|
+
command.command("init").description("Initialize documentation directory with weave-nn structure").option("-p, --path <path>", "Project root path", ".").option("-d, --docs <path>", "Docs directory path", "docs").option("-t, --template <template>", "Template to use (default, minimal)").option("--no-examples", "Skip example files").option("--no-detect", "Skip framework detection").option("-f, --force", "Overwrite existing files").option("-g, --generate", "Generate documents using expert agents").option("--parallel", "Run agent generation in parallel").option("--dry-run", "Show what would be generated without creating files").option("-v, --verbose", "Show detailed agent output").option("--force-generate", "Force regenerate documents even if they exist").action(async (options) => {
|
|
11
11
|
const spinner = ora("Initializing documentation...").start();
|
|
12
12
|
try {
|
|
13
13
|
const projectRoot = validateProjectRoot(options.path);
|
|
@@ -68,7 +68,8 @@ function createDocsCommand() {
|
|
|
68
68
|
const genResult = await generateDocsWithAgents(projectRoot, result.docsPath, {
|
|
69
69
|
parallel: options.parallel,
|
|
70
70
|
dryRun: options.dryRun,
|
|
71
|
-
verbose: options.verbose
|
|
71
|
+
verbose: options.verbose,
|
|
72
|
+
force: options.forceGenerate
|
|
72
73
|
});
|
|
73
74
|
if (options.dryRun) {
|
|
74
75
|
genSpinner.info("Dry run complete - no files created");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docs.js","sources":["../../../src/cli/commands/docs.ts"],"sourcesContent":["/**\n * Docs Command\n *\n * Initialize and manage documentation directory.\n */\n\nimport { Command } from 'commander';\nimport chalk from 'chalk';\nimport ora from 'ora';\nimport { initDocs, docsExist, getDocsPath } from '../../generators/docs-init.js';\nimport { generateDocsWithAgents } from '../../generators/doc-generator-agents.js';\nimport { validateProjectRoot, validateDocsPath } from '../../core/security.js';\n\n/**\n * Create docs command\n */\nexport function createDocsCommand(): Command {\n const command = new Command('docs');\n\n command\n .description('Documentation management commands');\n\n // Init subcommand\n command\n .command('init')\n .description('Initialize documentation directory with weave-nn structure')\n .option('-p, --path <path>', 'Project root path', '.')\n .option('-d, --docs <path>', 'Docs directory path', 'docs')\n .option('-t, --template <template>', 'Template to use (default, minimal)')\n .option('--no-examples', 'Skip example files')\n .option('--no-detect', 'Skip framework detection')\n .option('-f, --force', 'Overwrite existing files')\n .option('-g, --generate', 'Generate documents using expert agents')\n .option('--parallel', 'Run agent generation in parallel')\n .option('--dry-run', 'Show what would be generated without creating files')\n .option('-v, --verbose', 'Show detailed agent output')\n .action(async (options) => {\n const spinner = ora('Initializing documentation...').start();\n\n try {\n // Validate paths to prevent traversal attacks\n const projectRoot = validateProjectRoot(options.path);\n const docsPath = options.docs;\n validateDocsPath(projectRoot, docsPath); // Ensure docs stays within project\n\n // Note: initDocs is additive - it only creates missing files/directories\n // The --force flag is for overwriting existing files if needed in the future\n const isExisting = docsExist(projectRoot, docsPath);\n if (isExisting) {\n spinner.text = 'Adding missing files to existing documentation...';\n }\n\n const result = await initDocs({\n projectRoot,\n docsPath,\n includeExamples: options.examples !== false,\n detectFramework: options.detect !== false,\n });\n\n if (result.success) {\n if (isExisting && result.filesCreated.length === 0) {\n spinner.succeed('Documentation already complete - no new files needed');\n } else if (isExisting) {\n spinner.succeed(`Documentation updated - added ${result.filesCreated.length} missing files`);\n } else {\n spinner.succeed('Documentation initialized!');\n }\n } else {\n spinner.warn('Documentation initialized with errors');\n }\n\n console.log();\n console.log(chalk.white(' Created:'));\n console.log(chalk.gray(` Path: ${result.docsPath}`));\n console.log(chalk.green(` Files: ${result.filesCreated.length}`));\n\n if (result.errors.length > 0) {\n console.log();\n console.log(chalk.yellow(' Errors:'));\n result.errors.forEach(err => {\n console.log(chalk.gray(` - ${err}`));\n });\n }\n\n console.log();\n console.log(chalk.cyan('Structure created:'));\n console.log(chalk.gray(`\n ${docsPath}/\n ├── README.md # Documentation home\n ├── PRIMITIVES.md # Technology primitives\n ├── MOC.md # Map of Content\n ├── concepts/ # Abstract concepts\n ├── components/ # Reusable components\n ├── services/ # Backend services\n ├── features/ # Product features\n ├── integrations/ # External integrations\n ├── standards/ # Coding standards\n ├── guides/ # How-to guides\n └── references/ # API references\n `));\n\n // Run agent generation if requested\n if (options.generate) {\n console.log();\n const genSpinner = ora('Analyzing project and generating documents with expert agents...').start();\n\n try {\n const genResult = await generateDocsWithAgents(projectRoot, result.docsPath, {\n parallel: options.parallel,\n dryRun: options.dryRun,\n verbose: options.verbose,\n });\n\n if (options.dryRun) {\n genSpinner.info('Dry run complete - no files created');\n } else if (genResult.success) {\n genSpinner.succeed(`Generated ${genResult.documentsGenerated.filter(d => d.generated).length} documents using ${genResult.agentsSpawned} agents`);\n } else {\n genSpinner.warn(`Generated ${genResult.documentsGenerated.filter(d => d.generated).length} documents with ${genResult.errors.length} errors`);\n }\n\n if (genResult.documentsGenerated.length > 0 && !options.dryRun) {\n console.log();\n console.log(chalk.white(' Generated Documents:'));\n for (const doc of genResult.documentsGenerated) {\n const icon = doc.generated ? chalk.green('✓') : chalk.red('✗');\n console.log(` ${icon} ${doc.path}${doc.error ? chalk.gray(` (${doc.error})`) : ''}`);\n }\n }\n\n if (genResult.errors.length > 0 && !options.dryRun) {\n console.log();\n console.log(chalk.yellow(' Agent Errors:'));\n genResult.errors.forEach(err => {\n console.log(chalk.gray(` - ${err}`));\n });\n }\n } catch (genError) {\n genSpinner.fail('Agent generation failed');\n console.error(chalk.red(String(genError)));\n }\n }\n\n console.log();\n console.log(chalk.cyan('Next: ') + chalk.white('kg graph') + chalk.gray(' to generate knowledge graph'));\n console.log();\n\n } catch (error) {\n spinner.fail('Failed to initialize documentation');\n console.error(chalk.red(String(error)));\n process.exit(1);\n }\n });\n\n // Status subcommand\n command\n .command('status')\n .description('Show documentation status')\n .option('-p, --path <path>', 'Project root path', '.')\n .action(async (options) => {\n // Validate path to prevent traversal\n const projectRoot = validateProjectRoot(options.path);\n const docsPath = getDocsPath(projectRoot);\n\n if (!docsPath) {\n console.log(chalk.yellow(' No documentation directory found'));\n console.log(chalk.gray(' Run ') + chalk.cyan('kg docs init') + chalk.gray(' to create one'));\n return;\n }\n\n console.log(chalk.white('\\n Documentation Status\\n'));\n console.log(chalk.gray(' Path:'), chalk.white(docsPath));\n console.log();\n\n // Count files\n const fg = await import('fast-glob');\n const files = await fg.default('**/*.md', {\n cwd: docsPath,\n ignore: ['node_modules/**', '.git/**'],\n });\n\n console.log(chalk.gray(' Markdown files:'), chalk.white(files.length));\n\n // Check for key files\n const keyFiles = ['README.md', 'PRIMITIVES.md', 'MOC.md'];\n const fs = await import('fs');\n const path = await import('path');\n\n console.log();\n console.log(chalk.white(' Key Files:'));\n keyFiles.forEach(file => {\n const exists = fs.existsSync(path.join(docsPath, file));\n const icon = exists ? chalk.green('✓') : chalk.red('✗');\n console.log(` ${icon} ${file}`);\n });\n\n // Check directories\n const dirs = ['concepts', 'components', 'services', 'features', 'guides'];\n console.log();\n console.log(chalk.white(' Directories:'));\n dirs.forEach(dir => {\n const exists = fs.existsSync(path.join(docsPath, dir));\n const icon = exists ? chalk.green('✓') : chalk.gray('○');\n console.log(` ${icon} ${dir}/`);\n });\n\n console.log();\n });\n\n return command;\n}\n"],"names":[],"mappings":";;;;;;AAgBO,SAAS,oBAA6B;AAC3C,QAAM,UAAU,IAAI,QAAQ,MAAM;AAElC,UACG,YAAY,mCAAmC;AAGlD,UACG,QAAQ,MAAM,EACd,YAAY,4DAA4D,EACxE,OAAO,qBAAqB,qBAAqB,GAAG,EACpD,OAAO,qBAAqB,uBAAuB,MAAM,EACzD,OAAO,6BAA6B,oCAAoC,EACxE,OAAO,iBAAiB,oBAAoB,EAC5C,OAAO,eAAe,0BAA0B,EAChD,OAAO,eAAe,0BAA0B,EAChD,OAAO,kBAAkB,wCAAwC,EACjE,OAAO,cAAc,kCAAkC,EACvD,OAAO,aAAa,qDAAqD,EACzE,OAAO,iBAAiB,4BAA4B,EACpD,OAAO,OAAO,YAAY;AACzB,UAAM,UAAU,IAAI,+BAA+B,EAAE,MAAA;AAErD,QAAI;AAEF,YAAM,cAAc,oBAAoB,QAAQ,IAAI;AACpD,YAAM,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IAAI,MAAM,MAAM,cAAc,CAAC;AACvC,aAAS,QAAQ,CAAA,SAAQ;AACvB,YAAM,SAAS,GAAG,WAAW,KAAK,KAAK,UAAU,IAAI,CAAC;AACtD,YAAM,OAAO,SAAS,MAAM,MAAM,GAAG,IAAI,MAAM,IAAI,GAAG;AACtD,cAAQ,IAAI,OAAO,IAAI,IAAI,IAAI,EAAE;AAAA,IACnC,CAAC;AAGD,UAAM,OAAO,CAAC,YAAY,cAAc,YAAY,YAAY,QAAQ;AACxE,YAAQ,IAAA;AACR,YAAQ,IAAI,MAAM,MAAM,gBAAgB,CAAC;AACzC,SAAK,QAAQ,CAAA,QAAO;AAClB,YAAM,SAAS,GAAG,WAAW,KAAK,KAAK,UAAU,GAAG,CAAC;AACrD,YAAM,OAAO,SAAS,MAAM,MAAM,GAAG,IAAI,MAAM,KAAK,GAAG;AACvD,cAAQ,IAAI,OAAO,IAAI,IAAI,GAAG,GAAG;AAAA,IACnC,CAAC;AAED,YAAQ,IAAA;AAAA,EACV,CAAC;AAEH,SAAO;AACT;"}
|
|
1
|
+
{"version":3,"file":"docs.js","sources":["../../../src/cli/commands/docs.ts"],"sourcesContent":["/**\n * Docs Command\n *\n * Initialize and manage documentation directory.\n */\n\nimport { Command } from 'commander';\nimport chalk from 'chalk';\nimport ora from 'ora';\nimport { initDocs, docsExist, getDocsPath } from '../../generators/docs-init.js';\nimport { generateDocsWithAgents } from '../../generators/doc-generator-agents.js';\nimport { validateProjectRoot, validateDocsPath } from '../../core/security.js';\n\n/**\n * Create docs command\n */\nexport function createDocsCommand(): Command {\n const command = new Command('docs');\n\n command\n .description('Documentation management commands');\n\n // Init subcommand\n command\n .command('init')\n .description('Initialize documentation directory with weave-nn structure')\n .option('-p, --path <path>', 'Project root path', '.')\n .option('-d, --docs <path>', 'Docs directory path', 'docs')\n .option('-t, --template <template>', 'Template to use (default, minimal)')\n .option('--no-examples', 'Skip example files')\n .option('--no-detect', 'Skip framework detection')\n .option('-f, --force', 'Overwrite existing files')\n .option('-g, --generate', 'Generate documents using expert agents')\n .option('--parallel', 'Run agent generation in parallel')\n .option('--dry-run', 'Show what would be generated without creating files')\n .option('-v, --verbose', 'Show detailed agent output')\n .option('--force-generate', 'Force regenerate documents even if they exist')\n .action(async (options) => {\n const spinner = ora('Initializing documentation...').start();\n\n try {\n // Validate paths to prevent traversal attacks\n const projectRoot = validateProjectRoot(options.path);\n const docsPath = options.docs;\n validateDocsPath(projectRoot, docsPath); // Ensure docs stays within project\n\n // Note: initDocs is additive - it only creates missing files/directories\n // The --force flag is for overwriting existing files if needed in the future\n const isExisting = docsExist(projectRoot, docsPath);\n if (isExisting) {\n spinner.text = 'Adding missing files to existing documentation...';\n }\n\n const result = await initDocs({\n projectRoot,\n docsPath,\n includeExamples: options.examples !== false,\n detectFramework: options.detect !== false,\n });\n\n if (result.success) {\n if (isExisting && result.filesCreated.length === 0) {\n spinner.succeed('Documentation already complete - no new files needed');\n } else if (isExisting) {\n spinner.succeed(`Documentation updated - added ${result.filesCreated.length} missing files`);\n } else {\n spinner.succeed('Documentation initialized!');\n }\n } else {\n spinner.warn('Documentation initialized with errors');\n }\n\n console.log();\n console.log(chalk.white(' Created:'));\n console.log(chalk.gray(` Path: ${result.docsPath}`));\n console.log(chalk.green(` Files: ${result.filesCreated.length}`));\n\n if (result.errors.length > 0) {\n console.log();\n console.log(chalk.yellow(' Errors:'));\n result.errors.forEach(err => {\n console.log(chalk.gray(` - ${err}`));\n });\n }\n\n console.log();\n console.log(chalk.cyan('Structure created:'));\n console.log(chalk.gray(`\n ${docsPath}/\n ├── README.md # Documentation home\n ├── PRIMITIVES.md # Technology primitives\n ├── MOC.md # Map of Content\n ├── concepts/ # Abstract concepts\n ├── components/ # Reusable components\n ├── services/ # Backend services\n ├── features/ # Product features\n ├── integrations/ # External integrations\n ├── standards/ # Coding standards\n ├── guides/ # How-to guides\n └── references/ # API references\n `));\n\n // Run agent generation if requested\n if (options.generate) {\n console.log();\n const genSpinner = ora('Analyzing project and generating documents with expert agents...').start();\n\n try {\n const genResult = await generateDocsWithAgents(projectRoot, result.docsPath, {\n parallel: options.parallel,\n dryRun: options.dryRun,\n verbose: options.verbose,\n force: options.forceGenerate,\n });\n\n if (options.dryRun) {\n genSpinner.info('Dry run complete - no files created');\n } else if (genResult.success) {\n genSpinner.succeed(`Generated ${genResult.documentsGenerated.filter(d => d.generated).length} documents using ${genResult.agentsSpawned} agents`);\n } else {\n genSpinner.warn(`Generated ${genResult.documentsGenerated.filter(d => d.generated).length} documents with ${genResult.errors.length} errors`);\n }\n\n if (genResult.documentsGenerated.length > 0 && !options.dryRun) {\n console.log();\n console.log(chalk.white(' Generated Documents:'));\n for (const doc of genResult.documentsGenerated) {\n const icon = doc.generated ? chalk.green('✓') : chalk.red('✗');\n console.log(` ${icon} ${doc.path}${doc.error ? chalk.gray(` (${doc.error})`) : ''}`);\n }\n }\n\n if (genResult.errors.length > 0 && !options.dryRun) {\n console.log();\n console.log(chalk.yellow(' Agent Errors:'));\n genResult.errors.forEach(err => {\n console.log(chalk.gray(` - ${err}`));\n });\n }\n } catch (genError) {\n genSpinner.fail('Agent generation failed');\n console.error(chalk.red(String(genError)));\n }\n }\n\n console.log();\n console.log(chalk.cyan('Next: ') + chalk.white('kg graph') + chalk.gray(' to generate knowledge graph'));\n console.log();\n\n } catch (error) {\n spinner.fail('Failed to initialize documentation');\n console.error(chalk.red(String(error)));\n process.exit(1);\n }\n });\n\n // Status subcommand\n command\n .command('status')\n .description('Show documentation status')\n .option('-p, --path <path>', 'Project root path', '.')\n .action(async (options) => {\n // Validate path to prevent traversal\n const projectRoot = validateProjectRoot(options.path);\n const docsPath = getDocsPath(projectRoot);\n\n if (!docsPath) {\n console.log(chalk.yellow(' No documentation directory found'));\n console.log(chalk.gray(' Run ') + chalk.cyan('kg docs init') + chalk.gray(' to create one'));\n return;\n }\n\n console.log(chalk.white('\\n Documentation Status\\n'));\n console.log(chalk.gray(' Path:'), chalk.white(docsPath));\n console.log();\n\n // Count files\n const fg = await import('fast-glob');\n const files = await fg.default('**/*.md', {\n cwd: docsPath,\n ignore: ['node_modules/**', '.git/**'],\n });\n\n console.log(chalk.gray(' Markdown files:'), chalk.white(files.length));\n\n // Check for key files\n const keyFiles = ['README.md', 'PRIMITIVES.md', 'MOC.md'];\n const fs = await import('fs');\n const path = await import('path');\n\n console.log();\n console.log(chalk.white(' Key Files:'));\n keyFiles.forEach(file => {\n const exists = fs.existsSync(path.join(docsPath, file));\n const icon = exists ? chalk.green('✓') : chalk.red('✗');\n console.log(` ${icon} ${file}`);\n });\n\n // Check directories\n const dirs = ['concepts', 'components', 'services', 'features', 'guides'];\n console.log();\n console.log(chalk.white(' Directories:'));\n dirs.forEach(dir => {\n const exists = fs.existsSync(path.join(docsPath, dir));\n const icon = exists ? chalk.green('✓') : chalk.gray('○');\n console.log(` ${icon} ${dir}/`);\n });\n\n console.log();\n });\n\n return command;\n}\n"],"names":[],"mappings":";;;;;;AAgBO,SAAS,oBAA6B;AAC3C,QAAM,UAAU,IAAI,QAAQ,MAAM;AAElC,UACG,YAAY,mCAAmC;AAGlD,UACG,QAAQ,MAAM,EACd,YAAY,4DAA4D,EACxE,OAAO,qBAAqB,qBAAqB,GAAG,EACpD,OAAO,qBAAqB,uBAAuB,MAAM,EACzD,OAAO,6BAA6B,oCAAoC,EACxE,OAAO,iBAAiB,oBAAoB,EAC5C,OAAO,eAAe,0BAA0B,EAChD,OAAO,eAAe,0BAA0B,EAChD,OAAO,kBAAkB,wCAAwC,EACjE,OAAO,cAAc,kCAAkC,EACvD,OAAO,aAAa,qDAAqD,EACzE,OAAO,iBAAiB,4BAA4B,EACpD,OAAO,oBAAoB,+CAA+C,EAC1E,OAAO,OAAO,YAAY;AACzB,UAAM,UAAU,IAAI,+BAA+B,EAAE,MAAA;AAErD,QAAI;AAEF,YAAM,cAAc,oBAAoB,QAAQ,IAAI;AACpD,YAAM,WAAW,QAAQ;AACzB,uBAAiB,aAAa,QAAQ;AAItC,YAAM,aAAa,UA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;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,OAAO,CAAC;IACjB,kBAAkB,EAAE,YAAY,EAAE,CAAC;IACnC,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAaD;;GAEG;AACH,wBAAsB,sBAAsB,CAC1C,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE;IACP,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"doc-generator-agents.d.ts","sourceRoot":"","sources":["../../src/generators/doc-generator-agents.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,OAAO,CAAC;IACjB,kBAAkB,EAAE,YAAY,EAAE,CAAC;IACnC,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAaD;;GAEG;AACH,wBAAsB,sBAAsB,CAC1C,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE;IACP,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;CACZ,GACL,OAAO,CAAC,qBAAqB,CAAC,CA0EhC"}
|
|
@@ -11,7 +11,7 @@ async function generateDocsWithAgents(projectRoot, docsPath, options = {}) {
|
|
|
11
11
|
};
|
|
12
12
|
try {
|
|
13
13
|
const context = await buildGenerationContext(projectRoot, docsPath);
|
|
14
|
-
const tasks = await planDocumentGeneration(context);
|
|
14
|
+
const tasks = await planDocumentGeneration(context, options.force);
|
|
15
15
|
if (options.dryRun) {
|
|
16
16
|
console.log("\n[Dry Run] Would generate the following documents:");
|
|
17
17
|
for (const task of tasks) {
|
|
@@ -95,8 +95,32 @@ async function buildGenerationContext(projectRoot, docsPath) {
|
|
|
95
95
|
if (existsSync(join(projectRoot, "package.json"))) {
|
|
96
96
|
context.languages.push("JavaScript");
|
|
97
97
|
}
|
|
98
|
-
|
|
98
|
+
const pythonConfigPaths = [
|
|
99
|
+
join(projectRoot, "requirements.txt"),
|
|
100
|
+
join(projectRoot, "pyproject.toml"),
|
|
101
|
+
join(projectRoot, "src/backend/requirements.txt"),
|
|
102
|
+
join(projectRoot, "backend/requirements.txt"),
|
|
103
|
+
join(projectRoot, "src/requirements.txt")
|
|
104
|
+
];
|
|
105
|
+
const foundPythonConfig = pythonConfigPaths.find((p) => existsSync(p));
|
|
106
|
+
if (foundPythonConfig) {
|
|
99
107
|
context.languages.push("Python");
|
|
108
|
+
try {
|
|
109
|
+
let reqContent = readFileSync(foundPythonConfig, "utf-8").toLowerCase();
|
|
110
|
+
if (foundPythonConfig.includes("requirements.txt")) {
|
|
111
|
+
const pyprojectPath = join(projectRoot, "pyproject.toml");
|
|
112
|
+
if (existsSync(pyprojectPath)) {
|
|
113
|
+
reqContent += readFileSync(pyprojectPath, "utf-8").toLowerCase();
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
if (reqContent.includes("fastapi")) context.frameworks.push("FastAPI");
|
|
117
|
+
if (reqContent.includes("flask")) context.frameworks.push("Flask");
|
|
118
|
+
if (reqContent.includes("django")) context.frameworks.push("Django");
|
|
119
|
+
if (reqContent.includes("sqlalchemy")) context.frameworks.push("SQLAlchemy");
|
|
120
|
+
if (reqContent.includes("pydantic")) context.frameworks.push("Pydantic");
|
|
121
|
+
if (reqContent.includes("alembic")) context.frameworks.push("Alembic");
|
|
122
|
+
} catch {
|
|
123
|
+
}
|
|
100
124
|
}
|
|
101
125
|
if (existsSync(join(projectRoot, "Cargo.toml"))) {
|
|
102
126
|
context.languages.push("Rust");
|
|
@@ -115,30 +139,49 @@ async function buildGenerationContext(projectRoot, docsPath) {
|
|
|
115
139
|
dot: true
|
|
116
140
|
});
|
|
117
141
|
context.sourceFiles = sourceFiles;
|
|
142
|
+
if (!context.languages.includes("Python") && sourceFiles.some((f) => f.endsWith(".py"))) {
|
|
143
|
+
context.languages.push("Python");
|
|
144
|
+
}
|
|
118
145
|
return context;
|
|
119
146
|
}
|
|
120
|
-
async function planDocumentGeneration(context) {
|
|
147
|
+
async function planDocumentGeneration(context, force) {
|
|
121
148
|
const tasks = [];
|
|
122
149
|
const { projectRoot, docsPath, sourceFiles, frameworks } = context;
|
|
123
150
|
const docExists = (relativePath) => {
|
|
151
|
+
if (force) return false;
|
|
124
152
|
return existsSync(join(docsPath, relativePath));
|
|
125
153
|
};
|
|
126
154
|
const srcDirs = /* @__PURE__ */ new Set();
|
|
127
155
|
const componentFiles = [];
|
|
128
156
|
const serviceFiles = [];
|
|
129
157
|
const utilityFiles = [];
|
|
158
|
+
const backendFiles = [];
|
|
159
|
+
const modelFiles = [];
|
|
130
160
|
for (const file of sourceFiles) {
|
|
131
161
|
const dir = file.split("/")[0];
|
|
132
162
|
srcDirs.add(dir);
|
|
133
|
-
|
|
163
|
+
const fileLower = file.toLowerCase();
|
|
164
|
+
if (fileLower.includes("component") || fileLower.includes("/ui/") || fileLower.includes("/views/")) {
|
|
134
165
|
componentFiles.push(file);
|
|
135
|
-
}
|
|
166
|
+
}
|
|
167
|
+
if (fileLower.includes("service") || fileLower.includes("/api/") || fileLower.includes("routes") || fileLower.includes("endpoints")) {
|
|
136
168
|
serviceFiles.push(file);
|
|
137
|
-
}
|
|
169
|
+
}
|
|
170
|
+
if (fileLower.includes("util") || fileLower.includes("helper") || fileLower.includes("/lib/") || fileLower.includes("common")) {
|
|
138
171
|
utilityFiles.push(file);
|
|
139
172
|
}
|
|
173
|
+
if (fileLower.includes("backend") || fileLower.includes("server") || fileLower.includes("app/")) {
|
|
174
|
+
backendFiles.push(file);
|
|
175
|
+
}
|
|
176
|
+
if (fileLower.includes("model") || fileLower.includes("schema") || fileLower.includes("entities")) {
|
|
177
|
+
modelFiles.push(file);
|
|
178
|
+
}
|
|
179
|
+
if (fileLower.includes("frontend") || fileLower.includes("client") || fileLower.includes("pages")) ;
|
|
180
|
+
}
|
|
181
|
+
if (serviceFiles.length === 0 && backendFiles.length > 0) {
|
|
182
|
+
serviceFiles.push(...backendFiles);
|
|
140
183
|
}
|
|
141
|
-
if (srcDirs.size
|
|
184
|
+
if (srcDirs.size >= 1 && sourceFiles.length >= 3 && !docExists("concepts/architecture/overview.md")) {
|
|
142
185
|
tasks.push({
|
|
143
186
|
directory: "concepts/architecture",
|
|
144
187
|
type: "concept",
|
|
@@ -205,6 +248,33 @@ async function planDocumentGeneration(context) {
|
|
|
205
248
|
outputFile: "integrations/databases/prisma.md"
|
|
206
249
|
});
|
|
207
250
|
}
|
|
251
|
+
if (frameworks.includes("SQLAlchemy") && !docExists("integrations/databases/sqlalchemy.md")) {
|
|
252
|
+
tasks.push({
|
|
253
|
+
directory: "integrations/databases",
|
|
254
|
+
type: "integration",
|
|
255
|
+
agentType: "coder",
|
|
256
|
+
prompt: buildSQLAlchemyPrompt(context, modelFiles),
|
|
257
|
+
outputFile: "integrations/databases/sqlalchemy.md"
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
if (frameworks.includes("FastAPI") && !docExists("services/api/fastapi.md")) {
|
|
261
|
+
tasks.push({
|
|
262
|
+
directory: "services/api",
|
|
263
|
+
type: "service",
|
|
264
|
+
agentType: "coder",
|
|
265
|
+
prompt: buildFastAPIPrompt(context, serviceFiles),
|
|
266
|
+
outputFile: "services/api/fastapi.md"
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
if (frameworks.includes("Flask") && !docExists("services/api/flask.md")) {
|
|
270
|
+
tasks.push({
|
|
271
|
+
directory: "services/api",
|
|
272
|
+
type: "service",
|
|
273
|
+
agentType: "coder",
|
|
274
|
+
prompt: buildFlaskPrompt(context, serviceFiles),
|
|
275
|
+
outputFile: "services/api/flask.md"
|
|
276
|
+
});
|
|
277
|
+
}
|
|
208
278
|
return tasks;
|
|
209
279
|
}
|
|
210
280
|
async function executeAgentTask(task, context, verbose) {
|
|
@@ -483,6 +553,111 @@ npx prisma migrate dev
|
|
|
483
553
|
|
|
484
554
|
*Add Prisma client usage examples*
|
|
485
555
|
|
|
556
|
+
---
|
|
557
|
+
> Auto-generated by kg-agent
|
|
558
|
+
`,
|
|
559
|
+
"integrations/databases/sqlalchemy.md": `---
|
|
560
|
+
title: SQLAlchemy Integration
|
|
561
|
+
type: integration
|
|
562
|
+
status: active
|
|
563
|
+
tags: [sqlalchemy, database, orm, python]
|
|
564
|
+
created: ${date}
|
|
565
|
+
---
|
|
566
|
+
|
|
567
|
+
# SQLAlchemy Integration
|
|
568
|
+
|
|
569
|
+
Database ORM configuration for ${projectName}.
|
|
570
|
+
|
|
571
|
+
## Models
|
|
572
|
+
|
|
573
|
+
*Document your SQLAlchemy models*
|
|
574
|
+
|
|
575
|
+
## Database Connection
|
|
576
|
+
|
|
577
|
+
\`\`\`python
|
|
578
|
+
from sqlalchemy import create_engine
|
|
579
|
+
from sqlalchemy.orm import sessionmaker
|
|
580
|
+
|
|
581
|
+
engine = create_engine(DATABASE_URL)
|
|
582
|
+
Session = sessionmaker(bind=engine)
|
|
583
|
+
\`\`\`
|
|
584
|
+
|
|
585
|
+
## Migrations (Alembic)
|
|
586
|
+
|
|
587
|
+
\`\`\`bash
|
|
588
|
+
alembic upgrade head
|
|
589
|
+
\`\`\`
|
|
590
|
+
|
|
591
|
+
## Query Examples
|
|
592
|
+
|
|
593
|
+
*Add common query patterns*
|
|
594
|
+
|
|
595
|
+
---
|
|
596
|
+
> Auto-generated by kg-agent
|
|
597
|
+
`,
|
|
598
|
+
"services/api/fastapi.md": `---
|
|
599
|
+
title: FastAPI Service
|
|
600
|
+
type: service
|
|
601
|
+
status: active
|
|
602
|
+
tags: [fastapi, api, python]
|
|
603
|
+
created: ${date}
|
|
604
|
+
---
|
|
605
|
+
|
|
606
|
+
# FastAPI Service
|
|
607
|
+
|
|
608
|
+
API service documentation for ${projectName}.
|
|
609
|
+
|
|
610
|
+
## Running the Server
|
|
611
|
+
|
|
612
|
+
\`\`\`bash
|
|
613
|
+
uvicorn main:app --reload
|
|
614
|
+
\`\`\`
|
|
615
|
+
|
|
616
|
+
## API Endpoints
|
|
617
|
+
|
|
618
|
+
*Document your API endpoints*
|
|
619
|
+
|
|
620
|
+
## Authentication
|
|
621
|
+
|
|
622
|
+
*Document authentication flow*
|
|
623
|
+
|
|
624
|
+
## Request/Response Schemas
|
|
625
|
+
|
|
626
|
+
*Document Pydantic models*
|
|
627
|
+
|
|
628
|
+
---
|
|
629
|
+
> Auto-generated by kg-agent
|
|
630
|
+
`,
|
|
631
|
+
"services/api/flask.md": `---
|
|
632
|
+
title: Flask Service
|
|
633
|
+
type: service
|
|
634
|
+
status: active
|
|
635
|
+
tags: [flask, api, python]
|
|
636
|
+
created: ${date}
|
|
637
|
+
---
|
|
638
|
+
|
|
639
|
+
# Flask Service
|
|
640
|
+
|
|
641
|
+
API service documentation for ${projectName}.
|
|
642
|
+
|
|
643
|
+
## Running the Server
|
|
644
|
+
|
|
645
|
+
\`\`\`bash
|
|
646
|
+
flask run
|
|
647
|
+
\`\`\`
|
|
648
|
+
|
|
649
|
+
## Routes
|
|
650
|
+
|
|
651
|
+
*Document your Flask routes*
|
|
652
|
+
|
|
653
|
+
## Blueprints
|
|
654
|
+
|
|
655
|
+
*Document blueprints structure*
|
|
656
|
+
|
|
657
|
+
## Error Handling
|
|
658
|
+
|
|
659
|
+
*Document error handling patterns*
|
|
660
|
+
|
|
486
661
|
---
|
|
487
662
|
> Auto-generated by kg-agent
|
|
488
663
|
`
|
|
@@ -557,6 +732,21 @@ function buildPrismaPrompt(context) {
|
|
|
557
732
|
return `Document Prisma database integration for ${context.projectName}.
|
|
558
733
|
Generate integration documentation with schema, models, and usage patterns.`;
|
|
559
734
|
}
|
|
735
|
+
function buildSQLAlchemyPrompt(context, modelFiles) {
|
|
736
|
+
return `Document SQLAlchemy database integration for ${context.projectName}.
|
|
737
|
+
Model files: ${modelFiles.slice(0, 10).join(", ")}.
|
|
738
|
+
Generate integration documentation with models, relationships, and query patterns.`;
|
|
739
|
+
}
|
|
740
|
+
function buildFastAPIPrompt(context, serviceFiles) {
|
|
741
|
+
return `Document FastAPI API service for ${context.projectName}.
|
|
742
|
+
API files: ${serviceFiles.slice(0, 10).join(", ")}.
|
|
743
|
+
Generate API documentation with endpoints, request/response schemas, and authentication.`;
|
|
744
|
+
}
|
|
745
|
+
function buildFlaskPrompt(context, serviceFiles) {
|
|
746
|
+
return `Document Flask API service for ${context.projectName}.
|
|
747
|
+
Route files: ${serviceFiles.slice(0, 10).join(", ")}.
|
|
748
|
+
Generate API documentation with routes, blueprints, and request handling.`;
|
|
749
|
+
}
|
|
560
750
|
export {
|
|
561
751
|
generateDocsWithAgents
|
|
562
752
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doc-generator-agents.js","sources":["../../src/generators/doc-generator-agents.ts"],"sourcesContent":["/**\n * Agent-Driven Document Generator\n *\n * Spawns expert agents from claude-flow to analyze existing code and\n * documentation, then generates appropriate documents for each directory.\n */\n\nimport { existsSync, readFileSync, writeFileSync, readdirSync, statSync } from 'fs';\nimport { join, basename, extname, relative } from 'path';\nimport fg from 'fast-glob';\nimport { spawn } from 'child_process';\n\n/**\n * Document generation context\n */\nexport interface GenerationContext {\n projectRoot: string;\n docsPath: string;\n projectName: string;\n languages: string[];\n frameworks: string[];\n existingDocs: string[];\n sourceFiles: string[];\n}\n\n/**\n * Generation result for a single document\n */\nexport interface GeneratedDoc {\n path: string;\n title: string;\n type: string;\n generated: boolean;\n error?: string;\n}\n\n/**\n * Overall generation result\n */\nexport interface AgentGenerationResult {\n success: boolean;\n documentsGenerated: GeneratedDoc[];\n agentsSpawned: number;\n errors: string[];\n}\n\n/**\n * Agent task definition\n */\ninterface AgentTask {\n directory: string;\n type: 'concept' | 'component' | 'service' | 'feature' | 'integration' | 'standard' | 'guide' | 'reference';\n agentType: 'researcher' | 'coder' | 'analyst';\n prompt: string;\n outputFile: string;\n}\n\n/**\n * Analyze project and generate documents using expert agents\n */\nexport async function generateDocsWithAgents(\n projectRoot: string,\n docsPath: string,\n options: {\n parallel?: boolean;\n dryRun?: boolean;\n verbose?: boolean;\n } = {}\n): Promise<AgentGenerationResult> {\n const result: AgentGenerationResult = {\n success: true,\n documentsGenerated: [],\n agentsSpawned: 0,\n errors: [],\n };\n\n try {\n // Build context by analyzing the project\n const context = await buildGenerationContext(projectRoot, docsPath);\n\n // Determine what documents should be generated\n const tasks = await planDocumentGeneration(context);\n\n if (options.dryRun) {\n console.log('\\n[Dry Run] Would generate the following documents:');\n for (const task of tasks) {\n console.log(` - ${task.outputFile} (${task.agentType} agent)`);\n }\n return result;\n }\n\n // Execute tasks (parallel or sequential)\n if (options.parallel) {\n const results = await Promise.allSettled(\n tasks.map(task => executeAgentTask(task, context, options.verbose))\n );\n\n for (let i = 0; i < results.length; i++) {\n const r = results[i];\n result.agentsSpawned++;\n\n if (r.status === 'fulfilled') {\n result.documentsGenerated.push(r.value);\n } else {\n result.errors.push(`Failed: ${tasks[i].outputFile} - ${r.reason}`);\n result.documentsGenerated.push({\n path: tasks[i].outputFile,\n title: basename(tasks[i].outputFile, '.md'),\n type: tasks[i].type,\n generated: false,\n error: String(r.reason),\n });\n }\n }\n } else {\n // Sequential execution\n for (const task of tasks) {\n result.agentsSpawned++;\n\n try {\n const doc = await executeAgentTask(task, context, options.verbose);\n result.documentsGenerated.push(doc);\n } catch (error) {\n result.errors.push(`Failed: ${task.outputFile} - ${error}`);\n result.documentsGenerated.push({\n path: task.outputFile,\n title: basename(task.outputFile, '.md'),\n type: task.type,\n generated: false,\n error: String(error),\n });\n }\n }\n }\n\n result.success = result.errors.length === 0;\n } catch (error) {\n result.success = false;\n result.errors.push(`Generation failed: ${error}`);\n }\n\n return result;\n}\n\n/**\n * Build context by analyzing the project\n */\nasync function buildGenerationContext(\n projectRoot: string,\n docsPath: string\n): Promise<GenerationContext> {\n const context: GenerationContext = {\n projectRoot,\n docsPath,\n projectName: basename(projectRoot),\n languages: [],\n frameworks: [],\n existingDocs: [],\n sourceFiles: [],\n };\n\n // Get project name from package.json\n const pkgPath = join(projectRoot, 'package.json');\n if (existsSync(pkgPath)) {\n try {\n const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));\n context.projectName = pkg.name?.replace(/^@[^/]+\\//, '') || context.projectName;\n\n // Detect frameworks from dependencies\n const deps = { ...pkg.dependencies, ...pkg.devDependencies };\n if (deps.react) context.frameworks.push('React');\n if (deps.next) context.frameworks.push('Next.js');\n if (deps.vue) context.frameworks.push('Vue');\n if (deps.express) context.frameworks.push('Express');\n if (deps.fastify) context.frameworks.push('Fastify');\n if (deps['@prisma/client'] || deps.prisma) context.frameworks.push('Prisma');\n } catch {\n // Ignore parse errors\n }\n }\n\n // Detect languages\n if (existsSync(join(projectRoot, 'tsconfig.json'))) {\n context.languages.push('TypeScript');\n }\n if (existsSync(join(projectRoot, 'package.json'))) {\n context.languages.push('JavaScript');\n }\n if (existsSync(join(projectRoot, 'requirements.txt')) || existsSync(join(projectRoot, 'pyproject.toml'))) {\n context.languages.push('Python');\n }\n if (existsSync(join(projectRoot, 'Cargo.toml'))) {\n context.languages.push('Rust');\n }\n if (existsSync(join(projectRoot, 'go.mod'))) {\n context.languages.push('Go');\n }\n\n // Find existing docs\n const existingDocs = await fg('**/*.md', {\n cwd: docsPath,\n ignore: ['node_modules/**', '.git/**', '_templates/**'],\n });\n context.existingDocs = existingDocs;\n\n // Find source files\n const sourceFiles = await fg('**/*.{ts,tsx,js,jsx,py,rs,go}', {\n cwd: projectRoot,\n ignore: ['node_modules/**', '.git/**', 'dist/**', 'build/**', docsPath + '/**'],\n dot: true,\n });\n context.sourceFiles = sourceFiles;\n\n return context;\n}\n\n/**\n * Plan what documents should be generated based on context\n */\nasync function planDocumentGeneration(context: GenerationContext): Promise<AgentTask[]> {\n const tasks: AgentTask[] = [];\n const { projectRoot, docsPath, sourceFiles, frameworks } = context;\n\n // Helper to check if doc already exists\n const docExists = (relativePath: string) => {\n return existsSync(join(docsPath, relativePath));\n };\n\n // Analyze source structure to determine what docs to generate\n const srcDirs = new Set<string>();\n const componentFiles: string[] = [];\n const serviceFiles: string[] = [];\n const utilityFiles: string[] = [];\n\n for (const file of sourceFiles) {\n const dir = file.split('/')[0];\n srcDirs.add(dir);\n\n // Categorize files\n if (file.includes('component') || file.includes('ui/')) {\n componentFiles.push(file);\n } else if (file.includes('service') || file.includes('api/')) {\n serviceFiles.push(file);\n } else if (file.includes('util') || file.includes('helper') || file.includes('lib/')) {\n utilityFiles.push(file);\n }\n }\n\n // Generate architecture overview if source has multiple modules\n if (srcDirs.size > 2 && !docExists('concepts/architecture/overview.md')) {\n tasks.push({\n directory: 'concepts/architecture',\n type: 'concept',\n agentType: 'analyst',\n prompt: buildArchitecturePrompt(context, Array.from(srcDirs)),\n outputFile: 'concepts/architecture/overview.md',\n });\n }\n\n // Generate component docs for detected UI frameworks\n if (frameworks.includes('React') || frameworks.includes('Vue')) {\n if (componentFiles.length > 0 && !docExists('components/ui/overview.md')) {\n tasks.push({\n directory: 'components/ui',\n type: 'component',\n agentType: 'coder',\n prompt: buildComponentPrompt(context, componentFiles.slice(0, 10)),\n outputFile: 'components/ui/overview.md',\n });\n }\n }\n\n // Generate service docs if API files detected\n if (serviceFiles.length > 0 && !docExists('services/api/overview.md')) {\n tasks.push({\n directory: 'services/api',\n type: 'service',\n agentType: 'coder',\n prompt: buildServicePrompt(context, serviceFiles.slice(0, 10)),\n outputFile: 'services/api/overview.md',\n });\n }\n\n // Generate utility docs\n if (utilityFiles.length > 0 && !docExists('components/utilities/overview.md')) {\n tasks.push({\n directory: 'components/utilities',\n type: 'component',\n agentType: 'coder',\n prompt: buildUtilityPrompt(context, utilityFiles.slice(0, 10)),\n outputFile: 'components/utilities/overview.md',\n });\n }\n\n // Generate getting started guide\n if (!docExists('guides/getting-started/quick-start.md')) {\n tasks.push({\n directory: 'guides/getting-started',\n type: 'guide',\n agentType: 'researcher',\n prompt: buildGettingStartedPrompt(context),\n outputFile: 'guides/getting-started/quick-start.md',\n });\n }\n\n // Generate standards/coding guide if tsconfig or eslint exists\n const hasLinting = existsSync(join(projectRoot, '.eslintrc.json')) ||\n existsSync(join(projectRoot, '.eslintrc.js')) ||\n existsSync(join(projectRoot, 'eslint.config.js'));\n const hasTypescript = existsSync(join(projectRoot, 'tsconfig.json'));\n\n if ((hasLinting || hasTypescript) && !docExists('standards/coding-standards/guide.md')) {\n tasks.push({\n directory: 'standards/coding-standards',\n type: 'standard',\n agentType: 'analyst',\n prompt: buildCodingStandardsPrompt(context, hasTypescript, hasLinting),\n outputFile: 'standards/coding-standards/guide.md',\n });\n }\n\n // Generate integration docs for detected databases/services\n if (frameworks.includes('Prisma') && !docExists('integrations/databases/prisma.md')) {\n tasks.push({\n directory: 'integrations/databases',\n type: 'integration',\n agentType: 'coder',\n prompt: buildPrismaPrompt(context),\n outputFile: 'integrations/databases/prisma.md',\n });\n }\n\n return tasks;\n}\n\n/**\n * Execute a single agent task\n */\nasync function executeAgentTask(\n task: AgentTask,\n context: GenerationContext,\n verbose?: boolean\n): Promise<GeneratedDoc> {\n const { docsPath } = context;\n const outputPath = join(docsPath, task.outputFile);\n\n // Try to use claude-flow if available, otherwise generate locally\n const hasClaudeFlow = await checkClaudeFlowAvailable();\n\n let content: string;\n\n if (hasClaudeFlow) {\n content = await executeWithClaudeFlow(task, context, verbose);\n } else {\n // Fallback to local template generation\n content = generateLocalTemplate(task, context);\n }\n\n // Write the file\n writeFileSync(outputPath, content, 'utf-8');\n\n return {\n path: task.outputFile,\n title: extractTitle(content) || basename(task.outputFile, '.md'),\n type: task.type,\n generated: true,\n };\n}\n\n/**\n * Check if claude-flow is available\n */\nasync function checkClaudeFlowAvailable(): Promise<boolean> {\n return new Promise((resolve) => {\n const proc = spawn('npx', ['claude-flow@alpha', '--version'], {\n stdio: 'pipe',\n shell: true,\n });\n\n proc.on('close', (code) => {\n resolve(code === 0);\n });\n\n proc.on('error', () => {\n resolve(false);\n });\n\n // Timeout after 5 seconds\n setTimeout(() => {\n proc.kill();\n resolve(false);\n }, 5000);\n });\n}\n\n/**\n * Execute task using claude-flow expert agents\n */\nasync function executeWithClaudeFlow(\n task: AgentTask,\n context: GenerationContext,\n verbose?: boolean\n): Promise<string> {\n return new Promise((resolve, reject) => {\n const agentCmd = `npx claude-flow@alpha sparc run ${task.agentType} \"${task.prompt.replace(/\"/g, '\\\\\"')}\"`;\n\n if (verbose) {\n console.log(`\\n Spawning ${task.agentType} agent for ${task.outputFile}...`);\n }\n\n const proc = spawn(agentCmd, {\n shell: true,\n cwd: context.projectRoot,\n stdio: verbose ? 'inherit' : 'pipe',\n });\n\n let output = '';\n\n if (proc.stdout) {\n proc.stdout.on('data', (data) => {\n output += data.toString();\n });\n }\n\n proc.on('close', (code) => {\n if (code === 0 && output) {\n resolve(output);\n } else {\n // Fallback to local generation\n resolve(generateLocalTemplate(task, context));\n }\n });\n\n proc.on('error', () => {\n resolve(generateLocalTemplate(task, context));\n });\n\n // Timeout after 60 seconds\n setTimeout(() => {\n proc.kill();\n resolve(generateLocalTemplate(task, context));\n }, 60000);\n });\n}\n\n/**\n * Generate document using local templates (fallback)\n */\nfunction generateLocalTemplate(task: AgentTask, context: GenerationContext): string {\n const date = new Date().toISOString().split('T')[0];\n const { projectName } = context;\n\n const templates: Record<string, string> = {\n 'concepts/architecture/overview.md': `---\ntitle: Architecture Overview\ntype: concept\nstatus: active\ntags: [architecture, overview]\ncreated: ${date}\n---\n\n# Architecture Overview\n\nHigh-level architecture documentation for ${projectName}.\n\n## System Overview\n\nThis document describes the overall architecture and design patterns used in ${projectName}.\n\n## Module Structure\n\n${context.sourceFiles.slice(0, 20).map(f => `- \\`${f}\\``).join('\\n')}\n\n## Key Patterns\n\n*Document key architectural patterns here*\n\n## Design Decisions\n\n*Add Architecture Decision Records (ADRs)*\n\n---\n> Auto-generated by kg-agent\n`,\n\n 'components/ui/overview.md': `---\ntitle: UI Components Overview\ntype: technical\nstatus: active\ntags: [components, ui]\ncreated: ${date}\n---\n\n# UI Components\n\nUser interface components for ${projectName}.\n\n## Component Library\n\n${context.frameworks.includes('React') ? 'Built with **React**.' : ''}\n${context.frameworks.includes('Vue') ? 'Built with **Vue**.' : ''}\n\n## Available Components\n\n*Document available UI components*\n\n## Usage Patterns\n\n*Add component usage examples*\n\n---\n> Auto-generated by kg-agent\n`,\n\n 'services/api/overview.md': `---\ntitle: API Services Overview\ntype: service\nstatus: active\ntags: [api, services]\ncreated: ${date}\n---\n\n# API Services\n\nBackend API services for ${projectName}.\n\n## Endpoints\n\n*Document API endpoints*\n\n## Authentication\n\n*Document authentication flow*\n\n## Error Handling\n\n*Document error handling patterns*\n\n---\n> Auto-generated by kg-agent\n`,\n\n 'components/utilities/overview.md': `---\ntitle: Utilities Overview\ntype: technical\nstatus: active\ntags: [utilities, helpers]\ncreated: ${date}\n---\n\n# Utility Functions\n\nReusable utilities and helpers for ${projectName}.\n\n## Available Utilities\n\n*Document available utilities*\n\n## Usage Examples\n\n*Add code examples*\n\n---\n> Auto-generated by kg-agent\n`,\n\n 'guides/getting-started/quick-start.md': `---\ntitle: Quick Start Guide\ntype: guide\nstatus: active\ntags: [guide, getting-started]\ncreated: ${date}\n---\n\n# Quick Start\n\nGet up and running with ${projectName}.\n\n## Prerequisites\n\n${context.languages.map(l => `- ${l}`).join('\\n')}\n\n## Installation\n\n\\`\\`\\`bash\nnpm install\n\\`\\`\\`\n\n## Basic Usage\n\n*Add basic usage instructions*\n\n## Next Steps\n\n- [[concepts/architecture/overview|Architecture Overview]]\n- [[guides/_MOC|More Guides]]\n\n---\n> Auto-generated by kg-agent\n`,\n\n 'standards/coding-standards/guide.md': `---\ntitle: Coding Standards\ntype: standard\nstatus: active\ntags: [standards, coding]\ncreated: ${date}\n---\n\n# Coding Standards\n\nCode style and conventions for ${projectName}.\n\n## Language Standards\n\n${context.languages.map(l => `### ${l}\\n\\n*Add ${l} specific standards*`).join('\\n\\n')}\n\n## Linting Configuration\n\n*Document ESLint/Prettier setup*\n\n## Best Practices\n\n*Add coding best practices*\n\n---\n> Auto-generated by kg-agent\n`,\n\n 'integrations/databases/prisma.md': `---\ntitle: Prisma Integration\ntype: integration\nstatus: active\ntags: [prisma, database, orm]\ncreated: ${date}\n---\n\n# Prisma Integration\n\nDatabase ORM configuration for ${projectName}.\n\n## Schema Location\n\n\\`prisma/schema.prisma\\`\n\n## Models\n\n*Document database models*\n\n## Migrations\n\n\\`\\`\\`bash\nnpx prisma migrate dev\n\\`\\`\\`\n\n## Client Usage\n\n*Add Prisma client usage examples*\n\n---\n> Auto-generated by kg-agent\n`,\n };\n\n return templates[task.outputFile] || generateGenericTemplate(task, context, date);\n}\n\n/**\n * Generate a generic template for unknown task types\n */\nfunction generateGenericTemplate(\n task: AgentTask,\n context: GenerationContext,\n date: string\n): string {\n const title = basename(task.outputFile, '.md')\n .split('-')\n .map(w => w.charAt(0).toUpperCase() + w.slice(1))\n .join(' ');\n\n return `---\ntitle: ${title}\ntype: ${task.type}\nstatus: draft\ntags: [${task.type}]\ncreated: ${date}\n---\n\n# ${title}\n\nDocumentation for ${context.projectName}.\n\n## Overview\n\n*Add overview content*\n\n## Details\n\n*Add detailed documentation*\n\n---\n> Auto-generated by kg-agent\n`;\n}\n\n/**\n * Extract title from markdown content\n */\nfunction extractTitle(content: string): string | null {\n const match = content.match(/^#\\s+(.+)$/m);\n return match ? match[1] : null;\n}\n\n// Prompt builders\n\nfunction buildArchitecturePrompt(context: GenerationContext, dirs: string[]): string {\n return `Analyze the architecture of ${context.projectName}.\nModules: ${dirs.join(', ')}.\nLanguages: ${context.languages.join(', ')}.\nGenerate an Architecture Overview markdown document with system design, patterns, and key decisions.`;\n}\n\nfunction buildComponentPrompt(context: GenerationContext, files: string[]): string {\n return `Document the UI components in ${context.projectName}.\nFrameworks: ${context.frameworks.join(', ')}.\nComponent files: ${files.join(', ')}.\nGenerate a Components Overview markdown document.`;\n}\n\nfunction buildServicePrompt(context: GenerationContext, files: string[]): string {\n return `Document the API services in ${context.projectName}.\nService files: ${files.join(', ')}.\nGenerate an API Services Overview markdown document with endpoints and patterns.`;\n}\n\nfunction buildUtilityPrompt(context: GenerationContext, files: string[]): string {\n return `Document utility functions in ${context.projectName}.\nUtility files: ${files.join(', ')}.\nGenerate a Utilities Overview markdown document.`;\n}\n\nfunction buildGettingStartedPrompt(context: GenerationContext): string {\n return `Create a Quick Start guide for ${context.projectName}.\nLanguages: ${context.languages.join(', ')}.\nFrameworks: ${context.frameworks.join(', ')}.\nGenerate a Getting Started guide with installation and basic usage.`;\n}\n\nfunction buildCodingStandardsPrompt(\n context: GenerationContext,\n hasTypescript: boolean,\n hasLinting: boolean\n): string {\n return `Document coding standards for ${context.projectName}.\nTypeScript: ${hasTypescript ? 'yes' : 'no'}.\nESLint: ${hasLinting ? 'yes' : 'no'}.\nGenerate a Coding Standards guide with style rules and best practices.`;\n}\n\nfunction buildPrismaPrompt(context: GenerationContext): string {\n return `Document Prisma database integration for ${context.projectName}.\nGenerate integration documentation with schema, models, and usage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AW,KAAK,IAAI,CAAC;AAAA;AAE3C;AAEA,SAAS,2BACP,SACA,eACA,YACQ;AACR,SAAO,iCAAiC,QAAQ,WAAW;AAAA,cAC/C,gBAAgB,QAAQ,IAAI;AAAA,UAChC,aAAa,QAAQ,IAAI;AAAA;AAEnC;AAEA,SAAS,kBAAkB,SAAoC;AAC7D,SAAO,4CAA4C,QAAQ,WAAW;AAAA;AAExE;"}
|
|
1
|
+
{"version":3,"file":"doc-generator-agents.js","sources":["../../src/generators/doc-generator-agents.ts"],"sourcesContent":["/**\n * Agent-Driven Document Generator\n *\n * Spawns expert agents from claude-flow to analyze existing code and\n * documentation, then generates appropriate documents for each directory.\n */\n\nimport { existsSync, readFileSync, writeFileSync, readdirSync, statSync } from 'fs';\nimport { join, basename, extname, relative } from 'path';\nimport fg from 'fast-glob';\nimport { spawn } from 'child_process';\n\n/**\n * Document generation context\n */\nexport interface GenerationContext {\n projectRoot: string;\n docsPath: string;\n projectName: string;\n languages: string[];\n frameworks: string[];\n existingDocs: string[];\n sourceFiles: string[];\n}\n\n/**\n * Generation result for a single document\n */\nexport interface GeneratedDoc {\n path: string;\n title: string;\n type: string;\n generated: boolean;\n error?: string;\n}\n\n/**\n * Overall generation result\n */\nexport interface AgentGenerationResult {\n success: boolean;\n documentsGenerated: GeneratedDoc[];\n agentsSpawned: number;\n errors: string[];\n}\n\n/**\n * Agent task definition\n */\ninterface AgentTask {\n directory: string;\n type: 'concept' | 'component' | 'service' | 'feature' | 'integration' | 'standard' | 'guide' | 'reference';\n agentType: 'researcher' | 'coder' | 'analyst';\n prompt: string;\n outputFile: string;\n}\n\n/**\n * Analyze project and generate documents using expert agents\n */\nexport async function generateDocsWithAgents(\n projectRoot: string,\n docsPath: string,\n options: {\n parallel?: boolean;\n dryRun?: boolean;\n verbose?: boolean;\n force?: boolean;\n } = {}\n): Promise<AgentGenerationResult> {\n const result: AgentGenerationResult = {\n success: true,\n documentsGenerated: [],\n agentsSpawned: 0,\n errors: [],\n };\n\n try {\n // Build context by analyzing the project\n const context = await buildGenerationContext(projectRoot, docsPath);\n\n // Determine what documents should be generated\n const tasks = await planDocumentGeneration(context, options.force);\n\n if (options.dryRun) {\n console.log('\\n[Dry Run] Would generate the following documents:');\n for (const task of tasks) {\n console.log(` - ${task.outputFile} (${task.agentType} agent)`);\n }\n return result;\n }\n\n // Execute tasks (parallel or sequential)\n if (options.parallel) {\n const results = await Promise.allSettled(\n tasks.map(task => executeAgentTask(task, context, options.verbose))\n );\n\n for (let i = 0; i < results.length; i++) {\n const r = results[i];\n result.agentsSpawned++;\n\n if (r.status === 'fulfilled') {\n result.documentsGenerated.push(r.value);\n } else {\n result.errors.push(`Failed: ${tasks[i].outputFile} - ${r.reason}`);\n result.documentsGenerated.push({\n path: tasks[i].outputFile,\n title: basename(tasks[i].outputFile, '.md'),\n type: tasks[i].type,\n generated: false,\n error: String(r.reason),\n });\n }\n }\n } else {\n // Sequential execution\n for (const task of tasks) {\n result.agentsSpawned++;\n\n try {\n const doc = await executeAgentTask(task, context, options.verbose);\n result.documentsGenerated.push(doc);\n } catch (error) {\n result.errors.push(`Failed: ${task.outputFile} - ${error}`);\n result.documentsGenerated.push({\n path: task.outputFile,\n title: basename(task.outputFile, '.md'),\n type: task.type,\n generated: false,\n error: String(error),\n });\n }\n }\n }\n\n result.success = result.errors.length === 0;\n } catch (error) {\n result.success = false;\n result.errors.push(`Generation failed: ${error}`);\n }\n\n return result;\n}\n\n/**\n * Build context by analyzing the project\n */\nasync function buildGenerationContext(\n projectRoot: string,\n docsPath: string\n): Promise<GenerationContext> {\n const context: GenerationContext = {\n projectRoot,\n docsPath,\n projectName: basename(projectRoot),\n languages: [],\n frameworks: [],\n existingDocs: [],\n sourceFiles: [],\n };\n\n // Get project name from package.json\n const pkgPath = join(projectRoot, 'package.json');\n if (existsSync(pkgPath)) {\n try {\n const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));\n context.projectName = pkg.name?.replace(/^@[^/]+\\//, '') || context.projectName;\n\n // Detect frameworks from dependencies\n const deps = { ...pkg.dependencies, ...pkg.devDependencies };\n if (deps.react) context.frameworks.push('React');\n if (deps.next) context.frameworks.push('Next.js');\n if (deps.vue) context.frameworks.push('Vue');\n if (deps.express) context.frameworks.push('Express');\n if (deps.fastify) context.frameworks.push('Fastify');\n if (deps['@prisma/client'] || deps.prisma) context.frameworks.push('Prisma');\n } catch {\n // Ignore parse errors\n }\n }\n\n // Detect languages\n if (existsSync(join(projectRoot, 'tsconfig.json'))) {\n context.languages.push('TypeScript');\n }\n if (existsSync(join(projectRoot, 'package.json'))) {\n context.languages.push('JavaScript');\n }\n\n // Detect Python - check multiple locations for requirements\n const pythonConfigPaths = [\n join(projectRoot, 'requirements.txt'),\n join(projectRoot, 'pyproject.toml'),\n join(projectRoot, 'src/backend/requirements.txt'),\n join(projectRoot, 'backend/requirements.txt'),\n join(projectRoot, 'src/requirements.txt'),\n ];\n const foundPythonConfig = pythonConfigPaths.find(p => existsSync(p));\n\n // Also detect Python if we find .py files later in source scan\n // For now, check if there's a Python config file\n if (foundPythonConfig) {\n context.languages.push('Python');\n\n // Detect Python frameworks from requirements.txt or pyproject.toml\n try {\n let reqContent = readFileSync(foundPythonConfig, 'utf-8').toLowerCase();\n // Also check pyproject.toml if we found requirements.txt\n if (foundPythonConfig.includes('requirements.txt')) {\n const pyprojectPath = join(projectRoot, 'pyproject.toml');\n if (existsSync(pyprojectPath)) {\n reqContent += readFileSync(pyprojectPath, 'utf-8').toLowerCase();\n }\n }\n if (reqContent.includes('fastapi')) context.frameworks.push('FastAPI');\n if (reqContent.includes('flask')) context.frameworks.push('Flask');\n if (reqContent.includes('django')) context.frameworks.push('Django');\n if (reqContent.includes('sqlalchemy')) context.frameworks.push('SQLAlchemy');\n if (reqContent.includes('pydantic')) context.frameworks.push('Pydantic');\n if (reqContent.includes('alembic')) context.frameworks.push('Alembic');\n } catch {\n // Ignore read errors\n }\n }\n if (existsSync(join(projectRoot, 'Cargo.toml'))) {\n context.languages.push('Rust');\n }\n if (existsSync(join(projectRoot, 'go.mod'))) {\n context.languages.push('Go');\n }\n\n // Find existing docs\n const existingDocs = await fg('**/*.md', {\n cwd: docsPath,\n ignore: ['node_modules/**', '.git/**', '_templates/**'],\n });\n context.existingDocs = existingDocs;\n\n // Find source files\n const sourceFiles = await fg('**/*.{ts,tsx,js,jsx,py,rs,go}', {\n cwd: projectRoot,\n ignore: ['node_modules/**', '.git/**', 'dist/**', 'build/**', docsPath + '/**'],\n dot: true,\n });\n context.sourceFiles = sourceFiles;\n\n // Detect Python from .py files if not already detected\n if (!context.languages.includes('Python') && sourceFiles.some(f => f.endsWith('.py'))) {\n context.languages.push('Python');\n }\n\n return context;\n}\n\n/**\n * Plan what documents should be generated based on context\n */\nasync function planDocumentGeneration(context: GenerationContext, force?: boolean): Promise<AgentTask[]> {\n const tasks: AgentTask[] = [];\n const { projectRoot, docsPath, sourceFiles, frameworks } = context;\n\n // Helper to check if doc already exists (returns false if force is true)\n const docExists = (relativePath: string) => {\n if (force) return false; // Force regeneration\n return existsSync(join(docsPath, relativePath));\n };\n\n // Analyze source structure to determine what docs to generate\n const srcDirs = new Set<string>();\n const componentFiles: string[] = [];\n const serviceFiles: string[] = [];\n const utilityFiles: string[] = [];\n const backendFiles: string[] = [];\n const modelFiles: string[] = [];\n const frontendFiles: string[] = [];\n\n for (const file of sourceFiles) {\n const dir = file.split('/')[0];\n srcDirs.add(dir);\n const fileLower = file.toLowerCase();\n\n // Categorize files (improved patterns for Python and TypeScript)\n if (fileLower.includes('component') || fileLower.includes('/ui/') || fileLower.includes('/views/')) {\n componentFiles.push(file);\n }\n if (fileLower.includes('service') || fileLower.includes('/api/') || fileLower.includes('routes') || fileLower.includes('endpoints')) {\n serviceFiles.push(file);\n }\n if (fileLower.includes('util') || fileLower.includes('helper') || fileLower.includes('/lib/') || fileLower.includes('common')) {\n utilityFiles.push(file);\n }\n if (fileLower.includes('backend') || fileLower.includes('server') || fileLower.includes('app/')) {\n backendFiles.push(file);\n }\n if (fileLower.includes('model') || fileLower.includes('schema') || fileLower.includes('entities')) {\n modelFiles.push(file);\n }\n if (fileLower.includes('frontend') || fileLower.includes('client') || fileLower.includes('pages')) {\n frontendFiles.push(file);\n }\n }\n\n // If no service files found but backend files exist, use backend files\n if (serviceFiles.length === 0 && backendFiles.length > 0) {\n serviceFiles.push(...backendFiles);\n }\n\n // Generate architecture overview if source has modules with files\n // Threshold: at least 1 directory with 3+ source files\n if (srcDirs.size >= 1 && sourceFiles.length >= 3 && !docExists('concepts/architecture/overview.md')) {\n tasks.push({\n directory: 'concepts/architecture',\n type: 'concept',\n agentType: 'analyst',\n prompt: buildArchitecturePrompt(context, Array.from(srcDirs)),\n outputFile: 'concepts/architecture/overview.md',\n });\n }\n\n // Generate component docs for detected UI frameworks\n if (frameworks.includes('React') || frameworks.includes('Vue')) {\n if (componentFiles.length > 0 && !docExists('components/ui/overview.md')) {\n tasks.push({\n directory: 'components/ui',\n type: 'component',\n agentType: 'coder',\n prompt: buildComponentPrompt(context, componentFiles.slice(0, 10)),\n outputFile: 'components/ui/overview.md',\n });\n }\n }\n\n // Generate service docs if API files detected\n if (serviceFiles.length > 0 && !docExists('services/api/overview.md')) {\n tasks.push({\n directory: 'services/api',\n type: 'service',\n agentType: 'coder',\n prompt: buildServicePrompt(context, serviceFiles.slice(0, 10)),\n outputFile: 'services/api/overview.md',\n });\n }\n\n // Generate utility docs\n if (utilityFiles.length > 0 && !docExists('components/utilities/overview.md')) {\n tasks.push({\n directory: 'components/utilities',\n type: 'component',\n agentType: 'coder',\n prompt: buildUtilityPrompt(context, utilityFiles.slice(0, 10)),\n outputFile: 'components/utilities/overview.md',\n });\n }\n\n // Generate getting started guide\n if (!docExists('guides/getting-started/quick-start.md')) {\n tasks.push({\n directory: 'guides/getting-started',\n type: 'guide',\n agentType: 'researcher',\n prompt: buildGettingStartedPrompt(context),\n outputFile: 'guides/getting-started/quick-start.md',\n });\n }\n\n // Generate standards/coding guide if tsconfig or eslint exists\n const hasLinting = existsSync(join(projectRoot, '.eslintrc.json')) ||\n existsSync(join(projectRoot, '.eslintrc.js')) ||\n existsSync(join(projectRoot, 'eslint.config.js'));\n const hasTypescript = existsSync(join(projectRoot, 'tsconfig.json'));\n\n if ((hasLinting || hasTypescript) && !docExists('standards/coding-standards/guide.md')) {\n tasks.push({\n directory: 'standards/coding-standards',\n type: 'standard',\n agentType: 'analyst',\n prompt: buildCodingStandardsPrompt(context, hasTypescript, hasLinting),\n outputFile: 'standards/coding-standards/guide.md',\n });\n }\n\n // Generate integration docs for detected databases/services\n if (frameworks.includes('Prisma') && !docExists('integrations/databases/prisma.md')) {\n tasks.push({\n directory: 'integrations/databases',\n type: 'integration',\n agentType: 'coder',\n prompt: buildPrismaPrompt(context),\n outputFile: 'integrations/databases/prisma.md',\n });\n }\n\n // Generate SQLAlchemy docs for Python projects\n if (frameworks.includes('SQLAlchemy') && !docExists('integrations/databases/sqlalchemy.md')) {\n tasks.push({\n directory: 'integrations/databases',\n type: 'integration',\n agentType: 'coder',\n prompt: buildSQLAlchemyPrompt(context, modelFiles),\n outputFile: 'integrations/databases/sqlalchemy.md',\n });\n }\n\n // Generate FastAPI docs\n if (frameworks.includes('FastAPI') && !docExists('services/api/fastapi.md')) {\n tasks.push({\n directory: 'services/api',\n type: 'service',\n agentType: 'coder',\n prompt: buildFastAPIPrompt(context, serviceFiles),\n outputFile: 'services/api/fastapi.md',\n });\n }\n\n // Generate Flask docs\n if (frameworks.includes('Flask') && !docExists('services/api/flask.md')) {\n tasks.push({\n directory: 'services/api',\n type: 'service',\n agentType: 'coder',\n prompt: buildFlaskPrompt(context, serviceFiles),\n outputFile: 'services/api/flask.md',\n });\n }\n\n return tasks;\n}\n\n/**\n * Execute a single agent task\n */\nasync function executeAgentTask(\n task: AgentTask,\n context: GenerationContext,\n verbose?: boolean\n): Promise<GeneratedDoc> {\n const { docsPath } = context;\n const outputPath = join(docsPath, task.outputFile);\n\n // Try to use claude-flow if available, otherwise generate locally\n const hasClaudeFlow = await checkClaudeFlowAvailable();\n\n let content: string;\n\n if (hasClaudeFlow) {\n content = await executeWithClaudeFlow(task, context, verbose);\n } else {\n // Fallback to local template generation\n content = generateLocalTemplate(task, context);\n }\n\n // Write the file\n writeFileSync(outputPath, content, 'utf-8');\n\n return {\n path: task.outputFile,\n title: extractTitle(content) || basename(task.outputFile, '.md'),\n type: task.type,\n generated: true,\n };\n}\n\n/**\n * Check if claude-flow is available\n */\nasync function checkClaudeFlowAvailable(): Promise<boolean> {\n return new Promise((resolve) => {\n const proc = spawn('npx', ['claude-flow@alpha', '--version'], {\n stdio: 'pipe',\n shell: true,\n });\n\n proc.on('close', (code) => {\n resolve(code === 0);\n });\n\n proc.on('error', () => {\n resolve(false);\n });\n\n // Timeout after 5 seconds\n setTimeout(() => {\n proc.kill();\n resolve(false);\n }, 5000);\n });\n}\n\n/**\n * Execute task using claude-flow expert agents\n */\nasync function executeWithClaudeFlow(\n task: AgentTask,\n context: GenerationContext,\n verbose?: boolean\n): Promise<string> {\n return new Promise((resolve, reject) => {\n const agentCmd = `npx claude-flow@alpha sparc run ${task.agentType} \"${task.prompt.replace(/\"/g, '\\\\\"')}\"`;\n\n if (verbose) {\n console.log(`\\n Spawning ${task.agentType} agent for ${task.outputFile}...`);\n }\n\n const proc = spawn(agentCmd, {\n shell: true,\n cwd: context.projectRoot,\n stdio: verbose ? 'inherit' : 'pipe',\n });\n\n let output = '';\n\n if (proc.stdout) {\n proc.stdout.on('data', (data) => {\n output += data.toString();\n });\n }\n\n proc.on('close', (code) => {\n if (code === 0 && output) {\n resolve(output);\n } else {\n // Fallback to local generation\n resolve(generateLocalTemplate(task, context));\n }\n });\n\n proc.on('error', () => {\n resolve(generateLocalTemplate(task, context));\n });\n\n // Timeout after 60 seconds\n setTimeout(() => {\n proc.kill();\n resolve(generateLocalTemplate(task, context));\n }, 60000);\n });\n}\n\n/**\n * Generate document using local templates (fallback)\n */\nfunction generateLocalTemplate(task: AgentTask, context: GenerationContext): string {\n const date = new Date().toISOString().split('T')[0];\n const { projectName } = context;\n\n const templates: Record<string, string> = {\n 'concepts/architecture/overview.md': `---\ntitle: Architecture Overview\ntype: concept\nstatus: active\ntags: [architecture, overview]\ncreated: ${date}\n---\n\n# Architecture Overview\n\nHigh-level architecture documentation for ${projectName}.\n\n## System Overview\n\nThis document describes the overall architecture and design patterns used in ${projectName}.\n\n## Module Structure\n\n${context.sourceFiles.slice(0, 20).map(f => `- \\`${f}\\``).join('\\n')}\n\n## Key Patterns\n\n*Document key architectural patterns here*\n\n## Design Decisions\n\n*Add Architecture Decision Records (ADRs)*\n\n---\n> Auto-generated by kg-agent\n`,\n\n 'components/ui/overview.md': `---\ntitle: UI Components Overview\ntype: technical\nstatus: active\ntags: [components, ui]\ncreated: ${date}\n---\n\n# UI Components\n\nUser interface components for ${projectName}.\n\n## Component Library\n\n${context.frameworks.includes('React') ? 'Built with **React**.' : ''}\n${context.frameworks.includes('Vue') ? 'Built with **Vue**.' : ''}\n\n## Available Components\n\n*Document available UI components*\n\n## Usage Patterns\n\n*Add component usage examples*\n\n---\n> Auto-generated by kg-agent\n`,\n\n 'services/api/overview.md': `---\ntitle: API Services Overview\ntype: service\nstatus: active\ntags: [api, services]\ncreated: ${date}\n---\n\n# API Services\n\nBackend API services for ${projectName}.\n\n## Endpoints\n\n*Document API endpoints*\n\n## Authentication\n\n*Document authentication flow*\n\n## Error Handling\n\n*Document error handling patterns*\n\n---\n> Auto-generated by kg-agent\n`,\n\n 'components/utilities/overview.md': `---\ntitle: Utilities Overview\ntype: technical\nstatus: active\ntags: [utilities, helpers]\ncreated: ${date}\n---\n\n# Utility Functions\n\nReusable utilities and helpers for ${projectName}.\n\n## Available Utilities\n\n*Document available utilities*\n\n## Usage Examples\n\n*Add code examples*\n\n---\n> Auto-generated by kg-agent\n`,\n\n 'guides/getting-started/quick-start.md': `---\ntitle: Quick Start Guide\ntype: guide\nstatus: active\ntags: [guide, getting-started]\ncreated: ${date}\n---\n\n# Quick Start\n\nGet up and running with ${projectName}.\n\n## Prerequisites\n\n${context.languages.map(l => `- ${l}`).join('\\n')}\n\n## Installation\n\n\\`\\`\\`bash\nnpm install\n\\`\\`\\`\n\n## Basic Usage\n\n*Add basic usage instructions*\n\n## Next Steps\n\n- [[concepts/architecture/overview|Architecture Overview]]\n- [[guides/_MOC|More Guides]]\n\n---\n> Auto-generated by kg-agent\n`,\n\n 'standards/coding-standards/guide.md': `---\ntitle: Coding Standards\ntype: standard\nstatus: active\ntags: [standards, coding]\ncreated: ${date}\n---\n\n# Coding Standards\n\nCode style and conventions for ${projectName}.\n\n## Language Standards\n\n${context.languages.map(l => `### ${l}\\n\\n*Add ${l} specific standards*`).join('\\n\\n')}\n\n## Linting Configuration\n\n*Document ESLint/Prettier setup*\n\n## Best Practices\n\n*Add coding best practices*\n\n---\n> Auto-generated by kg-agent\n`,\n\n 'integrations/databases/prisma.md': `---\ntitle: Prisma Integration\ntype: integration\nstatus: active\ntags: [prisma, database, orm]\ncreated: ${date}\n---\n\n# Prisma Integration\n\nDatabase ORM configuration for ${projectName}.\n\n## Schema Location\n\n\\`prisma/schema.prisma\\`\n\n## Models\n\n*Document database models*\n\n## Migrations\n\n\\`\\`\\`bash\nnpx prisma migrate dev\n\\`\\`\\`\n\n## Client Usage\n\n*Add Prisma client usage examples*\n\n---\n> Auto-generated by kg-agent\n`,\n\n 'integrations/databases/sqlalchemy.md': `---\ntitle: SQLAlchemy Integration\ntype: integration\nstatus: active\ntags: [sqlalchemy, database, orm, python]\ncreated: ${date}\n---\n\n# SQLAlchemy Integration\n\nDatabase ORM configuration for ${projectName}.\n\n## Models\n\n*Document your SQLAlchemy models*\n\n## Database Connection\n\n\\`\\`\\`python\nfrom sqlalchemy import create_engine\nfrom sqlalchemy.orm import sessionmaker\n\nengine = create_engine(DATABASE_URL)\nSession = sessionmaker(bind=engine)\n\\`\\`\\`\n\n## Migrations (Alembic)\n\n\\`\\`\\`bash\nalembic upgrade head\n\\`\\`\\`\n\n## Query Examples\n\n*Add common query patterns*\n\n---\n> Auto-generated by kg-agent\n`,\n\n 'services/api/fastapi.md': `---\ntitle: FastAPI Service\ntype: service\nstatus: active\ntags: [fastapi, api, python]\ncreated: ${date}\n---\n\n# FastAPI Service\n\nAPI service documentation for ${projectName}.\n\n## Running the Server\n\n\\`\\`\\`bash\nuvicorn main:app --reload\n\\`\\`\\`\n\n## API Endpoints\n\n*Document your API endpoints*\n\n## Authentication\n\n*Document authentication flow*\n\n## Request/Response Schemas\n\n*Document Pydantic models*\n\n---\n> Auto-generated by kg-agent\n`,\n\n 'services/api/flask.md': `---\ntitle: Flask Service\ntype: service\nstatus: active\ntags: [flask, api, python]\ncreated: ${date}\n---\n\n# Flask Service\n\nAPI service documentation for ${projectName}.\n\n## Running the Server\n\n\\`\\`\\`bash\nflask run\n\\`\\`\\`\n\n## Routes\n\n*Document your Flask routes*\n\n## Blueprints\n\n*Document blueprints structure*\n\n## Error Handling\n\n*Document error handling patterns*\n\n---\n> Auto-generated by kg-agent\n`,\n };\n\n return templates[task.outputFile] || generateGenericTemplate(task, context, date);\n}\n\n/**\n * Generate a generic template for unknown task types\n */\nfunction generateGenericTemplate(\n task: AgentTask,\n context: GenerationContext,\n date: string\n): string {\n const title = basename(task.outputFile, '.md')\n .split('-')\n .map(w => w.charAt(0).toUpperCase() + w.slice(1))\n .join(' ');\n\n return `---\ntitle: ${title}\ntype: ${task.type}\nstatus: draft\ntags: [${task.type}]\ncreated: ${date}\n---\n\n# ${title}\n\nDocumentation for ${context.projectName}.\n\n## Overview\n\n*Add overview content*\n\n## Details\n\n*Add detailed documentation*\n\n---\n> Auto-generated by kg-agent\n`;\n}\n\n/**\n * Extract title from markdown content\n */\nfunction extractTitle(content: string): string | null {\n const match = content.match(/^#\\s+(.+)$/m);\n return match ? match[1] : null;\n}\n\n// Prompt builders\n\nfunction buildArchitecturePrompt(context: GenerationContext, dirs: string[]): string {\n return `Analyze the architecture of ${context.projectName}.\nModules: ${dirs.join(', ')}.\nLanguages: ${context.languages.join(', ')}.\nGenerate an Architecture Overview markdown document with system design, patterns, and key decisions.`;\n}\n\nfunction buildComponentPrompt(context: GenerationContext, files: string[]): string {\n return `Document the UI components in ${context.projectName}.\nFrameworks: ${context.frameworks.join(', ')}.\nComponent files: ${files.join(', ')}.\nGenerate a Components Overview markdown document.`;\n}\n\nfunction buildServicePrompt(context: GenerationContext, files: string[]): string {\n return `Document the API services in ${context.projectName}.\nService files: ${files.join(', ')}.\nGenerate an API Services Overview markdown document with endpoints and patterns.`;\n}\n\nfunction buildUtilityPrompt(context: GenerationContext, files: string[]): string {\n return `Document utility functions in ${context.projectName}.\nUtility files: ${files.join(', ')}.\nGenerate a Utilities Overview markdown document.`;\n}\n\nfunction buildGettingStartedPrompt(context: GenerationContext): string {\n return `Create a Quick Start guide for ${context.projectName}.\nLanguages: ${context.languages.join(', ')}.\nFrameworks: ${context.frameworks.join(', ')}.\nGenerate a Getting Started guide with installation and basic usage.`;\n}\n\nfunction buildCodingStandardsPrompt(\n context: GenerationContext,\n hasTypescript: boolean,\n hasLinting: boolean\n): string {\n return `Document coding standards for ${context.projectName}.\nTypeScript: ${hasTypescript ? 'yes' : 'no'}.\nESLint: ${hasLinting ? 'yes' : 'no'}.\nGenerate a Coding Standards guide with style rules and best practices.`;\n}\n\nfunction buildPrismaPrompt(context: GenerationContext): string {\n return `Document Prisma database integration for ${context.projectName}.\nGenerate integration documentation with schema, models, and usage patterns.`;\n}\n\nfunction buildSQLAlchemyPrompt(context: GenerationContext, modelFiles: string[]): string {\n return `Document SQLAlchemy database integration for ${context.projectName}.\nModel files: ${modelFiles.slice(0, 10).join(', ')}.\nGenerate integration documentation with models, relationships, and query patterns.`;\n}\n\nfunction buildFastAPIPrompt(context: GenerationContext, serviceFiles: string[]): string {\n return `Document FastAPI API service for ${context.projectName}.\nAPI files: ${serviceFiles.slice(0, 10).join(', ')}.\nGenerate API documentation with endpoints, request/response schemas, and authentication.`;\n}\n\nfunction buildFlaskPrompt(context: GenerationContext, serviceFiles: string[]): string {\n return `Document Flask API service for ${context.projectName}.\nRoute files: ${serviceFiles.slice(0, 10).join(', ')}.\nGenerate API documentation with routes, blueprints, and request handling.`;\n}\n"],"names":[],"mappings":";;;;AA4DA,eAAsB,uBACpB,aACA,UACA,UAKI,CAAA,GAC4B;AAChC,QAAM,SAAgC;AAAA,IACpC,SAAS;AAAA,IACT,oBAAoB,CAAA;AAAA,IACpB,eAAe;AAAA,IACf,QAAQ,CAAA;AAAA,EAAC;AAGX,MAAI;AAEF,UAAM,UAAU,MAAM,uBAAuB,aAAa,QAAQ;AAGlE,UAAM,QAAQ,MAAM,uBAAuB,SAAS,QAAQ,KAAK;AAEjE,QAAI,QAAQ,QAAQ;AAClB,cAAQ,IAAI,qDAAqD;AACjE,iBAAW,QAAQ,OAAO;AACxB,gBAAQ,IAAI,OAAO,KAAK,UAAU,KAAK,KAAK,SAAS,SAAS;AAAA,MAChE;AACA,aAAO;AAAA,IACT;AAGA,QAAI,QAAQ,UAAU;AACpB,YAAM,UAAU,MAAM,QAAQ;AAAA,QAC5B,MAAM,IAAI,CAAA,SAAQ,iBAAiB,MAAM,SAAS,QAAQ,OAAO,CAAC;AAAA,MAAA;AAGpE,eAAS,IAAI,GAAG,IAAI,QAAQ,QAAQ,KAAK;AACvC,cAAM,IAAI,QAAQ,CAAC;AACnB,eAAO;AAEP,YAAI,EAAE,WAAW,aAAa;AAC5B,iBAAO,mBAAmB,KAAK,EAAE,KAAK;AAAA,QACxC,OAAO;AACL,iBAAO,OAAO,KAAK,WAAW,MAAM,CAAC,EAAE,UAAU,MAAM,EAAE,MAAM,EAAE;AACjE,iBAAO,mBAAmB,KAAK;AAAA,YAC7B,MAAM,MAAM,CAAC,EAAE;AAAA,YACf,OAAO,SAAS,MAAM,CAAC,EAAE,YAAY,KAAK;AAAA,YAC1C,MAAM,MAAM,CAAC,EAAE;AAAA,YACf,WAAW;AAAA,YACX,OAAO,OAAO,EAAE,MAAM;AAAA,UAAA,CACvB;AAAA,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K,IAAI,CAAC;AAAA;AAEjD;AAEA,SAAS,iBAAiB,SAA4B,cAAgC;AACpF,SAAO,kCAAkC,QAAQ,WAAW;AAAA,eAC/C,aAAa,MAAM,GAAG,EAAE,EAAE,KAAK,IAAI,CAAC;AAAA;AAEnD;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __exports as dist } from "../../../../_virtual/
|
|
1
|
+
import { __exports as dist } from "../../../../_virtual/index6.js";
|
|
2
2
|
import { __require as requireAstSpec } from "./generated/ast-spec.js";
|
|
3
3
|
import { __require as requireLib } from "./lib.js";
|
|
4
4
|
import { __require as requireParserOptions } from "./parser-options.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __exports as dist } from "../../../../_virtual/
|
|
1
|
+
import { __exports as dist } from "../../../../_virtual/index5.js";
|
|
2
2
|
import { __require as requireGetKeys } from "./get-keys.js";
|
|
3
3
|
import { __require as requireVisitorKeys } from "./visitor-keys.js";
|
|
4
4
|
var hasRequiredDist;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@weavelogic/knowledge-graph-agent",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.7",
|
|
4
4
|
"description": "Knowledge graph agent for Claude Code - generates knowledge graphs, initializes docs, and integrates with claude-flow",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|