@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.
Files changed (2) hide show
  1. package/dist/index.js +19 -2
  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.1";
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
- injectModelsAllowlist(providerModels.models);
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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opencompress/opencompress",
3
- "version": "1.6.1",
3
+ "version": "1.6.3",
4
4
  "description": "OpenCompress plugin for OpenClaw — automatic 5-layer prompt compression for any LLM",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",