@tokmizer/plugin 0.9.61 → 0.9.63
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/.claude-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/LICENSE +176 -0
- package/LICENSE-ENGINE +107 -0
- package/LICENSES.md +29 -0
- package/NOTICE +18 -0
- package/README.md +22 -6
- package/THIRD-PARTY-NOTICES.md +446 -0
- package/dist/bin/tkr-agent-hook.js +9 -9
- package/dist/bin/tkr-codex-hook.js +67 -67
- package/dist/bin/tkr-copilot-hook.js +9 -9
- package/dist/bin/tkr-crush-hook.js +9 -9
- package/dist/bin/tkr-cursor-hook.js +8 -8
- package/dist/bin/tkr-daemon.js +113 -113
- package/dist/bin/tkr-droid-hook.js +9 -9
- package/dist/bin/tkr-exec +2 -2
- package/dist/bin/tkr-exec.js +2 -2
- package/dist/bin/tkr-gemini-hook.js +8 -8
- package/dist/bin/tkr-grok-hook.js +9 -9
- package/dist/bin/tkr-junie-hook.js +9 -9
- package/dist/bin/tkr-processor.js +81 -81
- package/dist/bin/tkr-qwen-hook.js +9 -9
- package/dist/bin/tkr-shim.js +2 -2
- package/dist/bin/tkr-trae-hook.js +9 -9
- package/dist/bin/tkr-zcode-hook.js +9 -9
- package/dist/bin/tkr.js +233 -233
- package/dist/hooks-host/post-tool-use.js +2 -2
- package/dist/hooks-host/pre-tool-use.js +9 -9
- package/dist/hooks-host/reducer-stop.js +1 -1
- package/dist/hooks-host/session-recap.js +1 -1
- package/dist/index.js +2 -2
- package/dist/native/manifest.json +12 -12
- package/dist/native/single.json +12 -12
- package/dist/native/tkr-exec-darwin-arm64 +0 -0
- package/dist/native/tkr-exec-darwin-x64 +0 -0
- package/dist/native/tkr-exec-linux-arm64 +0 -0
- package/dist/native/tkr-exec-linux-x64 +0 -0
- package/dist/native/tkr-exec-win32-arm64.exe +0 -0
- package/dist/native/tkr-exec-win32-x64.exe +0 -0
- package/package.json +13 -9
package/LICENSE
ADDED
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
package/LICENSE-ENGINE
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
Business Source License 1.1
|
|
2
|
+
|
|
3
|
+
License text copyright (c) 2020 MariaDB Corporation Ab, All Rights Reserved.
|
|
4
|
+
"Business Source License" is a trademark of MariaDB Corporation Ab.
|
|
5
|
+
|
|
6
|
+
-----------------------------------------------------------------------------
|
|
7
|
+
|
|
8
|
+
Parameters
|
|
9
|
+
|
|
10
|
+
Licensor: Impulse Creation
|
|
11
|
+
|
|
12
|
+
Licensed Work: Tokmizer compression engine and rule catalogue, version
|
|
13
|
+
as published: the contents of the src/engine/ and
|
|
14
|
+
filters/ directories of the @tokmizer/plugin package
|
|
15
|
+
and its source repository, including the default
|
|
16
|
+
rules built from filters/ and embedded in the
|
|
17
|
+
compiled package.
|
|
18
|
+
The Licensed Work is (c) 2026 Impulse Creation.
|
|
19
|
+
|
|
20
|
+
Additional Use Grant: You may make production use of the Licensed Work,
|
|
21
|
+
without charge, including as a component of the
|
|
22
|
+
Tokmizer command-line tools, hooks and plugins, and
|
|
23
|
+
inside your own internal tools and workflows. This
|
|
24
|
+
grant does not permit offering the Licensed Work, or a
|
|
25
|
+
derivative of it (including the engine or the rules,
|
|
26
|
+
alone or together), to third parties as part of a
|
|
27
|
+
product or service, paid or hosted, whose purpose is
|
|
28
|
+
to reduce, compress or optimize the tokens or the
|
|
29
|
+
context sent to AI models and that competes with
|
|
30
|
+
Tokmizer. For such use, contact contact@tokmizer.com.
|
|
31
|
+
|
|
32
|
+
Change Date: Four years after the date on which this version of
|
|
33
|
+
the Licensed Work is first publicly distributed by the
|
|
34
|
+
Licensor (for a version first distributed on
|
|
35
|
+
2026-10-15, the Change Date is 2030-10-15)
|
|
36
|
+
|
|
37
|
+
Change License: Apache License, Version 2.0
|
|
38
|
+
|
|
39
|
+
For information about alternative licensing arrangements for the Licensed
|
|
40
|
+
Work, please contact contact@tokmizer.com.
|
|
41
|
+
|
|
42
|
+
-----------------------------------------------------------------------------
|
|
43
|
+
|
|
44
|
+
Terms
|
|
45
|
+
|
|
46
|
+
The Licensor hereby grants you the right to copy, modify, create derivative
|
|
47
|
+
works, redistribute, and make non-production use of the Licensed Work. The
|
|
48
|
+
Licensor may make an Additional Use Grant, above, permitting limited
|
|
49
|
+
production use.
|
|
50
|
+
|
|
51
|
+
Effective on the Change Date, or the fourth anniversary of the first publicly
|
|
52
|
+
available distribution of a specific version of the Licensed Work under this
|
|
53
|
+
License, whichever comes first, the Licensor hereby grants you rights under
|
|
54
|
+
the terms of the Change License, and the rights granted in the paragraph
|
|
55
|
+
above terminate.
|
|
56
|
+
|
|
57
|
+
If your use of the Licensed Work does not comply with the requirements
|
|
58
|
+
currently in effect as described in this License, you must purchase a
|
|
59
|
+
commercial license from the Licensor, its affiliated entities, or authorized
|
|
60
|
+
resellers, or you must refrain from using the Licensed Work.
|
|
61
|
+
|
|
62
|
+
All copies of the original and modified Licensed Work, and derivative works
|
|
63
|
+
of the Licensed Work, are subject to this License. This License applies
|
|
64
|
+
separately for each version of the Licensed Work and the Change Date may vary
|
|
65
|
+
for each version of the Licensed Work released by Licensor.
|
|
66
|
+
|
|
67
|
+
You must conspicuously display this License on each original or modified copy
|
|
68
|
+
of the Licensed Work. If you receive the Licensed Work in original or
|
|
69
|
+
modified form from a third party, the terms and conditions set forth in this
|
|
70
|
+
License apply to your use of that work.
|
|
71
|
+
|
|
72
|
+
Any use of the Licensed Work in violation of this License will automatically
|
|
73
|
+
terminate your rights under this License for the current and all other
|
|
74
|
+
versions of the Licensed Work.
|
|
75
|
+
|
|
76
|
+
This License does not grant you any right in any trademark or logo of
|
|
77
|
+
Licensor or its affiliates (provided that you may use a trademark or logo of
|
|
78
|
+
Licensor as expressly required by this License).
|
|
79
|
+
|
|
80
|
+
TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
|
|
81
|
+
AN "AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
|
|
82
|
+
EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
|
|
83
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
|
|
84
|
+
TITLE.
|
|
85
|
+
|
|
86
|
+
-----------------------------------------------------------------------------
|
|
87
|
+
|
|
88
|
+
Covenants of Licensor
|
|
89
|
+
|
|
90
|
+
In consideration of the right to use this License's text and the "Business
|
|
91
|
+
Source License" name and trademark, Licensor covenants to MariaDB, and to all
|
|
92
|
+
other recipients of the licensed work to be provided by Licensor:
|
|
93
|
+
|
|
94
|
+
1. To specify as the Change License the GPL Version 2.0 or any later version,
|
|
95
|
+
or a license that is compatible with GPL Version 2.0 or a later version,
|
|
96
|
+
where "compatible" means that software provided under the Change License can
|
|
97
|
+
be included in a program with software provided under GPL Version 2.0 or a
|
|
98
|
+
later version. Licensor may specify additional Change Licenses without
|
|
99
|
+
limitation.
|
|
100
|
+
|
|
101
|
+
2. To either: (a) specify an additional grant of rights to use that does not
|
|
102
|
+
impose any additional restriction on the right granted in this License, as
|
|
103
|
+
the Additional Use Grant; or (b) insert the text "None".
|
|
104
|
+
|
|
105
|
+
3. To specify a Change Date.
|
|
106
|
+
|
|
107
|
+
4. Not to modify this License in any other way.
|
package/LICENSES.md
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Licences
|
|
2
|
+
|
|
3
|
+
Tokmizer uses two licences, split by directory. No source file carries a licence header: the directory decides.
|
|
4
|
+
|
|
5
|
+
Copyright 2026 Impulse Creation, the copyright holder and the Licensor named in the BUSL-1.1 files.
|
|
6
|
+
|
|
7
|
+
| Path | Licence | Text |
|
|
8
|
+
|---|---|---|
|
|
9
|
+
| `src/engine/**` (compression engine: pipeline, routing, matcher, filter schema and loader, transforms, structured compaction, test-failure folding) | BUSL-1.1, converts to Apache-2.0 on the Change Date | [`src/engine/LICENSE`](src/engine/LICENSE) |
|
|
10
|
+
| `filters/**` (TOML rule catalogue), including the default rules built from it and embedded in `dist/` | BUSL-1.1, same Licensed Work as the engine | [`filters/LICENSE`](filters/LICENSE) |
|
|
11
|
+
| Everything else: CLI (`src/bin`, `src/*.ts`), hooks (`hooks/`, `src/hooks-host`), agent adapters (`src/adapters`, `agent-plugins/`), daemon, launcher and shims (`src/daemon`, `src/exec`, `src/shim`), native launcher (`native/`), setup commands (`command-templates/`, `codex-plugin/`, `.claude-plugin/`, install scripts), tests and fixtures (`src/__tests__`), build scripts (`scripts/`) and documentation | Apache-2.0 | [`LICENSE`](LICENSE) |
|
|
12
|
+
| `dist/` and the npm package `@tokmizer/plugin` | `Apache-2.0 AND BUSL-1.1`: the bundled files contain code and rules under both licences | both texts above |
|
|
13
|
+
| Third-party code bundled into `dist/` and into the native launcher | its own licence | [`THIRD-PARTY-NOTICES.md`](THIRD-PARTY-NOTICES.md) |
|
|
14
|
+
|
|
15
|
+
The BUSL-1.1 text is the same file in `src/engine/LICENSE`, `filters/LICENSE` and, at the root, [`LICENSE-ENGINE`](LICENSE-ENGINE).
|
|
16
|
+
|
|
17
|
+
## What BUSL-1.1 allows here
|
|
18
|
+
|
|
19
|
+
You can read, copy, modify and redistribute the engine and the rules, and use them in production, including inside the Tokmizer CLI, hooks and plugins and in your own internal tools. You cannot offer the engine or the rules, alone or together, or a derivative of them, to third parties as part of a product or service that reduces, compresses or optimizes AI-model tokens or context and competes with Tokmizer. The exact terms are in [`LICENSE-ENGINE`](LICENSE-ENGINE).
|
|
20
|
+
|
|
21
|
+
Each published version becomes Apache-2.0 on its Change Date: four years after that version's first public release, or earlier if the licence file of that version says so.
|
|
22
|
+
|
|
23
|
+
## Your own rules
|
|
24
|
+
|
|
25
|
+
Rules you write yourself, in your project or user configuration, are yours. Writing or reading rules in the same TOML format with your own tools needs no licence from us; only the engine source and the rule catalogue published here are BUSL-1.1.
|
|
26
|
+
|
|
27
|
+
## Contributions
|
|
28
|
+
|
|
29
|
+
Contributions are accepted under the Tokmizer Contributor License Agreement, which grants Impulse Creation the right to distribute them under the licence of the directory they change and under other licences, including commercial ones. The agreement is `CLA.md` at the root of the public repository; the process is described in its `CONTRIBUTING.md`.
|
package/NOTICE
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
Tokmizer
|
|
2
|
+
Copyright 2026 Impulse Creation
|
|
3
|
+
|
|
4
|
+
This product is licensed under the Apache License, Version 2.0 (see LICENSE),
|
|
5
|
+
except the compression engine in src/engine/ and the rule catalogue in
|
|
6
|
+
filters/, which are licensed under the Business Source License 1.1 (see
|
|
7
|
+
LICENSE-ENGINE, src/engine/LICENSE and filters/LICENSE).
|
|
8
|
+
LICENSES.md maps each directory to its licence.
|
|
9
|
+
|
|
10
|
+
The TOML filter rule format and parts of the rule catalogue in filters/
|
|
11
|
+
(rule names, some descriptions and some line patterns) are derived from rtk
|
|
12
|
+
(https://github.com/rtk-ai/rtk), Copyright Patrick Szymkowiak and the rtk
|
|
13
|
+
contributors, licensed under the Apache License, Version 2.0. Those derived
|
|
14
|
+
portions remain available under the Apache License, Version 2.0; the
|
|
15
|
+
Business Source License 1.1 applies to the changes and additions made here.
|
|
16
|
+
|
|
17
|
+
The npm package and the native launcher bundle third-party software. Their
|
|
18
|
+
copyright notices and licence texts are reproduced in THIRD-PARTY-NOTICES.md.
|
package/README.md
CHANGED
|
@@ -100,7 +100,7 @@ Each command adds one `PreToolUse` hook for the agent's shell tool. It rewrites
|
|
|
100
100
|
|
|
101
101
|
Permission rules stay in force. Agents match their allow, ask and deny rules against the command text, so Tokmizer leaves a command untouched whenever one of your deny or ask rules matches it. Tokmizer reads those rules for Claude Code (`permissions.deny` and `permissions.ask` in user, project, local and managed settings; a command matched by one of your `permissions.allow` rules is left untouched too, so that rule keeps approving it), OpenCode (`permission` in `opencode.json`), Cursor CLI (`permissions.deny`), Gemini CLI (policy files and `tools.exclude`) and Antigravity CLI (`permissions.deny` and `permissions.ask`). For the other agents, and on top of the Cursor, Gemini and Antigravity rules, only inspection, build and test commands (`cat`, `rg`, `git log`, `npm test`, `cargo build` and similar; inspection only for Codex) are routed; anything else, such as `git push` or `rm`, runs exactly as typed. If a settings file cannot be read, nothing is routed. Shell functions, aliases, builtins and anything that is not a program on your `PATH` always run exactly as typed.
|
|
102
102
|
|
|
103
|
-
In Claude Code, a command is rewritten only when that adds no permission prompt: in `bypassPermissions` mode, or when a plain `Bash` allow rule in your user or managed settings applies and the session is in default, `acceptEdits` or `dontAsk` mode. Otherwise it runs exactly as typed, so Claude Code still approves read-only commands such as `ls`, `cat` or `git status` on its own, and Tokmizer shortens the output once the command has succeeded. Claude Code runs that after-command hook only for successful commands, so in this default mode a failing command reaches Claude in full. When commands are rewritten, failing output is shortened too, with its failure details kept.
|
|
103
|
+
In Claude Code, a command is rewritten only when that adds no permission prompt: in `bypassPermissions` mode, or when a plain `Bash` allow rule in your user or managed settings applies and the session is in default, `acceptEdits` or `dontAsk` mode. Otherwise it runs exactly as typed, so Claude Code still approves read-only commands such as `ls`, `cat` or `git status` on its own, and Tokmizer shortens the output once the command has succeeded. Claude Code runs that after-command hook only for successful commands, so in this default mode a failing command reaches Claude in full. A single command typed on its own (no `&&`, `;`, pipe, redirection, `$( )` or wildcard) is also rewritten when one of your own allow rules for it, such as `Bash(pytest:*)` or `Bash(cargo build:*)` in your user or managed settings, applies and no deny or ask rule matches: Tokmizer then gives the approval Claude Code would have given to the command as typed, so no new prompt appears. When commands are rewritten, failing output is shortened too, with its failure details kept.
|
|
104
104
|
|
|
105
105
|
Aider, Cline and Windsurf have no hooks. Start them through Tokmizer, for example `tkr wrap aider`: only that session goes through Tokmizer's command shims. Your own terminals are not changed; `tkr shim global-path on` routes every terminal through the shims by adding a PATH line to your shell profile, and `tkr shim global-path off` removes it.
|
|
106
106
|
|
|
@@ -320,10 +320,26 @@ Every changed file is backed up under `~/.tokmizer/migrate-rtk/`. Running `--yes
|
|
|
320
320
|
|
|
321
321
|
This README is shared by the npm package and the public GitHub repository.
|
|
322
322
|
|
|
323
|
-
- The npm package includes the CLI, Claude Code hooks and command templates, and the
|
|
324
|
-
- The public repository contains
|
|
323
|
+
- The npm package includes the CLI, Claude Code hooks and command templates, the Codex manifest and the compiled compression engine.
|
|
324
|
+
- The public repository contains the full source of the package: CLI, hooks, agent adapters, native launcher, setup commands, the TOML rule catalogue and the compression engine.
|
|
325
325
|
|
|
326
|
-
|
|
326
|
+
## Build from source
|
|
327
|
+
|
|
328
|
+
Requirements: Node.js 20.11 or later and npm. The native launcher is optional and needs a Rust toolchain.
|
|
329
|
+
|
|
330
|
+
```
|
|
331
|
+
git clone https://github.com/norwelltw/Tokmizer
|
|
332
|
+
cd Tokmizer
|
|
333
|
+
npm install
|
|
334
|
+
npm run build
|
|
335
|
+
npm test
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
`npm run build` type-checks the sources and bundles them into `packages/plugin/dist/`. Run the result with `node packages/plugin/dist/bin/tkr.js help`.
|
|
339
|
+
|
|
340
|
+
To build the native launcher for your platform: `npm --workspace packages/plugin run build:native`, then `npm run build` again to copy it into `dist/native/`.
|
|
341
|
+
|
|
342
|
+
To try your build in Claude Code, install the folder as a local plugin or link the CLI with `npm --workspace packages/plugin link`.
|
|
327
343
|
|
|
328
344
|
## Network & privacy
|
|
329
345
|
|
|
@@ -374,7 +390,7 @@ The switch does not cover Claude Code's own marketplace auto-update, which `/tkr
|
|
|
374
390
|
### Local data
|
|
375
391
|
|
|
376
392
|
- Restoration copies are local and kept up to 30 days. A restore hint identifies available cached content; there is no guarantee that every removed detail has a saved copy. YOLO creates no new restoration copies.
|
|
377
|
-
- The
|
|
393
|
+
- The [redaction helpers](https://github.com/norwelltw/Tokmizer/blob/main/packages/plugin/src/learn/redact.ts) are available for inspection, like the rest of the source.
|
|
378
394
|
- Local state lives in `~/.tokmizer/`.
|
|
379
395
|
|
|
380
396
|
## Uninstall
|
|
@@ -394,4 +410,4 @@ In Claude Code: `/plugin uninstall tokmizer@tokmizer`. Your savings history stay
|
|
|
394
410
|
|
|
395
411
|
## License
|
|
396
412
|
|
|
397
|
-
|
|
413
|
+
Apache-2.0, except the compression engine in `src/engine/` and the rule catalogue in `filters/`, which are under the Business Source License 1.1 and become Apache-2.0 four years after each release. Production use is allowed, including inside your own tools; offering the engine or the rules as part of a competing token-optimization product or hosted service is not. Rules you write yourself stay yours. See [LICENSES.md](LICENSES.md), [LICENSE](LICENSE), [LICENSE-ENGINE](LICENSE-ENGINE) and [NOTICE](NOTICE).
|