dsh-code 1.0.5 → 1.0.6

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.md CHANGED
@@ -7,7 +7,7 @@
7
7
  <p align="center"><img alt="Typing SVG" src="https://readme-typing-svg.herokuapp.com?font=JetBrains+Mono&amp;weight=500&amp;size=22&amp;duration=4000&amp;pause=700&amp;color=4176E6&amp;center=true&amp;vCenter=true&amp;width=680&amp;lines=DeepSeek+Harness+Code;DSH+%E5%86%85%E6%A0%B8%E7%9A%84%E7%BB%88%E7%AB%AF%E7%BC%96%E7%A0%81%E7%95%8C%E9%9D%A2"></p>
8
8
  <p align="center">
9
9
  <a href="https://github.com/deepseek-ai/deepseek-harness"><img alt="DeepSeek Harness" src="https://img.shields.io/badge/DeepSeek-Harness-4176E6?style=for-the-badge&amp;logo=deepseek&amp;logoColor=white&amp;labelColor=1c1917"></a>
10
- <a href="https://www.npmjs.com/package/@deepseek-ai/dsh"><img alt="dsh version" src="https://img.shields.io/badge/dsh-0.1.1--rc.2-4176E6?style=for-the-badge&amp;logo=deepseek&amp;logoColor=white&amp;labelColor=1c1917"></a>
10
+ <a href="https://www.npmjs.com/package/@deepseek-ai/dsh"><img alt="dsh version" src="https://img.shields.io/badge/dsh-0.1.5--rc.1-4176E6?style=for-the-badge&amp;logo=deepseek&amp;logoColor=white&amp;labelColor=1c1917"></a>
11
11
  <a href="https://github.com/UNLINEARITY/dsh-code/stargazers"><img alt="GitHub stars" src="https://img.shields.io/github/stars/UNLINEARITY/dsh-code?label=Stars&amp;style=for-the-badge&amp;logo=github&amp;logoColor=white&amp;color=4176E6&amp;labelColor=1c1917"></a>
12
12
  <a href="https://www.npmjs.com/package/dsh-code"><img alt="npm version" src="https://img.shields.io/npm/v/dsh-code?label=npm&amp;style=for-the-badge&amp;logo=npm&amp;color=cb3837&amp;labelColor=1c1917"></a>
13
13
  <a href="https://github.com/UNLINEARITY/dsh-code/blob/main/LICENSE"><img alt="License" src="https://img.shields.io/github/license/UNLINEARITY/dsh-code?label=License&amp;style=for-the-badge&amp;logo=opensourceinitiative&amp;color=4176E6&amp;labelColor=1c1917"></a>
@@ -25,23 +25,23 @@ DeepSeek Harness 将模型、工具、存储、策略和界面作为插件,通
25
25
 
26
26
  ## 二、快速开始
27
27
 
28
- 需要 Node `^22.19 || >=24` 和预览版 `dsh` CLI(当前版本线:`@deepseek-ai/dsh@0.1.2-rc.1`)。未配置模型时仍可进入 TUI、查看会话和使用非模型功能;在 `/model` 中按 Tab 进入供应商管理,配置 API key、OAuth 与设备码登录。
28
+ 需要 Node `^22.19 || >=24` 和预览版 `dsh` CLI(当前版本线:`@deepseek-ai/dsh@0.1.5-rc.1`)。未配置模型时仍可进入 TUI、查看会话和使用非模型功能;在 `/model` 中按 Tab 进入供应商管理,配置 API key、OAuth 与设备码登录。
29
29
 
30
30
  ### 1. 安装与更新
31
31
 
32
32
  初次安装和更新使用同一组指令:
33
33
 
34
34
  ```sh
35
- npm install -g @deepseek-ai/dsh@0.1.2-rc.1 dsh-code@1.0.5
35
+ npm install -g @deepseek-ai/dsh@0.1.5-rc.1 dsh-code@1.0.6
36
36
  npm install -g pnpm
37
- dsh plugin --profile cli add dsh-code@1.0.5
37
+ dsh plugin --profile cli add dsh-code@1.0.6
38
38
  ```
39
39
 
40
- > 提示:pnpm 会忽略发布不足 24 小时的包,因此发布首日请使用精确版本 `dsh-code@1.0.5`;24 小时后可省略版本号。npm 安装不受此限制。
40
+ > 提示:pnpm 会忽略发布不足 24 小时的包,因此发布首日请使用精确版本 `dsh-code@1.0.6`;24 小时后可省略版本号。npm 安装不受此限制。
41
41
  >
42
- > 版本对齐:dsh-code 1.0.5 面向 dsh `0.1.2-rc.1` 构建,全部 Harness 依赖均精确锁定为 `0.1.2-rc.1`。已安装的用户运行 `deepseek update --apply` 即可按同一条版本线一起升级全局宿主与 cli profile 中的插件,本地开发挂载(`link:`)不受影响。
42
+ > 版本对齐:dsh-code 面向 dsh `0.1.5-rc.1` 构建,全部 Harness 依赖均精确锁定为 `0.1.5-rc.1`。已安装的用户运行 `deepseek update --apply` 即可按同一条版本线一起升级全局宿主与 cli profile 中的插件,本地开发挂载(`link:`)不受影响。
43
43
  >
44
- > 升级说明:上游从本版本起将内置 `code` 预设更名为 `ptc`;旧会话与旧参数中记录的 `code` 会自动映射到 `ptc`,无需手动迁移。
44
+ > 升级说明:旧会话与旧参数中记录的 `code` 预设会自动映射到上游已改名的 `ptc`,无需手动迁移。会话日志读取端随上游升级到格式 v3:旧格式日志在读取时由内核自动迁移,磁盘上的原始文件保持不变。
45
45
 
46
46
  ### 2. 启动指令
47
47
 
@@ -79,7 +79,7 @@ DSH-Code 的重点是让 DSH 的 Agent、模型、工具和持久会话可以直
79
79
  ### 2. Agent、模型与扩展
80
80
 
81
81
  - 每个会话可以选择独立的 Agent Preset,用于组合工具、提示词、技能、上下文压缩、plan mode 和 subagent 能力
82
- - 使用 `/mode` 选择 `standard`、`code`、`minimal`、`cordis` 或用户自定义 Preset
82
+ - 使用 `/mode` 选择 `standard`、`ptc`、`minimal`、`cordis` 或用户自定义 Preset(旧名称 `code` 自动映射到 `ptc`)
83
83
  - 使用 `/model` 切换模型,管理 provider、API key、OAuth/设备码登录、endpoint、可用模型和上下文窗口;`Tab` 进入 provider 管理(已配置供应商置顶分组),任意阶段 `Ctrl+C` 直接退出整个 /model 流程
84
84
  - 在 provider 列表中,Enter 进入统一配置页:同页填写 API key 与 endpoint(留空即官方默认)、编辑已添加模型的上下文/输出窗口,`Tab` 进入发现页拉取端点真实可用模型并勾选添加
85
85
  - 在统一配置页的模型行上按 `e` 编辑推理档位声明(格式 `low:low high:high max:max`,`false` 禁用、留空恢复继承),按 `c` 从其他已声明模型逐字复制——例如 GLM 系列按官方三档写 `low:low high:high max:max`,新模型(如 gpt-6)可一键复制 gpt-5.6 的映射
@@ -111,7 +111,7 @@ DSH-Code 的重点是让 DSH 的 Agent、模型、工具和持久会话可以直
111
111
  ### 4. 编码工作流
112
112
 
113
113
  - 使用 `@` 引用工作区文件或已有会话;选择 PNG、JPEG、WebP、GIF 时会自动作为真实图片附件
114
- - 支持启动 prompt、多个 `--image` 参数,以及从终端拖入一张或多张图片
114
+ - 支持启动 prompt、多个 `--image` 参数,以及从终端拖入或粘贴附件:图片按图片附件发送,其他文件按原样文件附件发送(单文件 8 MiB、每条消息 8 个以内)
115
115
  - 使用 `/diff` 按文件检查改动,使用 `/review` 发起只读代码审查
116
116
  - 使用 `/copy` 复制最近一条完整回复,使用 Ctrl+O 查看完整历史和工具详情
117
117
  - 支持工具审批、结构化提问、plan review、多选和自定义答案
@@ -174,6 +174,7 @@ dsh --profile cli --session my-id # 使用指定 id 新建会话
174
174
  | `/statusline` | 选择状态栏显示的项目 |
175
175
  | `/vscode-keys` | 将 Ctrl+R 放行进 VS Code 系终端(幂等写入用户级 keybindings.json) |
176
176
  | `/theme` | 切换终端配色主题 |
177
+ | `/animation` | 开关计时动画(shimmer/追逐/闪烁/切换波浪),`/animation [on\|off]` |
177
178
  | `/help` | 查看快捷键、内置命令、Harness 命令和用户技能 |
178
179
  | `/quit` | 退出 DSH-Code |
179
180
 
@@ -216,8 +217,8 @@ DSH-Code 读取 Harness 的实时注册表,不在本地维护另一套副本
216
217
  Host 持有共享基础设施——注册表、持久化、会话查询、权限和 sandbox 策略;每个会话则获得一个隔离的 Agent scope,并由 **Agent Preset** 进行组合:
217
218
 
218
219
  - `standard`——功能完整的通用编码 Agent
219
- - `code`——面向 Code Mode / PTC 的多操作工作流
220
- - `minimal`——只保留持久 shell 和 `str_replace_editor`
220
+ - `ptc`——面向 PTC(原 Code Mode)的多操作工作流;旧名称 `code` 仍可使用
221
+ - `minimal`——仅保留持久 shell 的单工具精简组合
221
222
  - `cordis`——完整 Agent,加上运行时检查与 Preset 编写指导
222
223
  - 用户预设——自行定义工具、提示词段落、技能、上下文压缩、plan mode 与 subagent 行为
223
224
 
@@ -225,7 +226,7 @@ Host 持有共享基础设施——注册表、持久化、会话查询、权限
225
226
 
226
227
  ### 3. 会话记录与恢复
227
228
 
228
- 提示词、流式 chunk、工具调用与结果、模型选择、plan 状态、权限、标题和 preset 选择都由持久 Session 事件投影得到。会话恢复、导出、历史检查、上下文统计和终端重放使用同一份记录。
229
+ 提示词、工具调用与结果、模型选择、plan 状态、权限、标题和 preset 选择都由持久 Session 事件投影得到;会话恢复、导出、历史检查、上下文统计和终端重放使用同一份记录。实时流式文本经进程内流帧呈现,落盘日志只保留装配完成的回复(内嵌计时流),两者在重放时得到同一视图。
229
230
 
230
231
  React state 只保存输入草稿、光标、当前面板、选中项和滚动位置等临时界面状态。
231
232
 
package/bin/deepseek.mjs CHANGED
@@ -73,6 +73,37 @@ export function profileMountedVersion(profileDir = cliProfileDir(), fileExists =
73
73
  }
74
74
  }
75
75
 
76
+ /**
77
+ * Profile-installed harness plugins that a line upgrade must carry along:
78
+ * every `@deepseek-ai/dsh-*` dependency except the dsh-code target itself
79
+ * and local checkouts (`link:`/`file:` stay untouched). Users install these
80
+ * through `dsh plugin add` once; without this pass `update --apply` would
81
+ * move the host and dsh-code forward and silently leave every other plugin
82
+ * pinned to the old line.
83
+ * @param profileDir - the cli profile root.
84
+ * @returns dependency entries as `{ name, spec }` in manifest order.
85
+ */
86
+ export function profilePluginDependencies(profileDir = cliProfileDir(), fileExists = existsSync, readFile = readFileSync) {
87
+ const manifest = join(profileDir, 'package.json')
88
+ if (!fileExists(manifest)) return []
89
+ let dependencies
90
+ try {
91
+ dependencies = JSON.parse(readFile(manifest, 'utf8'))?.dependencies
92
+ } catch {
93
+ return []
94
+ }
95
+ if (typeof dependencies !== 'object' || dependencies === null) return []
96
+ const plugins = []
97
+ for (const [name, spec] of Object.entries(dependencies)) {
98
+ if (typeof spec !== 'string') continue
99
+ if (!name.startsWith('@deepseek-ai/dsh-')) continue
100
+ if (name === 'dsh-code' || name === '@deepseek-ai/dsh-base') continue
101
+ if (/^(link|file):/iu.test(spec)) continue
102
+ plugins.push({ name, spec })
103
+ }
104
+ return plugins
105
+ }
106
+
76
107
  /** The harness release line a dsh-code release expects, read from its peers. */
77
108
  export function harnessLineFromPeers(peers) {
78
109
  if (typeof peers !== 'object' || peers === null) return undefined
@@ -90,14 +121,67 @@ export function harnessLineFromPeers(peers) {
90
121
  * so the launcher can never move ahead of the plugin it must boot. A
91
122
  * profile that mounts a local checkout (link:/file:) keeps its mount.
92
123
  */
93
- export function updatePlan({ latestCode, peers, profileSpec }) {
124
+ export function updatePlan({ latestCode, peers, profileSpec, profilePlugins = [] }) {
94
125
  const line = harnessLineFromPeers(peers)
126
+ const profileStep = !(typeof profileSpec === 'string' && /^(link|file):/iu.test(profileSpec))
95
127
  return {
96
128
  dshSpec: line === undefined ? '@deepseek-ai/dsh@latest' : `@deepseek-ai/dsh@${line}`,
129
+ line: line === undefined ? undefined : line,
97
130
  lineLocked: line !== undefined,
98
131
  codeSpec: `dsh-code@${latestCode}`,
99
- profileStep: !(typeof profileSpec === 'string' && /^(link|file):/iu.test(profileSpec)),
132
+ profileStep,
133
+ // Companion plugins the profile installed through `dsh plugin add`:
134
+ // carried to the same line so one command moves the whole profile.
135
+ pluginSpecs: line === undefined || !profileStep ? [] : profilePlugins
136
+ .filter(plugin => plugin.spec !== line)
137
+ .map(plugin => `${plugin.name}@${line}`),
138
+ }
139
+ }
140
+
141
+ /**
142
+ * Compare two @deepseek-ai/dsh release-line versions (`0.1.x`, `0.1.x-rc.N`,
143
+ * `0.1.x-alpha.N`). Positive when `left` is newer, negative when older, and 0
144
+ * on equality or an unparseable value (an unreadable version never blocks an
145
+ * update — release semantics follow semver prerelease ordering: final > rc >
146
+ * beta > alpha).
147
+ */
148
+ export function compareHarnessLines(left, right) {
149
+ const parse = (value) => {
150
+ const match = /^(\d+)\.(\d+)\.(\d+)(?:-(alpha|beta|rc)\.(\d+))?$/.exec(String(value))
151
+ if (match === null) return undefined
152
+ return {
153
+ core: [Number(match[1]), Number(match[2]), Number(match[3])],
154
+ tag: match[4] === undefined ? 3 : { alpha: 0, beta: 1, rc: 2 }[match[4]],
155
+ num: match[5] === undefined ? 0 : Number(match[5]),
156
+ }
157
+ }
158
+ const a = parse(left)
159
+ const b = parse(right)
160
+ if (a === undefined || b === undefined) return 0
161
+ for (let index = 0; index < 3; index += 1) {
162
+ if (a.core[index] !== b.core[index]) return a.core[index] - b.core[index]
163
+ }
164
+ if (a.tag !== b.tag) return a.tag - b.tag
165
+ return a.num - b.num
166
+ }
167
+
168
+ /**
169
+ * The globally installed @deepseek-ai/dsh version, when one exists across the
170
+ * npm global roots this launcher may boot from. An update whose plan targets a
171
+ * line OLDER than this would silently downgrade the booted host.
172
+ */
173
+ export function installedGlobalDshVersion(roots = globalDshRoots(), fileExists = existsSync, readFile = readFileSync) {
174
+ for (const root of roots) {
175
+ const manifest = join(root, 'node_modules', '@deepseek-ai', 'dsh', 'package.json')
176
+ if (!fileExists(manifest)) continue
177
+ try {
178
+ const version = JSON.parse(readFile(manifest, 'utf8'))?.version
179
+ if (typeof version === 'string' && version !== '') return version
180
+ } catch {
181
+ // Unreadable manifest: try the next root.
182
+ }
100
183
  }
184
+ return undefined
101
185
  }
102
186
 
103
187
  /** Run wrapper-owned child steps in order, stopping at the first failure. */
@@ -319,10 +403,27 @@ async function applyUpdate({
319
403
  return
320
404
  }
321
405
  const peers = view([`dsh-code@${latestCode}`, 'peerDependencies'], undefined, npm)
322
- const plan = updatePlan({ latestCode, peers, profileSpec: profileDependencySpec() })
406
+ const plan = updatePlan({
407
+ latestCode,
408
+ peers,
409
+ profileSpec: profileDependencySpec(),
410
+ profilePlugins: profilePluginDependencies(),
411
+ })
323
412
  if (!plan.lineLocked) {
324
413
  console.log('dsh-code: could not read the compatible harness line; installing @deepseek-ai/dsh@latest')
325
414
  }
415
+ // Downgrade guard: the latest published dsh-code may still pin an older
416
+ // harness line than the host already installed globally (a release-ordering
417
+ // window). Installing would silently downgrade every existing session's
418
+ // booted host, and a link-mounted profile would end up on a mismatched pair
419
+ // with no warning — refuse instead and name the manual command.
420
+ const installed = installedGlobalDshVersion()
421
+ if (plan.line !== undefined && installed !== undefined && compareHarnessLines(plan.line, installed) < 0) {
422
+ console.error(`dsh-code: dsh-code@${latestCode} needs @deepseek-ai/dsh@${plan.line}, but ${installed} is already installed globally`)
423
+ console.error(`dsh-code: refusing to downgrade the host; to proceed anyway run: npm install -g @deepseek-ai/dsh@${plan.line} dsh-code@${latestCode}`)
424
+ process.exitCode = 1
425
+ return
426
+ }
326
427
  const steps = [{ command: npm.command, args: [...npm.args, 'install', '-g', plan.dshSpec, plan.codeSpec], label: 'npm install' }]
327
428
  if (plan.profileStep) {
328
429
  const command = resolveCommand(['plugin', '--profile', 'cli', 'add', plan.codeSpec])
@@ -332,6 +433,20 @@ async function applyUpdate({
332
433
  return
333
434
  }
334
435
  steps.push({ command: command.command, args: command.args, label: 'dsh plugin add' })
436
+ // Companion plugins ride the same line: without this, `dsh plugin add`-ed
437
+ // extras stay pinned to the old harness line after an upgrade.
438
+ for (const pluginSpec of plan.pluginSpecs) {
439
+ const pluginCommand = resolveCommand(['plugin', '--profile', 'cli', 'add', pluginSpec])
440
+ if (pluginCommand === undefined) {
441
+ console.error(`dsh-code: could not resolve the dsh command for ${pluginSpec}`)
442
+ process.exitCode = 1
443
+ return
444
+ }
445
+ steps.push({ command: pluginCommand.command, args: pluginCommand.args, label: `dsh plugin add ${pluginSpec}` })
446
+ }
447
+ if (plan.pluginSpecs.length > 0) {
448
+ console.log(`carrying ${plan.pluginSpecs.length} profile plugin${plan.pluginSpecs.length === 1 ? '' : 's'} to the same line: ${plan.pluginSpecs.join(', ')}`)
449
+ }
335
450
  } else {
336
451
  console.log('cli profile mounts a local checkout; leaving the profile untouched')
337
452
  }
package/cordis.patch.yml CHANGED
@@ -7,9 +7,12 @@
7
7
  # dispatches slash commands through the shared registry, and folds submitted
8
8
  # prompts back into the same durable session until the user quits.
9
9
 
10
+ # 0.1.5 split the deployment persona into a prefix and a suffix template
11
+ # around the first-party guidance sections; this terminal keeps its identity
12
+ # line as the prefix ({{variable}} interpolation stays strict upstream).
10
13
  - id: system-prompt
11
14
  config:
12
- persona: >-
15
+ personaPrefix: >-
13
16
  You are a coding agent powered by the {{model}} model. Your working directory is {{cwd}}.
14
17
 
15
18
  # The shared module-reload HMR row stays off; the launcher's watch-only
@@ -34,10 +37,14 @@
34
37
  disabled: true
35
38
  - id: tool-fs-search
36
39
  disabled: true
37
- - id: tool-str-replace-editor
38
- disabled: true
40
+ # skill-filesystem stays ENABLED on the host: it only feeds the skill
41
+ # REGISTRY (local-root discovery), never the model-facing tool surface —
42
+ # tool-skill below stays disabled and presets mount it per session. The
43
+ # terminal offers skills in the slash menu before any session exists, and a
44
+ # bare launch has no preset layer yet, so the registry's global layer needs
45
+ # this provider; presets shadow it with the same discovery on their scope.
39
46
  - id: skill-filesystem
40
- disabled: true
47
+ disabled: false
41
48
  - id: tool-skill
42
49
  disabled: true
43
50
  - id: command-goal
@@ -70,9 +77,11 @@
70
77
  disabled: true
71
78
  - id: tool-todo
72
79
  disabled: true
73
- # tool-web keeps the 0.1.2-rc.1 base default (web_fetch enabled over the
80
+ # tool-web keeps the 0.1.5-rc.1 base default (web_fetch enabled over the
74
81
  # bundled web-fetch-http provider): the host row exposes web_fetch while the
75
- # per-preset agent-plane rows keep their own fetch stance.
82
+ # per-preset agent-plane rows keep their own fetch stance. The upstream base
83
+ # bundle dropped tool-str-replace-editor entirely in 0.1.5 (the minimal
84
+ # preset became a single-tool composition), so this patch no longer lists it.
76
85
 
77
86
  - insert:
78
87
  # Code Mode is a core execution capability, not a Web component.
@@ -111,7 +120,8 @@
111
120
  # tool-subagent rows set `modelSelectionSettings: true`, whose start
112
121
  # resolves this service and fails the whole preset mount when absent
113
122
  # ("failed to apply loader entry delegation (cordis:group)"). The upstream
114
- # web-app bundle adds this host row in 0.1.2-rc.1; dsh-base does not ship it.
123
+ # web-app bundle carries this host row in 0.1.5-rc.1; dsh-base still does
124
+ # not ship it.
115
125
  - id: subagent-model-selection-settings
116
126
  name: '@deepseek-ai/dsh-tool-subagent/model-selection-settings'
117
127