Implements an observer pattern where agents can register watchers for conditions on their thread. When the condition is met, the agent gets "nagged" on subsequent invocations until it explicitly closes the todo. Key components: - TodoRegistry: thread-scoped watcher tracking with eyebrow state - TodoUntil/TodoComplete payloads and system handlers - HandlerMetadata.todo_nudge for delivering raised eyebrow notices - Integration in StreamPump dispatch to check and nudge Greeter now demonstrates the pattern: 1. Registers watcher for ShoutedResponse from shouter 2. On next invocation, sees nudge and closes completed todos 3. Includes nudge in LLM prompt for awareness Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
27 lines
616 B
Python
27 lines
616 B
Python
"""
|
|
System primitives — Core message types handled by the organism itself.
|
|
|
|
These are not user-defined listeners but system-level messages that
|
|
establish context, handle errors, and manage the organism lifecycle.
|
|
"""
|
|
|
|
from agentserver.primitives.boot import Boot, handle_boot
|
|
from agentserver.primitives.todo import (
|
|
TodoUntil,
|
|
TodoComplete,
|
|
TodoRegistered,
|
|
TodoClosed,
|
|
handle_todo_until,
|
|
handle_todo_complete,
|
|
)
|
|
|
|
__all__ = [
|
|
"Boot",
|
|
"handle_boot",
|
|
"TodoUntil",
|
|
"TodoComplete",
|
|
"TodoRegistered",
|
|
"TodoClosed",
|
|
"handle_todo_until",
|
|
"handle_todo_complete",
|
|
]
|