dsh-sweeper 1.5.10 → 1.5.12

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 CHANGED
@@ -6,6 +6,10 @@
6
6
  清理对话留下的临时文件、缓存与垃圾,释放磁盘空间(常被叫作「清理内存」,实际清理的是磁盘上的文件,不动进程内存)。
7
7
  静态扫描历史会话里的工具产物,分两档展示;你自己勾选,点「清理选中」批量移到插件回收站,可随时恢复。
8
8
 
9
+ ## 反馈
10
+
11
+ 设置页右上角有「★ 点个 star」,页面底部有「反馈问题或建议」,都会跳到 GitHub。装完之后遇到任何不对的地方,直接开 issue 就行——比起下载数,我更想知道它在哪里判断错了。
12
+
9
13
  ## 截图
10
14
 
11
15
  三张都是真实数据(46 个会话、16,400 次工具调用,模型 `deepseek-v4.1-flash` 的真实回答),不是设计稿。
@@ -273,6 +277,7 @@ node test/browser/check.mjs # 需要本机有 Chrome/Edge,或 CHROME=<p
273
277
 
274
278
  ## 边界与自保
275
279
 
280
+ - **工具的遍历上限会说出来**:模型自己找文件时走到 400 个条目上限会收到一句「只看了前 400 个」,不会把「没扫完」当成「没有」。
276
281
  - **看不到的路径会被点名**:权限不足或文件被占用的路径不能判断,会写成「另有 N 个路径读不到」,不会悄悄少列。
277
282
  - **没列出来的对话会说明**:每轮最多分析 24 段,超出的段数会写成「另有 N 段没有列出」,而不是装作全都看过。
278
283
  - **读不下去的日志会被点名**:会话日志读到一半失败时会计入「N 段日志读不出来」,而不是悄悄从计划里消失。
package/lib/client.js CHANGED
@@ -6,7 +6,10 @@ window.__ModuleLoader__.load({
6
6
  const { useState, useEffect, useMemo, useRef, useCallback } = React
7
7
 
8
8
  const API = '/plugins/dsh-sweeper'
9
- const STYLE_ID = 'dsh-sweeper-style'
9
+ const REPO_URL = 'https://github.com/Dushiqi1987/dsh-sweeper'
10
+ const ISSUE_URL = 'https://github.com/Dushiqi1987/dsh-sweeper/issues/new'
11
+
12
+ const STYLE_ID = 'dsh-sweeper-style'
10
13
 
11
14
  // ── theme ───────────────────────────────────────────────────────────────
12
15
  // Everything is expressed with host tokens so light/dark both work; the
@@ -1490,7 +1493,7 @@ window.__ModuleLoader__.load({
1490
1493
 
1491
1494
  return h('div', { className: 'sw-root', style: { padding: '16px 18px 96px', maxWidth: 1000 } },
1492
1495
  // header
1493
- h('div', { style: { display: 'flex', alignItems: 'center', gap: 12 } },
1496
+ h('div', { style: { display: 'flex', alignItems: 'center', gap: 10, flexWrap: 'wrap' } },
1494
1497
  h('div', {
1495
1498
  style: {
1496
1499
  width: 40, height: 40, borderRadius: 12, display: 'grid', placeItems: 'center', flex: 'none',
@@ -1510,6 +1513,15 @@ window.__ModuleLoader__.load({
1510
1513
  disabled: scanning,
1511
1514
  }),
1512
1515
  report ? h(Btn, { label: '导出', icon: h(Icon, { name: 'download', size: 14 }), onClick: exportJSON, disabled: scanning }) : null,
1516
+ h('a', {
1517
+ href: REPO_URL, target: '_blank', rel: 'noreferrer noopener',
1518
+ title: '到 GitHub 给这个插件点个 star',
1519
+ style: {
1520
+ display: 'inline-flex', alignItems: 'center', gap: 6, height: 30, padding: '0 11px',
1521
+ borderRadius: 8, border: '1px solid ' + T.border, color: T.text, textDecoration: 'none',
1522
+ fontSize: 12.5, whiteSpace: 'nowrap',
1523
+ },
1524
+ }, h('span', { style: { color: T.warn } }, '★'), '点个 star'),
1513
1525
  ),
1514
1526
 
1515
1527
  // stats
@@ -1619,6 +1631,18 @@ window.__ModuleLoader__.load({
1619
1631
  onRefresh: loadTrash,
1620
1632
  }) : null,
1621
1633
 
1634
+ h('div', {
1635
+ style: {
1636
+ display: 'flex', alignItems: 'center', gap: 8, flexWrap: 'wrap',
1637
+ marginTop: 18, fontSize: 11.5, color: T.faint,
1638
+ },
1639
+ },
1640
+ h('span', null, '如果它帮你省了一点清理的时间,'),
1641
+ h('a', { href: REPO_URL, target: '_blank', rel: 'noreferrer noopener', style: { color: T.accent, textDecoration: 'none' } }, '给作者点个 star 支持一下'),
1642
+ h('span', { style: { opacity: .5 } }, '·'),
1643
+ h('a', { href: ISSUE_URL, target: '_blank', rel: 'noreferrer noopener', style: { color: T.accent, textDecoration: 'none' } }, '反馈问题或建议'),
1644
+ ),
1645
+
1622
1646
  // selection bar
1623
1647
  tab === 'report' && chosen.length ? h('div', {
1624
1648
  style: {
package/lib/fs-tools.js CHANGED
@@ -143,13 +143,15 @@ export function makeFsTools(opts) {
143
143
  }
144
144
  const found = []
145
145
  let walked = 0
146
+ let capped = false
146
147
  const walk = (dir, level) => {
147
- if (level > depth || walked > MAX_WALK) return
148
+ if (level > depth) return
149
+ if (walked > MAX_WALK) { capped = true; return }
148
150
  let names
149
151
  try { names = fs.readdirSync(dir) } catch { return }
150
152
  for (const name of names) {
151
153
  walked += 1
152
- if (walked > MAX_WALK) return
154
+ if (walked > MAX_WALK) { capped = true; return }
153
155
  const full = path.join(dir, name)
154
156
  let st
155
157
  try { st = fs.lstatSync(full) } catch { continue }
@@ -168,9 +170,17 @@ export function makeFsTools(opts) {
168
170
  walk(ok.real, 1)
169
171
  found.sort((a, b) => b.size - a.size)
170
172
  const shown = found.slice(0, limit)
171
- if (shown.length === 0) return ok.real + '\nno file matched'
173
+ // A cap that is not announced reads as "this is the whole tree". Say it out loud:
174
+ // a model that believes it has seen everything will stop looking.
175
+ const cappedNote = capped
176
+ ? '\n… walked only the first ' + MAX_WALK + ' entries (cap); narrow the path or lower depth to see the rest'
177
+ : ''
178
+ if (shown.length === 0) {
179
+ return ok.real + '\n' + (capped ? 'capped before any match' : 'no file matched') + cappedNote
180
+ }
172
181
  return ok.real + '\n' + shown.map((row) => human(row.size).padStart(9) + ' ' + day(row.mtime) + ' ' + row.full).join('\n')
173
182
  + (found.length > shown.length ? '\n… ' + (found.length - shown.length) + ' more matches not shown' : '')
183
+ + cappedNote
174
184
  },
175
185
  }
176
186
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-sweeper",
3
- "version": "1.5.10",
3
+ "version": "1.5.12",
4
4
  "type": "module",
5
5
  "description": "清理对话留下的临时文件与垃圾,释放磁盘空间;只报告,清理进回收站可恢复 (cleanup junk files conversations leave on disk, free up space)",
6
6
  "keywords": [