From 4727d0d58253bc1dffd9ca410e318f3464f930f1 Mon Sep 17 00:00:00 2001 From: Lee Whieldon Date: Wed, 29 Apr 2026 12:03:46 -0400 Subject: [PATCH] updated to render pets in windows --- scripts/build-art.ts | 3 ++- server/art.ts | 18 +++++++++--------- server/index.ts | 10 +++++++--- statusline/pet-status.sh | 16 ++++++++-------- 4 files changed, 26 insertions(+), 21 deletions(-) diff --git a/scripts/build-art.ts b/scripts/build-art.ts index fe8a375..32ee111 100644 --- a/scripts/build-art.ts +++ b/scripts/build-art.ts @@ -10,13 +10,14 @@ import { readFileSync, writeFileSync } from "fs"; import { join } from "path"; +import { fileURLToPath } from "url"; import { ANIMAL_ART } from "../server/art.ts"; import { ANIMALS, ANIMAL_COLOR } from "../server/engine.ts"; import { ART_META } from "../server/art-meta.ts"; import type { AnimalId } from "../server/engine.ts"; // Resolve paths relative to this script's directory -const SCRIPT_DIR = new URL(".", import.meta.url).pathname; +const SCRIPT_DIR = fileURLToPath(new URL(".", import.meta.url)); const PROJECT_ROOT = join(SCRIPT_DIR, ".."); const SHELL_PATH = join(PROJECT_ROOT, "statusline", "pet-status.sh"); diff --git a/server/art.ts b/server/art.ts index da7954f..583ed4f 100644 --- a/server/art.ts +++ b/server/art.ts @@ -118,16 +118,16 @@ export const ANIMAL_ART: Record = { [" ", " {*|_W_|*} ", " ( > < ) ", " { = ^ = } ", " * *~~* * "], // glare [" ", " {*|_W_|*} ", " ( - - ) ", " { = O = } ", " * *~~* * "], // yawn ], - // 12. ESFJ golden retriever — fluffy fur ~~, tongue U, tail wag + // 12. ESFJ golden retriever — 6-eyes brow, snout, quote paws golden: [ - [" ", " _/~\\~~ ", " ( \u2022 \\~~ ", " U | ", " \\__(__)~ "], - [" ", " _/~\\~~ ", " ( \u2022 \\~~ ", " U | ", " \\__(__)~~ "], - [" ", " _/~\\~~ ", " ( - \\~~ ", " U | ", " \\__(__)~ "], - [" ", " _/~\\~~ ", " ( \u2022 \\~~ ", " U | ", " \\__(__)~~~"], // wag - [" ", " _/~\\~~ ", " ( \u2022 \\~~ ", " U | ", " ~\\__( )~ "], // jump - [" ", " _/~\\~~ ", " ( \u2022 \\~~ ", " U | ", " \\__(__)~ "], // lick out - [" ", " _/~\\~~ ", " ( \u2022 \\~~ ", " U | ", " \\__(__)~ "], // lick back - [" ", " ~~/ ~\\_ ", " (~~ \u2022 ) ", " | U ", " ~(__)__/~ "], // spin + [" ", " . \" . ", " /|6 6|\\ ", "{/(_0_)\\} ", " \" \" \" "], // idle + [" ", " . \" . ", " /|6 6|\\ ", "{/(_0_)\\} ", " \" \" \"~ "], // wag 1 + [" ", " . \" . ", " /|- -|\\ ", "{/(_0_)\\} ", " \" \" \" "], // blink + [" ", " . \" . ", " /|6 6|\\ ", "{/(_0_)\\} ", " \" \" \"~~ "], // wag 2 + [" ", " . \" . ", " /|^ ^|\\ ", "{/(_0_)\\} ", " ~ ~ ~ "], // jump + [" ", " . \" . ", " /|6 6|\\ ", "{/(-U-)\\} ", " \" \" \" "], // lick out + [" ", " . \" . ", " /|6 6|\\ ", "{/(~~~)\\} ", " \" \" \" "], // lick back + [" ", " . \" . ", " /|6 6|\\ ", " {/(_0_)\\} ", " \" \" \" "], // spin ], // 13. ISTP cat — iconic /\_/\ ears, curled up loaf, aloof cat: [ diff --git a/server/index.ts b/server/index.ts index d00c2d5..105718f 100644 --- a/server/index.ts +++ b/server/index.ts @@ -322,9 +322,13 @@ server.tool( saveReaction(reaction, "pet"); writeStatusState(pet, reaction); - return { - content: [{ type: "text", text: `${pet.petName}: ${reaction}` }], - }; + const card = renderPetCard( + pet.petId, + pet.petName, + `${animalName(pet.petId)} · ${pet.personality}`, + reaction, + ); + return { content: [{ type: "text", text: codeFence(card) }] }; }, ); diff --git a/statusline/pet-status.sh b/statusline/pet-status.sh index 4ed0fb6..c89abf2 100755 --- a/statusline/pet-status.sh +++ b/statusline/pet-status.sh @@ -681,14 +681,14 @@ case "$PET_ID" in golden) TG=$'\033[38;2;240;140;150m' # pink tongue case $FRAME in - 0) L1=" _/~\\~~ "; L2=" ( • \\~~ "; L3=" ${TG}U${C} | "; L4=" \\__(__)~ " ;; - 1) L1=" _/~\\~~ "; L2=" ( • \\~~ "; L3=" ${TG}U${C} | "; L4=" \\__(__)~~ " ;; - 2) L1=" _/~\\~~ "; L2=" ( - \\~~ "; L3=" ${TG}U${C} | "; L4=" \\__(__)~ " ;; - 3) L1=" _/~\\~~ "; L2=" ( • \\~~ "; L3=" ${TG}U${C} | "; L4=" \\__(__)~~~" ;; - 4) L1=" _/~\\~~ "; L2=" ( • \\~~ "; L3=" ${TG}U${C} | "; L4=" ~\\__( )~ " ;; - 5) L1=" _/~\\~~ "; L2=" ( • \\~~ "; L3=" ${TG}U${C} | "; L4=" \\__(__)~ " ;; - 6) L1=" _/~\\~~ "; L2=" ( • \\~~ "; L3=" ${TG}U${C} | "; L4=" \\__(__)~ " ;; - 7) L1=" ~~/ ~\\_ "; L2=" (~~ • ) "; L3=" | ${TG}U${C} "; L4=" ~(__)__/~ " ;; + 0) L1=" . \" . "; L2=" /|6 6|\\ "; L3="{/(_0_)\\} "; L4=" \" \" \" " ;; + 1) L1=" . \" . "; L2=" /|6 6|\\ "; L3="{/(_0_)\\} "; L4=" \" \" \"~ " ;; + 2) L1=" . \" . "; L2=" /|- -|\\ "; L3="{/(_0_)\\} "; L4=" \" \" \" " ;; + 3) L1=" . \" . "; L2=" /|6 6|\\ "; L3="{/(_0_)\\} "; L4=" \" \" \"~~ " ;; + 4) L1=" . \" . "; L2=" /|^ ^|\\ "; L3="{/(_0_)\\} "; L4=" ~ ~ ~ " ;; + 5) L1=" . \" . "; L2=" /|6 6|\\ "; L3="{/(-${TG}U${C}-)\\} "; L4=" \" \" \" " ;; + 6) L1=" . \" . "; L2=" /|6 6|\\ "; L3="{/(~~~)\\} "; L4=" \" \" \" " ;; + 7) L1=" . \" . "; L2=" /|6 6|\\ "; L3=" {/(_0_)\\} "; L4=" \" \" \" " ;; esac ;; cat) case $FRAME in