souls

package
v1.1.29 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 9, 2026 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Overview

Package souls discovers principal-owned lesser souls and manages local incorporation bindings.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrTrustNotConfigured indicates the instance trust base URL is unavailable.
	ErrTrustNotConfigured = errors.New("trust not configured")
	// ErrSoulNotAvailable indicates a soul is not available to the current authenticated principal.
	ErrSoulNotAvailable = errors.New("soul not available")
	// ErrSoulAlreadyBound indicates the target soul is already incorporated elsewhere.
	ErrSoulAlreadyBound = errors.New("soul already bound")
	// ErrTargetAgentRequired indicates the incorporation target agent identifier was omitted.
	ErrTargetAgentRequired = errors.New("target agent is required")
	// ErrTargetAgentNotFound indicates the requested local target agent does not exist.
	ErrTargetAgentNotFound = errors.New("target agent not found")
	// ErrTargetAgentMustBeAgent indicates the requested local target exists but is not an agent account.
	ErrTargetAgentMustBeAgent = errors.New("target account must be an agent")
	// ErrTargetAgentNotOwned indicates the requested local target agent is not owned by the authenticated principal.
	ErrTargetAgentNotOwned = errors.New("target agent not owned by authenticated principal")
	// ErrTargetAgentAlreadyHasSoul indicates the target local agent is already bound to another soul.
	ErrTargetAgentAlreadyHasSoul = errors.New("target agent already has soul")
)

Functions

This section is empty.

Types

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service resolves principal-bound souls for a Lesser instance and manages explicit incorporation bindings.

func NewService

func NewService(accountRepo accountRepository, instanceRepo instanceRepository, cfg *config.Config, logger *zap.Logger) *Service

NewService creates a new soul service.

func (*Service) Incorporate

func (s *Service) Incorporate(ctx context.Context, principalUsername string, targetAgentUsername string, agentID string) (*Soul, error)

Incorporate explicitly binds a soul to a local agent chosen by the authenticated principal.

func (*Service) ListMine

func (s *Service) ListMine(ctx context.Context, username string) ([]Soul, error)

ListMine returns the current user's discoverable souls for this instance.

func (*Service) WithHTTPClient

func (s *Service) WithHTTPClient(client *http.Client) *Service

WithHTTPClient overrides the HTTP client used for lesser-host requests.

type Soul

type Soul struct {
	AgentID                string
	Domain                 string
	LocalID                string
	ENSName                *string
	Wallet                 string
	PrincipalAddress       string
	Status                 string
	LifecycleStatus        string
	SelfDescriptionVersion *int
	Capabilities           []string
	MintTxHash             string
	MintedAt               *time.Time
	UpdatedAt              *time.Time
	Bound                  bool
	BoundAgentUsername     string
	BoundPrincipalAddress  string
	BoundAt                time.Time
	BoundUpdatedAt         time.Time
}

Soul represents a host-discovered soul plus local binding state.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL