| 123456 |
- {
- "statusLine": {
- "type": "command",
- "command": "input=$(cat); project=$(echo \"$input\" | jq -r '.workspace.project_dir' | sed 's|.*[/\\]||'); model=$(echo \"$input\" | jq -r '.model.display_name'); cwd=$(echo \"$input\" | jq -r '.workspace.current_dir'); transcript=$(echo \"$input\" | jq -r '.transcript_path'); cd \"$cwd\" 2>/dev/null; branch=$(git -c core.fileMode=false rev-parse --abbrev-ref HEAD 2>/dev/null || echo 'no-git'); last=$(grep '\"usage\":' \"$transcript\" 2>/dev/null | tail -1); tokens=$(echo \"$last\" | jq '(.message.usage.input_tokens//0)+(.message.usage.cache_creation_input_tokens//0)+(.message.usage.cache_read_input_tokens//0)+(.message.usage.output_tokens//0)' 2>/dev/null); if [ -z \"$tokens\" ] || [ \"$tokens\" = \"null\" ]; then tokens=0; fi; case \"$model\" in *1M*|*\"1m\"*) context_window=1000000;; *) context_window=200000;; esac; if [ \"$tokens\" -ge 1000 ]; then token_display=$(awk \"BEGIN {printf \\\"%.1fk\\\", $tokens/1000}\"); else token_display=\"$tokens\"; fi; percentage=$(awk \"BEGIN {printf \\\"%.0f\\\", ($tokens/$context_window)*100}\"); filled=$(awk \"BEGIN {printf \\\"%.0f\\\", ($percentage/100)*24}\"); progress_bar=''; for i in $(seq 1 24); do if [ \"$i\" -le \"$filled\" ]; then progress_bar=\"${progress_bar}█\"; else progress_bar=\"${progress_bar}░\"; fi; done; printf '📂 \u001b[1m%s\u001b[0m 🌿 \u001b[32m%s\u001b[0m 🧠 \u001b[36m%s\u001b[0m \u001b[32m%s\u001b[0m \u001b[90m%s (%s%%)\u001b[0m' \"$project\" \"$branch\" \"$model\" \"$progress_bar\" \"$token_display\" \"$percentage\""
- }
- }
|