mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-11 02:33:51 +08:00
feat(storage): implement storage manager for centralized management and cleanup
- Added a new Storage Manager component to handle storage statistics, project cleanup, and configuration for CCW centralized storage. - Introduced functions to calculate directory sizes, get project storage stats, and clean specific or all storage. - Enhanced SQLiteStore with a public API for executing queries securely. - Updated tests to utilize the new execute_query method and validate storage management functionalities. - Improved performance by implementing connection pooling with idle timeout management in SQLiteStore. - Added new fields (token_count, symbol_type) to the symbols table and adjusted related insertions. - Enhanced error handling and logging for storage operations.
This commit is contained in:
@@ -110,12 +110,35 @@ export function getProjectPaths(projectPath: string): ProjectPaths {
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Get storage paths for a project by its ID (hash)
|
||||
* Use when iterating centralized storage without original project path
|
||||
* @param projectId - 16-character project ID hash
|
||||
* @returns Object with all project-specific paths
|
||||
*/
|
||||
export function getProjectPathsById(projectId: string): ProjectPaths {
|
||||
const projectDir = join(CCW_HOME, 'projects', projectId);
|
||||
|
||||
return {
|
||||
root: projectDir,
|
||||
cliHistory: join(projectDir, 'cli-history'),
|
||||
historyDb: join(projectDir, 'cli-history', 'history.db'),
|
||||
memory: join(projectDir, 'memory'),
|
||||
memoryDb: join(projectDir, 'memory', 'memory.db'),
|
||||
cache: join(projectDir, 'cache'),
|
||||
dashboardCache: join(projectDir, 'cache', 'dashboard-data.json'),
|
||||
config: join(projectDir, 'config'),
|
||||
cliConfig: join(projectDir, 'config', 'cli-config.json'),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Unified StoragePaths object combining global and project paths
|
||||
*/
|
||||
export const StoragePaths = {
|
||||
global: GlobalPaths,
|
||||
project: getProjectPaths,
|
||||
projectById: getProjectPathsById,
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user