@xbzbing/dsh-git-panel 1.2.0 → 1.4.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.
@@ -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;
@@ -62,6 +66,10 @@ export interface GitSnapshot {
62
66
  readonly showInputPill: boolean;
63
67
  /** Default diff layout the views open with (user preference). */
64
68
  readonly defaultDiffView: DiffViewMode;
69
+ /** Commit-graph line style (user preference). */
70
+ readonly graphStyle: GraphStyle;
71
+ /** Whether the commit box shows the AI-suggest button (user preference). */
72
+ readonly suggestEnabled: boolean;
65
73
  /** Epoch millis of the snapshot. */
66
74
  readonly checkedAt: number;
67
75
  }
@@ -120,8 +128,41 @@ export type GitAction = {
120
128
  readonly name: string;
121
129
  } | {
122
130
  readonly kind: 'fetch';
131
+ } | {
132
+ readonly kind: 'tag-create';
133
+ readonly name: string;
134
+ readonly commit: string;
135
+ readonly message?: string;
136
+ } | {
137
+ readonly kind: 'tag-delete';
138
+ readonly name: string;
139
+ } | {
140
+ readonly kind: 'stash-push';
141
+ readonly message?: string;
142
+ } | {
143
+ readonly kind: 'stash-apply';
144
+ readonly index: number;
145
+ readonly sha: string;
146
+ } | {
147
+ readonly kind: 'stash-pop';
148
+ readonly index: number;
149
+ readonly sha: string;
150
+ } | {
151
+ readonly kind: 'stash-drop';
152
+ readonly index: number;
153
+ readonly sha: string;
154
+ } | {
155
+ readonly kind: 'revert';
156
+ readonly commit: string;
157
+ } | {
158
+ readonly kind: 'reset';
159
+ readonly commit: string;
160
+ readonly mode: ResetMode;
123
161
  };
124
- export type GitErrorCode = 'cwd-unavailable' | 'not-a-git-repo' | 'git-unavailable' | 'invalid-path' | 'invalid-name' | 'git-error' | 'timeout' | 'cancelled' | 'empty-message' | 'local-changes-block';
162
+ /** `git reset` modes, from least to most destructive. Single source so the
163
+ * client dialog and the command builder cannot drift. */
164
+ export type ResetMode = 'soft' | 'mixed' | 'hard';
165
+ 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' | 'conflict' | 'revert-conflict' | 'revert-stuck' | 'revert-merge' | 'not-found' | 'index-busy' | 'empty-diff' | 'llm-unavailable' | 'llm-error' | 'llm-output' | 'suggest-disabled';
125
166
  export type GitActionResult = {
126
167
  readonly ok: true;
127
168
  readonly snapshot: GitSnapshot;
@@ -195,6 +236,8 @@ export type GitQuery = {
195
236
  readonly kind: 'branches';
196
237
  } | {
197
238
  readonly kind: 'tags';
239
+ } | {
240
+ readonly kind: 'stash-list';
198
241
  } | {
199
242
  readonly kind: 'authors';
200
243
  } | {
@@ -222,6 +265,19 @@ export interface GitBranch {
222
265
  readonly ahead?: number;
223
266
  readonly behind?: number;
224
267
  }
268
+ /** One entry in the stash stack (`git stash list`). */
269
+ export interface StashEntry {
270
+ /** Stack position (0 = most recent). */
271
+ readonly index: number;
272
+ /** The stash commit SHA — a stable id the index position is not (see run). */
273
+ readonly sha: string;
274
+ /** The stash message (custom `-m` text, or the auto "WIP on …" subject). */
275
+ readonly message: string;
276
+ /** Branch the stash was taken on; null when it could not be parsed. */
277
+ readonly branch: string | null;
278
+ /** Human relative time (e.g. "2 hours ago"). */
279
+ readonly relTime: string;
280
+ }
225
281
  /** Working-tree statistics for the changes page header. */
226
282
  export interface WorktreeStats {
227
283
  /** Distinct changed-file paths (staged ∪ modified ∪ untracked). */
@@ -237,6 +293,13 @@ export interface WorktreeStats {
237
293
  readonly lastChangeAt: number | null;
238
294
  /** HEAD commit time ISO; null when unborn. */
239
295
  readonly headCommittedAt: string | null;
296
+ /**
297
+ * True when the per-file fan-outs were skipped because the change set was too
298
+ * large (issue #16): `insertions` then omits untracked lines and
299
+ * `lastChangeAt` is null. Counts (fileCount/staged/modified/untracked) and
300
+ * tracked insertions/deletions stay exact.
301
+ */
302
+ readonly partial: boolean;
240
303
  }
241
304
  export type GitQueryResult = {
242
305
  readonly kind: 'history';
@@ -284,6 +347,9 @@ export type GitQueryResult = {
284
347
  } | {
285
348
  readonly kind: 'tags';
286
349
  readonly tags: readonly GitBranch[];
350
+ } | {
351
+ readonly kind: 'stash-list';
352
+ readonly entries: readonly StashEntry[];
287
353
  } | {
288
354
  readonly kind: 'authors';
289
355
  readonly authors: readonly string[];
@@ -325,6 +391,34 @@ export interface GitQueryRequest {
325
391
  readonly sessionId: string;
326
392
  readonly query: GitQuery;
327
393
  }
394
+ /**
395
+ * Wire request for the suggest endpoint: ask the configured model to write a
396
+ * commit message from the repository's uncommitted changes. `paths` restricts
397
+ * the diff to the user's selection (bare repo-relative paths); absent means
398
+ * all uncommitted changes.
399
+ */
400
+ export interface GitSuggestRequest {
401
+ readonly sessionId: string;
402
+ readonly paths?: readonly string[];
403
+ }
404
+ export type GitSuggestResult = {
405
+ readonly ok: true;
406
+ readonly value: {
407
+ /** The generated message, ready for the user to edit and commit. */
408
+ readonly message: string;
409
+ /** Actual provider/model route used (display only). */
410
+ readonly provider?: string;
411
+ readonly model?: string;
412
+ /** The diff exceeded the model input cap and was truncated. */
413
+ readonly truncated?: boolean;
414
+ };
415
+ } | {
416
+ readonly ok: false;
417
+ readonly error: {
418
+ readonly code: GitErrorCode;
419
+ readonly message?: string;
420
+ };
421
+ };
328
422
  /**
329
423
  * Extensions the image-diff query serves, mapped to MIME types. Part of the
330
424
  * query's contract, so both halves gate on this one list and cannot drift.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xbzbing/dsh-git-panel",
3
- "version": "1.2.0",
3
+ "version": "1.4.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",
@@ -42,7 +42,7 @@
42
42
  "build": "node build.mjs",
43
43
  "typecheck": "tsc -p tsconfig.json --noEmit",
44
44
  "test:unit": "node build.mjs && node --test --test-force-exit test/unit/*.test.mjs",
45
- "test:e2e": "node build.mjs && node test/e2e/setup.mjs && node test/e2e/run.mjs && node test/e2e/run2.mjs",
45
+ "test:e2e": "node build.mjs && node test/e2e/setup.mjs && node test/e2e/run.mjs && node test/e2e/run2.mjs && node test/e2e/run3.mjs",
46
46
  "test": "npm run test:unit && npm run test:e2e",
47
47
  "check": "npm run typecheck && npm run test && git diff --exit-code -- lib/"
48
48
  },