@civilization/dsh-git-workbench 0.0.0-stage → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/types.ts ADDED
@@ -0,0 +1,187 @@
1
+ /**
2
+ * Core type declarations for the experimental Git plugin.
3
+ * Shared across the Host RPC handlers and Client UI viewers.
4
+ */
5
+
6
+ /** File change status representation in git */
7
+ export type GitFileStatusCode = 'modified' | 'added' | 'deleted' | 'renamed' | 'untracked' | 'copied'
8
+
9
+ /** One changed file entry in the working directory or staging area */
10
+ export interface GitFileStatus {
11
+ /** Relative file path from the repository root */
12
+ readonly path: string
13
+ /** Previous path if the file was renamed */
14
+ readonly originalPath?: string
15
+ /** Normalized status kind */
16
+ readonly status: GitFileStatusCode
17
+ /** Whether the change has been staged to index */
18
+ readonly staged: boolean
19
+ }
20
+
21
+ /** Information about one local git branch */
22
+ export interface GitBranchInfo {
23
+ /** Branch name (e.g. 'main', 'master', 'feature/xyz') */
24
+ readonly name: string
25
+ /** Whether this branch is currently checked out */
26
+ readonly isCurrent: boolean
27
+ /** Upstream tracking branch if configured */
28
+ readonly upstream?: string
29
+ /** Number of commits ahead of upstream */
30
+ readonly ahead?: number
31
+ /** Number of commits behind upstream */
32
+ readonly behind?: number
33
+ }
34
+
35
+ /** Full status summary of the workspace repository */
36
+ export interface GitStatusSummary {
37
+ /** Whether the checked directory is inside a Git worktree/repository */
38
+ readonly isRepo: boolean
39
+ /** Absolute root directory of the repository */
40
+ readonly rootPath?: string
41
+ /** Current branch name, or commit hash if detached */
42
+ readonly branch?: string
43
+ /** Upstream branch name */
44
+ readonly upstream?: string
45
+ /** Commits ahead of upstream */
46
+ readonly ahead: number
47
+ /** Commits behind upstream */
48
+ readonly behind: number
49
+ /** Latest commit summary on current HEAD */
50
+ readonly headCommit?: {
51
+ readonly hash: string
52
+ readonly shortHash: string
53
+ readonly message: string
54
+ }
55
+ /** Staged changes in index */
56
+ readonly staged: readonly GitFileStatus[]
57
+ /** Unstaged changes in working tree */
58
+ readonly unstaged: readonly GitFileStatus[]
59
+ /** Untracked new files */
60
+ readonly untracked: readonly GitFileStatus[]
61
+ /** Total count of all changed/untracked files */
62
+ readonly totalChanges: number
63
+ /** Total count of commits in the current repository */
64
+ readonly totalCommitsCount?: number
65
+ }
66
+
67
+ /** One commit log entry with optional DAG topology metadata */
68
+ export interface GitCommitItem {
69
+ /** Full 40-character commit hash */
70
+ readonly hash: string
71
+ /** Abbreviated 7-character commit hash */
72
+ readonly shortHash: string
73
+ /** Author name */
74
+ readonly author: string
75
+ /** Author email address */
76
+ readonly authorEmail: string
77
+ /** Human-readable relative date (e.g. '2 hours ago') */
78
+ readonly relativeDate: string
79
+ /** ISO date string */
80
+ readonly date: string
81
+ /** Commit subject/first line of commit message */
82
+ readonly subject: string
83
+ /** Full multiline commit body message (excluding subject) */
84
+ readonly body?: string
85
+ /** Parent commit hashes */
86
+ readonly parents?: readonly string[]
87
+ /** Git branch / tag reference names */
88
+ readonly refs?: readonly string[]
89
+ /** Topological vertical lane column index (0-based) */
90
+ readonly lane?: number
91
+ /** Color hex code for the current commit's lane */
92
+ readonly laneColor?: string
93
+ /** Connecting graph rails to parent commits */
94
+ readonly paths?: readonly GitGraphLanePath[]
95
+ }
96
+
97
+ /** Vector path connecting lanes in the DAG graph visualization */
98
+ export interface GitGraphLanePath {
99
+ /** Starting lane index (from this commit) */
100
+ readonly fromLane: number
101
+ /** Target lane index (to parent commit or pass-through) */
102
+ readonly toLane: number
103
+ /** Type of track: pass-through, fork out, or merge in */
104
+ readonly kind: 'straight' | 'fork' | 'merge'
105
+ /** Color of this track line */
106
+ readonly color: string
107
+ }
108
+
109
+ /** Detail information for a single commit including changed files */
110
+ export interface GitCommitDetail {
111
+ readonly commit: GitCommitItem
112
+ readonly body?: string
113
+ readonly parents?: readonly string[]
114
+ readonly files: readonly {
115
+ readonly path: string
116
+ readonly oldPath?: string
117
+ readonly status: GitFileStatusCode
118
+ readonly additions: number
119
+ readonly deletions: number
120
+ }[]
121
+ readonly totalAdditions: number
122
+ readonly totalDeletions: number
123
+ }
124
+
125
+ /** Complete log query summary including commits and total count */
126
+ export interface GitLogSummary {
127
+ readonly commits: readonly GitCommitItem[]
128
+ readonly totalCount: number
129
+ }
130
+
131
+ /** One Git tag entry */
132
+ export interface GitTagItem {
133
+ /** Tag name (e.g. 'v1.0.0', 'dsh-v0.2.1-rc.2') */
134
+ readonly name: string
135
+ /** Target commit full 40-character SHA hash */
136
+ readonly commitHash: string
137
+ /** Target commit abbreviated 7-character hash */
138
+ readonly shortHash: string
139
+ /** ISO 8601 date string of tag or commit */
140
+ readonly date: string
141
+ /** Human-readable relative date (e.g. '3 days ago') */
142
+ readonly relativeDate: string
143
+ /** Tag annotation message or commit subject */
144
+ readonly message: string
145
+ /** Author or tagger name */
146
+ readonly author: string
147
+ /** Whether this is an annotated tag (git tag -a) */
148
+ readonly isAnnotated: boolean
149
+ }
150
+
151
+ /** Aggregated local and remote branches */
152
+ export interface GitBranchesSummary {
153
+ readonly current?: string
154
+ readonly local: readonly GitBranchInfo[]
155
+ readonly remote: readonly GitBranchInfo[]
156
+ }
157
+
158
+ /** Generic result of executing a git mutative operation */
159
+ export interface GitOperationResult {
160
+ readonly success: boolean
161
+ readonly message?: string
162
+ readonly output?: string
163
+ }
164
+
165
+ /** One file's diff result */
166
+ export interface GitDiffFile {
167
+ /** File path */
168
+ readonly path: string
169
+ /** Old file path if renamed */
170
+ readonly oldPath?: string
171
+ /** Change status */
172
+ readonly status: GitFileStatusCode
173
+ /** Raw unified diff patch lines */
174
+ readonly diffText: string
175
+ /** Count of added lines */
176
+ readonly additions: number
177
+ /** Count of removed lines */
178
+ readonly deletions: number
179
+ }
180
+
181
+ /** Complete diff result summary */
182
+ export interface GitDiffSummary {
183
+ /** List of parsed diff files */
184
+ readonly files: readonly GitDiffFile[]
185
+ /** Complete raw unified diff output */
186
+ readonly rawDiff: string
187
+ }