dsh-router-core 0.1.0
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/README.md +151 -0
- package/cordis.patch.yml +9 -0
- package/lib/client-registry.js +3006 -0
- package/lib/client.js +3006 -0
- package/lib/index.js +1756 -0
- package/lib/types/credential-store.d.ts +15 -0
- package/lib/types/index.d.ts +6 -0
- package/lib/types/keys.d.ts +39 -0
- package/lib/types/llm/adapter.d.ts +31 -0
- package/lib/types/router/index.d.ts +73 -0
- package/lib/types/router/types.d.ts +80 -0
- package/lib/types/shared.d.ts +138 -0
- package/lib/types/supplier-config.d.ts +28 -0
- package/lib/types/suppliers/contract.d.ts +98 -0
- package/lib/types/suppliers/loader.d.ts +41 -0
- package/lib/types/suppliers/registry.d.ts +33 -0
- package/package.json +86 -0
- package/src/client/CombosTab.tsx +458 -0
- package/src/client/EndpointTab.tsx +360 -0
- package/src/client/Modal.tsx +46 -0
- package/src/client/RouterView.tsx +186 -0
- package/src/client/SupplierDetail.tsx +943 -0
- package/src/client/index.tsx +18 -0
- package/src/client/router.css +2096 -0
- package/src/client/sidebar-entry.ts +167 -0
- package/src/client/workspace-controller.ts +26 -0
- package/src/client/workspace-mount.tsx +117 -0
- package/src/credential-store.ts +64 -0
- package/src/index.ts +468 -0
- package/src/keys.ts +143 -0
- package/src/llm/adapter.ts +273 -0
- package/src/router/index.ts +273 -0
- package/src/router/types.ts +85 -0
- package/src/shared.ts +152 -0
- package/src/supplier-config.ts +144 -0
- package/src/suppliers/contract.ts +73 -0
- package/src/suppliers/loader.ts +191 -0
- package/src/suppliers/nvidia/plugin.ts +268 -0
- package/src/suppliers/opencode/plugin.ts +200 -0
- package/src/suppliers/openrouter/plugin.ts +282 -0
- package/src/suppliers/registry.ts +365 -0
- package/src/types.d.ts +45 -0
package/src/types.d.ts
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 最小类型声明:@deepseek-ai/dsh-settings 与 @deepseek-ai/schemastery。
|
|
3
|
+
*
|
|
4
|
+
* tsdown `neverBundle: [/^@deepseek-ai\//]` 会把 @deepseek-ai/* 保留为运行时
|
|
5
|
+
* import(DSH host 全局解析,见 dsh-model/dsh-better-sidebar)。这里只为 tsc
|
|
6
|
+
* 提供够用的形状,不安装依赖。
|
|
7
|
+
*/
|
|
8
|
+
declare module '@deepseek-ai/dsh-settings' {
|
|
9
|
+
export function settingsNamespace(value: string): string
|
|
10
|
+
export interface SettingsHooks {
|
|
11
|
+
validate?: (value: unknown) => void
|
|
12
|
+
setSource: (source: () => unknown) => void
|
|
13
|
+
onChange: () => void
|
|
14
|
+
}
|
|
15
|
+
export function installSettingsSection(
|
|
16
|
+
ctx: unknown,
|
|
17
|
+
ns: string,
|
|
18
|
+
schema: unknown,
|
|
19
|
+
entry: unknown,
|
|
20
|
+
hooks: SettingsHooks,
|
|
21
|
+
): void
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
declare module '@deepseek-ai/schemastery' {
|
|
25
|
+
interface Schema<T> {
|
|
26
|
+
default(value: T): Schema<T>
|
|
27
|
+
optional(): Schema<T | undefined>
|
|
28
|
+
required(): Schema<T>
|
|
29
|
+
step(n: number): Schema<T>
|
|
30
|
+
min(n: number): Schema<T>
|
|
31
|
+
max(n: number): Schema<T>
|
|
32
|
+
role(name: string): Schema<T>
|
|
33
|
+
}
|
|
34
|
+
interface Z {
|
|
35
|
+
string(): Schema<string>
|
|
36
|
+
number(): Schema<number>
|
|
37
|
+
boolean(): Schema<boolean>
|
|
38
|
+
object<T>(shape: { [K in keyof T]: Schema<T[K]> }): Schema<T>
|
|
39
|
+
array<T>(item?: Schema<T>): Schema<T[]>
|
|
40
|
+
union<T>(items: readonly Schema<T>[]): Schema<T>
|
|
41
|
+
const<T>(value: T): Schema<T>
|
|
42
|
+
}
|
|
43
|
+
const z: Z
|
|
44
|
+
export default z
|
|
45
|
+
}
|