@llmtrim/js 0.2.1 → 0.3.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.
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # llmtrim-wasm
1
+ # @llmtrim/js
2
2
 
3
3
  WebAssembly/JS bindings for the [`llmtrim-core`](../llmtrim-core) compression engine, for
4
4
  running the static prompt/payload compressor in a browser, Node, Bun, Deno, or a Cloudflare
package/llmtrim_wasm.d.ts CHANGED
@@ -36,9 +36,15 @@ export interface StageReport {
36
36
  * - `provider`: `"openai"`, `"anthropic"`, or `"google"`; omit (`null`/`undefined`) to
37
37
  * auto-detect from the body shape.
38
38
  * - `preset`: a named workload preset (`aggressive`, `agent`, `code`, `rag`, `safe`, …);
39
- * omit to use the built-in defaults. Unlike the native crate, this binding never reads
40
- * the environment or a config file (there is none in a Worker), so the configuration
41
- * comes only from the preset or the defaults.
39
+ * omit to use the shipped default (`auto` shape-routing), matching the native CLI.
40
+ * Unlike the native crate, this binding never reads the environment or a config file
41
+ * (there is none in a Worker), so the configuration comes only from the preset or the
42
+ * `auto` default. Pass `"safe"` to restore the lossless-only behavior this binding had
43
+ * before `auto` became the no-preset default.
44
+ *
45
+ * Cross-binding note: with no preset, this binding applies `auto`, while the UniFFI binding
46
+ * reads the host's environment/config. For output that matches every binding regardless of
47
+ * host, pass an explicit preset.
42
48
  *
43
49
  * Returns the [`CompressOutput`] as a typed JS object (TypeScript types are generated for
44
50
  * it), or throws on invalid JSON, an undetectable provider, or an unknown preset/provider
@@ -4,9 +4,15 @@
4
4
  * - `provider`: `"openai"`, `"anthropic"`, or `"google"`; omit (`null`/`undefined`) to
5
5
  * auto-detect from the body shape.
6
6
  * - `preset`: a named workload preset (`aggressive`, `agent`, `code`, `rag`, `safe`, …);
7
- * omit to use the built-in defaults. Unlike the native crate, this binding never reads
8
- * the environment or a config file (there is none in a Worker), so the configuration
9
- * comes only from the preset or the defaults.
7
+ * omit to use the shipped default (`auto` shape-routing), matching the native CLI.
8
+ * Unlike the native crate, this binding never reads the environment or a config file
9
+ * (there is none in a Worker), so the configuration comes only from the preset or the
10
+ * `auto` default. Pass `"safe"` to restore the lossless-only behavior this binding had
11
+ * before `auto` became the no-preset default.
12
+ *
13
+ * Cross-binding note: with no preset, this binding applies `auto`, while the UniFFI binding
14
+ * reads the host's environment/config. For output that matches every binding regardless of
15
+ * host, pass an explicit preset.
10
16
  *
11
17
  * Returns the [`CompressOutput`] as a typed JS object (TypeScript types are generated for
12
18
  * it), or throws on invalid JSON, an undetectable provider, or an unknown preset/provider
Binary file
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@llmtrim/js",
3
3
  "type": "module",
4
4
  "description": "WebAssembly/JS bindings for the llmtrim-core compression engine (wasm-bindgen).",
5
- "version": "0.2.1",
5
+ "version": "0.3.1",
6
6
  "license": "MPL-2.0",
7
7
  "repository": {
8
8
  "type": "git",
@@ -20,5 +20,16 @@
20
20
  "sideEffects": [
21
21
  "./llmtrim_wasm.js",
22
22
  "./snippets/*"
23
+ ],
24
+ "keywords": [
25
+ "llm",
26
+ "tokens",
27
+ "compression",
28
+ "proxy",
29
+ "openai",
30
+ "anthropic",
31
+ "claude",
32
+ "wasm",
33
+ "webassembly"
23
34
  ]
24
35
  }