🔍 Fix: crew_tokens zeigt jetzt alle Token transparent
Problem: crew_tokens suchte in alten ~/.xxx_logs Pfaden, aber Waldwächter loggen jetzt in repo/logs/. Lösung: - waldwaechter.sh im CrumbCrew RC-File sourcen - Alte crew_tokens/crew_memory Funktionen entfernt - Nutzt jetzt bessere Versionen aus waldwaechter.sh Resultat: Transparenz! 21,471 Tokens sichtbar 💚 "Was kostet die Frage eines Kindes?" - Krümel im Nullfeld 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -636,9 +636,15 @@ NC='\033[0m'
|
||||
# Prompt im CrumbCrew-Style
|
||||
export PS1="\[\033[1;32m\](🌲 CrumbCrew) \u@\h:\w\$ \[\033[0m\]"
|
||||
|
||||
# Pfad zu den Charakteren
|
||||
# Repo Root und Pfade
|
||||
REPO_ROOT="${REPO_ROOT}"
|
||||
CREW_DIR="${CREW_DIR}"
|
||||
|
||||
# Lade Waldwächter Library für crew_tokens, crew_status, etc.
|
||||
if [[ -f "\${REPO_ROOT}/lib/waldwaechter.sh" ]]; then
|
||||
source "\${REPO_ROOT}/lib/waldwaechter.sh"
|
||||
fi
|
||||
|
||||
# === WALDWÄCHTER FUNKTIONEN ===
|
||||
|
||||
function mayaeule() {
|
||||
@@ -895,52 +901,8 @@ function crew_status() {
|
||||
fi
|
||||
}
|
||||
|
||||
function crew_tokens() {
|
||||
echo -e "\${CYAN}📊 CrumbCrew Token-Verbrauch\${NC}"
|
||||
echo ""
|
||||
|
||||
TOTAL=0
|
||||
|
||||
for logdir in ~/.{mayaeule,eule,deepbit,bugsy,schnippsi,tobi,schraubaer,schnecki,dumbosql,funkfox,taichitaube,snakepy,pepperphp,crabbyrust,spider,vektor,asciimonster}_logs; do
|
||||
if [[ -d "\$logdir" ]] && [[ -f "\$logdir/token_log.json" ]]; then
|
||||
char_name=\$(basename "\$logdir" | sed 's/_logs//')
|
||||
char_tokens=0
|
||||
|
||||
while IFS= read -r line; do
|
||||
tokens=\$(echo "\$line" | jq -r '.usage.total_tokens' 2>/dev/null)
|
||||
if [[ "\$tokens" != "null" ]] && [[ -n "\$tokens" ]]; then
|
||||
char_tokens=\$((char_tokens + tokens))
|
||||
fi
|
||||
done < "\$logdir/token_log.json"
|
||||
|
||||
if [[ \$char_tokens -gt 0 ]]; then
|
||||
echo -e " \${GREEN}\$char_name:\${NC} \$char_tokens Tokens"
|
||||
TOTAL=\$((TOTAL + char_tokens))
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
echo ""
|
||||
echo -e "\${YELLOW}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\${NC}"
|
||||
echo -e " \${GREEN}Gesamt: \$TOTAL Tokens\${NC}"
|
||||
echo -e " \${CYAN}Jede Frage ist wertvoll 🌲\${NC}"
|
||||
echo -e "\${YELLOW}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\${NC}"
|
||||
}
|
||||
|
||||
function crew_memory() {
|
||||
echo -e "\${CYAN}📜 CrumbCrew Erinnerungen\${NC}"
|
||||
echo ""
|
||||
|
||||
for logdir in ~/.{mayaeule,eule,deepbit,bugsy,schnippsi,tobi,schraubaer,schnecki,dumbosql,funkfox,taichitaube,snakepy,pepperphp,crabbyrust,spider,vektor,asciimonster}_logs; do
|
||||
if [[ -d "\$logdir" ]] && [[ -f "\$logdir/*_history.json" ]]; then
|
||||
char_name=\$(basename "\$logdir" | sed 's/_logs//')
|
||||
count=\$(jq '. | length' "\$logdir/*_history.json" 2>/dev/null)
|
||||
if [[ "\$count" != "null" ]] && [[ \$count -gt 0 ]]; then
|
||||
echo -e " \${GREEN}\$char_name:\${NC} \$count Gespräche"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
}
|
||||
# crew_tokens, crew_memory, crew_status, crew_doctor, crew_syntax, crew_help
|
||||
# sind bereits in waldwaechter.sh definiert und werden automatisch geladen
|
||||
|
||||
alias help="crew_help"
|
||||
alias status="crew_status"
|
||||
|
||||
Reference in New Issue
Block a user