@@ -91,29 +91,30 @@ echo ""
9191
9292# Filter stream-json into human-readable lines.
9393#
94- # - assistant text -> the line as-is
95- # - assistant tool -> "→ Name(short input)"
96- # - tool_result -> " result: <truncated>"
97- # - rate_limit -> "[rate limit] <status>"
98- # - non-JSON lines (launcher messages, git output) pass through verbatim
94+ # - assistant text -> "[HH:MM:SS] the line as-is"
95+ # - assistant tool -> "[HH:MM:SS] → Name(short input)"
96+ # - tool_result -> "[HH:MM:SS] result: <truncated>"
97+ # - rate_limit -> "[HH:MM:SS] [ rate limit] <status>"
98+ # - non-JSON lines (launcher messages, git output) pass through verbatim with timestamp
9999HUMANISE='
100+ (now | strftime("%Y-%m-%d %H:%M:%S")) as $ts |
100101 . as $raw |
101102 (try fromjson catch null) as $j |
102103 if $j == null then
103- $ raw
104+ "\($ts) \($ raw)"
104105 elif $j.type == "assistant" then
105106 ($j.message.content[]? |
106- if .type == "text" then .text
107+ if .type == "text" then "\($ts) \( .text)"
107108 elif .type == "tool_use" then
108- "→ \(.name)(" + ((.input | tostring)[:100]) + ")"
109+ "\($ts) → \(.name)(" + ((.input | tostring)[:100]) + ")"
109110 else empty end)
110111 elif $j.type == "user" then
111112 ($j.message.content[]? |
112113 if .type == "tool_result" then
113- " result: " + ((.content | tostring | gsub("\n"; " "))[:200])
114+ "\($ts) result: " + ((.content | tostring | gsub("\n"; " "))[:200])
114115 else empty end)
115116 elif $j.type == "rate_limit_event" then
116- "[rate limit] " + $j.rate_limit_info.status
117+ "\($ts) [rate limit] " + $j.rate_limit_info.status
117118 else empty end
118119'
119120
0 commit comments