@michengai/dsh-simplify 0.1.6 → 0.1.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/CHANGELOG.md +11 -0
- package/CHANGELOG.zh-CN.md +11 -0
- package/README.md +7 -7
- package/README.zh-CN.md +7 -7
- package/lib/client.d.ts +10 -0
- package/lib/client.js +4 -0
- package/lib/client.js.map +7 -0
- package/lib/command.d.ts +8 -0
- package/lib/command.js +1 -1
- package/lib/command.js.map +1 -1
- package/package.json +34 -13
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
[简体中文](CHANGELOG.zh-CN.md)
|
|
4
4
|
|
|
5
|
+
## 0.1.8 - 2026-09-22
|
|
6
|
+
|
|
7
|
+
- Support DSH `0.1.7-alpha.1` while retaining compatibility with `0.1.0-rc.8`, `0.1.1-rc.2`, `0.1.2-rc.1`, `0.1.5-rc.1`, `0.1.5-rc.2`, `0.1.6-alpha.1`, and `0.1.6-alpha.2`.
|
|
8
|
+
- Queue simplification with a producer-owned message source so DSH 0.1.7 accepts it, and keep that same source on earlier hosts.
|
|
9
|
+
- Use whichever Enhance icon the installed host exports, including the icon renamed in 0.1.7.
|
|
10
|
+
|
|
11
|
+
## 0.1.7 - 2026-09-18
|
|
12
|
+
|
|
13
|
+
- Show the official Enhance icon and a Simplify/简化 title on the `/simplify` slash-menu row, matching commands such as BTW and review.
|
|
14
|
+
- Use a bilingual package description so the plugin manager matches the GitHub About text.
|
|
15
|
+
|
|
5
16
|
## 0.1.6 - 2026-09-18
|
|
6
17
|
|
|
7
18
|
- Support DSH `0.1.6-alpha.2` while retaining compatibility with `0.1.0-rc.8`, `0.1.1-rc.2`, `0.1.2-rc.1`, `0.1.5-rc.1`, `0.1.5-rc.2`, and `0.1.6-alpha.1`.
|
package/CHANGELOG.zh-CN.md
CHANGED
|
@@ -2,6 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
[English](CHANGELOG.md)
|
|
4
4
|
|
|
5
|
+
## 0.1.8 - 2026-09-22
|
|
6
|
+
|
|
7
|
+
- 支持 DSH `0.1.7-alpha.1`,继续兼容 `0.1.0-rc.8`、`0.1.1-rc.2`、`0.1.2-rc.1`、`0.1.5-rc.1`、`0.1.5-rc.2`、`0.1.6-alpha.1` 和 `0.1.6-alpha.2`。
|
|
8
|
+
- 简化请求改用插件自己的消息来源,DSH 0.1.7 可以入队,更早的宿主也接受同一来源。
|
|
9
|
+
- 斜杠菜单改用当前宿主提供的 Enhance 图标,包括 0.1.7 重命名后的导出。
|
|
10
|
+
|
|
11
|
+
## 0.1.7 - 2026-09-18
|
|
12
|
+
|
|
13
|
+
- `/simplify` 斜杠菜单补上官方 Enhance 图标和「简化」标题,与旁问、审查等命令一致。
|
|
14
|
+
- 插件描述改为中英文双语,插件管理页与仓库简介一致。
|
|
15
|
+
|
|
5
16
|
## 0.1.6 - 2026-09-18
|
|
6
17
|
|
|
7
18
|
- 支持 DSH `0.1.6-alpha.2`,继续兼容 `0.1.0-rc.8`、`0.1.1-rc.2`、`0.1.2-rc.1`、`0.1.5-rc.1`、`0.1.5-rc.2` 和 `0.1.6-alpha.1`。
|
package/README.md
CHANGED
|
@@ -54,20 +54,20 @@ For a desktop workbench, download [DSH Codex Desktop](https://github.com/Micheng
|
|
|
54
54
|
## Prerequisites
|
|
55
55
|
|
|
56
56
|
- DeepSeek Harness is installed, `dsh` is available in your terminal, and the host provides the `commands` and `subprocess` services.
|
|
57
|
-
- Host peer dependencies declare `0.1.0-rc.8 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2`.
|
|
57
|
+
- Host peer dependencies declare `0.1.0-rc.8 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1`.
|
|
58
58
|
- Node.js >= 22.19 and Git on PATH.
|
|
59
59
|
- The current session is associated with a local Git project.
|
|
60
60
|
|
|
61
61
|
## Installation
|
|
62
62
|
|
|
63
|
-
The current version is `0.1.
|
|
63
|
+
The current version is `0.1.8`. The commands below use the `web` profile; replace it for your environment. Disable other plugins that register `/simplify` before installation.
|
|
64
64
|
|
|
65
65
|
### Ask an agent to install it (recommended)
|
|
66
66
|
|
|
67
67
|
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
68
|
|
|
69
69
|
```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.
|
|
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.8 --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
71
|
```
|
|
72
72
|
|
|
73
73
|
### Install from npm
|
|
@@ -76,19 +76,19 @@ Install the DSH plugin @michengai/dsh-simplify into my local web profile by runn
|
|
|
76
76
|
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
|
|
77
77
|
$OutputEncoding = [System.Text.Encoding]::UTF8
|
|
78
78
|
|
|
79
|
-
dsh plugin --profile web add @michengai/dsh-simplify@0.1.
|
|
79
|
+
dsh plugin --profile web add @michengai/dsh-simplify@0.1.8 --registry=https://registry.npmjs.org/
|
|
80
80
|
```
|
|
81
81
|
|
|
82
82
|
<details>
|
|
83
83
|
<summary>Install from a local package</summary>
|
|
84
84
|
|
|
85
|
-
Download the published tgz from the [GitHub Release](https://github.com/MichengAI/dsh-simplify/releases/tag/v0.1.
|
|
85
|
+
Download the published tgz from the [GitHub Release](https://github.com/MichengAI/dsh-simplify/releases/tag/v0.1.8), then run this from the package directory:
|
|
86
86
|
|
|
87
87
|
```powershell
|
|
88
88
|
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
|
|
89
89
|
$OutputEncoding = [System.Text.Encoding]::UTF8
|
|
90
90
|
|
|
91
|
-
dsh plugin --profile web add .\michengai-dsh-simplify-0.1.
|
|
91
|
+
dsh plugin --profile web add .\michengai-dsh-simplify-0.1.8.tgz --ignore-scripts
|
|
92
92
|
```
|
|
93
93
|
|
|
94
94
|
</details>
|
|
@@ -200,7 +200,7 @@ The entry point is `lib/index.js`, so build before installing. Keep the source d
|
|
|
200
200
|
|
|
201
201
|
### Verification
|
|
202
202
|
|
|
203
|
-
Development dependencies are pinned to DSH `0.1.
|
|
203
|
+
Development dependencies are pinned to DSH `0.1.7-alpha.1`.
|
|
204
204
|
|
|
205
205
|
```powershell
|
|
206
206
|
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
|
package/README.zh-CN.md
CHANGED
|
@@ -54,20 +54,20 @@
|
|
|
54
54
|
## 前置条件
|
|
55
55
|
|
|
56
56
|
- 已安装 DeepSeek Harness,可在终端执行 `dsh`,宿主提供 `commands` 和 `subprocess` 服务。
|
|
57
|
-
- 宿主 peer 依赖声明为 `0.1.0-rc.8 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2`。
|
|
57
|
+
- 宿主 peer 依赖声明为 `0.1.0-rc.8 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1`。
|
|
58
58
|
- Node.js >= 22.19,PATH 中可执行 Git。
|
|
59
59
|
- 当前会话关联本地 Git 项目。
|
|
60
60
|
|
|
61
61
|
## 安装
|
|
62
62
|
|
|
63
|
-
当前版本为 `0.1.
|
|
63
|
+
当前版本为 `0.1.8`。以下命令使用 `web` profile,请按实际环境替换。安装前停用其他注册 `/simplify` 的插件。
|
|
64
64
|
|
|
65
65
|
### 让 Agent 帮你安装(推荐)
|
|
66
66
|
|
|
67
67
|
把下面这段话发给任意能够执行本机终端命令的 Agent。将 `web` 替换为实际使用的 profile;安装完成后,在 DSH 中使用本插件。
|
|
68
68
|
|
|
69
69
|
```text
|
|
70
|
-
请将 DSH 插件 @michengai/dsh-simplify 安装到本机 web profile,执行:dsh plugin --profile web add @michengai/dsh-simplify@0.1.
|
|
70
|
+
请将 DSH 插件 @michengai/dsh-simplify 安装到本机 web profile,执行:dsh plugin --profile web add @michengai/dsh-simplify@0.1.8 --registry=https://registry.npmjs.org/。安装后执行 dsh --profile web --dump-config,确认配置包含 michengai-simplify,并告诉我如何重新加载 DSH 和开始使用。
|
|
71
71
|
```
|
|
72
72
|
|
|
73
73
|
### 手动从 npm 安装
|
|
@@ -76,19 +76,19 @@
|
|
|
76
76
|
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
|
|
77
77
|
$OutputEncoding = [System.Text.Encoding]::UTF8
|
|
78
78
|
|
|
79
|
-
dsh plugin --profile web add @michengai/dsh-simplify@0.1.
|
|
79
|
+
dsh plugin --profile web add @michengai/dsh-simplify@0.1.8 --registry=https://registry.npmjs.org/
|
|
80
80
|
```
|
|
81
81
|
|
|
82
82
|
<details>
|
|
83
83
|
<summary>从本地安装包安装</summary>
|
|
84
84
|
|
|
85
|
-
从 [GitHub Release](https://github.com/MichengAI/dsh-simplify/releases/tag/v0.1.
|
|
85
|
+
从 [GitHub Release](https://github.com/MichengAI/dsh-simplify/releases/tag/v0.1.8) 下载已发布的 tgz,然后在安装包所在目录执行:
|
|
86
86
|
|
|
87
87
|
```powershell
|
|
88
88
|
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
|
|
89
89
|
$OutputEncoding = [System.Text.Encoding]::UTF8
|
|
90
90
|
|
|
91
|
-
dsh plugin --profile web add .\michengai-dsh-simplify-0.1.
|
|
91
|
+
dsh plugin --profile web add .\michengai-dsh-simplify-0.1.8.tgz --ignore-scripts
|
|
92
92
|
```
|
|
93
93
|
|
|
94
94
|
</details>
|
|
@@ -200,7 +200,7 @@ dsh plugin --profile web add . --ignore-scripts
|
|
|
200
200
|
|
|
201
201
|
### 验证
|
|
202
202
|
|
|
203
|
-
开发依赖固定为 DSH `0.1.
|
|
203
|
+
开发依赖固定为 DSH `0.1.7-alpha.1`。
|
|
204
204
|
|
|
205
205
|
```powershell
|
|
206
206
|
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
|
package/lib/client.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
type Lookup = {
|
|
2
|
+
get?: (name: string) => unknown;
|
|
3
|
+
};
|
|
4
|
+
interface ClientScope extends Lookup {
|
|
5
|
+
inject?(deps: string[], callback: (scope: Lookup) => () => void): unknown;
|
|
6
|
+
effect?(fn: () => () => void): unknown;
|
|
7
|
+
}
|
|
8
|
+
/** 给宿主 `/simplify` 补官方图标和中英文标题;没有 commandUi 的旧宿主会跳过。 */
|
|
9
|
+
export declare function apply(ctx: ClientScope): unknown;
|
|
10
|
+
export {};
|
package/lib/client.js
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
window.__ModuleLoader__.load({id:"@michengai/dsh-simplify",factory:(require)=>{var module={exports:{}};var exports=module.exports;
|
|
2
|
+
"use strict";var k=Object.create;var s=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var y=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty;var h=(n,e)=>{for(var o in e)s(n,o,{get:e[o],enumerable:!0})},f=(n,e,o,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of g(e))!w.call(n,i)&&i!==o&&s(n,i,{get:()=>e[i],enumerable:!(t=m(e,i))||t.enumerable});return n};var v=(n,e,o)=>(o=n!=null?k(y(n)):{},f(e||!n||!n.__esModule?s(o,"default",{value:n,enumerable:!0}):o,n)),b=n=>f(s({},"__esModule",{value:!0}),n);var C={};h(C,{apply:()=>A});module.exports=b(C);var L=v(require("@deepseek-ai/dsh-client-ui-primitives"),1),d=L,j=d.IconEnhanceOutline16??d.IconEnhanceOutlineRegular,u={icon:j,zh:"\u7B80\u5316",en:"Simplify"};function S(n){let e=n.get?.("locale");return typeof e?.snapshot?.active=="string"&&/^en(?:-|$)/i.test(e.snapshot.active)}function p(n,e){let o=n,t=o?.candidates;return!o||typeof t!="function"?()=>{}:(o.candidates=async(...i)=>{let r=await t.apply(o,i);if(!Array.isArray(r))return r;let l=S(e);return r.map(a=>{if(!a||typeof a!="object"||!("name"in a)||typeof a.name!="string")return a;let c=a;return c.name!=="simplify"?c:{...c,...c.icon===void 0&&u.icon!==void 0?{icon:u.icon}:{},...c.label===void 0?{label:l?u.en:u.zh}:{}}})},()=>{o.candidates=t})}function A(n){return typeof n.inject=="function"?n.inject(["commandUi"],e=>p(e.get?.("commandUi"),n)):n.effect?.(()=>p(n.get?.("commandUi"),n))}
|
|
3
|
+
return module.exports;}});
|
|
4
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/client.ts"],
|
|
4
|
+
"sourcesContent": ["import * as primitives from '@deepseek-ai/dsh-client-ui-primitives';\n\n/** 0.1.6 \u5BFC\u51FA IconEnhanceOutline16\uFF1B0.1.7 \u6539\u4E3A Regular\uFF0C\u753B\u5E03\u4ECD\u662F 16\u3002 */\nconst icons = primitives as Record<string, unknown>;\nconst enhanceIcon = icons.IconEnhanceOutline16 ?? icons.IconEnhanceOutlineRegular;\n\n/** Host `/` \u884C\u6CA1\u6709 icon/label\uFF1B\u5B98\u65B9\u53EA\u7ED9\u4E00\u7B49\u547D\u4EE4\u753B\u8138\u3002\u540C\u540D\u8D21\u732E\u4F1A\u649E\u8F66\uFF0C\u53EA\u80FD\u8865 candidates\u3002 */\nconst FACE = { icon: enhanceIcon, zh: '\u7B80\u5316', en: 'Simplify' } as const;\n\ntype Lookup = { get?: (name: string) => unknown };\n\nfunction english(ctx: Lookup): boolean {\n const locale = ctx.get?.('locale') as { snapshot?: { active?: unknown } } | undefined;\n return typeof locale?.snapshot?.active === 'string' && /^en(?:-|$)/i.test(locale.snapshot.active);\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; label?: unknown };\n if (item.name !== 'simplify') return item;\n return {\n ...item,\n ...(item.icon === undefined && FACE.icon !== undefined ? { icon: FACE.icon } : {}),\n ...(item.label === undefined ? { label: en ? FACE.en : FACE.zh } : {}),\n };\n });\n };\n return () => { live.candidates = original; };\n}\n\ninterface ClientScope extends Lookup {\n inject?(deps: string[], callback: (scope: Lookup) => () => void): unknown;\n effect?(fn: () => () => void): unknown;\n}\n\n/** \u7ED9\u5BBF\u4E3B `/simplify` \u8865\u5B98\u65B9\u56FE\u6807\u548C\u4E2D\u82F1\u6587\u6807\u9898\uFF1B\u6CA1\u6709 commandUi \u7684\u65E7\u5BBF\u4E3B\u4F1A\u8DF3\u8FC7\u3002 */\nexport function apply(ctx: ClientScope): unknown {\n if (typeof ctx.inject === 'function') return ctx.inject(['commandUi'], scope => decorateSlashFace(scope.get?.('commandUi'), ctx));\n return ctx.effect?.(() => decorateSlashFace(ctx.get?.('commandUi'), ctx));\n}\n"],
|
|
5
|
+
"mappings": ";0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,WAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAA4B,sDAGtBC,EAAQD,EACRE,EAAcD,EAAM,sBAAwBA,EAAM,0BAGlDE,EAAO,CAAE,KAAMD,EAAa,GAAI,eAAM,GAAI,UAAW,EAI3D,SAASE,EAAQC,EAAsB,CACrC,IAAMC,EAASD,EAAI,MAAM,QAAQ,EACjC,OAAO,OAAOC,GAAQ,UAAU,QAAW,UAAY,cAAc,KAAKA,EAAO,SAAS,MAAM,CAClG,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,OAAIC,EAAK,OAAS,WAAmBA,EAC9B,CACL,GAAGA,EACH,GAAIA,EAAK,OAAS,QAAaZ,EAAK,OAAS,OAAY,CAAE,KAAMA,EAAK,IAAK,EAAI,CAAC,EAChF,GAAIY,EAAK,QAAU,OAAY,CAAE,MAAOF,EAAKV,EAAK,GAAKA,EAAK,EAAG,EAAI,CAAC,CACtE,CACF,CAAC,CACH,EACO,IAAM,CAAEM,EAAK,WAAaC,CAAU,EAC7C,CAQO,SAASZ,EAAMO,EAA2B,CAC/C,OAAI,OAAOA,EAAI,QAAW,WAAmBA,EAAI,OAAO,CAAC,WAAW,EAAGW,GAAST,EAAkBS,EAAM,MAAM,WAAW,EAAGX,CAAG,CAAC,EACzHA,EAAI,SAAS,IAAME,EAAkBF,EAAI,MAAM,WAAW,EAAGA,CAAG,CAAC,CAC1E",
|
|
6
|
+
"names": ["client_exports", "__export", "apply", "__toCommonJS", "primitives", "icons", "enhanceIcon", "FACE", "english", "ctx", "locale", "decorateSlashFace", "commandUi", "live", "original", "args", "rows", "en", "row", "item", "scope"]
|
|
7
|
+
}
|
package/lib/command.d.ts
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
import type { Context } from '@deepseek-ai/cordis';
|
|
2
2
|
import type { CommandInvocation, CommandResult } from '@deepseek-ai/dsh-commands';
|
|
3
|
+
declare module '@deepseek-ai/dsh-llm' {
|
|
4
|
+
interface MessageSourceMap {
|
|
5
|
+
/** 0.1.7 拒绝退役的 `kind: 'plugin'` 包装;这个生产者 kind 在更早的宿主里同样可以入队。 */
|
|
6
|
+
'michengai-simplify': {
|
|
7
|
+
readonly kind: 'michengai-simplify';
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
}
|
|
3
11
|
/** 执行一次交互式命令;错误只返回 UI,可靠范围才交给当前 Agent。 */
|
|
4
12
|
export declare function handleCommand(ctx: Pick<Context, 'subprocess'>, invocation: CommandInvocation, lifetime?: AbortSignal): Promise<CommandResult>;
|
package/lib/command.js
CHANGED
|
@@ -27,7 +27,7 @@ export async function handleCommand(ctx, invocation, lifetime) {
|
|
|
27
27
|
// followup 在当前宿主中同时负责持久入队与唤醒,避免直接操作 inbox 后缺少唤醒。
|
|
28
28
|
invocation.agent.followup(createUserMessage({
|
|
29
29
|
content: [{ type: 'text', text: prompt }],
|
|
30
|
-
source: { kind: '
|
|
30
|
+
source: { kind: 'michengai-simplify' },
|
|
31
31
|
}));
|
|
32
32
|
return { kind: 'success', text: `已提交 ${review.files.length} 个文件的简化审查${review.source === 'previous-commit' ? '(回看上一提交)' : ''}。${review.skipped.length ? `已跳过 ${review.skipped.length} 个不可编辑文件。` : ''}` };
|
|
33
33
|
}
|
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,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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 MessageSourceMap {\n /** 0.1.7 拒绝退役的 `kind: 'plugin'` 包装;这个生产者 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,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@michengai/dsh-simplify",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "DSH
|
|
3
|
+
"version": "0.1.8",
|
|
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": { "type": "git", "url": "git+https://github.com/MichengAI/dsh-simplify.git" },
|
|
6
6
|
"homepage": "https://github.com/MichengAI/dsh-simplify#readme",
|
|
7
7
|
"bugs": { "url": "https://github.com/MichengAI/dsh-simplify/issues" },
|
|
@@ -10,11 +10,23 @@
|
|
|
10
10
|
"engines": { "node": ">=22.19.0" },
|
|
11
11
|
"main": "./lib/index.js",
|
|
12
12
|
"types": "./lib/index.d.ts",
|
|
13
|
-
"exports": {
|
|
13
|
+
"exports": {
|
|
14
|
+
".": { "types": "./lib/index.d.ts", "default": "./lib/index.js" },
|
|
15
|
+
"./client": { "default": "./lib/client.js" }
|
|
16
|
+
},
|
|
14
17
|
"files": ["lib", "assets/branding/dsh-simplify-banner.png", "cordis.patch.yml", "README.md", "README.zh-CN.md", "LICENSE", "CHANGELOG.md", "CHANGELOG.zh-CN.md"],
|
|
15
|
-
"dsh": {
|
|
18
|
+
"dsh": {
|
|
19
|
+
"bundle": { "patch": "./cordis.patch.yml" },
|
|
20
|
+
"client": {
|
|
21
|
+
"platform": "web",
|
|
22
|
+
"inject": [
|
|
23
|
+
"@deepseek-ai/dsh-client-ui-commands",
|
|
24
|
+
"@deepseek-ai/dsh-client-ui-primitives"
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
},
|
|
16
28
|
"scripts": {
|
|
17
|
-
"build": "tsc -p tsconfig.json",
|
|
29
|
+
"build": "tsc -p tsconfig.json && node scripts/build-client.mjs",
|
|
18
30
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
19
31
|
"test": "npm run build && node --test tests/*.test.mjs",
|
|
20
32
|
"check": "npm run typecheck && npm test",
|
|
@@ -23,17 +35,26 @@
|
|
|
23
35
|
"publishConfig": { "access": "public", "registry": "https://registry.npmjs.org/" },
|
|
24
36
|
"peerDependencies": {
|
|
25
37
|
"@deepseek-ai/cordis": "^4.0.2",
|
|
26
|
-
"@deepseek-ai/dsh-commands": "0.1.0-rc.8 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2",
|
|
27
|
-
"@deepseek-ai/dsh-llm": "0.1.0-rc.8 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2",
|
|
28
|
-
"@deepseek-ai/dsh-subprocess": "0.1.0-rc.8 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2"
|
|
38
|
+
"@deepseek-ai/dsh-commands": "0.1.0-rc.8 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1",
|
|
39
|
+
"@deepseek-ai/dsh-llm": "0.1.0-rc.8 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1",
|
|
40
|
+
"@deepseek-ai/dsh-subprocess": "0.1.0-rc.8 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1",
|
|
41
|
+
"@deepseek-ai/dsh-client-ui-commands": "0.1.6-alpha.2 || 0.1.7-alpha.1",
|
|
42
|
+
"@deepseek-ai/dsh-client-ui-primitives": "0.1.6-alpha.2 || 0.1.7-alpha.1"
|
|
43
|
+
},
|
|
44
|
+
"peerDependenciesMeta": {
|
|
45
|
+
"@deepseek-ai/dsh-client-ui-commands": { "optional": true },
|
|
46
|
+
"@deepseek-ai/dsh-client-ui-primitives": { "optional": true }
|
|
29
47
|
},
|
|
30
48
|
"devDependencies": {
|
|
31
|
-
"@deepseek-ai/cordis": "4.0.
|
|
32
|
-
"@deepseek-ai/dsh-commands": "0.1.
|
|
33
|
-
"@deepseek-ai/dsh-
|
|
34
|
-
"@deepseek-ai/dsh-
|
|
35
|
-
"@deepseek-ai/dsh-
|
|
49
|
+
"@deepseek-ai/cordis": "4.0.3",
|
|
50
|
+
"@deepseek-ai/dsh-client-ui-commands": "0.1.7-alpha.1",
|
|
51
|
+
"@deepseek-ai/dsh-client-ui-primitives": "0.1.7-alpha.1",
|
|
52
|
+
"@deepseek-ai/dsh-commands": "0.1.7-alpha.1",
|
|
53
|
+
"@deepseek-ai/dsh-llm": "0.1.7-alpha.1",
|
|
54
|
+
"@deepseek-ai/dsh-subprocess": "0.1.7-alpha.1",
|
|
55
|
+
"@deepseek-ai/dsh-subprocess-local": "0.1.7-alpha.1",
|
|
36
56
|
"@types/node": "^22.19.0",
|
|
57
|
+
"esbuild": "^0.25.0",
|
|
37
58
|
"typescript": "~5.7.2"
|
|
38
59
|
}
|
|
39
60
|
}
|