@aipanel/provider-deepseek 1.3.10 → 1.3.11
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/deepseek-web.d.ts +7 -0
- package/es/deepseek-web.js +14 -1
- package/es/profile-check.d.ts +19 -0
- package/es/profile-check.js +41 -0
- package/es/provider.js +9 -0
- package/es/types.d.ts +7 -1
- package/lib/deepseek-web.cjs +14 -1
- package/lib/deepseek-web.d.ts +7 -0
- package/lib/profile-check.cjs +77 -0
- package/lib/profile-check.d.ts +19 -0
- package/lib/provider.cjs +9 -0
- package/lib/types.d.ts +7 -1
- package/package.json +2 -2
package/es/deepseek-web.d.ts
CHANGED
|
@@ -33,6 +33,13 @@ export declare class LaunchToken {
|
|
|
33
33
|
fail(err: Error): void;
|
|
34
34
|
/** 窗口到点:输出 dsh web 启动原始日志辅助诊断,再按未捕获 token 判定本次启动失败 */
|
|
35
35
|
private expire;
|
|
36
|
+
/**
|
|
37
|
+
* 附上"这次起的是哪个 profile"的上下文(provider 起进程前调用)。
|
|
38
|
+
* 只加在这里、不进 printStartupOutput:超时的那条错误要能自己说清 profile 与它的 bundle 列表,
|
|
39
|
+
* 否则症状永远只是"启动超时"(见 profile-check 的注释)。
|
|
40
|
+
*/
|
|
41
|
+
attachContext(provider: () => string): void;
|
|
42
|
+
private context?;
|
|
36
43
|
/** 报错时把 dsh web 启动的原始日志作为一条日志整体输出(幂等:每实例只打一次) */
|
|
37
44
|
private printed;
|
|
38
45
|
private printStartupOutput;
|
package/es/deepseek-web.js
CHANGED
|
@@ -19,6 +19,7 @@ class LaunchToken {
|
|
|
19
19
|
/** dsh 进程是否已 spawn:token 只可能在 spawn 后打印,超时窗口自 arm 起算 */
|
|
20
20
|
__publicField(this, "spawned", false);
|
|
21
21
|
__publicField(this, "windowTimer");
|
|
22
|
+
__publicField(this, "context");
|
|
22
23
|
/** 报错时把 dsh web 启动的原始日志作为一条日志整体输出(幂等:每实例只打一次) */
|
|
23
24
|
__publicField(this, "printed", false);
|
|
24
25
|
}
|
|
@@ -63,12 +64,24 @@ class LaunchToken {
|
|
|
63
64
|
/** 窗口到点:输出 dsh web 启动原始日志辅助诊断,再按未捕获 token 判定本次启动失败 */
|
|
64
65
|
expire() {
|
|
65
66
|
this.printStartupOutput();
|
|
67
|
+
const context = this.context?.();
|
|
68
|
+
const base = `dsh launch token was not captured from stdout within ${this.timeoutMs}ms (dsh >= 0.1.2 should print the "dsh web: http://127.0.0.1:<port>/?token=..." URL)`;
|
|
66
69
|
this.fail(
|
|
67
70
|
new Error(
|
|
68
|
-
|
|
71
|
+
context === void 0 || context.trim() === "" ? base : `${base}
|
|
72
|
+
${context}
|
|
73
|
+
\uFF08\u8FD9\u4E2A profile \u8D77\u4E0D\u4E86 Web UI \u65F6\u5C31\u662F\u8FD9\u4E2A\u75C7\u72B6\uFF1A\u5148\u786E\u8BA4\u5B83\u5EFA\u597D\u4E86\uFF09`
|
|
69
74
|
)
|
|
70
75
|
);
|
|
71
76
|
}
|
|
77
|
+
/**
|
|
78
|
+
* 附上"这次起的是哪个 profile"的上下文(provider 起进程前调用)。
|
|
79
|
+
* 只加在这里、不进 printStartupOutput:超时的那条错误要能自己说清 profile 与它的 bundle 列表,
|
|
80
|
+
* 否则症状永远只是"启动超时"(见 profile-check 的注释)。
|
|
81
|
+
*/
|
|
82
|
+
attachContext(provider) {
|
|
83
|
+
this.context = provider;
|
|
84
|
+
}
|
|
72
85
|
printStartupOutput() {
|
|
73
86
|
if (this.printed) return;
|
|
74
87
|
this.printed = true;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** dsh 的 Web 应用 bundle(`dsh web` 的 profile 必有;纯终端类 profile 没有) */
|
|
2
|
+
export declare const DSH_WEB_APP_BUNDLE = "@deepseek-ai/dsh-web-app";
|
|
3
|
+
export type DshProfileProblem = "missing" | "no-web-app";
|
|
4
|
+
export interface DshProfileInspection {
|
|
5
|
+
/** 这个 profile 现在能不能起 Web UI */
|
|
6
|
+
readonly ok: boolean;
|
|
7
|
+
/** 不能时是哪一类问题;能时为 null */
|
|
8
|
+
readonly problem: DshProfileProblem | null;
|
|
9
|
+
/** profile 声明的 bundle 列表(读不到时为空数组) */
|
|
10
|
+
readonly bundles: readonly string[];
|
|
11
|
+
/** profile 清单文件路径(报错信息里给绝对路径,方便直接去看) */
|
|
12
|
+
readonly manifest: string;
|
|
13
|
+
}
|
|
14
|
+
/** 读 profile 清单并判断它是否具备启动 Web UI 的条件 */
|
|
15
|
+
export declare function inspectDshProfile(profileDir: string): DshProfileInspection;
|
|
16
|
+
/** 预检没过时给用户的说明(通用措辞:说清是什么、去哪看、怎么修) */
|
|
17
|
+
export declare function profileProblemText(inspection: DshProfileInspection, profileDir: string, profile: string): string;
|
|
18
|
+
/** 启动超时诊断用的一行上下文:profile 在哪、声明了哪些 bundle */
|
|
19
|
+
export declare function describeDshProfile(profileDir: string, profile: string): string;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
const DSH_WEB_APP_BUNDLE = "@deepseek-ai/dsh-web-app";
|
|
4
|
+
function inspectDshProfile(profileDir) {
|
|
5
|
+
const manifest = path.join(profileDir, "package.json");
|
|
6
|
+
let parsed;
|
|
7
|
+
try {
|
|
8
|
+
parsed = JSON.parse(fs.readFileSync(manifest, "utf8"));
|
|
9
|
+
} catch {
|
|
10
|
+
return { ok: false, problem: "missing", bundles: [], manifest };
|
|
11
|
+
}
|
|
12
|
+
const declared = parsed?.dsh?.profile?.bundles;
|
|
13
|
+
const bundles = Array.isArray(declared) ? declared.filter((one) => typeof one === "string") : [];
|
|
14
|
+
if (!bundles.includes(DSH_WEB_APP_BUNDLE)) {
|
|
15
|
+
return { ok: false, problem: "no-web-app", bundles, manifest };
|
|
16
|
+
}
|
|
17
|
+
return { ok: true, problem: null, bundles, manifest };
|
|
18
|
+
}
|
|
19
|
+
function profileProblemText(inspection, profileDir, profile) {
|
|
20
|
+
const head = inspection.problem === "missing" ? `dsh profile "${profile}" \u8FD8\u4E0D\u5B58\u5728\uFF08\u627E\u4E0D\u5230 ${inspection.manifest}\uFF09` : `dsh profile "${profile}" \u91CC\u6CA1\u6709 Web \u5E94\u7528 bundle\uFF08${DSH_WEB_APP_BUNDLE}\uFF09`;
|
|
21
|
+
const bundles = inspection.bundles.length === 0 ? "\uFF08\u8BFB\u4E0D\u5230 bundle \u5217\u8868\uFF09" : `\u73B0\u6709 bundles\uFF1A${inspection.bundles.join("\u3001")}`;
|
|
22
|
+
return [
|
|
23
|
+
`${head}\uFF1A${profileDir}`,
|
|
24
|
+
` ${bundles}`,
|
|
25
|
+
" dsh \u5728 profile \u7F3A\u5931\u65F6\u4F1A\u81EA\u5DF1\u5EFA\u4E00\u4E2A\u53EA\u6709 @deepseek-ai/dsh-base \u7684\u7A7A\u58F3\uFF0C\u8D77\u6765\u4E0D\u4F1A\u6709\u754C\u9762\uFF1B",
|
|
26
|
+
" \u800C provider \u7684\u7F16\u6392\u662F\u300C\u5148\u88C5\u63D2\u4EF6\u3001\u518D\u8D77\u8FDB\u7A0B\u300D\uFF0C\u90A3\u4E00\u6B65\u4F1A\u628A\u7A7A\u58F3\u5EFA\u51FA\u6765\uFF0C\u75C7\u72B6\u53EA\u662F\u542F\u52A8\u8D85\u65F6\u3002",
|
|
27
|
+
" \u5148\u628A\u8FD9\u4E2A profile \u5EFA\u597D\uFF08\u5B83\u81EA\u5DF1\u7684\u5B89\u88C5\u6D41\u7A0B\uFF0C\u6216 `dsh <\u540D> --from-default-profile web`\uFF09\u518D\u91CD\u5F00\u3002"
|
|
28
|
+
].join("\n");
|
|
29
|
+
}
|
|
30
|
+
function describeDshProfile(profileDir, profile) {
|
|
31
|
+
const inspection = inspectDshProfile(profileDir);
|
|
32
|
+
const bundles = inspection.bundles.length === 0 ? "\uFF08\u8BFB\u4E0D\u5230\uFF09" : inspection.bundles.join("\u3001");
|
|
33
|
+
return `profile: ${profile} (${profileDir})
|
|
34
|
+
bundles: ${bundles}`;
|
|
35
|
+
}
|
|
36
|
+
export {
|
|
37
|
+
DSH_WEB_APP_BUNDLE,
|
|
38
|
+
describeDshProfile,
|
|
39
|
+
inspectDshProfile,
|
|
40
|
+
profileProblemText
|
|
41
|
+
};
|
package/es/provider.js
CHANGED
|
@@ -8,6 +8,7 @@ import { DEFAULT_DEEPSEEK_PROVIDER_OPTIONS, DSH_DEFAULT_PROFILE, DSH_LOOPBACK_HO
|
|
|
8
8
|
import { DeepSeekAPI } from "./api.js";
|
|
9
9
|
import { LaunchToken, startDeepSeekWeb } from "./deepseek-web.js";
|
|
10
10
|
import { buildDshOverlay, writeDshOverlay } from "./profile.js";
|
|
11
|
+
import { describeDshProfile, inspectDshProfile, profileProblemText } from "./profile-check.js";
|
|
11
12
|
import {
|
|
12
13
|
checkDeepSeekInstalled,
|
|
13
14
|
getDeepSeekVersion,
|
|
@@ -91,6 +92,14 @@ Please upgrade:
|
|
|
91
92
|
const launchToken = new LaunchToken();
|
|
92
93
|
this.launchToken = launchToken;
|
|
93
94
|
this.api.setLaunchTokenSource(() => launchToken.wait());
|
|
95
|
+
launchToken.attachContext(() => describeDshProfile(profileDir, this.opts.profile));
|
|
96
|
+
const profileCheck = inspectDshProfile(profileDir);
|
|
97
|
+
if (!profileCheck.ok) {
|
|
98
|
+
const reason = profileProblemText(profileCheck, profileDir, this.opts.profile);
|
|
99
|
+
log.error(reason);
|
|
100
|
+
launchToken.fail(new Error(reason));
|
|
101
|
+
throw new Error(reason);
|
|
102
|
+
}
|
|
94
103
|
const devClientDir = resolveDevDshPackageSource(import.meta.url, "dsh-client", "lib/client.js");
|
|
95
104
|
const providerVersion = readProviderVersion(import.meta.url);
|
|
96
105
|
const clientTarget = devClientDir ?? (providerVersion ? `${DSH_CLIENT_PACKAGE}@${providerVersion}` : `${DSH_CLIENT_PACKAGE}@latest`);
|
package/es/types.d.ts
CHANGED
|
@@ -17,7 +17,13 @@ export type DeepSeekBusyEnter = BusyEnterBehavior;
|
|
|
17
17
|
export type DeepSeekProviderOptions = {
|
|
18
18
|
/** dsh 数据目录($DSH_HOME),默认跟随系统(~/.dsh) */
|
|
19
19
|
home?: string;
|
|
20
|
-
/**
|
|
20
|
+
/**
|
|
21
|
+
* dsh profile 名($DSH_HOME/profiles/<name>),默认 "web";AIPanel 侧插件与 web 进程都指向该 profile。
|
|
22
|
+
*
|
|
23
|
+
* ⚠️ 该 profile 必须**先建好**:其 `dsh.profile.bundles` 里要有 `@deepseek-ai/dsh-web-app`。
|
|
24
|
+
* 缺失时 dsh 的 `plugin` 子命令会自己建出一个只有 `@deepseek-ai/dsh-base` 的空壳,
|
|
25
|
+
* 于是启动只会表现为"等 launch token 超时"(见 profile-check.ts 的预检与说明)。
|
|
26
|
+
*/
|
|
21
27
|
profile?: string;
|
|
22
28
|
/** 默认 Agent 预设(dsh settings agent-presets.default,如 code/standard;新建会话的默认模式) */
|
|
23
29
|
agentPreset?: string;
|
package/lib/deepseek-web.cjs
CHANGED
|
@@ -41,6 +41,7 @@ class LaunchToken {
|
|
|
41
41
|
/** dsh 进程是否已 spawn:token 只可能在 spawn 后打印,超时窗口自 arm 起算 */
|
|
42
42
|
__publicField(this, "spawned", false);
|
|
43
43
|
__publicField(this, "windowTimer");
|
|
44
|
+
__publicField(this, "context");
|
|
44
45
|
/** 报错时把 dsh web 启动的原始日志作为一条日志整体输出(幂等:每实例只打一次) */
|
|
45
46
|
__publicField(this, "printed", false);
|
|
46
47
|
}
|
|
@@ -85,12 +86,24 @@ class LaunchToken {
|
|
|
85
86
|
/** 窗口到点:输出 dsh web 启动原始日志辅助诊断,再按未捕获 token 判定本次启动失败 */
|
|
86
87
|
expire() {
|
|
87
88
|
this.printStartupOutput();
|
|
89
|
+
const context = this.context?.();
|
|
90
|
+
const base = `dsh launch token was not captured from stdout within ${this.timeoutMs}ms (dsh >= 0.1.2 should print the "dsh web: http://127.0.0.1:<port>/?token=..." URL)`;
|
|
88
91
|
this.fail(
|
|
89
92
|
new Error(
|
|
90
|
-
|
|
93
|
+
context === void 0 || context.trim() === "" ? base : `${base}
|
|
94
|
+
${context}
|
|
95
|
+
\uFF08\u8FD9\u4E2A profile \u8D77\u4E0D\u4E86 Web UI \u65F6\u5C31\u662F\u8FD9\u4E2A\u75C7\u72B6\uFF1A\u5148\u786E\u8BA4\u5B83\u5EFA\u597D\u4E86\uFF09`
|
|
91
96
|
)
|
|
92
97
|
);
|
|
93
98
|
}
|
|
99
|
+
/**
|
|
100
|
+
* 附上"这次起的是哪个 profile"的上下文(provider 起进程前调用)。
|
|
101
|
+
* 只加在这里、不进 printStartupOutput:超时的那条错误要能自己说清 profile 与它的 bundle 列表,
|
|
102
|
+
* 否则症状永远只是"启动超时"(见 profile-check 的注释)。
|
|
103
|
+
*/
|
|
104
|
+
attachContext(provider) {
|
|
105
|
+
this.context = provider;
|
|
106
|
+
}
|
|
94
107
|
printStartupOutput() {
|
|
95
108
|
if (this.printed) return;
|
|
96
109
|
this.printed = true;
|
package/lib/deepseek-web.d.ts
CHANGED
|
@@ -33,6 +33,13 @@ export declare class LaunchToken {
|
|
|
33
33
|
fail(err: Error): void;
|
|
34
34
|
/** 窗口到点:输出 dsh web 启动原始日志辅助诊断,再按未捕获 token 判定本次启动失败 */
|
|
35
35
|
private expire;
|
|
36
|
+
/**
|
|
37
|
+
* 附上"这次起的是哪个 profile"的上下文(provider 起进程前调用)。
|
|
38
|
+
* 只加在这里、不进 printStartupOutput:超时的那条错误要能自己说清 profile 与它的 bundle 列表,
|
|
39
|
+
* 否则症状永远只是"启动超时"(见 profile-check 的注释)。
|
|
40
|
+
*/
|
|
41
|
+
attachContext(provider: () => string): void;
|
|
42
|
+
private context?;
|
|
36
43
|
/** 报错时把 dsh web 启动的原始日志作为一条日志整体输出(幂等:每实例只打一次) */
|
|
37
44
|
private printed;
|
|
38
45
|
private printStartupOutput;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
var profile_check_exports = {};
|
|
29
|
+
__export(profile_check_exports, {
|
|
30
|
+
DSH_WEB_APP_BUNDLE: () => DSH_WEB_APP_BUNDLE,
|
|
31
|
+
describeDshProfile: () => describeDshProfile,
|
|
32
|
+
inspectDshProfile: () => inspectDshProfile,
|
|
33
|
+
profileProblemText: () => profileProblemText
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(profile_check_exports);
|
|
36
|
+
var import_node_fs = __toESM(require("node:fs"));
|
|
37
|
+
var import_node_path = __toESM(require("node:path"));
|
|
38
|
+
const DSH_WEB_APP_BUNDLE = "@deepseek-ai/dsh-web-app";
|
|
39
|
+
function inspectDshProfile(profileDir) {
|
|
40
|
+
const manifest = import_node_path.default.join(profileDir, "package.json");
|
|
41
|
+
let parsed;
|
|
42
|
+
try {
|
|
43
|
+
parsed = JSON.parse(import_node_fs.default.readFileSync(manifest, "utf8"));
|
|
44
|
+
} catch {
|
|
45
|
+
return { ok: false, problem: "missing", bundles: [], manifest };
|
|
46
|
+
}
|
|
47
|
+
const declared = parsed?.dsh?.profile?.bundles;
|
|
48
|
+
const bundles = Array.isArray(declared) ? declared.filter((one) => typeof one === "string") : [];
|
|
49
|
+
if (!bundles.includes(DSH_WEB_APP_BUNDLE)) {
|
|
50
|
+
return { ok: false, problem: "no-web-app", bundles, manifest };
|
|
51
|
+
}
|
|
52
|
+
return { ok: true, problem: null, bundles, manifest };
|
|
53
|
+
}
|
|
54
|
+
function profileProblemText(inspection, profileDir, profile) {
|
|
55
|
+
const head = inspection.problem === "missing" ? `dsh profile "${profile}" \u8FD8\u4E0D\u5B58\u5728\uFF08\u627E\u4E0D\u5230 ${inspection.manifest}\uFF09` : `dsh profile "${profile}" \u91CC\u6CA1\u6709 Web \u5E94\u7528 bundle\uFF08${DSH_WEB_APP_BUNDLE}\uFF09`;
|
|
56
|
+
const bundles = inspection.bundles.length === 0 ? "\uFF08\u8BFB\u4E0D\u5230 bundle \u5217\u8868\uFF09" : `\u73B0\u6709 bundles\uFF1A${inspection.bundles.join("\u3001")}`;
|
|
57
|
+
return [
|
|
58
|
+
`${head}\uFF1A${profileDir}`,
|
|
59
|
+
` ${bundles}`,
|
|
60
|
+
" dsh \u5728 profile \u7F3A\u5931\u65F6\u4F1A\u81EA\u5DF1\u5EFA\u4E00\u4E2A\u53EA\u6709 @deepseek-ai/dsh-base \u7684\u7A7A\u58F3\uFF0C\u8D77\u6765\u4E0D\u4F1A\u6709\u754C\u9762\uFF1B",
|
|
61
|
+
" \u800C provider \u7684\u7F16\u6392\u662F\u300C\u5148\u88C5\u63D2\u4EF6\u3001\u518D\u8D77\u8FDB\u7A0B\u300D\uFF0C\u90A3\u4E00\u6B65\u4F1A\u628A\u7A7A\u58F3\u5EFA\u51FA\u6765\uFF0C\u75C7\u72B6\u53EA\u662F\u542F\u52A8\u8D85\u65F6\u3002",
|
|
62
|
+
" \u5148\u628A\u8FD9\u4E2A profile \u5EFA\u597D\uFF08\u5B83\u81EA\u5DF1\u7684\u5B89\u88C5\u6D41\u7A0B\uFF0C\u6216 `dsh <\u540D> --from-default-profile web`\uFF09\u518D\u91CD\u5F00\u3002"
|
|
63
|
+
].join("\n");
|
|
64
|
+
}
|
|
65
|
+
function describeDshProfile(profileDir, profile) {
|
|
66
|
+
const inspection = inspectDshProfile(profileDir);
|
|
67
|
+
const bundles = inspection.bundles.length === 0 ? "\uFF08\u8BFB\u4E0D\u5230\uFF09" : inspection.bundles.join("\u3001");
|
|
68
|
+
return `profile: ${profile} (${profileDir})
|
|
69
|
+
bundles: ${bundles}`;
|
|
70
|
+
}
|
|
71
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
72
|
+
0 && (module.exports = {
|
|
73
|
+
DSH_WEB_APP_BUNDLE,
|
|
74
|
+
describeDshProfile,
|
|
75
|
+
inspectDshProfile,
|
|
76
|
+
profileProblemText
|
|
77
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** dsh 的 Web 应用 bundle(`dsh web` 的 profile 必有;纯终端类 profile 没有) */
|
|
2
|
+
export declare const DSH_WEB_APP_BUNDLE = "@deepseek-ai/dsh-web-app";
|
|
3
|
+
export type DshProfileProblem = "missing" | "no-web-app";
|
|
4
|
+
export interface DshProfileInspection {
|
|
5
|
+
/** 这个 profile 现在能不能起 Web UI */
|
|
6
|
+
readonly ok: boolean;
|
|
7
|
+
/** 不能时是哪一类问题;能时为 null */
|
|
8
|
+
readonly problem: DshProfileProblem | null;
|
|
9
|
+
/** profile 声明的 bundle 列表(读不到时为空数组) */
|
|
10
|
+
readonly bundles: readonly string[];
|
|
11
|
+
/** profile 清单文件路径(报错信息里给绝对路径,方便直接去看) */
|
|
12
|
+
readonly manifest: string;
|
|
13
|
+
}
|
|
14
|
+
/** 读 profile 清单并判断它是否具备启动 Web UI 的条件 */
|
|
15
|
+
export declare function inspectDshProfile(profileDir: string): DshProfileInspection;
|
|
16
|
+
/** 预检没过时给用户的说明(通用措辞:说清是什么、去哪看、怎么修) */
|
|
17
|
+
export declare function profileProblemText(inspection: DshProfileInspection, profileDir: string, profile: string): string;
|
|
18
|
+
/** 启动超时诊断用的一行上下文:profile 在哪、声明了哪些 bundle */
|
|
19
|
+
export declare function describeDshProfile(profileDir: string, profile: string): string;
|
package/lib/provider.cjs
CHANGED
|
@@ -30,6 +30,7 @@ var import_constants = require("./constants.cjs");
|
|
|
30
30
|
var import_api = require("./api.cjs");
|
|
31
31
|
var import_deepseek_web = require("./deepseek-web.cjs");
|
|
32
32
|
var import_profile = require("./profile.cjs");
|
|
33
|
+
var import_profile_check = require("./profile-check.cjs");
|
|
33
34
|
var import_system = require("./system.cjs");
|
|
34
35
|
var import_dsh_install = require("./dsh-install.cjs");
|
|
35
36
|
const log = (0, import_node.createLogger)("DeepSeekWebProvider");
|
|
@@ -100,6 +101,14 @@ Please upgrade:
|
|
|
100
101
|
const launchToken = new import_deepseek_web.LaunchToken();
|
|
101
102
|
this.launchToken = launchToken;
|
|
102
103
|
this.api.setLaunchTokenSource(() => launchToken.wait());
|
|
104
|
+
launchToken.attachContext(() => (0, import_profile_check.describeDshProfile)(profileDir, this.opts.profile));
|
|
105
|
+
const profileCheck = (0, import_profile_check.inspectDshProfile)(profileDir);
|
|
106
|
+
if (!profileCheck.ok) {
|
|
107
|
+
const reason = (0, import_profile_check.profileProblemText)(profileCheck, profileDir, this.opts.profile);
|
|
108
|
+
log.error(reason);
|
|
109
|
+
launchToken.fail(new Error(reason));
|
|
110
|
+
throw new Error(reason);
|
|
111
|
+
}
|
|
103
112
|
const devClientDir = (0, import_dsh_install.resolveDevDshPackageSource)(import_meta.url, "dsh-client", "lib/client.js");
|
|
104
113
|
const providerVersion = (0, import_dsh_install.readProviderVersion)(import_meta.url);
|
|
105
114
|
const clientTarget = devClientDir ?? (providerVersion ? `${import_dsh_install.DSH_CLIENT_PACKAGE}@${providerVersion}` : `${import_dsh_install.DSH_CLIENT_PACKAGE}@latest`);
|
package/lib/types.d.ts
CHANGED
|
@@ -17,7 +17,13 @@ export type DeepSeekBusyEnter = BusyEnterBehavior;
|
|
|
17
17
|
export type DeepSeekProviderOptions = {
|
|
18
18
|
/** dsh 数据目录($DSH_HOME),默认跟随系统(~/.dsh) */
|
|
19
19
|
home?: string;
|
|
20
|
-
/**
|
|
20
|
+
/**
|
|
21
|
+
* dsh profile 名($DSH_HOME/profiles/<name>),默认 "web";AIPanel 侧插件与 web 进程都指向该 profile。
|
|
22
|
+
*
|
|
23
|
+
* ⚠️ 该 profile 必须**先建好**:其 `dsh.profile.bundles` 里要有 `@deepseek-ai/dsh-web-app`。
|
|
24
|
+
* 缺失时 dsh 的 `plugin` 子命令会自己建出一个只有 `@deepseek-ai/dsh-base` 的空壳,
|
|
25
|
+
* 于是启动只会表现为"等 launch token 超时"(见 profile-check.ts 的预检与说明)。
|
|
26
|
+
*/
|
|
21
27
|
profile?: string;
|
|
22
28
|
/** 默认 Agent 预设(dsh settings agent-presets.default,如 code/standard;新建会话的默认模式) */
|
|
23
29
|
agentPreset?: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aipanel/provider-deepseek",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.11",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "lib/index.cjs",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"registry": "https://registry.npmjs.org/"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@aipanel/core": "1.3.
|
|
24
|
+
"@aipanel/core": "1.3.11",
|
|
25
25
|
"execa": "^9.6.1"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|