feat(CF-524): Add project_archive MCP method

Implements complete project archival workflow:
- Migration 024: Add archival fields to projects table
- New project-archive.ts tool coordinating:
  * Tarball creation via shell
  * S3 upload with vault credentials
  * Database metadata tracking
  * Optional local deletion
  * Cleanup of temp files
- Registered in tool definitions and handlers

Replaces manual archival process used for Fireberries/CyprusPulse.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Christian Gick
2026-01-27 20:45:56 +02:00
parent a6d24ab86c
commit 3e20a8ea3c
4 changed files with 264 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
-- Migration 024: Add project archival tracking fields
-- Adds fields to track S3 archival of complete projects
ALTER TABLE projects
ADD COLUMN IF NOT EXISTS archived_at TIMESTAMP WITH TIME ZONE,
ADD COLUMN IF NOT EXISTS archive_location TEXT,
ADD COLUMN IF NOT EXISTS archive_size BIGINT,
ADD COLUMN IF NOT EXISTS archived_by_session TEXT;
CREATE INDEX IF NOT EXISTS idx_projects_archived ON projects(archived_at) WHERE archived_at IS NOT NULL;
COMMENT ON COLUMN projects.archived_at IS 'Timestamp when project was archived to S3';
COMMENT ON COLUMN projects.archive_location IS 'S3 path to archived tarball (e.g., s3://agiliton-archive/projects/Project-20260127.tar.gz)';
COMMENT ON COLUMN projects.archive_size IS 'Size of archive in bytes';
COMMENT ON COLUMN projects.archived_by_session IS 'Session ID that performed the archival';
-- Record migration
INSERT INTO schema_migrations (version, applied_at)
VALUES ('024_add_project_archival_fields', NOW())
ON CONFLICT DO NOTHING;