clients

package
v0.1.147 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2026 License: AGPL-3.0, AGPL-3.0-or-later Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecuteOAuthCommand added in v0.1.71

func ExecuteOAuthCommand(
	ctx context.Context,
	toolName string,
	command string,
	args map[string]any,
	creds *types.IntegrationCredentials,
	handlers map[string]OAuthCommandHandler,
	stdout io.Writer,
) error

ExecuteOAuthCommand runs a command for OAuth-backed tool clients with consistent auth checking, error shaping, and JSON output.

func GetBoolArg

func GetBoolArg(args map[string]any, key string, defaultVal bool) bool

GetBoolArg extracts a bool argument from args map

func GetIntArg

func GetIntArg(args map[string]any, key string, defaultVal int) int

GetIntArg extracts an int argument from args map

func GetStringArg

func GetStringArg(args map[string]any, key, defaultVal string) string

GetStringArg extracts a string argument from args map

func RequireAccessToken added in v0.1.71

func RequireAccessToken(toolName string, creds *types.IntegrationCredentials, stdout io.Writer) (string, error)

RequireAccessToken validates OAuth credentials and returns the access token. On failure it writes a structured error to stdout for consistent CLI behavior.

func RequirePositiveIntArg added in v0.1.71

func RequirePositiveIntArg(args map[string]any, key string) (int, error)

func RequireStringArgs added in v0.1.71

func RequireStringArgs(args map[string]any, keys ...string) (map[string]string, error)

func WriteJSON added in v0.1.71

func WriteJSON(w io.Writer, payload any) error

WriteJSON writes a JSON payload to a tool output stream.

func WriteToolError added in v0.1.71

func WriteToolError(w io.Writer, msg string) error

WriteToolError writes a standard structured tool error.

Types

type ArticleResponse

type ArticleResponse struct {
	Title      string   `json:"title"`
	PageID     int      `json:"page_id"`
	Extract    string   `json:"extract"`
	HTML       string   `json:"html,omitempty"`
	Categories []string `json:"categories"`
	URL        string   `json:"url"`
}

ArticleResponse is the response from a get_article command

type ContentResponse

type ContentResponse struct {
	URL     string `json:"url"`
	Title   string `json:"title"`
	Content string `json:"content"`
	Length  int    `json:"length"`
}

ContentResponse represents extracted content

type CurrentWeatherResponse

type CurrentWeatherResponse struct {
	Location    string  `json:"location"`
	Country     string  `json:"country"`
	Temperature float64 `json:"temperature"`
	FeelsLike   float64 `json:"feels_like"`
	Humidity    int     `json:"humidity"`
	Pressure    int     `json:"pressure"`
	WindSpeed   float64 `json:"wind_speed"`
	WindDeg     int     `json:"wind_deg"`
	Clouds      int     `json:"clouds"`
	Visibility  int     `json:"visibility"`
	Weather     string  `json:"weather"`
	Description string  `json:"description"`
	Icon        string  `json:"icon"`
	Sunrise     int64   `json:"sunrise"`
	Sunset      int64   `json:"sunset"`
	Timezone    int     `json:"timezone"`
	Units       string  `json:"units"`
}

CurrentWeatherResponse represents current weather data

type ExaClient

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

ExaClient implements the Exa neural search tool

func NewExaClient

func NewExaClient(apiKey string) *ExaClient

NewExaClient creates a new Exa client

func (*ExaClient) Execute

func (e *ExaClient) Execute(ctx context.Context, command string, args map[string]any, creds *types.IntegrationCredentials, stdout, stderr io.Writer) error

Execute runs an Exa command - implements ToolClient interface

func (*ExaClient) Name

func (e *ExaClient) Name() types.IntegrationName

Name returns the tool identifier - implements ToolClient interface

type ExaSearchResponse

type ExaSearchResponse struct {
	Query   string            `json:"query"`
	Results []ExaSearchResult `json:"results"`
	Total   int               `json:"total"`
}

SearchResponse represents the search response

type ExaSearchResult

type ExaSearchResult struct {
	Title     string  `json:"title"`
	URL       string  `json:"url"`
	Snippet   string  `json:"snippet,omitempty"`
	Score     float64 `json:"score"`
	Published string  `json:"published,omitempty"`
	Author    string  `json:"author,omitempty"`
}

SearchResult represents a single search result

type ForecastDay

type ForecastDay struct {
	Date        string  `json:"date"`
	TempMin     float64 `json:"temp_min"`
	TempMax     float64 `json:"temp_max"`
	Humidity    int     `json:"humidity"`
	Weather     string  `json:"weather"`
	Description string  `json:"description"`
	Icon        string  `json:"icon"`
	WindSpeed   float64 `json:"wind_speed"`
	Pop         float64 `json:"precipitation_probability"`
}

ForecastDay represents a single day's forecast

type ForecastResponse

type ForecastResponse struct {
	Location string        `json:"location"`
	Country  string        `json:"country"`
	Days     []ForecastDay `json:"days"`
	Units    string        `json:"units"`
}

ForecastResponse represents the forecast data

type GDriveClient added in v0.1.71

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

func NewGDriveClient added in v0.1.71

func NewGDriveClient() *GDriveClient

func (*GDriveClient) Execute added in v0.1.71

func (g *GDriveClient) Execute(ctx context.Context, command string, args map[string]any, creds *types.IntegrationCredentials, stdout, _ io.Writer) error

func (*GDriveClient) Name added in v0.1.71

type GitHubClient

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

func NewGitHubClient

func NewGitHubClient() *GitHubClient

func (*GitHubClient) Execute

func (g *GitHubClient) Execute(ctx context.Context, command string, args map[string]any, creds *types.IntegrationCredentials, stdout, _ io.Writer) error

func (*GitHubClient) Name

type GmailClient added in v0.1.71

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

func NewGmailClient added in v0.1.71

func NewGmailClient() *GmailClient

func (*GmailClient) Execute added in v0.1.71

func (g *GmailClient) Execute(ctx context.Context, command string, args map[string]any, creds *types.IntegrationCredentials, stdout, _ io.Writer) error

func (*GmailClient) Name added in v0.1.71

func (g *GmailClient) Name() types.IntegrationName

type HourlyForecastItem

type HourlyForecastItem struct {
	Time        string  `json:"time"`
	Temperature float64 `json:"temperature"`
	FeelsLike   float64 `json:"feels_like"`
	Humidity    int     `json:"humidity"`
	Weather     string  `json:"weather"`
	Description string  `json:"description"`
	Icon        string  `json:"icon"`
	WindSpeed   float64 `json:"wind_speed"`
	Pop         float64 `json:"precipitation_probability"`
}

HourlyForecastItem represents a single hour's forecast

type HourlyForecastResponse

type HourlyForecastResponse struct {
	Location string               `json:"location"`
	Country  string               `json:"country"`
	Hours    []HourlyForecastItem `json:"hours"`
	Units    string               `json:"units"`
}

HourlyForecastResponse represents hourly forecast data

type IssueInfo

type IssueInfo struct {
	Number   int      `json:"number"`
	Title    string   `json:"title"`
	State    string   `json:"state"`
	Body     string   `json:"body,omitempty"`
	User     string   `json:"user"`
	Labels   []string `json:"labels,omitempty"`
	Comments int      `json:"comments"`
	URL      string   `json:"url"`
}

type LinearClient added in v0.1.71

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

func NewLinearClient added in v0.1.71

func NewLinearClient() *LinearClient

func (*LinearClient) Execute added in v0.1.71

func (l *LinearClient) Execute(ctx context.Context, command string, args map[string]any, creds *types.IntegrationCredentials, stdout, _ io.Writer) error

func (*LinearClient) Name added in v0.1.71

type NotionClient added in v0.1.71

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

func NewNotionClient added in v0.1.71

func NewNotionClient() *NotionClient

func (*NotionClient) Execute added in v0.1.71

func (n *NotionClient) Execute(ctx context.Context, command string, args map[string]any, creds *types.IntegrationCredentials, stdout, _ io.Writer) error

func (*NotionClient) Name added in v0.1.71

type OAuthCommandHandler added in v0.1.71

type OAuthCommandHandler func(ctx context.Context, token string, args map[string]any) (any, error)

type OutlookToolClient added in v0.1.143

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

func NewOutlookToolClient added in v0.1.143

func NewOutlookToolClient() *OutlookToolClient

func (*OutlookToolClient) Execute added in v0.1.143

func (o *OutlookToolClient) Execute(ctx context.Context, command string, args map[string]any, creds *types.IntegrationCredentials, stdout, _ io.Writer) error

func (*OutlookToolClient) Name added in v0.1.143

type PRFileInfo added in v0.1.71

type PRFileInfo struct {
	Filename  string `json:"filename"`
	Status    string `json:"status"`
	Additions int    `json:"additions"`
	Deletions int    `json:"deletions"`
	Changes   int    `json:"changes"`
	Patch     string `json:"patch,omitempty"`
	BlobURL   string `json:"blob_url,omitempty"`
}

type PRInfo

type PRInfo struct {
	Number    int    `json:"number"`
	Title     string `json:"title"`
	State     string `json:"state"`
	Body      string `json:"body,omitempty"`
	User      string `json:"user"`
	Draft     bool   `json:"draft"`
	Mergeable bool   `json:"mergeable,omitempty"`
	URL       string `json:"url"`
}

type RepoInfo

type RepoInfo struct {
	Name        string `json:"name"`
	FullName    string `json:"full_name"`
	Description string `json:"description,omitempty"`
	Private     bool   `json:"private"`
	Language    string `json:"language,omitempty"`
	Stars       int    `json:"stars"`
	Forks       int    `json:"forks,omitempty"`
	OpenIssues  int    `json:"open_issues,omitempty"`
	URL         string `json:"url"`
	CloneURL    string `json:"clone_url,omitempty"`
}

type ResearchFinding

type ResearchFinding struct {
	Title   string `json:"title"`
	URL     string `json:"url"`
	Summary string `json:"summary"`
	Key     string `json:"key_insight,omitempty"`
}

ResearchFinding represents a single research finding

type ResearchResponse

type ResearchResponse struct {
	Topic    string            `json:"topic"`
	Findings []ResearchFinding `json:"findings"`
	Summary  string            `json:"summary"`
}

ResearchResponse represents the research response

type SearchResponse

type SearchResponse struct {
	Results []SearchResult `json:"results"`
	Total   int            `json:"total"`
}

SearchResponse is the response from a search command

type SearchResult

type SearchResult struct {
	Title       string `json:"title"`
	PageID      int    `json:"page_id"`
	Excerpt     string `json:"excerpt"`
	Description string `json:"description,omitempty"`
}

SearchResult represents a Wikipedia search result

type SlackClient added in v0.1.71

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

func NewSlackClient added in v0.1.71

func NewSlackClient() *SlackClient

func (*SlackClient) Execute added in v0.1.71

func (s *SlackClient) Execute(ctx context.Context, command string, args map[string]any, creds *types.IntegrationCredentials, stdout, _ io.Writer) error

func (*SlackClient) Name added in v0.1.71

func (s *SlackClient) Name() types.IntegrationName

type SummaryResponse

type SummaryResponse struct {
	Title        string `json:"title"`
	PageID       int    `json:"page_id"`
	Extract      string `json:"extract"`
	Description  string `json:"description,omitempty"`
	ThumbnailURL string `json:"thumbnail_url,omitempty"`
	URL          string `json:"url"`
}

SummaryResponse is the response from a get_summary command

type ViewClient added in v0.1.124

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

func NewViewClient added in v0.1.124

func NewViewClient(store *views.ViewStore, backend repository.BackendRepository, sync *views.ViewSync) *ViewClient

func (*ViewClient) Execute added in v0.1.124

func (c *ViewClient) Execute(ctx context.Context, command string, args map[string]any, creds *types.IntegrationCredentials, stdout, stderr io.Writer) error

func (*ViewClient) Name added in v0.1.124

func (c *ViewClient) Name() types.IntegrationName

type WeatherClient

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

WeatherClient implements the Weather tool using OpenWeatherMap API

func NewWeatherClient

func NewWeatherClient(apiKey string) *WeatherClient

NewWeatherClient creates a new Weather client

func (*WeatherClient) Execute

func (w *WeatherClient) Execute(ctx context.Context, command string, args map[string]any, creds *types.IntegrationCredentials, stdout, stderr io.Writer) error

Execute runs a Weather command - implements ToolClient interface

func (*WeatherClient) Name

Name returns the tool identifier - implements ToolClient interface

type WikipediaClient

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

WikipediaClient implements the Wikipedia tool

func NewWikipediaClient

func NewWikipediaClient() *WikipediaClient

NewWikipediaClient creates a new Wikipedia client

func (*WikipediaClient) Execute

func (w *WikipediaClient) Execute(ctx context.Context, command string, args map[string]any, creds *types.IntegrationCredentials, stdout, stderr io.Writer) error

Execute runs a Wikipedia command - implements ToolClient interface

func (*WikipediaClient) Name

Name returns the tool identifier - implements ToolClient interface

Jump to

Keyboard shortcuts

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