@opencompress/opencompress 1.6.1 → 1.6.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/dist/index.js +19 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
|
|
|
6
6
|
});
|
|
7
7
|
|
|
8
8
|
// src/index.ts
|
|
9
|
-
var VERSION = "1.6.
|
|
9
|
+
var VERSION = "1.6.3";
|
|
10
10
|
var DEFAULT_BASE_URL = "https://www.opencompress.ai/api";
|
|
11
11
|
function getApiKey(api) {
|
|
12
12
|
const auth = api.config.auth;
|
|
@@ -396,7 +396,24 @@ var plugin = {
|
|
|
396
396
|
api.config.models.providers.opencompress = providerModels;
|
|
397
397
|
persistModelsConfig(providerModels);
|
|
398
398
|
persistAgentModelsJson(providerModels);
|
|
399
|
-
|
|
399
|
+
{
|
|
400
|
+
if (!api.config.agents) api.config.agents = {};
|
|
401
|
+
const agents = api.config.agents;
|
|
402
|
+
if (!agents.defaults) agents.defaults = {};
|
|
403
|
+
const defaults = agents.defaults;
|
|
404
|
+
if (!defaults.models) defaults.models = {};
|
|
405
|
+
const allowlist = defaults.models;
|
|
406
|
+
if (Object.keys(allowlist).length > 0) {
|
|
407
|
+
for (const m of providerModels.models) {
|
|
408
|
+
const fullId = `opencompress/${m.id}`;
|
|
409
|
+
if (!allowlist[fullId]) {
|
|
410
|
+
allowlist[fullId] = {};
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
const modelsForAllowlist = providerModels.models;
|
|
416
|
+
setTimeout(() => injectModelsAllowlist(modelsForAllowlist), 3e3);
|
|
400
417
|
const apiKey = getApiKey(api);
|
|
401
418
|
if (apiKey) {
|
|
402
419
|
persistAuthProfile(apiKey);
|