ai-lens 0.8.104 → 0.8.105
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/.commithash +1 -1
- package/CHANGELOG.md +3 -0
- package/client/ai-lens-hook.ps1 +14 -3
- package/package.json +1 -1
package/.commithash
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
0a107d0
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
History of changes to the `ai-lens` CLI package on npm. New entries go on top. Format: `## X.Y.Z — YYYY-MM-DD`, followed by user-facing bullets.
|
|
4
4
|
|
|
5
|
+
## 0.8.105 — 2026-06-18
|
|
6
|
+
- fix: Cyrillic (and other non-ASCII) in Claude Code hook payloads is no longer mangled on Windows. The windowless hook launcher read stdin through PowerShell's console codepage (OEM, e.g. CP866 on Russian Windows), corrupting prompts/paths on the way in; it now reads the raw stdin bytes and decodes UTF-8 directly. The earlier 0.8.102 fix only covered the write side, so machines that adopted the windowless launcher saw the corruption reappear.
|
|
7
|
+
|
|
5
8
|
## 0.8.104 — 2026-06-18
|
|
6
9
|
- fix: subagent token usage is now captured for Claude Code. Tokens spent by Task / general-purpose subagents were silently dropped, so subagent-heavy sessions were badly undercounted — only the main thread's tokens showed up. Capture now reads each subagent's own transcript on `SubagentStop` instead of re-reading the parent session's.
|
|
7
10
|
|
package/client/ai-lens-hook.ps1
CHANGED
|
@@ -13,8 +13,16 @@
|
|
|
13
13
|
#
|
|
14
14
|
# Payload source differs by caller, so read BOTH:
|
|
15
15
|
# - Cursor pipes it through the PowerShell pipeline → $input.
|
|
16
|
-
# - Claude Code pipes it to the process's OS stdin →
|
|
17
|
-
# Read $input first; if empty (Claude Code invocation),
|
|
16
|
+
# - Claude Code pipes it to the process's OS stdin → read it as raw bytes.
|
|
17
|
+
# Read $input first; if empty (Claude Code invocation), read the OS stdin stream.
|
|
18
|
+
#
|
|
19
|
+
# Why raw bytes (not [Console]::In.ReadToEnd()): [Console]::In decodes stdin via
|
|
20
|
+
# [Console]::InputEncoding, which on Windows PowerShell 5.1 defaults to the OEM
|
|
21
|
+
# codepage (e.g. CP866 on Russian Windows) — so Cyrillic/non-ASCII in the JSON
|
|
22
|
+
# payload is mangled at READ time, before we ever re-encode to UTF-8 on the way
|
|
23
|
+
# to node. Reading OpenStandardInput() as bytes and decoding UTF-8 ourselves
|
|
24
|
+
# bypasses the console codepage entirely. (The 0.8.102 fix only covered the WRITE
|
|
25
|
+
# side; the read side still mangled — observed live as mojibake'd prompts.)
|
|
18
26
|
#
|
|
19
27
|
# Args: $args[0] = node path, $args[1] = capture.js path.
|
|
20
28
|
|
|
@@ -25,7 +33,10 @@ try {
|
|
|
25
33
|
|
|
26
34
|
$payload = @($input) -join "`n"
|
|
27
35
|
if ([string]::IsNullOrEmpty($payload)) {
|
|
28
|
-
$
|
|
36
|
+
$stdin = [Console]::OpenStandardInput()
|
|
37
|
+
$ms = New-Object System.IO.MemoryStream
|
|
38
|
+
$stdin.CopyTo($ms)
|
|
39
|
+
$payload = [System.Text.Encoding]::UTF8.GetString($ms.ToArray())
|
|
29
40
|
}
|
|
30
41
|
|
|
31
42
|
$psi = New-Object System.Diagnostics.ProcessStartInfo
|