Refactor multi-CLI planning documentation, enhance analyze-with-file skill, and implement timeout for DeepWiki API requests

- Updated SKILL.md for workflow-multi-cli-plan to streamline sections, clarify processes, and improve user decision points.
- Enhanced analyze-with-file skill to include hypothesis impact in key findings and refined recording principles for better documentation.
- Added fetchWithTimeout function to DeepWiki API calls to handle request timeouts, ensuring more robust error handling.
- Introduced new DeepWiki routes in server.ts to manage API requests effectively.
- Updated tsconfig.tsbuildinfo to reflect recent changes in the codebase structure.
This commit is contained in:
catlog22
2026-03-06 15:54:40 +08:00
parent 88149b6154
commit f2d4364c69
8 changed files with 477 additions and 639 deletions

View File

@@ -578,6 +578,11 @@ export async function startServer(options: ServerOptions = {}): Promise<http.Ser
if (await handleMcpRoutes(routeContext)) return;
}
// DeepWiki routes (/api/deepwiki/*)
if (pathname.startsWith('/api/deepwiki')) {
if (await handleDeepWikiRoutes(routeContext)) return;
}
// Hooks routes (/api/hooks, /api/hook)
if (pathname.startsWith('/api/hook')) {
if (await handleHooksRoutes(routeContext)) return;

View File

@@ -250,6 +250,35 @@ export class DeepWikiService {
return [];
}
}
/**
* Get storage statistics
* @returns Statistics object with counts
*/
public getStats(): { files: number; symbols: number; docs: number; filesNeedingDocs: number; dbPath: string } {
const db = this.getConnection();
if (!db) {
return { files: 0, symbols: 0, docs: 0, filesNeedingDocs: 0, dbPath: this.dbPath };
}
try {
const files = db.prepare('SELECT COUNT(*) as count FROM deepwiki_files').get() as { count: number };
const symbols = db.prepare('SELECT COUNT(*) as count FROM deepwiki_symbols').get() as { count: number };
const docs = db.prepare('SELECT COUNT(*) as count FROM deepwiki_docs').get() as { count: number };
const filesNeedingDocs = db.prepare('SELECT COUNT(*) as count FROM deepwiki_files WHERE docs_generated = 0').get() as { count: number };
return {
files: files?.count || 0,
symbols: symbols?.count || 0,
docs: docs?.count || 0,
filesNeedingDocs: filesNeedingDocs?.count || 0,
dbPath: this.dbPath
};
} catch (error) {
console.error('[DeepWiki] Error getting stats:', error);
return { files: 0, symbols: 0, docs: 0, filesNeedingDocs: 0, dbPath: this.dbPath };
}
}
}
// Singleton instance