diff --git a/adapters/native/register.go b/adapters/native/register.go index a582a9b..2655894 100644 --- a/adapters/native/register.go +++ b/adapters/native/register.go @@ -10,6 +10,7 @@ import ( nativexec "agent-native/adapters/native" "agent-native/exec" "agent-native/runtime" + "agent-native/runtime/checkpoint" "agent-native/runtime/hooks" "agent-native/runtime/llm" "agent-native/runtime/mcp" @@ -20,27 +21,30 @@ import ( // Config 是组合根交给 agent-native 后端的装配。零值只做模型执行。 type Config struct { - Client *llm.Client - DefaultModel string - MaxTurns int - Timeout time.Duration - Search tools.SearchProvider - Exec *tools.ExecConfig - Fetch *tools.FetchConfig - MCP *mcp.Manager - SkillsRoots []string - Subagent subagent.Factory - Compact *nativexec.CompactConfig - HostTools []tools.Tool - OnEvent func(ev squad.ProcessEvent) - Stream llm.StreamFunc - MaxToolCalls int - BeforeTool func(call llm.ToolCall) error - AfterTool func(call llm.ToolCall, res llm.Message) - Stop func(last llm.Message, info runtime.StopInfo) runtime.StopDecision - Reminders func(turn int) []string - RepeatGuard bool - Hooks *hooks.Bus + Client *llm.Client + DefaultModel string + MaxTurns int + Timeout time.Duration + Search tools.SearchProvider + Exec *tools.ExecConfig + Fetch *tools.FetchConfig + MCP *mcp.Manager + SkillsRoots []string + Subagent subagent.Factory + Compact *nativexec.CompactConfig + HostTools []tools.Tool + OnEvent func(ev squad.ProcessEvent) + Stream llm.StreamFunc + MaxToolCalls int + BeforeTool func(call llm.ToolCall) error + AfterTool func(call llm.ToolCall, res llm.Message) + Stop func(last llm.Message, info runtime.StopInfo) runtime.StopDecision + Reminders func(turn int) []string + RepeatGuard bool + Hooks *hooks.Bus + Checkpoints *checkpoint.Log + CheckpointAnchor func() string + Trace func(name string, attrs map[string]string) func() } // Register 把 "agent-native" 工厂注册进解析器。 @@ -78,7 +82,9 @@ func buildOptions(cfg Config, role squad.RoleSpec) (nativexec.Options, error) { ToolOptions: nativexec.ToolOptions{ Search: cfg.Search, Fetch: cfg.Fetch, MCP: cfg.MCP, SkillsRoots: cfg.SkillsRoots, Subagent: cfg.Subagent, HostTools: cfg.HostTools, + Checkpoints: cfg.Checkpoints, CheckpointAnchor: cfg.CheckpointAnchor, }, + ObserveOptions: nativexec.ObserveOptions{Trace: cfg.Trace}, SessionOptions: nativexec.SessionOptions{Compact: cfg.Compact, MaxToolCalls: cfg.MaxToolCalls}, GateOptions: nativexec.GateOptions{ BeforeTool: cfg.BeforeTool, AfterTool: cfg.AfterTool, Stop: cfg.Stop, diff --git a/deps/agent-native b/deps/agent-native index 0a52d9f..fb2b3b7 160000 --- a/deps/agent-native +++ b/deps/agent-native @@ -1 +1 @@ -Subproject commit 0a52d9f9763372ef1b4d061934d60f15fd8bcbea +Subproject commit fb2b3b796c57246306cd7384b60fb671ce371143