From c9cd5119077c69088eb8ba768ee1e1602baec751 Mon Sep 17 00:00:00 2001 From: haoyuren <13851610112@163.com> Date: Thu, 30 Jul 2026 08:53:27 +0800 Subject: Add workspace file browser and OpenAlex citation search MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Workspace browser: - The left panel gains a Project/Workspace toggle; the Workspace view browses the agent scratch space (claude-workspace/, never synced) - Open/edit workspace text files in the editor with debounced auto-save (flushed on tab switch); binaries open with the system default app - Import to Project copies a workspace file/folder into the project root where the sync bridge picks it up and creates it on Overleaf (collision-safe: falls back to a -imported suffix) - New file/folder, rename, delete, reveal in Finder, drag-drop into the workspace, 5s auto-refresh while visible OpenAlex search (MCP): - New search_openalex tool: broad OpenAlex coverage with an explicit citation-authority policy — BibTeX is cross-checked against Semantic Scholar (by DOI, then by exact title, since OpenAlex DOIs can point at mirrors); entries not found on S2 are flagged "OpenAlex only" with instructions to verify via web search before citing - Tool description, agent guide, permission allowlist, and README updated Co-Authored-By: Claude Fable 5 --- src/preload/index.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/preload') diff --git a/src/preload/index.ts b/src/preload/index.ts index d3cddea..a4d8179 100644 --- a/src/preload/index.ts +++ b/src/preload/index.ts @@ -12,8 +12,20 @@ window.addEventListener('wheel', (e) => { const api = { // File system - readFile: (path: string) => ipcRenderer.invoke('fs:readFile', path), + readFile: (path: string) => ipcRenderer.invoke('fs:readFile', path) as Promise, readBinary: (path: string) => ipcRenderer.invoke('fs:readBinary', path) as Promise, + writeFile: (path: string, content: string) => ipcRenderer.invoke('fs:writeFile', path, content) as Promise, + listDirTree: (rootPath: string, pathPrefix: string) => + ipcRenderer.invoke('fs:listDirTree', rootPath, pathPrefix) as Promise + }>>, + mkdirp: (path: string) => ipcRenderer.invoke('fs:mkdirp', path) as Promise, + renamePath: (oldPath: string, newPath: string) => ipcRenderer.invoke('fs:rename', oldPath, newPath) as Promise, + deletePath: (path: string) => ipcRenderer.invoke('fs:deletePath', path) as Promise, + copyPath: (src: string, dest: string) => ipcRenderer.invoke('fs:copyPath', src, dest) as Promise, + pathExists: (path: string) => ipcRenderer.invoke('fs:exists', path) as Promise, + openPath: (path: string) => ipcRenderer.invoke('shell:openPath', path) as Promise, // LaTeX onCompileLog: (cb: (log: string) => void) => { -- cgit v1.2.3