@michengai/dsh-simplify 0.1.16 → 1.0.1
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/CHANGELOG.md +11 -0
- package/CHANGELOG.zh-CN.md +11 -0
- package/README.md +9 -8
- package/README.zh-CN.md +9 -8
- package/lib/client.d.ts +1 -2
- package/lib/client.js +1 -1
- package/lib/client.js.map +3 -3
- package/lib/command.d.ts +1 -1
- package/lib/command.js.map +1 -1
- package/package.json +14 -14
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,17 @@
|
|
|
4
4
|
|
|
5
5
|
## Unreleased
|
|
6
6
|
|
|
7
|
+
## 1.0.1 - 2026-10-17
|
|
8
|
+
|
|
9
|
+
- Support DeepSeek Harness `0.2.1-rc.2`. Supported hosts are `0.2.0-rc.1`, `0.2.0-rc.2`, `0.2.1-rc.1`, and `0.2.1-rc.2`.
|
|
10
|
+
- Hosts before `0.2.0`, and `0.2.1-alpha.1` through `0.2.1-alpha.5`, are still rejected by the version gate. The plugin stays installed but does not run; saved configuration is kept. If you still use a `0.1.x` host, install plugin `0.1.16` instead of `@latest`.
|
|
11
|
+
|
|
12
|
+
## 1.0.0 - 2026-10-17
|
|
13
|
+
|
|
14
|
+
- Plugin version starts at `1.0.0`. Supported hosts are DeepSeek Harness `0.2.0-rc.1`, `0.2.0-rc.2`, and `0.2.1-rc.1`.
|
|
15
|
+
- Hosts before `0.2.0`, and intermediate `0.2.1-alpha.1` through `0.2.1-alpha.5`, are rejected by the version gate. The plugin stays installed but does not run; saved configuration is kept. If you still use a `0.1.x` host, install plugin `0.1.16` instead of `@latest`.
|
|
16
|
+
- Slash-menu icon uses the host export `IconEnhanceOutlineRegular`. `IconEnhanceOutline16` is not present from `0.2.0-rc.1` onward.
|
|
17
|
+
|
|
7
18
|
## 0.1.16 - 2026-10-15
|
|
8
19
|
|
|
9
20
|
- Support DSH `0.2.1-alpha.3` while retaining all existing supported versions; pin development `@deepseek-ai/dsh*` dependencies to host `0.2.1-alpha.3` and Cordis to `4.0.5-alpha.2`.
|
package/CHANGELOG.zh-CN.md
CHANGED
|
@@ -4,6 +4,17 @@
|
|
|
4
4
|
|
|
5
5
|
## 未发布
|
|
6
6
|
|
|
7
|
+
## 1.0.1 - 2026-10-17
|
|
8
|
+
|
|
9
|
+
- 支持 DeepSeek Harness `0.2.1-rc.2`。支持的宿主为 `0.2.0-rc.1`、`0.2.0-rc.2`、`0.2.1-rc.1`、`0.2.1-rc.2`。
|
|
10
|
+
- `0.2.0` 之前的宿主,以及 `0.2.1-alpha.1` 至 `0.2.1-alpha.5`,仍会被版本门拒绝。插件留在已安装列表里,但不会运行;已保存的配置仍保留。仍在使用 `0.1.x` 的,请安装插件 `0.1.16`,不要装 `@latest`。
|
|
11
|
+
|
|
12
|
+
## 1.0.0 - 2026-10-17
|
|
13
|
+
|
|
14
|
+
- 插件版本从 `1.0.0` 起计。支持的宿主为 DeepSeek Harness `0.2.0-rc.1`、`0.2.0-rc.2`、`0.2.1-rc.1`。
|
|
15
|
+
- 不再支持 `0.2.0` 之前的宿主,也不再支持中间的 `0.2.1-alpha.1` 至 `0.2.1-alpha.5`。这些宿主启动时会被版本门拒绝,插件不会运行;已保存的配置仍保留。仍在使用 `0.1.x` 的,请安装插件 `0.1.16`,不要装 `@latest`。
|
|
16
|
+
- 斜杠菜单图标改用宿主导出的 `IconEnhanceOutlineRegular`。`0.2.0-rc.1` 起已没有 `IconEnhanceOutline16`。
|
|
17
|
+
|
|
7
18
|
## 0.1.16 - 2026-10-15
|
|
8
19
|
|
|
9
20
|
- 支持 DSH `0.2.1-alpha.3`,继续兼容既有已支持版本;开发依赖对齐宿主 `0.2.1-alpha.3`(含 Cordis `4.0.5-alpha.2`)。
|
package/README.md
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
[](LICENSE)
|
|
14
14
|
[](https://www.npmjs.com/package/@michengai/dsh-simplify)
|
|
15
15
|
[](https://github.com/deepseek-ai/deepseek-harness)
|
|
16
|
+
[](#installation)
|
|
16
17
|
[](https://nodejs.org/)
|
|
17
18
|
|
|
18
19
|
</div>
|
|
@@ -53,21 +54,21 @@ For a desktop workbench, download [DSH Codex Desktop](https://github.com/Micheng
|
|
|
53
54
|
|
|
54
55
|
## Prerequisites
|
|
55
56
|
|
|
56
|
-
- DeepSeek Harness is installed, `dsh` is available in your terminal, and the host provides the `commands` and `subprocess` services.
|
|
57
|
-
-
|
|
57
|
+
- DeepSeek Harness `0.2.0-rc.1`, `0.2.0-rc.2`, `0.2.1-rc.1`, or `0.2.1-rc.2` is installed, `dsh` is available in your terminal, and the host provides the `commands` and `subprocess` services.
|
|
58
|
+
- Hosts before `0.2.0`, and intermediate `0.2.1-alpha.1` through `0.2.1-alpha.5`, are rejected by the version gate. The plugin stays installed but does not run; saved configuration is kept. If you still use a `0.1.x` host, install plugin `0.1.16` instead of `@latest`.
|
|
58
59
|
- Node.js >= 22.19 and Git on PATH.
|
|
59
60
|
- The current session is associated with a local Git project.
|
|
60
61
|
|
|
61
62
|
## Installation
|
|
62
63
|
|
|
63
|
-
The current version is `0.1
|
|
64
|
+
The current version is `1.0.1`. The commands below use the `web` profile; replace it for your environment. Disable other plugins that register `/simplify` before installation. `1.0.1` runs on DeepSeek Harness `0.2.0-rc.1`, `0.2.0-rc.2`, `0.2.1-rc.1`, and `0.2.1-rc.2`.
|
|
64
65
|
|
|
65
66
|
### Ask an agent to install it (recommended)
|
|
66
67
|
|
|
67
68
|
Send the prompt below to any agent that can run terminal commands on your computer. Replace `web` with your actual profile. Once installed, use the plugin in DSH.
|
|
68
69
|
|
|
69
70
|
```text
|
|
70
|
-
Install the DSH plugin @michengai/dsh-simplify into my local web profile by running: dsh plugin --profile web add @michengai/dsh-simplify@0.1
|
|
71
|
+
Install the DSH plugin @michengai/dsh-simplify into my local web profile by running: dsh plugin --profile web add @michengai/dsh-simplify@1.0.1 --registry=https://registry.npmjs.org/. Then run dsh --profile web --dump-config, confirm the configuration includes michengai-simplify, and explain how to reload DSH and start using the plugin.
|
|
71
72
|
```
|
|
72
73
|
|
|
73
74
|
### Install from npm
|
|
@@ -76,19 +77,19 @@ Install the DSH plugin @michengai/dsh-simplify into my local web profile by runn
|
|
|
76
77
|
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
|
|
77
78
|
$OutputEncoding = [System.Text.Encoding]::UTF8
|
|
78
79
|
|
|
79
|
-
dsh plugin --profile web add @michengai/dsh-simplify@0.1
|
|
80
|
+
dsh plugin --profile web add @michengai/dsh-simplify@1.0.1 --registry=https://registry.npmjs.org/
|
|
80
81
|
```
|
|
81
82
|
|
|
82
83
|
<details>
|
|
83
84
|
<summary>Install from a local package</summary>
|
|
84
85
|
|
|
85
|
-
Download the published tgz from the [GitHub Release](https://github.com/MichengAI/dsh-simplify/releases/tag/
|
|
86
|
+
Download the published tgz from the [GitHub Release](https://github.com/MichengAI/dsh-simplify/releases/tag/v1.0.1), then run this from the package directory:
|
|
86
87
|
|
|
87
88
|
```powershell
|
|
88
89
|
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
|
|
89
90
|
$OutputEncoding = [System.Text.Encoding]::UTF8
|
|
90
91
|
|
|
91
|
-
dsh plugin --profile web add .\michengai-dsh-simplify-0.1.
|
|
92
|
+
dsh plugin --profile web add .\michengai-dsh-simplify-1.0.1.tgz --ignore-scripts
|
|
92
93
|
```
|
|
93
94
|
|
|
94
95
|
</details>
|
|
@@ -200,7 +201,7 @@ GitHub and npm both include a ready-to-run `lib`. After changing source, run `np
|
|
|
200
201
|
|
|
201
202
|
### Verification
|
|
202
203
|
|
|
203
|
-
Development dependencies are pinned to DSH `0.2.
|
|
204
|
+
Development dependencies are pinned to DSH `0.2.1-rc.2`. `npm run test:compat` reruns the real command and Git tests on `0.2.0-rc.1`, `0.2.0-rc.2`, `0.2.1-rc.1`, and `0.2.1-rc.2`.
|
|
204
205
|
|
|
205
206
|
```powershell
|
|
206
207
|
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
|
package/README.zh-CN.md
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
[](LICENSE)
|
|
14
14
|
[](https://www.npmjs.com/package/@michengai/dsh-simplify)
|
|
15
15
|
[](https://github.com/deepseek-ai/deepseek-harness)
|
|
16
|
+
[](#安装)
|
|
16
17
|
[](https://nodejs.org/)
|
|
17
18
|
|
|
18
19
|
</div>
|
|
@@ -53,21 +54,21 @@
|
|
|
53
54
|
|
|
54
55
|
## 前置条件
|
|
55
56
|
|
|
56
|
-
- 已安装 DeepSeek Harness
|
|
57
|
-
-
|
|
57
|
+
- 已安装 DeepSeek Harness `0.2.0-rc.1`、`0.2.0-rc.2`、`0.2.1-rc.1` 或 `0.2.1-rc.2`,可在终端执行 `dsh`,宿主提供 `commands` 和 `subprocess` 服务。
|
|
58
|
+
- `0.2.0` 之前的宿主,以及中间的 `0.2.1-alpha.1` 至 `0.2.1-alpha.5`,会被版本门拒绝。插件仍留在已安装列表里,但不会运行;已保存的配置会保留。仍在使用 `0.1.x` 的,请安装插件 `0.1.16`,不要装 `@latest`。
|
|
58
59
|
- Node.js >= 22.19,PATH 中可执行 Git。
|
|
59
60
|
- 当前会话关联本地 Git 项目。
|
|
60
61
|
|
|
61
62
|
## 安装
|
|
62
63
|
|
|
63
|
-
当前版本为 `0.1
|
|
64
|
+
当前版本为 `1.0.1`。以下命令使用 `web` profile,请按实际环境替换。安装前停用其他注册 `/simplify` 的插件。`1.0.1` 可在 DeepSeek Harness `0.2.0-rc.1`、`0.2.0-rc.2`、`0.2.1-rc.1`、`0.2.1-rc.2` 上运行。
|
|
64
65
|
|
|
65
66
|
### 让 Agent 帮你安装(推荐)
|
|
66
67
|
|
|
67
68
|
把下面这段话发给任意能够执行本机终端命令的 Agent。将 `web` 替换为实际使用的 profile;安装完成后,在 DSH 中使用本插件。
|
|
68
69
|
|
|
69
70
|
```text
|
|
70
|
-
请将 DSH 插件 @michengai/dsh-simplify 安装到本机 web profile,执行:dsh plugin --profile web add @michengai/dsh-simplify@0.1
|
|
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 和开始使用。
|
|
71
72
|
```
|
|
72
73
|
|
|
73
74
|
### 手动从 npm 安装
|
|
@@ -76,19 +77,19 @@
|
|
|
76
77
|
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
|
|
77
78
|
$OutputEncoding = [System.Text.Encoding]::UTF8
|
|
78
79
|
|
|
79
|
-
dsh plugin --profile web add @michengai/dsh-simplify@0.1
|
|
80
|
+
dsh plugin --profile web add @michengai/dsh-simplify@1.0.1 --registry=https://registry.npmjs.org/
|
|
80
81
|
```
|
|
81
82
|
|
|
82
83
|
<details>
|
|
83
84
|
<summary>从本地安装包安装</summary>
|
|
84
85
|
|
|
85
|
-
从 [GitHub Release](https://github.com/MichengAI/dsh-simplify/releases/tag/
|
|
86
|
+
从 [GitHub Release](https://github.com/MichengAI/dsh-simplify/releases/tag/v1.0.1) 下载已发布的 tgz,然后在安装包所在目录执行:
|
|
86
87
|
|
|
87
88
|
```powershell
|
|
88
89
|
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
|
|
89
90
|
$OutputEncoding = [System.Text.Encoding]::UTF8
|
|
90
91
|
|
|
91
|
-
dsh plugin --profile web add .\michengai-dsh-simplify-0.1.
|
|
92
|
+
dsh plugin --profile web add .\michengai-dsh-simplify-1.0.1.tgz --ignore-scripts
|
|
92
93
|
```
|
|
93
94
|
|
|
94
95
|
</details>
|
|
@@ -200,7 +201,7 @@ GitHub 与 npm 都包含可直接运行的 `lib`。改了源码后,提交前
|
|
|
200
201
|
|
|
201
202
|
### 验证
|
|
202
203
|
|
|
203
|
-
开发依赖固定为 DSH `0.2.
|
|
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` 四个隔离宿主上重跑真实命令与 Git 测试。
|
|
204
205
|
|
|
205
206
|
```powershell
|
|
206
207
|
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
|
package/lib/client.d.ts
CHANGED
|
@@ -2,9 +2,8 @@ type Lookup = {
|
|
|
2
2
|
get?: (name: string) => unknown;
|
|
3
3
|
};
|
|
4
4
|
interface ClientScope extends Lookup {
|
|
5
|
-
inject?(deps: string[], callback: (scope: Lookup) => () => void): unknown;
|
|
6
5
|
effect?(fn: () => () => void): unknown;
|
|
7
6
|
}
|
|
8
|
-
/** 给宿主 `/simplify`
|
|
7
|
+
/** 给宿主 `/simplify` 补官方图标,并按当前界面语言覆盖标题和说明。客户端门面只暴露 effect,不暴露 inject。 */
|
|
9
8
|
export declare function apply(ctx: ClientScope): unknown;
|
|
10
9
|
export {};
|
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
|
|
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))}
|
|
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
|
|
5
|
-
"mappings": ";
|
|
6
|
-
"names": ["client_exports", "__export", "apply", "__toCommonJS", "
|
|
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,I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
|
|
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"]
|
|
7
7
|
}
|
package/lib/command.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { Context } from '@deepseek-ai/cordis';
|
|
|
2
2
|
import type { CommandInvocation, CommandResult } from '@deepseek-ai/dsh-commands';
|
|
3
3
|
declare module '@deepseek-ai/dsh-llm' {
|
|
4
4
|
interface MessageSourceMap {
|
|
5
|
-
/**
|
|
5
|
+
/** 宿主没有共享的 `plugin` kind,生产者必须声明自己的 kind 才能入队。 */
|
|
6
6
|
'michengai-simplify': {
|
|
7
7
|
readonly kind: 'michengai-simplify';
|
|
8
8
|
};
|
package/lib/command.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command.js","sourceRoot":"","sources":["../src/command.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAS1C,0CAA0C;AAC1C,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,GAAgC,EAAE,UAA6B,EAAE,QAAsB;IACzH,MAAM,QAAQ,GAAG,IAAI,eAAe,EAAE,CAAC;IACvC,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,KAAK,EAAE,EAAE,MAAM,CAAC,CAAC;IACzD,MAAM,MAAM,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC,UAAU,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ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jD,UAAU,CAAC,KAAK,CAAC,QAAQ,CAAC,iBAAiB,CAAC;YAC1C,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;YACzC,MAAM,EAAE,EAAE,IAAI,EAAE,oBAAoB,EAAE;SACvC,CAAC,CAAC,CAAC;QACJ,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,MAAM,CAAC,KAAK,CAAC,MAAM,YAAY,MAAM,CAAC,MAAM,KAAK,iBAAiB,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,MAAM,CAAC,OAAO,CAAC,MAAM,WAAW,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC;IAC1M,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,GAAG,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,yBAAyB;YAC9D,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU;gBAC7B,CAAC,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC3D,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IACjC,CAAC;YAAS,CAAC;QAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IAAC,CAAC;AACpC,CAAC","sourcesContent":["import type { Context } from '@deepseek-ai/cordis';\nimport type { CommandInvocation, CommandResult } from '@deepseek-ai/dsh-commands';\nimport { createUserMessage } from '@deepseek-ai/dsh-llm';\nimport { parseArgs } from './args.js';\nimport { createGitRunner } from './exec.js';\nimport { collectReview, verifyReview } from './git.js';\nimport { buildPrompt } from './prompt.js';\n\ndeclare module '@deepseek-ai/dsh-llm' {\n interface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E,CAAC;IAC1M,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,GAAG,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,yBAAyB;YAC9D,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU;gBAC7B,CAAC,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC3D,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IACjC,CAAC;YAAS,CAAC;QAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IAAC,CAAC;AACpC,CAAC","sourcesContent":["import type { Context } from '@deepseek-ai/cordis';\nimport type { CommandInvocation, CommandResult } from '@deepseek-ai/dsh-commands';\nimport { createUserMessage } from '@deepseek-ai/dsh-llm';\nimport { parseArgs } from './args.js';\nimport { createGitRunner } from './exec.js';\nimport { collectReview, verifyReview } from './git.js';\nimport { buildPrompt } from './prompt.js';\n\ndeclare module '@deepseek-ai/dsh-llm' {\n interface MessageSourceMap {\n /** 宿主没有共享的 `plugin` kind,生产者必须声明自己的 kind 才能入队。 */\n 'michengai-simplify': { readonly kind: 'michengai-simplify' }\n }\n}\n\n/** 执行一次交互式命令;错误只返回 UI,可靠范围才交给当前 Agent。 */\nexport async function handleCommand(ctx: Pick<Context, 'subprocess'>, invocation: CommandInvocation, lifetime?: AbortSignal): Promise<CommandResult> {\n const deadline = new AbortController();\n const timer = setTimeout(() => deadline.abort(), 60_000);\n const signal = AbortSignal.any([invocation.signal, deadline.signal, ...(lifetime ? [lifetime] : [])]);\n try {\n signal.throwIfAborted();\n const options = parseArgs(invocation.rawInput);\n const cwd = invocation.agent.session.header.cwd;\n if (!cwd) throw new Error('当前会话没有工作目录,无法确定审查仓库。');\n const run = createGitRunner(ctx.subprocess, signal);\n const review = await collectReview(run, cwd, options);\n signal.throwIfAborted();\n if (!review.files.length) {\n const skipped = review.skipped.slice(0, 10).map(file => `${JSON.stringify(file.path)}:${file.reason}`).join('\\n');\n return { kind: 'success', text: `没有可简化的当前代码行。${skipped ? `\\n已跳过 ${review.skipped.length} 个文件:\\n${skipped}` : ''}` };\n }\n const prompt = buildPrompt(review);\n await verifyReview(run, review);\n signal.throwIfAborted();\n // followup 在当前宿主中同时负责持久入队与唤醒,避免直接操作 inbox 后缺少唤醒。\n invocation.agent.followup(createUserMessage({\n content: [{ type: 'text', text: prompt }],\n source: { kind: 'michengai-simplify' },\n }));\n return { kind: 'success', text: `已提交 ${review.files.length} 个文件的简化审查${review.source === 'previous-commit' ? '(回看上一提交)' : ''}。${review.skipped.length ? `已跳过 ${review.skipped.length} 个不可编辑文件。` : ''}` };\n } catch (error) {\n const text = deadline.signal.aborted ? '审查范围收集超过 60 秒,请缩小范围后重试。'\n : signal.aborted ? '简化审查已取消。'\n : error instanceof Error ? error.message : String(error);\n return { kind: 'error', text };\n } finally { clearTimeout(timer); }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@michengai/dsh-simplify",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "1.0.1",
|
|
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",
|
|
@@ -64,12 +64,12 @@
|
|
|
64
64
|
"registry": "https://registry.npmjs.org/"
|
|
65
65
|
},
|
|
66
66
|
"peerDependencies": {
|
|
67
|
-
"@deepseek-ai/cordis": "
|
|
68
|
-
"@deepseek-ai/dsh-commands": "0.
|
|
69
|
-
"@deepseek-ai/dsh-llm": "0.
|
|
70
|
-
"@deepseek-ai/dsh-subprocess": "0.
|
|
71
|
-
"@deepseek-ai/dsh-client-ui-commands": "0.
|
|
72
|
-
"@deepseek-ai/dsh-client-ui-primitives": "0.
|
|
67
|
+
"@deepseek-ai/cordis": ">=4.0.4 <5",
|
|
68
|
+
"@deepseek-ai/dsh-commands": "0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-rc.1 || 0.2.1-rc.2",
|
|
69
|
+
"@deepseek-ai/dsh-llm": "0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-rc.1 || 0.2.1-rc.2",
|
|
70
|
+
"@deepseek-ai/dsh-subprocess": "0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-rc.1 || 0.2.1-rc.2",
|
|
71
|
+
"@deepseek-ai/dsh-client-ui-commands": "0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-rc.1 || 0.2.1-rc.2",
|
|
72
|
+
"@deepseek-ai/dsh-client-ui-primitives": "0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-rc.1 || 0.2.1-rc.2"
|
|
73
73
|
},
|
|
74
74
|
"peerDependenciesMeta": {
|
|
75
75
|
"@deepseek-ai/dsh-client-ui-commands": {
|
|
@@ -80,13 +80,13 @@
|
|
|
80
80
|
}
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
|
-
"@deepseek-ai/cordis": "4.0.5
|
|
84
|
-
"@deepseek-ai/dsh-client-ui-commands": "0.2.1-
|
|
85
|
-
"@deepseek-ai/dsh-client-ui-primitives": "0.2.1-
|
|
86
|
-
"@deepseek-ai/dsh-commands": "0.2.1-
|
|
87
|
-
"@deepseek-ai/dsh-llm": "0.2.1-
|
|
88
|
-
"@deepseek-ai/dsh-subprocess": "0.2.1-
|
|
89
|
-
"@deepseek-ai/dsh-subprocess-local": "0.2.1-
|
|
83
|
+
"@deepseek-ai/cordis": "4.0.5",
|
|
84
|
+
"@deepseek-ai/dsh-client-ui-commands": "0.2.1-rc.2",
|
|
85
|
+
"@deepseek-ai/dsh-client-ui-primitives": "0.2.1-rc.2",
|
|
86
|
+
"@deepseek-ai/dsh-commands": "0.2.1-rc.2",
|
|
87
|
+
"@deepseek-ai/dsh-llm": "0.2.1-rc.2",
|
|
88
|
+
"@deepseek-ai/dsh-subprocess": "0.2.1-rc.2",
|
|
89
|
+
"@deepseek-ai/dsh-subprocess-local": "0.2.1-rc.2",
|
|
90
90
|
"@types/node": "^22.19.0",
|
|
91
91
|
"esbuild": "^0.25.0",
|
|
92
92
|
"typescript": "~5.7.2"
|