dsh-better-debug 0.2.0 → 0.2.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.
Files changed (3) hide show
  1. package/README.en.md +17 -8
  2. package/README.md +16 -8
  3. package/package.json +3 -5
package/README.en.md CHANGED
@@ -175,13 +175,21 @@ The route is mounted via `ctx.inject(['webServer'], …)` — a **dynamic inject
175
175
 
176
176
  ## Install
177
177
 
178
- **Quick (Release tarball; pnpm treats it as a normal package):**
178
+ **Shortest path (npm registry — published):**
179
179
 
180
180
  ```bash
181
- dsh plugin add https://github.com/Leonlee114514/dsh-better-debug/releases/download/v0.2.0/dsh-better-debug-0.2.0.tgz
181
+ dsh plugin add dsh-better-debug
182
182
  ```
183
183
 
184
- (This package is **not** published to the npm registry, so `dsh plugin add dsh-better-debug` will 404. Use the tarball URL above, or link manually as below.)
184
+ **Or from the Release tarball (pnpm treats it as a normal package):**
185
+
186
+ ```bash
187
+ dsh plugin add https://github.com/Leonlee114514/dsh-better-debug/releases/download/v0.2.1/dsh-better-debug-0.2.1.tgz
188
+ ```
189
+
190
+ (Both install the same package: the npm tarball is byte-identical to the Release asset.
191
+ Going through npm also lets the market's daily probe backfill the `npm` field into the
192
+ catalog entry, so a click installs straight from the registry.)
185
193
 
186
194
  **Manual link (use this if you want to change the code):**
187
195
 
@@ -291,13 +299,13 @@ Not writing a file was the v0.1 default, and the cost was new users installing i
291
299
 
292
300
  ```bash
293
301
  node --check lib/index.js && node --check lib/panel.js && node --check lib/text.js && node --check client.js
294
- node test/sim.mjs # 37 cases: gate semantics + portability
302
+ node test/sim.mjs # 40 cases: gate semantics + portability
295
303
  node test/panel.mjs # 32 cases: log parsing, aggregation, instrumentation
296
304
  npm run test:posix # re-runs both suites under POSIX path semantics
297
305
  npm run verify # all of the above (with syntax checks)
298
306
  ```
299
307
 
300
- `test/sim.mjs` uses a fake ctx that replicates agent-loop call order (`emitPlain` / `emitWaterfall`) and covers **37 cases**.
308
+ `test/sim.mjs` uses a fake ctx that replicates agent-loop call order (`emitPlain` / `emitWaterfall`) and covers **40 cases**.
301
309
 
302
310
  Semantics (each with a positive and a negative):
303
311
 
@@ -324,10 +332,10 @@ and only ask "does it start at a root" (`isAbsPath`).
324
332
 
325
333
  `test/posix` uses a `node --import` resolve hook to swap `node:path` for `node:path/posix`
326
334
  and then **re-runs both suites unchanged** — so a Windows dev machine reproduces Linux path
327
- semantics. CI runs `npm run verify` on ubuntu / windows / macos × node 20 / 22, so this
328
- cannot quietly regress.
335
+ semantics. CI runs `npm run verify` on ubuntu / windows / macos × node 20 / 22 / 24, so this
336
+ cannot quietly regress. (24 is not padding: the desktop build runs Electron's bundled node 24.)
329
337
 
330
- Three more of the same family, all fixed in v0.2:
338
+ Four more of the same family, all fixed in v0.2 / v0.2.1:
331
339
 
332
340
  | Symptom | Root cause | Now |
333
341
  | --- | --- | --- |
@@ -335,6 +343,7 @@ Three more of the same family, all fixed in v0.2:
335
343
  | Panel shows four empty cards right after install | default `logFile: ""` wrote nothing | defaults to `$DSH_HOME/logs/better-debug.log` |
336
344
  | Plugin silently not loaded — no error, no log line | static `inject: ['skills']` makes `apply()` never run when the service is missing | `inject = []`, dynamic `ctx.inject` |
337
345
  | Clicking "enable" in the market does nothing | bundle patch carried a `config:` block | patch keeps only `id` + `name` |
346
+ | A too-old host is never rejected | the range lived in `dsh.engines.dsh`, but the host and the market read only top-level `engines.dsh` | moved to top-level `engines.dsh` |
338
347
 
339
348
  **Case folding is decided per platform** (`CASE_INSENSITIVE`): only on `win32` / `darwin`.
340
349
  The cost of folding wrong is asymmetric — not folding when you should under-reports, folding
package/README.md CHANGED
@@ -213,14 +213,20 @@ suppress session=… turn=39 reason=done
213
213
 
214
214
  ## 安装
215
215
 
216
- **快装(从 Release tarball,pnpm 会把它当普通包装进 profile):**
216
+ **最短一条(npm registry,已发布):**
217
217
 
218
218
  ```bash
219
- dsh plugin add https://github.com/Leonlee114514/dsh-better-debug/releases/download/v0.2.0/dsh-better-debug-0.2.0.tgz
219
+ dsh plugin add dsh-better-debug
220
220
  ```
221
221
 
222
- (这个包**没有**发到 npm registry,所以 `dsh plugin add dsh-better-debug` 会 404;
223
- 要么用上面这条 tarball URL,要么手动 link,见下。)
222
+ **或者从 Release tarball 装(pnpm 会把它当普通包装进 profile):**
223
+
224
+ ```bash
225
+ dsh plugin add https://github.com/Leonlee114514/dsh-better-debug/releases/download/v0.2.1/dsh-better-debug-0.2.1.tgz
226
+ ```
227
+
228
+ (两条装的是同一个包:npm 上的 tarball 与 Release 资产逐字节相同。走 npm 的好处是
229
+ 市场每日探测会自动把 `npm` 字段回填进目录条目,用户点一下就走 registry 快路。)
224
230
 
225
231
  **手动 link(要改代码就用这个):**
226
232
 
@@ -357,14 +363,14 @@ bundle 层按原样加载」。也就是说:**写了 config,用户点「启
357
363
 
358
364
  ```bash
359
365
  node --check lib/index.js && node --check lib/panel.js && node --check lib/text.js && node --check client.js
360
- node test/sim.mjs # 37 个用例:闸门语义 + 可移植性
366
+ node test/sim.mjs # 40 个用例:闸门语义 + 可移植性
361
367
  node test/panel.mjs # 32 个用例:日志解析、聚合、埋点落盘
362
368
  npm run test:posix # 把上面两套用 POSIX 路径语义再跑一遍
363
369
  npm run verify # 上面全部(含语法检查)
364
370
  ```
365
371
 
366
372
  `test/sim.mjs` 用假 ctx 复刻 agent-loop 的调用顺序(`emitPlain` / `emitWaterfall`),
367
- 覆盖 **37 个用例**。
373
+ 覆盖 **40 个用例**。
368
374
 
369
375
  语义层(每条都有正例 + 反例):
370
376
 
@@ -393,9 +399,10 @@ npm run verify # 上面全部(含语法检查)
393
399
 
394
400
  `test/posix` 用 `node --import` 的 resolve hook 把 `node:path` 换成 `node:path/posix`,
395
401
  然后**把两套用例原样再跑一遍**——这样 Windows 开发机也能复现 Linux 的路径语义。CI 在
396
- ubuntu / windows / macos × node 20 / 22 上跑 `npm run verify`,所以这条不会退回去。
402
+ ubuntu / windows / macos × node 20 / 22 / 24 上跑 `npm run verify`,所以这条不会退回去。
403
+ (24 不是凑数:桌面版 DSH 跑的是 Electron 内置的 node 24。)
397
404
 
398
- 同一类问题的另外三处,都在 v0.2 修掉了:
405
+ 同一类问题的另外四处,都在 v0.2 / v0.2.1 修掉了:
399
406
 
400
407
  | 症状 | 根因 | 现在 |
401
408
  | --- | --- | --- |
@@ -403,6 +410,7 @@ ubuntu / windows / macos × node 20 / 22 上跑 `npm run verify`,所以这条
403
410
  | 装完面板四张卡全 0 | 默认 `logFile: ""` 不落盘 | 默认落 `$DSH_HOME/logs/better-debug.log` |
404
411
  | 插件静默不加载,无报错无日志 | 静态 `inject: ['skills']` 缺服务时 `apply()` 整个不执行 | `inject = []`,走 `ctx.inject` 动态订阅 |
405
412
  | 市场点「启用」没反应 | bundle patch 带 `config:` 块 | patch 只留 `id` + `name` |
413
+ | 宿主版本太旧也不拦 | 版本范围写在 `dsh.engines.dsh`,而宿主与市场只读顶层 `engines.dsh` | 移到顶层 `engines.dsh` |
406
414
 
407
415
  **大小写折叠按平台判**(`CASE_INSENSITIVE`):只在 `win32` / `darwin` 上折叠。折叠错了的
408
416
  后果不对称——该折叠却不折叠是漏报,不该折叠却折叠是**误报**(狼来了),后者才是这道闸门
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-better-debug",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "卡住闸门的代码化:同一文件连续盲改 / 同一操作重复报错 / 改完没有回路又动手,命中就在下一步注入一次提醒,逼出一条几秒能跑的反馈回路。",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -42,13 +42,11 @@
42
42
  "inject": [
43
43
  "slots"
44
44
  ]
45
- },
46
- "engines": {
47
- "dsh": ">=0.2.1-rc.5"
48
45
  }
49
46
  },
50
47
  "engines": {
51
- "node": ">=20"
48
+ "node": ">=20",
49
+ "dsh": ">=0.2.1-rc.5"
52
50
  },
53
51
  "scripts": {
54
52
  "check": "node --check lib/index.js && node --check lib/panel.js && node --check lib/text.js && node --check client.js && node --check test/sim.mjs && node --check test/panel.mjs && node --check test/posix/register.mjs && node --check test/posix/hooks.mjs && node --check test/posix/path.mjs",