Add project_archives table and MCP tools (CF-264)
- Created migration 009: project_archives table with semantic search - Implemented archives.ts: archiveAdd, archiveSearch, archiveList, archiveGet - Registered archive tools in index.ts and tools/index.ts - Archive types: session, research, audit, investigation, completed, migration - Uses project_key (TEXT) FK to projects table - Tested: archive_add and archive_list working correctly Replaces filesystem archives with database-backed storage. Eliminates context pollution from Glob/Grep operations. Task: CF-264 Session: session_20260119111342_66de546b Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
36
src/index.ts
36
src/index.ts
@@ -63,6 +63,7 @@ import {
|
||||
sessionProductivityAnalytics,
|
||||
sessionPatternDetection,
|
||||
} from './tools/session-docs.js';
|
||||
import { archiveAdd, archiveSearch, archiveList, archiveGet } from './tools/archives.js';
|
||||
|
||||
// Create MCP server
|
||||
const server = new Server(
|
||||
@@ -597,6 +598,41 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
||||
);
|
||||
break;
|
||||
|
||||
// Archives
|
||||
case 'archive_add':
|
||||
result = await archiveAdd({
|
||||
project: a.project,
|
||||
archive_type: a.archive_type,
|
||||
title: a.title,
|
||||
content: a.content,
|
||||
original_path: a.original_path,
|
||||
file_size: a.file_size,
|
||||
archived_by_session: a.archived_by_session,
|
||||
metadata: a.metadata,
|
||||
});
|
||||
break;
|
||||
case 'archive_search':
|
||||
result = await archiveSearch({
|
||||
query: a.query,
|
||||
project: a.project,
|
||||
archive_type: a.archive_type,
|
||||
limit: a.limit,
|
||||
});
|
||||
break;
|
||||
case 'archive_list':
|
||||
result = await archiveList({
|
||||
project: a.project,
|
||||
archive_type: a.archive_type,
|
||||
since: a.since,
|
||||
limit: a.limit,
|
||||
});
|
||||
break;
|
||||
case 'archive_get':
|
||||
result = await archiveGet({
|
||||
id: a.id,
|
||||
});
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new Error(`Unknown tool: ${name}`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user