Introduce a CompositeHook that fans out lifecycle callbacks to an ordered list of AgentHook instances with per-hook error isolation. Extract the nested _LoopHook and _SubagentHook to module scope as public LoopHook / SubagentHook so downstream users can subclass or compose them. Add `hooks` parameter to AgentLoop.__init__ for registering custom hooks at construction time. Closes #2603
22 lines
570 B
Python
22 lines
570 B
Python
"""Agent core module."""
|
|
|
|
from nanobot.agent.context import ContextBuilder
|
|
from nanobot.agent.hook import AgentHook, AgentHookContext, CompositeHook
|
|
from nanobot.agent.loop import AgentLoop, LoopHook
|
|
from nanobot.agent.memory import MemoryStore
|
|
from nanobot.agent.skills import SkillsLoader
|
|
from nanobot.agent.subagent import SubagentHook, SubagentManager
|
|
|
|
__all__ = [
|
|
"AgentHook",
|
|
"AgentHookContext",
|
|
"AgentLoop",
|
|
"CompositeHook",
|
|
"ContextBuilder",
|
|
"LoopHook",
|
|
"MemoryStore",
|
|
"SkillsLoader",
|
|
"SubagentHook",
|
|
"SubagentManager",
|
|
]
|