mailbox

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package mailbox provides tools for inter-agent communication via the persistent mailbox system. Agents call these tools to send tasks, replies, and broadcasts to other team members without direct coupling.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BroadcastTool

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

BroadcastTool lets an agent fan-out a message to every member of a team.

func NewBroadcastTool

func NewBroadcastTool(dispatcher Dispatcher, fromAgentID string) *BroadcastTool

NewBroadcastTool creates a BroadcastTool pre-configured with the sender's agent ID.

func (*BroadcastTool) BackfillInput

func (t *BroadcastTool) BackfillInput(_ context.Context, in map[string]any) map[string]any

func (*BroadcastTool) Call

func (*BroadcastTool) CheckPermissions

func (t *BroadcastTool) CheckPermissions(_ context.Context, in map[string]any, _ tool.ToolUseContext) types.PermissionResult

func (*BroadcastTool) Definition

func (t *BroadcastTool) Definition() tool.Definition

func (*BroadcastTool) Description

func (t *BroadcastTool) Description(_ context.Context) (string, error)

func (*BroadcastTool) FormatResult

func (t *BroadcastTool) FormatResult(data any) string

func (*BroadcastTool) IsConcurrencySafe

func (t *BroadcastTool) IsConcurrencySafe(_ map[string]any) bool

func (*BroadcastTool) IsEnabled

func (t *BroadcastTool) IsEnabled() bool

func (*BroadcastTool) IsReadOnly

func (t *BroadcastTool) IsReadOnly(_ map[string]any) bool

func (*BroadcastTool) ValidateInput

func (t *BroadcastTool) ValidateInput(_ context.Context, in map[string]any) (map[string]any, error)

type Dispatcher

type Dispatcher interface {
	Send(ctx context.Context, fromID, toID, subject, body string) error
	Assign(ctx context.Context, fromID, role, teamID, subject, body string) error
	Broadcast(ctx context.Context, fromID, teamID, subject, body string) error
	Reply(ctx context.Context, fromID, toID, replyToID, subject, body string) error
}

Dispatcher is the subset of team.Dispatcher consumed by mailbox tools. The concrete implementation (team.Dispatcher) satisfies this interface.

type SendTool

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

SendTool lets an agent send a direct task or reply via the mailbox.

func NewSendTool

func NewSendTool(dispatcher Dispatcher, fromAgentID string) *SendTool

NewSendTool creates a SendTool pre-configured with the sender's agent ID.

func (*SendTool) BackfillInput

func (t *SendTool) BackfillInput(_ context.Context, in map[string]any) map[string]any

func (*SendTool) Call

func (*SendTool) CheckPermissions

func (t *SendTool) CheckPermissions(_ context.Context, in map[string]any, _ tool.ToolUseContext) types.PermissionResult

func (*SendTool) Definition

func (t *SendTool) Definition() tool.Definition

func (*SendTool) Description

func (t *SendTool) Description(_ context.Context) (string, error)

func (*SendTool) FormatResult

func (t *SendTool) FormatResult(data any) string

func (*SendTool) IsConcurrencySafe

func (t *SendTool) IsConcurrencySafe(_ map[string]any) bool

func (*SendTool) IsEnabled

func (t *SendTool) IsEnabled() bool

func (*SendTool) IsReadOnly

func (t *SendTool) IsReadOnly(_ map[string]any) bool

func (*SendTool) ValidateInput

func (t *SendTool) ValidateInput(_ context.Context, in map[string]any) (map[string]any, error)

Jump to

Keyboard shortcuts

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