DSH Plugins Marketplace

DSH Plugins

Plugins

/

dsh-resource-lease

r

dsh-resource-lease

Manifest valid

Resource lease governance: auto-registers browser tabs, background jobs, processes and ports as session-owned leases with TTL auto-reclaim, pinning and manual sweep.

UI (client)hasBundlePatch

dsh-resource-lease — 资源租约治理插件

解决「agent 打开浏览器 tab / 后台 job / 临时进程后忘记关」的问题。不依赖模型自觉:资源打开即自动登记租约(归属会话 + TTL),回收由机制执行。

三层防线

  1. 自动登记(tools/result 观察钩子,零提示词依赖)
    • browser_tab_new → browser-tab 租约(tabId + 归属会话 + TTL,默认 240min)
    • bash/subagent/workflow 带 run_in_background → job 租约(jobId,默认 360min)
    • 其他资源(run_code 里起的服务器等)→ lease_register 工具手动登记
  2. 自动回收(三个触发点互为冗余)
    • session/disposed → 关闭该会话全部 session 级租约(正常路径)
    • daemon 每 60s 扫 TTL 过期租约(会话挂死兜底)
    • 启动 10s 后扫过期账(宿主重启兜底;注册表持久化于 ~/.dsh/resource-lease/leases.json)
    • 浏览器空闲 10min 且实查 0 残留 tab 才 browser_close(共享实例安全闸:有未登记 tab 绝不误关)
  3. 分类策略
    • session(默认):随会话/TTL 自动回收
    • pinned:用户说「这个留着」→ lease_pin 升级,永不自动回收
    • system:白名单(cron/watchdog 服务、外部 Chrome 本来就不登记,天然豁免)

工具面(agent)

工具用途
lease_list列租约(默认当前会话活跃;all=true 全部)
lease_register手动登记(kind=process/port/custom;process/port 需 pid)
lease_pinpinned 升级/降级
lease_release立即关闭(force=true 连 pinned 也关)
lease_sweep立即扫一轮(给 sessionId 则清该会话)

面板(conversation.view slot「资源租约」)

活跃租约表 + 单个关闭/固定 + 清扫过期,10s 自动刷新。宿主 API:/resource-lease/api/{leases,release,pin,sweep}。

回收执行路径(实测)

  • browser tab → ctx.tools.execute('browser_tab_close')(无 agent 上下文可用,PTC 不拦)
  • job → ctx.jobs.kill(jobId, sessionId, reason) 直连服务(job_kill 工具是 agent 作用域注册,全局视图不可见——v1 实测踩坑)
  • process/port → process.kill(pid, SIGTERM)
  • 「资源已不存在」(not found/ESRCH/already-finished)视为关闭成功;'unknown tool' 不算——连续失败 3 次标 failed 停止重试,面板可见待人工处理

构建(离线,无需 npm install)

  • host:bash scripts/build.sh(DSH_CHECKOUT 自动探测 ~/dsh-harness)
  • client:bash scripts/build-client.sh(tsc CJS + 手工 ModuleLoader 包装,替代 tsdown)
  • 一键:dev_build_plugin → dev_inject_plugin / dev_reload_package 热重载

配置(cordis.patch.yml 可覆盖)

sweepIntervalMs(60s) tabTtlMinutes(240) jobTtlMinutes(360) autoCloseBrowser(true) browserIdleCloseMs(10min) keepClosedHours(72)

Comments

Loading…

Similar plugins

dsh-pilot

by Viger1

Browser operation by accessibility refs: navigate, snapshot the page as a ref tree, act on elements, and wait for conditions; the origin policy follows the session approval stance and is enforced by r

Tools & CapabilitiesManifest valid

★ 0

MIT

TypeScript

Aug 17, 2026

dsh plugin --profile web add dsh-pilot

by kai-GitHubaccount

DeepSeek 余额 + Token 用量面板(DSH Web):三级预警、自定义阈值、一键充值、缓存命中率 | Balance & usage panel for DeepSeek Harness

Tools & CapabilitiesDevelopment & InfrastructureManifest valid

★ 0

MIT

JavaScript

Sep 21, 2026

dsh plugin --profile web add dsh-usage-panel

by KelaoHu

Time-shifting task delegation for DeepSeek Harness (dsh): plan tasks at leisure, they run unattended off-peak, come back to a report. Human-adjudicated, desktop + web.

Workflow & AutomationManifest valid

★ 174

↓ 767/wk

MIT

TypeScript

Oct 11, 2026

dsh plugin --profile web add dsh-lowtide

by Nethur-auro

Workspace Explorer for DeepSeek Harness: multi-root conversation tree plus a read-only resource browser in the sidebar.

Manifest valid

★ 0

MIT

JavaScript

Oct 2, 2026

dsh plugin --profile web add dsh-workspace-explorer

by xinyang20

Workspace resource library for DeepSeek Harness: organize, preview and reuse references and deliverables.

Manifest valid

★ 0

MIT

TypeScript

Oct 8, 2026

dsh plugin --profile web add dsh-project-space

by kakajun

Records real clicks, inputs, navigation and network traffic in a user-guided browser session for DSH, then generates a Markdown timeline report (report.md + events.jsonl) to build API-level skills.

Tools & CapabilitiesDevelopment & InfrastructureManifest valid

★ 2

↓ 429/wk

MIT

TypeScript

Sep 30, 2026

dsh plugin --profile web add dsh-web-recorder