Physicolor/harness-widgets

Right-hand widget rail for DeepSeek Harness Web UI: live session stats (turns, LLM/tool time, TTFT, speed, cache, tokens) plus OpenCode Go quota via a same-origin host proxy; extensible widget registry.

Bundle verified MIT TypeScript Unknown
Bundle verified

Listed

2

Ui

Bundle verified

VersionUnknown
LanguageTypeScript
LicenseMIT
View on GitHub

Preview

Preview 1 of 2: Physicolor/harness-widgets
Preview 2 of 2: Physicolor/harness-widgets

What it does

Right-hand widget rail for the DSH Web UI: live session stats (turns, LLM/tool time, TTFT, speed, cache, tokens) and OpenCode Go quota via a same-origin host proxy; extensible widget registry for more platform usage widgets, visuals, utility actions and external integrations.

Best for

  • DSH Web users who want live session performance, token, cache, and context metrics beside the conversation.
  • OpenCode Go users who want quota windows and reset information in the same interface.
  • Users who want a configurable widget rail with multiple columns, sizes, ordering, and reusable widget registration.

Not ideal for

  • CLI or headless workflows, because the widgets are built for the Web UI.
  • Users who do not need persistent on-screen metrics or utility controls.
  • OpenCode Go quota monitoring when no `OPENCODE_GO_API_KEY` is configured; other session widgets can still be useful.

README

Harness Widgets

为 DeepSeek Harness 打造的美观、可扩展的右侧组件系统。
多列网格布局 · 2×4 长方形组件 · 连续波峰悬浮放大 · 组件市场与实例管理
A beautiful, extensible widget system for DeepSeek Harness — multi-column grids, 2×4 tiles, continuous magnification, and a built-in component marketplace.

Latest release Total downloads GitHub stars MIT License Supported: DeepSeek Harness 0.1.x

Harness Widgets 预览

Harness Widgets 是一个基于 Cordis 的 DeepSeek Harness 持久 bundle 插件。它在会话页右侧提供一套可定制的多列组件面板,实时展示对话洞察、用量监控与快捷工具,并通过声明式注册表支持无限扩展。

Harness Widgets is a persistent DSH bundle plugin built on the Cordis composition model. It provides a customizable multi-column widget rail on the right side of the conversation page — real-time session insights, usage monitoring, and quick actions — with an extensible declarative registry.


当前功能 · Features

多列网格布局 · Multi-Column Grid
项目 说明
列数 1 / 2 / 4 列可选(设置中下拉,默认 2 列)
2×4 长方形组件 宽度为两个 2×2 加一个间距,与 2×2 同高;同一组件可同时以两种尺寸独立安装
无空隙排列 组件按格自动打包(best-fit),2×4 造成的空格由后续 2×2 回填,拖动排序始终无空洞
悬浮放大 多列网格同样支持,放大时行/列均按平面距离让位,间距恒定
连续波峰悬浮放大 · Continuous Magnification

macOS Dock 式悬浮放大,由离散阶梯升级为连续指数衰减:指针在 X/Y 平面运动时,波峰跟随平滑响应,四周所有组件(含上行下行)均参与,间距恒定,右侧不溢出。放大倍数可在设置中调节(1.0–1.4)。

内置部件 · Built-in Widgets
部件 说明
轮次·步数 会话轮次与步骤计数
LLM / 工具时长 推理与调用累计耗时
首 token 延迟 平均 TTFT
速率 解码吞吐(tok/s)
缓存命中 输入缓存命中比例
Tokens 输入 / 输出 token 计数
上下文水位 系统/工具/消息三段占比条 + 明细;支持 2×2 与 2×4 两种尺寸
一键压缩 上下文占用百分比 + 右下角圆钮(双击执行 compact)
任务 进行中 / 已完成 / 待办计数
用量热度图 GitHub 式日历热力图,自记账每日用量
今日寄语 随机鼓励语录,可自定义文字/对齐/换行
组件市场 · Component Marketplace
  • 展示全部组件(系统 + 外部),支持搜索、尺寸切换预览、按 组件@尺寸 独立安装;
  • 已安装列表支持拖拽排序、配置编辑、2×2 ↔ 2×4 一键切换(自动去重,同组件同尺寸只保留一个);
  • 组件配置 tab 支持卡片级自定义(今日寄语、热度图窗口对齐等)。
OpenCode Go 用量 · Usage Monitor

滚动 / 每周 / 每月三个用量窗口 + 百分比 + 重置时间。Host 半注册同源路由代理 opencode.ai,浏览器不发跨域请求,密钥走 DSH credentials。


工作原理 · Architecture

  • 部件注册表:WIDGETS 声明式描述符(id / 名称 / 尺寸 / 分组 / render),部件栏与设置页共用同一注册表,新增部件只需追加一条描述符;
  • 数据收集器:挂载在 conversation.composer.dock slot,该 slot 仅在活跃会话存在时渲染,天然充当「会话存在」信号;
  • Host 半:webServer + credentials 两个服务,注册 /api/opencode-usage 同源代理路由;
  • 可逆清理:所有注册通过 fiber 的 effect 生命周期管理,卸载即恢复;
  • Slot 接入:shell.overlay(面板)、conversation.session.header.utilities(胶囊开关)、settings.section(设置页)。

安装 · Installation

# 通过 npm(插件市场)
dsh plugin --profile web add harness-widgets

# 本地开发(link 方式)
dsh plugin --profile web add link:D:/dsh-home/plugins/harness-widgets

安装后硬刷新浏览器(Ctrl+Shift+R),在会话页头部点击「组件」胶囊即可展开右侧部件栏。OpenCode Go 部件需先在 Models 设置中配置 OPENCODE_GO_API_KEY。

开发 · Development

pnpm install
pnpm run build      # tsdown 构建 lib/
pnpm run check      # 类型检查 + 测试 + 构建
  • peerDependencies:@deepseek-ai/dsh-client-ui-slots、dsh-client-runtime(由 DSH web profile 提供);
  • cordis.patch.yml 插入一行 widgets 行,host 半与浏览器半分别由 loader 与 client-modules 加载。

兼容性 · Compatibility

  • DeepSeek Harness 0.1.0-rc.6 及兼容的后续 0.1.x;
  • 通过 shell.overlay / conversation.session.header.utilities / conversation.composer.dock / settings.section 等官方 slot 接入;
  • 与 dsh-better-sidebar 右栏显式协调(共用 --dsh-sidebar-width),卸载后无残留。

变更日志 · Changelog

Frequently Asked QuestionsFAQ

Use the verified command dsh plugin --profile default add github:Physicolor/harness-widgets in a DSH-enabled shell. The command resolves the public package metadata and keeps the plugin attached to the catalog identity shown on this page.