diff --git a/.src/types/index.ts b/.src/types/index.ts new file mode 100644 index 0000000..09e5bcc --- /dev/null +++ b/.src/types/index.ts @@ -0,0 +1,143 @@ +import { SimpleGit } from 'simple-git'; + +export interface AgentWorkspace { + agentName: string; + branch: string; + path: string; + createdAt: string; + mainBranch: string; + environment: Record; +} + +export interface WorkspaceConfig { + agentName: string; + branch: string; + createdAt: string; + mainBranch: string; + environment: Record; + customSetupScript?: string; +} + +export interface FileChange { + file: string; + status: 'added' | 'modified' | 'deleted' | 'renamed'; + oldPath?: string; + newPath?: string; + staged: boolean; + author: string; + timestamp: string; + diff: string; +} + +export interface WorkspaceChange { + agentName: string; + branch: string; + path: string; + changes: FileChange[]; + lastUpdated: string; + uncommittedCount: number; +} + +export interface MergeResult { + success: boolean; + commitSha?: string; + message?: string; + conflicts?: ConflictInfo[]; + error?: string; +} + +export interface ConflictInfo { + file: string; + content: string; +} + +export interface DiffResult { + agentName: string; + branch: string; + comparedBranch: string; + files: DiffFile[]; + summary: DiffSummary; +} + +export interface DiffFile { + file: string; + oldFile?: string; + changes: DiffLine[]; + additions: number; + deletions: number; +} + +export interface DiffLine { + type: 'context' | 'added' | 'deleted'; + lineNumber: { + old: number | null; + new: number | null; + }; + content: string; +} + +export interface DiffSummary { + filesChanged: number; + additions: number; + deletions: number; +} + +export interface GlobalConfig { + workspacePath: string; + defaultBranch: string; + autoInstall: boolean; + templates: Record; +} + +export interface CreateOptions { + path?: string; + template?: string; + installDeps: boolean; + environment?: Record; +} + +export interface ListOptions { + json: boolean; + verbose: boolean; +} + +export interface StatusOptions { + short: boolean; + output?: string; +} + +export interface MergeOptions { + force: boolean; + dryRun: boolean; + message?: string; +} + +export interface DestroyOptions { + force: boolean; + preserveChanges: boolean; + outputPath?: string; +} + +export interface DiffOptions { + output?: string; + short: boolean; + compare?: string; +} + +export interface GitContext { + git: SimpleGit; + basePath: string; + workspacePath: string; +} + +export interface WorkspaceInfo { + name: string; + path: string; + branch: string; + exists: boolean; + hasChanges: boolean; + changeCount: number; + lastCommit?: string; +} + +export { SimpleGit };