mirror of
https://github.com/davidkaya/aryx.git
synced 2026-11-17 23:28:18 +01:00
feat: add git-aware project context
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
1 parent
8d140b6972
commit
ab4e9bcea9
10 files changed
+701
No files matched your search
@@ -4,6 +4,7 @@ export const ipcChannels = {
|
||||
loadWorkspace: 'workspace:load',
|
||||
addProject: 'workspace:add-project',
|
||||
removeProject: 'workspace:remove-project',
|
||||
refreshProjectGitContext: 'projects:refresh-git-context',
|
||||
savePattern: 'patterns:save',
|
||||
deletePattern: 'patterns:delete',
|
||||
setPatternFavorite: 'patterns:set-favorite',
|
||||
|
||||
@@ -55,6 +55,7 @@ export interface ElectronApi {
|
||||
loadWorkspace(): Promise<WorkspaceState>;
|
||||
addProject(): Promise<WorkspaceState>;
|
||||
removeProject(projectId: string): Promise<WorkspaceState>;
|
||||
refreshProjectGitContext(projectId?: string): Promise<WorkspaceState>;
|
||||
savePattern(input: SavePatternInput): Promise<WorkspaceState>;
|
||||
deletePattern(patternId: string): Promise<WorkspaceState>;
|
||||
createSession(input: CreateSessionInput): Promise<WorkspaceState>;
|
||||
|
||||
@@ -1,10 +1,42 @@
|
||||
import { nowIso } from '@shared/utils/ids';
|
||||
|
||||
export type ProjectGitContextStatus = 'ready' | 'not-repository' | 'git-missing' | 'error';
|
||||
|
||||
export interface ProjectGitChangeSummary {
|
||||
staged: number;
|
||||
unstaged: number;
|
||||
untracked: number;
|
||||
conflicted: number;
|
||||
}
|
||||
|
||||
export interface ProjectGitCommitSummary {
|
||||
hash: string;
|
||||
shortHash: string;
|
||||
subject: string;
|
||||
committedAt: string;
|
||||
}
|
||||
|
||||
export interface ProjectGitContext {
|
||||
status: ProjectGitContextStatus;
|
||||
scannedAt: string;
|
||||
repoRoot?: string;
|
||||
branch?: string;
|
||||
upstream?: string;
|
||||
ahead?: number;
|
||||
behind?: number;
|
||||
isDirty?: boolean;
|
||||
changedFileCount?: number;
|
||||
changes?: ProjectGitChangeSummary;
|
||||
head?: ProjectGitCommitSummary;
|
||||
errorMessage?: string;
|
||||
}
|
||||
|
||||
export interface ProjectRecord {
|
||||
id: string;
|
||||
name: string;
|
||||
path: string;
|
||||
addedAt: string;
|
||||
git?: ProjectGitContext;
|
||||
}
|
||||
|
||||
export const SCRATCHPAD_PROJECT_ID = 'project-scratchpad';
|
||||
|
||||
Reference in new issue
Block a user