1
0

fix: wire Pip familiar into Workshop state pipeline (#412)

Co-authored-by: Kimi Agent <kimi@timmy.local>
Co-committed-by: Kimi Agent <kimi@timmy.local>
This commit is contained in:
2026-03-19 03:09:22 -04:00
committed by hermes
parent 4b617cfcd0
commit 9b8ad3629a
2 changed files with 23 additions and 0 deletions

View File

@@ -73,6 +73,19 @@ def _current_energy() -> float:
return max(_ENERGY_MIN, min(1.0, decayed))
def _pip_snapshot(mood: str, confidence: float) -> dict:
"""Tick Pip and return his current snapshot dict.
Feeds Timmy's mood and confidence into Pip's behavioral AI so the
familiar reacts to Timmy's cognitive state.
"""
from timmy.familiar import pip_familiar
pip_familiar.on_mood_change(mood, confidence=confidence)
pip_familiar.tick()
return pip_familiar.snapshot().to_dict()
def get_state_dict() -> dict:
"""Build presence state dict from current cognitive state.
@@ -135,6 +148,7 @@ def get_state_dict() -> dict:
"local_time": local_now.strftime("%-I:%M %p"),
"day_of_week": local_now.strftime("%A"),
},
"familiar": _pip_snapshot(mood, confidence),
"meta": {
"schema_version": 1,
"updated_at": now.strftime("%Y-%m-%dT%H:%M:%SZ"),