tool

package
v0.14.3 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2026 License: MIT Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CanonicalToolName

func CanonicalToolName(name string) string

func IsExecToolName

func IsExecToolName(name string) bool

func ToolNameAliases

func ToolNameAliases() map[string]string

Types

type ContentBlock

type ContentBlock struct {
	Type string `json:"type"`
	Text string `json:"text"`
}

type HeartbeatRunResult

type HeartbeatRunResult struct {
	Response     string    `json:"response,omitempty"`
	Skipped      bool      `json:"skipped,omitempty"`
	SkipReason   string    `json:"skip_reason,omitempty"`
	Logged       bool      `json:"logged,omitempty"`
	Acknowledged bool      `json:"acknowledged,omitempty"`
	RanAt        time.Time `json:"ran_at,omitempty"`
}

type HeartbeatStatus

type HeartbeatStatus struct {
	Configured       bool   `json:"configured"`
	ActiveHours      string `json:"active_hours,omitempty"`
	Timezone         string `json:"timezone,omitempty"`
	ChatBusy         bool   `json:"chat_busy,omitempty"`
	LastRunAt        string `json:"last_run_at,omitempty"`
	LastSkipped      bool   `json:"last_skipped,omitempty"`
	LastSkipReason   string `json:"last_skip_reason,omitempty"`
	LastLogged       bool   `json:"last_logged,omitempty"`
	LastAcknowledged bool   `json:"last_acknowledged,omitempty"`
	LastResponse     string `json:"last_response,omitempty"`
	LastError        string `json:"last_error,omitempty"`
}

type ProcessManager

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

func NewProcessManager

func NewProcessManager() *ProcessManager

func (*ProcessManager) ClearDone

func (m *ProcessManager) ClearDone() int

func (*ProcessManager) Kill

func (m *ProcessManager) Kill(sessionID string) (ProcessSnapshot, error)

func (*ProcessManager) List

func (m *ProcessManager) List() []ProcessSnapshot

func (*ProcessManager) Log

func (m *ProcessManager) Log(sessionID string) (ProcessSnapshot, error)

func (*ProcessManager) Poll

func (m *ProcessManager) Poll(sessionID string) (ProcessSnapshot, error)

func (*ProcessManager) Remove

func (m *ProcessManager) Remove(sessionID string) error

func (*ProcessManager) Start

func (m *ProcessManager) Start(ctx context.Context, workspaceDir, commandLine string, timeoutMS int) (ProcessSnapshot, error)

func (*ProcessManager) Write

func (m *ProcessManager) Write(sessionID string, chars string) (ProcessSnapshot, error)

type ProcessSnapshot

type ProcessSnapshot struct {
	SessionID   string `json:"session_id"`
	Command     string `json:"command"`
	Running     bool   `json:"running"`
	Done        bool   `json:"done"`
	ExitCode    int    `json:"exit_code,omitempty"`
	StartedAt   string `json:"started_at,omitempty"`
	CompletedAt string `json:"completed_at,omitempty"`
	Stdout      string `json:"stdout,omitempty"`
	Stderr      string `json:"stderr,omitempty"`
	Message     string `json:"message,omitempty"`
}

type Registry

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

func NewRegistry

func NewRegistry() *Registry

func (*Registry) All

func (r *Registry) All() []Tool

func (*Registry) Get

func (r *Registry) Get(name string) (Tool, bool)

func (*Registry) Register

func (r *Registry) Register(t Tool)

func (*Registry) Schemas

func (r *Registry) Schemas() []llm.ToolSchema

func (*Registry) SchemasForNames

func (r *Registry) SchemasForNames(names []string) []llm.ToolSchema

type Result

type Result struct {
	Content []ContentBlock `json:"content"`
	IsError bool           `json:"is_error,omitempty"`
}

func (Result) Text

func (r Result) Text() string

type SessionStatus

type SessionStatus struct {
	SessionID       string `json:"session_id"`
	HistoryMessages int    `json:"history_messages"`
}

type TelegramDefaultChatIDResolveFunc

type TelegramDefaultChatIDResolveFunc func(ctx context.Context) (string, error)

func (TelegramDefaultChatIDResolveFunc) ResolveDefaultChatID

func (f TelegramDefaultChatIDResolveFunc) ResolveDefaultChatID(ctx context.Context) (string, error)

type TelegramDefaultChatIDResolver

type TelegramDefaultChatIDResolver interface {
	ResolveDefaultChatID(ctx context.Context) (string, error)
}

type TelegramSendFunc

type TelegramSendFunc func(ctx context.Context, req TelegramSendRequest) (TelegramSendResult, error)

func (TelegramSendFunc) Send

type TelegramSendRequest

type TelegramSendRequest struct {
	BotID     string
	ChatID    string
	Text      string
	ThreadID  string
	ParseMode string
}

type TelegramSendResult

type TelegramSendResult struct {
	MessageID int64  `json:"message_id"`
	ChatID    string `json:"chat_id"`
	Text      string `json:"text"`
}

type TelegramSender

type TelegramSender interface {
	Send(ctx context.Context, req TelegramSendRequest) (TelegramSendResult, error)
}

type Tool

type Tool struct {
	Name        string
	Description string
	Parameters  json.RawMessage
	Execute     func(ctx context.Context, params json.RawMessage) (Result, error)
}

func NewAgentsListTool

func NewAgentsListTool(runtime *gateway.Runtime) Tool

func NewApplyPatchTool

func NewApplyPatchTool(workspaceDir string, enabled bool) Tool

func NewBrowserTool

func NewBrowserTool(runtime *gateway.Runtime, enabled bool) Tool

func NewCronCreateTool

func NewCronCreateTool(store *cron.Store) Tool

func NewCronDeleteTool

func NewCronDeleteTool(store *cron.Store) Tool

func NewCronGetTool

func NewCronGetTool(store *cron.Store) Tool

func NewCronListTool

func NewCronListTool(store *cron.Store) Tool

func NewCronRunTool

func NewCronRunTool(store *cron.Store, runJob func(ctx context.Context, job cron.Job) (string, error)) Tool

func NewCronRunsTool

func NewCronRunsTool(store *cron.Store) Tool

func NewCronTool

func NewCronTool(store *cron.Store, runJob func(ctx context.Context, job cron.Job) (string, error)) Tool

func NewCronUpdateTool

func NewCronUpdateTool(store *cron.Store) Tool

func NewEditFileTool

func NewEditFileTool(workspaceDir string) Tool

func NewEditTool

func NewEditTool(workspaceDir string) Tool

func NewExecTool

func NewExecTool(workspaceDir string) Tool

func NewExecToolWithManager

func NewExecToolWithManager(workspaceDir string, manager *ProcessManager) Tool

func NewGatewayTool

func NewGatewayTool(runtime *gateway.Runtime, enabled bool) Tool

func NewGlobTool

func NewGlobTool(workspaceDir string) Tool

func NewHeartbeatRunOnceTool

func NewHeartbeatRunOnceTool(runOnce func(ctx context.Context) (HeartbeatRunResult, error)) Tool

func NewHeartbeatStatusTool

func NewHeartbeatStatusTool(getStatus func(ctx context.Context) (HeartbeatStatus, error)) Tool

func NewHeartbeatTool

func NewHeartbeatTool(
	getStatus func(ctx context.Context) (HeartbeatStatus, error),
	runOnce func(ctx context.Context) (HeartbeatRunResult, error),
) Tool

func NewListDirTool

func NewListDirTool(workspaceDir string) Tool

func NewMemoryGetTool

func NewMemoryGetTool(workspaceDir string) Tool

func NewMemorySaveTool

func NewMemorySaveTool(workspaceDir string, semantic *memory.Service, nowFn func() time.Time) Tool

func NewMemorySearchTool

func NewMemorySearchTool(workspaceDir string, semantic *memory.Service) Tool

func NewMessageTool

func NewMessageTool(runtime *gateway.Runtime, enabled bool) Tool

func NewNodesTool

func NewNodesTool(runtime *gateway.Runtime, enabled bool) Tool

func NewOpsCleanupApplyTool

func NewOpsCleanupApplyTool(manager *ops.Manager) Tool

func NewOpsCleanupPlanTool

func NewOpsCleanupPlanTool(manager *ops.Manager) Tool

func NewOpsStatusTool

func NewOpsStatusTool(manager *ops.Manager) Tool

func NewProcessTool

func NewProcessTool(manager *ProcessManager) Tool

func NewProjectActivateTool

func NewProjectActivateTool(store *project.Store, sessionStore *session.Store, mainSessionID string) Tool

func NewProjectActivityAppendTool added in v0.4.0

func NewProjectActivityAppendTool(store *project.Store) Tool

func NewProjectActivityGetTool added in v0.4.0

func NewProjectActivityGetTool(store *project.Store) Tool

func NewProjectAutopilotAdvanceTool added in v0.12.0

func NewProjectAutopilotAdvanceTool(manager projectAutopilotAdvancer) Tool

func NewProjectAutopilotStartTool added in v0.4.0

func NewProjectAutopilotStartTool(manager projectAutopilotStarter) Tool

func NewProjectBoardGetTool added in v0.4.0

func NewProjectBoardGetTool(store *project.Store) Tool

func NewProjectBoardUpdateTool added in v0.4.0

func NewProjectBoardUpdateTool(store *project.Store) Tool

func NewProjectBriefFinalizeTool

func NewProjectBriefFinalizeTool(store *project.Store, sessionStore *session.Store) Tool

func NewProjectBriefGetTool

func NewProjectBriefGetTool(store *project.Store) Tool

func NewProjectBriefUpdateTool

func NewProjectBriefUpdateTool(store *project.Store) Tool

func NewProjectCreateTool

func NewProjectCreateTool(store *project.Store) Tool

func NewProjectDeleteTool

func NewProjectDeleteTool(store *project.Store) Tool

func NewProjectDispatchTool added in v0.4.0

func NewProjectDispatchTool(store *project.Store, runner project.TaskRunner, checker project.GitHubAuthChecker) Tool

func NewProjectGetTool

func NewProjectGetTool(store *project.Store) Tool

func NewProjectListTool

func NewProjectListTool(store *project.Store) Tool

func NewProjectStateGetTool

func NewProjectStateGetTool(store *project.Store) Tool

func NewProjectStateUpdateTool

func NewProjectStateUpdateTool(store *project.Store) Tool

func NewProjectUpdateTool

func NewProjectUpdateTool(store *project.Store) Tool

func NewReadFileTool

func NewReadFileTool(workspaceDir string) Tool

func NewReadTool

func NewReadTool(workspaceDir string) Tool

func NewResearchReportTool

func NewResearchReportTool(service *research.Service) Tool

func NewScheduleCompleteTool

func NewScheduleCompleteTool(store *schedule.Store) Tool

func NewScheduleCreateTool

func NewScheduleCreateTool(store *schedule.Store) Tool

func NewScheduleDeleteTool

func NewScheduleDeleteTool(store *schedule.Store) Tool

func NewScheduleListTool

func NewScheduleListTool(store *schedule.Store) Tool

func NewScheduleUpdateTool

func NewScheduleUpdateTool(store *schedule.Store) Tool

func NewSessionStatusTool

func NewSessionStatusTool(getStatus func(ctx context.Context) (SessionStatus, error)) Tool

func NewSessionsHistoryTool

func NewSessionsHistoryTool(store *session.Store) Tool

func NewSessionsListTool

func NewSessionsListTool(store *session.Store) Tool

func NewSessionsRunsTool

func NewSessionsRunsTool(runtime *gateway.Runtime) Tool

func NewSessionsSendTool

func NewSessionsSendTool(runtime *gateway.Runtime) Tool

func NewSessionsSpawnTool

func NewSessionsSpawnTool(runtime *gateway.Runtime) Tool

func NewSubagentsRunTool added in v0.10.0

func NewSubagentsRunTool(runtime *gateway.Runtime) Tool

func NewTelegramSendTool

func NewTelegramSendTool(sender TelegramSender, enabled bool, resolver TelegramDefaultChatIDResolver) Tool

func NewUsageReportTool

func NewUsageReportTool(tracker *usage.Tracker) Tool

func NewWebFetchTool

func NewWebFetchTool(enabled bool) Tool

func NewWebFetchToolWithOptions

func NewWebFetchToolWithOptions(opts WebFetchOptions) Tool

func NewWebSearchTool

func NewWebSearchTool(enabled bool, apiKey string) Tool

func NewWebSearchToolWithOptions

func NewWebSearchToolWithOptions(opts WebSearchOptions) Tool

func NewWriteFileTool

func NewWriteFileTool(workspaceDir string) Tool

func NewWriteTool

func NewWriteTool(workspaceDir string) Tool

type WebFetchOptions

type WebFetchOptions struct {
	Enabled              bool
	AllowPrivateHosts    bool
	PrivateHostAllowlist []string
	HTTPClient           *http.Client
}

type WebSearchOptions

type WebSearchOptions struct {
	Enabled           bool
	Provider          string
	BraveAPIKey       string
	BraveBaseURL      string
	PerplexityAPIKey  string
	PerplexityModel   string
	PerplexityBaseURL string
	CacheTTL          time.Duration
	HTTPClient        *http.Client
}

Jump to

Keyboard shortcuts

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