nuwa-skill
alchaincyf
你想蒸馏的下一个员工,何必是同事。蒸馏任何人的思维方式——心智模型、决策启发式、表达DNA。Distill how anyone thinks.
745403lkh/dsh-ai-browser
基于 DeepSeek Harness 的 AI 浏览器,主打比其它 AI 浏览器更精细的权限管理:四档窗口权限 × 按工作区隔离的站点名单,支持域名/子域/路径精确匹配与逐站点「无需授权访问」;同时支持内嵌浏览、多标签和下载管理。 / An AI browser for DeepSeek Harness with finer-grained permission control: four window levels x per-workspace site lists, domain/subdomain/path matching and per-site no-auth toggles, plus embedded browsing, tabs and downloads.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:745403lkh/dsh-ai-browser
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
Harness 里的一个应用内浏览器模式:在会话右侧打开浏览器面板,AI 可以读取页面、点击、输入、滚动、截图和下载文件;同时提供按窗口细分的四级浏览器权限、风险警告与限制性授权越权。
底层是 DSH 桌面版的应用内 <webview>(不启动外部浏览器、不碰系统鼠标),Host 只负责命令队列、权限与文件保存。
ai-browser)。browser 工具)state / windows / downloads / bookmarks / history:查看窗口、页面状态与已下载文件,读取当前工作区的收藏与历史记录。open / read / click / type / press / scroll / back / forward / reload / inspect / screenshot:打开、读取、点击、输入、按键、滚动、导航、元素详情与截图。read 返回正文 + 带 index 的可交互元素;先 read 再按 index 操作;页面跳转后重新 read。bookmarks / history 读取当前工作区(按工作区隔离)的收藏和历史记录;面板工具栏的收藏/历史按钮也能查看和整理这些数据(见第 6 节)。new_window / close_window 管理,用 window 参数指定窗口(省略则操作当前激活窗口)。页面里 target="_blank" 或 window.open 打开的链接会自动新建标签页、切换过去,AI 也能直接操作新标签页。<webview> 的脚本执行与合成输入事件完成,不移动系统鼠标、不要求 DSH 在前台;窗口最小化时仍可继续加载与操作(Electron 后台节流会让速度略降)。| 级别 | 能力 |
|---|---|
| 仅可查看 | 读取页面、截图、查看窗口与页面状态 |
| 仅简单操作 | + 打开网址、前进/后退/刷新、滚动、输入文字、新建/关闭窗口 |
| 自动审查 | + 点击/按键/下载;高风险目标(支付、删除、提交订单、密码框等)自动升级确认 |
| 完全权限 | 所有浏览器操作放行 |
baidu.com 匹配该域名及所有子域(www.baidu.com、fanyi.baidu.com);写 www.baidu.com 只匹配该主机;带路径的 www.baidu.com/xyz 匹配该路径及下级。命中名单直接使用名单档位,未命中一律仅可查看;条目可开启「无需授权访问」,开启后 AI 打开该站点无需申请授权。新窗口/外链不继承旧权限,按目标站点重新套用名单。# name: 头 + [view] / [simple] / [review] / [full] 四个分节,每个分节下逐行写站点条目,条目可带 !noauth 表示「无需授权访问」,例如:# name: 我的常用预设
[view]
example.com
[simple]
baidu.com !noauth
[review]
docs.example.org
[full]
intranet.example.com
reason);被拒后 AI 向用户解释而不是静默停止。request_access 可先申请再执行(需带上目标动作的 URL/index 等参数)。<webview> 是原生视图、会盖住页面 DOM 覆盖层:打开权限菜单、警告弹窗或下载弹窗时会临时隐藏 webview 区域,关闭后恢复。download(url 或 index)。fetch 取回(可带页面登录态);跨域失败时自动回退到 Host 直连下载(绕过页面 CORS,流式写盘,上限 512MB,拒绝本机/内网地址防 SSRF)。Content-Length 总大小校验:只有字节数达到服务端声明的总大小才改名为最终文件;中断时保留 .part 供下次续传,不会把半成品当成下载成功。browser download/(同名自动加序号);工作区不可用时回退到 $DSH_HOME/storages/dsh-ai-browser/downloads/。downloads 查看任务状态,用 pause_download / resume_download / cancel_download 控制。window.open 打开下载链接、下载一开始就立刻关闭弹窗,以前浏览器会留下一个空白页面;现在会自动识别并关闭这类下载型弹窗,加载后仍是空白/无标题的弹窗也会被自动关闭。.exe / .msi / .apk 等高风险类型会升级确认。screenshot 截图保存到 $DSH_HOME/storages/dsh-ai-browser/screenshots/,最多保留 40 张。browser 工具的 bookmarks / history 动作读取当前工作区的收藏和历史记录。$DSH_HOME/storages/dsh-ai-browser/:
| 路径 | 内容 |
|---|---|
permissions.json |
四级权限状态(按会话 + 窗口持久化) |
sites.json |
四档站点名单(按工作区隔离) |
library.json |
收藏与历史记录(按工作区隔离,历史最多 500 条) |
presets.json |
权限预设、默认预设与已初始化工作区列表 |
screenshots/ |
截图,最多 40 张 |
downloads/ |
工作区不可用时的下载回退目录 |
所有接口(含 GET)都必须携带本地客户端请求头 x-dsh-ai-browser: 1,且只接受本机回环来源(Host 必须是 localhost / 127.0.0.1 / [::1];带 Origin 时必须是同源或桌面壳协议)。接口从不返回 CORS 头,跨站页面无法触发。
| 方法 | 路径 | 说明 |
|---|---|---|
| GET | /.dsh-ai-browser/health |
插件版本与运行时能力清单(用于 Host/Client 版本自检) |
| POST | /.dsh-ai-browser/session |
会话窗口列表与各窗口权限级别 |
| POST | /.dsh-ai-browser/level |
设置指定窗口的权限级别 { sessionId, windowId, level } |
| POST | /.dsh-ai-browser/report |
面板上报窗口状态(URL/标题/激活窗口) |
| POST | /.dsh-ai-browser/poll |
长轮询拉取待执行命令 |
| POST | /.dsh-ai-browser/result |
回传命令结果 |
| POST | /.dsh-ai-browser/download |
保存页面内取回的字节(≤128MB,base64) |
| POST | /.dsh-ai-browser/download-url |
Host 直连下载(断点续传,≤512MB) |
| POST | /.dsh-ai-browser/downloads |
列出已下载文件与进行中的下载任务(含进度/速度) |
| POST | /.dsh-ai-browser/open-download |
用系统默认程序打开下载目录内的文件 |
| GET | /.dsh-ai-browser/library?sessionId= |
当前工作区的收藏与历史记录 |
| POST | /.dsh-ai-browser/library |
收藏/历史操作 { sessionId, action: bookmark-add / bookmark-remove / history-clear } |
| GET | /.dsh-ai-browser/presets |
权限预设列表与默认预设 |
| POST | /.dsh-ai-browser/presets |
权限预设操作 { action: create / update / delete / set-default / apply } |
浏览器工具的 bookmarks / history 动作读取当前工作区的收藏与历史记录(见第 2 节)。
错误响应统一为 { ok: false, error: { code, message } }。
<webview> 的安全策略由 DSH 主进程强制:无 Node 权限、禁用插件与 devTools(打包版)、禁用系统下载、拒绝系统权限、禁止打开 DSH 应用自身地址(含 localhost 回环服务)。因此下载由 Host 负责写盘,而不是交给 Chromium 原生下载。session:<id> 分区),重启应用后登录状态不保留;同一会话刷新面板会重建隔离分区。preset-ai-browser 的 plugins 列表,移除 shell/文件系统工具。| 文件 | 作用 |
|---|---|
index.js |
Host 入口:注入服务、注册 HTTP 路由、版本/能力自检 |
preset.js |
Agent Preset:browser 工具、权限校验与主动授权、系统提示词 |
lib/runtime.js |
会话运行时:窗口状态、命令队列、截图保存、会话权限 |
lib/downloads.js |
下载:断点续传、大小校验、进度任务、打开下载文件 |
lib/routes.js |
同源 HTTP 接口与安全守卫(请求头 + 回环来源) |
lib/permissions.js |
四级权限定义、动作能力映射与高风险启发式 |
lib/browser-permissions.js |
按「会话 + 窗口」持久化权限状态 |
lib/library.js |
收藏与历史记录:按工作区存储、自动去重与数量上限 |
lib/presets.js |
权限预设:创建/编辑/删除、默认预设、应用与工作区自动初始化 |
lib/home.js |
DSH home 路径解析 |
client.js |
浏览器半侧:面板、<webview> 租约、下载面板、权限 UI、收藏/历史面板、设置页 |
cordis.patch.yml |
Loader 补丁:Host 行 + Agent Preset 行 |
locale/zh.json / locale/en.json |
界面文案 |
icon.svg |
插件图标 |
不依赖任何第三方 npm 包:Host 只用 Node 内置能力与 Harness 服务(agents / agentPresets / workingDirectory / webServer / approval);Client 通过 window.__ModuleLoader__.load 请求平台自带的 React,应用内浏览器通过 window.dshDesktop.browser 租约创建 <webview>。
/health 会返回版本与运行时实际能力;Host 代码版本与 Client 不一致时,面板会提示「请重启 DSH」,避免功能静默失败。dsh-ai-browser;许可证:MIT(见 LICENSE)。MIT © 2026 Akivelli
An in-app browser mode for Harness: open a browser panel on the right side of a conversation, and let the AI read pages, click, type, scroll, take screenshots and download files. It also provides per-window four-level browser permissions, risk warnings and restricted authorization escalation.
The browser is an in-app <webview> in the DSH desktop app (no external browser is launched and no system mouse is used); the host only handles the command queue, permissions and file saving.
ai-browser).browser tool)state / windows / downloads / bookmarks / history: inspect windows, page state and downloaded files, and read the current workspace's bookmarks and history.open / read / click / type / press / scroll / back / forward / reload / inspect / screenshot: open, read, click, type, press keys, scroll, navigate, inspect an element and take screenshots.read returns page text plus indexed interactive elements; read first, then act by index; re-read after navigation.bookmarks / history read the current workspace's bookmarks and history (both stored per workspace); the bookmark/history buttons in the panel toolbar manage the same data (see section 6).new_window / close_window, and targeted via the window parameter (the active window is used when omitted). Links opened via target="_blank" or window.open create a new tab automatically, switch to it, and the AI can operate that tab too.<webview> script execution and synthesized input events. The system mouse is never moved, DSH does not need to be in the foreground, and browsing continues while the window is minimized (Electron background throttling may slow it slightly).| Level | Capabilities |
|---|---|
| View only | Read pages, take screenshots, inspect windows and page state |
| Simple actions | + open URLs, back/forward/reload, scroll, type text, create/close windows |
| Auto review | + click / press keys / download; high-risk targets (payment, delete, submit order, password fields, etc.) are escalated for confirmation |
| Full access | All browser actions are allowed |
baidu.com) matches the domain and all subdomains (www.baidu.com, fanyi.baidu.com); a prefixed entry (www.baidu.com) matches that host only; a path entry (www.baidu.com/xyz) matches that path and its children. Listed sites use that level; unlisted sites are view-only; each entry has "No authorization needed" so the AI can open it without approval. New windows and external links do not inherit the old permission — the target site's list entry is applied instead.# name: header plus [view] / [simple] / [review] / [full] sections; each section lists site entries one per line, and an entry may end with !noauth meaning "no authorization needed", for example:# name: My usual preset
[view]
example.com
[simple]
baidu.com !noauth
[review]
docs.example.org
[full]
intranet.example.com
reason); after a rejection the AI explains instead of silently stopping. request_access can ask first and then execute (include the target action's URL/index parameters).<webview> is a native view that covers DOM overlays: while the permission menu, warning dialog or download dialog is open, the webview area is temporarily hidden and restored afterwards.download (url or index).fetch first (keeping page login state); on CORS failure it falls back to a direct host download (bypasses page CORS, streams to disk, 512MB cap, rejects loopback/private addresses against SSRF).Content-Length size check: only when the byte count reaches the server-declared total is the file renamed to its final name; interrupted downloads keep a .part file for the next resume, so a partial file is never reported as a success.browser download/ in the current workspace (same names get numbered suffixes); when the workspace is unavailable, they fall back to $DSH_HOME/storages/dsh-ai-browser/downloads/.downloads and control it with pause_download / resume_download / cancel_download.window.open and close the popup as soon as the download starts, which used to leave an empty page behind. Such download popups are now detected and closed automatically, as are popups that stay blank / title-less after loading..exe / .msi / .apk are escalated for confirmation.screenshot saves images to $DSH_HOME/storages/dsh-ai-browser/screenshots/, keeping the latest 40.bookmarks / history actions.$DSH_HOME/storages/dsh-ai-browser/:
| Path | Content |
|---|---|
permissions.json |
Four-level permission state (persisted per session + window) |
sites.json |
Four-level site lists (per workspace) |
library.json |
Bookmarks and history (per workspace; history keeps the latest 500) |
presets.json |
Permission presets, the default preset and the list of initialized workspaces |
screenshots/ |
Screenshots, keeping the latest 40 |
downloads/ |
Download fallback directory when the workspace is unavailable |
Every endpoint (including GET) must carry the local client header x-dsh-ai-browser: 1 and only accepts loopback origins (Host must be localhost / 127.0.0.1 / [::1]; when Origin is present it must be same-origin or the desktop shell protocol). The endpoints never return CORS headers, so cross-site pages cannot trigger them.
| Method | Path | Description |
|---|---|---|
| GET | /.dsh-ai-browser/health |
Plugin version and runtime capability list (used for host/client self-check) |
| POST | /.dsh-ai-browser/session |
Session window list and each window's permission level |
| POST | /.dsh-ai-browser/level |
Set a window's permission level { sessionId, windowId, level } |
| POST | /.dsh-ai-browser/report |
Panel reports window state (URL/title/active window) |
| POST | /.dsh-ai-browser/poll |
Long-poll for pending commands |
| POST | /.dsh-ai-browser/result |
Return a command result |
| POST | /.dsh-ai-browser/download |
Save bytes fetched in the page (≤128MB, base64) |
| POST | /.dsh-ai-browser/download-url |
Direct host download (resumable, ≤512MB) |
| POST | /.dsh-ai-browser/downloads |
List downloaded files and active download tasks (with progress/speed) |
| POST | /.dsh-ai-browser/open-download |
Open a file in the download directory with the system default app |
| GET | /.dsh-ai-browser/library?sessionId= |
Bookmarks and history of the current workspace |
| POST | /.dsh-ai-browser/library |
Bookmark/history action { sessionId, action: bookmark-add / bookmark-remove / history-clear } |
| GET | /.dsh-ai-browser/presets |
Permission presets and the default preset |
| POST | /.dsh-ai-browser/presets |
Permission preset action { action: create / update / delete / set-default / apply } |
The browser tool's bookmarks / history actions read the current workspace's bookmarks and history (see section 2).
Error responses are uniformly { ok: false, error: { code, message } }.
<webview> is locked down by the DSH main process: no Node permission, plugins and devTools disabled (packaged build), system downloads disabled, system permissions denied, and DSH's own addresses (including localhost loopback services) blocked. Downloads are therefore written by the host instead of Chromium's native download flow.session:<id> partition); login state is not kept after restarting the app, and refreshing the panel within the same session recreates the isolated partition.preset-ai-browser plugins list in a profile patch and remove the shell/filesystem tools.| File | Purpose |
|---|---|
index.js |
Host entry: injects services, registers HTTP routes, version/capability self-check |
preset.js |
Agent Preset: browser tool, permission checks and proactive authorization, system prompt |
lib/runtime.js |
Session runtime: window state, command queue, screenshot saving, session permissions |
lib/downloads.js |
Downloads: resume, size validation, progress tasks, opening downloaded files |
lib/routes.js |
Same-origin HTTP endpoints and guards (header + loopback origin) |
lib/permissions.js |
Four-level permission definitions, action capability mapping and risk heuristics |
lib/browser-permissions.js |
Persists permission state per "session + window" |
lib/library.js |
Bookmarks and history: per-workspace storage, de-duplication and caps |
lib/presets.js |
Permission presets: create/edit/delete, default preset, apply and workspace auto-initialization |
lib/home.js |
DSH home path resolution |
client.js |
Browser side: panel, <webview> lease, download panel, permission UI, bookmark/history panels, settings page |
cordis.patch.yml |
Loader patch: host row + Agent Preset row |
locale/zh.json / locale/en.json |
UI strings |
icon.svg |
Plugin icon |
No third-party npm packages: the host uses only Node built-ins and Harness services (agents / agentPresets / workingDirectory / webServer / approval); the client requests the platform-provided React through window.__ModuleLoader__.load, and the in-app browser creates its <webview> through the window.dshDesktop.browser lease.
/health reports the version and real runtime capabilities; when the host code version differs from the client, the panel prompts to restart DSH so features do not fail silently.dsh-ai-browser; license: MIT (see LICENSE).MIT © 2026 Akivelli
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: ai-agent。