dsh-router-core 0.3.5 → 0.3.8
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.js +1 -0
- package/package.json +9 -9
- package/src/index.ts +8 -0
package/lib/index.js
CHANGED
|
@@ -3253,6 +3253,7 @@ function apply(rawContext) {
|
|
|
3253
3253
|
loaded?.supplier.dispose();
|
|
3254
3254
|
log(`supplier unregistered: ${id}`);
|
|
3255
3255
|
};
|
|
3256
|
+
ctx.provide("router.suppliers", {});
|
|
3256
3257
|
const dataDir = dirname(stateFile);
|
|
3257
3258
|
const registerLoaded = (loaded) => {
|
|
3258
3259
|
loadedSuppliers.push(loaded);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-router-core",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.8",
|
|
4
4
|
"description": "DSH plugin: a simplified 9router (AI routing gateway). Adds a 路由系统 (Routing System) sidebar entry beside 记忆系统; the panel shows suppliers, account pool, combos, and endpoint/API keys.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
},
|
|
67
67
|
"license": "MIT",
|
|
68
68
|
"peerDependencies": {
|
|
69
|
-
"@deepseek-ai/cordis": "^4.0.
|
|
69
|
+
"@deepseek-ai/cordis": "^4.0.2",
|
|
70
70
|
"@deepseek-ai/dsh-client-locale": "*",
|
|
71
71
|
"@deepseek-ai/dsh-client-runtime": "*",
|
|
72
72
|
"@deepseek-ai/dsh-client-ui-slots": "*",
|
|
@@ -90,14 +90,14 @@
|
|
|
90
90
|
}
|
|
91
91
|
},
|
|
92
92
|
"devDependencies": {
|
|
93
|
-
"@types/node": "^24.
|
|
94
|
-
"@types/react": "~18.3.
|
|
95
|
-
"@types/react-dom": "~18.3.
|
|
96
|
-
"cordis": "^4.0.0-rc.
|
|
97
|
-
"react": "^18.
|
|
93
|
+
"@types/node": "^24.13.3",
|
|
94
|
+
"@types/react": "~18.3.31",
|
|
95
|
+
"@types/react-dom": "~18.3.7",
|
|
96
|
+
"cordis": "^4.0.0-rc.9",
|
|
97
|
+
"react": "^18.3.1",
|
|
98
98
|
"react-dom": "18.2.0",
|
|
99
|
-
"tsdown": "^0.22.
|
|
100
|
-
"typescript": "^5.
|
|
99
|
+
"tsdown": "^0.22.14",
|
|
100
|
+
"typescript": "^5.9.3",
|
|
101
101
|
"vite": "8.1.3",
|
|
102
102
|
"vite-plugin-css-injected-by-js": "^3.5.2"
|
|
103
103
|
},
|
package/src/index.ts
CHANGED
|
@@ -123,6 +123,7 @@ export function apply(rawContext: unknown): void {
|
|
|
123
123
|
const ctx = rawContext as {
|
|
124
124
|
get: (key: string) => unknown
|
|
125
125
|
on: (name: string, listener: (...args: unknown[]) => void) => unknown
|
|
126
|
+
provide: (name: string, value: unknown) => unknown
|
|
126
127
|
webServer: WebServer
|
|
127
128
|
llm?: Llm
|
|
128
129
|
logger: { info: (message: string) => void; warn: (message: string) => void }
|
|
@@ -170,6 +171,13 @@ export function apply(rawContext: unknown): void {
|
|
|
170
171
|
log(`supplier unregistered: ${id}`)
|
|
171
172
|
}
|
|
172
173
|
|
|
174
|
+
// 聚合表归核心所有:外部供应商插件(traework/codebuddy 等)只往里 append,不各自
|
|
175
|
+
// provide(cordis 同一 service 只允许一个插件注册,重复 provide 会抛错)。核心先提供
|
|
176
|
+
// 空表,任何独立安装的供应商插件都能经 ctx.inject(['router.suppliers']) 拿到同一个
|
|
177
|
+
// live 表把自己挂进来——不再依赖某个「宿主」插件提供它(此前只有 traework 会 provide,
|
|
178
|
+
// 单装 dsh-router-codebuddy 时表永不出现,codebuddy 就一直不生效)。
|
|
179
|
+
ctx.provide('router.suppliers', {})
|
|
180
|
+
|
|
173
181
|
// 内置 + 用户 + 外部插件供应商(异步加载,完成后注册路由 + 加入路由器)
|
|
174
182
|
const dataDir = dirname(stateFile)
|
|
175
183
|
const registerLoaded = (loaded: LoadedSupplier): void => {
|