Clide is being rebuilt as a Flutter desktop app. The Python Textual implementation moves wholesale into legacy/ rather than being deleted: its pane model, panel set, git skills, and panel communication design are real thought that should remain readable next to the new code while the rebuild finds its shape. Git's rename tracking preserves history, so `git log -- legacy/` still works. The Flutter rebuild lives at the repo root alongside a Go sidecar (the architecture claudian was heading toward, which folds into clide as a core component rather than a separate plugin project). Bootstrap of the new shape lands in subsequent commits. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
81 lines
1.7 KiB
Python
81 lines
1.7 KiB
Python
"""Git-related Pydantic models."""
|
|
|
|
from enum import Enum
|
|
|
|
from pydantic import BaseModel, ConfigDict
|
|
|
|
|
|
class ChangeStatus(str, Enum):
|
|
"""Git file change status."""
|
|
|
|
ADDED = "added"
|
|
MODIFIED = "modified"
|
|
DELETED = "deleted"
|
|
RENAMED = "renamed"
|
|
COPIED = "copied"
|
|
UNTRACKED = "untracked"
|
|
IGNORED = "ignored"
|
|
UNMERGED = "unmerged"
|
|
|
|
|
|
class GitChange(BaseModel):
|
|
"""A single file change in git."""
|
|
|
|
model_config = ConfigDict(strict=True, frozen=True)
|
|
|
|
path: str
|
|
status: ChangeStatus
|
|
staged: bool
|
|
old_path: str | None = None # For renames
|
|
|
|
|
|
class GitStatus(BaseModel):
|
|
"""Current git repository status."""
|
|
|
|
model_config = ConfigDict(strict=True, frozen=True)
|
|
|
|
branch: str
|
|
ahead: int = 0
|
|
behind: int = 0
|
|
staged: tuple[GitChange, ...]
|
|
unstaged: tuple[GitChange, ...]
|
|
untracked: tuple[str, ...] = ()
|
|
has_conflicts: bool = False
|
|
|
|
|
|
class GitBranch(BaseModel):
|
|
"""Git branch information."""
|
|
|
|
model_config = ConfigDict(strict=True, frozen=True)
|
|
|
|
name: str
|
|
is_current: bool = False
|
|
is_remote: bool = False
|
|
tracking: str | None = None
|
|
commit_hash: str | None = None
|
|
commit_message: str | None = None
|
|
|
|
|
|
class GitCommit(BaseModel):
|
|
"""Git commit information for graph view."""
|
|
|
|
model_config = ConfigDict(strict=True, frozen=True)
|
|
|
|
hash: str
|
|
short_hash: str
|
|
message: str
|
|
author: str
|
|
date: str
|
|
is_merge: bool = False
|
|
refs: tuple[str, ...] = () # branch names, tags
|
|
parents: tuple[str, ...] = ()
|
|
|
|
|
|
class GitGraph(BaseModel):
|
|
"""Git log graph data."""
|
|
|
|
model_config = ConfigDict(strict=True, frozen=True)
|
|
|
|
commits: tuple[GitCommit, ...]
|
|
branches: tuple[GitBranch, ...]
|