@llmtrim/cli 0.5.0 → 0.6.1

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.
@@ -0,0 +1,22 @@
1
+ #!/usr/bin/env node
2
+ // Resolve the platform package's prebuilt tray binary and exec it with our args.
3
+ const { spawnSync } = require("child_process");
4
+ const fs = require("fs");
5
+ const path = require("path");
6
+ const pkg = `@llmtrim/${process.platform}-${process.arch}`;
7
+ const bin = process.platform === "win32" ? "llmtrim-tray.exe" : "llmtrim-tray";
8
+ let exe;
9
+ try {
10
+ exe = path.join(path.dirname(require.resolve(`${pkg}/package.json`)), "bin", bin);
11
+ } catch {
12
+ exe = null;
13
+ }
14
+ // The Linux platform packages resolve but carry no tray binary, so check the file too.
15
+ if (!exe || !fs.existsSync(exe)) {
16
+ console.error(`llmtrim-tray: no prebuilt tray for ${process.platform}-${process.arch}.`);
17
+ console.error("The npm package bundles the tray on macOS and Windows only.");
18
+ console.error("On Linux download llmtrim-tray from https://github.com/fkiene/llmtrim/releases");
19
+ process.exit(1);
20
+ }
21
+ const r = spawnSync(exe, process.argv.slice(2), { stdio: "inherit" });
22
+ process.exit(r.status === null ? 1 : r.status);
package/bin/llmtrim.js CHANGED
File without changes
package/package.json CHANGED
@@ -1,20 +1,21 @@
1
1
  {
2
2
  "name": "@llmtrim/cli",
3
- "version": "0.5.0",
3
+ "version": "0.6.1",
4
4
  "description": "Cut your LLM bill: drop-in proxy that compresses input, output, and cache. Any provider, answers unchanged.",
5
5
  "mcpName": "io.github.fkiene/llmtrim",
6
6
  "repository": "https://github.com/fkiene/llmtrim",
7
7
  "homepage": "https://github.com/fkiene/llmtrim#readme",
8
8
  "license": "MPL-2.0",
9
9
  "keywords": ["llm", "tokens", "compression", "proxy", "mcp", "openai", "anthropic", "claude"],
10
- "bin": { "llmtrim": "bin/llmtrim.js" },
10
+ "bin": { "llmtrim": "bin/llmtrim.js", "llmtrim-tray": "bin/llmtrim-tray.js" },
11
+ "engines": { "node": ">=10" },
11
12
  "files": ["bin", "README.md"],
12
13
  "optionalDependencies": {
13
- "@llmtrim/linux-x64": "0.5.0",
14
- "@llmtrim/linux-arm64": "0.5.0",
15
- "@llmtrim/darwin-x64": "0.5.0",
16
- "@llmtrim/darwin-arm64": "0.5.0",
17
- "@llmtrim/win32-x64": "0.5.0",
18
- "@llmtrim/win32-arm64": "0.5.0"
14
+ "@llmtrim/linux-x64": "0.6.1",
15
+ "@llmtrim/linux-arm64": "0.6.1",
16
+ "@llmtrim/darwin-x64": "0.6.1",
17
+ "@llmtrim/darwin-arm64": "0.6.1",
18
+ "@llmtrim/win32-x64": "0.6.1",
19
+ "@llmtrim/win32-arm64": "0.6.1"
19
20
  }
20
21
  }