Commit Graph

8 Commits

Author SHA1 Message Date
Teknium 7309c3aef3 refactor(agent): pet atlas/render/store pass-2 structural cut (median-box helper, encoder dispatch, inlined single-use helpers) 2026-09-02 23:04:29 -07:00
Teknium 6c41acbddd refactor(agent): pet — pass 2 (render/store/orchestrate helper collapse, dispatch, docstring compaction; 25% LOC cut) 2026-09-02 19:44:51 -07:00
Teknium b4c386642f refactor(agent): pet — pass 1 (dead ROWS/COLUMNS, module-level PIL imports, helper collapse, docstring compaction) 2026-09-02 19:15:47 -07:00
Teknium 2ad284b473 refactor(agent/runtime): pet — shared flood/placement helpers in atlas, provider resolution loop, dead helpers removed
- atlas: _border_flood/_unvisited_components/_place/_clear_region/_remove_masked
  replace 6 hand-rolled flood + canvas-composite loops; _sever_expected_gutters
  uses channel ops instead of per-pixel writes; dead _color_distance,
  _has_slot_padding, _slot_bounds, atlas_to_webp_bytes, FRAME_COUNTS (0 refs).
- render/store: dead _open_sheet/_png_bytes/_union_alpha_bbox/_thumbs_dir removed.
- imagegen: _available() unifies 3 provider-availability checks; forced/preferred
  provider resolution collapsed into one ordered loop (same precedence).
- state: derive_pet_state as a ranked table (same priority order).
- Comment/docstring compaction keeping the pipeline invariants.
2026-09-02 13:29:47 -07:00
Brooklyn Nicholson d889758521 feat(pet): gate Unicode placeholders to kitty and Ghostty
WezTerm speaks kitty APC but not U+10EEEE, so detect_terminal_graphics()
== "kitty" is the wrong gate for the placeholder path.
2026-08-28 23:38:59 -05:00
Teknium 55e3ee1ab8 fix: remove dead f-string prefixes via ruff F541 (216 sites) (#52336)
ruff check --fix --select F541 . on current main. Pure prefix removals;
adjacent-string concatenations keep the f only on interpolating fragments.
No string content or live placeholder altered.
2026-07-05 13:42:46 -07:00
Brooklyn Nicholson af35ae3c46 fix(pet): snap kitty frames to whole cells
kitty fits an image to its cell rect preserving aspect, so a frame whose pixel
size isn't a whole multiple of the cell rounds up — clipping the bottom row
("clipped feet") and letterboxing a blank row. Trim each frame to its union
alpha bbox, then snap to an exact cell multiple before transmit so the sprite
hugs its box and renders full-body. (ratatui-image#57: render in multiples of
the font-size.)
2026-06-30 15:41:44 -05:00
Brooklyn Nicholson e7dbfdaad7 feat(pets): pet engine + display.pet config
Add the shared pet engine under agent/pet/: spritesheet manifest loading
and in-process caching, six-state animation model, frame rendering, and
the persistent pet store. Register the display.pet config block (pet,
scale, enabled, etc.) that every surface reads from. Covered by
tests/agent/test_pet_engine.py.
2026-06-20 14:18:30 -05:00