Pass code orchestration and MCP ask through the squad backend #14
+28
-24
@@ -21,30 +21,32 @@ 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
|
||||
Checkpoints *checkpoint.Log
|
||||
CheckpointAnchor func() string
|
||||
Trace func(name string, attrs map[string]string) func()
|
||||
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()
|
||||
CodeOrchestration bool
|
||||
Ask func(ctx context.Context, question string) (string, error)
|
||||
}
|
||||
|
||||
// Register 把 "agent-native" 工厂注册进解析器。
|
||||
@@ -83,12 +85,14 @@ func buildOptions(cfg Config, role squad.RoleSpec) (nativexec.Options, error) {
|
||||
Search: cfg.Search, Fetch: cfg.Fetch, MCP: cfg.MCP,
|
||||
SkillsRoots: cfg.SkillsRoots, Subagent: cfg.Subagent, HostTools: cfg.HostTools,
|
||||
Checkpoints: cfg.Checkpoints, CheckpointAnchor: cfg.CheckpointAnchor,
|
||||
CodeOrchestration: cfg.CodeOrchestration,
|
||||
},
|
||||
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,
|
||||
Reminders: cfg.Reminders, RepeatGuard: cfg.RepeatGuard, Hooks: cfg.Hooks,
|
||||
Ask: cfg.Ask,
|
||||
},
|
||||
}
|
||||
if cfg.Client != nil {
|
||||
|
||||
Vendored
+1
-1
Submodule deps/agent-native updated: fb2b3b796c...e4020d297c
Reference in New Issue
Block a user