对当前 DSH 会话做并行矛盾分析,在会话标题栏显示 0–100 连贯性徽章与评注,支持手动触发和按轮数的自动分析(默认开启,可按会话或全局调整)。
安装
# GitHub 源码(首次需按提示配置 allowBuilds 构建授权后重试)
dsh plugin --profile web add github:iimaguest/dsh-contradictions-indicator
装任何插件都等于在你的机器上跑第三方代码,权限和你本人一样大——能读你的文件、用你的凭据、访问网络,工具审批管不到它。GitHub 来源的插件还会在安装时执行构建脚本——pnpm 默认拦截,所以安装可能停在 ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED 或 ERR_PNPM_IGNORED_BUILDS;dsh 会打印出需要添加的确切键名,把它加进该 profile 的 pnpm-workspace.yaml 的 allowBuilds 下,重跑一次即可装上。放行构建本身就是一次信任判断:请只安装可信来源,并尽量锁定 commit(github:owner/repo#sha)。
README
该插件的 README 只有英文版本。
A DeepSeek Harness plugin that scores the live conversation for internal contradictions and shows a 0–100 coherence badge in the session header.
0 means the conversation is riddled with contradictions. 100 means it is consistent. Click the badge for commentary, a manual Analyze Now button, and per-session controls.
Install, update, and remove
Use the web profile:
dsh plugin --profile web add https://github.com/iimaguest/dsh-contradictions-indicator
dsh plugin --profile web update dsh-contradictions-indicator
dsh plugin --profile web remove dsh-contradictions-indicator
dsh plugin --profile web forwards to pnpm in that profile directory (add / update / remove). After add or update, restart dsh web so the host and client halves load. The badge appears in the conversation header utilities. Global defaults live under Settings → Plugins → Contradictions.
Requires DSH web 0.2.0-rc.1 or newer (dsh 0.1 hosts are not supported) with the settings and conversation UI packages that this plugin injects. Tested against dsh 0.2.0-rc.2.
What it does
- Watches main conversation
llm/streamcalls (skips compaction, session-title, and its own analysis calls). - On demand, or on a turn interval, fires a parallel model call that reuses the conversation's provider, model, system prompt, tools, session id, and messages, then appends one analysis user message so the provider KV cache stays warm. Every other request field the session declared — reasoning effort, temperature, stop sequences, and the output budget — is forwarded verbatim too, so the request body is the main call plus exactly one message and no adapter default is substituted anywhere. The only field deliberately replaced is the abort signal. Nothing is ever removed from the request to steer the model's answer: dropping the tool list would invalidate the whole context cache.
- Parses
SCORE: <n>andANALYSIS: <text>from that response. - Shows a colored header badge (green ≥80, yellow ≥50, red <50) and an overlay with the commentary.
- Auto-analysis is on by default for new conversations (default interval 25 turns, editable 1–500). Turn it off globally in Settings → Plugins → Contradictions, or per conversation in the panel.
- Optional system-reminder steer using
{{score}}and{{commentary}}. While a turn is running it is pushed into the conversation as a user message the moment the analysis finishes (agent.steer()on the live agent, landing at the next step boundary). An idle conversation is never woken just to carry a notice — the text stays pending and is handed over at that conversation's next step. If no live agent can be resolved (registry absent, session closed, inbox rejection), the sameagent/pre-stepfallback applies. Off entirely if you uncheck it. - A response that ignores the required
SCORE:/ANALYSIS:format, or that arrives as a bare tool call with no text at all, is retried once before the run is reported as failed. The retry re-sends the identical cached prefix, so it costs almost nothing — and the tool list is never dropped from the request, because removing it would invalidate the provider's context cache. - The badge, panel, and settings tab are localized (English / 简体中文) through the shell's locale service, so Settings → Language applies to this plugin too, and every surface color/radius/shadow comes from the shell's
--dsw-*theme tokens, so Settings → Appearance themes it like host UI.
Settings: two planes, strictly separated
Global defaults (autoEnabled, interval, steer, both prompt texts) live in the plugin's Settings section and persist through DSH's settings service into the profile patch (see "Settings in dsh 0.2 (native)" below). Each conversation snapshots those defaults once, at creation; after that the conversation's panel owns its own copy. Editing settings therefore affects only conversations started afterwards — it never reaches into a live one — and adjusting one conversation never writes back to the defaults (the old persist flag on /contradictions/auto is ignored and gone).
HTTP endpoints (local DSH web server)
The host half registers four exact paths on the DSH web server. They are meant for this plugin's client UI on the same origin:
| Method | Path | Purpose |
|---|---|---|
| GET | /contradictions/state?sessionId= |
Current score, commentary, and session flags |
| POST | /contradictions/auto?sessionId= |
Update auto-analysis, interval, steer, prompts |
| GET/POST | /contradictions/defaults |
Read or write global defaults |
| POST | /contradictions/trigger?sessionId= |
Run analysis now |
These routes are not covered by DSH's /api browser-trust fence, so the plugin
applies its own same-origin check (Sec-Fetch-Site / Origin vs Host) and
rejects cross-site requests before touching session state. All four also
reject bodies over 1 MB and cap persisted prompt text length.
Peer packages after a local clone
If you link: this directory into a profile, Node resolves imports from the real path and will not see the profile's @deepseek-ai packages. Re-run after a fresh clone (node_modules/ is gitignored):
./link-peer-deps.sh
dsh-settings, schemastery, and cordis are linked — the first two are
bare imports the host half has always executed in Node, and since 2.0.0
cordis is one too (the Service base class). react is resolved through
the DSH browser module table, not Node's node_modules, so it needs no
linking here.
@deepseek-ai/dsh-settings and react are marked optional in
package.json — the correct install contract for a DSH host plugin (pnpm
must not duplicate host-provided packages) — while cordis and schemastery
are required peers since 2.0.0 because the Service import is load-bearing.
Optional never means "runs without them": lib/index.js hard-imports the
peers it needs and will fail to load if the profile does not provide them.
Message sources and the v4 session format
Every durable message this plugin emits — the steer notice delivered to a
running turn and the pre-step fallback insert — carries the producer-owned
source kind plugin:contradictions-indicator. dsh's v4 session format
refuses the retired v3 wrapper kind: 'plugin' at admission, and the refusal
takes the whole running turn down with it, so the plugin must never emit it
(a regression test locks this against the admission rule). The in-flight
analysis request message uses the same kind; it is never persisted.
Settings in dsh 0.2 (native)
From 2.0.0 the host half is a Cordis Service with a static Config schema
covering the five global defaults (autoEnabled, interval, steerEnabled,
prompt1, prompt2). dsh's settings service auto-generates a Settings tab
form for the plugin's composed entry from that schema, edits persist into the
profile patch through settings.update, and every field is volatile — an
edit hot-applies via loader/volatile-update without remounting the plugin.
Per-session entries snapshot these defaults once, at creation (Settings edits
reach conversations started afterwards, never mid-flight ones). The plugin
panel's global plane (POST /contradictions/defaults) writes through the same
service, so the panel and the native form cannot drift apart. On a host with
no settings service or no composed entry, global writes stay in memory with a
console note; dsh 0.1 hosts are not supported at all (peers narrowed to
@deepseek-ai/dsh-settings ^0.2.0-rc.1).
Run the host-side regression tests with:
npm test
The ./client export (lib/client.js) is a DSH window.__ModuleLoader__
lazy-load factory, not a standard ESM/CJS module. It only runs inside the DSH
browser runtime; import … from 'dsh-contradictions-indicator/client' will
not work outside of it.
Layout
lib/index.js— host plugin (Cordisapply)lib/client.js— web client (badge, overlay, settings tab)cordis.patch.yml— bundle insert fordsh plugin addtest/— host-side delivery-timing regression tests (npm test)plugin/— working copy of the same host/client sources
License
Apache License 2.0. See LICENSE.
链接
同类插件
zhu1090093659/dsh-web#packages/dsh-task-board★ 8978
侧边栏多列任务看板:卡片交给真实 DSH 智能体会话执行,支持 cron 定时(Host 侧到点执行,关浏览器也生效)。
zhu1090093659/dsh-web#packages/dsh-web-all★ 8978
DSH Web UI 插件与皮肤合集:任务看板、git 图、右侧面板、远程移动端 UI、桌宠、实时 token 统计与皮肤中心。
MeteorNOX/DeepSeek-Balance-Whale-Widget★ 5292
右下角常驻的小鲸鱼挂件:余额、今日已用与每轮对话消耗(含峰谷价),余额预警与今日预算的泡泡内容都可编辑;泡泡点击序列模块化自定义,支持并列加权 A/B、随机台词与随机图片;内置 30+ 厂商模板(OpenAI / OpenRouter / Kimi / 硅基流动 / 方舟 / 智谱 / MiniMax 等),按模型查余额与订阅额度;另有任务结束音效、导入音频、自定义角色与资源管理。数据全在本机,无遥测。
ccch1mneyyy/dsh-TUI★ 4819
Claude Code 风格全屏终端 UI:像素鲸鱼顶栏、实时工作状态行、思考流式展开。
omdsh-dev/DSH-better-sidebar★ 4290
侧边栏完整工作台:内置文件渲染编辑、终端、Git 与子代理,支持三方插件注册新 Tab。
Devin-AXIS/deepseek-design#deepseek-idesign★ 1478
可视化设计工作室,支持网站、App 原型、海报、信息卡、报告和杂志的模板创建、元素编辑、选区级 AI 草稿衔接与导出。
社区评论
评论公开保存在 GitHub Discussions。加载评论会连接 GitHub 和 Giscus;发表内容需要 GitHub 账号。