@aipanel/provider-deepseek 1.2.8 → 1.2.10

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/es/api.d.ts CHANGED
@@ -56,11 +56,6 @@ export declare class DeepSeekAPI {
56
56
  createSession(projectDir: string, retries?: number): Promise<{
57
57
  sessionId: string;
58
58
  }>;
59
- /**
60
- * 通过 dsh settings/mutate 应用 providerOptions 指定的用户设置(逐命名空间幂等 patch)。
61
- * dsh 启动初期 API 未就绪,整体带重试;单个命名空间不存在会导致该次调用失败重试。
62
- */
63
- applySettings(sections: Record<string, Record<string, unknown>>, retries?: number): Promise<void>;
64
59
  /** 归档会话(dsh 无硬删除,仅归档;幂等) */
65
60
  archiveSession(sessionId: string, retries?: number): Promise<void>;
66
61
  /**
package/es/api.js CHANGED
@@ -3,7 +3,7 @@ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { en
3
3
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
4
  import http from "http";
5
5
  import { randomUUID } from "node:crypto";
6
- import { DEFAULT_RETRIES, RETRY_DELAY, sleep } from "@aipanel/core";
6
+ import { DEFAULT_RETRIES, withRetries } from "@aipanel/core";
7
7
  import { PerformanceTimer, createLogger } from "@aipanel/core/node";
8
8
  import { DSH_API_BASE, DSH_REMOTE_MUX_PATH } from "./constants.js";
9
9
  const log = createLogger("DeepSeekAPI");
@@ -149,11 +149,9 @@ class DeepSeekAPI {
149
149
  * sessionId === activeSessionId(当前选中会话,对应 UI 的 New Session 占位行)时展示。
150
150
  */
151
151
  async listSessions(projectDir, activeSessionId, retries = DEFAULT_RETRIES) {
152
- const timer = log.timer("listSessions", { projectDir, activeSessionId, retries });
153
- let lastError = null;
154
- for (let i = 0; i < retries; i++) {
155
- try {
156
- log.debug(`Attempt ${i + 1}/${retries}`, { method: "session/list", projectDir });
152
+ return withRetries(
153
+ async (attempt) => {
154
+ log.debug(`Attempt ${attempt + 1}/${retries}`, { method: "listSessions" });
157
155
  const workspaces = await this.fetchWorkspaceBaseline();
158
156
  const matchedWorkspace = workspaces.items.find((w) => w.path === projectDir);
159
157
  const ownedByWorkspace = new Set(matchedWorkspace?.sessionIds ?? []);
@@ -169,105 +167,54 @@ class DeepSeekAPI {
169
167
  return false;
170
168
  });
171
169
  const result = filtered.sort((a, b) => b.updatedAt - a.updatedAt);
172
- timer.end(`Found ${result.length} sessions`);
173
170
  return result;
174
- } catch (e) {
175
- lastError = e instanceof Error ? e : new Error(String(e));
176
- log.debug(`Attempt ${i + 1} failed: ${lastError.message}`, { method: "listSessions" });
177
- if (i < retries - 1) {
178
- await sleep(RETRY_DELAY);
179
- }
171
+ },
172
+ {
173
+ attempts: retries,
174
+ onRetry: (n, e) => log.debug(`Attempt ${n} failed: ${e instanceof Error ? e.message : String(e)}`, {
175
+ method: "listSessions"
176
+ })
180
177
  }
181
- }
182
- timer.end("\u274C All retries exhausted");
183
- throw lastError;
178
+ );
184
179
  }
185
180
  /** 在当前目录下创建会话(dsh 仅返回 { sessionId, agentPreset? },非完整 SessionSummary)。
186
181
  * 与旧逻辑一致:先确保 projectDir 对应的 workspace 存在(workspace/create 幂等 get-or-create),
187
182
  * 再用 workspaceId 调 session/create,让新会话挂到该 workspace。 */
188
183
  async createSession(projectDir, retries = DEFAULT_RETRIES) {
189
- const timer = log.timer("createSession", { projectDir, retries });
190
- let lastError = null;
191
- for (let i = 0; i < retries; i++) {
192
- try {
193
- log.debug(`Attempt ${i + 1}/${retries}`, {
194
- method: "session/create",
195
- projectDir
196
- });
184
+ return withRetries(
185
+ async (attempt) => {
186
+ log.debug(`Attempt ${attempt + 1}/${retries}`, { method: "createSession" });
197
187
  const { workspace } = await this.call("workspace/create", {
198
188
  request: { path: projectDir }
199
189
  });
200
190
  const session = await this.call("session/create", {
201
191
  request: { workspaceId: workspace.workspaceId }
202
192
  });
203
- timer.end(`Created session: ${session.sessionId}`);
204
193
  return session;
205
- } catch (e) {
206
- lastError = e instanceof Error ? e : new Error(String(e));
207
- log.debug(`Attempt ${i + 1} failed: ${lastError.message}`, { method: "createSession" });
208
- if (i < retries - 1) {
209
- await sleep(RETRY_DELAY);
210
- }
211
- }
212
- }
213
- timer.end("\u274C All retries exhausted");
214
- throw lastError;
215
- }
216
- /**
217
- * 通过 dsh settings/mutate 应用 providerOptions 指定的用户设置(逐命名空间幂等 patch)。
218
- * dsh 启动初期 API 未就绪,整体带重试;单个命名空间不存在会导致该次调用失败重试。
219
- */
220
- async applySettings(sections, retries = DEFAULT_RETRIES) {
221
- const namespaces = Object.keys(sections);
222
- if (namespaces.length === 0) return;
223
- const timer = log.timer("applySettings", { namespaces });
224
- let lastError = null;
225
- for (let i = 0; i < retries; i++) {
226
- try {
227
- log.debug(`Attempt ${i + 1}/${retries}`, { method: "settings/mutate", namespaces });
228
- for (const [ns, patch] of Object.entries(sections)) {
229
- const ops = Object.entries(patch).map(([key, value]) => ({
230
- op: "set",
231
- path: [key],
232
- value
233
- }));
234
- await this.call("settings/mutate", { ns, ops });
235
- }
236
- timer.end(`Applied settings: ${namespaces.join(", ")}`);
237
- return;
238
- } catch (e) {
239
- lastError = e instanceof Error ? e : new Error(String(e));
240
- log.debug(`Attempt ${i + 1} failed: ${lastError.message}`, { method: "applySettings" });
241
- if (i < retries - 1) {
242
- await sleep(RETRY_DELAY);
243
- }
194
+ },
195
+ {
196
+ attempts: retries,
197
+ onRetry: (n, e) => log.debug(`Attempt ${n} failed: ${e instanceof Error ? e.message : String(e)}`, {
198
+ method: "createSession"
199
+ })
244
200
  }
245
- }
246
- timer.end("\u274C All retries exhausted");
247
- throw lastError;
201
+ );
248
202
  }
249
203
  /** 归档会话(dsh 无硬删除,仅归档;幂等) */
250
204
  async archiveSession(sessionId, retries = DEFAULT_RETRIES) {
251
- const timer = log.timer("archiveSession", { sessionId, retries });
252
- let lastError = null;
253
- for (let i = 0; i < retries; i++) {
254
- try {
255
- log.debug(`Attempt ${i + 1}/${retries}`, { method: "workspace/archiveSession" });
205
+ return withRetries(
206
+ async (attempt) => {
207
+ log.debug(`Attempt ${attempt + 1}/${retries}`, { method: "archiveSession" });
256
208
  await this.call("workspace/archiveSession", { request: { sessionId } });
257
- timer.end(`Archived session: ${sessionId}`);
258
209
  return;
259
- } catch (e) {
260
- lastError = e instanceof Error ? e : new Error(String(e));
261
- log.debug(`Attempt ${i + 1} failed: ${lastError.message}`, {
210
+ },
211
+ {
212
+ attempts: retries,
213
+ onRetry: (n, e) => log.debug(`Attempt ${n} failed: ${e instanceof Error ? e.message : String(e)}`, {
262
214
  method: "archiveSession"
263
- });
264
- if (i < retries - 1) {
265
- await sleep(RETRY_DELAY);
266
- }
215
+ })
267
216
  }
268
- }
269
- timer.end("\u274C All retries exhausted");
270
- throw lastError;
217
+ );
271
218
  }
272
219
  /**
273
220
  * 取 workspace/follow 流的 baseline(等价旧 workspace.list 的快照:{ items, archivedSessionIds })。
package/es/constants.d.ts CHANGED
@@ -17,14 +17,5 @@ export declare const DSH_REMOTE_MUX_PATH = "/api/remote.mux";
17
17
  export declare const DSH_LOOPBACK_HOST = "127.0.0.1";
18
18
  /** dsh web 默认端口(未显式指定时) */
19
19
  export declare const DSH_DEFAULT_PORT = 3080;
20
- /** ==================== dsh localStorage 键 ==================== */
21
- export declare const DSH_STORAGE_KEYS: {
22
- /** 当前选中会话(SPA 启动时据此恢复选中,无 URL 深链) */
23
- readonly CURRENT_SESSION: "dsh.sessions.current";
24
- /** 选中的页面元素(bridge 写入,dsh-client 的 @aipanel source 读取) */
25
- readonly SELECTION: "dsh.bridge.selection";
26
- /** 诊断功能开关标记(bridge 按 provider 配置写入,dsh-client 据此决定是否注册诊断视图) */
27
- readonly DIAGNOSTICS_ENABLED: "dsh.bridge.diagnostics.enabled";
28
- };
29
20
  /** ==================== Provider 专属配置默认值 ==================== */
30
21
  export declare const DEFAULT_DEEPSEEK_PROVIDER_OPTIONS: DeepSeekProviderOptions;
package/es/constants.js CHANGED
@@ -2,14 +2,6 @@ const DSH_API_BASE = "/api";
2
2
  const DSH_REMOTE_MUX_PATH = "/api/remote.mux";
3
3
  const DSH_LOOPBACK_HOST = "127.0.0.1";
4
4
  const DSH_DEFAULT_PORT = 3080;
5
- const DSH_STORAGE_KEYS = {
6
- /** 当前选中会话(SPA 启动时据此恢复选中,无 URL 深链) */
7
- CURRENT_SESSION: "dsh.sessions.current",
8
- /** 选中的页面元素(bridge 写入,dsh-client 的 @aipanel source 读取) */
9
- SELECTION: "dsh.bridge.selection",
10
- /** 诊断功能开关标记(bridge 按 provider 配置写入,dsh-client 据此决定是否注册诊断视图) */
11
- DIAGNOSTICS_ENABLED: "dsh.bridge.diagnostics.enabled"
12
- };
13
5
  const DEFAULT_DEEPSEEK_PROVIDER_OPTIONS = {
14
6
  // 对齐 opencode 的 enableLsp(默认 true):诊断功能默认开启
15
7
  enableDiagnostics: true,
@@ -21,6 +13,5 @@ export {
21
13
  DSH_API_BASE,
22
14
  DSH_DEFAULT_PORT,
23
15
  DSH_LOOPBACK_HOST,
24
- DSH_REMOTE_MUX_PATH,
25
- DSH_STORAGE_KEYS
16
+ DSH_REMOTE_MUX_PATH
26
17
  };
package/es/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * DeepSeek Harness Web Provider
3
- * 实现 WebProvider 契约:进程管理、RPC 会话 API、桥接脚本、CLI 环境检查。
3
+ * 实现 WebProvider 契约:进程管理、RPC 会话 API、dsh 侧插件编排、CLI 环境检查。
4
4
  * 所有 dsh 专属类型与常量自包含于此包。
5
5
  */
6
6
  import type { ProviderInitContext, WebProvider } from "@aipanel/core";
@@ -10,7 +10,6 @@ export { DeepSeekAPI } from "./api";
10
10
  export type { DeepSeekWebProviderConfig, DeepSeekWebProviderDeps } from "./provider";
11
11
  export { startDeepSeekWeb, type DeepSeekWebOptions } from "./deepseek-web";
12
12
  export { buildDshOverlay, writeDshOverlay } from "./profile";
13
- export { generateBridgeScript, type BridgeScriptOptions } from "./bridge-script";
14
13
  export { checkDeepSeekInstalled, getDeepSeekVersion, killOrphanDeepSeekProcesses } from "./system";
15
14
  export { DEFAULT_DEEPSEEK_PROVIDER_OPTIONS, DSH_LOOPBACK_HOST, DSH_DEFAULT_PORT } from "./constants";
16
15
  export type { DeepSeekProviderOptions, DeepSeekPermissionPreset, DeepSeekBusyEnter, SessionSummary, WorkspaceView, SessionStreamEvent, ServerRequest, ServerResponse, ClientRequest, } from "./types";
package/es/index.js CHANGED
@@ -10,7 +10,6 @@ function createProvider(ctx) {
10
10
  import { DeepSeekAPI } from "./api.js";
11
11
  import { startDeepSeekWeb } from "./deepseek-web.js";
12
12
  import { buildDshOverlay, writeDshOverlay } from "./profile.js";
13
- import { generateBridgeScript } from "./bridge-script.js";
14
13
  import { checkDeepSeekInstalled, getDeepSeekVersion, killOrphanDeepSeekProcesses } from "./system.js";
15
14
  import { DEFAULT_DEEPSEEK_PROVIDER_OPTIONS, DSH_LOOPBACK_HOST as DSH_LOOPBACK_HOST2, DSH_DEFAULT_PORT } from "./constants.js";
16
15
  export {
@@ -21,7 +20,6 @@ export {
21
20
  buildDshOverlay,
22
21
  checkDeepSeekInstalled,
23
22
  createProvider,
24
- generateBridgeScript,
25
23
  getDeepSeekVersion,
26
24
  killOrphanDeepSeekProcesses,
27
25
  startDeepSeekWeb,
package/es/profile.d.ts CHANGED
@@ -1,10 +1,12 @@
1
+ import type { AIPanelWidgetTheme } from "@aipanel/core";
2
+ import type { DeepSeekBusyEnter, DeepSeekPermissionPreset } from "./types";
1
3
  /** 组装 overlay YAML */
2
4
  export declare function buildDshOverlay(options: {
3
5
  vitePort: number;
4
6
  cwd: string;
5
- /** host 插件(@aipanel/dsh-plugin)是否已被同步到 dsh profile;false 时停用该行,避免 fail-loud */
7
+ /** host 插件(@aipanel/dsh-plugin)是否已同步到 dsh profile;false 时停用该行,避免 fail-loud */
6
8
  pluginAvailable?: boolean;
7
- /** client 插件(@aipanel/dsh-client)是否可被 dsh 解析(provider 已同步到 dsh profile);false 时停用该行,避免 fail-loud */
9
+ /** client 插件(@aipanel/dsh-client)是否可被 dsh 解析;false 时停用该行,避免 fail-loud */
8
10
  clientAvailable?: boolean;
9
11
  /**
10
12
  * 编辑后自动诊断开关(provider option autoDiagnose)。
@@ -14,14 +16,22 @@ export declare function buildDshOverlay(options: {
14
16
  /**
15
17
  * 宿主事件推送令牌(core 每轮启动随机):随 plugin config 注入 dsh-plugin,
16
18
  * 使其把归一化 ProviderEvent POST 到 core 的 HOST_EVENTS_API_PATH。
17
- * 缺省(undefined)时不写该配置行,事件中继不启用(兼容未升级的 dsh-plugin)。
18
19
  */
19
20
  eventsToken?: string;
20
21
  /**
21
22
  * 诊断功能总开关(provider option enableDiagnostics)。
22
- * true(默认,对齐 opencode enableLsp)时 host 插件注册 run_diagnostics 工具与自动诊断逻辑。
23
+ * true(默认,对齐 opencode enableLsp)时 host 插件注册 run_diagnostics 工具与自动诊断逻辑,
24
+ * client 插件注册诊断卡片视图。
23
25
  */
24
26
  enableDiagnostics?: boolean;
27
+ /** provider option agentPreset:dsh settings agent-presets.default(随 host 插件 config 下发) */
28
+ agentPreset?: string;
29
+ /** provider option permissionPreset:dsh settings permission.defaultPreset(单一来源 ./types) */
30
+ permissionPreset?: DeepSeekPermissionPreset;
31
+ /** provider option busyEnter:dsh settings ui-conversation.busyEnter(单一来源 ./types) */
32
+ busyEnter?: DeepSeekBusyEnter;
33
+ /** AIPanel 侧主题偏好(applyConfig.theme,AIPanelWidgetTheme);auto 不干预(沿用 dsh 持久化偏好),light/dark 随 client 插件 config 下发 */
34
+ theme?: AIPanelWidgetTheme;
25
35
  }): string;
26
36
  /** 将 overlay 写入项目缓存目录(AIPANEL_CACHE_DIR 下按 provider 分二级目录),不污染用户项目根目录。 */
27
37
  export declare function writeDshOverlay(workspaceCwd: string, overlay: string): string;
package/es/profile.js CHANGED
@@ -7,6 +7,8 @@ import {
7
7
  HOST_EVENTS_API_PATH,
8
8
  createLogger
9
9
  } from "@aipanel/core/node";
10
+ import { DSH_LOOPBACK_HOST } from "./constants.js";
11
+ import { DSH_CLIENT_PACKAGE, DSH_PLUGIN_PACKAGE } from "./dsh-install.js";
10
12
  const log = createLogger("DeepSeekProfile");
11
13
  function buildDshOverlay(options) {
12
14
  const {
@@ -16,9 +18,13 @@ function buildDshOverlay(options) {
16
18
  clientAvailable = true,
17
19
  autoDiagnose,
18
20
  enableDiagnostics = true,
19
- eventsToken
21
+ eventsToken,
22
+ agentPreset,
23
+ permissionPreset,
24
+ busyEnter,
25
+ theme = "auto"
20
26
  } = options;
21
- const mcpUrl = `http://127.0.0.1:${vitePort}${MCP_API_PATH}`;
27
+ const mcpUrl = `http://${DSH_LOOPBACK_HOST}:${vitePort}${MCP_API_PATH}`;
22
28
  const rows = [];
23
29
  rows.push(
24
30
  [
@@ -34,7 +40,7 @@ function buildDshOverlay(options) {
34
40
  rows.push(
35
41
  [
36
42
  " - id: aipanel",
37
- " name: '@aipanel/dsh-plugin'",
43
+ ` name: ${JSON.stringify(DSH_PLUGIN_PACKAGE)}`,
38
44
  ...pluginAvailable ? [] : [" disabled: true"],
39
45
  " inject: [tools]",
40
46
  " config:",
@@ -46,14 +52,21 @@ function buildDshOverlay(options) {
46
52
  ...eventsToken ? [
47
53
  ` eventsToken: ${JSON.stringify(eventsToken)}`,
48
54
  ` eventsPath: ${JSON.stringify(HOST_EVENTS_API_PATH)}`
49
- ] : []
55
+ ] : [],
56
+ // providerOptions → 启动期设置(dsh-plugin/applyProviderSettings 经 ctx.settings 写入)
57
+ ...agentPreset !== void 0 ? [` agentPreset: ${JSON.stringify(agentPreset)}`] : [],
58
+ ...permissionPreset !== void 0 ? [` permissionPreset: ${JSON.stringify(permissionPreset)}`] : [],
59
+ ...busyEnter !== void 0 ? [` busyEnter: ${JSON.stringify(busyEnter)}`] : []
50
60
  ].join("\n")
51
61
  );
52
62
  rows.push(
53
63
  [
54
64
  " - id: aipanel-client",
55
- " name: '@aipanel/dsh-client'",
56
- ...clientAvailable ? [] : [" disabled: true"]
65
+ ` name: ${JSON.stringify(DSH_CLIENT_PACKAGE)}`,
66
+ ...clientAvailable ? [] : [" disabled: true"],
67
+ " config:",
68
+ ` enableDiagnostics: ${enableDiagnostics ? "true" : "false"}`,
69
+ ...theme !== "auto" ? [` theme: ${JSON.stringify(theme)}`] : []
57
70
  ].join("\n")
58
71
  );
59
72
  return ["- insert:", rows.join("\n"), ""].join("\n");
package/es/provider.d.ts CHANGED
@@ -13,7 +13,9 @@ export interface DeepSeekWebProviderDeps {
13
13
  }
14
14
  /**
15
15
  * DeepSeek Harness Web Provider
16
- * 组合 CLI 进程管理、RPC 会话 API、桥接脚本,向核心层暴露 WebProvider 契约。
16
+ * 组合 CLI 进程管理、RPC 会话 API、dsh 侧插件编排(host 插件 + 浏览器 client 插件),
17
+ * 向核心层暴露 WebProvider 契约。dsh 页内行为(会话聚焦/主题/布局/选中元素)全部
18
+ * 由浏览器插件 @aipanel/dsh-client 承担,不再注入 bridge 脚本。
17
19
  */
18
20
  export declare class DeepSeekWebProvider implements WebProvider {
19
21
  readonly id = "deepseek";
@@ -25,17 +27,14 @@ export declare class DeepSeekWebProvider implements WebProvider {
25
27
  private readonly api;
26
28
  private deps;
27
29
  private process;
28
- private bridgeOptions;
30
+ /** AIPanel 侧下发的主题偏好(AIPanelWidgetTheme,default auto):随 client 插件 config 注入,作为启动初值 */
31
+ private uiTheme;
29
32
  private readonly opts;
30
33
  constructor(config: DeepSeekWebProviderConfig, deps: DeepSeekWebProviderDeps, options?: Record<string, unknown>);
31
- /** 代理注入到 HTML 的桥接脚本(Provider 资产) */
32
- get bridgeScript(): string | undefined;
33
- /** 初始化桥接配置(主题、诊断开关等) */
34
+ /** 记录 AIPanel 侧主题偏好(applyConfig start 前调用;start 时随 client 插件 config 下发) */
34
35
  applyConfig(config: ProviderConfig): void;
35
36
  checkEnvironment(): Promise<ProviderEnvironmentInfo>;
36
37
  start(options: ProviderStartOptions): Promise<ProviderStartResult>;
37
- /** 把 providerOptions 配置映射为 dsh settings 命名空间 patch(仅含用户显式配置项) */
38
- private buildSettingsToApply;
39
38
  stop(): Promise<void>;
40
39
  killOrphans(): Promise<number>;
41
40
  listSessions(projectDir: string, activeSessionId?: string): Promise<ChatSession[]>;
package/es/provider.js CHANGED
@@ -6,7 +6,6 @@ import { createLogger } from "@aipanel/core/node";
6
6
  import { DEFAULT_DEEPSEEK_PROVIDER_OPTIONS } from "./constants.js";
7
7
  import { DSH_LOOPBACK_HOST } from "./constants.js";
8
8
  import { DeepSeekAPI } from "./api.js";
9
- import { generateBridgeScript } from "./bridge-script.js";
10
9
  import { LaunchToken, startDeepSeekWeb } from "./deepseek-web.js";
11
10
  import { buildDshOverlay, writeDshOverlay } from "./profile.js";
12
11
  import {
@@ -33,22 +32,17 @@ class DeepSeekWebProvider {
33
32
  __publicField(this, "api");
34
33
  __publicField(this, "deps");
35
34
  __publicField(this, "process", null);
36
- __publicField(this, "bridgeOptions", {});
35
+ /** AIPanel 侧下发的主题偏好(AIPanelWidgetTheme,default auto):随 client 插件 config 注入,作为启动初值 */
36
+ __publicField(this, "uiTheme", "auto");
37
37
  __publicField(this, "opts");
38
38
  this.deps = deps;
39
39
  this.opts = resolveDeepSeekOptions(options);
40
40
  this.api = new DeepSeekAPI(DSH_LOOPBACK_HOST, deps.getWebPort);
41
41
  }
42
- /** 代理注入到 HTML 的桥接脚本(Provider 资产) */
43
- get bridgeScript() {
44
- return generateBridgeScript(this.bridgeOptions);
45
- }
46
- /** 初始化桥接配置(主题、诊断开关等) */
42
+ /** 记录 AIPanel 侧主题偏好(applyConfig start 前调用;start 时随 client 插件 config 下发) */
47
43
  applyConfig(config) {
48
- this.bridgeOptions = {
49
- theme: config.theme ?? "auto",
50
- diagnosticsEnabled: this.opts.enableDiagnostics ?? false
51
- };
44
+ const t = config.theme;
45
+ this.uiTheme = t === "light" || t === "dark" || t === "auto" ? t : "auto";
52
46
  }
53
47
  async checkEnvironment() {
54
48
  if (!await checkDeepSeekInstalled()) {
@@ -109,7 +103,7 @@ Please upgrade:
109
103
  this.opts.home
110
104
  );
111
105
  if (!pluginAvailable) {
112
- log.warn("@aipanel/dsh-plugin unavailable; run_diagnostics & auto-diagnose disabled", {
106
+ log.warn("@aipanel/dsh-plugin unavailable; run_diagnostics & settings application disabled", {
113
107
  metaUrl: import.meta.url
114
108
  });
115
109
  }
@@ -121,7 +115,11 @@ Please upgrade:
121
115
  autoDiagnose: this.opts.autoDiagnose,
122
116
  enableDiagnostics: this.opts.enableDiagnostics,
123
117
  // 宿主事件推送令牌(core 每轮启动随机):随 plugin config 注入 dsh-plugin 用于回推鉴权
124
- eventsToken: options.eventsToken
118
+ eventsToken: options.eventsToken,
119
+ agentPreset: this.opts.agentPreset,
120
+ permissionPreset: this.opts.permissionPreset,
121
+ busyEnter: this.opts.busyEnter,
122
+ theme: this.uiTheme
125
123
  });
126
124
  const patchPath = writeDshOverlay(options.cwd, overlay);
127
125
  const launchToken = new LaunchToken();
@@ -163,37 +161,8 @@ Please upgrade:
163
161
  }
164
162
  );
165
163
  }
166
- const settings = this.buildSettingsToApply();
167
- if (Object.keys(settings).length > 0) {
168
- void this.api.applySettings(settings).catch((e) => {
169
- log.warn("failed to apply provider settings to dsh", {
170
- settings,
171
- error: e instanceof Error ? e.message : String(e)
172
- });
173
- });
174
- }
175
164
  return { url: this.api.shellUrl, processHandle: proc, webAuthCookie };
176
165
  }
177
- /** 把 providerOptions 配置映射为 dsh settings 命名空间 patch(仅含用户显式配置项) */
178
- buildSettingsToApply() {
179
- const sections = {};
180
- if (this.opts.agentPreset !== void 0) {
181
- sections["agent-presets"] = { ...sections["agent-presets"], default: this.opts.agentPreset };
182
- }
183
- if (this.opts.permissionPreset !== void 0) {
184
- sections.permission = {
185
- ...sections.permission,
186
- defaultPreset: this.opts.permissionPreset
187
- };
188
- }
189
- if (this.opts.busyEnter !== void 0) {
190
- sections["ui-conversation"] = {
191
- ...sections["ui-conversation"],
192
- busyEnter: this.opts.busyEnter
193
- };
194
- }
195
- return sections;
196
- }
197
166
  async stop() {
198
167
  if (this.process) {
199
168
  log.debug("Killing dsh web process", { pid: this.process.pid });
package/es/system.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  export declare function checkDeepSeekInstalled(): Promise<boolean>;
2
+ export declare function getDeepSeekVersion(): Promise<string | null>;
3
+ export declare function killOrphanDeepSeekProcesses(): Promise<number>;
2
4
  /** 本 provider 要求的 dsh 最低版本(0.1.2 起:browser-session 认证 + {args} Remote RPC + remote.mux,协议不向下兼容) */
3
5
  export declare const MIN_DSH_VERSION = "0.1.2-rc.1";
4
6
  /**
5
7
  * 判定 version 是否 >= minimum(semver 风格,含 pre-release 比较:0.1.2 > 0.1.2-rc.1)。
6
- * @returns true/false;任一版本无法解析时返回 null(调用方按"无法确认"放行)。
8
+ * @returns true/false;任一版本无法解析时返回 null(调用方按“无法确认”放行)。
7
9
  */
8
10
  export declare function isDeepSeekVersionAtLeast(version: string, minimum?: string): boolean | null;
9
- export declare function getDeepSeekVersion(): Promise<string | null>;
10
- export declare function killOrphanDeepSeekProcesses(): Promise<number>;