mirror of
https://github.com/hanzoai/agent.git
synced 2026-09-11 21:08:51 +00:00
Consolidate all Hanzo agent infrastructure into one repo: - control-plane/: Go control plane server (was agents-new) - sdk/: Go, Python, TypeScript SDKs - deployments/: Docker, Kubernetes, Helm configs - Dockerfile.sdk: Python SDK image (ghcr.io/hanzoai/agent:latest) - CI builds both SDK + control-plane images No more agentfield — everything is hanzoai/agent.
31 lines
752 B
Go
31 lines
752 B
Go
package server
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
|
|
"github.com/hanzoai/agents/control-plane/pkg/types"
|
|
)
|
|
|
|
type stubPackageStorage struct {
|
|
packages map[string]*types.AgentPackage
|
|
getCalls []string
|
|
}
|
|
|
|
func newStubPackageStorage() *stubPackageStorage {
|
|
return &stubPackageStorage{packages: make(map[string]*types.AgentPackage)}
|
|
}
|
|
|
|
func (s *stubPackageStorage) GetAgentPackage(ctx context.Context, packageID string) (*types.AgentPackage, error) {
|
|
s.getCalls = append(s.getCalls, packageID)
|
|
if pkg, ok := s.packages[packageID]; ok {
|
|
return pkg, nil
|
|
}
|
|
return nil, fmt.Errorf("package %s not found", packageID)
|
|
}
|
|
|
|
func (s *stubPackageStorage) StoreAgentPackage(ctx context.Context, pkg *types.AgentPackage) error {
|
|
s.packages[pkg.ID] = pkg
|
|
return nil
|
|
}
|