anolisa-tokenless 0.7.9 → 0.7.11

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
@@ -7,7 +7,7 @@
7
7
  Token-Less combines complementary strategies to minimize LLM token consumption:
8
8
 
9
9
  - **Schema & Response Compression** — Compresses OpenAI Function Calling tool definitions and API responses via the `tokenless-schema` library, cutting structural overhead before tokens ever reach the context window.
10
- - **TOON Context Compression** — Encodes JSON responses to TOON (Token-Oriented Object Notation) format via the `toon` binary, reducing token usage by 15-40% for structured data.
10
+ - **TOON Context Compression** — Encodes JSON responses to TOON (Token-Oriented Object Notation) format via the `toon-format` library linked into `tokenless`, reducing token usage by 15-40% for structured data.
11
11
  - **Command Rewriting** — Integrates [RTK](https://github.com/rtk-ai/rtk) to filter and rewrite CLI command output, eliminating noise that would otherwise waste 60–90% of tokens.
12
12
  - **Tool Ready (legacy, hard-disabled)** — Its pre-call dependency checks are retained in source but unconditionally bypassed while the readiness model is redesigned.
13
13
 
@@ -62,7 +62,13 @@ tokenless only removes redundancy from **tool call responses** before they enter
62
62
  ### Where it pays little or doesn't apply
63
63
 
64
64
  - **Chat-heavy / few tool calls**: tool-response share is tiny, overall savings approach 0.
65
- - **Already-short responses**: when `after >= before`, the CLI emits the original and records no stats (expected).
65
+ - **No fixed minimum payload**: `compress-schema` and `compress-response` build a
66
+ candidate for every accepted valid JSON input. In active mode, they emit it only
67
+ when its estimated token count is strictly lower than the original. A small input
68
+ with removable content can still compress, while a larger already-compact input can
69
+ pass through unchanged; the CLI writes the reason to stderr and records no stats.
70
+ In dry-run mode, the CLI always emits the original and may record a smaller candidate
71
+ as a predicted saving.
66
72
  - **Model inference tokens / billed tokens**: outside what tokenless touches.
67
73
 
68
74
  ### Estimating the effect
@@ -119,7 +125,7 @@ Token-Less/
119
125
  Install the published component with the ANOLISA CLI:
120
126
 
121
127
  The install script places `anolisa` in `~/.local/bin`, and a user-mode
122
- Tokenless installation places `tokenless`, `rtk`, and `toon` in that same
128
+ Tokenless installation places `tokenless` and `rtk` in that same
123
129
  directory. Export it once if the current shell has not picked it up yet.
124
130
 
125
131
  ```bash
@@ -180,8 +186,8 @@ cd Token-Less
180
186
  make setup
181
187
  ```
182
188
 
183
- The source setup installs `tokenless` to `~/.local/bin`, places the `rtk` and
184
- `toon` helpers alongside it, and deploys all adapters for development.
189
+ The source setup installs `tokenless` to `~/.local/bin`, places the `rtk`
190
+ helper alongside it, and deploys all adapters for development.
185
191
 
186
192
  ### Build the Python runtime
187
193
 
@@ -208,8 +214,38 @@ package is built and tested in this repository but is not yet published to
208
214
  PyPI. See the [runtime design](docs/design/runtime-library.md)
209
215
  and the [user manual](../../docs/user-guide/en/token-saving/tokenless/user-manual.md#build-the-python-runtime-from-source).
210
216
 
217
+ The same wheel provides typed, read-only statistics queries without requiring
218
+ the CLI. Point `TokenlessStats` at the state directory used by the runtime, or
219
+ use the lazy `sdk.stats` client:
220
+
221
+ ```python
222
+ from anolisa_tokenless import TokenlessStats
223
+
224
+ stats = TokenlessStats("/absolute/path/to/tokenless-data")
225
+ summary = stats.summary()
226
+ print(summary.total.tokens_saved, summary.total.tokens_saved_percent)
227
+ ```
228
+
229
+ Token counts are estimates and only operations with positive savings are
230
+ recorded. `show()` and detailed `diff()` results may contain sensitive tool
231
+ input and output stored in `stats.db`. Read-only describes the API surface:
232
+ opening the client follows CLI initialization and may create or migrate
233
+ `stats.db`, so the data directory must be writable. `summary(limit=None)` and
234
+ `compare(..., limit=None)` inspect at most the newest 10,000 records. For a
235
+ session or tool-use diff, at most the newest 10,000 matching records are read.
236
+ For a meaningful comparison, pass a dry-run session first and an active
237
+ Tokenless session second.
238
+
211
239
  ## CLI Usage
212
240
 
241
+ The standalone `compress-schema` and `compress-response` commands use this
242
+ content-dependent savings check rather than a fixed byte or character minimum.
243
+ The description, string, array, and depth limits in the
244
+ [CLI reference](../../docs/user-guide/en/token-saving/tokenless/cli-reference.md)
245
+ trigger individual transformations; they are not minimum total payload sizes.
246
+ Agent adapters may apply separate pre-check thresholds; see the
247
+ [framework integration guide](../../docs/user-guide/en/token-saving/tokenless/framework-integration.md#adapter-processing-rules).
248
+
213
249
  ### compress-schema
214
250
 
215
251
  Compress a single tool schema:
@@ -673,9 +709,8 @@ transformed. Tool Ready remains hard-disabled.
673
709
 
674
710
  | Target | Description |
675
711
  |---|---|
676
- | `make build` | Build `tokenless` + `rtk` + `toon` (release mode) |
712
+ | `make build` | Build `tokenless` + `rtk` (release mode) |
677
713
  | `make build-tokenless` | Build `tokenless` + `rtk` (via justfile) |
678
- | `make build-toon` | Install TOON binary via `cargo install toon-format` |
679
714
  | `make python-wheel` | Build the native `anolisa-tokenless` wheel |
680
715
  | `make agentscope-wheel` | Build the pure-Python AgentScope integration wheel |
681
716
  | `make test-python-runtime` | Install and test the wheel in an isolated environment |
@@ -713,7 +748,7 @@ make install BIN_DIR=/usr/local/bin
713
748
 
714
749
  ## Raw Packaging
715
750
 
716
- Raw packaging accepts already-built `tokenless`, `rtk`, and `toon`
751
+ Raw packaging accepts already-built `tokenless` and `rtk`
717
752
  executables in one directory and applies the stable component payload layout:
718
753
 
719
754
  ```bash
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tokenless",
3
- "version": "0.7.9",
3
+ "version": "0.7.11",
4
4
  "description": "Token-Less context compression for Claude Code — RTK command rewriting, response/TOON compression, and Tool Ready environment pre-check",
5
5
  "author": { "name": "ANOLISA" },
6
6
  "license": "Apache-2.0",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tokenless",
3
- "version": "0.7.9",
3
+ "version": "0.7.11",
4
4
  "description": "Intelligent tool response compression, environment error detection, and token optimization. Strips noise (debug fields, nulls, empty values), truncates long strings/arrays, applies TOON encoding for JSON responses, and classifies environment errors with actionable fix hints.",
5
5
  "keywords": [
6
6
  "compression",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tokenless",
3
- "version": "0.7.9",
3
+ "version": "0.7.11",
4
4
  "contextFileName": "COPILOT.md",
5
5
  "hooks": {
6
6
  "PreToolUse": [
@@ -47,7 +47,7 @@ _RTK_LOCAL_SHARE = _user_path(
47
47
  )
48
48
  _RTK_LOCAL_LIB = _user_path(".local", "lib", "anolisa", "tokenless", "rtk")
49
49
 
50
- _TOKENLESS_HELPER_BINARIES = frozenset({"rtk", "toon"})
50
+ _TOKENLESS_HELPER_BINARIES = frozenset({"rtk"})
51
51
 
52
52
 
53
53
  def _known_binary_paths(name: str, home: str | None = None) -> tuple[str, ...]:
@@ -295,7 +295,7 @@ resolve_binary() {
295
295
  candidates+=("$USER_HOME/.local/bin/$name")
296
296
  fi
297
297
  case "$name" in
298
- rtk|toon)
298
+ rtk)
299
299
  if [ -n "$USER_HOME" ]; then
300
300
  candidates+=(
301
301
  "$USER_HOME/.local/lib/anolisa/libexec/tokenless/$name"
@@ -306,13 +306,13 @@ resolve_binary() {
306
306
  esac
307
307
  candidates+=("/usr/local/bin/$name")
308
308
  case "$name" in
309
- rtk|toon)
309
+ rtk)
310
310
  candidates+=("/usr/local/libexec/anolisa/tokenless/$name")
311
311
  ;;
312
312
  esac
313
313
  candidates+=("/usr/bin/$name")
314
314
  case "$name" in
315
- rtk|toon)
315
+ rtk)
316
316
  candidates+=(
317
317
  "/usr/libexec/anolisa/tokenless/$name"
318
318
  "/usr/lib/anolisa/tokenless/$name"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anolisa/dsh-tokenless",
3
- "version": "0.7.9",
3
+ "version": "0.7.11",
4
4
  "description": "Native DeepSeek Harness response compression for Tokenless",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,5 +1,5 @@
1
1
  name: tokenless
2
- version: "0.7.9"
2
+ version: "0.7.11"
3
3
  description: "Token-Less context compression for Hermes Agent — response compression, TOON encoding, command rewriting, and registered but hard-disabled Tool Ready"
4
4
  author: ANOLISA
5
5
  requires_env: []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "component": "tokenless",
3
- "version": "0.7.9",
3
+ "version": "0.7.11",
4
4
  "targets": {
5
5
  "cosh": {
6
6
  "compatibleVersions": "*",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "tokenless",
3
3
  "name": "Tokenless",
4
- "version": "0.7.9",
4
+ "version": "0.7.11",
5
5
  "description": "Unified RTK command rewriting + response/TOON compression + registered but hard-disabled Tool Ready. Wraps tokenless and rtk system binaries via child_process — this is expected and not malicious.",
6
6
  "activation": {
7
7
  "onCapabilities": ["hook"]
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tokenless/openclaw-plugin",
3
- "version": "0.7.9",
3
+ "version": "0.7.11",
4
4
  "description": "Unified OpenClaw plugin — RTK command rewriting + tokenless schema/response compression for 60-90% LLM token savings",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tokenless",
3
- "version": "0.7.9",
3
+ "version": "0.7.11",
4
4
  "description": "Token-Less LLM Token Optimization Toolkit for Qoder CLI",
5
5
  "author": {
6
6
  "name": "Shile Zhang",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tokenless",
3
- "version": "0.7.9",
3
+ "version": "0.7.11",
4
4
  "description": "Token-Less context compression for Qwen Code — RTK command rewriting, response/TOON/schema compression, and registered but hard-disabled Tool Ready",
5
5
  "author": { "name": "ANOLISA" },
6
6
  "license": "Apache-2.0",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "anolisa-tokenless",
3
3
  "type": "module",
4
- "version": "0.7.9",
4
+ "version": "0.7.11",
5
5
  "description": "Token-Less — LLM token optimization toolkit (schema/response compression, command rewriting, tool readiness)",
6
6
  "license": "Apache-2.0",
7
7
  "repository": {
@@ -20,8 +20,7 @@
20
20
  ],
21
21
  "bin": {
22
22
  "tokenless": "bin/tokenless",
23
- "rtk": "bin/rtk",
24
- "toon": "bin/toon"
23
+ "rtk": "bin/rtk"
25
24
  },
26
25
  "files": [
27
26
  "bin/",
@@ -45,10 +44,10 @@
45
44
  "arm64"
46
45
  ],
47
46
  "optionalDependencies": {
48
- "@anolisa/tokenless-linux-x64": "0.7.9",
49
- "@anolisa/tokenless-linux-arm64": "0.7.9",
50
- "@anolisa/tokenless-darwin-x64": "0.7.9",
51
- "@anolisa/tokenless-darwin-arm64": "0.7.9"
47
+ "@anolisa/tokenless-linux-x64": "0.7.11",
48
+ "@anolisa/tokenless-linux-arm64": "0.7.11",
49
+ "@anolisa/tokenless-darwin-x64": "0.7.11",
50
+ "@anolisa/tokenless-darwin-arm64": "0.7.11"
52
51
  },
53
52
  "publishConfig": {
54
53
  "registry": "https://registry.npmjs.org/",
@@ -17,8 +17,8 @@
17
17
  * Platform packages follow the naming convention:
18
18
  * @anolisa/tokenless-{os}-{arch}
19
19
  *
20
- * Each platform package ships three native binaries:
21
- * bin/tokenless, bin/rtk, bin/toon
20
+ * Each platform package ships two native binaries:
21
+ * bin/tokenless, bin/rtk
22
22
  *
23
23
  * Exit codes: on a supported platform, a missing platform package or a
24
24
  * missing binary is a hard failure (non-zero exit) so `npm install` fails
@@ -47,7 +47,7 @@ const require = createRequire(import.meta.url);
47
47
  const packageRoot = join(__dirname, '..');
48
48
  const binDir = join(packageRoot, 'bin');
49
49
 
50
- const BINARIES = ['tokenless', 'rtk', 'toon'];
50
+ const BINARIES = ['tokenless', 'rtk'];
51
51
 
52
52
  // Map Node.js platform/arch to package names
53
53
  const PLATFORM_MAP = {
package/bin/toon DELETED
@@ -1,6 +0,0 @@
1
- #!/usr/bin/env node
2
- console.error(
3
- 'anolisa-tokenless: postinstall has not run yet. ' +
4
- 'Run "npm rebuild anolisa-tokenless" to fix.',
5
- );
6
- process.exit(1);