contracts

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AgentNameContextKey = struct{ key string }{"agentry.agent-name"}

AgentNameContextKey provides the current agent's logical name (e.g., "agent_0" or role name) when running within a Team. Team sets this value before invoking the agent.

View Source
var TeamContextKey = struct{ key string }{"agentry.team"}

TeamContextKey is used to store a team implementation in context for builtins. The concrete value should implement the TeamService interface.

Functions

This section is empty.

Types

type TeamService

type TeamService interface {
	// Agent Discovery
	SpawnedAgentNames() []string  // Currently running agent instances
	AvailableRoleNames() []string // Role names from configuration files

	// Task Delegation
	DelegateTask(ctx context.Context, role, task string) (string, error)

	// Communication
	SendMessage(ctx context.Context, from, to, message string) error
	GetInbox(agentID string) []map[string]interface{}
	MarkInboxRead(agentID string)

	// Coordination
	GetCoordinationSummary() string
	GetCoordinationHistory(limit int) []string

	// Shared Memory
	GetSharedData(key string) (interface{}, bool)
	SetSharedData(key string, value interface{})
	GetAllSharedData() map[string]interface{}

	// Help System
	RequestHelp(ctx context.Context, agentID, description, preferredHelper string) error
}

TeamService defines the contract for team coordination services. This interface breaks import cycles between tool and team packages.

Jump to

Keyboard shortcuts

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