@dsh-plus/llm-pi 0.1.21 → 0.1.23
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/lib/client.js +525 -59707
- package/lib/index.d.ts +1 -1
- package/lib/index.js +3 -1
- package/lib/style.css +101 -1269
- package/package.json +27 -27
- package/src/index.ts +5 -1
- package/src/profiles.ts +6 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dsh-plus/llm-pi",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.23",
|
|
4
4
|
"description": "dsh-plus service+ui plugin: 基于 PiAiAdapter 的自定义 LLM 路由(全量 compat、模型继承、models.dev 目录兜底)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -32,40 +32,40 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"https-proxy-agent": "^9.1.0",
|
|
35
|
-
"@dsh-plus/shared": "0.1.
|
|
35
|
+
"@dsh-plus/shared": "0.1.13"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"@deepseek-ai/cordis": "^4.0.2",
|
|
39
|
-
"@deepseek-ai/dsh-anonymous-user-id": "
|
|
40
|
-
"@deepseek-ai/dsh-credentials": "
|
|
41
|
-
"@deepseek-ai/dsh-home-paths": "
|
|
42
|
-
"@deepseek-ai/dsh-host-webserver": "
|
|
43
|
-
"@deepseek-ai/dsh-launch-environment": "
|
|
44
|
-
"@deepseek-ai/dsh-llm": "
|
|
45
|
-
"@deepseek-ai/dsh-llm-deepseek": "
|
|
46
|
-
"@deepseek-ai/dsh-llm-pi-ai": "
|
|
47
|
-
"@deepseek-ai/dsh-settings": "
|
|
48
|
-
"@deepseek-ai/dsh-util-values": "
|
|
39
|
+
"@deepseek-ai/dsh-anonymous-user-id": "^0.1.5-alpha.2",
|
|
40
|
+
"@deepseek-ai/dsh-credentials": "^0.1.5-alpha.2",
|
|
41
|
+
"@deepseek-ai/dsh-home-paths": "^0.1.5-alpha.2",
|
|
42
|
+
"@deepseek-ai/dsh-host-webserver": "^0.1.5-alpha.2",
|
|
43
|
+
"@deepseek-ai/dsh-launch-environment": "^0.1.5-alpha.2",
|
|
44
|
+
"@deepseek-ai/dsh-llm": "^0.1.5-alpha.2",
|
|
45
|
+
"@deepseek-ai/dsh-llm-deepseek": "^0.1.5-alpha.2",
|
|
46
|
+
"@deepseek-ai/dsh-llm-pi-ai": "^0.1.5-alpha.2",
|
|
47
|
+
"@deepseek-ai/dsh-settings": "^0.1.5-alpha.2",
|
|
48
|
+
"@deepseek-ai/dsh-util-values": "^0.1.5-alpha.2",
|
|
49
49
|
"@deepseek-ai/schemastery": "^3.18.2",
|
|
50
50
|
"@earendil-works/pi-ai": "^0.84.2"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@deepseek-ai/cordis": "4.0.2",
|
|
54
|
-
"@deepseek-ai/dsh-anonymous-user-id": "0.1.5-alpha.
|
|
55
|
-
"@deepseek-ai/dsh-atomic-write": "0.1.5-alpha.
|
|
56
|
-
"@deepseek-ai/dsh-attachment": "0.1.5-alpha.
|
|
57
|
-
"@deepseek-ai/dsh-credentials": "0.1.5-alpha.
|
|
58
|
-
"@deepseek-ai/dsh-home-paths": "0.1.5-alpha.
|
|
59
|
-
"@deepseek-ai/dsh-host-webserver": "0.1.5-alpha.
|
|
60
|
-
"@deepseek-ai/dsh-launch-environment": "0.1.5-alpha.
|
|
61
|
-
"@deepseek-ai/dsh-llm": "0.1.5-alpha.
|
|
62
|
-
"@deepseek-ai/dsh-llm-deepseek": "0.1.5-alpha.
|
|
63
|
-
"@deepseek-ai/dsh-llm-pi-ai": "0.1.5-alpha.
|
|
64
|
-
"@deepseek-ai/dsh-settings": "0.1.5-alpha.
|
|
65
|
-
"@deepseek-ai/dsh-timeout": "0.1.5-alpha.
|
|
66
|
-
"@deepseek-ai/dsh-typert-protocol": "0.1.5-alpha.
|
|
67
|
-
"@deepseek-ai/dsh-util-crypto": "0.1.5-alpha.
|
|
68
|
-
"@deepseek-ai/dsh-util-values": "0.1.5-alpha.
|
|
54
|
+
"@deepseek-ai/dsh-anonymous-user-id": "0.1.5-alpha.2",
|
|
55
|
+
"@deepseek-ai/dsh-atomic-write": "0.1.5-alpha.2",
|
|
56
|
+
"@deepseek-ai/dsh-attachment": "0.1.5-alpha.2",
|
|
57
|
+
"@deepseek-ai/dsh-credentials": "0.1.5-alpha.2",
|
|
58
|
+
"@deepseek-ai/dsh-home-paths": "0.1.5-alpha.2",
|
|
59
|
+
"@deepseek-ai/dsh-host-webserver": "0.1.5-alpha.2",
|
|
60
|
+
"@deepseek-ai/dsh-launch-environment": "0.1.5-alpha.2",
|
|
61
|
+
"@deepseek-ai/dsh-llm": "0.1.5-alpha.2",
|
|
62
|
+
"@deepseek-ai/dsh-llm-deepseek": "0.1.5-alpha.2",
|
|
63
|
+
"@deepseek-ai/dsh-llm-pi-ai": "0.1.5-alpha.2",
|
|
64
|
+
"@deepseek-ai/dsh-settings": "0.1.5-alpha.2",
|
|
65
|
+
"@deepseek-ai/dsh-timeout": "0.1.5-alpha.2",
|
|
66
|
+
"@deepseek-ai/dsh-typert-protocol": "0.1.5-alpha.2",
|
|
67
|
+
"@deepseek-ai/dsh-util-crypto": "0.1.5-alpha.2",
|
|
68
|
+
"@deepseek-ai/dsh-util-values": "0.1.5-alpha.2",
|
|
69
69
|
"@deepseek-ai/schemastery": "3.18.2",
|
|
70
70
|
"@earendil-works/pi-ai": "0.84.4",
|
|
71
71
|
"@types/react": "~18.3.31",
|
package/src/index.ts
CHANGED
|
@@ -8,6 +8,10 @@
|
|
|
8
8
|
* - 模块解析优先 dsh 安装树(dsh 升级即自动跟随上游),vendored 副本兜底。
|
|
9
9
|
*
|
|
10
10
|
* 注册全新的 route 名,不触碰官方 llm-pi-ai 的任何 route 与配置。
|
|
11
|
+
*
|
|
12
|
+
* 接线约束:inject 须含 credentials(auth-inline/deepseek-routes 经
|
|
13
|
+
* ctx.get('credentials') 读 seam;凭据解析为请求时惰性调用,硬声明保证
|
|
14
|
+
* 时序,消除启动早窗口的一次性 MISSING_CREDENTIAL)。
|
|
11
15
|
* @module @dsh-plus/llm-pi
|
|
12
16
|
*/
|
|
13
17
|
import type { Context } from '@deepseek-ai/cordis'
|
|
@@ -18,7 +22,7 @@ import { startRuntime } from './service.ts'
|
|
|
18
22
|
|
|
19
23
|
export const name = 'dsh-plus-llm-pi'
|
|
20
24
|
|
|
21
|
-
export const inject = ['llm'] as const
|
|
25
|
+
export const inject = ['credentials', 'llm'] as const
|
|
22
26
|
|
|
23
27
|
export type {
|
|
24
28
|
LlmPiConfig,
|
package/src/profiles.ts
CHANGED
|
@@ -568,6 +568,11 @@ export function resolveProfilesFallback(
|
|
|
568
568
|
// 模型物化:全显式条目 + route 级 api/baseURL(官方 resolveRouteModels 镜像,
|
|
569
569
|
// 无目录继承——归一化已把继承值落定在条目里)
|
|
570
570
|
const configuredMaxTokens = new Map<string, number>()
|
|
571
|
+
// 官方 0.1.5-alpha.2(llm-pi-ai)adapter 读取 profile.modelErrors/catalogError:
|
|
572
|
+
// 本 fallback 对条目严格校验、坏条目整体拒绝(不产生"条目级不可服务"的
|
|
573
|
+
// deferred 诊断),故补空表保持与官方 profile 形状一致——缺失会让
|
|
574
|
+
// PiAiAdapter.modelOf 读 modelErrors.get 时以 TypeError 打崩。
|
|
575
|
+
const modelErrors = new Map<string, string>()
|
|
571
576
|
const seen = new Set<string>()
|
|
572
577
|
const models = (source.models ?? []).map((entry) => {
|
|
573
578
|
if (entry.id.length === 0) invalid(provider, '存在空 id 的模型条目')
|
|
@@ -617,6 +622,7 @@ export function resolveProfilesFallback(
|
|
|
617
622
|
? {}
|
|
618
623
|
: { thinkingBudgets: { ...rest.thinkingBudgets } }),
|
|
619
624
|
configuredMaxTokens,
|
|
625
|
+
modelErrors,
|
|
620
626
|
piProvider: deps.createProvider({
|
|
621
627
|
id: provider,
|
|
622
628
|
name: displayName,
|