@dsh-plus/llm-pi 0.1.21 → 0.1.22

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/index.d.ts CHANGED
@@ -84,7 +84,7 @@ declare const Config: z<LlmPiConfig>;
84
84
  //#endregion
85
85
  //#region src/index.d.ts
86
86
  declare const name = "dsh-plus-llm-pi";
87
- declare const inject: readonly ["llm"];
87
+ declare const inject: readonly ["credentials", "llm"];
88
88
  declare function apply(ctx: Context, config: LlmPiConfig): Promise<void>;
89
89
  //#endregion
90
90
  export { Config, type LlmPiConfig, type ModelEntryConfig, type ProviderProfileConfig, SETTINGS_NS, apply, inject, name };
package/lib/index.js CHANGED
@@ -2109,7 +2109,7 @@ async function startRuntime(ctx, rawConfig) {
2109
2109
  //#endregion
2110
2110
  //#region src/index.ts
2111
2111
  const name = "dsh-plus-llm-pi";
2112
- const inject = ["llm"];
2112
+ const inject = ["credentials", "llm"];
2113
2113
  async function apply(ctx, config) {
2114
2114
  const runtime = await startRuntime(ctx, config);
2115
2115
  ctx.inject(["webServer"], (webCtx) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dsh-plus/llm-pi",
3
- "version": "0.1.21",
3
+ "version": "0.1.22",
4
4
  "description": "dsh-plus service+ui plugin: 基于 PiAiAdapter 的自定义 LLM 路由(全量 compat、模型继承、models.dev 目录兜底)",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -31,8 +31,8 @@
31
31
  }
32
32
  },
33
33
  "dependencies": {
34
- "https-proxy-agent": "^9.1.0",
35
- "@dsh-plus/shared": "0.1.11"
34
+ "@dsh-plus/shared": "0.1.12",
35
+ "https-proxy-agent": "^9.1.0"
36
36
  },
37
37
  "peerDependencies": {
38
38
  "@deepseek-ai/cordis": "^4.0.2",
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,