coding-tool-x 3.7.9 → 3.7.10
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/dist/web/assets/{Analytics-D14GGF2y.js → Analytics-CkUtnoz9.js} +1 -1
- package/dist/web/assets/{ConfigTemplates-C0TeUSZg.js → ConfigTemplates-BwPqhE-N.js} +1 -1
- package/dist/web/assets/{Home-CUh_BsGm.js → Home-BANl91zG.js} +1 -1
- package/dist/web/assets/{PluginManager-DPZvPrT4.js → PluginManager-JMXWl37b.js} +1 -1
- package/dist/web/assets/{ProjectList-DUaiCvsF.js → ProjectList-CZwDgVvt.js} +1 -1
- package/dist/web/assets/{SessionList-XdHNM61o.js → SessionList-2fZmN7Au.js} +1 -1
- package/dist/web/assets/{SkillManager-I4LFlsVN.js → SkillManager-Bhzhkeis.js} +1 -1
- package/dist/web/assets/{WorkspaceManager-zMI7Lhzf.js → WorkspaceManager-B3lhhBD0.js} +1 -1
- package/dist/web/assets/index-LYvv7wtx.js +2 -0
- package/dist/web/index.html +1 -1
- package/package.json +1 -1
- package/src/server/api/omp-channels.js +10 -1
- package/src/server/services/omp-settings-manager.js +23 -3
- package/dist/web/assets/index-CCP7sRMP.js +0 -2
package/dist/web/index.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<link rel="icon" href="/favicon.ico">
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
7
7
|
<title>coding-tool-x · AI 编程工作台</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-LYvv7wtx.js"></script>
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/assets/markdown-BNJfEgCA.js">
|
|
10
10
|
<link rel="modulepreload" crossorigin href="/assets/vue-vendor-B5RqjEjQ.js">
|
|
11
11
|
<link rel="modulepreload" crossorigin href="/assets/naive-ui-BALVpMgd.js">
|
package/package.json
CHANGED
|
@@ -356,9 +356,18 @@ module.exports = () => {
|
|
|
356
356
|
if (!providerKey) {
|
|
357
357
|
return res.status(400).json({ error: 'providerKey is required' });
|
|
358
358
|
}
|
|
359
|
+
const requestedModelIds = uniqueModels([
|
|
360
|
+
req.body?.model,
|
|
361
|
+
req.body?.speedTestModel,
|
|
362
|
+
...(Array.isArray(req.body?.allowedModels) ? req.body.allowedModels : []),
|
|
363
|
+
...(Array.isArray(req.body?.models)
|
|
364
|
+
? req.body.models.map(model => typeof model === 'string' ? model : (model?.id || model?.name))
|
|
365
|
+
: [])
|
|
366
|
+
]);
|
|
359
367
|
const rawModels = getOmpCatalogModels(providerKey, {
|
|
360
368
|
forceCatalogRefresh: req.body?.forceRefresh === true,
|
|
361
|
-
catalogTimeout: 5000
|
|
369
|
+
catalogTimeout: 5000,
|
|
370
|
+
requestedModelIds
|
|
362
371
|
});
|
|
363
372
|
const normalizedCatalog = normalizeCatalogModelList(rawModels);
|
|
364
373
|
const models = normalizedCatalog.models.map(model => redactSensitiveFields(model));
|
|
@@ -170,7 +170,10 @@ function normalizeModels(channel = {}, options = {}) {
|
|
|
170
170
|
}
|
|
171
171
|
|
|
172
172
|
function readOmpCatalogModels(command, providerId, options = {}) {
|
|
173
|
-
const
|
|
173
|
+
const requestedModelIds = uniqueStrings(options.requestedModelIds);
|
|
174
|
+
const requested = new Set(requestedModelIds.map(modelId => modelId.toLowerCase()));
|
|
175
|
+
const useFullCatalog = requested.size > 0;
|
|
176
|
+
const cacheKey = `${command}\u0000${useFullCatalog ? `requested:${providerId}:${[...requested].sort().join(',')}` : providerId}`;
|
|
174
177
|
const cached = ompCatalogCache.get(cacheKey);
|
|
175
178
|
const now = Date.now();
|
|
176
179
|
const cacheTtl = cached?.failed ? OMP_CATALOG_FAILURE_CACHE_TTL_MS : OMP_CATALOG_CACHE_TTL_MS;
|
|
@@ -178,7 +181,8 @@ function readOmpCatalogModels(command, providerId, options = {}) {
|
|
|
178
181
|
return cached.models.map(model => ({ ...model }));
|
|
179
182
|
}
|
|
180
183
|
const runner = options.catalogRunner || options.modelsRunner || spawnSync;
|
|
181
|
-
const
|
|
184
|
+
const args = useFullCatalog ? ['models', '--json'] : ['models', providerId, '--json'];
|
|
185
|
+
const result = runner(command, args, {
|
|
182
186
|
encoding: 'utf8',
|
|
183
187
|
env: {
|
|
184
188
|
...process.env,
|
|
@@ -194,7 +198,22 @@ function readOmpCatalogModels(command, providerId, options = {}) {
|
|
|
194
198
|
}
|
|
195
199
|
try {
|
|
196
200
|
const parsed = JSON.parse(normalizeCommandOutput(result?.stdout).trim() || '{}');
|
|
197
|
-
const
|
|
201
|
+
const rawModels = Array.isArray(parsed.models) ? parsed.models : [];
|
|
202
|
+
let models = rawModels;
|
|
203
|
+
if (useFullCatalog) {
|
|
204
|
+
const providerCandidates = new Set([providerId, `${MANAGED_PROVIDER_PREFIX}${providerId}`]);
|
|
205
|
+
const selected = new Map();
|
|
206
|
+
for (const model of rawModels) {
|
|
207
|
+
const id = String(model?.id || '').trim().toLowerCase();
|
|
208
|
+
if (!requested.has(id)) continue;
|
|
209
|
+
const provider = normalizeProviderId(model?.provider || '');
|
|
210
|
+
const previous = selected.get(id);
|
|
211
|
+
if (!previous || (providerCandidates.has(provider) && !providerCandidates.has(normalizeProviderId(previous.provider || '')))) {
|
|
212
|
+
selected.set(id, model);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
models = [...selected.values()];
|
|
216
|
+
}
|
|
198
217
|
ompCatalogCache.set(cacheKey, { cachedAt: now, models, failed: false });
|
|
199
218
|
return models.map(model => ({ ...model }));
|
|
200
219
|
} catch {
|
|
@@ -203,6 +222,7 @@ function readOmpCatalogModels(command, providerId, options = {}) {
|
|
|
203
222
|
}
|
|
204
223
|
}
|
|
205
224
|
|
|
225
|
+
|
|
206
226
|
function getOmpCatalogModels(providerId, options = {}) {
|
|
207
227
|
const normalizedProviderId = normalizeProviderId(providerId);
|
|
208
228
|
if (!normalizedProviderId) return [];
|