@michengai/dsh-simplify 1.0.6 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.zh-CN.md CHANGED
@@ -8,19 +8,21 @@
8
8
 
9
9
  **在 DeepSeek Harness 中简化最近改动的代码,保持原有功能。**
10
10
 
11
- [English](README.md) · [安装](#安装) · [使用](#使用) · [故障排查](#故障排查) · [更新日志](CHANGELOG.zh-CN.md) · [Apache-2.0](LICENSE)
11
+ [简体中文](README.zh-CN.md) · [English](README.en.md) · [日本語](README.ja.md) · [Español](README.es.md) · [Français](README.fr.md) · [Deutsch](README.de.md) · [Русский](README.ru.md) · [Português](README.pt.md)
12
+
13
+ [安装](#安装) · [使用](#使用) · [故障排查](#故障排查) · [更新日志](CHANGELOG.zh-CN.md) · [Apache-2.0](LICENSE)
12
14
 
13
15
  [![许可证:Apache-2.0](https://img.shields.io/badge/License-Apache--2.0-blue.svg)](LICENSE)
14
16
  [![npm package](https://img.shields.io/npm/v/%40michengai%2Fdsh-simplify.svg?label=npm%20package)](https://www.npmjs.com/package/@michengai/dsh-simplify)
15
17
  [![DSH Web Plugin](https://img.shields.io/badge/DSH%20Web-Plugin-0f766e.svg)](https://github.com/deepseek-ai/deepseek-harness)
16
- [![DSH 支持至 0.2.1-rc.3](https://img.shields.io/badge/DSH-%E6%94%AF%E6%8C%81%E8%87%B3%200.2.1--rc.3-2563eb.svg)](#安装)
18
+ [![DSH 支持至 0.2.2-rc.1](https://img.shields.io/badge/DSH-%E6%94%AF%E6%8C%81%E8%87%B3%200.2.2--rc.1-2563eb.svg)](#安装)
17
19
  [![Node.js 22.19+](https://img.shields.io/badge/Node.js-22.19%2B-339933.svg?logo=node.js&logoColor=white)](https://nodejs.org/)
18
20
 
19
21
  </div>
20
22
 
21
23
  > DSH Simplify 是社区维护的 DeepSeek Harness 插件,并非 DeepSeek AI 官方产品。在当前会话中输入 `/simplify`,即可请 Agent 整理 Git 改动范围内的代码,改善可读性并保持原有功能。支持 DSH Web 及集成 DSH Web 的桌面应用。
22
24
 
23
- 命令文案及提示词使用简体中文。
25
+ 发给 Agent 的任务提示词仍为简体中文,命令候选文案随界面语言自动切换。
24
26
 
25
27
  ## 功能概览
26
28
 
@@ -54,7 +56,7 @@
54
56
 
55
57
  ## 前置条件
56
58
 
57
- - 宿主支持范围:DeepSeek Harness `0.2.x` 全系列(`>=0.2.0-rc.1 <0.3.0-0`),已验证兼容 `0.2.0-rc.1`、`0.2.0-rc.2`、`0.2.1-rc.1`、`0.2.1-rc.2`、`0.2.1-rc.3`,并自动支持后续日常小版本、alpha 与 RC,同代宿主升级无需重复等待发版。
59
+ - 宿主支持范围:DeepSeek Harness `0.2.x` 全系列(`>=0.2.0-rc.1 <0.3.0-0`),已验证兼容 `0.2.0-rc.1`、`0.2.0-rc.2`、`0.2.1-rc.1`~`0.2.1-rc.5`、`0.2.2-rc.1`,并自动支持后续全部 0.2.x RC 版本,同代宿主升级无需重复等待发版。
58
60
  - `0.2.0-rc.1` 之前的早期宿主会被版本门拒绝,`0.3.0` 代际破坏性更新由版本门拦截。仍在使用 `0.1.x` 的用户请安装插件 `0.1.16`。
59
61
  - Node.js >= 22.19,PATH 中可执行 Git。
60
62
  - 当前会话关联本地 Git 项目。
@@ -68,7 +70,7 @@
68
70
  把下面这段话发给任意能够执行本机终端命令的 Agent。将 `web` 替换为实际使用的 profile;安装完成后,在 DSH 中使用本插件。
69
71
 
70
72
  ```text
71
- 请将 DSH 插件 @michengai/dsh-simplify 安装到本机 web profile,执行:dsh plugin --profile web add @michengai/dsh-simplify@1.0.1 --registry=https://registry.npmjs.org/。安装后执行 dsh --profile web --dump-config,确认配置包含 michengai-simplify,并告诉我如何重新加载 DSH 和开始使用。
73
+ 请将 DSH 插件 @michengai/dsh-simplify 安装到本机 web profile,执行:dsh plugin --profile web add @michengai/dsh-simplify@1.0.8 --registry=https://registry.npmjs.org/。安装后执行 dsh --profile web --dump-config,确认配置包含 michengai-simplify,并告诉我如何重新加载 DSH 和开始使用。
72
74
  ```
73
75
 
74
76
  ### 手动从 npm 安装
@@ -77,19 +79,19 @@
77
79
  [Console]::OutputEncoding = [System.Text.Encoding]::UTF8
78
80
  $OutputEncoding = [System.Text.Encoding]::UTF8
79
81
 
80
- dsh plugin --profile web add @michengai/dsh-simplify@1.0.1 --registry=https://registry.npmjs.org/
82
+ dsh plugin --profile web add @michengai/dsh-simplify@1.0.8 --registry=https://registry.npmjs.org/
81
83
  ```
82
84
 
83
85
  <details>
84
86
  <summary>从本地安装包安装</summary>
85
87
 
86
- 从 [GitHub Release](https://github.com/MichengAI/dsh-simplify/releases/tag/v1.0.1) 下载已发布的 tgz,然后在安装包所在目录执行:
88
+ 从 [GitHub Release](https://github.com/MichengAI/dsh-simplify/releases/tag/v1.0.8) 下载已发布的 tgz,然后在安装包所在目录执行:
87
89
 
88
90
  ```powershell
89
91
  [Console]::OutputEncoding = [System.Text.Encoding]::UTF8
90
92
  $OutputEncoding = [System.Text.Encoding]::UTF8
91
93
 
92
- dsh plugin --profile web add .\michengai-dsh-simplify-1.0.1.tgz --ignore-scripts
94
+ dsh plugin --profile web add .\michengai-dsh-simplify-1.0.8.tgz --ignore-scripts
93
95
  ```
94
96
 
95
97
  </details>
@@ -201,7 +203,7 @@ GitHub 与 npm 都包含可直接运行的 `lib`。改了源码后,提交前
201
203
 
202
204
  ### 验证
203
205
 
204
- 开发依赖固定为 DSH `0.2.1-rc.2`。`npm run test:compat` 在 `0.2.0-rc.1`、`0.2.0-rc.2`、`0.2.1-rc.1`、`0.2.1-rc.2`、`0.2.1-rc.3` 四个隔离宿主上重跑真实命令与 Git 测试。
206
+ 开发依赖对齐 DSH `0.2.2-rc.1`。`npm run test:compat` 在 `0.2.0-rc.1`、`0.2.0-rc.2`、`0.2.1-rc.1`~`0.2.1-rc.5`、`0.2.2-rc.1` 等各版本隔离宿主上重跑真实命令与 Git 测试。
205
207
 
206
208
  ```powershell
207
209
  [Console]::OutputEncoding = [System.Text.Encoding]::UTF8
package/lib/client.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export type SupportedLocale = 'zh' | 'en' | 'ja' | 'es' | 'fr' | 'de' | 'ru' | 'pt';
1
2
  type Lookup = {
2
3
  get?: (name: string) => unknown;
3
4
  };
package/lib/client.js CHANGED
@@ -1,4 +1,4 @@
1
1
  window.__ModuleLoader__.load({id:"@michengai/dsh-simplify",factory:(require)=>{var module={exports:{}};var exports=module.exports;
2
- "use strict";var u=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var k=Object.prototype.hasOwnProperty;var y=(n,o)=>{for(var e in o)u(n,e,{get:o[e],enumerable:!0})},g=(n,o,e,i)=>{if(o&&typeof o=="object"||typeof o=="function")for(let t of m(o))!k.call(n,t)&&t!==e&&u(n,t,{get:()=>o[t],enumerable:!(i=f(o,t))||i.enumerable});return n};var h=n=>g(u({},"__esModule",{value:!0}),n);var S={};y(S,{apply:()=>b});module.exports=h(S);var l=require("@deepseek-ai/dsh-client-ui-primitives"),s={icon:l.IconEnhanceOutlineRegular,zh:{label:"\u7B80\u5316",description:"\u7B80\u5316\u6700\u8FD1\u6539\u52A8\u7684\u4EE3\u7801\uFF0C\u4FDD\u6301\u529F\u80FD\u5E76\u9650\u5B9A\u4FEE\u6539\u8303\u56F4"},en:{label:"Simplify",description:"Simplify recent code changes, preserve behavior, and limit the edit scope."}};function v(n){let e=n.get?.("locale")?.snapshot?.active;return typeof e=="string"&&/^en(?:-|$)/i.test(e.replace(/_/g,"-"))}function w(n,o){let e=n,i=e?.candidates;return!e||typeof i!="function"?()=>{}:(e.candidates=async(...t)=>{let r=await i.apply(e,t);if(!Array.isArray(r))return r;let d=v(o);return r.map(a=>{if(!a||typeof a!="object"||!("name"in a)||typeof a.name!="string")return a;let c=a;if(c.name!=="simplify")return c;let p=d?s.en:s.zh;return{...c,...c.icon===void 0&&s.icon!==void 0?{icon:s.icon}:{},label:p.label,description:p.description}})},()=>{e.candidates=i})}function b(n){return n.effect?.(()=>w(n.get?.("commandUi"),n))}
2
+ "use strict";var s=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var b=Object.prototype.hasOwnProperty;var g=(e,t)=>{for(var i in t)s(e,i,{get:t[i],enumerable:!0})},h=(e,t,i,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of m(t))!b.call(e,o)&&o!==i&&s(e,o,{get:()=>t[o],enumerable:!(n=f(t,o))||n.enumerable});return e};var y=e=>h(s({},"__esModule",{value:!0}),e);var w={};g(w,{apply:()=>v});module.exports=y(w);var d=require("@deepseek-ai/dsh-client-ui-primitives"),l={icon:d.IconEnhanceOutlineRegular,zh:{label:"\u7B80\u5316",description:"\u7B80\u5316\u6700\u8FD1\u6539\u52A8\u7684\u4EE3\u7801\uFF0C\u4FDD\u6301\u529F\u80FD\u5E76\u9650\u5B9A\u4FEE\u6539\u8303\u56F4"},en:{label:"Simplify",description:"Simplify recent code changes, preserve behavior, and limit the edit scope."},ja:{label:"\u7C21\u7D20\u5316",description:"\u6700\u8FD1\u306E\u5909\u66F4\u30B3\u30FC\u30C9\u3092\u7C21\u7D20\u5316\u3057\u3001\u6A5F\u80FD\u3092\u7DAD\u6301\u3057\u306A\u304C\u3089\u5909\u66F4\u7BC4\u56F2\u3092\u9650\u5B9A"},es:{label:"Simplificar",description:"Simplifica los cambios recientes de c\xF3digo, preservando el comportamiento y limitando el alcance."},fr:{label:"Simplifier",description:"Simplifier les modifications r\xE9centes du code, pr\xE9server le comportement et limiter la port\xE9e."},de:{label:"Vereinfachen",description:"K\xFCrzliche Code\xE4nderungen vereinfachen, Verhalten beibehalten und Bearbeitungsbereich einschr\xE4nken."},ru:{label:"\u0423\u043F\u0440\u043E\u0441\u0442\u0438\u0442\u044C",description:"\u0423\u043F\u0440\u043E\u0441\u0442\u0438\u0442\u044C \u043D\u0435\u0434\u0430\u0432\u043D\u0438\u0435 \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F \u043A\u043E\u0434\u0430 \u0441 \u0441\u043E\u0445\u0440\u0430\u043D\u0435\u043D\u0438\u0435\u043C \u043F\u043E\u0432\u0435\u0434\u0435\u043D\u0438\u044F \u0438 \u043E\u0433\u0440\u0430\u043D\u0438\u0447\u0435\u043D\u0438\u0435\u043C \u043E\u0431\u043B\u0430\u0441\u0442\u0438 \u043F\u0440\u0430\u0432\u043E\u043A."},pt:{label:"Simplificar",description:"Simplificar altera\xE7\xF5es recentes de c\xF3digo, preservando o comportamento e limitando o escopo."}};function k(e){let i=e.get?.("locale")?.snapshot?.active;if(typeof i!="string")return"zh";let n=i.replace(/_/g,"-").toLowerCase();return/^zh\b/.test(n)?"zh":/^ja\b/.test(n)?"ja":/^es\b/.test(n)?"es":/^fr\b/.test(n)?"fr":/^de\b/.test(n)?"de":/^ru\b/.test(n)?"ru":/^pt\b/.test(n)?"pt":"en"}function S(e,t){let i=e,n=i?.candidates;return!i||typeof n!="function"?()=>{}:(i.candidates=async(...o)=>{let c=await n.apply(i,o);if(!Array.isArray(c))return c;let u=k(t),p=l[u];return c.map(r=>{if(!r||typeof r!="object"||!("name"in r)||typeof r.name!="string")return r;let a=r;return a.name!=="simplify"?a:{...a,...a.icon===void 0&&l.icon!==void 0?{icon:l.icon}:{},label:p.label,description:p.description}})},()=>{i.candidates=n})}function v(e){return e.effect?.(()=>S(e.get?.("commandUi"),e))}
3
3
  return module.exports;}});
4
4
  //# sourceMappingURL=client.js.map
package/lib/client.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/client.ts"],
4
- "sourcesContent": ["import { IconEnhanceOutlineRegular } from '@deepseek-ai/dsh-client-ui-primitives';\n\n/** Host `/` \u884C\u6CA1\u6709\u53EF\u672C\u5730\u5316\u7684\u8BF4\u660E\uFF1B\u540C\u540D\u8D21\u732E\u4F1A\u649E\u8F66\uFF0C\u53EA\u80FD\u5728\u6BCF\u6B21 candidates \u4E0A\u8986\u76D6 /simplify\u3002 */\nconst FACE = {\n icon: IconEnhanceOutlineRegular,\n zh: { label: '\u7B80\u5316', description: '\u7B80\u5316\u6700\u8FD1\u6539\u52A8\u7684\u4EE3\u7801\uFF0C\u4FDD\u6301\u529F\u80FD\u5E76\u9650\u5B9A\u4FEE\u6539\u8303\u56F4' },\n en: { label: 'Simplify', description: 'Simplify recent code changes, preserve behavior, and limit the edit scope.' },\n} as const;\n\ntype Lookup = { get?: (name: string) => unknown };\n\n/** en\u3001en-US\u3001en_US \u4E3A\u82F1\u6587\uFF1B\u4E0B\u5212\u7EBF\u5148\u6298\u6210\u8FDE\u5B57\u7B26\uFF0C\u518D\u6309 /^en(?:-|$)/i \u5224\u65AD\u3002 */\nfunction english(ctx: Lookup): boolean {\n const locale = ctx.get?.('locale') as { snapshot?: { active?: unknown } } | undefined;\n const active = locale?.snapshot?.active;\n return typeof active === 'string' && /^en(?:-|$)/i.test(active.replace(/_/g, '-'));\n}\n\nfunction decorateSlashFace(commandUi: unknown, ctx: Lookup): () => void {\n const live = commandUi as { candidates?: (...args: unknown[]) => unknown } | undefined;\n const original = live?.candidates;\n if (!live || typeof original !== 'function') return () => {};\n live.candidates = async (...args: unknown[]) => {\n const rows = await original.apply(live, args);\n if (!Array.isArray(rows)) return rows;\n const en = english(ctx);\n return rows.map((row: unknown) => {\n if (!row || typeof row !== 'object' || !('name' in row) || typeof (row as { name: unknown }).name !== 'string') return row;\n const item = row as { name: string; icon?: unknown };\n if (item.name !== 'simplify') return item;\n const copy = en ? FACE.en : FACE.zh;\n return {\n ...item,\n ...(item.icon === undefined && FACE.icon !== undefined ? { icon: FACE.icon } : {}),\n label: copy.label,\n description: copy.description,\n };\n });\n };\n return () => { live.candidates = original; };\n}\n\ninterface ClientScope extends Lookup {\n effect?(fn: () => () => void): unknown;\n}\n\n/** \u7ED9\u5BBF\u4E3B `/simplify` \u8865\u5B98\u65B9\u56FE\u6807\uFF0C\u5E76\u6309\u5F53\u524D\u754C\u9762\u8BED\u8A00\u8986\u76D6\u6807\u9898\u548C\u8BF4\u660E\u3002\u5BA2\u6237\u7AEF\u95E8\u9762\u53EA\u66B4\u9732 effect\uFF0C\u4E0D\u66B4\u9732 inject\u3002 */\nexport function apply(ctx: ClientScope): unknown {\n return ctx.effect?.(() => decorateSlashFace(ctx.get?.('commandUi'), ctx));\n}\n"],
5
- "mappings": ";yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,WAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAA0C,iDAGpCC,EAAO,CACX,KAAM,4BACN,GAAI,CAAE,MAAO,eAAM,YAAa,gIAAwB,EACxD,GAAI,CAAE,MAAO,WAAY,YAAa,4EAA6E,CACrH,EAKA,SAASC,EAAQC,EAAsB,CAErC,IAAMC,EADSD,EAAI,MAAM,QAAQ,GACV,UAAU,OACjC,OAAO,OAAOC,GAAW,UAAY,cAAc,KAAKA,EAAO,QAAQ,KAAM,GAAG,CAAC,CACnF,CAEA,SAASC,EAAkBC,EAAoBH,EAAyB,CACtE,IAAMI,EAAOD,EACPE,EAAWD,GAAM,WACvB,MAAI,CAACA,GAAQ,OAAOC,GAAa,WAAmB,IAAM,CAAC,GAC3DD,EAAK,WAAa,SAAUE,IAAoB,CAC9C,IAAMC,EAAO,MAAMF,EAAS,MAAMD,EAAME,CAAI,EAC5C,GAAI,CAAC,MAAM,QAAQC,CAAI,EAAG,OAAOA,EACjC,IAAMC,EAAKT,EAAQC,CAAG,EACtB,OAAOO,EAAK,IAAKE,GAAiB,CAChC,GAAI,CAACA,GAAO,OAAOA,GAAQ,UAAY,EAAE,SAAUA,IAAQ,OAAQA,EAA0B,MAAS,SAAU,OAAOA,EACvH,IAAMC,EAAOD,EACb,GAAIC,EAAK,OAAS,WAAY,OAAOA,EACrC,IAAMC,EAAOH,EAAKV,EAAK,GAAKA,EAAK,GACjC,MAAO,CACL,GAAGY,EACH,GAAIA,EAAK,OAAS,QAAaZ,EAAK,OAAS,OAAY,CAAE,KAAMA,EAAK,IAAK,EAAI,CAAC,EAChF,MAAOa,EAAK,MACZ,YAAaA,EAAK,WACpB,CACF,CAAC,CACH,EACO,IAAM,CAAEP,EAAK,WAAaC,CAAU,EAC7C,CAOO,SAASV,EAAMK,EAA2B,CAC/C,OAAOA,EAAI,SAAS,IAAME,EAAkBF,EAAI,MAAM,WAAW,EAAGA,CAAG,CAAC,CAC1E",
6
- "names": ["client_exports", "__export", "apply", "__toCommonJS", "import_dsh_client_ui_primitives", "FACE", "english", "ctx", "active", "decorateSlashFace", "commandUi", "live", "original", "args", "rows", "en", "row", "item", "copy"]
4
+ "sourcesContent": ["import { IconEnhanceOutlineRegular } from '@deepseek-ai/dsh-client-ui-primitives';\n\nexport type SupportedLocale = 'zh' | 'en' | 'ja' | 'es' | 'fr' | 'de' | 'ru' | 'pt';\n\n/** Host `/` \u884C\u6CA1\u6709\u53EF\u672C\u5730\u5316\u7684\u8BF4\u660E\uFF1B\u540C\u540D\u8D21\u732E\u4F1A\u649E\u8F66\uFF0C\u53EA\u80FD\u5728\u6BCF\u6B21 candidates \u4E0A\u8986\u76D6 /simplify\u3002 */\nconst FACE: {\n icon: typeof IconEnhanceOutlineRegular;\n} & Record<SupportedLocale, { label: string; description: string }> = {\n icon: IconEnhanceOutlineRegular,\n zh: { label: '\u7B80\u5316', description: '\u7B80\u5316\u6700\u8FD1\u6539\u52A8\u7684\u4EE3\u7801\uFF0C\u4FDD\u6301\u529F\u80FD\u5E76\u9650\u5B9A\u4FEE\u6539\u8303\u56F4' },\n en: { label: 'Simplify', description: 'Simplify recent code changes, preserve behavior, and limit the edit scope.' },\n ja: { label: '\u7C21\u7D20\u5316', description: '\u6700\u8FD1\u306E\u5909\u66F4\u30B3\u30FC\u30C9\u3092\u7C21\u7D20\u5316\u3057\u3001\u6A5F\u80FD\u3092\u7DAD\u6301\u3057\u306A\u304C\u3089\u5909\u66F4\u7BC4\u56F2\u3092\u9650\u5B9A' },\n es: { label: 'Simplificar', description: 'Simplifica los cambios recientes de c\u00F3digo, preservando el comportamiento y limitando el alcance.' },\n fr: { label: 'Simplifier', description: 'Simplifier les modifications r\u00E9centes du code, pr\u00E9server le comportement et limiter la port\u00E9e.' },\n de: { label: 'Vereinfachen', description: 'K\u00FCrzliche Code\u00E4nderungen vereinfachen, Verhalten beibehalten und Bearbeitungsbereich einschr\u00E4nken.' },\n ru: { label: '\u0423\u043F\u0440\u043E\u0441\u0442\u0438\u0442\u044C', description: '\u0423\u043F\u0440\u043E\u0441\u0442\u0438\u0442\u044C \u043D\u0435\u0434\u0430\u0432\u043D\u0438\u0435 \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F \u043A\u043E\u0434\u0430 \u0441 \u0441\u043E\u0445\u0440\u0430\u043D\u0435\u043D\u0438\u0435\u043C \u043F\u043E\u0432\u0435\u0434\u0435\u043D\u0438\u044F \u0438 \u043E\u0433\u0440\u0430\u043D\u0438\u0447\u0435\u043D\u0438\u0435\u043C \u043E\u0431\u043B\u0430\u0441\u0442\u0438 \u043F\u0440\u0430\u0432\u043E\u043A.' },\n pt: { label: 'Simplificar', description: 'Simplificar altera\u00E7\u00F5es recentes de c\u00F3digo, preservando o comportamento e limitando o escopo.' },\n};\n\ntype Lookup = { get?: (name: string) => unknown };\n\n/** \u8BC6\u522B\u5BBF\u4E3B\u754C\u9762\u5F53\u524D\u751F\u6548\u7684\u8BED\u8A00\uFF1B\u672A\u6307\u5B9A\u9ED8\u8BA4\u4E2D\u6587\uFF0C\u975E\u4E2D\u6587\u672A\u77E5\u8BED\u79CD\u56DE\u843D\u82F1\u6587\u3002 */\nfunction resolveLocale(ctx: Lookup): SupportedLocale {\n const locale = ctx.get?.('locale') as { snapshot?: { active?: unknown } } | undefined;\n const active = locale?.snapshot?.active;\n if (typeof active !== 'string') return 'zh';\n const tag = active.replace(/_/g, '-').toLowerCase();\n if (/^zh\\b/.test(tag)) return 'zh';\n if (/^ja\\b/.test(tag)) return 'ja';\n if (/^es\\b/.test(tag)) return 'es';\n if (/^fr\\b/.test(tag)) return 'fr';\n if (/^de\\b/.test(tag)) return 'de';\n if (/^ru\\b/.test(tag)) return 'ru';\n if (/^pt\\b/.test(tag)) return 'pt';\n return 'en';\n}\n\nfunction decorateSlashFace(commandUi: unknown, ctx: Lookup): () => void {\n const live = commandUi as { candidates?: (...args: unknown[]) => unknown } | undefined;\n const original = live?.candidates;\n if (!live || typeof original !== 'function') return () => {};\n live.candidates = async (...args: unknown[]) => {\n const rows = await original.apply(live, args);\n if (!Array.isArray(rows)) return rows;\n const lang = resolveLocale(ctx);\n const copy = FACE[lang];\n return rows.map((row: unknown) => {\n if (!row || typeof row !== 'object' || !('name' in row) || typeof (row as { name: unknown }).name !== 'string') return row;\n const item = row as { name: string; icon?: unknown };\n if (item.name !== 'simplify') return item;\n return {\n ...item,\n ...(item.icon === undefined && FACE.icon !== undefined ? { icon: FACE.icon } : {}),\n label: copy.label,\n description: copy.description,\n };\n });\n };\n return () => { live.candidates = original; };\n}\n\ninterface ClientScope extends Lookup {\n effect?(fn: () => () => void): unknown;\n}\n\n/** \u7ED9\u5BBF\u4E3B `/simplify` \u8865\u5B98\u65B9\u56FE\u6807\uFF0C\u5E76\u6309\u5F53\u524D\u754C\u9762\u8BED\u8A00\u8986\u76D6\u6807\u9898\u548C\u8BF4\u660E\u3002\u5BA2\u6237\u7AEF\u95E8\u9762\u53EA\u66B4\u9732 effect\uFF0C\u4E0D\u66B4\u9732 inject\u3002 */\nexport function apply(ctx: ClientScope): unknown {\n return ctx.effect?.(() => decorateSlashFace(ctx.get?.('commandUi'), ctx));\n}\n"],
5
+ "mappings": ";yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,WAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAA0C,iDAKpCC,EAEgE,CACpE,KAAM,4BACN,GAAI,CAAE,MAAO,eAAM,YAAa,gIAAwB,EACxD,GAAI,CAAE,MAAO,WAAY,YAAa,4EAA6E,EACnH,GAAI,CAAE,MAAO,qBAAO,YAAa,sLAAiC,EAClE,GAAI,CAAE,MAAO,cAAe,YAAa,sGAAoG,EAC7I,GAAI,CAAE,MAAO,aAAc,YAAa,yGAAiG,EACzI,GAAI,CAAE,MAAO,eAAgB,YAAa,6GAAqG,EAC/I,GAAI,CAAE,MAAO,yDAAa,YAAa,2dAA2F,EAClI,GAAI,CAAE,MAAO,cAAe,YAAa,uGAA+F,CAC1I,EAKA,SAASC,EAAcC,EAA8B,CAEnD,IAAMC,EADSD,EAAI,MAAM,QAAQ,GACV,UAAU,OACjC,GAAI,OAAOC,GAAW,SAAU,MAAO,KACvC,IAAMC,EAAMD,EAAO,QAAQ,KAAM,GAAG,EAAE,YAAY,EAClD,MAAI,QAAQ,KAAKC,CAAG,EAAU,KAC1B,QAAQ,KAAKA,CAAG,EAAU,KAC1B,QAAQ,KAAKA,CAAG,EAAU,KAC1B,QAAQ,KAAKA,CAAG,EAAU,KAC1B,QAAQ,KAAKA,CAAG,EAAU,KAC1B,QAAQ,KAAKA,CAAG,EAAU,KAC1B,QAAQ,KAAKA,CAAG,EAAU,KACvB,IACT,CAEA,SAASC,EAAkBC,EAAoBJ,EAAyB,CACtE,IAAMK,EAAOD,EACPE,EAAWD,GAAM,WACvB,MAAI,CAACA,GAAQ,OAAOC,GAAa,WAAmB,IAAM,CAAC,GAC3DD,EAAK,WAAa,SAAUE,IAAoB,CAC9C,IAAMC,EAAO,MAAMF,EAAS,MAAMD,EAAME,CAAI,EAC5C,GAAI,CAAC,MAAM,QAAQC,CAAI,EAAG,OAAOA,EACjC,IAAMC,EAAOV,EAAcC,CAAG,EACxBU,EAAOZ,EAAKW,CAAI,EACtB,OAAOD,EAAK,IAAKG,GAAiB,CAChC,GAAI,CAACA,GAAO,OAAOA,GAAQ,UAAY,EAAE,SAAUA,IAAQ,OAAQA,EAA0B,MAAS,SAAU,OAAOA,EACvH,IAAMC,EAAOD,EACb,OAAIC,EAAK,OAAS,WAAmBA,EAC9B,CACL,GAAGA,EACH,GAAIA,EAAK,OAAS,QAAad,EAAK,OAAS,OAAY,CAAE,KAAMA,EAAK,IAAK,EAAI,CAAC,EAChF,MAAOY,EAAK,MACZ,YAAaA,EAAK,WACpB,CACF,CAAC,CACH,EACO,IAAM,CAAEL,EAAK,WAAaC,CAAU,EAC7C,CAOO,SAASX,EAAMK,EAA2B,CAC/C,OAAOA,EAAI,SAAS,IAAMG,EAAkBH,EAAI,MAAM,WAAW,EAAGA,CAAG,CAAC,CAC1E",
6
+ "names": ["client_exports", "__export", "apply", "__toCommonJS", "import_dsh_client_ui_primitives", "FACE", "resolveLocale", "ctx", "active", "tag", "decorateSlashFace", "commandUi", "live", "original", "args", "rows", "lang", "copy", "row", "item"]
7
7
  }
package/lib/index.js CHANGED
@@ -9,7 +9,7 @@ export function apply(ctx) {
9
9
  const unregister = ctx.commands.register({
10
10
  name: 'simplify',
11
11
  description: '简化最近改动的代码,保持功能并限定修改范围',
12
- input: { hint: '[--staged] [--ref=<ref>] [--] [文件或目录...]' },
12
+ input: { hint: '[--staged] [--ref=<ref>] [--] [<paths>...]' },
13
13
  handler: invocation => {
14
14
  const operation = handleCommand(ctx, invocation, lifetime.signal);
15
15
  active.add(operation);
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,MAAM,CAAC,MAAM,IAAI,GAAG,oBAAoB,CAAC;AACzC,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC;AAEjD,+CAA+C;AAC/C,MAAM,UAAU,KAAK,CAAC,GAAY;IAChC,GAAG,CAAC,MAAM,CAAC,GAAG,EAAE;QACd,MAAM,QAAQ,GAAG,IAAI,eAAe,EAAE,CAAC;QACvC,MAAM,MAAM,GAAG,IAAI,GAAG,EAA0B,CAAC;QACjD,MAAM,UAAU,GAAG,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC;YACvC,IAAI,EAAE,UAAU;YAChB,WAAW,EAAE,uBAAuB;YACpC,KAAK,EAAE,EAAE,IAAI,EAAE,0CAA0C,EAAE;YAC3D,OAAO,EAAE,UAAU,CAAC,EAAE;gBACpB,MAAM,SAAS,GAAG,aAAa,CAAC,GAAG,EAAE,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;gBAClE,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;gBACtB,KAAK,SAAS,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC;gBACpF,OAAO,SAAS,CAAC;YACnB,CAAC;SACF,CAAC,CAAC;QACH,OAAO,KAAK,IAAI,EAAE;YAChB,QAAQ,CAAC,KAAK,EAAE,CAAC;YACjB,UAAU,EAAE,CAAC;YACb,MAAM,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QACnC,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type { Context } from '@deepseek-ai/cordis';\nimport type { CommandResult } from '@deepseek-ai/dsh-commands';\nimport { handleCommand } from './command.js';\n\nexport const name = 'michengai-simplify';\nexport const inject = ['commands', 'subprocess'];\n\n/** 注册 /simplify;卸载时取消正在收集的范围,并等待其 Git 进程结束。 */\nexport function apply(ctx: Context): void {\n ctx.effect(() => {\n const lifetime = new AbortController();\n const active = new Set<Promise<CommandResult>>();\n const unregister = ctx.commands.register({\n name: 'simplify',\n description: '简化最近改动的代码,保持功能并限定修改范围',\n input: { hint: '[--staged] [--ref=<ref>] [--] [文件或目录...]' },\n handler: invocation => {\n const operation = handleCommand(ctx, invocation, lifetime.signal);\n active.add(operation);\n void operation.then(() => active.delete(operation), () => active.delete(operation));\n return operation;\n },\n });\n return async () => {\n lifetime.abort();\n unregister();\n await Promise.allSettled(active);\n };\n });\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,MAAM,CAAC,MAAM,IAAI,GAAG,oBAAoB,CAAC;AACzC,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC;AAEjD,+CAA+C;AAC/C,MAAM,UAAU,KAAK,CAAC,GAAY;IAChC,GAAG,CAAC,MAAM,CAAC,GAAG,EAAE;QACd,MAAM,QAAQ,GAAG,IAAI,eAAe,EAAE,CAAC;QACvC,MAAM,MAAM,GAAG,IAAI,GAAG,EAA0B,CAAC;QACjD,MAAM,UAAU,GAAG,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC;YACvC,IAAI,EAAE,UAAU;YAChB,WAAW,EAAE,uBAAuB;YACpC,KAAK,EAAE,EAAE,IAAI,EAAE,4CAA4C,EAAE;YAC7D,OAAO,EAAE,UAAU,CAAC,EAAE;gBACpB,MAAM,SAAS,GAAG,aAAa,CAAC,GAAG,EAAE,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;gBAClE,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;gBACtB,KAAK,SAAS,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC;gBACpF,OAAO,SAAS,CAAC;YACnB,CAAC;SACF,CAAC,CAAC;QACH,OAAO,KAAK,IAAI,EAAE;YAChB,QAAQ,CAAC,KAAK,EAAE,CAAC;YACjB,UAAU,EAAE,CAAC;YACb,MAAM,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QACnC,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type { Context } from '@deepseek-ai/cordis';\nimport type { CommandResult } from '@deepseek-ai/dsh-commands';\nimport { handleCommand } from './command.js';\n\nexport const name = 'michengai-simplify';\nexport const inject = ['commands', 'subprocess'];\n\n/** 注册 /simplify;卸载时取消正在收集的范围,并等待其 Git 进程结束。 */\nexport function apply(ctx: Context): void {\n ctx.effect(() => {\n const lifetime = new AbortController();\n const active = new Set<Promise<CommandResult>>();\n const unregister = ctx.commands.register({\n name: 'simplify',\n description: '简化最近改动的代码,保持功能并限定修改范围',\n input: { hint: '[--staged] [--ref=<ref>] [--] [<paths>...]' },\n handler: invocation => {\n const operation = handleCommand(ctx, invocation, lifetime.signal);\n active.add(operation);\n void operation.then(() => active.delete(operation), () => active.delete(operation));\n return operation;\n },\n });\n return async () => {\n lifetime.abort();\n unregister();\n await Promise.allSettled(active);\n };\n });\n}\n"]}
package/locale/de.json ADDED
@@ -0,0 +1,7 @@
1
+ {
2
+ "meta": {
3
+ "title": "Simplify",
4
+ "description": "Vereinfacht Code innerhalb des Git-Änderungsbereichs, unterstützt nicht nachverfolgte Dateien und plattformübergreifende Pfade.",
5
+ "detail": "README.de.md"
6
+ }
7
+ }
package/locale/en.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "meta": {
3
3
  "title": "Simplify",
4
- "description": "Simplify Git-scoped changes, including untracked files and cross-platform paths."
4
+ "description": "Simplify Git-scoped changes, including untracked files and cross-platform paths.",
5
+ "detail": "README.en.md"
5
6
  }
6
7
  }
package/locale/es.json ADDED
@@ -0,0 +1,7 @@
1
+ {
2
+ "meta": {
3
+ "title": "Simplify",
4
+ "description": "Simplifica los cambios acotados por Git, con compatibilidad para archivos no rastreados y rutas multiplataforma.",
5
+ "detail": "README.es.md"
6
+ }
7
+ }
package/locale/fr.json ADDED
@@ -0,0 +1,7 @@
1
+ {
2
+ "meta": {
3
+ "title": "Simplify",
4
+ "description": "Simplifie le code dans le périmètre des modifications Git, avec prise en charge des fichiers non suivis et des chemins multiplateformes.",
5
+ "detail": "README.fr.md"
6
+ }
7
+ }
package/locale/ja.json ADDED
@@ -0,0 +1,7 @@
1
+ {
2
+ "meta": {
3
+ "title": "Simplify",
4
+ "description": "Git 変更範囲内でコードを簡素化し、未追跡ファイルやクロスプラットフォームパスに対応。",
5
+ "detail": "README.ja.md"
6
+ }
7
+ }
package/locale/pt.json ADDED
@@ -0,0 +1,7 @@
1
+ {
2
+ "meta": {
3
+ "title": "Simplify",
4
+ "description": "Simplifica o código no escopo de alterações do Git, com suporte a arquivos não rastreados e caminhos multiplataforma.",
5
+ "detail": "README.pt.md"
6
+ }
7
+ }
package/locale/ru.json ADDED
@@ -0,0 +1,7 @@
1
+ {
2
+ "meta": {
3
+ "title": "Simplify",
4
+ "description": "Упрощение кода в пределах изменений Git с поддержкой неотслеживаемых файлов и кроссплатформенных путей.",
5
+ "detail": "README.ru.md"
6
+ }
7
+ }
package/locale/zh.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "meta": {
3
3
  "title": "Simplify",
4
- "description": "在 Git 变更范围内简化代码,支持未跟踪文件和跨平台路径。"
4
+ "description": "在 Git 变更范围内简化代码,支持未跟踪文件和跨平台路径。",
5
+ "detail": "README.zh-CN.md"
5
6
  }
6
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@michengai/dsh-simplify",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "description": "DSH Simplify — 为 DeepSeek Harness 提供限定 Git 变更范围的代码简化,支持未跟踪文件、跨平台路径与可靠的 Git 异常处理 · Git-scoped code simplification with untracked-file support, cross-platform paths, and reliable Git error handling for DeepSeek Harness",
5
5
  "repository": {
6
6
  "type": "git",
@@ -10,6 +10,19 @@
10
10
  "bugs": {
11
11
  "url": "https://github.com/MichengAI/dsh-simplify/issues"
12
12
  },
13
+ "author": {
14
+ "name": "MichengAI",
15
+ "url": "https://github.com/MichengAI"
16
+ },
17
+ "keywords": [
18
+ "dsh",
19
+ "deepseek-harness",
20
+ "simplify",
21
+ "git",
22
+ "code-review",
23
+ "refactoring"
24
+ ],
25
+ "icon": "./assets/icon.svg",
13
26
  "type": "module",
14
27
  "license": "Apache-2.0",
15
28
  "engines": {
@@ -27,6 +40,7 @@
27
40
  "default": "./lib/client.js"
28
41
  },
29
42
  "./package.json": "./package.json",
43
+ "./icon": "./assets/icon.svg",
30
44
  "./locale/*.json": "./locale/*.json"
31
45
  },
32
46
  "files": [
@@ -35,13 +49,21 @@
35
49
  "assets/branding/dsh-simplify-banner.png",
36
50
  "cordis.patch.yml",
37
51
  "README.md",
52
+ "README.en.md",
38
53
  "README.zh-CN.md",
54
+ "README.ja.md",
55
+ "README.es.md",
56
+ "README.fr.md",
57
+ "README.de.md",
58
+ "README.ru.md",
59
+ "README.pt.md",
39
60
  "LICENSE",
40
61
  "CHANGELOG.md",
41
62
  "CHANGELOG.zh-CN.md",
42
63
  "assets/icon.svg"
43
64
  ],
44
65
  "dsh": {
66
+ "manifestVersion": 1,
45
67
  "bundle": {
46
68
  "patch": "./cordis.patch.yml"
47
69
  },
@@ -82,17 +104,48 @@
82
104
  }
83
105
  },
84
106
  "devDependencies": {
85
- "@deepseek-ai/cordis": "4.0.5",
86
- "@deepseek-ai/dsh-client-ui-commands": "0.2.1-rc.3",
87
- "@deepseek-ai/dsh-client-ui-primitives": "0.2.1-rc.3",
88
- "@deepseek-ai/dsh-commands": "0.2.1-rc.3",
89
- "@deepseek-ai/dsh-llm": "0.2.1-rc.3",
90
- "@deepseek-ai/dsh-subprocess": "0.2.1-rc.3",
91
- "@deepseek-ai/dsh-subprocess-local": "0.2.1-rc.3",
107
+ "@deepseek-ai/cordis": "4.1.0",
108
+ "@deepseek-ai/dsh-client-ui-commands": "0.2.2-rc.1",
109
+ "@deepseek-ai/dsh-client-ui-primitives": "0.2.2-rc.1",
110
+ "@deepseek-ai/dsh-commands": "0.2.2-rc.1",
111
+ "@deepseek-ai/dsh-llm": "0.2.2-rc.1",
112
+ "@deepseek-ai/dsh-subprocess": "0.2.2-rc.1",
113
+ "@deepseek-ai/dsh-subprocess-local": "0.2.2-rc.1",
92
114
  "@types/node": "^22.19.0",
93
115
  "esbuild": "^0.25.0",
94
116
  "typescript": "~5.7.2",
95
- "semver": "^7.7.3"
96
- },
97
- "icon": "assets/icon.svg"
117
+ "semver": "^7.7.3",
118
+ "@deepseek-ai/dsh-attachment": "0.2.2-rc.1",
119
+ "@deepseek-ai/dsh-scope": "0.2.2-rc.1",
120
+ "@deepseek-ai/dsh-agent": "0.2.2-rc.1",
121
+ "@deepseek-ai/dsh-agent-loop": "0.2.2-rc.1",
122
+ "@deepseek-ai/dsh-session": "0.2.2-rc.1",
123
+ "@deepseek-ai/dsh-session-persistence": "0.2.2-rc.1",
124
+ "@deepseek-ai/dsh-session-projection": "0.2.2-rc.1",
125
+ "@deepseek-ai/dsh-settings": "0.2.2-rc.1",
126
+ "@deepseek-ai/dsh-subagent": "0.2.2-rc.1",
127
+ "@deepseek-ai/dsh-subagent-spawn-in-process": "0.2.2-rc.1",
128
+ "@deepseek-ai/dsh-system-prompt": "0.2.2-rc.1",
129
+ "@deepseek-ai/dsh-tools": "0.2.2-rc.1",
130
+ "@deepseek-ai/dsh-user-approval": "0.2.2-rc.1",
131
+ "@deepseek-ai/dsh-user-questions": "0.2.2-rc.1",
132
+ "@deepseek-ai/dsh-api-gateway": "0.2.2-rc.1",
133
+ "@deepseek-ai/dsh-api-session-controller": "0.2.2-rc.1",
134
+ "@deepseek-ai/dsh-client-connection": "0.2.2-rc.1",
135
+ "@deepseek-ai/dsh-client-locale": "0.2.2-rc.1",
136
+ "@deepseek-ai/dsh-client-ui-chat": "0.2.2-rc.1",
137
+ "@deepseek-ai/dsh-client-ui-conversation": "0.2.2-rc.1",
138
+ "@deepseek-ai/dsh-client-ui-input-trigger": "0.2.2-rc.1",
139
+ "@deepseek-ai/dsh-client-ui-renderer": "0.2.2-rc.1",
140
+ "@deepseek-ai/dsh-client-ui-slots": "0.2.2-rc.1",
141
+ "@deepseek-ai/dsh-client-ui-theme": "0.2.2-rc.1",
142
+ "@deepseek-ai/dsh-ptc-runtime": "0.2.2-rc.1",
143
+ "@deepseek-ai/dsh-sandbox": "0.2.2-rc.1",
144
+ "@deepseek-ai/dsh-sandbox-policy": "0.2.2-rc.1",
145
+ "@deepseek-ai/dsh-subagent-fork-in-process": "0.2.2-rc.1",
146
+ "@deepseek-ai/dsh-typert-protocol": "0.2.2-rc.1",
147
+ "@deepseek-ai/dsh-typert-registry": "0.2.2-rc.1",
148
+ "@deepseek-ai/dsh-util-time": "0.2.2-rc.1",
149
+ "@deepseek-ai/dsh-http-proxy": "0.2.2-rc.1"
150
+ }
98
151
  }