feat(project): 项目完结

This commit is contained in:
peakxy
2026-05-30 23:16:49 +08:00
commit 60e7777cbd
97 changed files with 15027 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
package armory
import (
"context"
"ai-agent-scaffold-go/internal/domain/agent/model"
"ai-agent-scaffold-go/internal/domain/agent/ports"
"ai-agent-scaffold-go/internal/domain/shared/tree"
)
type AgentNode struct {
agentFactory ports.AgentFactory
next Handler
}
func NewAgentNode(agentFactory ports.AgentFactory, next Handler) AgentNode {
return AgentNode{agentFactory: agentFactory, next: next}
}
func (n AgentNode) Apply(ctx context.Context, command model.ArmoryCommand, dynamic *DynamicContext) (model.RegisteredAgent, error) {
for _, config := range command.Table.Module.Agents {
agent, err := n.agentFactory.NewLLMAgent(ctx, config, dynamic.ChatModel)
if err != nil {
return model.RegisteredAgent{}, err
}
dynamic.AddAgent(agent)
}
return tree.Route(ctx, n.next, command, dynamic)
}