rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:elegant01/dsh-codearts
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
English | 中文
把华为云 CodeArts 接入 DeepSeek Harness(DSH),实现在 DSH 对话窗口里直接使用 CodeArts 提供的模型(GLM-5.2、盘古、Qwen、DeepSeek 等)。
enabledModels)。未勾选的模型只是不再被推荐,已经选定它的会话仍可继续使用;不勾选等同于提供全部模型。dsh-codearts usage 展示今日/累计的请求数与输入输出 token(按模型、按账号),以及每个账号的会话槽位占用(占用时正好解释了「为什么刚才要等半分钟」)。CodeArts 没有额度接口,这里只统计本机经插件发出的请求,官方额度明细见卡片上的链接。showSidebarPanel,默认关闭 —— 那一列是全宿主共用的)。status / models / usage / identity / doctor / logout 六个子命令,便于在无图形界面时检查登录状态、发现模型与查用量。详见 INSTALL.md。核心是把 package.json + lib/ + cordis.patch.yml 放进
profiles/<profile>/node_modules/dsh-codearts/,并在 profile 的 package.json、
node_modules/.package-map.json、node_modules/.modules.yaml 登记。
# 从本仓库构建产物
pnpm install && pnpm run build
node scripts/deploy.mjs [profileDir] # profileDir 默认 <用户目录>/.dsh/profiles/desktop
改代码调试时不必反复重启:见 DEV.md(宿主侧走 dsh-hmr 模块热重载,客户端卡片走
dsh-client-hmr 自动替换进浏览器)。
$DSH_HOME/.codearts-auth.json。codearts,再选一个模型即可开始。dsh plugin --profile <profile> exec dsh-codearts status [--json] # 登录状态与种子模型清单
dsh plugin --profile <profile> exec dsh-codearts models [--json] # 向上游发现当前账号的真实模型
dsh plugin --profile <profile> exec dsh-codearts usage [--json] # 本机用量账本(非账号额度)
dsh plugin --profile <profile> exec dsh-codearts identity [--fix] # 查/回填账号稳定身份,合并重复条目
dsh plugin --profile <profile> exec dsh-codearts doctor # 不涉及密钥的环境诊断
dsh plugin --profile <profile> exec dsh-codearts logout # 清除本插件保存的凭证
models 是排查「模型选择器里怎么没有某个模型」的第一手段:它打印上游真实返回的清单
(内置 / 限时福利 / agent-center 三路合并),而不是插件里那份手维护的种子清单。
usage 读的是插件自己的账本($DSH_HOME/.codearts-usage.json,按天保留 60 天)——
不是账号额度:CodeArts 没有额度接口,官方明细在
codearts.huaweicloud.com/portal/settings/personal-usage,卡片上也有这个链接。
identity 打印每个已存账号在上游的稳定 user_id(同一个 id 出现两次就是重复条目);
加 --fix 会把它们合并到稳定键上,顺带补上 user_name / domain_id。
doctor 只输出路径、状态与版本,不会打印任何令牌内容,输出可以直接贴进问题反馈;logout
只删除本插件自己的凭证副本,不影响账号本身。
沿用 dsh-codebuddy-cli 的结构:本地 loopback shim + pi-ai adapter。
DSH 对话窗口
│ OpenAI /chat/completions 格式, Bearer=<本进程随机密钥>
▼
dsh-codearts shim (127.0.0.1:随机端口)
│ 注入 x-auth-token: <华为云 STS security_token>
│ + 华为云 AK/SK SDK-HMAC-SHA256 签名
▼
CodeArts /api/v2/chat/completions
shim 只监听回环地址,并校验 Host、Origin 与本进程随机密钥,其他本机进程无法冒用。
user_id / user_name 都是空串),所以插件在登录完成后
会再问一次 /snap-manager/v1/current/user 拿稳定的 user_id 作为账号的自然键:
同一个账号重新登录会更新原条目,不再变成新账号。这一步失败(网络/接口变动)时退回旧行为
—— 用 DPoP 公钥当键,此时同一账号重新登录会被当成新账号,旧条目会因凭据失效而自行停用。
历史遗留的重复条目可以用 dsh-codearts identity --fix 合并到稳定键上(先不带 --fix 跑一次是只读的)。dsh-codearts models 看上游到底返回了什么;上游标称的参数不一定可用:
福利网关把 max_tokens 标成 393216,而聊天端点实测超过 65536 就报
InferHub.001001005.400。插件按实测上限下发请求(免费 DeepSeek 系列 65536、
GLM-5.2 已实测可到 131072),没实测过的模型退回 65536 保守值。contextWindowOverrides 按模型纠正,例:
{ "deepseek-v4.1-flash-1017": 491520, "glm-5.3-flash": 774000 }。此外,当
max_tokens 已降到 8192 地板仍被判参数非法时,插件会把本次 prompt 估算记为该模型的
上界(进程内、只收紧不放宽),下一轮直接在本地拦下并提示 /compact 或新建会话。$DSH_HOME 即丢失。各版本的改动见 CHANGELOG.md。
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek-harness、deepseek-harness-plugin、deepseek-harness-plugins。