@omdp/dsh-key-fallback 1.0.5 → 1.0.6
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 +22 -5
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -121,12 +121,29 @@ window.__ModuleLoader__.load({
|
|
|
121
121
|
)
|
|
122
122
|
}
|
|
123
123
|
|
|
124
|
+
function FallbackSection() {
|
|
125
|
+
// 同一个 KeyFallbackCard 样式,只是放在 section 页面容器中。
|
|
126
|
+
return React.createElement('div', { style: { padding: '12px 0' } },
|
|
127
|
+
React.createElement('h3', { style: { margin: '0 0 8px 0', fontSize: '14px', fontWeight: 600 } }, 'API Key 回退 — 池状态'),
|
|
128
|
+
React.createElement(KeyFallbackCard))
|
|
129
|
+
}
|
|
130
|
+
|
|
124
131
|
function apply(ctx) {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
//
|
|
128
|
-
//
|
|
129
|
-
|
|
132
|
+
var slots = ctx.get('slots')
|
|
133
|
+
if (slots === undefined) return
|
|
134
|
+
// 1) 独立设置页:左侧菜单出现“API Key 回退”项(永远可见,不依赖 served)。
|
|
135
|
+
// 与 dshmarket/connector 的 settings.section 同构。
|
|
136
|
+
slots.inject('settings.section', function () {
|
|
137
|
+
return slots.register({
|
|
138
|
+
name: 'settings.section',
|
|
139
|
+
id: 'key-fallback',
|
|
140
|
+
order: 62,
|
|
141
|
+
label: 'API Key 回退',
|
|
142
|
+
}, FallbackSection)
|
|
143
|
+
})
|
|
144
|
+
// 2) 插件配置标签下的状态卡(served 时显示;上述独立页的补充)。
|
|
145
|
+
// 我们的 host 已用 installSettingsSection 注册 key-fallback 命名空间使它可 serve;
|
|
146
|
+
// 这里复用同一 KeyFallbackCard。
|
|
130
147
|
var scopedInject = ctx.inject
|
|
131
148
|
if (typeof scopedInject === 'function') {
|
|
132
149
|
scopedInject(['settingsScope'], function (scoped) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@omdp/dsh-key-fallback",
|
|
3
3
|
"description": "Minimal API key fallback for DeepSeek Harness: on a retryable request error, silently retry the same call with the next key in the pool.",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.6",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"exports": {
|