dsh-mobile-plugin 0.5.18 → 0.5.20

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.
@@ -110,14 +110,23 @@
110
110
  config:
111
111
  - id: tool-subagent-control
112
112
  name: '@deepseek-ai/dsh-tool-subagent-control'
113
+ # 独立的 `list_agents` 入口只在 0.2.1 及更早存在;0.2.2 把它并进了主包,
114
+ # 子路径没了。这一行保留是为了老运行时,启动时宿主会按「这一代认不认这个
115
+ # 子路径」把副本里的这一行整行拿掉(见 lib/host-compat.cjs 的 dropRows)。
113
116
  - id: tool-subagent-list-agents
114
117
  name: '@deepseek-ai/dsh-tool-subagent-control/list-agents'
118
+ # 子代理挑模型的开关,两代运行时键名不同:0.2.1 及更早读
119
+ # `modelSelectionSettings`,0.2.2 起改成 `modelSelection`(另加
120
+ # `modelDiscovery` 才让模型查得到可选模型)。两个键都写:各自的 schema 只认
121
+ # 自己那个、另一个原样忽略,所以同一份预设挂到哪一代都对。
115
122
  - id: tool-subagent
116
123
  name: '@deepseek-ai/dsh-tool-subagent'
117
124
  config:
118
125
  provider: spawn
119
126
  toolName: subagent
120
127
  modelSelectionSettings: true
128
+ modelSelection: true
129
+ modelDiscovery: true
121
130
  backgroundMode: continuable
122
131
  - id: tool-subagent-fork
123
132
  name: '@deepseek-ai/dsh-tool-subagent'
package/host.js CHANGED
@@ -20,7 +20,7 @@ import { installProcessGuard } from './lib/host-guard.cjs'
20
20
  import { DIRECTORY_PICKER_ROW, TOOL_ROWS, pinInsertedRows, syncPresetDir } from './lib/host-compat.cjs'
21
21
  import { dropBareNameSelfMounts } from './lib/host-patches.cjs'
22
22
  import {
23
- assertEntriesActivated,
23
+ auditStartupEntries as assertEntriesActivated,
24
24
  boot,
25
25
  evaluatePluginCompatibility,
26
26
  getDshRuntimeVersion,
@@ -29,11 +29,19 @@ import {
29
29
  loadLayeredEnv,
30
30
  loadOverlayPatches,
31
31
  loadProfile,
32
- PROFILE_TEMPLATES,
33
32
  readProfileCompatibility,
34
33
  resolveProfileDir,
35
34
  } from '@deepseek-ai/dsh-app-boot'
36
35
 
36
+ /**
37
+ * 新建 profile 时的初始组合层。
38
+ *
39
+ * 不从 `dsh-app-boot` 取 `PROFILE_TEMPLATES`:0.2.2 把这份清单挪进了
40
+ * `@deepseek-ai/dsh-official-bundles`,旧位置不再导出,而静态导入一个不存在的
41
+ * 命名导出是让整个宿主起不来(不是降级)。这里本来就只要 web 那一档的两行。
42
+ */
43
+ const WEB_PROFILE_BUNDLES = ['@deepseek-ai/dsh-base', '@deepseek-ai/dsh-web-app']
44
+
37
45
  const BIN_NAME = 'dsh-mobile-plugin'
38
46
  const PROFILE_NAME = process.env.DSH_MOBILE_PROFILE || 'mobile'
39
47
  const PACKAGE_DIR = dirname(fileURLToPath(import.meta.url))
@@ -58,7 +66,7 @@ try {
58
66
  const home = process.env.DSH_HOME
59
67
  const profileDir = resolveProfileDir(PROFILE_NAME, home)
60
68
  // Idempotent: an already-initialized profile keeps its own patch layer.
61
- initProfile(profileDir, PROFILE_TEMPLATES.web)
69
+ initProfile(profileDir, WEB_PROFILE_BUNDLES)
62
70
  const profile = loadProfile(BIN_NAME, PROFILE_NAME, INSTALL_ANCHOR, home, { userLayer: true })
63
71
 
64
72
  /**
@@ -142,6 +150,19 @@ try {
142
150
  )
143
151
  }
144
152
 
153
+ // 预设里「列子代理」那一行挂的是 `dsh-tool-subagent-control` 的一个子入口。
154
+ // 0.2.2 把那个工具并进了主包,子路径没有了 —— 留着它,每建一个会话都会有一行
155
+ // 起不来,而能力本身还在。判据是**这一代运行时认不认这个子路径**,不按版本号猜。
156
+ const listAgentsEntry = '@deepseek-ai/dsh-tool-subagent-control/list-agents'
157
+ let listAgentsRowGone = false
158
+ try {
159
+ runtimeRequire?.resolve(listAgentsEntry)
160
+ } catch {
161
+ listAgentsRowGone = true
162
+ process.stderr.write(`${BIN_NAME}: 这一代运行时没有 ${listAgentsEntry}(该工具已并在主包里),预设副本里那一行不再挂\n`)
163
+ }
164
+ const dropPresetIds = listAgentsRowGone ? ['tool-subagent-list-agents'] : []
165
+
145
166
  // 预设里的两行默认按裸名写:Loader 从它自己的位置解析,命中哪一份不由我们决定。
146
167
  // 解析到了同代的那份就改写一份副本给它,路径写死成那一份的入口。
147
168
  const presetRoots = {}
@@ -149,11 +170,12 @@ try {
149
170
  const hit = pinnedRows.get(id)
150
171
  if (hit) presetRoots[id] = hit.entry
151
172
  }
152
- const presetDir = TOOL_ROWS.some(({ id }) => presetRoots[id] !== undefined)
173
+ const presetDir = TOOL_ROWS.some(({ id }) => presetRoots[id] !== undefined) || dropPresetIds.length > 0
153
174
  ? syncPresetDir(
154
175
  join(PACKAGE_DIR, 'config', 'agent-presets'),
155
176
  join(profileDir, '.mobile-agent-presets'),
156
177
  presetRoots,
178
+ { dropIds: dropPresetIds },
157
179
  )
158
180
  : join(PACKAGE_DIR, 'config', 'agent-presets')
159
181