@tokmizer/plugin 0.9.63 → 0.9.64
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/README.md +4 -4
- package/dist/bin/tkr-codex-hook.js +27 -27
- package/dist/bin/tkr-daemon.js +118 -116
- package/dist/bin/tkr-exec +73 -71
- package/dist/bin/tkr-exec.js +73 -71
- package/dist/bin/tkr-processor.js +92 -90
- package/dist/bin/tkr-shim.js +67 -67
- package/dist/bin/tkr.js +213 -213
- package/dist/hooks-host/post-tool-use.js +85 -83
- package/dist/hooks-host/reducer-stop.js +24 -24
- package/dist/hooks-host/session-recap.js +1 -1
- package/dist/index.js +82 -82
- 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/hooks/on-session-start.mjs +16 -5
- package/package.json +8 -8
- package/scripts/install-mac-linux.sh +1 -1
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"darwin-arm64": {
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.64",
|
|
4
4
|
"file": "tkr-exec-darwin-arm64",
|
|
5
|
-
"sha256": "
|
|
5
|
+
"sha256": "93ac959eb219c40eae59001f2500fbd501e925721867d4d33a4bd329067eb22f"
|
|
6
6
|
},
|
|
7
7
|
"darwin-x64": {
|
|
8
|
-
"version": "0.9.
|
|
8
|
+
"version": "0.9.64",
|
|
9
9
|
"file": "tkr-exec-darwin-x64",
|
|
10
|
-
"sha256": "
|
|
10
|
+
"sha256": "45544b391596cf2784ae287df5ffe139a6f3aad63a821d115d6da2364fbc59ca"
|
|
11
11
|
},
|
|
12
12
|
"linux-arm64": {
|
|
13
|
-
"version": "0.9.
|
|
13
|
+
"version": "0.9.64",
|
|
14
14
|
"file": "tkr-exec-linux-arm64",
|
|
15
|
-
"sha256": "
|
|
15
|
+
"sha256": "3312beb9866d7bb4b251035fcb94609dc8d2d252db3af4fa5ee77cf385638c32"
|
|
16
16
|
},
|
|
17
17
|
"linux-x64": {
|
|
18
|
-
"version": "0.9.
|
|
18
|
+
"version": "0.9.64",
|
|
19
19
|
"file": "tkr-exec-linux-x64",
|
|
20
|
-
"sha256": "
|
|
20
|
+
"sha256": "fab12b83474bedf1202bb9da6d70ffc16dd60a053dd8de2dd704f15596b43cf2"
|
|
21
21
|
},
|
|
22
22
|
"win32-arm64": {
|
|
23
|
-
"version": "0.9.
|
|
23
|
+
"version": "0.9.64",
|
|
24
24
|
"file": "tkr-exec-win32-arm64.exe",
|
|
25
|
-
"sha256": "
|
|
25
|
+
"sha256": "f260bc9d2e3700ce29ce9f219992b34246a6d228e182ccc7f3a4af6d28d2aa44"
|
|
26
26
|
},
|
|
27
27
|
"win32-x64": {
|
|
28
|
-
"version": "0.9.
|
|
28
|
+
"version": "0.9.64",
|
|
29
29
|
"file": "tkr-exec-win32-x64.exe",
|
|
30
|
-
"sha256": "
|
|
30
|
+
"sha256": "6a809c6316a2f73e95c7aa543ee568c21d60a5d3f64a4aa9b8035c37aaae36f2"
|
|
31
31
|
}
|
|
32
32
|
}
|
package/dist/native/single.json
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
1
|
{
|
|
2
2
|
"darwin-arm64": {
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.64",
|
|
4
4
|
"package": "@tokmizer/plugin-darwin-arm64",
|
|
5
5
|
"file": "tkr",
|
|
6
|
-
"sha256": "
|
|
6
|
+
"sha256": "f96266ea332f620a5f3dcc6f3c85e3e65e9c9e8821b1b3f7784bae2845b5039c"
|
|
7
7
|
},
|
|
8
8
|
"darwin-x64": {
|
|
9
|
-
"version": "0.9.
|
|
9
|
+
"version": "0.9.64",
|
|
10
10
|
"package": "@tokmizer/plugin-darwin-x64",
|
|
11
11
|
"file": "tkr",
|
|
12
|
-
"sha256": "
|
|
12
|
+
"sha256": "c917f30046707d95d3ee163be3c65ab30c059e91e93a4974d1e9dadbb388653e"
|
|
13
13
|
},
|
|
14
14
|
"linux-arm64": {
|
|
15
|
-
"version": "0.9.
|
|
15
|
+
"version": "0.9.64",
|
|
16
16
|
"package": "@tokmizer/plugin-linux-arm64",
|
|
17
17
|
"file": "tkr",
|
|
18
|
-
"sha256": "
|
|
18
|
+
"sha256": "90300edbfeea944b59e5b9922814aeadf9cec58769ab1e8242c254f163a71c19"
|
|
19
19
|
},
|
|
20
20
|
"linux-x64": {
|
|
21
|
-
"version": "0.9.
|
|
21
|
+
"version": "0.9.64",
|
|
22
22
|
"package": "@tokmizer/plugin-linux-x64",
|
|
23
23
|
"file": "tkr",
|
|
24
|
-
"sha256": "
|
|
24
|
+
"sha256": "e2ccde4eaae88dcee7c4073abdefb5efbccb83e9cce110358f4af74751d58d32"
|
|
25
25
|
},
|
|
26
26
|
"win32-arm64": {
|
|
27
|
-
"version": "0.9.
|
|
27
|
+
"version": "0.9.64",
|
|
28
28
|
"package": "@tokmizer/plugin-win32-arm64",
|
|
29
29
|
"file": "tkr.exe",
|
|
30
|
-
"sha256": "
|
|
30
|
+
"sha256": "130787ff1675b45706e15fa27e953c982a9c66d25848741ff3f973fd2e340e46"
|
|
31
31
|
},
|
|
32
32
|
"win32-x64": {
|
|
33
|
-
"version": "0.9.
|
|
33
|
+
"version": "0.9.64",
|
|
34
34
|
"package": "@tokmizer/plugin-win32-x64",
|
|
35
35
|
"file": "tkr.exe",
|
|
36
|
-
"sha256": "
|
|
36
|
+
"sha256": "bf4097a154658842e5084b3ec167803304104815f4480af208fdb1564efcbd38"
|
|
37
37
|
}
|
|
38
38
|
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -16,6 +16,8 @@ const pluginRoot = process.env.CLAUDE_PLUGIN_ROOT || (single ? join(dirname(proc
|
|
|
16
16
|
const networkOff =
|
|
17
17
|
["0", "off", "false", "no"].includes(String(process.env.TOKMIZER_NETWORK ?? "").trim().toLowerCase()) ||
|
|
18
18
|
existsSync(join(home, "network-off"));
|
|
19
|
+
const userMessages = [];
|
|
20
|
+
let context = "";
|
|
19
21
|
|
|
20
22
|
try {
|
|
21
23
|
const srcDir = join(pluginRoot, "command-templates");
|
|
@@ -42,7 +44,7 @@ try {
|
|
|
42
44
|
try {
|
|
43
45
|
const args = single ? ["shims-heal"] : [join(dirname(fileURLToPath(import.meta.url)), "..", "dist", "bin", "tkr.js"), "shims-heal"];
|
|
44
46
|
const healed = spawnSync(process.execPath, args, { stdio: ["ignore", "pipe", "ignore"], encoding: "utf8", timeout: 3000, windowsHide: true });
|
|
45
|
-
if (healed.status === 0 && healed.stdout && healed.stdout.trim())
|
|
47
|
+
if (healed.status === 0 && healed.stdout && healed.stdout.trim()) context = healed.stdout.trim();
|
|
46
48
|
} catch {}
|
|
47
49
|
|
|
48
50
|
try {
|
|
@@ -73,7 +75,7 @@ try {
|
|
|
73
75
|
try {
|
|
74
76
|
const onboardFile = join(home, "onboarded");
|
|
75
77
|
if (!existsSync(onboardFile)) {
|
|
76
|
-
|
|
78
|
+
userMessages.push(
|
|
77
79
|
"Tokmizer is on with the recommended settings. Free tier, no account needed.\n" +
|
|
78
80
|
"See it live anytime: /tkr-status. Your savings: /tkr-gain.\n" +
|
|
79
81
|
"Tune it with /tkr. Paid plan? Link it with /tkr-link."
|
|
@@ -86,7 +88,7 @@ try {
|
|
|
86
88
|
try {
|
|
87
89
|
const noticeFile = join(home, "network-notice-shown");
|
|
88
90
|
if (!networkOff && !existsSync(noticeFile)) {
|
|
89
|
-
|
|
91
|
+
userMessages.push(
|
|
90
92
|
[
|
|
91
93
|
"Tokmizer contacts tokmizer.com to keep its rules up to date and to improve the product. No account or email is needed.",
|
|
92
94
|
"It sends a random install ID, your computer name, OS and CPU model, a hash of your network card address and of your user name, and the plugin version. Command contents and output are never sent.",
|
|
@@ -120,7 +122,7 @@ try {
|
|
|
120
122
|
const saved = Math.max(0, Math.ceil(rawB / 4) - Math.ceil(filtB / 4));
|
|
121
123
|
if (saved >= 1000) {
|
|
122
124
|
const label = saved >= 1e6 ? (saved / 1e6).toFixed(1) + "M" : saved >= 1e3 ? (saved / 1e3).toFixed(1) + "K" : String(saved);
|
|
123
|
-
|
|
125
|
+
userMessages.push(`Tokmizer has already saved you ~${label} tokens since install. Details: /tkr-gain`);
|
|
124
126
|
writeFileSync(nudgeFile, String(Date.now()));
|
|
125
127
|
}
|
|
126
128
|
}
|
|
@@ -134,7 +136,7 @@ try {
|
|
|
134
136
|
if (latest && manifest.version && latest !== manifest.version) {
|
|
135
137
|
const nudgeFile = join(home, `update-nudge-${latest}`);
|
|
136
138
|
if (!existsSync(nudgeFile)) {
|
|
137
|
-
|
|
139
|
+
userMessages.push(`Tokmizer ${latest} is available. Update with: /tkr-update`);
|
|
138
140
|
writeFileSync(nudgeFile, String(Date.now()));
|
|
139
141
|
}
|
|
140
142
|
}
|
|
@@ -163,5 +165,14 @@ try {
|
|
|
163
165
|
}
|
|
164
166
|
} catch {}
|
|
165
167
|
|
|
168
|
+
if (userMessages.length) {
|
|
169
|
+
console.log(JSON.stringify({
|
|
170
|
+
systemMessage: userMessages.join("\n\n"),
|
|
171
|
+
...(context ? { hookSpecificOutput: { hookEventName: "SessionStart", additionalContext: context } } : {})
|
|
172
|
+
}));
|
|
173
|
+
} else if (context) {
|
|
174
|
+
console.log(context);
|
|
175
|
+
}
|
|
176
|
+
|
|
166
177
|
await drained;
|
|
167
178
|
process.stdin.destroy();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tokmizer/plugin",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.64",
|
|
4
4
|
"description": "Tokmizer reduces token consumption for AI coding tools (Claude Code, Codex, Cursor, Aider, Gemini CLI, Cline, Windsurf, Copilot). Cross-OS.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"build": "tsc -p tsconfig.json --noEmit && node scripts/bundle.mjs",
|
|
49
49
|
"build:native": "node scripts/build-native.mjs",
|
|
50
50
|
"postinstall": "node scripts/install-native.mjs",
|
|
51
|
-
"prepublishOnly": "npm run build && node scripts/check-native-artifacts.mjs && ( cd ../.. && npx vitest run packages/plugin ) && node scripts/check-upgrade-safety.mjs && node scripts/check-prod-key.mjs && node scripts/check-version.mjs && node scripts/check-dist-clean.mjs && node scripts/check-pack-clean.mjs && node scripts/smoke-dist.mjs",
|
|
51
|
+
"prepublishOnly": "npm run build && node scripts/check-native-artifacts.mjs && ( cd ../.. && npx vitest run packages/plugin ) && npx tsx scripts/benchmark-quality.ts --check && node scripts/check-upgrade-safety.mjs && node scripts/check-prod-key.mjs && node scripts/check-version.mjs && node scripts/check-dist-clean.mjs && node scripts/check-pack-clean.mjs && node scripts/smoke-dist.mjs",
|
|
52
52
|
"build:single": "node scripts/build-single.mjs",
|
|
53
53
|
"pack:single": "node scripts/pack-single.mjs"
|
|
54
54
|
},
|
|
@@ -61,12 +61,12 @@
|
|
|
61
61
|
"zod": "^3.23.8"
|
|
62
62
|
},
|
|
63
63
|
"optionalDependencies": {
|
|
64
|
-
"@tokmizer/plugin-darwin-arm64": "0.9.
|
|
65
|
-
"@tokmizer/plugin-darwin-x64": "0.9.
|
|
66
|
-
"@tokmizer/plugin-linux-arm64": "0.9.
|
|
67
|
-
"@tokmizer/plugin-linux-x64": "0.9.
|
|
68
|
-
"@tokmizer/plugin-win32-arm64": "0.9.
|
|
69
|
-
"@tokmizer/plugin-win32-x64": "0.9.
|
|
64
|
+
"@tokmizer/plugin-darwin-arm64": "0.9.64",
|
|
65
|
+
"@tokmizer/plugin-darwin-x64": "0.9.64",
|
|
66
|
+
"@tokmizer/plugin-linux-arm64": "0.9.64",
|
|
67
|
+
"@tokmizer/plugin-linux-x64": "0.9.64",
|
|
68
|
+
"@tokmizer/plugin-win32-arm64": "0.9.64",
|
|
69
|
+
"@tokmizer/plugin-win32-x64": "0.9.64"
|
|
70
70
|
},
|
|
71
71
|
"publishConfig": {
|
|
72
72
|
"access": "public"
|
|
@@ -82,7 +82,7 @@ tkr shim install </dev/null
|
|
|
82
82
|
if [ "$standalone" = "1" ] && [ "$claude_before" = "1" ]; then
|
|
83
83
|
tkr setup-claude </dev/null || log "Could not add the Claude Code hooks. Run: tkr setup-claude"
|
|
84
84
|
fi
|
|
85
|
+
tkr setup --all </dev/null || log "Some agents could not be set up. Run: tkr setup --all"
|
|
85
86
|
log "Done. Tokmizer is free and does not require an account. Your shell profile was not changed."
|
|
86
|
-
log "For Codex, also run: tkr setup-codex"
|
|
87
87
|
log "For Aider, Cline or Windsurf, start them with: tkr wrap <agent>"
|
|
88
88
|
log "Check the installation with: tkr status"
|