@opencompress/opencompress 1.8.1 → 1.8.2
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 +10 -10
- 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.8.
|
|
9
|
+
var VERSION = "1.8.2";
|
|
10
10
|
var DEFAULT_BASE_URL = "https://www.opencompress.ai/api";
|
|
11
11
|
function getApiKey(api) {
|
|
12
12
|
const auth = api.config.auth;
|
|
@@ -399,7 +399,7 @@ var plugin = {
|
|
|
399
399
|
const source = existingModels ? "from existing providers" : "fallback";
|
|
400
400
|
api.logger.info(`OpenCompress provider registered (${modelCount} models ${source}, 5-layer compression)`);
|
|
401
401
|
api.registerCommand({
|
|
402
|
-
name: "
|
|
402
|
+
name: "compress_stats",
|
|
403
403
|
description: "Show OpenCompress usage statistics and savings",
|
|
404
404
|
acceptsArgs: true,
|
|
405
405
|
requireAuth: false,
|
|
@@ -445,9 +445,9 @@ var plugin = {
|
|
|
445
445
|
}
|
|
446
446
|
}
|
|
447
447
|
});
|
|
448
|
-
api.logger.info("Registered /
|
|
448
|
+
api.logger.info("Registered /compress_stats command");
|
|
449
449
|
api.registerCommand({
|
|
450
|
-
name: "
|
|
450
|
+
name: "compress_byok",
|
|
451
451
|
description: "Connect your own LLM key (OpenAI/Anthropic/OpenRouter) to save more",
|
|
452
452
|
acceptsArgs: true,
|
|
453
453
|
requireAuth: false,
|
|
@@ -469,10 +469,10 @@ var plugin = {
|
|
|
469
469
|
"Connect your LLM provider key to pay them directly \u2014 we only charge the compression fee (20% of savings).",
|
|
470
470
|
"",
|
|
471
471
|
"**Usage:**",
|
|
472
|
-
" `/
|
|
473
|
-
" `/
|
|
474
|
-
" `/
|
|
475
|
-
" `/
|
|
472
|
+
" `/compress_byok sk-proj-xxx` \u2014 Connect OpenAI key",
|
|
473
|
+
" `/compress_byok sk-ant-xxx` \u2014 Connect Anthropic key",
|
|
474
|
+
" `/compress_byok sk-or-xxx` \u2014 Connect OpenRouter key",
|
|
475
|
+
" `/compress_byok off` \u2014 Switch back to router mode",
|
|
476
476
|
"",
|
|
477
477
|
data ? `**Balance:** $${Number(data.balance || 0).toFixed(2)}` : ""
|
|
478
478
|
].join("\n")
|
|
@@ -541,12 +541,12 @@ var plugin = {
|
|
|
541
541
|
"",
|
|
542
542
|
"Your upstream key is stored securely on the server, associated with your API key.",
|
|
543
543
|
"",
|
|
544
|
-
"To switch back: `/
|
|
544
|
+
"To switch back: `/compress_byok off`"
|
|
545
545
|
].join("\n")
|
|
546
546
|
};
|
|
547
547
|
}
|
|
548
548
|
});
|
|
549
|
-
api.logger.info("Registered /
|
|
549
|
+
api.logger.info("Registered /compress_byok command");
|
|
550
550
|
const os = __require("os");
|
|
551
551
|
const fs = __require("fs");
|
|
552
552
|
const path = __require("path");
|