From 599af5b011dc108dbe02dece61e839b114bdeb0f Mon Sep 17 00:00:00 2001 From: Branko May Trinkwald Date: Sun, 21 Dec 2025 23:01:47 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20New:=20Crumb=20Memo=20-=20Output-Tr?= =?UTF-8?q?ansparenz=20System?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Neue Befehle fΓΌr kreatives Output-Tracking: - crumb_memo [notiz] - Kreativen Link festhalten - crew_memo - Alle kreativen KrΓΌmel anzeigen Features: β€’ Auto-Erkennung von Plattformen: 🎧 Mixcloud, πŸ”Š SoundCloud, πŸ“Ή YouTube, πŸ’Ύ Git β€’ Zeitstempel & Notizen β€’ JSON-basiert in logs/crumb_memo.json β€’ Statistik nach Typ Philosophie: Input-Transparenz (crew_tokens) + Output-Transparenz (crew_memo) = VollstΓ€ndige Sichtbarkeit der KrΓΌmel im Nullfeld "Was habe ich geschaffen?" πŸ’š Beispiel: crumb_memo "https://mixcloud.com/digfafunk/" "New Mix" crew_memo πŸ€– Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- lib/waldwaechter.sh | 135 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 134 insertions(+), 1 deletion(-) diff --git a/lib/waldwaechter.sh b/lib/waldwaechter.sh index 4408078..8132c60 100644 --- a/lib/waldwaechter.sh +++ b/lib/waldwaechter.sh @@ -436,11 +436,16 @@ function crew_help() { Crew-Verwaltung: crew_help Diese Hilfe anzeigen crew_status Status aller 17 WaldwΓ€chter - crew_tokens Token-Verbrauch ALLER Charaktere + crew_tokens Token-Verbrauch ALLER Charaktere (Input) + crew_memo Kreative KrΓΌmel anzeigen (Output) crew_memory Erinnerungen durchsuchen crew_doctor System-Diagnose (Version, Pfade, Dependencies) crew_syntax Syntax Check aller Scripts +KrΓΌmel-Tracking: + crumb_memo Kreativen Link festhalten (Mixcloud, Git, etc.) + crew_memo Alle kreativen KrΓΌmel anzeigen + Einzelne WaldwΓ€chter: πŸ”Ί Das Dreieck (Foundation): @@ -481,6 +486,132 @@ Beispiele: EOF } +# πŸ“ crumb_memo - Kreative Output-KrΓΌmel festhalten +function crumb_memo() { + local link="$1" + local notiz="${2:-}" + + if [[ -z "$link" ]]; then + echo "πŸ“ Crumb Memo - Kreative Output-KrΓΌmel" + echo "" + echo "Verwendung: crumb_memo [notiz]" + echo "" + echo "Beispiele:" + echo " crumb_memo \"https://mixcloud.com/digfafunk/new-mix\"" + echo " crumb_memo \"https://github.com/user/repo\" \"Neues Feature\"" + echo " crumb_memo \"https://soundcloud.com/artist/track\"" + echo " crumb_memo \"https://youtube.com/watch?v=xyz\" \"Tutorial\"" + echo "" + echo "Zeige alle KrΓΌmel mit: crew_memo" + return + fi + + # Memo-Datei + local memo_file="${CRUMB_LOGS_DIR}/crumb_memo.json" + mkdir -p "${CRUMB_LOGS_DIR}" + + # Initialisiere Datei wenn nicht vorhanden + if [[ ! -f "$memo_file" ]]; then + echo "[]" > "$memo_file" + fi + + # Erkenne Typ aus URL + local typ="link" + if [[ "$link" =~ mixcloud\.com ]]; then + typ="mixcloud" + elif [[ "$link" =~ soundcloud\.com ]]; then + typ="soundcloud" + elif [[ "$link" =~ (youtube\.com|youtu\.be) ]]; then + typ="youtube" + elif [[ "$link" =~ (github\.com|gitlab\.com) ]]; then + typ="git" + fi + + # Zeitstempel + local zeit=$(date '+%Y-%m-%d %H:%M:%S') + + # Erstelle JSON-Eintrag + local entry=$(jq -n \ + --arg zeit "$zeit" \ + --arg link "$link" \ + --arg typ "$typ" \ + --arg notiz "$notiz" \ + '{zeit: $zeit, link: $link, typ: $typ, notiz: $notiz}') + + # FΓΌge zur Datei hinzu (append) + if [[ -s "$memo_file" ]]; then + # Datei hat Inhalt - fΓΌge zum Array hinzu + jq ". += [$entry]" "$memo_file" > "${memo_file}.tmp" && mv "${memo_file}.tmp" "$memo_file" + else + # Datei ist leer - erstelle Array + echo "[$entry]" > "$memo_file" + fi + + # Icon je nach Typ + local icon="πŸ”—" + case "$typ" in + mixcloud) icon="🎧" ;; + soundcloud) icon="πŸ”Š" ;; + youtube) icon="πŸ“Ή" ;; + git) icon="πŸ’Ύ" ;; + esac + + echo "$icon KrΓΌmel gespeichert: $typ" + echo " $link" + if [[ -n "$notiz" ]]; then + echo " πŸ“ $notiz" + fi +} + +# πŸ“œ crew_memo - Zeige alle kreativen KrΓΌmel +function crew_memo() { + local memo_file="${CRUMB_LOGS_DIR}/crumb_memo.json" + + echo "πŸ“œ Crumb Memo - Deine kreativen KrΓΌmel" + echo "" + echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" + + if [[ ! -f "$memo_file" ]] || [[ ! -s "$memo_file" ]]; then + echo " Noch keine KrΓΌmel gespeichert." + echo "" + echo " FΓΌge welche hinzu mit:" + echo " crumb_memo \"https://mixcloud.com/digfafunk/...\"" + echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" + return + fi + + # ZΓ€hle EintrΓ€ge pro Typ + local total=$(jq 'length' "$memo_file") + local mixcloud=$(jq '[.[] | select(.typ == "mixcloud")] | length' "$memo_file") + local soundcloud=$(jq '[.[] | select(.typ == "soundcloud")] | length' "$memo_file") + local youtube=$(jq '[.[] | select(.typ == "youtube")] | length' "$memo_file") + local git=$(jq '[.[] | select(.typ == "git")] | length' "$memo_file") + + # Zeige letzte 10 EintrΓ€ge + echo "" + jq -r '.[-10:] | reverse | .[] | + if .typ == "mixcloud" then " 🎧" + elif .typ == "soundcloud" then " πŸ”Š" + elif .typ == "youtube" then " πŸ“Ή" + elif .typ == "git" then " πŸ’Ύ" + else " πŸ”—" + end + " " + .zeit + " - " + .typ + + (if .notiz != "" then "\n πŸ“ " + .notiz else "" end) + + "\n " + .link' "$memo_file" + + echo "" + echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" + printf " Gesamt: %d KrΓΌmel" "$total" + if [[ $mixcloud -gt 0 ]]; then printf " | 🎧 %d" "$mixcloud"; fi + if [[ $soundcloud -gt 0 ]]; then printf " | πŸ”Š %d" "$soundcloud"; fi + if [[ $youtube -gt 0 ]]; then printf " | πŸ“Ή %d" "$youtube"; fi + if [[ $git -gt 0 ]]; then printf " | πŸ’Ύ %d" "$git"; fi + echo "" + echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" + echo "" + echo "πŸ’‘ Output-Transparenz: Was habe ich geschaffen? πŸ’š" +} + # Export functions so they're available in subshells # Note: export -f works in bash, but not in zsh # In zsh, functions are automatically available in the current shell @@ -510,6 +641,8 @@ if [[ -n "$BASH_VERSION" ]]; then export -f crew_doctor export -f crew_syntax export -f crew_help + export -f crumb_memo + export -f crew_memo fi # In zsh, functions are available without export -f