From 3ac34530578b9a6f59bcea6b5aeefd97eb03d588 Mon Sep 17 00:00:00 2001 From: Clawd Date: Sat, 28 Feb 2026 18:46:11 -0800 Subject: Move artifacts to ~/.claude-flow/ (outside repo) - Store session artifacts in ~/.claude-flow/projects/{projectId}/sessions/{sessionId}/ - Artifacts no longer live in project directory - can't be accidentally committed - Remove .claude-flow/ from .gitignore (not needed anymore) - Update all IPC handlers and renderer to use projectId instead of projectPath - Update prompts to remove worktree references - Update README with new storage location --- src/main/ipc/handlers.ts | 34 ++++++++-------------------------- 1 file changed, 8 insertions(+), 26 deletions(-) (limited to 'src/main/ipc') diff --git a/src/main/ipc/handlers.ts b/src/main/ipc/handlers.ts index 2d5e3d3..d9beaf0 100644 --- a/src/main/ipc/handlers.ts +++ b/src/main/ipc/handlers.ts @@ -26,11 +26,8 @@ export function registerIpcHandlers(mainWindow: BrowserWindow): void { ipcMain.handle("sessions:delete", (_, id: string) => { const session = sessions.getSession(id); if (session) { - const project = projects.getProject(session.project_id); - if (project) { - // Clean up session artifacts - claude.clearSessionArtifacts(project.path, id); - } + // Clean up session artifacts from global storage + claude.clearSessionArtifacts(session.project_id, id); } sessions.deleteSession(id); }); @@ -103,22 +100,22 @@ export function registerIpcHandlers(mainWindow: BrowserWindow): void { } ); - // Session Artifacts (new session-specific API) + // Session Artifacts (stored in ~/.claude-flow/) ipcMain.handle( "artifact:readSession", - (_, projectPath: string, sessionId: string, filename: string) => { - return claude.readSessionArtifact(projectPath, sessionId, filename); + (_, projectId: string, sessionId: string, filename: string) => { + return claude.readSessionArtifact(projectId, sessionId, filename); } ); ipcMain.handle( "artifact:writeSession", - (_, projectPath: string, sessionId: string, filename: string, content: string) => { - claude.writeSessionArtifact(projectPath, sessionId, filename, content); + (_, projectId: string, sessionId: string, filename: string, content: string) => { + claude.writeSessionArtifact(projectId, sessionId, filename, content); } ); - // CLAUDE.md + // CLAUDE.md (stored in project) ipcMain.handle("claudemd:read", (_, projectPath: string) => { return claude.readClaudeMd(projectPath); }); @@ -127,21 +124,6 @@ export function registerIpcHandlers(mainWindow: BrowserWindow): void { claude.writeClaudeMd(projectPath, content); }); - // Legacy artifact API (for backward compatibility) - ipcMain.handle( - "artifact:read", - (_, projectPath: string, filename: string) => { - return claude.readArtifact(projectPath, filename); - } - ); - - ipcMain.handle( - "artifact:write", - (_, projectPath: string, filename: string, content: string) => { - claude.writeArtifact(projectPath, filename, content); - } - ); - // Dialogs ipcMain.handle("dialog:selectDirectory", async () => { const result = await dialog.showOpenDialog(mainWindow, { -- cgit v1.2.3