tools

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ContextKeyWorkspacePath overrides tool workspace paths.
	ContextKeyWorkspacePath contextKey = iota
	// ContextKeyContainerID signals a container exec context for shell_exec.
	ContextKeyContainerID
	// ContextKeyProjectID carries the current project ID.
	ContextKeyProjectID
	// ContextKeyAgentID carries the ID of the currently executing agent.
	ContextKeyAgentID
	// ContextKeyTaskID carries the ID of the current task.
	ContextKeyTaskID
)

Variables

This section is empty.

Functions

func AgentIDFromContext

func AgentIDFromContext(ctx context.Context) (string, bool)

AgentIDFromContext returns the agent ID from context, if set.

func ContainerIDFromContext

func ContainerIDFromContext(ctx context.Context) (string, bool)

ContainerIDFromContext returns the active container ID from context, if set.

func ProjectIDFromContext

func ProjectIDFromContext(ctx context.Context) (string, bool)

ProjectIDFromContext returns the project ID from context, if set.

func TaskIDFromContext

func TaskIDFromContext(ctx context.Context) (string, bool)

TaskIDFromContext returns the task ID from context, if set.

func WithAgentID

func WithAgentID(ctx context.Context, id string) context.Context

WithAgentID returns a context with the agent ID set.

func WithContainerID

func WithContainerID(ctx context.Context, id string) context.Context

WithContainerID returns a context with the container ID set.

func WithProjectID

func WithProjectID(ctx context.Context, id string) context.Context

WithProjectID returns a context with the project ID set.

func WithTaskID

func WithTaskID(ctx context.Context, id string) context.Context

WithTaskID returns a context with the task ID set.

func WithWorkspacePath

func WithWorkspacePath(ctx context.Context, path string) context.Context

WithWorkspacePath returns a context with the workspace path set.

func WorkspacePathFromContext

func WorkspacePathFromContext(ctx context.Context) (string, bool)

WorkspacePathFromContext returns the workspace path from context, if set.

Types

type AgentCheckTool

type AgentCheckTool struct {
	Manager SubAgentSpawner
}

AgentCheckTool checks the status of a previously spawned sub-agent task.

func (*AgentCheckTool) Definition

func (t *AgentCheckTool) Definition() provider.ToolDef

func (*AgentCheckTool) Description

func (t *AgentCheckTool) Description() string

func (*AgentCheckTool) Execute

func (t *AgentCheckTool) Execute(ctx context.Context, args map[string]any) (any, error)

func (*AgentCheckTool) Name

func (t *AgentCheckTool) Name() string

type AgentSpawnTool

type AgentSpawnTool struct {
	Manager SubAgentSpawner
}

AgentSpawnTool spawns an ephemeral sub-agent to handle a delegated task.

func (*AgentSpawnTool) Definition

func (t *AgentSpawnTool) Definition() provider.ToolDef

func (*AgentSpawnTool) Description

func (t *AgentSpawnTool) Description() string

func (*AgentSpawnTool) Execute

func (t *AgentSpawnTool) Execute(ctx context.Context, args map[string]any) (any, error)

func (*AgentSpawnTool) Name

func (t *AgentSpawnTool) Name() string

type AgentWaitTool

type AgentWaitTool struct {
	Manager SubAgentSpawner
}

AgentWaitTool waits for one or more spawned sub-agent tasks to complete.

func (*AgentWaitTool) Definition

func (t *AgentWaitTool) Definition() provider.ToolDef

func (*AgentWaitTool) Description

func (t *AgentWaitTool) Description() string

func (*AgentWaitTool) Execute

func (t *AgentWaitTool) Execute(ctx context.Context, args map[string]any) (any, error)

func (*AgentWaitTool) Name

func (t *AgentWaitTool) Name() string

type ApprovalCreator

type ApprovalCreator interface {
	CreateApproval(ctx context.Context, agentID, taskID, action, reason, details string) (string, error)
}

ApprovalCreator is the interface needed by RequestApprovalTool to create approvals. This avoids a circular import with the ratchetplugin package.

type BrowserClickTool

type BrowserClickTool struct {
	Manager BrowserPageProvider
}

BrowserClickTool clicks an element on the agent's current browser page.

func (*BrowserClickTool) Definition

func (t *BrowserClickTool) Definition() provider.ToolDef

func (*BrowserClickTool) Description

func (t *BrowserClickTool) Description() string

func (*BrowserClickTool) Execute

func (t *BrowserClickTool) Execute(ctx context.Context, args map[string]any) (any, error)

func (*BrowserClickTool) Name

func (t *BrowserClickTool) Name() string

type BrowserExtractTool

type BrowserExtractTool struct {
	Manager BrowserPageProvider
}

BrowserExtractTool extracts text and HTML from elements matching a CSS selector.

func (*BrowserExtractTool) Definition

func (t *BrowserExtractTool) Definition() provider.ToolDef

func (*BrowserExtractTool) Description

func (t *BrowserExtractTool) Description() string

func (*BrowserExtractTool) Execute

func (t *BrowserExtractTool) Execute(ctx context.Context, args map[string]any) (any, error)

func (*BrowserExtractTool) Name

func (t *BrowserExtractTool) Name() string

type BrowserFillTool

type BrowserFillTool struct {
	Manager BrowserPageProvider
}

BrowserFillTool fills an input element on the agent's current browser page.

func (*BrowserFillTool) Definition

func (t *BrowserFillTool) Definition() provider.ToolDef

func (*BrowserFillTool) Description

func (t *BrowserFillTool) Description() string

func (*BrowserFillTool) Execute

func (t *BrowserFillTool) Execute(ctx context.Context, args map[string]any) (any, error)

func (*BrowserFillTool) Name

func (t *BrowserFillTool) Name() string

type BrowserNavigateTool

type BrowserNavigateTool struct {
	Manager BrowserPageProvider
	// MaxTextLength caps the number of characters returned in the page text field.
	// A value of 0 (or negative) falls back to defaultBrowserMaxTextLength (2000).
	MaxTextLength int
}

BrowserNavigateTool navigates the agent's browser page to a URL and returns the page title and a text excerpt.

func (*BrowserNavigateTool) Definition

func (t *BrowserNavigateTool) Definition() provider.ToolDef

func (*BrowserNavigateTool) Description

func (t *BrowserNavigateTool) Description() string

func (*BrowserNavigateTool) Execute

func (t *BrowserNavigateTool) Execute(ctx context.Context, args map[string]any) (any, error)

func (*BrowserNavigateTool) Name

func (t *BrowserNavigateTool) Name() string

type BrowserPageProvider

type BrowserPageProvider interface {
	GetPage(agentID string) (*rod.Page, error)
}

BrowserPageProvider abstracts the BrowserManager to avoid circular imports. The ratchetplugin package implements this via BrowserManager.

type BrowserScreenshotTool

type BrowserScreenshotTool struct {
	Manager BrowserPageProvider
}

BrowserScreenshotTool captures a screenshot of the agent's current browser page.

func (*BrowserScreenshotTool) Definition

func (t *BrowserScreenshotTool) Definition() provider.ToolDef

func (*BrowserScreenshotTool) Description

func (t *BrowserScreenshotTool) Description() string

func (*BrowserScreenshotTool) Execute

func (t *BrowserScreenshotTool) Execute(ctx context.Context, _ map[string]any) (any, error)

func (*BrowserScreenshotTool) Name

func (t *BrowserScreenshotTool) Name() string

type CheckHumanRequestTool

type CheckHumanRequestTool struct {
	Manager HumanRequestChecker
}

CheckHumanRequestTool checks the status of a previously created human request.

func (*CheckHumanRequestTool) Definition

func (t *CheckHumanRequestTool) Definition() provider.ToolDef

func (*CheckHumanRequestTool) Description

func (t *CheckHumanRequestTool) Description() string

func (*CheckHumanRequestTool) Execute

func (t *CheckHumanRequestTool) Execute(ctx context.Context, args map[string]any) (any, error)

func (*CheckHumanRequestTool) Name

func (t *CheckHumanRequestTool) Name() string

type CodeComplexityTool

type CodeComplexityTool struct{}

CodeComplexityTool analyzes Go code complexity and identifies tech debt markers.

func (*CodeComplexityTool) Definition

func (t *CodeComplexityTool) Definition() provider.ToolDef

func (*CodeComplexityTool) Description

func (t *CodeComplexityTool) Description() string

func (*CodeComplexityTool) Execute

func (t *CodeComplexityTool) Execute(ctx context.Context, args map[string]any) (any, error)

func (*CodeComplexityTool) Name

func (t *CodeComplexityTool) Name() string

type CodeDiffReviewTool

type CodeDiffReviewTool struct{}

CodeDiffReviewTool runs git diff between two refs and structures the output.

func (*CodeDiffReviewTool) Definition

func (t *CodeDiffReviewTool) Definition() provider.ToolDef

func (*CodeDiffReviewTool) Description

func (t *CodeDiffReviewTool) Description() string

func (*CodeDiffReviewTool) Execute

func (t *CodeDiffReviewTool) Execute(ctx context.Context, args map[string]any) (any, error)

func (*CodeDiffReviewTool) Name

func (t *CodeDiffReviewTool) Name() string

type CodeReviewTool

type CodeReviewTool struct{}

CodeReviewTool runs golangci-lint on a Go project and returns structured findings.

func (*CodeReviewTool) Definition

func (t *CodeReviewTool) Definition() provider.ToolDef

func (*CodeReviewTool) Description

func (t *CodeReviewTool) Description() string

func (*CodeReviewTool) Execute

func (t *CodeReviewTool) Execute(ctx context.Context, args map[string]any) (any, error)

func (*CodeReviewTool) Name

func (t *CodeReviewTool) Name() string

type ComplianceReportTool

type ComplianceReportTool struct {
	// RunAudit is a callback injected at registration time.
	RunAudit func(ctx context.Context) (map[string]any, error)
}

ComplianceReportTool maps security audit findings to compliance framework controls.

func (*ComplianceReportTool) Definition

func (t *ComplianceReportTool) Definition() provider.ToolDef

func (*ComplianceReportTool) Description

func (t *ComplianceReportTool) Description() string

func (*ComplianceReportTool) Execute

func (t *ComplianceReportTool) Execute(ctx context.Context, args map[string]any) (any, error)

func (*ComplianceReportTool) Name

func (t *ComplianceReportTool) Name() string

type ContainerExecer

type ContainerExecer interface {
	ExecInContainer(ctx context.Context, projectID, command, workDir string, timeout int) (stdout, stderr string, exitCode int, err error)
}

ContainerExecer is the interface for executing commands in a container. This avoids a circular dependency on the ContainerManager type.

type DBAnalyzeTool

type DBAnalyzeTool struct {
	DB *sql.DB
}

DBAnalyzeTool runs EXPLAIN QUERY PLAN on SQL queries for optimization analysis.

func (*DBAnalyzeTool) Definition

func (t *DBAnalyzeTool) Definition() provider.ToolDef

func (*DBAnalyzeTool) Description

func (t *DBAnalyzeTool) Description() string

func (*DBAnalyzeTool) Execute

func (t *DBAnalyzeTool) Execute(_ context.Context, args map[string]any) (any, error)

func (*DBAnalyzeTool) Name

func (t *DBAnalyzeTool) Name() string

type DBHealthCheckTool

type DBHealthCheckTool struct {
	DB *sql.DB
}

DBHealthCheckTool checks SQLite database health metrics.

func (*DBHealthCheckTool) Definition

func (t *DBHealthCheckTool) Definition() provider.ToolDef

func (*DBHealthCheckTool) Description

func (t *DBHealthCheckTool) Description() string

func (*DBHealthCheckTool) Execute

func (t *DBHealthCheckTool) Execute(_ context.Context, _ map[string]any) (any, error)

func (*DBHealthCheckTool) Name

func (t *DBHealthCheckTool) Name() string

type DBQueryExternalTool

type DBQueryExternalTool struct{}

DBQueryExternalTool allows agents to query external databases (SELECT only).

func (*DBQueryExternalTool) Definition

func (t *DBQueryExternalTool) Definition() provider.ToolDef

func (*DBQueryExternalTool) Description

func (t *DBQueryExternalTool) Description() string

func (*DBQueryExternalTool) Execute

func (t *DBQueryExternalTool) Execute(ctx context.Context, args map[string]any) (any, error)

func (*DBQueryExternalTool) Name

func (t *DBQueryExternalTool) Name() string

type DataProfileTool

type DataProfileTool struct {
	DB *sql.DB
}

DataProfileTool computes null rates, distinct counts, and numeric/text statistics for each column in a table using a sample of rows.

func (*DataProfileTool) Definition

func (t *DataProfileTool) Definition() provider.ToolDef

func (*DataProfileTool) Description

func (t *DataProfileTool) Description() string

func (*DataProfileTool) Execute

func (t *DataProfileTool) Execute(_ context.Context, args map[string]any) (any, error)

func (*DataProfileTool) Name

func (t *DataProfileTool) Name() string

type DeploymentStatusTool

type DeploymentStatusTool struct{}

DeploymentStatusTool returns a structured rollout status for a Kubernetes Deployment.

func (*DeploymentStatusTool) Definition

func (t *DeploymentStatusTool) Definition() provider.ToolDef

func (*DeploymentStatusTool) Description

func (t *DeploymentStatusTool) Description() string

func (*DeploymentStatusTool) Execute

func (t *DeploymentStatusTool) Execute(ctx context.Context, args map[string]any) (any, error)

func (*DeploymentStatusTool) Name

func (t *DeploymentStatusTool) Name() string

type FileListTool

type FileListTool struct {
	Workspace string
}

FileListTool lists files in the project workspace.

func (*FileListTool) Definition

func (t *FileListTool) Definition() provider.ToolDef

func (*FileListTool) Description

func (t *FileListTool) Description() string

func (*FileListTool) Execute

func (t *FileListTool) Execute(ctx context.Context, args map[string]any) (any, error)

func (*FileListTool) Name

func (t *FileListTool) Name() string

type FileReadTool

type FileReadTool struct {
	Workspace string
}

FileReadTool reads a file from the project workspace.

func (*FileReadTool) Definition

func (t *FileReadTool) Definition() provider.ToolDef

func (*FileReadTool) Description

func (t *FileReadTool) Description() string

func (*FileReadTool) Execute

func (t *FileReadTool) Execute(ctx context.Context, args map[string]any) (any, error)

func (*FileReadTool) Name

func (t *FileReadTool) Name() string

type FileWriteTool

type FileWriteTool struct {
	Workspace string
}

FileWriteTool writes a file to the project workspace.

func (*FileWriteTool) Definition

func (t *FileWriteTool) Definition() provider.ToolDef

func (*FileWriteTool) Description

func (t *FileWriteTool) Description() string

func (*FileWriteTool) Execute

func (t *FileWriteTool) Execute(ctx context.Context, args map[string]any) (any, error)

func (*FileWriteTool) Name

func (t *FileWriteTool) Name() string

type GitCloneTool

type GitCloneTool struct {
	Workspace string
}

GitCloneTool clones a git repository into the workspace.

func (*GitCloneTool) Definition

func (t *GitCloneTool) Definition() provider.ToolDef

func (*GitCloneTool) Description

func (t *GitCloneTool) Description() string

func (*GitCloneTool) Execute

func (t *GitCloneTool) Execute(ctx context.Context, args map[string]any) (any, error)

func (*GitCloneTool) Name

func (t *GitCloneTool) Name() string

type GitCommitTool

type GitCommitTool struct {
	Workspace string
}

GitCommitTool stages files and creates a commit.

func (*GitCommitTool) Definition

func (t *GitCommitTool) Definition() provider.ToolDef

func (*GitCommitTool) Description

func (t *GitCommitTool) Description() string

func (*GitCommitTool) Execute

func (t *GitCommitTool) Execute(ctx context.Context, args map[string]any) (any, error)

func (*GitCommitTool) Name

func (t *GitCommitTool) Name() string

type GitDiffTool

type GitDiffTool struct {
	Workspace string
}

GitDiffTool shows changes in the working tree.

func (*GitDiffTool) Definition

func (t *GitDiffTool) Definition() provider.ToolDef

func (*GitDiffTool) Description

func (t *GitDiffTool) Description() string

func (*GitDiffTool) Execute

func (t *GitDiffTool) Execute(ctx context.Context, args map[string]any) (any, error)

func (*GitDiffTool) Name

func (t *GitDiffTool) Name() string

type GitLogStatsTool

type GitLogStatsTool struct{}

GitLogStatsTool analyses git history to find commit frequency, hotspot files, and top contributors over a configurable number of days.

func (*GitLogStatsTool) Definition

func (t *GitLogStatsTool) Definition() provider.ToolDef

func (*GitLogStatsTool) Description

func (t *GitLogStatsTool) Description() string

func (*GitLogStatsTool) Execute

func (t *GitLogStatsTool) Execute(ctx context.Context, args map[string]any) (any, error)

func (*GitLogStatsTool) Name

func (t *GitLogStatsTool) Name() string

type GitPRCreateTool

type GitPRCreateTool struct{}

GitPRCreateTool creates a GitHub pull request.

func (*GitPRCreateTool) Definition

func (t *GitPRCreateTool) Definition() provider.ToolDef

func (*GitPRCreateTool) Description

func (t *GitPRCreateTool) Description() string

func (*GitPRCreateTool) Execute

func (t *GitPRCreateTool) Execute(ctx context.Context, params map[string]any) (any, error)

func (*GitPRCreateTool) Name

func (t *GitPRCreateTool) Name() string

type GitPushTool

type GitPushTool struct {
	Workspace string
}

GitPushTool pushes commits to a remote.

func (*GitPushTool) Definition

func (t *GitPushTool) Definition() provider.ToolDef

func (*GitPushTool) Description

func (t *GitPushTool) Description() string

func (*GitPushTool) Execute

func (t *GitPushTool) Execute(ctx context.Context, args map[string]any) (any, error)

func (*GitPushTool) Name

func (t *GitPushTool) Name() string

type GitStatusTool

type GitStatusTool struct {
	Workspace string
}

GitStatusTool runs git status in a directory.

func (*GitStatusTool) Definition

func (t *GitStatusTool) Definition() provider.ToolDef

func (*GitStatusTool) Description

func (t *GitStatusTool) Description() string

func (*GitStatusTool) Execute

func (t *GitStatusTool) Execute(ctx context.Context, args map[string]any) (any, error)

func (*GitStatusTool) Name

func (t *GitStatusTool) Name() string

type HumanRequestChecker

type HumanRequestChecker interface {
	GetRequest(ctx context.Context, id string) (map[string]any, error)
}

HumanRequestChecker is the interface needed by CheckHumanRequestTool to check request status.

type HumanRequestCreator

type HumanRequestCreator interface {
	CreateRequest(ctx context.Context, agentID, taskID, projectID, reqType, title, desc, urgency, metadata string) (string, error)
}

HumanRequestCreator is the interface needed by RequestHumanTool to create requests.

type InfraHealthCheckTool

type InfraHealthCheckTool struct{}

InfraHealthCheckTool runs an aggregate health check across all namespaces and returns a summarized health score and list of detected issues.

func (*InfraHealthCheckTool) Definition

func (t *InfraHealthCheckTool) Definition() provider.ToolDef

func (*InfraHealthCheckTool) Description

func (t *InfraHealthCheckTool) Description() string

func (*InfraHealthCheckTool) Execute

func (t *InfraHealthCheckTool) Execute(ctx context.Context, args map[string]any) (any, error)

func (*InfraHealthCheckTool) Name

func (t *InfraHealthCheckTool) Name() string

type K8sApplyTool

type K8sApplyTool struct{}

K8sApplyTool applies a Kubernetes manifest from a YAML string (requires approval).

func (*K8sApplyTool) Definition

func (t *K8sApplyTool) Definition() provider.ToolDef

func (*K8sApplyTool) Description

func (t *K8sApplyTool) Description() string

func (*K8sApplyTool) Execute

func (t *K8sApplyTool) Execute(ctx context.Context, args map[string]any) (any, error)

func (*K8sApplyTool) Name

func (t *K8sApplyTool) Name() string

type K8sDescribeTool

type K8sDescribeTool struct{}

K8sDescribeTool describes any Kubernetes resource.

func (*K8sDescribeTool) Definition

func (t *K8sDescribeTool) Definition() provider.ToolDef

func (*K8sDescribeTool) Description

func (t *K8sDescribeTool) Description() string

func (*K8sDescribeTool) Execute

func (t *K8sDescribeTool) Execute(ctx context.Context, args map[string]any) (any, error)

func (*K8sDescribeTool) Name

func (t *K8sDescribeTool) Name() string

type K8sGetEventsTool

type K8sGetEventsTool struct{}

K8sGetEventsTool retrieves cluster events, filtered by namespace and optionally by type.

func (*K8sGetEventsTool) Definition

func (t *K8sGetEventsTool) Definition() provider.ToolDef

func (*K8sGetEventsTool) Description

func (t *K8sGetEventsTool) Description() string

func (*K8sGetEventsTool) Execute

func (t *K8sGetEventsTool) Execute(ctx context.Context, args map[string]any) (any, error)

func (*K8sGetEventsTool) Name

func (t *K8sGetEventsTool) Name() string

type K8sGetLogsTool

type K8sGetLogsTool struct{}

K8sGetLogsTool retrieves container logs from a pod.

func (*K8sGetLogsTool) Definition

func (t *K8sGetLogsTool) Definition() provider.ToolDef

func (*K8sGetLogsTool) Description

func (t *K8sGetLogsTool) Description() string

func (*K8sGetLogsTool) Execute

func (t *K8sGetLogsTool) Execute(ctx context.Context, args map[string]any) (any, error)

func (*K8sGetLogsTool) Name

func (t *K8sGetLogsTool) Name() string

type K8sGetPodsTool

type K8sGetPodsTool struct{}

K8sGetPodsTool lists pods in a namespace with status, restarts, and age.

func (*K8sGetPodsTool) Definition

func (t *K8sGetPodsTool) Definition() provider.ToolDef

func (*K8sGetPodsTool) Description

func (t *K8sGetPodsTool) Description() string

func (*K8sGetPodsTool) Execute

func (t *K8sGetPodsTool) Execute(ctx context.Context, args map[string]any) (any, error)

func (*K8sGetPodsTool) Name

func (t *K8sGetPodsTool) Name() string

type K8sRestartPodTool

type K8sRestartPodTool struct{}

K8sRestartPodTool deletes a pod to trigger a restart (requires approval). The Deployment controller recreates it automatically.

func (*K8sRestartPodTool) Definition

func (t *K8sRestartPodTool) Definition() provider.ToolDef

func (*K8sRestartPodTool) Description

func (t *K8sRestartPodTool) Description() string

func (*K8sRestartPodTool) Execute

func (t *K8sRestartPodTool) Execute(ctx context.Context, args map[string]any) (any, error)

func (*K8sRestartPodTool) Name

func (t *K8sRestartPodTool) Name() string

type K8sRollbackTool

type K8sRollbackTool struct{}

K8sRollbackTool rolls back a Deployment to the previous revision (requires approval).

func (*K8sRollbackTool) Definition

func (t *K8sRollbackTool) Definition() provider.ToolDef

func (*K8sRollbackTool) Description

func (t *K8sRollbackTool) Description() string

func (*K8sRollbackTool) Execute

func (t *K8sRollbackTool) Execute(ctx context.Context, args map[string]any) (any, error)

func (*K8sRollbackTool) Name

func (t *K8sRollbackTool) Name() string

type K8sScaleTool

type K8sScaleTool struct{}

K8sScaleTool scales a Deployment to a given replica count (requires approval).

func (*K8sScaleTool) Definition

func (t *K8sScaleTool) Definition() provider.ToolDef

func (*K8sScaleTool) Description

func (t *K8sScaleTool) Description() string

func (*K8sScaleTool) Execute

func (t *K8sScaleTool) Execute(ctx context.Context, args map[string]any) (any, error)

func (*K8sScaleTool) Name

func (t *K8sScaleTool) Name() string

type K8sTopTool

type K8sTopTool struct{}

K8sTopTool returns resource usage (CPU / memory) for pods or nodes.

func (*K8sTopTool) Definition

func (t *K8sTopTool) Definition() provider.ToolDef

func (*K8sTopTool) Description

func (t *K8sTopTool) Description() string

func (*K8sTopTool) Execute

func (t *K8sTopTool) Execute(ctx context.Context, args map[string]any) (any, error)

func (*K8sTopTool) Name

func (t *K8sTopTool) Name() string

type MemoryEntry

type MemoryEntry interface {
	GetID() string
	GetContent() string
	GetCategory() string
	GetCreatedAt() time.Time
}

MemoryEntry is the interface that memory store entries must satisfy.

type MemoryEntryResult

type MemoryEntryResult struct {
	ID        string    `json:"id"`
	Content   string    `json:"content"`
	Category  string    `json:"category"`
	CreatedAt time.Time `json:"created_at"`
}

MemoryEntryResult is a minimal view of a memory entry returned by tools.

type MemorySaveTool

type MemorySaveTool struct {
	Store   MemoryStoreSaver
	AgentID string // fallback if not in context
}

MemorySaveTool saves a new entry to an agent's persistent memory.

func (*MemorySaveTool) Definition

func (t *MemorySaveTool) Definition() provider.ToolDef

func (*MemorySaveTool) Description

func (t *MemorySaveTool) Description() string

func (*MemorySaveTool) Execute

func (t *MemorySaveTool) Execute(ctx context.Context, args map[string]any) (any, error)

func (*MemorySaveTool) Name

func (t *MemorySaveTool) Name() string

type MemorySearchTool

type MemorySearchTool struct {
	Store   MemoryStoreSearcher
	AgentID string // fallback if not in context
}

MemorySearchTool searches an agent's persistent memory.

func (*MemorySearchTool) Definition

func (t *MemorySearchTool) Definition() provider.ToolDef

func (*MemorySearchTool) Description

func (t *MemorySearchTool) Description() string

func (*MemorySearchTool) Execute

func (t *MemorySearchTool) Execute(ctx context.Context, args map[string]any) (any, error)

func (*MemorySearchTool) Name

func (t *MemorySearchTool) Name() string

type MemoryStoreSaver

type MemoryStoreSaver interface {
	SaveMemory(ctx context.Context, agentID, content, category string) error
}

MemoryStoreSaver can persist a memory entry.

type MemoryStoreSearcher

type MemoryStoreSearcher interface {
	SearchMemory(ctx context.Context, agentID, query string, limit int) ([]MemoryEntryResult, error)
}

MemoryStoreSearcher can search for agent memories.

type MessageSendTool

type MessageSendTool struct {
	DB *sql.DB
}

MessageSendTool sends a message to another agent.

func (*MessageSendTool) Definition

func (t *MessageSendTool) Definition() provider.ToolDef

func (*MessageSendTool) Description

func (t *MessageSendTool) Description() string

func (*MessageSendTool) Execute

func (t *MessageSendTool) Execute(ctx context.Context, args map[string]any) (any, error)

func (*MessageSendTool) Name

func (t *MessageSendTool) Name() string

type RequestApprovalTool

type RequestApprovalTool struct {
	Manager ApprovalCreator
}

RequestApprovalTool requests human approval before proceeding with a sensitive action.

func (*RequestApprovalTool) Definition

func (t *RequestApprovalTool) Definition() provider.ToolDef

func (*RequestApprovalTool) Description

func (t *RequestApprovalTool) Description() string

func (*RequestApprovalTool) Execute

func (t *RequestApprovalTool) Execute(ctx context.Context, args map[string]any) (any, error)

func (*RequestApprovalTool) Name

func (t *RequestApprovalTool) Name() string

type RequestHumanTool

type RequestHumanTool struct {
	Manager HumanRequestCreator
}

RequestHumanTool allows agents to request something from the human operator.

func (*RequestHumanTool) Definition

func (t *RequestHumanTool) Definition() provider.ToolDef

func (*RequestHumanTool) Description

func (t *RequestHumanTool) Description() string

func (*RequestHumanTool) Execute

func (t *RequestHumanTool) Execute(ctx context.Context, args map[string]any) (any, error)

func (*RequestHumanTool) Name

func (t *RequestHumanTool) Name() string

type SchemaInspectTool

type SchemaInspectTool struct {
	DB *sql.DB
}

SchemaInspectTool introspects the SQLite schema for tables, columns, indexes, foreign keys, and row counts.

func (*SchemaInspectTool) Definition

func (t *SchemaInspectTool) Definition() provider.ToolDef

func (*SchemaInspectTool) Description

func (t *SchemaInspectTool) Description() string

func (*SchemaInspectTool) Execute

func (t *SchemaInspectTool) Execute(_ context.Context, args map[string]any) (any, error)

func (*SchemaInspectTool) Name

func (t *SchemaInspectTool) Name() string

type SecretAuditTool

type SecretAuditTool struct {
	DB *sql.DB
}

SecretAuditTool checks for stale secrets in the database and environment.

func (*SecretAuditTool) Definition

func (t *SecretAuditTool) Definition() provider.ToolDef

func (*SecretAuditTool) Description

func (t *SecretAuditTool) Description() string

func (*SecretAuditTool) Execute

func (t *SecretAuditTool) Execute(_ context.Context, args map[string]any) (any, error)

func (*SecretAuditTool) Name

func (t *SecretAuditTool) Name() string

type SecurityScanTool

type SecurityScanTool struct {
	// RunAudit is a callback injected at registration time that calls SecurityAuditor.RunAll().
	// This avoids importing the full auditor into the tools package.
	RunAudit func(ctx context.Context) (map[string]any, error)
}

SecurityScanTool runs a platform security audit and returns structured findings.

func (*SecurityScanTool) Definition

func (t *SecurityScanTool) Definition() provider.ToolDef

func (*SecurityScanTool) Description

func (t *SecurityScanTool) Description() string

func (*SecurityScanTool) Execute

func (t *SecurityScanTool) Execute(ctx context.Context, _ map[string]any) (any, error)

func (*SecurityScanTool) Name

func (t *SecurityScanTool) Name() string

type SecurityScanURLTool

type SecurityScanURLTool struct{}

SecurityScanURLTool checks a URL for common security issues.

func (*SecurityScanURLTool) Definition

func (t *SecurityScanURLTool) Definition() provider.ToolDef

func (*SecurityScanURLTool) Description

func (t *SecurityScanURLTool) Description() string

func (*SecurityScanURLTool) Execute

func (t *SecurityScanURLTool) Execute(ctx context.Context, args map[string]any) (any, error)

func (*SecurityScanURLTool) Name

func (t *SecurityScanURLTool) Name() string

type ShellExecTool

type ShellExecTool struct {
	Workspace string
}

ShellExecTool executes a command in the project workspace.

func (*ShellExecTool) Definition

func (t *ShellExecTool) Definition() provider.ToolDef

func (*ShellExecTool) Description

func (t *ShellExecTool) Description() string

func (*ShellExecTool) Execute

func (t *ShellExecTool) Execute(ctx context.Context, args map[string]any) (any, error)

func (*ShellExecTool) Name

func (t *ShellExecTool) Name() string

type SubAgentSpawner

type SubAgentSpawner interface {
	Spawn(ctx context.Context, parentAgentID string, name string, taskDesc string, systemPrompt string) (taskID string, err error)
	CheckTask(ctx context.Context, taskID string) (status string, result string, err error)
	WaitTasks(ctx context.Context, taskIDs []string, timeout time.Duration) (map[string]SubTaskResult, error)
}

SubAgentSpawner is the interface the sub-agent tools use to spawn/check/wait tasks. It is satisfied by *ratchetplugin.SubAgentManager.

type SubTaskResult

type SubTaskResult struct {
	TaskID string
	Status string
	Result string
	Error  string
}

SubTaskResult mirrors the type in ratchetplugin to avoid an import cycle.

type TaskCreateTool

type TaskCreateTool struct {
	DB *sql.DB
}

TaskCreateTool creates a sub-task in the database.

func (*TaskCreateTool) Definition

func (t *TaskCreateTool) Definition() provider.ToolDef

func (*TaskCreateTool) Description

func (t *TaskCreateTool) Description() string

func (*TaskCreateTool) Execute

func (t *TaskCreateTool) Execute(ctx context.Context, args map[string]any) (any, error)

func (*TaskCreateTool) Name

func (t *TaskCreateTool) Name() string

type TaskUpdateTool

type TaskUpdateTool struct {
	DB *sql.DB
}

TaskUpdateTool updates a task's status in the database.

func (*TaskUpdateTool) Definition

func (t *TaskUpdateTool) Definition() provider.ToolDef

func (*TaskUpdateTool) Description

func (t *TaskUpdateTool) Description() string

func (*TaskUpdateTool) Execute

func (t *TaskUpdateTool) Execute(ctx context.Context, args map[string]any) (any, error)

func (*TaskUpdateTool) Name

func (t *TaskUpdateTool) Name() string

type TestCoverageTool

type TestCoverageTool struct{}

TestCoverageTool runs Go tests with coverage profiling and returns per-package coverage percentages along with an aggregate total.

func (*TestCoverageTool) Definition

func (t *TestCoverageTool) Definition() provider.ToolDef

func (*TestCoverageTool) Description

func (t *TestCoverageTool) Description() string

func (*TestCoverageTool) Execute

func (t *TestCoverageTool) Execute(ctx context.Context, args map[string]any) (any, error)

func (*TestCoverageTool) Name

func (t *TestCoverageTool) Name() string

type VulnCheckTool

type VulnCheckTool struct{}

VulnCheckTool runs govulncheck on a Go module to find known vulnerabilities.

func (*VulnCheckTool) Definition

func (t *VulnCheckTool) Definition() provider.ToolDef

func (*VulnCheckTool) Description

func (t *VulnCheckTool) Description() string

func (*VulnCheckTool) Execute

func (t *VulnCheckTool) Execute(ctx context.Context, args map[string]any) (any, error)

func (*VulnCheckTool) Name

func (t *VulnCheckTool) Name() string

type WebFetchTool

type WebFetchTool struct{}

WebFetchTool performs HTTP GET requests.

func (*WebFetchTool) Definition

func (t *WebFetchTool) Definition() provider.ToolDef

func (*WebFetchTool) Description

func (t *WebFetchTool) Description() string

func (*WebFetchTool) Execute

func (t *WebFetchTool) Execute(ctx context.Context, args map[string]any) (any, error)

func (*WebFetchTool) Name

func (t *WebFetchTool) Name() string

Jump to

Keyboard shortcuts

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