@michengai/dsh-simplify 1.0.10 → 1.0.12
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 +15 -0
- package/CHANGELOG.zh-CN.md +15 -0
- package/README.de.md +3 -3
- package/README.en.md +5 -5
- package/README.es.md +3 -3
- package/README.fr.md +3 -3
- package/README.ja.md +3 -3
- package/README.md +5 -5
- package/README.pt.md +3 -3
- package/README.ru.md +3 -3
- package/README.zh-CN.md +5 -5
- package/lib/client.d.ts +9 -2
- package/lib/client.js +1 -1
- package/lib/client.js.map +3 -3
- package/lib/command.js +1 -2
- package/lib/command.js.map +1 -1
- package/package.json +47 -47
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.0.12 - 2026-11-22
|
|
4
|
+
|
|
5
|
+
- Fix the `/simplify` entry in the `/` command menu showing nothing but the bare `simplify` name, with no icon and no localized title. It now looks like the built-in commands (`Compact`, `Permission`, …): a glyph plus a title in your interface language.
|
|
6
|
+
- Other commands are unaffected, and the entry's argument hint and behavior stay the same.
|
|
7
|
+
|
|
8
|
+
[简体中文](CHANGELOG.zh-CN.md)
|
|
9
|
+
|
|
10
|
+
## 1.0.11 - 2026-11-19
|
|
11
|
+
|
|
12
|
+
- Align with official DSH `0.2.2-rc.5` host environment; upgrade development dependencies to `0.2.2-rc.5`.
|
|
13
|
+
- Refine supported host version matrix to `>=0.2.2-rc.1 <0.3.0-0`, completing full compatibility regression across all RC hosts.
|
|
14
|
+
- Streamline command invocation and client initialization to improve execution smoothness.
|
|
15
|
+
|
|
16
|
+
[简体中文](CHANGELOG.zh-CN.md)
|
|
17
|
+
|
|
3
18
|
## 1.0.10 - 2026-11-14
|
|
4
19
|
|
|
5
20
|
- Align with official DSH `0.2.2-rc.3` release; upgrade development dependencies to `0.2.2-rc.3`.
|
package/CHANGELOG.zh-CN.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# 变更记录
|
|
2
2
|
|
|
3
|
+
## 1.0.12 - 2026-11-22
|
|
4
|
+
|
|
5
|
+
- 修复在输入框敲 `/` 时,`/simplify` 那一行只剩一个 `simplify` 字样、既不显示图标也没有「简化」标题的问题;现在它和「压缩 compact」等内置指令一样,显示图标与当前界面语言的标题。
|
|
6
|
+
- 其他指令不受影响,`/simplify` 的参数提示与功能行为保持不变。
|
|
7
|
+
|
|
8
|
+
[English](CHANGELOG.md)
|
|
9
|
+
|
|
10
|
+
## 1.0.11 - 2026-11-19
|
|
11
|
+
|
|
12
|
+
- 对齐官方最新 DSH `0.2.2-rc.5` 宿主环境,更新开发依赖至 `0.2.2-rc.5`。
|
|
13
|
+
- 优化宿主兼容支持矩阵,收缩为 `>=0.2.2-rc.1 <0.3.0-0`,完成全系 RC 宿主兼容性回归验证。
|
|
14
|
+
- 精简命令调用与界面初始化处理,优化执行流畅度。
|
|
15
|
+
|
|
16
|
+
[English](CHANGELOG.md)
|
|
17
|
+
|
|
3
18
|
## 1.0.10 - 2026-11-14
|
|
4
19
|
|
|
5
20
|
- 对齐官方 DSH `0.2.2-rc.3` 发布,开发依赖升级至 `0.2.2-rc.3`。
|
package/README.de.md
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
[](LICENSE)
|
|
16
16
|
[](https://www.npmjs.com/package/@michengai/dsh-simplify)
|
|
17
17
|
[](https://github.com/deepseek-ai/deepseek-harness)
|
|
18
|
-
[](#installation)
|
|
19
19
|
[](https://nodejs.org/)
|
|
20
20
|
|
|
21
21
|
</div>
|
|
@@ -50,8 +50,8 @@ Aufgaben-Prompts an den Agenten bleiben in vereinfachtem Chinesisch, während Be
|
|
|
50
50
|
|
|
51
51
|
## Voraussetzungen
|
|
52
52
|
|
|
53
|
-
- DeepSeek Harness `0.2.x` (`>=0.2.
|
|
54
|
-
- Frühere Versionen vor `0.2.
|
|
53
|
+
- DeepSeek Harness `0.2.x` (`>=0.2.2-rc.1 <0.3.0-0`), getestet mit `0.2.2-rc.1`, `0.2.2-rc.2`, `0.2.2-rc.3`, `0.2.2-rc.4`, `0.2.2-rc.5`.
|
|
54
|
+
- Frühere Versionen vor `0.2.2-rc.1` werden abgewiesen. Bei DSH `0.1.x` installieren Sie bitte Version `0.1.16`.
|
|
55
55
|
- Node.js >= 22.19, Git im PATH verfügbar.
|
|
56
56
|
- Sitzung mit lokalem Git-Projekt verknüpft.
|
|
57
57
|
|
package/README.en.md
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
[](LICENSE)
|
|
16
16
|
[](https://www.npmjs.com/package/@michengai/dsh-simplify)
|
|
17
17
|
[](https://github.com/deepseek-ai/deepseek-harness)
|
|
18
|
-
[](#installation)
|
|
19
19
|
[](https://nodejs.org/)
|
|
20
20
|
|
|
21
21
|
</div>
|
|
@@ -56,14 +56,14 @@ For a desktop workbench, download [DSH Codex Desktop](https://github.com/Micheng
|
|
|
56
56
|
|
|
57
57
|
## Prerequisites
|
|
58
58
|
|
|
59
|
-
- Host compatibility:
|
|
60
|
-
- Legacy hosts prior to `0.2.
|
|
59
|
+
- Host compatibility: DeepSeek Harness `0.2.x` line (`>=0.2.2-rc.1 <0.3.0-0`), verified with `0.2.2-rc.1`, `0.2.2-rc.2`, `0.2.2-rc.3`, `0.2.2-rc.4`, and `0.2.2-rc.5`, and forwards-compatible with subsequent `0.2.x` RC releases without requiring routine plugin version bumps.
|
|
60
|
+
- Legacy hosts prior to `0.2.2-rc.1` are rejected by the version gate. The version gate cleanly intercepts breaking changes in the `0.3.0` generation. Users on `0.1.x` hosts should install `0.1.16`.
|
|
61
61
|
- Node.js >= 22.19, git available in PATH.
|
|
62
62
|
- Active conversation linked to a local git repository.
|
|
63
63
|
|
|
64
64
|
## Installation
|
|
65
65
|
|
|
66
|
-
The commands below use the `web` profile; replace it for your environment. Disable other plugins that register `/simplify` before installation. Compatible with DeepSeek Harness
|
|
66
|
+
The commands below use the `web` profile; replace it for your environment. Disable other plugins that register `/simplify` before installation. Compatible with DeepSeek Harness (`>=0.2.2-rc.1 <0.3.0-0`).
|
|
67
67
|
|
|
68
68
|
### Ask an agent to install it (recommended)
|
|
69
69
|
|
|
@@ -203,7 +203,7 @@ GitHub and npm both include a ready-to-run `lib`. After changing source, run `np
|
|
|
203
203
|
|
|
204
204
|
### Verification
|
|
205
205
|
|
|
206
|
-
Development dependencies align with DSH `0.2.2-rc.
|
|
206
|
+
Development dependencies align with DSH `0.2.2-rc.5`. `npm run test:compat` reruns real command and Git tests across all supported isolated host versions (`0.2.2-rc.1`, `0.2.2-rc.2`, `0.2.2-rc.3`, `0.2.2-rc.4`, and `0.2.2-rc.5`).
|
|
207
207
|
|
|
208
208
|
```powershell
|
|
209
209
|
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
|
package/README.es.md
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
[](LICENSE)
|
|
16
16
|
[](https://www.npmjs.com/package/@michengai/dsh-simplify)
|
|
17
17
|
[](https://github.com/deepseek-ai/deepseek-harness)
|
|
18
|
-
[](#instalación)
|
|
19
19
|
[](https://nodejs.org/)
|
|
20
20
|
|
|
21
21
|
</div>
|
|
@@ -52,8 +52,8 @@ Después de una sesión de programación, usa `/simplify` para solicitar al Agen
|
|
|
52
52
|
|
|
53
53
|
## Requisitos previos
|
|
54
54
|
|
|
55
|
-
- Compatibilidad con DeepSeek Harness `0.2.x` (`>=0.2.
|
|
56
|
-
- Los entornos anteriores a `0.2.
|
|
55
|
+
- Compatibilidad con DeepSeek Harness `0.2.x` (`>=0.2.2-rc.1 <0.3.0-0`), probado con `0.2.2-rc.1`, `0.2.2-rc.2`, `0.2.2-rc.3`, `0.2.2-rc.4`, `0.2.2-rc.5`.
|
|
56
|
+
- Los entornos anteriores a `0.2.2-rc.1` son rechazados por el control de versiones. Si utilizas `0.1.x`, instala la versión `0.1.16`.
|
|
57
57
|
- Node.js >= 22.19 con Git disponible en PATH.
|
|
58
58
|
- Sesión vinculada a un repositorio Git local.
|
|
59
59
|
|
package/README.fr.md
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
[](LICENSE)
|
|
16
16
|
[](https://www.npmjs.com/package/@michengai/dsh-simplify)
|
|
17
17
|
[](https://github.com/deepseek-ai/deepseek-harness)
|
|
18
|
-
[](#installation)
|
|
19
19
|
[](https://nodejs.org/)
|
|
20
20
|
|
|
21
21
|
</div>
|
|
@@ -50,8 +50,8 @@ Les invites envoyées à l'Agent restent en chinois simplifié, tandis que les l
|
|
|
50
50
|
|
|
51
51
|
## Prérequis
|
|
52
52
|
|
|
53
|
-
- DeepSeek Harness `0.2.x` (`>=0.2.
|
|
54
|
-
- Les versions antérieures à `0.2.
|
|
53
|
+
- DeepSeek Harness `0.2.x` (`>=0.2.2-rc.1 <0.3.0-0`), vérifié avec `0.2.2-rc.1`, `0.2.2-rc.2`, `0.2.2-rc.3`, `0.2.2-rc.4`, `0.2.2-rc.5`.
|
|
54
|
+
- Les versions antérieures à `0.2.2-rc.1` sont rejetées. Si vous utilisez `0.1.x`, installez la version `0.1.16`.
|
|
55
55
|
- Node.js >= 22.19, Git accessible dans le PATH.
|
|
56
56
|
- Session liée à un dépôt Git local.
|
|
57
57
|
|
package/README.ja.md
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
[](LICENSE)
|
|
16
16
|
[](https://www.npmjs.com/package/@michengai/dsh-simplify)
|
|
17
17
|
[](https://github.com/deepseek-ai/deepseek-harness)
|
|
18
|
-
[](#インストール)
|
|
19
19
|
[](https://nodejs.org/)
|
|
20
20
|
|
|
21
21
|
</div>
|
|
@@ -56,8 +56,8 @@ Agent に送信されるタスクプロンプトは簡体字中国語のまま
|
|
|
56
56
|
|
|
57
57
|
## 前提条件
|
|
58
58
|
|
|
59
|
-
- ホスト対応範囲:DeepSeek Harness `0.2.x`
|
|
60
|
-
- `0.2.
|
|
59
|
+
- ホスト対応範囲:DeepSeek Harness `0.2.x` シリーズ(`>=0.2.2-rc.1 <0.3.0-0`)。`0.2.2-rc.1`、`0.2.2-rc.2`、`0.2.2-rc.3`、`0.2.2-rc.4`、`0.2.2-rc.5` で互換性検証済み。
|
|
60
|
+
- `0.2.2-rc.1` より前の旧ホストはバージョンゲートにより拒否されます。`0.1.x` をお使いの場合はプラグインバージョン `0.1.16` をインストールしてください。
|
|
61
61
|
- Node.js >= 22.19、PATH 内で Git が実行可能であること。
|
|
62
62
|
- 現在のセッションがローカル Git リポジトリに関連付けられていること。
|
|
63
63
|
|
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
[](LICENSE)
|
|
16
16
|
[](https://www.npmjs.com/package/@michengai/dsh-simplify)
|
|
17
17
|
[](https://github.com/deepseek-ai/deepseek-harness)
|
|
18
|
-
[](#安装)
|
|
19
19
|
[](https://nodejs.org/)
|
|
20
20
|
|
|
21
21
|
</div>
|
|
@@ -56,14 +56,14 @@
|
|
|
56
56
|
|
|
57
57
|
## 前置条件
|
|
58
58
|
|
|
59
|
-
- 宿主支持范围:DeepSeek Harness `0.2.x`
|
|
60
|
-
- `0.2.
|
|
59
|
+
- 宿主支持范围:DeepSeek Harness `0.2.x` 系列(`>=0.2.2-rc.1 <0.3.0-0`),已验证兼容 `0.2.2-rc.1`、`0.2.2-rc.2`、`0.2.2-rc.3`、`0.2.2-rc.4`、`0.2.2-rc.5`,并自动支持后续全部 0.2.x RC 版本,同代宿主升级无需重复等待发版。
|
|
60
|
+
- `0.2.2-rc.1` 之前的早期宿主会被版本门拒绝,`0.3.0` 代际破坏性更新由版本门拦截。仍在使用 `0.1.x` 的用户请安装插件 `0.1.16`。
|
|
61
61
|
- Node.js >= 22.19,PATH 中可执行 Git。
|
|
62
62
|
- 当前会话关联本地 Git 项目。
|
|
63
63
|
|
|
64
64
|
## 安装
|
|
65
65
|
|
|
66
|
-
以下命令使用 `web` profile,请按实际环境替换。安装前停用其他注册 `/simplify` 的插件。可在 DeepSeek Harness
|
|
66
|
+
以下命令使用 `web` profile,请按实际环境替换。安装前停用其他注册 `/simplify` 的插件。可在 DeepSeek Harness(`>=0.2.2-rc.1 <0.3.0-0`)上运行。
|
|
67
67
|
|
|
68
68
|
### 让 Agent 帮你安装(推荐)
|
|
69
69
|
|
|
@@ -203,7 +203,7 @@ GitHub 与 npm 都包含可直接运行的 `lib`。改了源码后,提交前
|
|
|
203
203
|
|
|
204
204
|
### 验证
|
|
205
205
|
|
|
206
|
-
开发依赖对齐 DSH `0.2.2-rc.
|
|
206
|
+
开发依赖对齐 DSH `0.2.2-rc.5`。`npm run test:compat` 在 `0.2.2-rc.1`、`0.2.2-rc.2`、`0.2.2-rc.3`、`0.2.2-rc.4`、`0.2.2-rc.5` 等各版本隔离宿主上重跑真实命令与 Git 测试。
|
|
207
207
|
|
|
208
208
|
```powershell
|
|
209
209
|
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
|
package/README.pt.md
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
[](LICENSE)
|
|
16
16
|
[](https://www.npmjs.com/package/@michengai/dsh-simplify)
|
|
17
17
|
[](https://github.com/deepseek-ai/deepseek-harness)
|
|
18
|
-
[](#instalação)
|
|
19
19
|
[](https://nodejs.org/)
|
|
20
20
|
|
|
21
21
|
</div>
|
|
@@ -50,8 +50,8 @@ Os prompts de tarefas enviados ao Agent permanecem em chinês simplificado, enqu
|
|
|
50
50
|
|
|
51
51
|
## Pré-requisitos
|
|
52
52
|
|
|
53
|
-
- Compatibilidade com DeepSeek Harness `0.2.x` (`>=0.2.
|
|
54
|
-
- Versões anteriores a `0.2.
|
|
53
|
+
- Compatibilidade com DeepSeek Harness `0.2.x` (`>=0.2.2-rc.1 <0.3.0-0`), validado em `0.2.2-rc.1`, `0.2.2-rc.2`, `0.2.2-rc.3`, `0.2.2-rc.4`, `0.2.2-rc.5`.
|
|
54
|
+
- Versões anteriores a `0.2.2-rc.1` são rejeitadas. Se estiver no DSH `0.1.x`, instale a versão `0.1.16`.
|
|
55
55
|
- Node.js >= 22.19, Git acessível no PATH.
|
|
56
56
|
- Sessão vinculada a um repositório Git local.
|
|
57
57
|
|
package/README.ru.md
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
[](LICENSE)
|
|
16
16
|
[](https://www.npmjs.com/package/@michengai/dsh-simplify)
|
|
17
17
|
[](https://github.com/deepseek-ai/deepseek-harness)
|
|
18
|
-
[](#установка)
|
|
19
19
|
[](https://nodejs.org/)
|
|
20
20
|
|
|
21
21
|
</div>
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
|
|
51
51
|
## Требования
|
|
52
52
|
|
|
53
|
-
- DeepSeek Harness `0.2.x` (`>=0.2.
|
|
54
|
-
- Версии до `0.2.
|
|
53
|
+
- DeepSeek Harness `0.2.x` (`>=0.2.2-rc.1 <0.3.0-0`), проверено на `0.2.2-rc.1`, `0.2.2-rc.2`, `0.2.2-rc.3`, `0.2.2-rc.4`, `0.2.2-rc.5`.
|
|
54
|
+
- Версии до `0.2.2-rc.1` отклоняются шлюзом версий. Для DSH `0.1.x` используйте версию `0.1.16`.
|
|
55
55
|
- Node.js >= 22.19, Git доступен в PATH.
|
|
56
56
|
- Сессия привязана к локальному репозиторию Git.
|
|
57
57
|
|
package/README.zh-CN.md
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
[](LICENSE)
|
|
16
16
|
[](https://www.npmjs.com/package/@michengai/dsh-simplify)
|
|
17
17
|
[](https://github.com/deepseek-ai/deepseek-harness)
|
|
18
|
-
[](#安装)
|
|
19
19
|
[](https://nodejs.org/)
|
|
20
20
|
|
|
21
21
|
</div>
|
|
@@ -56,14 +56,14 @@
|
|
|
56
56
|
|
|
57
57
|
## 前置条件
|
|
58
58
|
|
|
59
|
-
- 宿主支持范围:DeepSeek Harness `0.2.x`
|
|
60
|
-
- `0.2.
|
|
59
|
+
- 宿主支持范围:DeepSeek Harness `0.2.x` 系列(`>=0.2.2-rc.1 <0.3.0-0`),已验证兼容 `0.2.2-rc.1`、`0.2.2-rc.2`、`0.2.2-rc.3`、`0.2.2-rc.4`、`0.2.2-rc.5`,并自动支持后续全部 0.2.x RC 版本,同代宿主升级无需重复等待发版。
|
|
60
|
+
- `0.2.2-rc.1` 之前的早期宿主会被版本门拒绝,`0.3.0` 代际破坏性更新由版本门拦截。仍在使用 `0.1.x` 的用户请安装插件 `0.1.16`。
|
|
61
61
|
- Node.js >= 22.19,PATH 中可执行 Git。
|
|
62
62
|
- 当前会话关联本地 Git 项目。
|
|
63
63
|
|
|
64
64
|
## 安装
|
|
65
65
|
|
|
66
|
-
以下命令使用 `web` profile,请按实际环境替换。安装前停用其他注册 `/simplify` 的插件。可在 DeepSeek Harness
|
|
66
|
+
以下命令使用 `web` profile,请按实际环境替换。安装前停用其他注册 `/simplify` 的插件。可在 DeepSeek Harness(`>=0.2.2-rc.1 <0.3.0-0`)上运行。
|
|
67
67
|
|
|
68
68
|
### 让 Agent 帮你安装(推荐)
|
|
69
69
|
|
|
@@ -203,7 +203,7 @@ GitHub 与 npm 都包含可直接运行的 `lib`。改了源码后,提交前
|
|
|
203
203
|
|
|
204
204
|
### 验证
|
|
205
205
|
|
|
206
|
-
开发依赖对齐 DSH `0.2.2-rc.
|
|
206
|
+
开发依赖对齐 DSH `0.2.2-rc.5`。`npm run test:compat` 在 `0.2.2-rc.1`、`0.2.2-rc.2`、`0.2.2-rc.3`、`0.2.2-rc.4`、`0.2.2-rc.5` 等各版本隔离宿主上重跑真实命令与 Git 测试。
|
|
207
207
|
|
|
208
208
|
```powershell
|
|
209
209
|
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
|
package/lib/client.d.ts
CHANGED
|
@@ -3,8 +3,15 @@ type Lookup = {
|
|
|
3
3
|
get?: (name: string) => unknown;
|
|
4
4
|
};
|
|
5
5
|
interface ClientScope extends Lookup {
|
|
6
|
-
effect?(fn: () => () => void): unknown;
|
|
6
|
+
effect?(fn: () => (() => void) | void): unknown;
|
|
7
|
+
inject?(deps: string[], callback: (scope: ClientScope) => void): unknown;
|
|
7
8
|
}
|
|
8
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* 等 `commandUi` 就绪后再装饰 `/simplify` 的行面。
|
|
11
|
+
*
|
|
12
|
+
* 客户端插件的 apply 早于 UI 服务激活,此时直接 `ctx.get('commandUi')` 只会拿到
|
|
13
|
+
* undefined 并静默失效;`inject` 会在服务就绪时回调,并在服务重建后再次回调,
|
|
14
|
+
* 因此这里同时承担重挂载责任。
|
|
15
|
+
*/
|
|
9
16
|
export declare function apply(ctx: ClientScope): unknown;
|
|
10
17
|
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 s=Object.defineProperty;var
|
|
2
|
+
"use strict";var s=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var k=Object.getOwnPropertyNames;var y=Object.prototype.hasOwnProperty;var g=(n,t)=>{for(var e in t)s(n,e,{get:t[e],enumerable:!0})},h=(n,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of k(t))!y.call(n,o)&&o!==e&&s(n,o,{get:()=>t[o],enumerable:!(i=b(t,o))||i.enumerable});return n};var v=n=>h(s({},"__esModule",{value:!0}),n);var L={};g(L,{apply:()=>w});module.exports=v(L);var f=require("@deepseek-ai/dsh-client-ui-primitives"),p={icon:f.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."}},u=Symbol.for("michengai.simplify.slashFace");function S(n){let e=n.get?.("locale")?.snapshot?.active;if(typeof e!="string")return"zh";let i=e.replace(/_/g,"-").toLowerCase();return/^zh\b/.test(i)?"zh":/^ja\b/.test(i)?"ja":/^es\b/.test(i)?"es":/^fr\b/.test(i)?"fr":/^de\b/.test(i)?"de":/^ru\b/.test(i)?"ru":/^pt\b/.test(i)?"pt":"en"}function d(n,t){let e=n,i=e?.candidates;if(!e||typeof i!="function")return()=>{};if(i[u]===!0)return()=>{};let o=async(...m)=>{let c=await i.apply(e,m);if(!Array.isArray(c))return c;let l=p[S(t)];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?{icon:p.icon}:{},label:l.label,description:l.description}})};return o[u]=!0,e.candidates=o,()=>{e.candidates===o&&(e.candidates=i)}}function w(n){let t=e=>typeof e.effect=="function"?e.effect(()=>d(e.get?.("commandUi"),e)):d(e.get?.("commandUi"),e);if(typeof n.inject=="function"){n.inject(["commandUi"],e=>t(e));return}return t(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 { 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?:
|
|
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,
|
|
6
|
-
"names": ["client_exports", "__export", "apply", "__toCommonJS", "import_dsh_client_ui_primitives", "FACE", "resolveLocale", "ctx", "active", "tag", "decorateSlashFace", "commandUi", "live", "original", "
|
|
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/** \u88C5\u9970\u8FC7\u7684\u5305\u88C5\u51FD\u6570\u6807\u8BB0\uFF0C\u670D\u52A1\u91CD\u5EFA\u6216\u91CD\u590D\u6CE8\u5165\u65F6\u636E\u6B64\u907F\u514D\u591A\u5C42\u5305\u88F9\u3002 */\nconst WRAPPED = Symbol.for('michengai.simplify.slashFace');\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?: unknown } | undefined;\n const original = live?.candidates;\n if (!live || typeof original !== 'function') return () => {};\n if ((original as unknown as Record<symbol, unknown>)[WRAPPED] === true) return () => {};\n const wrapper = async (...args: unknown[]) => {\n const rows = await (original as (...rest: unknown[]) => unknown).apply(live, args);\n if (!Array.isArray(rows)) return rows;\n const copy = FACE[resolveLocale(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 return {\n ...item,\n ...(item.icon === undefined ? { icon: FACE.icon } : {}),\n label: copy.label,\n description: copy.description,\n };\n });\n };\n (wrapper as unknown as Record<symbol, unknown>)[WRAPPED] = true;\n live.candidates = wrapper;\n return () => {\n if (live.candidates === wrapper) live.candidates = original;\n };\n}\n\ninterface ClientScope extends Lookup {\n effect?(fn: () => (() => void) | void): unknown;\n inject?(deps: string[], callback: (scope: ClientScope) => void): unknown;\n}\n\n/**\n * \u7B49 `commandUi` \u5C31\u7EEA\u540E\u518D\u88C5\u9970 `/simplify` \u7684\u884C\u9762\u3002\n *\n * \u5BA2\u6237\u7AEF\u63D2\u4EF6\u7684 apply \u65E9\u4E8E UI \u670D\u52A1\u6FC0\u6D3B\uFF0C\u6B64\u65F6\u76F4\u63A5 `ctx.get('commandUi')` \u53EA\u4F1A\u62FF\u5230\n * undefined \u5E76\u9759\u9ED8\u5931\u6548\uFF1B`inject` \u4F1A\u5728\u670D\u52A1\u5C31\u7EEA\u65F6\u56DE\u8C03\uFF0C\u5E76\u5728\u670D\u52A1\u91CD\u5EFA\u540E\u518D\u6B21\u56DE\u8C03\uFF0C\n * \u56E0\u6B64\u8FD9\u91CC\u540C\u65F6\u627F\u62C5\u91CD\u6302\u8F7D\u8D23\u4EFB\u3002\n */\nexport function apply(ctx: ClientScope): unknown {\n // \u5BBF\u4E3B effect \u8FD4\u56DE\u5378\u8F7D\u5668\uFF1B\u628A\u5B83\u4EA4\u56DE\u5BBF\u4E3B\uFF0C\u670D\u52A1\u91CD\u5EFA\u6216\u63D2\u4EF6\u5378\u8F7D\u65F6\u624D\u80FD\u6062\u590D\u539F\u65B9\u6CD5\u3002\n const decorate = (scope: ClientScope): (() => void) => {\n if (typeof scope.effect === 'function') {\n return scope.effect(() => decorateSlashFace(scope.get?.('commandUi'), scope)) as () => void;\n }\n return decorateSlashFace(scope.get?.('commandUi'), scope);\n };\n if (typeof ctx.inject === 'function') {\n ctx.inject(['commandUi'], scope => decorate(scope));\n return;\n }\n // \u517C\u5BB9\u4E0D\u5E26 inject \u7684\u6700\u5C0F\u5939\u5177\uFF1A\u9000\u5316\u4E3A\u4E00\u6B21\u6027\u5C1D\u8BD5\u3002\n return decorate(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,EAKMC,EAAU,OAAO,IAAI,8BAA8B,EAGzD,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,GAAI,CAACA,GAAQ,OAAOC,GAAa,WAAY,MAAO,IAAM,CAAC,EAC3D,GAAKA,EAAgDR,CAAO,IAAM,GAAM,MAAO,IAAM,CAAC,EACtF,IAAMS,EAAU,SAAUC,IAAoB,CAC5C,IAAMC,EAAO,MAAOH,EAA6C,MAAMD,EAAMG,CAAI,EACjF,GAAI,CAAC,MAAM,QAAQC,CAAI,EAAG,OAAOA,EACjC,IAAMC,EAAOb,EAAKE,EAAcC,CAAG,CAAC,EACpC,OAAOS,EAAK,IAAKE,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,OAAY,CAAE,KAAMf,EAAK,IAAK,EAAI,CAAC,EACrD,MAAOa,EAAK,MACZ,YAAaA,EAAK,WACpB,CACF,CAAC,CACH,EACA,OAACH,EAA+CT,CAAO,EAAI,GAC3DO,EAAK,WAAaE,EACX,IAAM,CACPF,EAAK,aAAeE,IAASF,EAAK,WAAaC,EACrD,CACF,CAcO,SAASZ,EAAMM,EAA2B,CAE/C,IAAMa,EAAYC,GACZ,OAAOA,EAAM,QAAW,WACnBA,EAAM,OAAO,IAAMX,EAAkBW,EAAM,MAAM,WAAW,EAAGA,CAAK,CAAC,EAEvEX,EAAkBW,EAAM,MAAM,WAAW,EAAGA,CAAK,EAE1D,GAAI,OAAOd,EAAI,QAAW,WAAY,CACpCA,EAAI,OAAO,CAAC,WAAW,EAAGc,GAASD,EAASC,CAAK,CAAC,EAClD,MACF,CAEA,OAAOD,EAASb,CAAG,CACrB",
|
|
6
|
+
"names": ["client_exports", "__export", "apply", "__toCommonJS", "import_dsh_client_ui_primitives", "FACE", "WRAPPED", "resolveLocale", "ctx", "active", "tag", "decorateSlashFace", "commandUi", "live", "original", "wrapper", "args", "rows", "copy", "row", "item", "decorate", "scope"]
|
|
7
7
|
}
|
package/lib/command.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createUserMessage } from '@deepseek-ai/dsh-llm';
|
|
2
2
|
import { parseArgs } from './args.js';
|
|
3
3
|
import { createGitRunner } from './exec.js';
|
|
4
|
-
import { collectReview
|
|
4
|
+
import { collectReview } from './git.js';
|
|
5
5
|
import { buildPrompt } from './prompt.js';
|
|
6
6
|
/** 执行一次交互式命令;错误只返回 UI,可靠范围才交给当前 Agent。 */
|
|
7
7
|
export async function handleCommand(ctx, invocation, lifetime) {
|
|
@@ -22,7 +22,6 @@ export async function handleCommand(ctx, invocation, lifetime) {
|
|
|
22
22
|
return { kind: 'success', text: `没有可简化的当前代码行。${skipped ? `\n已跳过 ${review.skipped.length} 个文件:\n${skipped}` : ''}` };
|
|
23
23
|
}
|
|
24
24
|
const prompt = buildPrompt(review);
|
|
25
|
-
await verifyReview(run, review);
|
|
26
25
|
signal.throwIfAborted();
|
|
27
26
|
// followup 在当前宿主中同时负责持久入队与唤醒,避免直接操作 inbox 后缺少唤醒。
|
|
28
27
|
invocation.agent.followup(createUserMessage({
|
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,
|
|
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,MAAM,UAAU,CAAC;AACzC,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,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACtG,IAAI,CAAC;QACH,MAAM,CAAC,cAAc,EAAE,CAAC;QACxB,MAAM,OAAO,GAAG,SAAS,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;QAC/C,MAAM,GAAG,GAAG,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC;QAChD,IAAI,CAAC,GAAG;YAAE,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;QAClD,MAAM,GAAG,GAAG,eAAe,CAAC,GAAG,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;QACpD,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;QACtD,MAAM,CAAC,cAAc,EAAE,CAAC;QACxB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;YACzB,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAClH,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,eAAe,OAAO,CAAC,CAAC,CAAC,SAAS,MAAM,CAAC,OAAO,CAAC,MAAM,UAAU,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC;QACtH,CAAC;QACD,MAAM,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;QACnC,MAAM,CAAC,cAAc,EAAE,CAAC;QACxB,iDAAiD;QACjD,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 } 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 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": "1.0.
|
|
3
|
+
"version": "1.0.12",
|
|
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",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"license": "Apache-2.0",
|
|
28
28
|
"engines": {
|
|
29
29
|
"node": ">=22.19.0",
|
|
30
|
-
"dsh": ">=0.2.
|
|
30
|
+
"dsh": ">=0.2.2-rc.1 <0.3.0-0"
|
|
31
31
|
},
|
|
32
32
|
"main": "./lib/index.js",
|
|
33
33
|
"types": "./lib/index.d.ts",
|
|
@@ -88,12 +88,12 @@
|
|
|
88
88
|
"registry": "https://registry.npmjs.org/"
|
|
89
89
|
},
|
|
90
90
|
"peerDependencies": {
|
|
91
|
-
"@deepseek-ai/cordis": ">=4.0
|
|
92
|
-
"@deepseek-ai/dsh-commands": ">=0.2.
|
|
93
|
-
"@deepseek-ai/dsh-llm": ">=0.2.
|
|
94
|
-
"@deepseek-ai/dsh-subprocess": ">=0.2.
|
|
95
|
-
"@deepseek-ai/dsh-client-ui-commands": ">=0.2.
|
|
96
|
-
"@deepseek-ai/dsh-client-ui-primitives": ">=0.2.
|
|
91
|
+
"@deepseek-ai/cordis": ">=4.1.0 <5",
|
|
92
|
+
"@deepseek-ai/dsh-commands": ">=0.2.2-rc.1 <0.3.0-0",
|
|
93
|
+
"@deepseek-ai/dsh-llm": ">=0.2.2-rc.1 <0.3.0-0",
|
|
94
|
+
"@deepseek-ai/dsh-subprocess": ">=0.2.2-rc.1 <0.3.0-0",
|
|
95
|
+
"@deepseek-ai/dsh-client-ui-commands": ">=0.2.2-rc.1 <0.3.0-0",
|
|
96
|
+
"@deepseek-ai/dsh-client-ui-primitives": ">=0.2.2-rc.1 <0.3.0-0"
|
|
97
97
|
},
|
|
98
98
|
"peerDependenciesMeta": {
|
|
99
99
|
"@deepseek-ai/dsh-client-ui-commands": {
|
|
@@ -105,48 +105,48 @@
|
|
|
105
105
|
},
|
|
106
106
|
"devDependencies": {
|
|
107
107
|
"@deepseek-ai/cordis": "4.1.0",
|
|
108
|
-
"@deepseek-ai/dsh-client-ui-commands": "0.2.2-rc.
|
|
109
|
-
"@deepseek-ai/dsh-client-ui-primitives": "0.2.2-rc.
|
|
110
|
-
"@deepseek-ai/dsh-commands": "0.2.2-rc.
|
|
111
|
-
"@deepseek-ai/dsh-error": "0.2.2-rc.
|
|
112
|
-
"@deepseek-ai/dsh-llm": "0.2.2-rc.
|
|
113
|
-
"@deepseek-ai/dsh-subprocess": "0.2.2-rc.
|
|
114
|
-
"@deepseek-ai/dsh-subprocess-local": "0.2.2-rc.
|
|
108
|
+
"@deepseek-ai/dsh-client-ui-commands": "0.2.2-rc.5",
|
|
109
|
+
"@deepseek-ai/dsh-client-ui-primitives": "0.2.2-rc.5",
|
|
110
|
+
"@deepseek-ai/dsh-commands": "0.2.2-rc.5",
|
|
111
|
+
"@deepseek-ai/dsh-error": "0.2.2-rc.5",
|
|
112
|
+
"@deepseek-ai/dsh-llm": "0.2.2-rc.5",
|
|
113
|
+
"@deepseek-ai/dsh-subprocess": "0.2.2-rc.5",
|
|
114
|
+
"@deepseek-ai/dsh-subprocess-local": "0.2.2-rc.5",
|
|
115
115
|
"@types/node": "^22.19.0",
|
|
116
116
|
"esbuild": "^0.25.0",
|
|
117
117
|
"typescript": "~5.7.2",
|
|
118
118
|
"semver": "^7.7.3",
|
|
119
|
-
"@deepseek-ai/dsh-attachment": "0.2.2-rc.
|
|
120
|
-
"@deepseek-ai/dsh-scope": "0.2.2-rc.
|
|
121
|
-
"@deepseek-ai/dsh-agent": "0.2.2-rc.
|
|
122
|
-
"@deepseek-ai/dsh-agent-loop": "0.2.2-rc.
|
|
123
|
-
"@deepseek-ai/dsh-session": "0.2.2-rc.
|
|
124
|
-
"@deepseek-ai/dsh-session-persistence": "0.2.2-rc.
|
|
125
|
-
"@deepseek-ai/dsh-session-projection": "0.2.2-rc.
|
|
126
|
-
"@deepseek-ai/dsh-settings": "0.2.2-rc.
|
|
127
|
-
"@deepseek-ai/dsh-subagent": "0.2.2-rc.
|
|
128
|
-
"@deepseek-ai/dsh-subagent-spawn-in-process": "0.2.2-rc.
|
|
129
|
-
"@deepseek-ai/dsh-system-prompt": "0.2.2-rc.
|
|
130
|
-
"@deepseek-ai/dsh-tools": "0.2.2-rc.
|
|
131
|
-
"@deepseek-ai/dsh-user-approval": "0.2.2-rc.
|
|
132
|
-
"@deepseek-ai/dsh-user-questions": "0.2.2-rc.
|
|
133
|
-
"@deepseek-ai/dsh-api-gateway": "0.2.2-rc.
|
|
134
|
-
"@deepseek-ai/dsh-api-session-controller": "0.2.2-rc.
|
|
135
|
-
"@deepseek-ai/dsh-client-connection": "0.2.2-rc.
|
|
136
|
-
"@deepseek-ai/dsh-client-locale": "0.2.2-rc.
|
|
137
|
-
"@deepseek-ai/dsh-client-ui-chat": "0.2.2-rc.
|
|
138
|
-
"@deepseek-ai/dsh-client-ui-conversation": "0.2.2-rc.
|
|
139
|
-
"@deepseek-ai/dsh-client-ui-input-trigger": "0.2.2-rc.
|
|
140
|
-
"@deepseek-ai/dsh-client-ui-renderer": "0.2.2-rc.
|
|
141
|
-
"@deepseek-ai/dsh-client-ui-slots": "0.2.2-rc.
|
|
142
|
-
"@deepseek-ai/dsh-client-ui-theme": "0.2.2-rc.
|
|
143
|
-
"@deepseek-ai/dsh-ptc-runtime": "0.2.2-rc.
|
|
144
|
-
"@deepseek-ai/dsh-sandbox": "0.2.2-rc.
|
|
145
|
-
"@deepseek-ai/dsh-sandbox-policy": "0.2.2-rc.
|
|
146
|
-
"@deepseek-ai/dsh-subagent-fork-in-process": "0.2.2-rc.
|
|
147
|
-
"@deepseek-ai/dsh-typert-protocol": "0.2.2-rc.
|
|
148
|
-
"@deepseek-ai/dsh-typert-registry": "0.2.2-rc.
|
|
149
|
-
"@deepseek-ai/dsh-util-time": "0.2.2-rc.
|
|
150
|
-
"@deepseek-ai/dsh-http-proxy": "0.2.2-rc.
|
|
119
|
+
"@deepseek-ai/dsh-attachment": "0.2.2-rc.5",
|
|
120
|
+
"@deepseek-ai/dsh-scope": "0.2.2-rc.5",
|
|
121
|
+
"@deepseek-ai/dsh-agent": "0.2.2-rc.5",
|
|
122
|
+
"@deepseek-ai/dsh-agent-loop": "0.2.2-rc.5",
|
|
123
|
+
"@deepseek-ai/dsh-session": "0.2.2-rc.5",
|
|
124
|
+
"@deepseek-ai/dsh-session-persistence": "0.2.2-rc.5",
|
|
125
|
+
"@deepseek-ai/dsh-session-projection": "0.2.2-rc.5",
|
|
126
|
+
"@deepseek-ai/dsh-settings": "0.2.2-rc.5",
|
|
127
|
+
"@deepseek-ai/dsh-subagent": "0.2.2-rc.5",
|
|
128
|
+
"@deepseek-ai/dsh-subagent-spawn-in-process": "0.2.2-rc.5",
|
|
129
|
+
"@deepseek-ai/dsh-system-prompt": "0.2.2-rc.5",
|
|
130
|
+
"@deepseek-ai/dsh-tools": "0.2.2-rc.5",
|
|
131
|
+
"@deepseek-ai/dsh-user-approval": "0.2.2-rc.5",
|
|
132
|
+
"@deepseek-ai/dsh-user-questions": "0.2.2-rc.5",
|
|
133
|
+
"@deepseek-ai/dsh-api-gateway": "0.2.2-rc.5",
|
|
134
|
+
"@deepseek-ai/dsh-api-session-controller": "0.2.2-rc.5",
|
|
135
|
+
"@deepseek-ai/dsh-client-connection": "0.2.2-rc.5",
|
|
136
|
+
"@deepseek-ai/dsh-client-locale": "0.2.2-rc.5",
|
|
137
|
+
"@deepseek-ai/dsh-client-ui-chat": "0.2.2-rc.5",
|
|
138
|
+
"@deepseek-ai/dsh-client-ui-conversation": "0.2.2-rc.5",
|
|
139
|
+
"@deepseek-ai/dsh-client-ui-input-trigger": "0.2.2-rc.5",
|
|
140
|
+
"@deepseek-ai/dsh-client-ui-renderer": "0.2.2-rc.5",
|
|
141
|
+
"@deepseek-ai/dsh-client-ui-slots": "0.2.2-rc.5",
|
|
142
|
+
"@deepseek-ai/dsh-client-ui-theme": "0.2.2-rc.5",
|
|
143
|
+
"@deepseek-ai/dsh-ptc-runtime": "0.2.2-rc.5",
|
|
144
|
+
"@deepseek-ai/dsh-sandbox": "0.2.2-rc.5",
|
|
145
|
+
"@deepseek-ai/dsh-sandbox-policy": "0.2.2-rc.5",
|
|
146
|
+
"@deepseek-ai/dsh-subagent-fork-in-process": "0.2.2-rc.5",
|
|
147
|
+
"@deepseek-ai/dsh-typert-protocol": "0.2.2-rc.5",
|
|
148
|
+
"@deepseek-ai/dsh-typert-registry": "0.2.2-rc.5",
|
|
149
|
+
"@deepseek-ai/dsh-util-time": "0.2.2-rc.5",
|
|
150
|
+
"@deepseek-ai/dsh-http-proxy": "0.2.2-rc.5"
|
|
151
151
|
}
|
|
152
152
|
}
|