dsh-fullwidth-punctuation
Manifest validConverts half-width punctuation in AI replies to full-width Chinese punctuation, so copied answers stay publication-ready.
dsh-fullwidth-punctuation
让 DeepSeek Harness 的 AI 回答输出中文全角标点:回答在界面上是全角,用户直接复制回答内容也是全角。面向政务公文、汇报材料等对「标点统一全角」有硬性要求的写作场景。
原理
插件是纯 host 端 Cordis 插件,监听 llm/stream 瀑布(@deepseek-ai/dsh-llm 官方设计的流拦截点),在数据源头把模型输出文本里的半角标点转换为中文全角:
- 模型输出 →
llm/stream拦截 → 转换 → 写入会话存储 → 渲染到界面 → 复制 - 因为转换发生在源头,界面显示、复制按钮、选中复制拿到的都是同一份全角文本。
同时注入一条 system prompt 提示模型尽量输出全角(双保险,减少后处理负担)。
转换规则(智能全角,不破坏代码/数字/链接)
| 输入 | 输出 | 说明 |
|---|---|---|
, ; ! ? | , ; ! ? | 无条件转换 |
. | 。 | 数字小数点(3.14)、省略号(...)不转 |
: | : | 时间(10:30)、URL(http://)不转 |
( ) | ( ) | markdown 链接 [text](https://github.com/addie-ace/dsh-fullwidth-punctuation/blob/HEAD/url) 内的括号不转 |
" | “ ” | 配对转换 |
代码块 ``` / ~~~ | 不转 | fenced code 整体跳过 |
行内代码 ` | 不转 | inline code 跳过 |
| 裸 URL | 不转 | http://example.com/a.b 保持原样 |
< > [ ] * # - _ ' | 不转 | 歧义过大,保守保留 |
只转换 AI 的回答文本:不转用户输入、不转工具调用的 JSON 参数、不转推理(reasoning)内容。
安装
# 方式一:本地打包后安装(推荐,离线可用)
cd dsh-fullwidth-punctuation
npm pack # 生成 dsh-fullwidth-punctuation-0.1.0.tgz
dsh plugin --profile web add ./dsh-fullwidth-punctuation-0.1.0.tgz
# 方式二:直接用目录安装
dsh plugin --profile web add ./dsh-fullwidth-punctuation
安装后重启 Web GUI(或重启 dsh web)生效。
卸载
dsh plugin --profile web remove dsh-fullwidth-punctuation
验证
- 运行单元测试:
node --test test/ - 装好后问 AI:「写一段材料,包含逗号、句号、冒号和括号」,观察回答与复制内容均为全角。
- 再让 AI 输出一段代码块,确认代码块内的半角标点没有被改写。
边界说明
- 转换只作用于走标准
llm/stream的模型输出(DeepSeek Harness 的 agent-loop 全部走该路径)。 - 半角双引号
"会被配对成中文引号;英文引文场景如不希望转换,请卸载插件。 - 裸域名(无
http://前缀)中的点号可能被当作句号转换,URL 请写全前缀。 - 首版默认开启,无设置界面;如需开关可后续版本加配置项。
开发
node --test test/ # 运行测试
核心文件:
lib/index.js:host 插件入口(llm/stream监听 + system prompt 注入)lib/fullwidth.js:转换核心(流式安全状态机)
Compatibility
Versions
| Latest version | Published | Size |
|---|---|---|
| 0.1.0 | — | — |
Comments
Loading…
Similar plugins
by CAI-MH
Force the model to write all replies in a chosen language (Simplified Chinese by default) via a system-prompt section, switchable anytime with a tool.
★ 0
MIT
JavaScript
Sep 4, 2026
dsh plugin --profile web add dsh-reply-languageby LiangHeOvO
DSH 插件:让所有会话、所有模型的思考过程与回复永久使用简体中文,直到卸载。Force Simplified Chinese thinking and replies in every DeepSeek Harness session.
★ 4
MIT
JavaScript
Oct 5, 2026
dsh plugin --profile web add dsh-zh-cnType normally; about two seconds after you pause, it rewrites your draft into a version more likely to get a good answer, leaving pasted code, links and long text untouched and keeping multi-part ques
★ 0
↓ 39/wk
dsh plugin --profile web add dsh-input-rewriterdsh划词评论:在 DSH 中选中文字,评论或添加到对话;修复引用框裁字。dsh-huaci-pinglun
★ 0
dsh plugin --profile web add dsh-huaci-pinglunby xiyuepcl
DSH审批汉化 — approval dialogs translated to Chinese before they render: DeepSeek-powered, host-side, nothing for React to revert.
★ 1
↓ 15/wk
MIT
JavaScript
Aug 20, 2026
dsh plugin --profile web add dsh-translatorby zzx-dear
Select any text in a DSH chat reply to get a floating Follow-up/Copy pill: one click quotes the selection into the composer so you can type your own follow-up question, or copies it.
★ 0
MIT
JavaScript
Aug 18, 2026
dsh plugin --profile web add dsh-selection-followup