@xbzbing/dsh-git-panel 1.3.0 → 1.5.0
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/README.md +5 -1
- package/README_EN.md +5 -1
- package/lib/client.js +109 -16
- package/lib/host/actions.d.ts +19 -0
- package/lib/host/core.d.ts +11 -1
- package/lib/host/git.d.ts +2 -0
- package/lib/host/index.d.ts +7 -4
- package/lib/host/index.js +259 -23
- package/lib/host/parser.d.ts +9 -1
- package/lib/host/remote.d.ts +14 -0
- package/lib/host/types.d.ts +95 -1
- package/package.json +1 -1
package/lib/host/types.d.ts
CHANGED
|
@@ -5,6 +5,10 @@
|
|
|
5
5
|
*/
|
|
6
6
|
/** Diff layout: `unified` = single inline column, `split` = side-by-side. */
|
|
7
7
|
export type DiffViewMode = 'unified' | 'split';
|
|
8
|
+
/** Commit-graph line style: `compact` = converge a shared ancestor into one
|
|
9
|
+
* lane (git log --graph); `parallel` = keep each merge's first parent in its
|
|
10
|
+
* own lane, converging only at the ancestor (VSCode / GUI tools). */
|
|
11
|
+
export type GraphStyle = 'compact' | 'parallel';
|
|
8
12
|
/** Wire request: the browser sends only session identity, never a path. */
|
|
9
13
|
export interface GitSnapshotRequest {
|
|
10
14
|
readonly sessionId: string;
|
|
@@ -33,6 +37,21 @@ export type GitFailure = {
|
|
|
33
37
|
} | {
|
|
34
38
|
readonly code: 'cancelled';
|
|
35
39
|
};
|
|
40
|
+
/** Host classification for a remote URL (drives the status-bar icon). */
|
|
41
|
+
export type RemoteHostKind = 'github' | 'gitlab' | 'gitee' | 'bitbucket' | 'other';
|
|
42
|
+
/** The repository's primary remote (origin, else the first remote). */
|
|
43
|
+
export interface GitRemote {
|
|
44
|
+
/** Remote name (`origin`, or the first configured remote). */
|
|
45
|
+
readonly name: string;
|
|
46
|
+
/** The configured fetch URL, verbatim (ssh/scp/https/git form). */
|
|
47
|
+
readonly url: string;
|
|
48
|
+
/** A browsable https URL for the repo page; null when unparseable. */
|
|
49
|
+
readonly webUrl: string | null;
|
|
50
|
+
/** The remote hostname (e.g. `github.com`); null when unparseable. */
|
|
51
|
+
readonly host: string | null;
|
|
52
|
+
/** Known-host classification, for the status-bar icon. */
|
|
53
|
+
readonly hostKind: RemoteHostKind;
|
|
54
|
+
}
|
|
36
55
|
/** Immutable snapshot of one repository's status at `checkedAt`. */
|
|
37
56
|
export interface GitSnapshot {
|
|
38
57
|
/** Realpath of the repository root (work tree top). */
|
|
@@ -50,6 +69,10 @@ export interface GitSnapshot {
|
|
|
50
69
|
readonly untracked: number;
|
|
51
70
|
readonly ahead: number;
|
|
52
71
|
readonly behind: number;
|
|
72
|
+
/** True when the current branch tracks an upstream (@{upstream} resolves). */
|
|
73
|
+
readonly hasUpstream: boolean;
|
|
74
|
+
/** The repository's primary remote; null when none is configured. */
|
|
75
|
+
readonly remote: GitRemote | null;
|
|
53
76
|
readonly lastCommit: GitCommit | null;
|
|
54
77
|
readonly changes: readonly GitChange[];
|
|
55
78
|
/** Working-tree statistics for the changes-page header (single source). */
|
|
@@ -62,6 +85,8 @@ export interface GitSnapshot {
|
|
|
62
85
|
readonly showInputPill: boolean;
|
|
63
86
|
/** Default diff layout the views open with (user preference). */
|
|
64
87
|
readonly defaultDiffView: DiffViewMode;
|
|
88
|
+
/** Commit-graph line style (user preference). */
|
|
89
|
+
readonly graphStyle: GraphStyle;
|
|
65
90
|
/** Whether the commit box shows the AI-suggest button (user preference). */
|
|
66
91
|
readonly suggestEnabled: boolean;
|
|
67
92
|
/** Epoch millis of the snapshot. */
|
|
@@ -122,8 +147,43 @@ export type GitAction = {
|
|
|
122
147
|
readonly name: string;
|
|
123
148
|
} | {
|
|
124
149
|
readonly kind: 'fetch';
|
|
150
|
+
} | {
|
|
151
|
+
readonly kind: 'pull-ff';
|
|
152
|
+
} | {
|
|
153
|
+
readonly kind: 'tag-create';
|
|
154
|
+
readonly name: string;
|
|
155
|
+
readonly commit: string;
|
|
156
|
+
readonly message?: string;
|
|
157
|
+
} | {
|
|
158
|
+
readonly kind: 'tag-delete';
|
|
159
|
+
readonly name: string;
|
|
160
|
+
} | {
|
|
161
|
+
readonly kind: 'stash-push';
|
|
162
|
+
readonly message?: string;
|
|
163
|
+
} | {
|
|
164
|
+
readonly kind: 'stash-apply';
|
|
165
|
+
readonly index: number;
|
|
166
|
+
readonly sha: string;
|
|
167
|
+
} | {
|
|
168
|
+
readonly kind: 'stash-pop';
|
|
169
|
+
readonly index: number;
|
|
170
|
+
readonly sha: string;
|
|
171
|
+
} | {
|
|
172
|
+
readonly kind: 'stash-drop';
|
|
173
|
+
readonly index: number;
|
|
174
|
+
readonly sha: string;
|
|
175
|
+
} | {
|
|
176
|
+
readonly kind: 'revert';
|
|
177
|
+
readonly commit: string;
|
|
178
|
+
} | {
|
|
179
|
+
readonly kind: 'reset';
|
|
180
|
+
readonly commit: string;
|
|
181
|
+
readonly mode: ResetMode;
|
|
125
182
|
};
|
|
126
|
-
|
|
183
|
+
/** `git reset` modes, from least to most destructive. Single source so the
|
|
184
|
+
* client dialog and the command builder cannot drift. */
|
|
185
|
+
export type ResetMode = 'soft' | 'mixed' | 'hard';
|
|
186
|
+
export type GitErrorCode = 'cwd-unavailable' | 'not-a-git-repo' | 'git-unavailable' | 'invalid-path' | 'invalid-name' | 'invalid-index' | 'git-error' | 'timeout' | 'cancelled' | 'empty-message' | 'local-changes-block' | 'not-ff' | 'conflict' | 'revert-conflict' | 'revert-stuck' | 'revert-merge' | 'not-found' | 'index-busy' | 'empty-diff' | 'llm-unavailable' | 'llm-error' | 'llm-output' | 'suggest-disabled';
|
|
127
187
|
export type GitActionResult = {
|
|
128
188
|
readonly ok: true;
|
|
129
189
|
readonly snapshot: GitSnapshot;
|
|
@@ -197,12 +257,16 @@ export type GitQuery = {
|
|
|
197
257
|
readonly kind: 'branches';
|
|
198
258
|
} | {
|
|
199
259
|
readonly kind: 'tags';
|
|
260
|
+
} | {
|
|
261
|
+
readonly kind: 'stash-list';
|
|
200
262
|
} | {
|
|
201
263
|
readonly kind: 'authors';
|
|
202
264
|
} | {
|
|
203
265
|
readonly kind: 'last-commit-message';
|
|
204
266
|
} | {
|
|
205
267
|
readonly kind: 'worktree-stats';
|
|
268
|
+
} | {
|
|
269
|
+
readonly kind: 'pull-preview';
|
|
206
270
|
};
|
|
207
271
|
/** One entry in a `dir-list` result. */
|
|
208
272
|
export interface DirEntry {
|
|
@@ -224,6 +288,19 @@ export interface GitBranch {
|
|
|
224
288
|
readonly ahead?: number;
|
|
225
289
|
readonly behind?: number;
|
|
226
290
|
}
|
|
291
|
+
/** One entry in the stash stack (`git stash list`). */
|
|
292
|
+
export interface StashEntry {
|
|
293
|
+
/** Stack position (0 = most recent). */
|
|
294
|
+
readonly index: number;
|
|
295
|
+
/** The stash commit SHA — a stable id the index position is not (see run). */
|
|
296
|
+
readonly sha: string;
|
|
297
|
+
/** The stash message (custom `-m` text, or the auto "WIP on …" subject). */
|
|
298
|
+
readonly message: string;
|
|
299
|
+
/** Branch the stash was taken on; null when it could not be parsed. */
|
|
300
|
+
readonly branch: string | null;
|
|
301
|
+
/** Human relative time (e.g. "2 hours ago"). */
|
|
302
|
+
readonly relTime: string;
|
|
303
|
+
}
|
|
227
304
|
/** Working-tree statistics for the changes page header. */
|
|
228
305
|
export interface WorktreeStats {
|
|
229
306
|
/** Distinct changed-file paths (staged ∪ modified ∪ untracked). */
|
|
@@ -239,6 +316,13 @@ export interface WorktreeStats {
|
|
|
239
316
|
readonly lastChangeAt: number | null;
|
|
240
317
|
/** HEAD commit time ISO; null when unborn. */
|
|
241
318
|
readonly headCommittedAt: string | null;
|
|
319
|
+
/**
|
|
320
|
+
* True when the per-file fan-outs were skipped because the change set was too
|
|
321
|
+
* large (issue #16): `insertions` then omits untracked lines and
|
|
322
|
+
* `lastChangeAt` is null. Counts (fileCount/staged/modified/untracked) and
|
|
323
|
+
* tracked insertions/deletions stay exact.
|
|
324
|
+
*/
|
|
325
|
+
readonly partial: boolean;
|
|
242
326
|
}
|
|
243
327
|
export type GitQueryResult = {
|
|
244
328
|
readonly kind: 'history';
|
|
@@ -286,6 +370,9 @@ export type GitQueryResult = {
|
|
|
286
370
|
} | {
|
|
287
371
|
readonly kind: 'tags';
|
|
288
372
|
readonly tags: readonly GitBranch[];
|
|
373
|
+
} | {
|
|
374
|
+
readonly kind: 'stash-list';
|
|
375
|
+
readonly entries: readonly StashEntry[];
|
|
289
376
|
} | {
|
|
290
377
|
readonly kind: 'authors';
|
|
291
378
|
readonly authors: readonly string[];
|
|
@@ -295,6 +382,13 @@ export type GitQueryResult = {
|
|
|
295
382
|
} | {
|
|
296
383
|
readonly kind: 'worktree-stats';
|
|
297
384
|
readonly stats: WorktreeStats;
|
|
385
|
+
} | {
|
|
386
|
+
readonly kind: 'pull-preview';
|
|
387
|
+
readonly hasUpstream: boolean;
|
|
388
|
+
readonly commits: number;
|
|
389
|
+
readonly files: number;
|
|
390
|
+
readonly insertions: number;
|
|
391
|
+
readonly deletions: number;
|
|
298
392
|
} | {
|
|
299
393
|
readonly kind: 'dir-list';
|
|
300
394
|
readonly path: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xbzbing/dsh-git-panel",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "DeepSeek Harness (dsh) plugin: an IDE-style Git panel in the Web GUI — branch/history overview, uncommitted changes with commit & amend, diff stats, and a zsh-style branch marker in the input bar.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|