forked from Rockachopa/Timmy-time-dashboard
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:
@@ -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"),
|
||||
|
||||
Reference in New Issue
Block a user