dsh-relayhub-bridge 0.1.2 → 0.1.3
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 +1 -1
- package/lib/index.js +33 -5
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -38,7 +38,7 @@ window.__ModuleLoader__.load({
|
|
|
38
38
|
|
|
39
39
|
const SETTINGS_NS = 'relayhub-bridge'
|
|
40
40
|
const PLUGIN_ID = 'dsh-relayhub-bridge'
|
|
41
|
-
const PLUGIN_VERSION = '0.1.
|
|
41
|
+
const PLUGIN_VERSION = '0.1.3'
|
|
42
42
|
const TOTP = { digits: 6, period: 30 }
|
|
43
43
|
const B32 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567'
|
|
44
44
|
const STYLE_ID = 'dsh-relayhub-bridge-styles'
|
package/lib/index.js
CHANGED
|
@@ -61,7 +61,7 @@ export const name = 'relayhub-bridge'
|
|
|
61
61
|
export const inject = ['llm']
|
|
62
62
|
|
|
63
63
|
/** Semantic version of this plugin, used in the identity header. */
|
|
64
|
-
export const PLUGIN_VERSION = '0.1.
|
|
64
|
+
export const PLUGIN_VERSION = '0.1.3'
|
|
65
65
|
|
|
66
66
|
/** Configuration schema, rendered by the Harness plugin settings page. */
|
|
67
67
|
export const Config = Schema.object({
|
|
@@ -196,14 +196,38 @@ export function apply(ctx, config) {
|
|
|
196
196
|
},
|
|
197
197
|
|
|
198
198
|
/**
|
|
199
|
-
*
|
|
200
|
-
*
|
|
199
|
+
* Retry policy for this route. Host 的 `prepareRoutes` 在注册时**无条件**
|
|
200
|
+
* 调用本方法(不是可选调用),缺失即 `TypeError: adapter.providerRetryPolicy
|
|
201
|
+
* is not a function`,插件激活直接失败(0.1.2 的启用失败即此因)。
|
|
202
|
+
* 返回 `undefined` 交给 Host 走默认策略。
|
|
203
|
+
* @param {string} _provider - the route id.
|
|
204
|
+
* @returns {undefined} use the harness default retry policy.
|
|
201
205
|
*/
|
|
202
|
-
|
|
206
|
+
providerRetryPolicy(_provider) {
|
|
207
|
+
return undefined
|
|
208
|
+
},
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Per-image request pricing. The token meter resolves this synchronously
|
|
212
|
+
* per measurement; a missing method makes measurement (and therefore
|
|
213
|
+
* compaction) throw. This lane quotes no per-image price.
|
|
214
|
+
* @returns {undefined} no image pricing declared.
|
|
215
|
+
*/
|
|
216
|
+
imageRequestPricing(_provider, _model) {
|
|
217
|
+
return undefined
|
|
218
|
+
},
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* Models this route can serve, from the last successful join. This is the
|
|
222
|
+
* name the harness calls; the earlier `discoverModels` spelling was never
|
|
223
|
+
* invoked by the runtime.
|
|
224
|
+
* @returns {Promise<object[]>} catalog entries.
|
|
225
|
+
*/
|
|
226
|
+
async listModels() {
|
|
203
227
|
return resolve().models.map((entry) => ({
|
|
204
228
|
provider: PROVIDER,
|
|
205
229
|
id: String(entry.id),
|
|
206
|
-
name: String(entry.id),
|
|
230
|
+
name: String(entry.name ?? entry.id),
|
|
207
231
|
inputModalities: ['text'],
|
|
208
232
|
}))
|
|
209
233
|
},
|
|
@@ -244,6 +268,10 @@ export function apply(ctx, config) {
|
|
|
244
268
|
|
|
245
269
|
// Expose the bridge on the context so other plugins (or a command surface)
|
|
246
270
|
// can drive a join without importing this module directly.
|
|
271
|
+
// Cordis requires the property to be provided by this plugin before it can
|
|
272
|
+
// be set; setting an unprovided property throws "cannot set property ...
|
|
273
|
+
// without provide" and kills activation (second 0.1.2-era enable failure).
|
|
274
|
+
ctx.provide?.('relayhubBridge')
|
|
247
275
|
ctx.set?.('relayhubBridge', {
|
|
248
276
|
provider: PROVIDER,
|
|
249
277
|
/** Join a station and return the configuration patch to persist. */
|
package/package.json
CHANGED