Furdavus/dsh-uyghurche

dsh-uyghurche

仓库尚未提供可用的公开描述。

待分类

dsh-uyghurche

维吾尔语插件 — 让 DeepSeek Harness 里的 AI 用维吾尔文(UEY 阿拉伯字母)回复,附带开发术语表和 UEY↔ULY 转写工具。

Uyghur language plugin for DeepSeek Harness: replies in UEY (Arabic script) by default, with a dev-term glossary and a UEY↔ULY transliteration tool.

功能 / Features

  • 维吾尔语回复策略:默认始终用维吾尔语(UEY)回复(可改为跟随用户语言),代码、标识符、命令保持英文原样。
  • RTL 排版(客户端半部):回答/用户消息的每个 markdown 块自动按内容方向排——维吾尔文块右对齐(RTL),中文/英文块、思考过程、工具卡片保持左对齐(dir="auto" + text-align: start,MutationObserver 覆盖流式渲染)。
  • 开发术语表:内置 195 条通用开发/计算机术语(英语 → 维吾尔语 UEY + ULY + 中文),提示词中内嵌,模型优先采用表中写法。
  • 工具 uyghur_transliterate:UEY(阿拉伯字母)↔ ULY(拉丁字母)双向转写,纯本地确定性算法。
  • 工具 uyghur_glossary:按英文/ULY/UEY/中文查术语表。
  • 命令 /uyghur:on / off / status / uly never|uncertain|always,实时切换,无需重启。
  • 配置项:见 cordis.patch.yml 中的 config 块(strategy / attachUly / includeGlossary)。

安装 / Install

# 从 GitHub 安装(推荐)
dsh plugin --profile web add github:Furdavus/dsh-uyghurche

# 或从本地目录安装
dsh plugin --profile web add <path-to-this-directory>

或手动:把本目录加入 profile 的 dependencies(link: 或 file: 方式),并把 dsh-uyghurche 加入 package.json 的 dsh.profile.bundles 数组,然后重启 profile。

安装后需重启 web profile 使 bundle 层生效(bundle 在启动时装载,不参与热重载)。

配置 / Config

编辑插件包内 cordis.patch.yml 的 config 块(或在 profile 的 cordis.patch.yml 中覆盖),重启后生效:

键值说明
strategyuyghur-always(默认)/ follow-user始终维吾尔语回复 / 跟随用户语言
attachUlynever / uncertain(默认)/ always不附 ULY / 拼写没把握时附 / 每句附
includeGlossarytrue(默认)/ false是否在系统提示词中内嵌术语表(约 1500 token)

运行时开关(/uyghur)持久化在 $DSH_HOME/uyghur-plugin/state.json。

测试 / Test

node test/smoke.mjs    # 宿主半部:转写、术语一致性、提示词
node test/client.mjs   # 客户端半部:DOM mock 下的方向应用与幂等性

无外部依赖。

已知限制 / Limitations

  • ULY→UEY 转换按字母逐字映射,不识别英文单词:英文文本会被转写成维吾尔文字母(这是转写工具,不是翻译器)。
  • 术语表为通用开发术语;特定领域的维吾尔语术语可能不存在统一标准,表中写法是推荐用法,可自行增删 lib/glossary.js。
  • bundle 层修改需重启 profile 生效(/uyghur 运行时开关除外)。
  • 客户端半部依赖稳定属性 data-chat-flow-kind(assistant/message、assistant/live-chunk、user/message);Web 客户端升级若改动了这些节点类型,需同步更新 lib/client.js 的选择器。