@tokmizer/plugin 0.9.62 → 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.
Files changed (37) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/.codex-plugin/plugin.json +1 -1
  3. package/README.md +5 -5
  4. package/dist/bin/tkr-agent-hook.js +9 -9
  5. package/dist/bin/tkr-codex-hook.js +67 -67
  6. package/dist/bin/tkr-copilot-hook.js +9 -9
  7. package/dist/bin/tkr-crush-hook.js +9 -9
  8. package/dist/bin/tkr-cursor-hook.js +8 -8
  9. package/dist/bin/tkr-daemon.js +120 -118
  10. package/dist/bin/tkr-droid-hook.js +9 -9
  11. package/dist/bin/tkr-exec +73 -71
  12. package/dist/bin/tkr-exec.js +73 -71
  13. package/dist/bin/tkr-gemini-hook.js +8 -8
  14. package/dist/bin/tkr-grok-hook.js +9 -9
  15. package/dist/bin/tkr-junie-hook.js +9 -9
  16. package/dist/bin/tkr-processor.js +91 -89
  17. package/dist/bin/tkr-qwen-hook.js +9 -9
  18. package/dist/bin/tkr-shim.js +67 -67
  19. package/dist/bin/tkr-trae-hook.js +9 -9
  20. package/dist/bin/tkr-zcode-hook.js +9 -9
  21. package/dist/bin/tkr.js +273 -273
  22. package/dist/hooks-host/post-tool-use.js +85 -83
  23. package/dist/hooks-host/pre-tool-use.js +9 -9
  24. package/dist/hooks-host/reducer-stop.js +24 -24
  25. package/dist/hooks-host/session-recap.js +1 -1
  26. package/dist/index.js +82 -82
  27. package/dist/native/manifest.json +12 -12
  28. package/dist/native/single.json +12 -12
  29. package/dist/native/tkr-exec-darwin-arm64 +0 -0
  30. package/dist/native/tkr-exec-darwin-x64 +0 -0
  31. package/dist/native/tkr-exec-linux-arm64 +0 -0
  32. package/dist/native/tkr-exec-linux-x64 +0 -0
  33. package/dist/native/tkr-exec-win32-arm64.exe +0 -0
  34. package/dist/native/tkr-exec-win32-x64.exe +0 -0
  35. package/hooks/on-session-start.mjs +16 -5
  36. package/package.json +8 -8
  37. package/scripts/install-mac-linux.sh +1 -1
@@ -1,32 +1,32 @@
1
1
  {
2
2
  "darwin-arm64": {
3
- "version": "0.9.62",
3
+ "version": "0.9.64",
4
4
  "file": "tkr-exec-darwin-arm64",
5
- "sha256": "a9cc4b9d5d6a7e2b7aeee5b7e5e61cd64dee693583f353b7a269f95cc74cac2c"
5
+ "sha256": "93ac959eb219c40eae59001f2500fbd501e925721867d4d33a4bd329067eb22f"
6
6
  },
7
7
  "darwin-x64": {
8
- "version": "0.9.62",
8
+ "version": "0.9.64",
9
9
  "file": "tkr-exec-darwin-x64",
10
- "sha256": "7aea3415c5473da38cadcd4e7d658f2695549e5f04fd2bc3fd5f70de1d9ffed0"
10
+ "sha256": "45544b391596cf2784ae287df5ffe139a6f3aad63a821d115d6da2364fbc59ca"
11
11
  },
12
12
  "linux-arm64": {
13
- "version": "0.9.62",
13
+ "version": "0.9.64",
14
14
  "file": "tkr-exec-linux-arm64",
15
- "sha256": "09c6dfe7572558ef3945e22c38986b03b4475f323b2bb26b69ad8878e47c7531"
15
+ "sha256": "3312beb9866d7bb4b251035fcb94609dc8d2d252db3af4fa5ee77cf385638c32"
16
16
  },
17
17
  "linux-x64": {
18
- "version": "0.9.62",
18
+ "version": "0.9.64",
19
19
  "file": "tkr-exec-linux-x64",
20
- "sha256": "713d6527fc5633d57f29b2d5e69d09eb246cd1f12de5f0d30d02c0a73b2a485b"
20
+ "sha256": "fab12b83474bedf1202bb9da6d70ffc16dd60a053dd8de2dd704f15596b43cf2"
21
21
  },
22
22
  "win32-arm64": {
23
- "version": "0.9.62",
23
+ "version": "0.9.64",
24
24
  "file": "tkr-exec-win32-arm64.exe",
25
- "sha256": "e9db7c900c86dbe734b070f7dd27a3ecb7c014b687b5f7e63e4fef7b8d3f06b6"
25
+ "sha256": "f260bc9d2e3700ce29ce9f219992b34246a6d228e182ccc7f3a4af6d28d2aa44"
26
26
  },
27
27
  "win32-x64": {
28
- "version": "0.9.62",
28
+ "version": "0.9.64",
29
29
  "file": "tkr-exec-win32-x64.exe",
30
- "sha256": "f55c35d3e8d92134d6491ce86dcd9a87f1007e9a6166c3ea8bde46052e7310d1"
30
+ "sha256": "6a809c6316a2f73e95c7aa543ee568c21d60a5d3f64a4aa9b8035c37aaae36f2"
31
31
  }
32
32
  }
@@ -1,38 +1,38 @@
1
1
  {
2
2
  "darwin-arm64": {
3
- "version": "0.9.62",
3
+ "version": "0.9.64",
4
4
  "package": "@tokmizer/plugin-darwin-arm64",
5
5
  "file": "tkr",
6
- "sha256": "4d6827a38cc9e057f69fc5b30d69954b3bb71ddb23b6e04b3ce7099647292416"
6
+ "sha256": "f96266ea332f620a5f3dcc6f3c85e3e65e9c9e8821b1b3f7784bae2845b5039c"
7
7
  },
8
8
  "darwin-x64": {
9
- "version": "0.9.62",
9
+ "version": "0.9.64",
10
10
  "package": "@tokmizer/plugin-darwin-x64",
11
11
  "file": "tkr",
12
- "sha256": "ec42aee7e1511aa49e3bec617db0a3fca4b53c6d562bb26b2f779234ecb35d07"
12
+ "sha256": "c917f30046707d95d3ee163be3c65ab30c059e91e93a4974d1e9dadbb388653e"
13
13
  },
14
14
  "linux-arm64": {
15
- "version": "0.9.62",
15
+ "version": "0.9.64",
16
16
  "package": "@tokmizer/plugin-linux-arm64",
17
17
  "file": "tkr",
18
- "sha256": "96131b391b7732f21015b52784df7ffa2c3c9442df5d1570d18fed831d1aa792"
18
+ "sha256": "90300edbfeea944b59e5b9922814aeadf9cec58769ab1e8242c254f163a71c19"
19
19
  },
20
20
  "linux-x64": {
21
- "version": "0.9.62",
21
+ "version": "0.9.64",
22
22
  "package": "@tokmizer/plugin-linux-x64",
23
23
  "file": "tkr",
24
- "sha256": "d123b8e959ccd7cad5a60bbaef39d19f0ae0937b64303a244bea279ea1771700"
24
+ "sha256": "e2ccde4eaae88dcee7c4073abdefb5efbccb83e9cce110358f4af74751d58d32"
25
25
  },
26
26
  "win32-arm64": {
27
- "version": "0.9.62",
27
+ "version": "0.9.64",
28
28
  "package": "@tokmizer/plugin-win32-arm64",
29
29
  "file": "tkr.exe",
30
- "sha256": "a049b5b63a8d3ba516ba1c7f39d386826f7b18982ada81bd68a0c7ad8d85cbb2"
30
+ "sha256": "130787ff1675b45706e15fa27e953c982a9c66d25848741ff3f973fd2e340e46"
31
31
  },
32
32
  "win32-x64": {
33
- "version": "0.9.62",
33
+ "version": "0.9.64",
34
34
  "package": "@tokmizer/plugin-win32-x64",
35
35
  "file": "tkr.exe",
36
- "sha256": "95ad697516d1001c5021d713cc31218fce2754bc4f1c805b7ce34702f4896451"
36
+ "sha256": "bf4097a154658842e5084b3ec167803304104815f4480af208fdb1564efcbd38"
37
37
  }
38
38
  }
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()) console.log(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
- console.log(
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
- console.log(
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
- console.log(`Tokmizer has already saved you ~${label} tokens since install. Details: /tkr-gain`);
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
- console.log(`Tokmizer ${latest} is available. Update with: /tkr-update`);
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.62",
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.62",
65
- "@tokmizer/plugin-darwin-x64": "0.9.62",
66
- "@tokmizer/plugin-linux-arm64": "0.9.62",
67
- "@tokmizer/plugin-linux-x64": "0.9.62",
68
- "@tokmizer/plugin-win32-arm64": "0.9.62",
69
- "@tokmizer/plugin-win32-x64": "0.9.62"
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"