Annotate elements in DSH Desktop's built-in browser and send the feedback into the current conversation.
Install
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:qijin-3/dsh-annotate
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
This plugin publishes its README in Chinese only.
Annotate frontend elements in DSH's built-in browser and send the feedback straight into the current conversation. The annotation UI is agentation, bundled unmodified.
中文
它做什么
- 在 DSH 桌面端的内置浏览器里点选页面元素、框选区域或选中文字,写下要改什么。
- 点 Send to Agent,反馈作为一条用户消息进入这个浏览器标签所属的对话。
- 不新建对话,也不启动新的 agent 会话。
- agentation 的源码一行不改;本插件只负责注入、提交桥和 DSH 接线。
安装
下载或克隆本仓库。
在 DSH 打开 插件 → 添加插件,选择本目录;或执行:
git clone https://github.com/qijin-3/dsh-annotate.git dsh plugin --profile desktop add ./dsh-annotate重启 DSH 一次。
lib/inject.js 已经预打包好,装好就能批注。只有“检查更新/更新”需要本机重新打包。
使用
- 在右侧栏打开 Browser,访问一个本地页面(默认
localhost、127.0.0.1、::1)。 - 页面右下角出现 agentation 工具条;点它,再点页面元素,写批注。
- 点 Send to Agent。反馈进入该标签所属的当前对话。
更新 agentation
打开 Settings(左侧栏最底部的齿轮,或 Cmd+,)→ 网页批注:
- 检查更新:读取
benjitaylor/agentation的 GitHub tags 和 npm 已发布版本。 - 更新到 vX:只在 npm 已发布该版本时出现。下载对应 npm 包,用 esbuild 重新打包
src/inject.tsx,原子替换lib/inject.js。 - agentation 的源码不改;只是换掉被 bundle 的依赖。
- 已打开的页面仍是旧实例,刷新后生效。
- 当前版本记录在
state/agentation.json(本机状态,不要提交到仓库)。
初始化(给其他人)
批注核心零初始化:
lib/inject.js已提交,装上就能用。打包安装(npm 包 / release 的
.tgz,推荐):esbuild、react、react-dom会由包管理器自动安装。目录 / 源码安装:包管理器不会替它装依赖。打开 Settings → 网页批注,点 初始化;或在插件目录执行:
node scripts/setup.mjs初始化优先用 DSH 自带的 pnpm,其次用系统 npm,只下载约 20 MB 构建依赖,不影响已有批注能力。
限制
- 只支持 Desktop 内置浏览器。Web 端的 Browser 是跨域 iframe,父页面无法注入脚本。
- 默认只对 loopback 页面注入,避免在任意公网站点上弹工具条;需要时在
cordis.patch.yml的hosts里追加主机名。 - HTTPS 页面提交到本机 HTTP 的 DSH 会被混合内容策略拦截;本地开发服务器建议用 HTTP。
- 页面 CSP 禁止内联
<style>时,工具条外观可能不完整。 - 单页应用的前端路由切换不会重复注入(agentation 自身仍可在同一文档继续批注)。
实现
lib/index.js:Host,注册/dsh-annotate/*路由、签发页面令牌、把批注通过ctx.sessionController.prompt追加到标签所属 Session。lib/client.js:Client,监听内置浏览器<webview>、读取标签所属对话、注入脚本、提供设置页。lib/update.js:Host,检查 GitHub/npm 版本、下载 tarball、esbuild 重建。lib/inject.js:由src/inject.tsx打包的 IIFE(React 18 + ReactDOM + agentation + 提交桥)。
Electron 会取消访客页面发往 DSH 自身 Host 的 http/ws 请求,所以访客通过同一端口的 IPv4-mapped IPv6 写法 [::ffff:127.0.0.1] 提交;普通地址作为回退。
许可证
插件自身代码是 MIT(见 LICENSE)。
lib/inject.js 内包含 agentation 3.1.2,使用 PolyForm Shield 1.0.0:源码可见,但不是 OSI 开源许可;允许使用,但不允许拿它做与 agentation 竞争的产品。商用或再分发前请先阅读 THIRD_PARTY_LICENSES/agentation-LICENSE.txt。React 与 ReactDOM 为 MIT。
English
What it does
- Click elements, drag a region, or select text in DSH Desktop's built-in browser and write what should change.
- Press Send to Agent. The feedback arrives as a user message in the conversation that owns the browser tab.
- No new conversation and no separate agent session.
- agentation's source is untouched; this plugin only adds the injection, the submit bridge, and the DSH wiring.
Install
Clone or download this repository.
In DSH open Plugins → Add plugin and choose this folder, or run:
git clone https://github.com/qijin-3/dsh-annotate.git dsh plugin --profile desktop add ./dsh-annotateRestart DSH once.
lib/inject.js is prebuilt, so annotation works immediately. Only Check / Update needs a local rebuild.
Use
- Open Browser in the right sidebar and visit a local page (
localhost,127.0.0.1,::1by default). - The agentation toolbar appears in the page's bottom-right; click it, then click an element and write a note.
- Press Send to Agent. The feedback lands in the current conversation that owns the tab.
Update agentation
Open Settings (the gear at the bottom of the left sidebar, or Cmd+,) → Page annotate:
- Check for updates reads the GitHub tags of
benjitaylor/agentationand the published npm version. - Update to vX appears only when npm has that version. It downloads the npm package, rebuilds
src/inject.tsxwith esbuild, and atomically replaceslib/inject.js. - agentation's source is never edited; only the bundled dependency changes.
- Open pages keep the old instance until they reload.
- The installed version is recorded in
state/agentation.json(machine-local; do not commit it).
Initialization (for other users)
Core annotation needs no setup: the committed
lib/inject.jsis ready to use.Packed install (npm package / release
.tgz, recommended):esbuild,react, andreact-domare installed by the package manager.Directory / source install: the package manager does not install its dependencies. Open Settings → Page annotate and press Set up, or run in the plugin directory:
node scripts/setup.mjsIt prefers DSH's bundled pnpm, then system npm. It downloads about 20 MB of build dependencies and does not affect annotation itself.
Limitations
- Desktop built-in browser only. The Web browser panel is a cross-origin iframe, and the parent page cannot inject into it.
- Only loopback pages are injected by default, so the toolbar does not appear on arbitrary public sites. Add hostnames under
hostsincordis.patch.ymlif needed. - An HTTPS page submitting to a local HTTP DSH is blocked by mixed-content rules; prefer HTTP for the local dev server.
- A page CSP that forbids inline
<style>can leave the toolbar under-styled. - SPA route changes do not re-inject; agentation itself keeps working within the same document.
How it works
lib/index.js: Host routes under/dsh-annotate/*, page tokens, andctx.sessionController.promptinto the Session that owns the tab.lib/client.js: watches the built-in browser's<webview>, reads the owning conversation, injects the bundle, and renders the settings page.lib/update.js: GitHub/npm checks, tarball download, and the esbuild rebuild.lib/inject.js: the IIFE built fromsrc/inject.tsx(React 18 + ReactDOM + agentation + submit bridge).
Electron cancels guest requests to DSH's own Host, so the guest submits to the same listener through the IPv4-mapped IPv6 spelling [::ffff:127.0.0.1]; the plain address stays as a fallback.
License
The plugin's own code is MIT (see LICENSE).
lib/inject.js bundles agentation 3.1.2, licensed under PolyForm Shield 1.0.0 — source-available, not OSI open source; it permits use except for competing with agentation. Read THIRD_PARTY_LICENSES/agentation-LICENSE.txt before commercial use or redistribution. React and ReactDOM are MIT.
Links
More in this category
zhu1090093659/dsh-web#packages/dsh-task-board★ 10645
Task board for the dsh web GUI: a sidebar multi-column kanban whose cards run in real DSH agent sessions and can also be scheduled with cron expressions, executed host-side even with the browser closed.
zhu1090093659/dsh-web#packages/dsh-web-all★ 10645
Plugin and skin collection for the DSH Web UI: task board, Git graph, right-side panel, remote mobile UI, pet, live token stats, and a skin center.
ccch1mneyyy/dsh-TUI★ 8283
Claude Code-style full-screen terminal UI: pixel-whale header, live status line, and streaming thought expansion.
MeteorNOX/DeepSeek-Balance-Whale-Widget★ 7472
A fixed-corner whale widget for the DSH web GUI — balance, today's usage and per-turn cost with peak/off-peak pricing, editable balance-alert and daily-budget bubbles, a module-based custom bubble queue with A/B weighted choices and random lines or images, 30+ vendor templates (OpenAI, OpenRouter, Kimi, SiliconFlow, Ark, Zhipu, MiniMax and more) with per-model balance and subscription quota, plus task-end sound, imported audio, custom roles and a resource manager. Local-only, no telemetry.
omdsh-dev/DSH-better-sidebar★ 5336
Full sidebar workbench with file rendering and editing, terminal, Git, and subagents; third-party plugins can register new tabs.
omdsh-dev/dsh-genui★ 1060
Interactive UI components rendered inline in replies: layout, charts, forms, quizzes, mermaid, 3D scenes, and an action event loop back to the model.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.