jonah791/dsh-agent-browser ↗★ 2

dsh-agent-browser

浏览器工具插件:client 捕获 console/全局错误上报宿主,agent 用 browser_console 工具读取——自己看 F12 Console。

Package
dsh-agent-browser
Compatibility
Unverified
Harness peer range
>=0.1.0-rc.6
Cordis peer range
^4.0.1
Version
0.1.0
License
MIT
Last updated
Nov 12, 2026

Other repositories with this package name

Install

This plugin has no verified bundle, or compatibility checks failed. Read the repository notes first. Read the full README ↗

配置

插件配置 Config(src/index.ts):

项默认说明
maxLogs500日志环形缓冲条数上限;超出保留最新的前 N 条(0 = 不缓冲)
maxText800单条文本截断长度(host 侧入缓冲时截断)

不可配置项(源码常量,改需改代码):

常量值位置 / 含义
client 心跳周期10000 mssrc/client/index.ts setInterval(probe, 10000)
client flush 周期2000 msmount 成功后 setInterval(flush, 2000)
push 去抖600 ms一条日志到一次 flush 的等待
client 本地缓冲80 条 / 单条 600 字符上报前的本地队列与截断
page 长度上限PAGE_MAX = 300src/logic.ts,normalizePage 截断(title 另截 100)
clientAlive TTL60000 ms判据硬编码在 browser_console.execute/browser_page.execute:lastSeenAt > 0 && now - lastSeenAt 注意:isClientFresh(lastSeenAt, nowMs, ttlMs)(src/logic.ts`)是带 TTL 参数的纯函数判据(对被单测覆盖),但工具执行路径并未调用它——工具里的 60s 判据是就地硬编码的。改 TTL 时两处要一致。