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 ¶
- type BroadcastTool
- func (t *BroadcastTool) BackfillInput(_ context.Context, in map[string]any) map[string]any
- func (t *BroadcastTool) Call(ctx context.Context, input tool.CallInput, _ types.CanUseToolFn) (tool.CallResult, error)
- func (t *BroadcastTool) CheckPermissions(_ context.Context, in map[string]any, _ tool.ToolUseContext) types.PermissionResult
- func (t *BroadcastTool) Definition() tool.Definition
- func (t *BroadcastTool) Description(_ context.Context) (string, error)
- func (t *BroadcastTool) FormatResult(data any) string
- func (t *BroadcastTool) IsConcurrencySafe(_ map[string]any) bool
- func (t *BroadcastTool) IsEnabled() bool
- func (t *BroadcastTool) IsReadOnly(_ map[string]any) bool
- func (t *BroadcastTool) ValidateInput(_ context.Context, in map[string]any) (map[string]any, error)
- type Dispatcher
- type SendTool
- func (t *SendTool) BackfillInput(_ context.Context, in map[string]any) map[string]any
- func (t *SendTool) Call(ctx context.Context, input tool.CallInput, _ types.CanUseToolFn) (tool.CallResult, error)
- func (t *SendTool) CheckPermissions(_ context.Context, in map[string]any, _ tool.ToolUseContext) types.PermissionResult
- func (t *SendTool) Definition() tool.Definition
- func (t *SendTool) Description(_ context.Context) (string, error)
- func (t *SendTool) FormatResult(data any) string
- func (t *SendTool) IsConcurrencySafe(_ map[string]any) bool
- func (t *SendTool) IsEnabled() bool
- func (t *SendTool) IsReadOnly(_ map[string]any) bool
- func (t *SendTool) ValidateInput(_ context.Context, in map[string]any) (map[string]any, error)
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 (*BroadcastTool) Call ¶
func (t *BroadcastTool) Call( ctx context.Context, input tool.CallInput, _ types.CanUseToolFn, ) (tool.CallResult, error)
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 ¶
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 (*SendTool) Call ¶
func (t *SendTool) Call( ctx context.Context, input tool.CallInput, _ types.CanUseToolFn, ) (tool.CallResult, error)
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