Skip to content

Node-based terminal manager for AI coding agents — tmux-backed terminals and parallel agent sessions as draggable nodes on an infinite pan/zoom canvas. macOS, Linux, and a browser Server Edition.

feat(git-history): preload git-history APIs + shell.openExternal

enes2b4908c44bc1
diff --git a/src/main/index.ts b/src/main/index.ts
index ef3bdae5d..878e51975 100644
--- a/src/main/index.ts
+++ b/src/main/index.ts
@@ -159,6 +159,10 @@ app.whenReady().then(async () => {
if (p) void shell.openPath(p)
})
+ ipcMain.on(IPC.shellOpenExternal, (_e, url: string) => {
+ if (typeof url === 'string' && /^https?:\/\//.test(url)) void shell.openExternal(url)
+ })
+
ipcMain.handle(IPC.fsList, async (_e, dirPath: string) => {
try {
const dirents = await fs.readdir(dirPath, { withFileTypes: true })
diff --git a/src/preload/index.ts b/src/preload/index.ts
index 5e9abe53f..995c29e79 100644
--- a/src/preload/index.ts
+++ b/src/preload/index.ts
@@ -63,14 +63,18 @@ const api: NodeTerminalApi = {
switchBranch: (cwd, name) => ipcRenderer.invoke(IPC.gitSwitchBranch, cwd, name),
createBranch: (cwd, name) => ipcRenderer.invoke(IPC.gitCreateBranch, cwd, name),
showFile: (cwd, ref, path) => ipcRenderer.invoke(IPC.gitShowFile, cwd, ref, path),
- generateMessage: (cwd) => ipcRenderer.invoke(IPC.commitGenerate, cwd)
+ generateMessage: (cwd) => ipcRenderer.invoke(IPC.commitGenerate, cwd),
+ history: (cwd, options) => ipcRenderer.invoke(IPC.gitHistory, cwd, options),
+ commitFiles: (cwd, oid) => ipcRenderer.invoke(IPC.gitCommitFiles, cwd, oid),
+ remoteCommitUrl: (cwd, sha) => ipcRenderer.invoke(IPC.gitRemoteCommitUrl, cwd, sha)
},
clipboard: {
writeText: (text: string) => clipboard.writeText(text)
},
shell: {
reveal: (path: string) => ipcRenderer.send(IPC.shellReveal, path),
- openPath: (path: string) => ipcRenderer.send(IPC.shellOpenPath, path)
+ openPath: (path: string) => ipcRenderer.send(IPC.shellOpenPath, path),
+ openExternal: (url: string) => ipcRenderer.send(IPC.shellOpenExternal, url)
},
fs: {
list: (dirPath: string) => ipcRenderer.invoke(IPC.fsList, dirPath),
diff --git a/src/shared/types.ts b/src/shared/types.ts
index 89b9a41a2..8c023f576 100644
--- a/src/shared/types.ts
+++ b/src/shared/types.ts
@@ -150,6 +150,8 @@ export interface ShellApi {
reveal(path: string): void
/** Open a path with the OS default application. */
openPath(path: string): void
+ /** Open an http(s) URL in the OS default browser. */
+ openExternal(url: string): void
}
export interface DirEntry {
@@ -302,6 +304,15 @@ export interface GitApi {
showFile(cwd: string, ref: string, path: string): Promise<string>
/** Generate a commit message from the staged diff via a local AI agent CLI. */
generateMessage(cwd: string): Promise<GitResult>
+ /** Commit history graph for the repo. */
+ history(
+ cwd: string,
+ options?: { limit?: number; baseRef?: string | null }
+ ): Promise<import('./git-history').GitHistoryResult>
+ /** File-level changes introduced by a commit (oid). */
+ commitFiles(cwd: string, oid: string): Promise<GitFileChange[]>
+ /** Remote web URL for a commit sha, or null if it can't be derived. */
+ remoteCommitUrl(cwd: string, sha: string): Promise<string | null>
}
export interface UpdateInfo {