feat: Implement DeepWiki generator and CLI integration

- Added `deepwiki_generator.py` for generating documentation from source code.
- Integrated symbol extraction and markdown generation for supported file types.
- Implemented database migration for legacy timestamp formats in DeepWikiStore.
- Enhanced debug logging for better traceability during conversation and store operations.
- Updated dependencies in `PKG-INFO` and `requires.txt` for compatibility.
- Added new tests for the DeepWiki generator and storage functionalities.
- Refactored existing code for improved readability and maintainability.
This commit is contained in:
catlog22
2026-03-07 17:05:49 +08:00
parent 75d5f7f230
commit ece4afcac8
17 changed files with 816 additions and 25221 deletions

View File

@@ -18,6 +18,7 @@ import {
deleteExecutionAsync,
batchDeleteExecutionsAsync,
executeCliTool,
generateExecutionId,
getNativeSessionContent,
getFormattedNativeConversation,
getEnrichedConversation,
@@ -940,7 +941,7 @@ export async function handleCliRoutes(ctx: RouteContext): Promise<boolean> {
}
}
const executionId = `${Date.now()}-${tool}`;
const executionId = generateExecutionId(tool);
// Store active execution for state recovery
// Check map size limit before creating new execution

View File

@@ -11,13 +11,22 @@
import type { RouteContext } from './types.js';
import { getDeepWikiService } from '../../services/deepwiki-service.js';
import { handleDeepWikiRoutes as handleDeepWikiPostRoutes } from '../../services/deepwiki-service.js';
/**
* Handle DeepWiki routes
* @returns true if route was handled, false otherwise
*/
export async function handleDeepWikiRoutes(ctx: RouteContext): Promise<boolean> {
const { pathname, url, res } = ctx;
const { pathname, url, res, req } = ctx;
// POST endpoints implemented in the DeepWiki service module.
if (
(pathname === '/api/deepwiki/symbols-for-paths' || pathname === '/api/deepwiki/stale-files') &&
req.method === 'POST'
) {
return handleDeepWikiPostRoutes({ pathname, req, res });
}
// GET /api/deepwiki/files - List all documented files
if (pathname === '/api/deepwiki/files') {

View File

@@ -17,6 +17,7 @@ import { getLaunchConfig } from './cli-launch-registry.js';
import { assembleInstruction, type InstructionType } from './cli-instruction-assembler.js';
import { loadEndpointSettings } from '../../config/cli-settings-manager.js';
import { getToolConfig } from '../../tools/claude-cli-tools.js';
import { generateExecutionId } from '../../tools/cli-executor.js';
export interface CliSession {
sessionKey: string;
@@ -532,7 +533,7 @@ export class CliSessionManager {
const executionId = resumeKey
? `${resumeKey}-${Date.now()}`
: `exec-${Date.now()}-${randomBytes(3).toString('hex')}`;
: generateExecutionId(options.tool);
let command: string;