aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/ipc
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/ipc')
-rw-r--r--src/main/ipc/handlers.ts34
1 files changed, 8 insertions, 26 deletions
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 {
26 ipcMain.handle("sessions:delete", (_, id: string) => { 26 ipcMain.handle("sessions:delete", (_, id: string) => {
27 const session = sessions.getSession(id); 27 const session = sessions.getSession(id);
28 if (session) { 28 if (session) {
29 const project = projects.getProject(session.project_id); 29 // Clean up session artifacts from global storage
30 if (project) { 30 claude.clearSessionArtifacts(session.project_id, id);
31 // Clean up session artifacts
32 claude.clearSessionArtifacts(project.path, id);
33 }
34 } 31 }
35 sessions.deleteSession(id); 32 sessions.deleteSession(id);
36 }); 33 });
@@ -103,22 +100,22 @@ export function registerIpcHandlers(mainWindow: BrowserWindow): void {
103 } 100 }
104 ); 101 );
105 102
106 // Session Artifacts (new session-specific API) 103 // Session Artifacts (stored in ~/.claude-flow/)
107 ipcMain.handle( 104 ipcMain.handle(
108 "artifact:readSession", 105 "artifact:readSession",
109 (_, projectPath: string, sessionId: string, filename: string) => { 106 (_, projectId: string, sessionId: string, filename: string) => {
110 return claude.readSessionArtifact(projectPath, sessionId, filename); 107 return claude.readSessionArtifact(projectId, sessionId, filename);
111 } 108 }
112 ); 109 );
113 110
114 ipcMain.handle( 111 ipcMain.handle(
115 "artifact:writeSession", 112 "artifact:writeSession",
116 (_, projectPath: string, sessionId: string, filename: string, content: string) => { 113 (_, projectId: string, sessionId: string, filename: string, content: string) => {
117 claude.writeSessionArtifact(projectPath, sessionId, filename, content); 114 claude.writeSessionArtifact(projectId, sessionId, filename, content);
118 } 115 }
119 ); 116 );
120 117
121 // CLAUDE.md 118 // CLAUDE.md (stored in project)
122 ipcMain.handle("claudemd:read", (_, projectPath: string) => { 119 ipcMain.handle("claudemd:read", (_, projectPath: string) => {
123 return claude.readClaudeMd(projectPath); 120 return claude.readClaudeMd(projectPath);
124 }); 121 });
@@ -127,21 +124,6 @@ export function registerIpcHandlers(mainWindow: BrowserWindow): void {
127 claude.writeClaudeMd(projectPath, content); 124 claude.writeClaudeMd(projectPath, content);
128 }); 125 });
129 126
130 // Legacy artifact API (for backward compatibility)
131 ipcMain.handle(
132 "artifact:read",
133 (_, projectPath: string, filename: string) => {
134 return claude.readArtifact(projectPath, filename);
135 }
136 );
137
138 ipcMain.handle(
139 "artifact:write",
140 (_, projectPath: string, filename: string, content: string) => {
141 claude.writeArtifact(projectPath, filename, content);
142 }
143 );
144
145 // Dialogs 127 // Dialogs
146 ipcMain.handle("dialog:selectDirectory", async () => { 128 ipcMain.handle("dialog:selectDirectory", async () => {
147 const result = await dialog.showOpenDialog(mainWindow, { 129 const result = await dialog.showOpenDialog(mainWindow, {