diff options
Diffstat (limited to 'src/main/preload.ts')
| -rw-r--r-- | src/main/preload.ts | 37 |
1 files changed, 10 insertions, 27 deletions
diff --git a/src/main/preload.ts b/src/main/preload.ts index 7c1d634..2c228dd 100644 --- a/src/main/preload.ts +++ b/src/main/preload.ts | |||
| @@ -31,34 +31,23 @@ export interface ClaudeFlowAPI { | |||
| 31 | mode: UserPermissionMode | 31 | mode: UserPermissionMode |
| 32 | ) => Promise<void>; | 32 | ) => Promise<void>; |
| 33 | 33 | ||
| 34 | // Session Artifacts (session-specific) | 34 | // Session Artifacts (stored in ~/.claude-flow/) |
| 35 | readSessionArtifact: ( | 35 | readSessionArtifact: ( |
| 36 | projectPath: string, | 36 | projectId: string, |
| 37 | sessionId: string, | 37 | sessionId: string, |
| 38 | filename: string | 38 | filename: string |
| 39 | ) => Promise<string | null>; | 39 | ) => Promise<string | null>; |
| 40 | writeSessionArtifact: ( | 40 | writeSessionArtifact: ( |
| 41 | projectPath: string, | 41 | projectId: string, |
| 42 | sessionId: string, | 42 | sessionId: string, |
| 43 | filename: string, | 43 | filename: string, |
| 44 | content: string | 44 | content: string |
| 45 | ) => Promise<void>; | 45 | ) => Promise<void>; |
| 46 | 46 | ||
| 47 | // CLAUDE.md | 47 | // CLAUDE.md (stored in project) |
| 48 | readClaudeMd: (projectPath: string) => Promise<string | null>; | 48 | readClaudeMd: (projectPath: string) => Promise<string | null>; |
| 49 | writeClaudeMd: (projectPath: string, content: string) => Promise<void>; | 49 | writeClaudeMd: (projectPath: string, content: string) => Promise<void>; |
| 50 | 50 | ||
| 51 | // Legacy Artifacts (backward compat) | ||
| 52 | readArtifact: ( | ||
| 53 | projectPath: string, | ||
| 54 | filename: string | ||
| 55 | ) => Promise<string | null>; | ||
| 56 | writeArtifact: ( | ||
| 57 | projectPath: string, | ||
| 58 | filename: string, | ||
| 59 | content: string | ||
| 60 | ) => Promise<void>; | ||
| 61 | |||
| 62 | // Events | 51 | // Events |
| 63 | onClaudeMessage: ( | 52 | onClaudeMessage: ( |
| 64 | callback: (sessionId: string, message: SDKMessage) => void | 53 | callback: (sessionId: string, message: SDKMessage) => void |
| @@ -97,23 +86,17 @@ const api: ClaudeFlowAPI = { | |||
| 97 | setPermissionMode: (sessionId, mode) => | 86 | setPermissionMode: (sessionId, mode) => |
| 98 | ipcRenderer.invoke("workflow:setPermissionMode", sessionId, mode), | 87 | ipcRenderer.invoke("workflow:setPermissionMode", sessionId, mode), |
| 99 | 88 | ||
| 100 | // Session Artifacts | 89 | // Session Artifacts (stored in ~/.claude-flow/) |
| 101 | readSessionArtifact: (projectPath, sessionId, filename) => | 90 | readSessionArtifact: (projectId, sessionId, filename) => |
| 102 | ipcRenderer.invoke("artifact:readSession", projectPath, sessionId, filename), | 91 | ipcRenderer.invoke("artifact:readSession", projectId, sessionId, filename), |
| 103 | writeSessionArtifact: (projectPath, sessionId, filename, content) => | 92 | writeSessionArtifact: (projectId, sessionId, filename, content) => |
| 104 | ipcRenderer.invoke("artifact:writeSession", projectPath, sessionId, filename, content), | 93 | ipcRenderer.invoke("artifact:writeSession", projectId, sessionId, filename, content), |
| 105 | 94 | ||
| 106 | // CLAUDE.md | 95 | // CLAUDE.md (stored in project) |
| 107 | readClaudeMd: (projectPath) => ipcRenderer.invoke("claudemd:read", projectPath), | 96 | readClaudeMd: (projectPath) => ipcRenderer.invoke("claudemd:read", projectPath), |
| 108 | writeClaudeMd: (projectPath, content) => | 97 | writeClaudeMd: (projectPath, content) => |
| 109 | ipcRenderer.invoke("claudemd:write", projectPath, content), | 98 | ipcRenderer.invoke("claudemd:write", projectPath, content), |
| 110 | 99 | ||
| 111 | // Legacy Artifacts | ||
| 112 | readArtifact: (projectPath, filename) => | ||
| 113 | ipcRenderer.invoke("artifact:read", projectPath, filename), | ||
| 114 | writeArtifact: (projectPath, filename, content) => | ||
| 115 | ipcRenderer.invoke("artifact:write", projectPath, filename, content), | ||
| 116 | |||
| 117 | // Events | 100 | // Events |
| 118 | onClaudeMessage: (callback) => { | 101 | onClaudeMessage: (callback) => { |
| 119 | const handler = ( | 102 | const handler = ( |
