agents

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: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NotifyAgentCompletion

func NotifyAgentCompletion(taskID, agentType, description, output string, success bool)

NotifyAgentCompletion is called when a background agent task completes

func RegisterAgentCompletionHandler

func RegisterAgentCompletionHandler(handler AgentCompletionHandler)

RegisterAgentCompletionHandler registers a callback to be called when background agents complete

Types

type AgentCompletionHandler

type AgentCompletionHandler func(taskID, agentType, description, output string, success bool)

AgentCompletionHandler is a function type for handling agent completion

type AgentTool

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

AgentTool is the agent tool

func NewAgentTool

func NewAgentTool(config *AgentToolConfig) *AgentTool

NewAgentTool creates a new agent tool

func (*AgentTool) BackfillInput

func (t *AgentTool) BackfillInput(ctx context.Context, input map[string]any) map[string]any

BackfillInput enriches input

func (*AgentTool) Call

func (t *AgentTool) Call(
	ctx context.Context,
	input tool.CallInput,
	permissionCheck types.CanUseToolFn,
) (tool.CallResult, error)

Call executes the tool

func (*AgentTool) CheckPermissions

func (t *AgentTool) CheckPermissions(ctx context.Context, input map[string]any, toolCtx tool.ToolUseContext) types.PermissionResult

CheckPermissions checks permissions

func (*AgentTool) Definition

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

Definition returns the tool definition

func (*AgentTool) Description

func (t *AgentTool) Description(ctx context.Context) (string, error)

Description returns description

func (*AgentTool) FormatResult

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

FormatResult formats result

func (*AgentTool) GetRunner

func (t *AgentTool) GetRunner() *coreagent.Runner

GetRunner returns the current runner (if any)

func (*AgentTool) IsConcurrencySafe

func (t *AgentTool) IsConcurrencySafe(input map[string]any) bool

IsConcurrencySafe returns whether tool is concurrency safe

func (*AgentTool) IsEnabled

func (t *AgentTool) IsEnabled() bool

IsEnabled returns whether tool is enabled

func (*AgentTool) IsReadOnly

func (t *AgentTool) IsReadOnly(input map[string]any) bool

IsReadOnly returns whether tool is read-only

func (*AgentTool) SetEngine

func (t *AgentTool) SetEngine(e *engine.Engine)

SetEngine binds this tool instance to a specific engine.

func (*AgentTool) SetRegistry

func (t *AgentTool) SetRegistry(r *coreagent.AgentRegistry)

SetRegistry sets the agent registry for resolving dynamic (skill-based) agent types.

func (*AgentTool) SetRunner

func (t *AgentTool) SetRunner(runner *coreagent.Runner)

SetRunner sets an advanced runner for the agent tool

func (*AgentTool) ValidateInput

func (t *AgentTool) ValidateInput(ctx context.Context, input map[string]any) (map[string]any, error)

ValidateInput validates tool input

type AgentToolConfig

type AgentToolConfig struct {
	Enabled bool
}

Config for Agent tool

func DefaultAgentToolConfig

func DefaultAgentToolConfig() *AgentToolConfig

Default config

type CloseAgentTool

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

CloseAgentTool terminates a sub-agent and removes it from the registry.

func NewCloseAgentTool

func NewCloseAgentTool() *CloseAgentTool

func (*CloseAgentTool) BackfillInput

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

func (*CloseAgentTool) Call

func (*CloseAgentTool) CheckPermissions

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

func (*CloseAgentTool) Definition

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

func (*CloseAgentTool) Description

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

func (*CloseAgentTool) FormatResult

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

func (*CloseAgentTool) IsConcurrencySafe

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

func (*CloseAgentTool) IsEnabled

func (t *CloseAgentTool) IsEnabled() bool

func (*CloseAgentTool) IsReadOnly

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

func (*CloseAgentTool) ValidateInput

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

type ListAgentsTool

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

ListAgentsTool lists all active sub-agents. Mirrors Codex's CollabAgentTool listing + CollabAgentStatusEntry.

func NewListAgentsTool

func NewListAgentsTool() *ListAgentsTool

func (*ListAgentsTool) BackfillInput

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

func (*ListAgentsTool) Call

func (*ListAgentsTool) CheckPermissions

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

func (*ListAgentsTool) Definition

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

func (*ListAgentsTool) Description

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

func (*ListAgentsTool) FormatResult

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

func (*ListAgentsTool) IsConcurrencySafe

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

func (*ListAgentsTool) IsEnabled

func (t *ListAgentsTool) IsEnabled() bool

func (*ListAgentsTool) IsReadOnly

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

func (*ListAgentsTool) ValidateInput

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

type ResumeAgentTool

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

ResumeAgentTool resumes a persisted sub-agent session with a new task.

func NewResumeAgentTool

func NewResumeAgentTool(eng *engine.Engine, tools []tool.Tool, reg *coreagent.AgentRegistry) *ResumeAgentTool

func (*ResumeAgentTool) BackfillInput

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

func (*ResumeAgentTool) Call

func (*ResumeAgentTool) CheckPermissions

func (*ResumeAgentTool) Definition

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

func (*ResumeAgentTool) Description

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

func (*ResumeAgentTool) FormatResult

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

func (*ResumeAgentTool) IsConcurrencySafe

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

func (*ResumeAgentTool) IsEnabled

func (t *ResumeAgentTool) IsEnabled() bool

func (*ResumeAgentTool) IsReadOnly

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

func (*ResumeAgentTool) ValidateInput

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

type SendAgentMessageTool

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

SendAgentMessageTool sends a message to a running agent's continuation queue.

func NewSendAgentMessageTool

func NewSendAgentMessageTool() *SendAgentMessageTool

func (*SendAgentMessageTool) BackfillInput

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

func (*SendAgentMessageTool) Call

func (*SendAgentMessageTool) CheckPermissions

func (*SendAgentMessageTool) Definition

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

func (*SendAgentMessageTool) Description

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

func (*SendAgentMessageTool) FormatResult

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

func (*SendAgentMessageTool) IsConcurrencySafe

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

func (*SendAgentMessageTool) IsEnabled

func (t *SendAgentMessageTool) IsEnabled() bool

func (*SendAgentMessageTool) IsReadOnly

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

func (*SendAgentMessageTool) ValidateInput

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

type SpawnAgentTool

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

SpawnAgentTool launches a sub-agent asynchronously and returns immediately. Mirrors Codex's CollabAgentTool = "spawnAgent" + CollabAgentSpawnBeginEvent / CollabAgentSpawnEndEvent.

func NewSpawnAgentTool

func NewSpawnAgentTool(eng *engine.Engine, tools []tool.Tool, reg *coreagent.AgentRegistry) *SpawnAgentTool

func (*SpawnAgentTool) BackfillInput

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

func (*SpawnAgentTool) Call

func (*SpawnAgentTool) CheckPermissions

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

func (*SpawnAgentTool) Definition

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

func (*SpawnAgentTool) Description

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

func (*SpawnAgentTool) FormatResult

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

func (*SpawnAgentTool) IsConcurrencySafe

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

func (*SpawnAgentTool) IsEnabled

func (t *SpawnAgentTool) IsEnabled() bool

func (*SpawnAgentTool) IsReadOnly

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

func (*SpawnAgentTool) ValidateInput

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

type WaitAgentTool

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

WaitAgentTool blocks until an agent finishes and returns its result.

func NewWaitAgentTool

func NewWaitAgentTool() *WaitAgentTool

func (*WaitAgentTool) BackfillInput

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

func (*WaitAgentTool) Call

func (*WaitAgentTool) CheckPermissions

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

func (*WaitAgentTool) Definition

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

func (*WaitAgentTool) Description

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

func (*WaitAgentTool) FormatResult

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

func (*WaitAgentTool) IsConcurrencySafe

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

func (*WaitAgentTool) IsEnabled

func (t *WaitAgentTool) IsEnabled() bool

func (*WaitAgentTool) IsReadOnly

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

func (*WaitAgentTool) ValidateInput

func (t *WaitAgentTool) 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