@tokmizer/plugin 0.9.65 → 0.9.67

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/LICENSES.md +1 -1
  4. package/dist/bin/tkr-agent-hook.js +54 -10
  5. package/dist/bin/tkr-codex-hook.js +72 -70
  6. package/dist/bin/tkr-copilot-hook.js +54 -10
  7. package/dist/bin/tkr-crush-hook.js +54 -10
  8. package/dist/bin/tkr-cursor-hook.js +53 -9
  9. package/dist/bin/tkr-daemon.js +139 -121
  10. package/dist/bin/tkr-droid-hook.js +54 -10
  11. package/dist/bin/tkr-exec +79 -74
  12. package/dist/bin/tkr-exec.js +79 -74
  13. package/dist/bin/tkr-gemini-hook.js +53 -9
  14. package/dist/bin/tkr-grok-hook.js +54 -10
  15. package/dist/bin/tkr-junie-hook.js +54 -10
  16. package/dist/bin/tkr-processor.js +98 -93
  17. package/dist/bin/tkr-qwen-hook.js +54 -10
  18. package/dist/bin/tkr-shim.js +80 -75
  19. package/dist/bin/tkr-trae-hook.js +54 -10
  20. package/dist/bin/tkr-zcode-hook.js +54 -10
  21. package/dist/bin/tkr.js +270 -253
  22. package/dist/hooks-host/post-tool-use.js +92 -87
  23. package/dist/hooks-host/pre-tool-use.js +54 -10
  24. package/dist/hooks-host/reducer-stop.js +26 -23
  25. package/dist/hooks-host/session-recap.js +5 -4
  26. package/dist/index.js +98 -83
  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 +9 -1
  36. package/package.json +7 -7
  37. package/scripts/install-mac-linux.sh +47 -0
@@ -1,32 +1,32 @@
1
1
  {
2
2
  "darwin-arm64": {
3
- "version": "0.9.65",
3
+ "version": "0.9.67",
4
4
  "file": "tkr-exec-darwin-arm64",
5
- "sha256": "a3c4ec4ee900156fe262e64c4bb1769917901c92c2d909d5c4af0546c47d7dc0"
5
+ "sha256": "1b444958877111e7860d4d882d58330aec294c43cdf4c1fc101d6d32c8e571a4"
6
6
  },
7
7
  "darwin-x64": {
8
- "version": "0.9.65",
8
+ "version": "0.9.67",
9
9
  "file": "tkr-exec-darwin-x64",
10
- "sha256": "6d2cf0aa5ed73af8f55bab6e3277143043ba677ca701498ff7a8cb759d347bcd"
10
+ "sha256": "35c6e3f6b055bc23e587514868175462c4a65e39001584e9e076e152e9e60eb0"
11
11
  },
12
12
  "linux-arm64": {
13
- "version": "0.9.65",
13
+ "version": "0.9.67",
14
14
  "file": "tkr-exec-linux-arm64",
15
- "sha256": "9073379a74db2a8effb04596123587c065073732169c993356a5b5b67aafd1d3"
15
+ "sha256": "24c226733be10467b50310783133004589b2d6d1fa47eb40cd62a258c82fbe14"
16
16
  },
17
17
  "linux-x64": {
18
- "version": "0.9.65",
18
+ "version": "0.9.67",
19
19
  "file": "tkr-exec-linux-x64",
20
- "sha256": "6aa518a4bcbba9b9c6c4a31ac09fcb0ae12b1e6a3aa4de61b2df90031c060832"
20
+ "sha256": "c8787764a24f576aea2fb86b4d26b79f4911a5adcdadf2923594a0910a6b812c"
21
21
  },
22
22
  "win32-arm64": {
23
- "version": "0.9.65",
23
+ "version": "0.9.67",
24
24
  "file": "tkr-exec-win32-arm64.exe",
25
- "sha256": "678de126a05f5318903dbe1b93ae95c7013b34f628aca3d6858224dfd7beb189"
25
+ "sha256": "19f69258b8be68cbef6b500515ea93c61cbfd541a86d3b8c823643068ce0ab6b"
26
26
  },
27
27
  "win32-x64": {
28
- "version": "0.9.65",
28
+ "version": "0.9.67",
29
29
  "file": "tkr-exec-win32-x64.exe",
30
- "sha256": "745cbc65d1c33bdf635d395c89cea182ea0e97225c0b85992b55e59f55264a5b"
30
+ "sha256": "2e35cac5f1ec24b8d071d1bab7902d912c94e80b130e2d25612e188acc6ad8fb"
31
31
  }
32
32
  }
@@ -1,38 +1,38 @@
1
1
  {
2
2
  "darwin-arm64": {
3
- "version": "0.9.65",
3
+ "version": "0.9.67",
4
4
  "package": "@tokmizer/plugin-darwin-arm64",
5
5
  "file": "tkr",
6
- "sha256": "caff99d95d73a1325803fcac5b2ef9703ee1376c1acd052309b5abca98d4b1d2"
6
+ "sha256": "77f5ec715776878b8fb8430c60895b7195cca3b1805da014e2f6a5a5ea11d7c8"
7
7
  },
8
8
  "darwin-x64": {
9
- "version": "0.9.65",
9
+ "version": "0.9.67",
10
10
  "package": "@tokmizer/plugin-darwin-x64",
11
11
  "file": "tkr",
12
- "sha256": "d7d6191dfde72b69f64a780f4831f4c01b5f5b5cbcaa3709af9feced755a452b"
12
+ "sha256": "eb16d7908d62485fbda3ccf685d7d4032a74eb543d85f1fde29ea6f5d6b2378e"
13
13
  },
14
14
  "linux-arm64": {
15
- "version": "0.9.65",
15
+ "version": "0.9.67",
16
16
  "package": "@tokmizer/plugin-linux-arm64",
17
17
  "file": "tkr",
18
- "sha256": "3fc9ce5b71ccacd6e9869e205bf95631dde4fde400eeadd8c97989295fbcc8c9"
18
+ "sha256": "1c8af8dfcf33e4e22e20e2f7d2f534afb22acea5e1eb9bc5c264aa7cfafe5f83"
19
19
  },
20
20
  "linux-x64": {
21
- "version": "0.9.65",
21
+ "version": "0.9.67",
22
22
  "package": "@tokmizer/plugin-linux-x64",
23
23
  "file": "tkr",
24
- "sha256": "bb6a564243c955ecb939fe14a73ce97bd385dab33993b64c6dc4a723bc919d0a"
24
+ "sha256": "9bcf7091817d7cb0178a3de988faf5fbb8c2eff0c8ad0dec9fda1e6814741563"
25
25
  },
26
26
  "win32-arm64": {
27
- "version": "0.9.65",
27
+ "version": "0.9.67",
28
28
  "package": "@tokmizer/plugin-win32-arm64",
29
29
  "file": "tkr.exe",
30
- "sha256": "bc291580ab7be24ce999d1d75877f2f25f2c9625bab5727412e6f4b732fecfca"
30
+ "sha256": "b8c43b930f586db372ff7ad786f8a12f0a08ef6941a565d5d6a59459c15b4a02"
31
31
  },
32
32
  "win32-x64": {
33
- "version": "0.9.65",
33
+ "version": "0.9.67",
34
34
  "package": "@tokmizer/plugin-win32-x64",
35
35
  "file": "tkr.exe",
36
- "sha256": "380565db1d15ac1598ac33db8a198c83a4cf5a20679e8a84b9cc757796bc11bd"
36
+ "sha256": "8300e43a7a1400331dfeac4c975e7e57a274ca0b31c0a349234daf10bde5b386"
37
37
  }
38
38
  }
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -136,7 +136,15 @@ try {
136
136
  if (latest && manifest.version && latest !== manifest.version) {
137
137
  const nudgeFile = join(home, `update-nudge-${latest}`);
138
138
  if (!existsSync(nudgeFile)) {
139
- userMessages.push(`Tokmizer ${latest} is available. Update with: /tkr-update`);
139
+ const claudeDir = join(homedir(), ".claude");
140
+ const fromCatalog = /[\\/]plugins[\\/]cache[\\/]tokmizer[\\/]/.test(pluginRoot) && (process.env.CLAUDE_CONFIG_DIR || claudeDir) === claudeDir;
141
+ let autoOn = false;
142
+ try {
143
+ autoOn = JSON.parse(readFileSync(join(claudeDir, "settings.json"), "utf8"))?.extraKnownMarketplaces?.tokmizer?.autoUpdate === true;
144
+ } catch {}
145
+ userMessages.push(fromCatalog && !autoOn
146
+ ? `Tokmizer ${latest} is available. Run /tkr-update once: it updates now and turns on automatic updates.`
147
+ : `Tokmizer ${latest} is available. Update with: /tkr-update`);
140
148
  writeFileSync(nudgeFile, String(Date.now()));
141
149
  }
142
150
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tokmizer/plugin",
3
- "version": "0.9.65",
3
+ "version": "0.9.67",
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": {
@@ -61,12 +61,12 @@
61
61
  "zod": "^3.23.8"
62
62
  },
63
63
  "optionalDependencies": {
64
- "@tokmizer/plugin-darwin-arm64": "0.9.65",
65
- "@tokmizer/plugin-darwin-x64": "0.9.65",
66
- "@tokmizer/plugin-linux-arm64": "0.9.65",
67
- "@tokmizer/plugin-linux-x64": "0.9.65",
68
- "@tokmizer/plugin-win32-arm64": "0.9.65",
69
- "@tokmizer/plugin-win32-x64": "0.9.65"
64
+ "@tokmizer/plugin-darwin-arm64": "0.9.67",
65
+ "@tokmizer/plugin-darwin-x64": "0.9.67",
66
+ "@tokmizer/plugin-linux-arm64": "0.9.67",
67
+ "@tokmizer/plugin-linux-x64": "0.9.67",
68
+ "@tokmizer/plugin-win32-arm64": "0.9.67",
69
+ "@tokmizer/plugin-win32-x64": "0.9.67"
70
70
  },
71
71
  "publishConfig": {
72
72
  "access": "public"
@@ -11,6 +11,52 @@ node_ready() {
11
11
 
12
12
  work=""
13
13
 
14
+ RELEASE_KEY_PEM='-----BEGIN PUBLIC KEY-----
15
+ MCowBQYDK2VwAyEAQqaFzuV5RhhcjaYgECQqM1faOtWjIE5U54zyPADPSgM=
16
+ -----END PUBLIC KEY-----'
17
+ RELEASE_KEY_SSH='ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEKmhc7leUYYXI2mIBAkKjNX2jrVoyBOVOeM8jwAz0oD'
18
+
19
+ openssl_ed25519() {
20
+ local help
21
+ command -v openssl >/dev/null 2>&1 || return 1
22
+ openssl pkey -pubin -in "$1" -noout >/dev/null 2>&1 || return 1
23
+ help="$(openssl pkeyutl -help 2>&1 || true)"
24
+ case "$help" in *-rawin*) return 0 ;; esac
25
+ return 1
26
+ }
27
+
28
+ ssh_keygen_sig() {
29
+ local out
30
+ command -v ssh-keygen >/dev/null 2>&1 || return 1
31
+ out="$(ssh-keygen -Y verify </dev/null 2>&1 || true)"
32
+ case "$out" in *"unknown option"*|*"illegal option"*|*"invalid option"*) return 1 ;; esac
33
+ return 0
34
+ }
35
+
36
+ verify_sums() {
37
+ local dir="$1" base="$2"
38
+ printf '%s\n' "$RELEASE_KEY_PEM" > "$dir/release.pem"
39
+ if openssl_ed25519 "$dir/release.pem"; then
40
+ curl -fsSL "$base/SHA256SUMS.sig" -o "$dir/SHA256SUMS.sig" || err "The release is not signed (SHA256SUMS.sig is missing). Do not install this build."
41
+ openssl pkeyutl -verify -pubin -inkey "$dir/release.pem" -rawin -in "$dir/SHA256SUMS" -sigfile "$dir/SHA256SUMS.sig" >/dev/null 2>&1 ||
42
+ err "Release signature check failed. Do not install this build."
43
+ log "Release signature verified (openssl)."
44
+ return 0
45
+ fi
46
+ if ssh_keygen_sig; then
47
+ curl -fsSL "$base/SHA256SUMS.sshsig" -o "$dir/SHA256SUMS.sshsig" || err "The release is not signed (SHA256SUMS.sshsig is missing). Do not install this build."
48
+ printf 'tokmizer-release %s\n' "$RELEASE_KEY_SSH" > "$dir/allowed_signers"
49
+ ssh-keygen -Y verify -f "$dir/allowed_signers" -I tokmizer-release -n tokmizer-release -s "$dir/SHA256SUMS.sshsig" < "$dir/SHA256SUMS" >/dev/null 2>&1 ||
50
+ err "Release signature check failed. Do not install this build."
51
+ log "Release signature verified (ssh-keygen)."
52
+ return 0
53
+ fi
54
+ if [ "${TOKMIZER_REQUIRE_SIG:-}" = "1" ]; then
55
+ err "Cannot verify the release signature: install OpenSSL 3 or OpenSSH 8.1+, or unset TOKMIZER_REQUIRE_SIG."
56
+ fi
57
+ log "Warning: cannot verify the release signature (no OpenSSL 3 with Ed25519, no ssh-keygen -Y). Relying on SHA256SUMS only."
58
+ }
59
+
14
60
  sha256_of() {
15
61
  if command -v sha256sum >/dev/null 2>&1; then sha256sum "$1" | cut -d' ' -f1
16
62
  else shasum -a 256 "$1" | cut -d' ' -f1
@@ -39,6 +85,7 @@ install_standalone() {
39
85
  work="$(mktemp -d)"
40
86
  trap 'rm -rf "${work:-}"' EXIT
41
87
  curl -fsSL "$base/SHA256SUMS" -o "$work/SHA256SUMS" || err "Could not download the standalone build. $unavailable"
88
+ verify_sums "$work" "$base"
42
89
  line="$(grep -E "^[0-9a-f]{64} tokmizer-[0-9][^ /]*-$key\.tar\.gz$" "$work/SHA256SUMS" | head -n 1)" || true
43
90
  [ -n "$line" ] || err "No standalone build for $key. $unavailable"
44
91
  sum="${line%% *}"