mirror of
https://github.com/hanzoai/agents.git
synced 2026-10-30 18:48:36 +00:00
Transforms hanzoai/agents from a marketplace config repo into a full agent orchestration platform by merging the AgentField infrastructure: - Go control plane (K8s-like agent orchestration, service mesh, DAG workflows) - Python SDK (FastAPI-based agent framework, LiteLLM, memory, DID/VC) - TypeScript SDK (@hanzo/agents - Vercel AI SDK, MCP, workflows) - Go SDK (idiomatic agent builder + client) - React 19 embedded dashboard (XyFlow DAGs, Recharts, Radix UI) - Docker/K8s/Helm deployment configs - Examples: hello world, deep research, RAG, simulation, benchmarks - Functional test suite across Python/Go/TypeScript All references rebranded: AgentField → Hanzo Agents - Module: github.com/hanzoai/agents/control-plane - Python: hanzo_agents - TypeScript: @hanzo/agents - Go: github.com/hanzoai/agents/sdk/go - Env vars: HANZO_AGENTS_* - Config: hanzo-agents.yaml Previous marketplace configs moved to config/ directory.
64 lines
1.8 KiB
Go
64 lines
1.8 KiB
Go
package framework
|
|
|
|
import (
|
|
"github.com/hanzoai/agents/control-plane/internal/core/interfaces"
|
|
"github.com/hanzoai/agents/control-plane/internal/services"
|
|
"github.com/hanzoai/agents/control-plane/internal/storage"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
// Command represents a CLI command that can be built into a Cobra command
|
|
type Command interface {
|
|
BuildCobraCommand() *cobra.Command
|
|
GetName() string
|
|
GetDescription() string
|
|
}
|
|
|
|
// ServiceContainer holds all the services that commands might need
|
|
type ServiceContainer struct {
|
|
PackageService interfaces.PackageService
|
|
AgentService interfaces.AgentService
|
|
DevService interfaces.DevService
|
|
DIDService *services.DIDService
|
|
VCService *services.VCService
|
|
KeystoreService *services.KeystoreService
|
|
DIDRegistry *services.DIDRegistry
|
|
StorageProvider storage.StorageProvider
|
|
}
|
|
|
|
// BaseCommand provides common functionality for all commands
|
|
type BaseCommand struct {
|
|
Services *ServiceContainer
|
|
}
|
|
|
|
// CommandRegistry manages registration and building of commands
|
|
type CommandRegistry struct {
|
|
commands []Command
|
|
}
|
|
|
|
// NewCommandRegistry creates a new command registry
|
|
func NewCommandRegistry() *CommandRegistry {
|
|
return &CommandRegistry{
|
|
commands: make([]Command, 0),
|
|
}
|
|
}
|
|
|
|
// Register adds a command to the registry
|
|
func (r *CommandRegistry) Register(cmd Command) {
|
|
r.commands = append(r.commands, cmd)
|
|
}
|
|
|
|
// BuildCobraCommands converts all registered commands to Cobra commands
|
|
func (r *CommandRegistry) BuildCobraCommands() []*cobra.Command {
|
|
var cobraCommands []*cobra.Command
|
|
for _, cmd := range r.commands {
|
|
cobraCommands = append(cobraCommands, cmd.BuildCobraCommand())
|
|
}
|
|
return cobraCommands
|
|
}
|
|
|
|
// GetCommands returns all registered commands
|
|
func (r *CommandRegistry) GetCommands() []Command {
|
|
return r.commands
|
|
}
|