@aipanel/provider-deepseek 1.3.9 → 1.3.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/constants.d.ts CHANGED
@@ -17,6 +17,8 @@ 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 默认 profile($DSH_HOME/profiles/<name>);用户可经 providerOptions.profile 覆盖 */
21
+ export declare const DSH_DEFAULT_PROFILE = "web";
20
22
  /** ==================== Provider 专属配置默认值 ==================== */
21
23
  /**
22
24
  * Provider 选项兜底值。
package/es/constants.js CHANGED
@@ -2,11 +2,15 @@ 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 DEFAULT_DEEPSEEK_PROVIDER_OPTIONS = {};
5
+ const DSH_DEFAULT_PROFILE = "web";
6
+ const DEFAULT_DEEPSEEK_PROVIDER_OPTIONS = {
7
+ profile: DSH_DEFAULT_PROFILE
8
+ };
6
9
  export {
7
10
  DEFAULT_DEEPSEEK_PROVIDER_OPTIONS,
8
11
  DSH_API_BASE,
9
12
  DSH_DEFAULT_PORT,
13
+ DSH_DEFAULT_PROFILE,
10
14
  DSH_LOOPBACK_HOST,
11
15
  DSH_REMOTE_MUX_PATH
12
16
  };
@@ -48,6 +48,8 @@ export interface DeepSeekWebOptions {
48
48
  hostname: string;
49
49
  /** 工作目录 */
50
50
  cwd: string;
51
+ /** dsh profile 名($DSH_HOME/profiles/<name>),默认 "web" */
52
+ profile?: string;
51
53
  /** cordis overlay 文件路径(--patch 注入 MCP client / aipanel 插件) */
52
54
  patchPath?: string;
53
55
  /** dsh 数据目录(透传 DSH_HOME;缺省跟随 $DSH_HOME / ~/.dsh) */
@@ -3,6 +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 { execa } from "execa";
5
5
  import { createLogger, getProcessLogBuffer } from "@aipanel/core/node";
6
+ import { DSH_DEFAULT_PROFILE } from "./constants.js";
6
7
  const log = createLogger("DeepSeekWeb");
7
8
  class LaunchToken {
8
9
  /** @param timeoutMs token 等待窗口(自 arm 起算,默认 20s) */
@@ -93,7 +94,8 @@ class LaunchToken {
93
94
  }
94
95
  function startDeepSeekWeb(options) {
95
96
  const { port, hostname, cwd, patchPath, home, verbose, launchToken } = options;
96
- const args = ["--profile", "web"];
97
+ const profile = options.profile ?? DSH_DEFAULT_PROFILE;
98
+ const args = ["--profile", profile];
97
99
  if (patchPath) {
98
100
  args.push("--patch", patchPath);
99
101
  }
@@ -8,8 +8,8 @@ export declare const DSH_PLUGIN_PACKAGE = "@aipanel/dsh-plugin";
8
8
  * @param distRel 产物相对路径(client 为 "lib/client.js",plugin 为 "dist/index.js")
9
9
  */
10
10
  export declare function resolveDevDshPackageSource(metaUrl: string, subdir: string, distRel: string): string | null;
11
- /** dsh web profile 目录(固定 --profile web);home 未指定时回退 $DSH_HOME / ~/.dsh */
12
- export declare function dshProfileDir(home?: string): string;
11
+ /** dsh profile 目录($DSH_HOME/profiles/<profile>);home 未指定时回退 $DSH_HOME / ~/.dsh */
12
+ export declare function dshProfileDir(profile: string, home?: string): string;
13
13
  /** 某 @aipanel/dsh-* 包在 profile 的 node_modules 中是否可解析 */
14
14
  export declare function isDshPackageInstalled(profileDir: string, packageName: string): boolean;
15
15
  /** 读取 profile 内已安装的某包版本(可解析不到时返回 null) */
@@ -22,4 +22,4 @@ export declare function readProviderVersion(metaUrl: string): string | null;
22
22
  * 生产 npm 包每次检查 registry 拉取最新版本。安装失败返回 false(不阻塞启动,
23
23
  * 仅对应 overlay 行停用,如失去 chip 高亮 / 审查工具)。
24
24
  */
25
- export declare function ensureDshPackage(profileDir: string, packageName: string, target: string, home?: string, expectedVersion?: string | null): Promise<boolean>;
25
+ export declare function ensureDshPackage(profileDir: string, packageName: string, target: string, profile: string, home?: string, expectedVersion?: string | null): Promise<boolean>;
package/es/dsh-install.js CHANGED
@@ -18,9 +18,9 @@ function resolveDevDshPackageSource(metaUrl, subdir, distRel) {
18
18
  }
19
19
  return null;
20
20
  }
21
- function dshProfileDir(home) {
21
+ function dshProfileDir(profile, home) {
22
22
  const resolved = home || process.env.DSH_HOME || path.join(os.homedir(), ".dsh");
23
- return path.join(resolved, "profiles", "web");
23
+ return path.join(resolved, "profiles", profile);
24
24
  }
25
25
  function isDshPackageInstalled(profileDir, packageName) {
26
26
  return fs.existsSync(packageJsonIn(profileDir, packageName));
@@ -42,10 +42,10 @@ function readProviderVersion(metaUrl) {
42
42
  return null;
43
43
  }
44
44
  }
45
- async function ensureDshPackage(profileDir, packageName, target, home, expectedVersion) {
45
+ async function ensureDshPackage(profileDir, packageName, target, profile, home, expectedVersion) {
46
46
  try {
47
- log.debug(`installing ${target} into dsh profile via dsh plugin add`);
48
- await execa("dsh", ["plugin", "--profile", "web", "add", target], {
47
+ log.debug(`installing ${target} into dsh profile via dsh plugin add`, { profile });
48
+ await execa("dsh", ["plugin", "--profile", profile, "add", target], {
49
49
  reject: true,
50
50
  env: {
51
51
  ...process.env,
@@ -64,7 +64,7 @@ async function ensureDshPackage(profileDir, packageName, target, home, expectedV
64
64
  `${packageName} version ${installed} is out of sync with provider ${expectedVersion}`,
65
65
  {
66
66
  profileDir,
67
- install: `dsh plugin --profile web add ${packageName}@${expectedVersion}`
67
+ install: `dsh plugin --profile ${profile} add ${packageName}@${expectedVersion}`
68
68
  }
69
69
  );
70
70
  }
package/es/index.d.ts CHANGED
@@ -11,7 +11,7 @@ export type { DeepSeekWebProviderConfig, DeepSeekWebProviderDeps } from "./provi
11
11
  export { startDeepSeekWeb, type DeepSeekWebOptions } from "./deepseek-web";
12
12
  export { buildDshOverlay, writeDshOverlay } from "./profile";
13
13
  export { checkDeepSeekInstalled, getDeepSeekVersion, killOrphanDeepSeekProcesses } from "./system";
14
- export { DEFAULT_DEEPSEEK_PROVIDER_OPTIONS, DSH_LOOPBACK_HOST, DSH_DEFAULT_PORT, } from "./constants";
14
+ export { DEFAULT_DEEPSEEK_PROVIDER_OPTIONS, DSH_LOOPBACK_HOST, DSH_DEFAULT_PORT, DSH_DEFAULT_PROFILE, } from "./constants";
15
15
  export type { DeepSeekProviderOptions, DeepSeekPermissionPreset, DeepSeekBusyEnter } from "./types";
16
16
  export type { ClientRequest, RpcMessage, ServerResponse } from "@deepseek-ai/dsh-client-connection";
17
17
  export type { SessionCreateValue, SessionListValue, SessionSummary, } from "@deepseek-ai/dsh-api-session-controller/types";
package/es/index.js CHANGED
@@ -14,11 +14,13 @@ import { checkDeepSeekInstalled, getDeepSeekVersion, killOrphanDeepSeekProcesses
14
14
  import {
15
15
  DEFAULT_DEEPSEEK_PROVIDER_OPTIONS,
16
16
  DSH_LOOPBACK_HOST as DSH_LOOPBACK_HOST2,
17
- DSH_DEFAULT_PORT
17
+ DSH_DEFAULT_PORT,
18
+ DSH_DEFAULT_PROFILE
18
19
  } from "./constants.js";
19
20
  export {
20
21
  DEFAULT_DEEPSEEK_PROVIDER_OPTIONS,
21
22
  DSH_DEFAULT_PORT,
23
+ DSH_DEFAULT_PROFILE,
22
24
  DSH_LOOPBACK_HOST2 as DSH_LOOPBACK_HOST,
23
25
  DeepSeekAPI,
24
26
  buildDshOverlay,
package/es/provider.js CHANGED
@@ -4,8 +4,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
4
4
  import { sleep } from "@aipanel/core";
5
5
  import { DEFAULT_DIAGNOSTICS_POLICY, resolveDiagnosticsPolicy } from "@aipanel/core";
6
6
  import { createLogger } from "@aipanel/core/node";
7
- import { DEFAULT_DEEPSEEK_PROVIDER_OPTIONS } from "./constants.js";
8
- import { DSH_LOOPBACK_HOST } from "./constants.js";
7
+ import { DEFAULT_DEEPSEEK_PROVIDER_OPTIONS, DSH_DEFAULT_PROFILE, DSH_LOOPBACK_HOST } from "./constants.js";
9
8
  import { DeepSeekAPI } from "./api.js";
10
9
  import { LaunchToken, startDeepSeekWeb } from "./deepseek-web.js";
11
10
  import { buildDshOverlay, writeDshOverlay } from "./profile.js";
@@ -85,9 +84,10 @@ Please upgrade:
85
84
  port: options.port,
86
85
  hostname: DSH_LOOPBACK_HOST,
87
86
  cwd: options.cwd,
87
+ profile: this.opts.profile,
88
88
  vitePort: options.vitePort
89
89
  });
90
- const profileDir = dshProfileDir(this.opts.home);
90
+ const profileDir = dshProfileDir(this.opts.profile, this.opts.home);
91
91
  const launchToken = new LaunchToken();
92
92
  this.launchToken = launchToken;
93
93
  this.api.setLaunchTokenSource(() => launchToken.wait());
@@ -98,6 +98,7 @@ Please upgrade:
98
98
  profileDir,
99
99
  DSH_CLIENT_PACKAGE,
100
100
  clientTarget,
101
+ this.opts.profile,
101
102
  this.opts.home,
102
103
  providerVersion
103
104
  );
@@ -112,6 +113,7 @@ Please upgrade:
112
113
  profileDir,
113
114
  DSH_PLUGIN_PACKAGE,
114
115
  pluginTarget,
116
+ this.opts.profile,
115
117
  this.opts.home,
116
118
  providerVersion
117
119
  );
@@ -139,6 +141,7 @@ Please upgrade:
139
141
  port: options.port,
140
142
  hostname: DSH_LOOPBACK_HOST,
141
143
  cwd: options.cwd,
144
+ profile: this.opts.profile,
142
145
  patchPath,
143
146
  home: this.opts.home,
144
147
  verbose: options.verbose,
@@ -233,6 +236,7 @@ function resolveDeepSeekOptions(options) {
233
236
  return {
234
237
  ...DEFAULT_DEEPSEEK_PROVIDER_OPTIONS,
235
238
  home: po.home ?? options?.home,
239
+ profile: po.profile ?? options?.profile ?? DSH_DEFAULT_PROFILE,
236
240
  agentPreset: po.agentPreset ?? options?.agentPreset,
237
241
  permissionPreset: po.permissionPreset ?? options?.permissionPreset,
238
242
  busyEnter: po.busyEnter ?? options?.busyEnter,
package/es/types.d.ts CHANGED
@@ -17,6 +17,8 @@ export type DeepSeekBusyEnter = BusyEnterBehavior;
17
17
  export type DeepSeekProviderOptions = {
18
18
  /** dsh 数据目录($DSH_HOME),默认跟随系统(~/.dsh) */
19
19
  home?: string;
20
+ /** dsh profile 名($DSH_HOME/profiles/<name>),默认 "web";AIPanel 侧插件与 web 进程都指向该 profile */
21
+ profile?: string;
20
22
  /** 默认 Agent 预设(dsh settings agent-presets.default,如 code/standard;新建会话的默认模式) */
21
23
  agentPreset?: string;
22
24
  /** 默认权限预设(dsh settings permission.defaultPreset) */
@@ -34,7 +36,8 @@ export type DeepSeekProviderOptions = {
34
36
  */
35
37
  [key: string]: unknown;
36
38
  };
37
- /** 归一化后的 Provider 选项:诊断策略一定是完整的(Partial 已在 provider 内解析) */
39
+ /** 归一化后的 Provider 选项:诊断策略一定是完整的(Partial 已在 provider 内解析),profile 一定落到默认值 */
38
40
  export type DeepSeekResolvedOptions = DeepSeekProviderOptions & {
41
+ profile: string;
39
42
  diagnostics: DiagnosticsPolicy;
40
43
  };
package/lib/constants.cjs CHANGED
@@ -20,6 +20,7 @@ __export(constants_exports, {
20
20
  DEFAULT_DEEPSEEK_PROVIDER_OPTIONS: () => DEFAULT_DEEPSEEK_PROVIDER_OPTIONS,
21
21
  DSH_API_BASE: () => DSH_API_BASE,
22
22
  DSH_DEFAULT_PORT: () => DSH_DEFAULT_PORT,
23
+ DSH_DEFAULT_PROFILE: () => DSH_DEFAULT_PROFILE,
23
24
  DSH_LOOPBACK_HOST: () => DSH_LOOPBACK_HOST,
24
25
  DSH_REMOTE_MUX_PATH: () => DSH_REMOTE_MUX_PATH
25
26
  });
@@ -28,12 +29,16 @@ const DSH_API_BASE = "/api";
28
29
  const DSH_REMOTE_MUX_PATH = "/api/remote.mux";
29
30
  const DSH_LOOPBACK_HOST = "127.0.0.1";
30
31
  const DSH_DEFAULT_PORT = 3080;
31
- const DEFAULT_DEEPSEEK_PROVIDER_OPTIONS = {};
32
+ const DSH_DEFAULT_PROFILE = "web";
33
+ const DEFAULT_DEEPSEEK_PROVIDER_OPTIONS = {
34
+ profile: DSH_DEFAULT_PROFILE
35
+ };
32
36
  // Annotate the CommonJS export names for ESM import in node:
33
37
  0 && (module.exports = {
34
38
  DEFAULT_DEEPSEEK_PROVIDER_OPTIONS,
35
39
  DSH_API_BASE,
36
40
  DSH_DEFAULT_PORT,
41
+ DSH_DEFAULT_PROFILE,
37
42
  DSH_LOOPBACK_HOST,
38
43
  DSH_REMOTE_MUX_PATH
39
44
  });
@@ -17,6 +17,8 @@ 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 默认 profile($DSH_HOME/profiles/<name>);用户可经 providerOptions.profile 覆盖 */
21
+ export declare const DSH_DEFAULT_PROFILE = "web";
20
22
  /** ==================== Provider 专属配置默认值 ==================== */
21
23
  /**
22
24
  * Provider 选项兜底值。
@@ -25,6 +25,7 @@ __export(deepseek_web_exports, {
25
25
  module.exports = __toCommonJS(deepseek_web_exports);
26
26
  var import_execa = require("execa");
27
27
  var import_node = require("@aipanel/core/node");
28
+ var import_constants = require("./constants.cjs");
28
29
  const log = (0, import_node.createLogger)("DeepSeekWeb");
29
30
  class LaunchToken {
30
31
  /** @param timeoutMs token 等待窗口(自 arm 起算,默认 20s) */
@@ -115,7 +116,8 @@ class LaunchToken {
115
116
  }
116
117
  function startDeepSeekWeb(options) {
117
118
  const { port, hostname, cwd, patchPath, home, verbose, launchToken } = options;
118
- const args = ["--profile", "web"];
119
+ const profile = options.profile ?? import_constants.DSH_DEFAULT_PROFILE;
120
+ const args = ["--profile", profile];
119
121
  if (patchPath) {
120
122
  args.push("--patch", patchPath);
121
123
  }
@@ -48,6 +48,8 @@ export interface DeepSeekWebOptions {
48
48
  hostname: string;
49
49
  /** 工作目录 */
50
50
  cwd: string;
51
+ /** dsh profile 名($DSH_HOME/profiles/<name>),默认 "web" */
52
+ profile?: string;
51
53
  /** cordis overlay 文件路径(--patch 注入 MCP client / aipanel 插件) */
52
54
  patchPath?: string;
53
55
  /** dsh 数据目录(透传 DSH_HOME;缺省跟随 $DSH_HOME / ~/.dsh) */
@@ -57,9 +57,9 @@ function resolveDevDshPackageSource(metaUrl, subdir, distRel) {
57
57
  }
58
58
  return null;
59
59
  }
60
- function dshProfileDir(home) {
60
+ function dshProfileDir(profile, home) {
61
61
  const resolved = home || process.env.DSH_HOME || import_node_path.default.join(import_node_os.default.homedir(), ".dsh");
62
- return import_node_path.default.join(resolved, "profiles", "web");
62
+ return import_node_path.default.join(resolved, "profiles", profile);
63
63
  }
64
64
  function isDshPackageInstalled(profileDir, packageName) {
65
65
  return import_node_fs.default.existsSync(packageJsonIn(profileDir, packageName));
@@ -81,10 +81,10 @@ function readProviderVersion(metaUrl) {
81
81
  return null;
82
82
  }
83
83
  }
84
- async function ensureDshPackage(profileDir, packageName, target, home, expectedVersion) {
84
+ async function ensureDshPackage(profileDir, packageName, target, profile, home, expectedVersion) {
85
85
  try {
86
- log.debug(`installing ${target} into dsh profile via dsh plugin add`);
87
- await (0, import_execa.execa)("dsh", ["plugin", "--profile", "web", "add", target], {
86
+ log.debug(`installing ${target} into dsh profile via dsh plugin add`, { profile });
87
+ await (0, import_execa.execa)("dsh", ["plugin", "--profile", profile, "add", target], {
88
88
  reject: true,
89
89
  env: {
90
90
  ...process.env,
@@ -103,7 +103,7 @@ async function ensureDshPackage(profileDir, packageName, target, home, expectedV
103
103
  `${packageName} version ${installed} is out of sync with provider ${expectedVersion}`,
104
104
  {
105
105
  profileDir,
106
- install: `dsh plugin --profile web add ${packageName}@${expectedVersion}`
106
+ install: `dsh plugin --profile ${profile} add ${packageName}@${expectedVersion}`
107
107
  }
108
108
  );
109
109
  }
@@ -8,8 +8,8 @@ export declare const DSH_PLUGIN_PACKAGE = "@aipanel/dsh-plugin";
8
8
  * @param distRel 产物相对路径(client 为 "lib/client.js",plugin 为 "dist/index.js")
9
9
  */
10
10
  export declare function resolveDevDshPackageSource(metaUrl: string, subdir: string, distRel: string): string | null;
11
- /** dsh web profile 目录(固定 --profile web);home 未指定时回退 $DSH_HOME / ~/.dsh */
12
- export declare function dshProfileDir(home?: string): string;
11
+ /** dsh profile 目录($DSH_HOME/profiles/<profile>);home 未指定时回退 $DSH_HOME / ~/.dsh */
12
+ export declare function dshProfileDir(profile: string, home?: string): string;
13
13
  /** 某 @aipanel/dsh-* 包在 profile 的 node_modules 中是否可解析 */
14
14
  export declare function isDshPackageInstalled(profileDir: string, packageName: string): boolean;
15
15
  /** 读取 profile 内已安装的某包版本(可解析不到时返回 null) */
@@ -22,4 +22,4 @@ export declare function readProviderVersion(metaUrl: string): string | null;
22
22
  * 生产 npm 包每次检查 registry 拉取最新版本。安装失败返回 false(不阻塞启动,
23
23
  * 仅对应 overlay 行停用,如失去 chip 高亮 / 审查工具)。
24
24
  */
25
- export declare function ensureDshPackage(profileDir: string, packageName: string, target: string, home?: string, expectedVersion?: string | null): Promise<boolean>;
25
+ export declare function ensureDshPackage(profileDir: string, packageName: string, target: string, profile: string, home?: string, expectedVersion?: string | null): Promise<boolean>;
package/lib/index.cjs CHANGED
@@ -19,6 +19,7 @@ var lib_exports = {};
19
19
  __export(lib_exports, {
20
20
  DEFAULT_DEEPSEEK_PROVIDER_OPTIONS: () => import_constants2.DEFAULT_DEEPSEEK_PROVIDER_OPTIONS,
21
21
  DSH_DEFAULT_PORT: () => import_constants2.DSH_DEFAULT_PORT,
22
+ DSH_DEFAULT_PROFILE: () => import_constants2.DSH_DEFAULT_PROFILE,
22
23
  DSH_LOOPBACK_HOST: () => import_constants2.DSH_LOOPBACK_HOST,
23
24
  DeepSeekAPI: () => import_api.DeepSeekAPI,
24
25
  buildDshOverlay: () => import_profile.buildDshOverlay,
@@ -48,6 +49,7 @@ function createProvider(ctx) {
48
49
  0 && (module.exports = {
49
50
  DEFAULT_DEEPSEEK_PROVIDER_OPTIONS,
50
51
  DSH_DEFAULT_PORT,
52
+ DSH_DEFAULT_PROFILE,
51
53
  DSH_LOOPBACK_HOST,
52
54
  DeepSeekAPI,
53
55
  buildDshOverlay,
package/lib/index.d.ts CHANGED
@@ -11,7 +11,7 @@ export type { DeepSeekWebProviderConfig, DeepSeekWebProviderDeps } from "./provi
11
11
  export { startDeepSeekWeb, type DeepSeekWebOptions } from "./deepseek-web";
12
12
  export { buildDshOverlay, writeDshOverlay } from "./profile";
13
13
  export { checkDeepSeekInstalled, getDeepSeekVersion, killOrphanDeepSeekProcesses } from "./system";
14
- export { DEFAULT_DEEPSEEK_PROVIDER_OPTIONS, DSH_LOOPBACK_HOST, DSH_DEFAULT_PORT, } from "./constants";
14
+ export { DEFAULT_DEEPSEEK_PROVIDER_OPTIONS, DSH_LOOPBACK_HOST, DSH_DEFAULT_PORT, DSH_DEFAULT_PROFILE, } from "./constants";
15
15
  export type { DeepSeekProviderOptions, DeepSeekPermissionPreset, DeepSeekBusyEnter } from "./types";
16
16
  export type { ClientRequest, RpcMessage, ServerResponse } from "@deepseek-ai/dsh-client-connection";
17
17
  export type { SessionCreateValue, SessionListValue, SessionSummary, } from "@deepseek-ai/dsh-api-session-controller/types";
package/lib/provider.cjs CHANGED
@@ -27,7 +27,6 @@ var import_core = require("@aipanel/core");
27
27
  var import_core2 = require("@aipanel/core");
28
28
  var import_node = require("@aipanel/core/node");
29
29
  var import_constants = require("./constants.cjs");
30
- var import_constants2 = require("./constants.cjs");
31
30
  var import_api = require("./api.cjs");
32
31
  var import_deepseek_web = require("./deepseek-web.cjs");
33
32
  var import_profile = require("./profile.cjs");
@@ -50,7 +49,7 @@ class DeepSeekWebProvider {
50
49
  __publicField(this, "opts");
51
50
  this.deps = deps;
52
51
  this.opts = resolveDeepSeekOptions(options);
53
- this.api = new import_api.DeepSeekAPI(import_constants2.DSH_LOOPBACK_HOST, deps.getWebPort);
52
+ this.api = new import_api.DeepSeekAPI(import_constants.DSH_LOOPBACK_HOST, deps.getWebPort);
54
53
  }
55
54
  /** 记录 AIPanel 侧主题偏好(applyConfig 在 start 前调用;start 时随 client 插件 config 下发) */
56
55
  applyConfig(config) {
@@ -92,11 +91,12 @@ Please upgrade:
92
91
  async start(options) {
93
92
  log.debug("Starting dsh web process", {
94
93
  port: options.port,
95
- hostname: import_constants2.DSH_LOOPBACK_HOST,
94
+ hostname: import_constants.DSH_LOOPBACK_HOST,
96
95
  cwd: options.cwd,
96
+ profile: this.opts.profile,
97
97
  vitePort: options.vitePort
98
98
  });
99
- const profileDir = (0, import_dsh_install.dshProfileDir)(this.opts.home);
99
+ const profileDir = (0, import_dsh_install.dshProfileDir)(this.opts.profile, this.opts.home);
100
100
  const launchToken = new import_deepseek_web.LaunchToken();
101
101
  this.launchToken = launchToken;
102
102
  this.api.setLaunchTokenSource(() => launchToken.wait());
@@ -107,6 +107,7 @@ Please upgrade:
107
107
  profileDir,
108
108
  import_dsh_install.DSH_CLIENT_PACKAGE,
109
109
  clientTarget,
110
+ this.opts.profile,
110
111
  this.opts.home,
111
112
  providerVersion
112
113
  );
@@ -121,6 +122,7 @@ Please upgrade:
121
122
  profileDir,
122
123
  import_dsh_install.DSH_PLUGIN_PACKAGE,
123
124
  pluginTarget,
125
+ this.opts.profile,
124
126
  this.opts.home,
125
127
  providerVersion
126
128
  );
@@ -146,8 +148,9 @@ Please upgrade:
146
148
  const patchPath = (0, import_profile.writeDshOverlay)(options.cwd, overlay);
147
149
  const proc = (0, import_deepseek_web.startDeepSeekWeb)({
148
150
  port: options.port,
149
- hostname: import_constants2.DSH_LOOPBACK_HOST,
151
+ hostname: import_constants.DSH_LOOPBACK_HOST,
150
152
  cwd: options.cwd,
153
+ profile: this.opts.profile,
151
154
  patchPath,
152
155
  home: this.opts.home,
153
156
  verbose: options.verbose,
@@ -218,7 +221,7 @@ Please upgrade:
218
221
  buildSessionUrl(projectDir, sessionId) {
219
222
  void projectDir;
220
223
  void sessionId;
221
- return `http://${import_constants2.DSH_LOOPBACK_HOST}:${this.deps.getProxyPort()}/`;
224
+ return `http://${import_constants.DSH_LOOPBACK_HOST}:${this.deps.getProxyPort()}/`;
222
225
  }
223
226
  subscribeEvents(handler) {
224
227
  void handler;
@@ -242,6 +245,7 @@ function resolveDeepSeekOptions(options) {
242
245
  return {
243
246
  ...import_constants.DEFAULT_DEEPSEEK_PROVIDER_OPTIONS,
244
247
  home: po.home ?? options?.home,
248
+ profile: po.profile ?? options?.profile ?? import_constants.DSH_DEFAULT_PROFILE,
245
249
  agentPreset: po.agentPreset ?? options?.agentPreset,
246
250
  permissionPreset: po.permissionPreset ?? options?.permissionPreset,
247
251
  busyEnter: po.busyEnter ?? options?.busyEnter,
package/lib/types.d.ts CHANGED
@@ -17,6 +17,8 @@ export type DeepSeekBusyEnter = BusyEnterBehavior;
17
17
  export type DeepSeekProviderOptions = {
18
18
  /** dsh 数据目录($DSH_HOME),默认跟随系统(~/.dsh) */
19
19
  home?: string;
20
+ /** dsh profile 名($DSH_HOME/profiles/<name>),默认 "web";AIPanel 侧插件与 web 进程都指向该 profile */
21
+ profile?: string;
20
22
  /** 默认 Agent 预设(dsh settings agent-presets.default,如 code/standard;新建会话的默认模式) */
21
23
  agentPreset?: string;
22
24
  /** 默认权限预设(dsh settings permission.defaultPreset) */
@@ -34,7 +36,8 @@ export type DeepSeekProviderOptions = {
34
36
  */
35
37
  [key: string]: unknown;
36
38
  };
37
- /** 归一化后的 Provider 选项:诊断策略一定是完整的(Partial 已在 provider 内解析) */
39
+ /** 归一化后的 Provider 选项:诊断策略一定是完整的(Partial 已在 provider 内解析),profile 一定落到默认值 */
38
40
  export type DeepSeekResolvedOptions = DeepSeekProviderOptions & {
41
+ profile: string;
39
42
  diagnostics: DiagnosticsPolicy;
40
43
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aipanel/provider-deepseek",
3
- "version": "1.3.9",
3
+ "version": "1.3.10",
4
4
  "type": "module",
5
5
  "main": "lib/index.cjs",
6
6
  "module": "es/index.js",
@@ -21,16 +21,16 @@
21
21
  "registry": "https://registry.npmjs.org/"
22
22
  },
23
23
  "dependencies": {
24
- "@aipanel/core": "1.3.9",
24
+ "@aipanel/core": "1.3.10",
25
25
  "execa": "^9.6.1"
26
26
  },
27
27
  "devDependencies": {
28
- "@deepseek-ai/dsh-api-session-controller": "^0.1.7-alpha.2",
29
- "@deepseek-ai/dsh-api-workspace-controller": "^0.1.7-alpha.2",
30
- "@deepseek-ai/dsh-brand": "^0.1.7-alpha.2",
31
- "@deepseek-ai/dsh-client-connection": "^0.1.7-alpha.2",
32
- "@deepseek-ai/dsh-client-ui-conversation": "^0.1.7-alpha.2",
33
- "@deepseek-ai/dsh-sandbox": "^0.1.7-alpha.2",
28
+ "@deepseek-ai/dsh-api-session-controller": "^0.2.0-rc.1",
29
+ "@deepseek-ai/dsh-api-workspace-controller": "^0.2.0-rc.1",
30
+ "@deepseek-ai/dsh-brand": "^0.2.0-rc.1",
31
+ "@deepseek-ai/dsh-client-connection": "^0.2.0-rc.1",
32
+ "@deepseek-ai/dsh-client-ui-conversation": "^0.2.0-rc.1",
33
+ "@deepseek-ai/dsh-sandbox": "^0.2.0-rc.1",
34
34
  "esbuild": "^0.25.0"
35
35
  },
36
36
  "scripts": {