feat: add git-aware project context

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
David Kaya
2026-03-23 20:11:46 +01:00
co-authored by Copilot
parent 8d140b6972
commit ab4e9bcea9
10 changed files with 701 additions and 0 deletions
+32
View File
@@ -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';