pub async fn trigger_agent_bootstrap(
agent_id: &str,
agent_type: &str,
session_key: Option<String>,
) -> Result<InternalHookEvent>Expand description
触发 agent:bootstrap 事件
当 Agent 完成初始化引导时调用此函数触发 agent:bootstrap 事件。
事件的 context 包含 agent_id 和 agent_type 字段。
§参数
agent_id: Agent 的唯一标识符agent_type: Agent 的类型(如 “coding”、“chat” 等)session_key: 可选的会话键
§返回值
返回触发后的 InternalHookEvent,调用者可以访问处理器添加的消息。
§示例
ⓘ
use aster::hooks::internal::trigger_agent_bootstrap;
async fn bootstrap_agent() {
let event = trigger_agent_bootstrap(
"agent-001",
"coding",
Some("session-123".to_string()),
).await.unwrap();
println!("Bootstrap complete, messages: {:?}", event.messages);
}Validates: Requirements 7.4, 7.5