dsh-git-sidebar 0.1.2 → 0.1.3

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.
Files changed (2) hide show
  1. package/lib/index.js +11 -3
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -304,9 +304,14 @@ export function apply(ctx) {
304
304
  if (!st.ok) return st
305
305
  if (st.clean) return { ok: false, error: '工作区没有变更' }
306
306
  const root = st.root
307
- const diffR = await gitRun('git diff HEAD', { cwd: root, cap: 20000 })
307
+ // 只取统计概览 + 受限的 diff 片段,避免把全量差异灌给模型拖慢生成
308
+ const [statR, diffR] = await Promise.all([
309
+ gitRun('git diff HEAD --stat', { cwd: root, cap: 8000 }),
310
+ gitRun('git diff HEAD', { cwd: root, cap: 8000 }),
311
+ ])
308
312
  if (!diffR.ok && diffR.stderr) return { ok: false, error: diffR.stderr.trim() }
309
- const diff = (diffR.stdout || '').slice(0, 19000)
313
+ const stat = (statR.stdout || '').trim()
314
+ const diff = (diffR.stdout || '').slice(0, 6000)
310
315
  if (!llm) return { ok: false, error: 'LLM 服务不可用' }
311
316
  if (!adm) return { ok: false, error: '默认模型服务不可用' }
312
317
  const sel = adm.currentSelection()
@@ -323,7 +328,10 @@ export function apply(ctx) {
323
328
  '变更文件:',
324
329
  fileLines,
325
330
  '',
326
- 'Diff:',
331
+ '变更统计:',
332
+ stat || '(无)',
333
+ '',
334
+ 'Diff 摘要:',
327
335
  diff || '(无可展示的 diff,仅有未跟踪文件)',
328
336
  ].join('\n')
329
337
  let text = ''
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-git-sidebar",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "A draggable right-side Git sidebar for DeepSeek Harness Web: follow the active workspace, list changed files, generate commit messages with the current model, and commit/push/pull",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",