@2en/clawly-plugins 1.19.2 → 1.20.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/model-gateway-setup.ts +16 -4
- package/package.json +1 -1
package/model-gateway-setup.ts
CHANGED
|
@@ -23,6 +23,12 @@ export const EXTRA_GATEWAY_MODELS: Array<{
|
|
|
23
23
|
alias: string
|
|
24
24
|
input: string[]
|
|
25
25
|
}> = [
|
|
26
|
+
{
|
|
27
|
+
id: 'moonshotai/kimi-k2.5',
|
|
28
|
+
name: 'moonshotai/kimi-k2.5',
|
|
29
|
+
alias: 'Kimi K2.5',
|
|
30
|
+
input: ['text', 'image'],
|
|
31
|
+
},
|
|
26
32
|
{
|
|
27
33
|
id: 'anthropic/claude-sonnet-4.6',
|
|
28
34
|
name: 'anthropic/claude-sonnet-4.6',
|
|
@@ -104,14 +110,15 @@ export function setupModelGateway(api: PluginApi): void {
|
|
|
104
110
|
}
|
|
105
111
|
}
|
|
106
112
|
|
|
107
|
-
// Ensure aliases exist for
|
|
113
|
+
// Ensure aliases exist for ALL models (existing + extras)
|
|
108
114
|
const agents = (config.agents ?? {}) as any
|
|
109
115
|
const defaults = agents.defaults ?? {}
|
|
110
116
|
const existingAliases: Record<string, {alias: string}> = defaults.models ?? {}
|
|
111
|
-
for (const m of
|
|
117
|
+
for (const m of existingModels) {
|
|
112
118
|
const key = `${PROVIDER_NAME}/${m.id}`
|
|
113
119
|
if (!existingAliases[key]) {
|
|
114
|
-
|
|
120
|
+
const extra = EXTRA_GATEWAY_MODELS.find((e) => e.id === m.id)
|
|
121
|
+
existingAliases[key] = {alias: extra?.alias ?? m.id}
|
|
115
122
|
dirty = true
|
|
116
123
|
}
|
|
117
124
|
}
|
|
@@ -169,9 +176,14 @@ export function setupModelGateway(api: PluginApi): void {
|
|
|
169
176
|
{id: imageModel, name: imageModel, input: ['text', 'image']},
|
|
170
177
|
]
|
|
171
178
|
|
|
179
|
+
const defaultIds = new Set(defaultModels.map((m) => m.id))
|
|
172
180
|
const models = [
|
|
173
181
|
...defaultModels,
|
|
174
|
-
...EXTRA_GATEWAY_MODELS.map(({id, name, input}) => ({
|
|
182
|
+
...EXTRA_GATEWAY_MODELS.filter((m) => !defaultIds.has(m.id)).map(({id, name, input}) => ({
|
|
183
|
+
id,
|
|
184
|
+
name,
|
|
185
|
+
input,
|
|
186
|
+
})),
|
|
175
187
|
]
|
|
176
188
|
|
|
177
189
|
if (!config.models) config.models = {}
|