@windypro-rourou/dsh-logcat 0.2.6 → 0.2.8

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 +6 -2
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -415,6 +415,7 @@ function makeRoutes(engine) {
415
415
  ready: engine.adb !== null,
416
416
  devices: engine.deviceList(),
417
417
  streaming: [...engine.streams.keys()],
418
+ currentPackage: engine.currentPackage,
418
419
  })
419
420
  },
420
421
  },
@@ -596,15 +597,18 @@ function logcatRecentTool(engine) {
596
597
  const level = typeof args.level === 'string' ? args.level : ''
597
598
  const filter = typeof args.filter === 'string' ? args.filter : ''
598
599
  const pkg = (typeof args.package === 'string' ? args.package.trim() : '') || engine.currentPackage
600
+ // The declared output schema is strict (additionalProperties: false), so strip the
601
+ // internal raw/cont fields before returning — otherwise DSH rejects the result.
602
+ 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
603
  const picked = engine.recent(serial, lines, level, filter)
600
- if (pkg === '') return { entries: picked }
604
+ if (pkg === '') return { entries: toOutput(picked) }
601
605
  const pids = await engine.pidsOfPackage(serial, pkg)
602
606
  if (pids.length === 0) {
603
607
  return { entries: [], note: `package ${pkg} is not running on ${serial} — start it first (adb_exec: am start -n ...) or pass another package` }
604
608
  }
605
609
  const byPid = picked.filter((e) => e.pid > 0 && pids.includes(e.pid))
606
610
  return byPid.length > 0
607
- ? { entries: byPid }
611
+ ? { entries: toOutput(byPid) }
608
612
  : { entries: [], note: `no buffered logcat lines for package ${pkg} (pids ${pids.join(', ')}); the app may not have logged yet` }
609
613
  },
610
614
  })
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.8",
5
5
  "type": "module",
6
6
  "packageManager": "pnpm@11.22.0",
7
7
  "engines": {