rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:EnhydraLutristus/dsh-chat-math
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
让 DeepSeek Harness 的聊天回答直接以 TeX 数学排版,而不是代码块、反引号里的伪数学、Unicode 符号或 PDF/图片。
chat-math-format system prompt section(order 1050):每次都告诉模型用 $...$ / $$...$$,不允许代码块、反引号、粗体 Unicode 公式,也不允许生成 PDF/图片。llm/stream 归一化器:即使模型仍然输出旧格式,也会在消息持久化之前把$$...$$(矩阵转 bmatrix,多行转 aligned);$...$(含单字母 t、M、p);**...** → $...$;$$...$$。每次改写都用与渲染器同版本的 KaTeX 校验;校验不通过就保留原文,绝不猜测公式结构。已有 $$ 块内的空行、裸 $、非法 TeX 也会被降级为 prose,避免 KaTeX 把后文整段吞成红色。代码 span 里的 **...**、已有 $...$ 里的粗体不会被二次改写;a+b、x - y 这类 ASCII 算术会被识别,API/++i 仍保持代码;x_12 会加花括号成 x_{12},而 T_pM 保持原样。
如果会话前面写过 LaTeX 文档,模型可能复用 preamble 里的 \newcommand 宏(\E、\R、\dd),而 KaTeX 不读文档 preamble。macroExpansions 会在数学区域内、校验之前把这些宏展开;它只替换完整控制词,不会误伤 \Epsilon。
node tools/install.mjs
安装器会把 lib/、package.json、cordis.patch.yml、dsh-plugin.json 复制到当前桌面 profile 的 node_modules/dsh-chat-math,并在 profile package.json 的 dependencies 和 dsh.profile.bundles 中登记。
安装后开一个新对话。 每个会话有自己的 runner 进程,会重新读取 bundle 列表;不需要重启应用。
卸载:
node tools/install.mjs --uninstall
在 profile 的 cordis.patch.yml 中给 dsh-chat-math 加 config:
- id: dsh-chat-math
name: dsh-chat-math
config:
prompt: always # always | off
normalize: true
convertFences: true
convertInline: true
convertBold: true
convertPlain: true
macroExpansions:
- from: '\E'
to: '\mathrm{e}'
- from: '\R'
to: '\mathbb{R}'
- from: '\dd'
to: '\,\mathrm{d}'
logFile: C:/Users/you/.dsh/profiles/desktop/dsh-chat-math.log
未知配置项会被忽略;maxFenceChars 限制为 200–20000,防止把超长代码块误当公式缓冲。
如果同时安装了 dsh-math-tex,建议把它的 repair 设为 off:它的修复守卫会在 dsh-chat-math 之前把 KaTeX 拒绝的公式降级成代码块,而代码块一旦生成,原公式结构就已经丢失了。dsh-chat-math 会把无法修复的公式降级为 prose,不会留下代码块。
node test/run.mjs # 50 passed
node test/audit.mjs # 结构 fuzz + KaTeX 可渲染性
node test/stream-compare.mjs
test/run.mjs 不依赖 DSH 宿主,但会使用桌面 profile 中的 KaTeX(与渲染器同版本)作为判定 oracle。
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek-harness。