Files
Genarrative/server-rs/crates/platform-agent-harness/src/hook.rs
T
kdletters d7f0c45164
Project CI / Repository checks (push) Successful in 1m3s
Project CI / Frontend tests (push) Successful in 1m59s
Project CI / Native shell tests (push) Successful in 2m27s
Project CI / Backend tests (push) Successful in 3m5s
抽取画布 Agent 公共执行框架
新增业务中立的 function-calling harness 与公共提示词协议

统一画布 Agent 工具路由约束和待确认控制语义

保留失败前输出并事务化收口 memory、deadline 与取消状态

迁移画布 Agent 和 API 编排并同步架构文档与项目记忆
2026-07-28 21:34:34 +08:00

15 lines
435 B
Rust

use crate::run::{TextFlow, ToolCallFlow};
use crate::tool::ToolCall;
pub trait Hook: Send + Sync {
fn on_text_reply(&self, _text: &str) -> TextFlow {
TextFlow::Continue
}
fn before_tool_call(&self, _tool_call: &ToolCall) -> ToolCallFlow {
ToolCallFlow::Continue
}
fn after_tool_call(&self, _tool_name: &str, _output: &mut serde_json::Value) -> ToolCallFlow {
ToolCallFlow::Continue
}
}