@askexenow/exe-os 0.8.107 → 0.8.108

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.
@@ -0,0 +1,44 @@
1
+ #!/bin/bash
2
+ # Claude Code status line — model + visual context bar + percentage
3
+ input=$(cat)
4
+
5
+ MODEL=$(echo "$input" | jq -r '.model.display_name // "Claude"')
6
+ PCT=$(echo "$input" | jq -r '.context_window.used_percentage // 0' | cut -d. -f1)
7
+ CTX_SIZE=$(echo "$input" | jq -r '.context_window.context_window_size // empty')
8
+
9
+ # Format context window size (1000000 -> 1M, 200000 -> 200K)
10
+ if [ -n "$CTX_SIZE" ]; then
11
+ if [ "$CTX_SIZE" -ge 1000000 ] 2>/dev/null; then
12
+ CTX_LABEL="$(echo "$CTX_SIZE" | awk '{printf "%.0fM", $1/1000000}')"
13
+ elif [ "$CTX_SIZE" -ge 1000 ] 2>/dev/null; then
14
+ CTX_LABEL="$(echo "$CTX_SIZE" | awk '{printf "%.0fK", $1/1000}')"
15
+ else
16
+ CTX_LABEL="${CTX_SIZE}"
17
+ fi
18
+ fi
19
+
20
+ # Build visual bar (12 chars wide)
21
+ BAR_WIDTH=12
22
+ FILLED=$((PCT * BAR_WIDTH / 100))
23
+ EMPTY=$((BAR_WIDTH - FILLED))
24
+ BAR=""
25
+
26
+ [ "$FILLED" -gt 0 ] && printf -v FILL "%${FILLED}s" && BAR="${FILL// /▓}"
27
+ [ "$EMPTY" -gt 0 ] && printf -v PAD "%${EMPTY}s" && BAR="${BAR}${PAD// /░}"
28
+
29
+ # Color the percentage based on usage
30
+ if [ "$PCT" -ge 80 ]; then
31
+ COLOR="\033[31m" # Red
32
+ elif [ "$PCT" -ge 50 ]; then
33
+ COLOR="\033[33m" # Yellow
34
+ else
35
+ COLOR="\033[32m" # Green
36
+ fi
37
+ RESET="\033[0m"
38
+ DIM="\033[2m"
39
+
40
+ if [ -n "$CTX_SIZE" ] && [ "$PCT" -gt 0 ]; then
41
+ printf "${DIM}%s${RESET} ${COLOR}%s ${PCT}%%${RESET} ${DIM}of ${CTX_LABEL}${RESET}" "$MODEL" "$BAR"
42
+ else
43
+ printf "${DIM}%s${RESET}" "$MODEL"
44
+ fi