@windypro-rourou/dsh-logcat 0.2.6 → 0.2.7

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 +5 -2
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -596,15 +596,18 @@ function logcatRecentTool(engine) {
596
596
  const level = typeof args.level === 'string' ? args.level : ''
597
597
  const filter = typeof args.filter === 'string' ? args.filter : ''
598
598
  const pkg = (typeof args.package === 'string' ? args.package.trim() : '') || engine.currentPackage
599
+ // The declared output schema is strict (additionalProperties: false), so strip the
600
+ // internal raw/cont fields before returning — otherwise DSH rejects the result.
601
+ const toOutput = (list) => list.map((e) => ({ ts: e.ts, pid: e.pid, tid: e.tid, level: e.level, tag: e.tag, msg: e.msg }))
599
602
  const picked = engine.recent(serial, lines, level, filter)
600
- if (pkg === '') return { entries: picked }
603
+ if (pkg === '') return { entries: toOutput(picked) }
601
604
  const pids = await engine.pidsOfPackage(serial, pkg)
602
605
  if (pids.length === 0) {
603
606
  return { entries: [], note: `package ${pkg} is not running on ${serial} — start it first (adb_exec: am start -n ...) or pass another package` }
604
607
  }
605
608
  const byPid = picked.filter((e) => e.pid > 0 && pids.includes(e.pid))
606
609
  return byPid.length > 0
607
- ? { entries: byPid }
610
+ ? { entries: toOutput(byPid) }
608
611
  : { entries: [], note: `no buffered logcat lines for package ${pkg} (pids ${pids.join(', ')}); the app may not have logged yet` }
609
612
  },
610
613
  })
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@windypro-rourou/dsh-logcat",
3
3
  "description": "Android Logcat viewer for the dsh web GUI: auto-connects to any adb device in debug mode, live logcat stream with level/keyword filters, pause/clear/export, plus agent tools (logcat_recent). Hot-pluggable — mounted via ~/.dsh/cordis.patch.yml + a profile node_modules copy, no dsh source changes.",
4
- "version": "0.2.6",
4
+ "version": "0.2.7",
5
5
  "type": "module",
6
6
  "packageManager": "pnpm@11.22.0",
7
7
  "engines": {