feat(external-tools): add cross-platform external tool discovery
Adds a new external tools subsystem to detect and launch diff and editor tools across Windows, macOS, and Linux. It exposes data models for tools, commands, and results to the UI and serializes them for consumption by the app. - Implement cross-platform discovery of editors and diff tools - Expose serialized results to the UI for user selection - Centralize per-OS known tool lists and overrides
This commit is contained in:
@@ -7,6 +7,9 @@ import type {
|
||||
CommitAiProvider,
|
||||
CommitAiStatus,
|
||||
ConflictFile,
|
||||
DetectedExternalTool,
|
||||
ExternalToolCommand,
|
||||
ExternalDiffScope,
|
||||
GitBlameResult,
|
||||
GitBranch,
|
||||
GitCommit,
|
||||
@@ -45,6 +48,22 @@ export function openRepositoryFile(path: string, file: string): Promise<void> {
|
||||
return invoke<void>("open_repository_file", { path, file });
|
||||
}
|
||||
|
||||
export function detectExternalTools(): Promise<DetectedExternalTool[]> {
|
||||
return invoke<DetectedExternalTool[]>("detect_external_tools");
|
||||
}
|
||||
|
||||
export function launchExternalTool(path: string, command: ExternalToolCommand, file?: string): Promise<void> {
|
||||
return invoke<void>("launch_external_tool", { path, file: file ?? null, command });
|
||||
}
|
||||
|
||||
export function launchExternalDiff(path: string, file: string, command: ExternalToolCommand, scope: ExternalDiffScope = "head"): Promise<void> {
|
||||
return invoke<void>("launch_external_diff", { path, file, command, scope });
|
||||
}
|
||||
|
||||
export function launchExternalMerge(path: string, file: string, command: ExternalToolCommand): Promise<void> {
|
||||
return invoke<void>("launch_external_merge", { path, file, command });
|
||||
}
|
||||
|
||||
export function openRepositoryBundle(path: string, commitLimit = 100): Promise<RepositoryBundle> {
|
||||
return invoke<RepositoryBundle>("open_repository_bundle", { path, commitLimit });
|
||||
}
|
||||
@@ -370,6 +389,36 @@ export function listCommits(path: string, limit = 100, skip = 0): Promise<GitCom
|
||||
return invoke<GitCommit[]>("list_commits", { path, limit, skip });
|
||||
}
|
||||
|
||||
export function getCommitNote(path: string, commit: string): Promise<string | null> {
|
||||
return invoke<string | null>("get_commit_note", { path, commit });
|
||||
}
|
||||
|
||||
export function setCommitNote(path: string, commit: string, note: string): Promise<void> {
|
||||
return invoke<void>("set_commit_note", { path, commit, note });
|
||||
}
|
||||
|
||||
export function deleteCommitNote(path: string, commit: string): Promise<void> {
|
||||
return invoke<void>("delete_commit_note", { path, commit });
|
||||
}
|
||||
|
||||
export function fetchCommitNotes(path: string, remote: string, username?: string, password?: string): Promise<void> {
|
||||
return invoke<void>("fetch_commit_notes", {
|
||||
path,
|
||||
remote,
|
||||
username: username ?? null,
|
||||
password: password ?? null,
|
||||
});
|
||||
}
|
||||
|
||||
export function pushCommitNotes(path: string, remote: string, username?: string, password?: string): Promise<void> {
|
||||
return invoke<void>("push_commit_notes", {
|
||||
path,
|
||||
remote,
|
||||
username: username ?? null,
|
||||
password: password ?? null,
|
||||
});
|
||||
}
|
||||
|
||||
export function restoreToCommit(path: string, commit: string): Promise<GitStatus> {
|
||||
return invoke<GitStatus>("restore_to_commit", { path, commit });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user