rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:sulfide2085/dsh-custom-context-menu
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
English · 中文
DeepSeek Harness(DSH)Web UI 的自定义右键菜单插件:全局接管浏览器右键,提供零依赖的扩展菜单框架,并内置“右键工作区 → 在资源管理器中打开文件夹”。
register() 注册菜单项,支持分隔线、分组标题、禁用项、危险项、hintexplorer.exe <path>,路径自动规范化为反斜杠,并通过前台激活 helper 把窗口带到最前open <path>xdg-open <path>cd dsh-custom-context-menu
pnpm install
cd ..
dsh plugin --profile web add ./dsh-custom-context-menu
重启 DSH Web 生效。
dsh plugin --profile web add "https://github.com/sulfide2085/dsh-custom-context-menu.git"
dsh plugin add会把包以link:/Git 依赖方式装进 profile,并把本包cordis.patch.yml声明的 bundle 层追加到dsh.profile.bundles。
在浏览器控制台(F12)或其他插件中:
window.dshContextMenu.register((target, event) => {
const row = target.closest("[data-session-row]");
if (row === null) return null; // 不处理,交给下一个 provider
return [
{ type: "label", text: row.dataset.title },
{ label: "复制标题", onClick: () => navigator.clipboard.writeText(row.dataset.title) },
{ type: "separator" },
{ label: "删除会话", danger: true, onClick: () => { /* ... */ } }
];
});
| 形式 | 说明 |
|---|---|
"字符串" |
简写 item,label 即字符串 |
{ label, onClick?, disabled?, danger?, hint? } |
常规项;onClick(item, ctx) 的 ctx 为 { target, x, y } |
{ type: "separator" } |
分隔线(连续分隔线自动压缩,首尾丢弃) |
{ type: "label", text } |
只读分组标题 |
window.dshContextMenu)| 成员 | 说明 |
|---|---|
register(provider) |
注册 (target, event) => items[] \| null,返回注销函数;多个 provider 依次询问,第一个非空结果胜出 |
setEnabled(bool) / enabled |
全局开关;关闭后完全放行浏览器原生右键菜单 |
open(x, y, items) |
命令式在视口坐标弹菜单(不经过拦截器) |
close() / isOpen / itemCount |
关闭 / 状态查询 |
debug() |
诊断各部件状态,便于排障 |
右键目标向上查找 div[role="treeitem"],三路匹配 ctx.workspaces.list 条目,任一唯一命中即提供菜单项:
aria-label 匹配官方 workspace 字典titlepath 的 basename(title 被重命名时)重名工作区不提供菜单项,避免打开错误目录。
preventDefault() + 弹出自定义菜单| 文件 | 作用 |
|---|---|
lib/client.js |
浏览器半:全局拦截 + 菜单框架 + 工作区 provider(点击调用 folderOpener/open 远程) |
lib/index.js |
host 半:folderOpener Typert 远程服务(路径校验、平台命令分派、Windows 前台激活) |
cordis.patch.yml |
bundle patch,安装时自动挂载 |
test/ |
node:test 单元测试 |
pnpm install
pnpm test
zod:host 侧 wire schema@deepseek-ai/dsh-typert-protocol:Typert Remote 服务基类@deepseek-ai/cordis:Service 基类(Typert 协议 peer)浏览器半(lib/client.js)为手写 bundle,零依赖、全部原生 DOM。
ctx.workspaces 服务contextmenu 事件;Electron/浏览器外壳同样适用MIT
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek-harness。