@aipanel/provider-deepseek 1.2.17 → 1.2.18
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 +3 -0
- package/es/deepseek-web.js +16 -10
- package/es/provider.js +1 -0
- package/lib/deepseek-web.cjs +16 -10
- package/lib/deepseek-web.d.ts +3 -0
- package/lib/provider.cjs +1 -0
- package/package.json +2 -2
package/es/deepseek-web.d.ts
CHANGED
|
@@ -17,6 +17,9 @@ export declare class LaunchToken {
|
|
|
17
17
|
recordOutput(stream: "stdout" | "stderr", text: string): void;
|
|
18
18
|
/** 从子进程输出写入已解析的 token(幂等:只接受第一个) */
|
|
19
19
|
set(token: string): void;
|
|
20
|
+
/** 报错时把 dsh web 启动的原始日志作为一条日志整体输出(幂等:每实例只打一次) */
|
|
21
|
+
private printed;
|
|
22
|
+
private printStartupOutput;
|
|
20
23
|
/** 已解析的 token(未就绪时 undefined) */
|
|
21
24
|
get(): string | undefined;
|
|
22
25
|
/** 等待 token 就绪(默认 20s 超时;未打印则抛错并快速失败,调用方降级处理) */
|
package/es/deepseek-web.js
CHANGED
|
@@ -13,6 +13,8 @@ class LaunchToken {
|
|
|
13
13
|
/** dsh 进程原始输出尾部缓存,超时报错时回填,便于定位真实根因 */
|
|
14
14
|
__publicField(this, "stdoutTail", "");
|
|
15
15
|
__publicField(this, "stderrTail", "");
|
|
16
|
+
/** 报错时把 dsh web 启动的原始日志作为一条日志整体输出(幂等:每实例只打一次) */
|
|
17
|
+
__publicField(this, "printed", false);
|
|
16
18
|
}
|
|
17
19
|
/** 记录 dsh 进程原始输出(只保留末尾,防止内存无限增长),用于超时报错时辅助诊断 */
|
|
18
20
|
recordOutput(stream, text) {
|
|
@@ -31,6 +33,16 @@ class LaunchToken {
|
|
|
31
33
|
}
|
|
32
34
|
this.waiters = [];
|
|
33
35
|
}
|
|
36
|
+
printStartupOutput() {
|
|
37
|
+
if (this.printed) return;
|
|
38
|
+
this.printed = true;
|
|
39
|
+
const stdout = this.stdoutTail.trim();
|
|
40
|
+
const stderr = this.stderrTail.trim();
|
|
41
|
+
const lines = ["dsh launch token was not captured; dsh web startup output:"];
|
|
42
|
+
lines.push(stdout || "(no dsh stdout captured)");
|
|
43
|
+
if (stderr) lines.push(`dsh web stderr: ${stderr}`);
|
|
44
|
+
log.warn(lines.join("\n"));
|
|
45
|
+
}
|
|
34
46
|
/** 已解析的 token(未就绪时 undefined) */
|
|
35
47
|
get() {
|
|
36
48
|
return this.token;
|
|
@@ -41,16 +53,10 @@ class LaunchToken {
|
|
|
41
53
|
if (this.failure) return Promise.reject(this.failure);
|
|
42
54
|
return new Promise((resolve, reject) => {
|
|
43
55
|
const timer = setTimeout(() => {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
detail.push("-- last dsh stdout --", this.stdoutTail.trim());
|
|
49
|
-
}
|
|
50
|
-
if (this.stderrTail.trim()) {
|
|
51
|
-
detail.push("-- last dsh stderr --", this.stderrTail.trim());
|
|
52
|
-
}
|
|
53
|
-
const err = new Error(detail.join("\n"));
|
|
56
|
+
this.printStartupOutput();
|
|
57
|
+
const err = new Error(
|
|
58
|
+
`dsh launch token was not captured from stdout within ${timeoutMs}ms (dsh >= 0.1.2 should print the "dsh web: http://127.0.0.1:<port>/?token=..." URL)`
|
|
59
|
+
);
|
|
54
60
|
this.failure = err;
|
|
55
61
|
for (const w of this.waiters) {
|
|
56
62
|
clearTimeout(w.timer);
|
package/es/provider.js
CHANGED
|
@@ -61,6 +61,7 @@ or run without installing:
|
|
|
61
61
|
};
|
|
62
62
|
}
|
|
63
63
|
const version = await getDeepSeekVersion();
|
|
64
|
+
log.debug("Detected dsh version", { version: version ?? "unknown" });
|
|
64
65
|
const compatible = version === null ? true : isDeepSeekVersionAtLeast(version);
|
|
65
66
|
if (compatible === false) {
|
|
66
67
|
return {
|
package/lib/deepseek-web.cjs
CHANGED
|
@@ -35,6 +35,8 @@ class LaunchToken {
|
|
|
35
35
|
/** dsh 进程原始输出尾部缓存,超时报错时回填,便于定位真实根因 */
|
|
36
36
|
__publicField(this, "stdoutTail", "");
|
|
37
37
|
__publicField(this, "stderrTail", "");
|
|
38
|
+
/** 报错时把 dsh web 启动的原始日志作为一条日志整体输出(幂等:每实例只打一次) */
|
|
39
|
+
__publicField(this, "printed", false);
|
|
38
40
|
}
|
|
39
41
|
/** 记录 dsh 进程原始输出(只保留末尾,防止内存无限增长),用于超时报错时辅助诊断 */
|
|
40
42
|
recordOutput(stream, text) {
|
|
@@ -53,6 +55,16 @@ class LaunchToken {
|
|
|
53
55
|
}
|
|
54
56
|
this.waiters = [];
|
|
55
57
|
}
|
|
58
|
+
printStartupOutput() {
|
|
59
|
+
if (this.printed) return;
|
|
60
|
+
this.printed = true;
|
|
61
|
+
const stdout = this.stdoutTail.trim();
|
|
62
|
+
const stderr = this.stderrTail.trim();
|
|
63
|
+
const lines = ["dsh launch token was not captured; dsh web startup output:"];
|
|
64
|
+
lines.push(stdout || "(no dsh stdout captured)");
|
|
65
|
+
if (stderr) lines.push(`dsh web stderr: ${stderr}`);
|
|
66
|
+
log.warn(lines.join("\n"));
|
|
67
|
+
}
|
|
56
68
|
/** 已解析的 token(未就绪时 undefined) */
|
|
57
69
|
get() {
|
|
58
70
|
return this.token;
|
|
@@ -63,16 +75,10 @@ class LaunchToken {
|
|
|
63
75
|
if (this.failure) return Promise.reject(this.failure);
|
|
64
76
|
return new Promise((resolve, reject) => {
|
|
65
77
|
const timer = setTimeout(() => {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
detail.push("-- last dsh stdout --", this.stdoutTail.trim());
|
|
71
|
-
}
|
|
72
|
-
if (this.stderrTail.trim()) {
|
|
73
|
-
detail.push("-- last dsh stderr --", this.stderrTail.trim());
|
|
74
|
-
}
|
|
75
|
-
const err = new Error(detail.join("\n"));
|
|
78
|
+
this.printStartupOutput();
|
|
79
|
+
const err = new Error(
|
|
80
|
+
`dsh launch token was not captured from stdout within ${timeoutMs}ms (dsh >= 0.1.2 should print the "dsh web: http://127.0.0.1:<port>/?token=..." URL)`
|
|
81
|
+
);
|
|
76
82
|
this.failure = err;
|
|
77
83
|
for (const w of this.waiters) {
|
|
78
84
|
clearTimeout(w.timer);
|
package/lib/deepseek-web.d.ts
CHANGED
|
@@ -17,6 +17,9 @@ export declare class LaunchToken {
|
|
|
17
17
|
recordOutput(stream: "stdout" | "stderr", text: string): void;
|
|
18
18
|
/** 从子进程输出写入已解析的 token(幂等:只接受第一个) */
|
|
19
19
|
set(token: string): void;
|
|
20
|
+
/** 报错时把 dsh web 启动的原始日志作为一条日志整体输出(幂等:每实例只打一次) */
|
|
21
|
+
private printed;
|
|
22
|
+
private printStartupOutput;
|
|
20
23
|
/** 已解析的 token(未就绪时 undefined) */
|
|
21
24
|
get(): string | undefined;
|
|
22
25
|
/** 等待 token 就绪(默认 20s 超时;未打印则抛错并快速失败,调用方降级处理) */
|
package/lib/provider.cjs
CHANGED
|
@@ -71,6 +71,7 @@ or run without installing:
|
|
|
71
71
|
};
|
|
72
72
|
}
|
|
73
73
|
const version = await (0, import_system.getDeepSeekVersion)();
|
|
74
|
+
log.debug("Detected dsh version", { version: version ?? "unknown" });
|
|
74
75
|
const compatible = version === null ? true : (0, import_system.isDeepSeekVersionAtLeast)(version);
|
|
75
76
|
if (compatible === false) {
|
|
76
77
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aipanel/provider-deepseek",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.18",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "lib/index.cjs",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"execa": "^9.6.1",
|
|
25
|
-
"@aipanel/core": "1.2.
|
|
25
|
+
"@aipanel/core": "1.2.18"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"esbuild": "^0.25.0"
|