actions

package
v0.0.0-...-cfdefcd Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2026 License: MIT Imports: 35 Imported by: 0

Documentation

Overview

Package actions contains action implementations used by LocalAGI. This file implements the "webhook" action which can send an HTTP request to an external service with a configurable method, content type, and payload.

Index

Constants

View Source
const (
	MetadataBrowserAgentHistory = "browser_agent_history"
)
View Source
const (
	MetadataDeepResearchResult = "deep_research_result"
)
View Source
const (
	MetadataImages = "images_url"
)
View Source
const (
	MetadataTelegramMessageSent = "telegram_message_sent"
)
View Source
const (
	MetadataUrls = "urls"
)

Variables

This section is empty.

Functions

func AddToMemoryConfigMeta

func AddToMemoryConfigMeta() []config.Field

AddToMemoryConfigMeta returns the metadata for AddToMemory action configuration fields

func BrowserAgentRunnerConfigMeta

func BrowserAgentRunnerConfigMeta() []config.Field

BrowserAgentRunnerConfigMeta returns the metadata for Browser Agent Runner action configuration fields

func CallAgentConfigMeta

func CallAgentConfigMeta() []config.Field

func DeepResearchRunnerConfigMeta

func DeepResearchRunnerConfigMeta() []config.Field

DeepResearchRunnerConfigMeta returns the metadata for Deep Research Runner action configuration fields

func GenImageConfigMeta

func GenImageConfigMeta() []config.Field

GenImageConfigMeta returns the metadata for GenImage action configuration fields

func GithubIssueCloserConfigMeta

func GithubIssueCloserConfigMeta() []config.Field

GithubIssueCloserConfigMeta returns the metadata for GitHub Issue Closer action configuration fields

func GithubIssueCommenterConfigMeta

func GithubIssueCommenterConfigMeta() []config.Field

GithubIssueCommenterConfigMeta returns the metadata for GitHub Issue Commenter action configuration fields

func GithubIssueEditorConfigMeta

func GithubIssueEditorConfigMeta() []config.Field

GithubIssueEditorConfigMeta returns the metadata for GitHub Issue Editor action configuration fields

func GithubIssueLabelerConfigMeta

func GithubIssueLabelerConfigMeta() []config.Field

GithubIssueLabelerConfigMeta returns the metadata for GitHub Issue Labeler action configuration fields

func GithubIssueOpenerConfigMeta

func GithubIssueOpenerConfigMeta() []config.Field

GithubIssueOpenerConfigMeta returns the metadata for GitHub Issue Opener action configuration fields

func GithubIssueReaderConfigMeta

func GithubIssueReaderConfigMeta() []config.Field

GithubIssueReaderConfigMeta returns the metadata for GitHub Issue Reader action configuration fields

func GithubIssueSearchConfigMeta

func GithubIssueSearchConfigMeta() []config.Field

GithubIssueSearchConfigMeta returns the metadata for GitHub Issue Search action configuration fields

func GithubPRCommenterConfigMeta

func GithubPRCommenterConfigMeta() []config.Field

GithubPRCommenterConfigMeta returns the metadata for GitHub PR Commenter action configuration fields

func GithubPRCreatorConfigMeta

func GithubPRCreatorConfigMeta() []config.Field

GithubPRCreatorConfigMeta returns the metadata for GitHub PR Creator action configuration fields

func GithubPRReaderConfigMeta

func GithubPRReaderConfigMeta() []config.Field

GithubPRReaderConfigMeta returns the metadata for GitHub PR Reader action configuration fields

func GithubPRReviewerConfigMeta

func GithubPRReviewerConfigMeta() []config.Field

GithubPRReviewerConfigMeta returns the metadata for GitHub PR Reviewer action configuration fields

func GithubRepositoryCreateOrUpdateContentConfigMeta

func GithubRepositoryCreateOrUpdateContentConfigMeta() []config.Field

GithubRepositoryCreateOrUpdateContentConfigMeta returns the metadata for GitHub Repository Create/Update Content action configuration fields

func GithubRepositoryGetAllContentConfigMeta

func GithubRepositoryGetAllContentConfigMeta() []config.Field

GithubRepositoryGetAllContentConfigMeta returns the metadata for GitHub Repository Get All Content action configuration fields

func GithubRepositoryGetContentConfigMeta

func GithubRepositoryGetContentConfigMeta() []config.Field

GithubRepositoryGetContentConfigMeta returns the metadata for GitHub Repository Get Content action configuration fields

func GithubRepositoryListFilesConfigMeta

func GithubRepositoryListFilesConfigMeta() []config.Field

GithubRepositoryListFilesConfigMeta returns the metadata for GitHub Repository List Files action configuration fields

func GithubRepositoryREADMEConfigMeta

func GithubRepositoryREADMEConfigMeta() []config.Field

GithubRepositoryREADMEConfigMeta returns the metadata for GitHub Repository README action configuration fields

func GithubRepositorySearchFilesConfigMeta

func GithubRepositorySearchFilesConfigMeta() []config.Field

GithubRepositorySearchFilesConfigMeta returns the metadata for GitHub Repository Search Files action configuration fields

func ListMemoryConfigMeta

func ListMemoryConfigMeta() []config.Field

ListMemoryConfigMeta returns the metadata for ListMemory action configuration fields

func NewMemoryActions

func NewMemoryActions(filePath string, config map[string]string) (*AddToMemoryAction, *ListMemoryAction, *RemoveFromMemoryAction)

NewMemoryActions returns the three actions, using the provided filePath and config

func PiKVMConfigMeta

func PiKVMConfigMeta() []config.Field

PiKVMConfigMeta returns the metadata for PiKVM action configuration fields

func RemoveFromMemoryConfigMeta

func RemoveFromMemoryConfigMeta() []config.Field

RemoveFromMemoryConfigMeta returns the metadata for RemoveFromMemory action configuration fields

func SearchConfigMeta

func SearchConfigMeta() []config.Field

SearchConfigMeta returns the metadata for Search action configuration fields

func SendMailConfigMeta

func SendMailConfigMeta() []config.Field

SendMailConfigMeta returns the metadata for SendMail action configuration fields

func SendTelegramMessageConfigMeta

func SendTelegramMessageConfigMeta() []config.Field

SendTelegramMessageConfigMeta returns the metadata for Send Telegram Message action configuration fields

func ShellConfigMeta

func ShellConfigMeta() []config.Field

ShellConfigMeta returns the metadata for Shell action configuration fields

func TwitterPostConfigMeta

func TwitterPostConfigMeta() []config.Field

TwitterPostConfigMeta returns the metadata for Twitter Post action configuration fields

func WebhookConfigMeta

func WebhookConfigMeta() []config.Field

WebhookConfigMeta returns the metadata for Webhook action configuration fields:

  • url: The endpoint to send requests to (required).
  • method: One of GET/POST/PUT/DELETE. Defaults to POST.
  • contentType: Common content types selectable from a dropdown.
  • payloadTemplate: Optional body template. At runtime, "{{payload}}" is replaced by the provided payload parameter. If missing, the template is used as-is; for GET, no body is sent regardless.

Types

type AddToMemoryAction

type AddToMemoryAction struct{ *MemoryActions }

func (*AddToMemoryAction) Definition

func (a *AddToMemoryAction) Definition() types.ActionDefinition

func (*AddToMemoryAction) Plannable

func (a *AddToMemoryAction) Plannable() bool

func (*AddToMemoryAction) Run

type BrowseAction

type BrowseAction struct{}

func NewBrowse

func NewBrowse(config map[string]string) *BrowseAction

func (*BrowseAction) Definition

func (a *BrowseAction) Definition() types.ActionDefinition

func (*BrowseAction) Plannable

func (a *BrowseAction) Plannable() bool

func (*BrowseAction) Run

type BrowserAgentRunner

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

func NewBrowserAgentRunner

func NewBrowserAgentRunner(config map[string]string, defaultURL string) *BrowserAgentRunner

func (*BrowserAgentRunner) Definition

func (b *BrowserAgentRunner) Definition() types.ActionDefinition

func (*BrowserAgentRunner) Plannable

func (a *BrowserAgentRunner) Plannable() bool

func (*BrowserAgentRunner) Run

type CallAgentAction

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

func NewCallAgent

func NewCallAgent(config map[string]string, agentName string, pool *state.AgentPoolInternalAPI) *CallAgentAction

func (*CallAgentAction) Definition

func (a *CallAgentAction) Definition() types.ActionDefinition

func (*CallAgentAction) Plannable

func (a *CallAgentAction) Plannable() bool

func (*CallAgentAction) Run

type CounterAction

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

CounterAction manages named counters that can be created, updated, and queried

func NewCounter

func NewCounter(config map[string]string) *CounterAction

NewCounter creates a new counter action

func (*CounterAction) Definition

func (a *CounterAction) Definition() types.ActionDefinition

Definition returns the action definition

func (*CounterAction) Plannable

func (a *CounterAction) Plannable() bool

func (*CounterAction) Run

Run executes the counter action

type DeepResearchRunner

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

func NewDeepResearchRunner

func NewDeepResearchRunner(config map[string]string, defaultURL string) *DeepResearchRunner

func (*DeepResearchRunner) Definition

func (d *DeepResearchRunner) Definition() types.ActionDefinition

func (*DeepResearchRunner) Plannable

func (d *DeepResearchRunner) Plannable() bool

func (*DeepResearchRunner) Run

type GenImageAction

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

func NewGenImage

func NewGenImage(config map[string]string) *GenImageAction

func (*GenImageAction) Definition

func (a *GenImageAction) Definition() types.ActionDefinition

func (*GenImageAction) Plannable

func (a *GenImageAction) Plannable() bool

func (*GenImageAction) Run

type GithubIssueEditor

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

func NewGithubIssueEditor

func NewGithubIssueEditor(config map[string]string) *GithubIssueEditor

func (*GithubIssueEditor) Definition

func (g *GithubIssueEditor) Definition() types.ActionDefinition

func (*GithubIssueEditor) Plannable

func (a *GithubIssueEditor) Plannable() bool

func (*GithubIssueEditor) Run

type GithubIssueSearch

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

func NewGithubIssueSearch

func NewGithubIssueSearch(config map[string]string) *GithubIssueSearch

func (*GithubIssueSearch) Definition

func (g *GithubIssueSearch) Definition() types.ActionDefinition

func (*GithubIssueSearch) Plannable

func (a *GithubIssueSearch) Plannable() bool

func (*GithubIssueSearch) Run

type GithubIssuesCloser

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

func NewGithubIssueCloser

func NewGithubIssueCloser(config map[string]string) *GithubIssuesCloser

func (*GithubIssuesCloser) Definition

func (g *GithubIssuesCloser) Definition() types.ActionDefinition

func (*GithubIssuesCloser) Plannable

func (a *GithubIssuesCloser) Plannable() bool

func (*GithubIssuesCloser) Run

type GithubIssuesCommenter

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

func NewGithubIssueCommenter

func NewGithubIssueCommenter(config map[string]string) *GithubIssuesCommenter

func (*GithubIssuesCommenter) Definition

func (*GithubIssuesCommenter) Plannable

func (a *GithubIssuesCommenter) Plannable() bool

func (*GithubIssuesCommenter) Run

type GithubIssuesLabeler

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

func NewGithubIssueLabeler

func NewGithubIssueLabeler(config map[string]string) *GithubIssuesLabeler

func (*GithubIssuesLabeler) Definition

func (g *GithubIssuesLabeler) Definition() types.ActionDefinition

func (*GithubIssuesLabeler) Plannable

func (a *GithubIssuesLabeler) Plannable() bool

func (*GithubIssuesLabeler) Run

type GithubIssuesOpener

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

func NewGithubIssueOpener

func NewGithubIssueOpener(config map[string]string) *GithubIssuesOpener

func (*GithubIssuesOpener) Definition

func (g *GithubIssuesOpener) Definition() types.ActionDefinition

func (*GithubIssuesOpener) Plannable

func (a *GithubIssuesOpener) Plannable() bool

func (*GithubIssuesOpener) Run

type GithubIssuesReader

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

func NewGithubIssueReader

func NewGithubIssueReader(config map[string]string) *GithubIssuesReader

func (*GithubIssuesReader) Definition

func (g *GithubIssuesReader) Definition() types.ActionDefinition

func (*GithubIssuesReader) Plannable

func (a *GithubIssuesReader) Plannable() bool

func (*GithubIssuesReader) Run

type GithubPRCommenter

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

func NewGithubPRCommenter

func NewGithubPRCommenter(config map[string]string) *GithubPRCommenter

func (*GithubPRCommenter) Definition

func (g *GithubPRCommenter) Definition() types.ActionDefinition

func (*GithubPRCommenter) Plannable

func (a *GithubPRCommenter) Plannable() bool

func (*GithubPRCommenter) Run

type GithubPRCreator

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

func NewGithubPRCreator

func NewGithubPRCreator(config map[string]string) *GithubPRCreator

func (*GithubPRCreator) Definition

func (g *GithubPRCreator) Definition() types.ActionDefinition

func (*GithubPRCreator) Plannable

func (a *GithubPRCreator) Plannable() bool

func (*GithubPRCreator) Run

type GithubPRReader

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

func NewGithubPRReader

func NewGithubPRReader(config map[string]string) *GithubPRReader

func (*GithubPRReader) Definition

func (g *GithubPRReader) Definition() types.ActionDefinition

func (*GithubPRReader) Plannable

func (a *GithubPRReader) Plannable() bool

func (*GithubPRReader) Run

type GithubPRReviewer

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

func NewGithubPRReviewer

func NewGithubPRReviewer(config map[string]string) *GithubPRReviewer

func (*GithubPRReviewer) Definition

func (g *GithubPRReviewer) Definition() types.ActionDefinition

func (*GithubPRReviewer) Plannable

func (a *GithubPRReviewer) Plannable() bool

func (*GithubPRReviewer) Run

type GithubRepositoryCreateOrUpdateContent

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

func NewGithubRepositoryCreateOrUpdateContent

func NewGithubRepositoryCreateOrUpdateContent(config map[string]string) *GithubRepositoryCreateOrUpdateContent

func (*GithubRepositoryCreateOrUpdateContent) Definition

func (*GithubRepositoryCreateOrUpdateContent) Plannable

func (*GithubRepositoryCreateOrUpdateContent) Run

type GithubRepositoryGetAllContent

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

func NewGithubRepositoryGetAllContent

func NewGithubRepositoryGetAllContent(config map[string]string) *GithubRepositoryGetAllContent

func (*GithubRepositoryGetAllContent) Definition

func (*GithubRepositoryGetAllContent) Plannable

func (a *GithubRepositoryGetAllContent) Plannable() bool

func (*GithubRepositoryGetAllContent) Run

type GithubRepositoryGetContent

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

func NewGithubRepositoryGetContent

func NewGithubRepositoryGetContent(config map[string]string) *GithubRepositoryGetContent

func (*GithubRepositoryGetContent) Definition

func (*GithubRepositoryGetContent) Plannable

func (a *GithubRepositoryGetContent) Plannable() bool

func (*GithubRepositoryGetContent) Run

type GithubRepositoryListFiles

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

func NewGithubRepositoryListFiles

func NewGithubRepositoryListFiles(config map[string]string) *GithubRepositoryListFiles

func (*GithubRepositoryListFiles) Definition

func (*GithubRepositoryListFiles) Plannable

func (a *GithubRepositoryListFiles) Plannable() bool

func (*GithubRepositoryListFiles) Run

type GithubRepositoryREADME

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

func NewGithubRepositoryREADME

func NewGithubRepositoryREADME(config map[string]string) *GithubRepositoryREADME

func (*GithubRepositoryREADME) Definition

func (*GithubRepositoryREADME) Plannable

func (a *GithubRepositoryREADME) Plannable() bool

func (*GithubRepositoryREADME) Run

type GithubRepositorySearchFiles

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

func NewGithubRepositorySearchFiles

func NewGithubRepositorySearchFiles(config map[string]string) *GithubRepositorySearchFiles

func (*GithubRepositorySearchFiles) Definition

func (*GithubRepositorySearchFiles) Plannable

func (a *GithubRepositorySearchFiles) Plannable() bool

func (*GithubRepositorySearchFiles) Run

type ListMemoryAction

type ListMemoryAction struct{ *MemoryActions }

func (*ListMemoryAction) Definition

func (a *ListMemoryAction) Definition() types.ActionDefinition

func (*ListMemoryAction) Plannable

func (a *ListMemoryAction) Plannable() bool

func (*ListMemoryAction) Run

type MemoryActions

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

type PiKVMAction

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

func NewPiKVMAction

func NewPiKVMAction(config map[string]string) *PiKVMAction

func (*PiKVMAction) Definition

func (a *PiKVMAction) Definition() types.ActionDefinition

func (*PiKVMAction) Plannable

func (a *PiKVMAction) Plannable() bool

func (*PiKVMAction) Run

type PostTweetAction

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

func NewPostTweet

func NewPostTweet(config map[string]string) *PostTweetAction

func (*PostTweetAction) Definition

func (a *PostTweetAction) Definition() types.ActionDefinition

func (*PostTweetAction) Plannable

func (a *PostTweetAction) Plannable() bool

func (*PostTweetAction) Run

type RemoveFromMemoryAction

type RemoveFromMemoryAction struct{ *MemoryActions }

func (*RemoveFromMemoryAction) Definition

func (*RemoveFromMemoryAction) Plannable

func (a *RemoveFromMemoryAction) Plannable() bool

func (*RemoveFromMemoryAction) Run

type ScraperAction

type ScraperAction struct{}

func NewScraper

func NewScraper(config map[string]string) *ScraperAction

func (*ScraperAction) Definition

func (a *ScraperAction) Definition() types.ActionDefinition

func (*ScraperAction) Plannable

func (a *ScraperAction) Plannable() bool

func (*ScraperAction) Run

type SearchAction

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

func NewSearch

func NewSearch(config map[string]string) *SearchAction

func (*SearchAction) Definition

func (a *SearchAction) Definition() types.ActionDefinition

func (*SearchAction) Plannable

func (a *SearchAction) Plannable() bool

func (*SearchAction) Run

type SendMailAction

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

func NewSendMail

func NewSendMail(config map[string]string) *SendMailAction

func (*SendMailAction) Definition

func (a *SendMailAction) Definition() types.ActionDefinition

func (*SendMailAction) Plannable

func (a *SendMailAction) Plannable() bool

func (*SendMailAction) Run

type SendTelegramMessageRunner

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

func NewSendTelegramMessageRunner

func NewSendTelegramMessageRunner(config map[string]string) *SendTelegramMessageRunner

func (*SendTelegramMessageRunner) Definition

func (*SendTelegramMessageRunner) Plannable

func (s *SendTelegramMessageRunner) Plannable() bool

func (*SendTelegramMessageRunner) Run

type ShellAction

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

func NewShell

func NewShell(config map[string]string, sshBoxURL string) *ShellAction

func (*ShellAction) Definition

func (a *ShellAction) Definition() types.ActionDefinition

func (*ShellAction) Plannable

func (a *ShellAction) Plannable() bool

func (*ShellAction) Run

type TelegramMessageParams

type TelegramMessageParams struct {
	ChatID  int64  `json:"chat_id"`
	Message string `json:"message"`
}

type WebhookAction

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

WebhookAction holds the static configuration for the webhook. These values come from the action configuration (UI/agent config), while the runtime parameter only carries the dynamic payload.

  • url: Target endpoint for the request.
  • method: HTTP method to use. Defaults to POST if not provided.
  • contentType: Sets the Content-Type header when a body is sent.
  • payloadTemplate: Optional template used to build the request body; occurrences of "{{payload}}" get replaced with the runtime payload string. If no placeholder is present, the template is used as-is. For GET requests the body is omitted regardless of payload.

Note: This action does not follow redirects!

func NewWebhook

func NewWebhook(cfg map[string]string) *WebhookAction

NewWebhook constructs a WebhookAction using provided configuration values:

  • url: Destination endpoint for the HTTP request (required).
  • method: HTTP method to use (GET, POST, PUT, DELETE, ...). Defaults to POST.
  • contentType: Value for the Content-Type header (e.g., application/json).
  • payloadTemplate: Optional template for the request body; the runtime parameter "payload" (if provided) will replace the "{{payload}}" placeholder inside this template.

func (*WebhookAction) Definition

func (a *WebhookAction) Definition() types.ActionDefinition

Definition returns the action schema exposed to the planner/runtime. Only the runtime parameter "payload" is accepted; all connection details are configured statically via the action configuration UI.

func (*WebhookAction) Plannable

func (a *WebhookAction) Plannable() bool

Plannable indicates the action can be suggested/used by planners without requiring hidden context; inputs are straightforward and safe.

func (*WebhookAction) Run

Run executes the webhook call. It reads the runtime parameter "payload" (optional), merges it into the configured payloadTemplate (if any), constructs an HTTP request using the configured URL, method and content type, and then returns a summary with the response status and body (truncated to 4KiB for safety).

type WikipediaAction

type WikipediaAction struct{}

func NewWikipedia

func NewWikipedia(config map[string]string) *WikipediaAction

func (*WikipediaAction) Definition

func (a *WikipediaAction) Definition() types.ActionDefinition

func (*WikipediaAction) Plannable

func (a *WikipediaAction) Plannable() bool

func (*WikipediaAction) Run

Jump to

Keyboard shortcuts

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