feat(memory): add hot/cold startup protocol with boot-pack generator and startup show
This commit is contained in:
@@ -172,6 +172,21 @@ def parse_and_handle(chat_id: int, msg_id: int, text: str) -> str:
|
||||
if not parts:
|
||||
return help_text()
|
||||
|
||||
if parts[:2] == ['startup','show']:
|
||||
try:
|
||||
import json
|
||||
from pathlib import Path
|
||||
bp = Path('/srv/prime-core/state/boot-pack.json')
|
||||
if not bp.exists():
|
||||
return 'Boot pack not generated yet.'
|
||||
data = json.loads(bp.read_text())
|
||||
s = data.get('summary', {})
|
||||
return (f"Boot pack @ {data.get('generated_at_utc')}\n"
|
||||
f"goals={s.get('goal_count')} queued={s.get('queued_count')} blocked={s.get('blocked_count')}\n"
|
||||
f"chat={s.get('chat_enabled')} strict={s.get('strict_mode')} autonomous={s.get('autonomous_enabled')}")
|
||||
except Exception as e:
|
||||
return f"startup show error: {e}"
|
||||
|
||||
if parts[:2] == ['allowlist','show']:
|
||||
if str(chat_id) != owner_id():
|
||||
return 'Not authorized.'
|
||||
|
||||
Reference in New Issue
Block a user