slack

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

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

func (*Action) Configure

func (x *Action) Configure(ctx context.Context) error

func (*Action) Flags

func (x *Action) Flags() []cli.Flag

func (*Action) Helper

func (x *Action) Helper() *cli.Command

func (*Action) LogValue

func (x *Action) LogValue() slog.Value

func (*Action) Name

func (x *Action) Name() string

func (*Action) Prompt

func (x *Action) Prompt(ctx context.Context) (string, error)

Prompt returns additional instructions for the system prompt

func (*Action) Run

func (x *Action) Run(ctx context.Context, name string, args map[string]any) (map[string]any, error)

func (*Action) SetOAuthToken

func (x *Action) SetOAuthToken(token string)

SetOAuthToken sets the OAuth token (for testing)

func (*Action) SetSlackClient

func (x *Action) SetSlackClient(client interfaces.SlackClient)

func (*Action) SetTestURL

func (x *Action) SetTestURL(url string)

SetTestURL sets a custom base URL (for testing)

func (*Action) Specs

func (x *Action) Specs(ctx context.Context) ([]gollem.ToolSpec, error)

type Attachment

type Attachment struct {
	ID      int    `json:"id"`
	Pretext string `json:"pretext,omitempty"`
	Text    string `json:"text,omitempty"`
}

Attachment represents message attachments

type ChannelInfo

type ChannelInfo struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

ChannelInfo represents channel information

type Message

type Message struct {
	Type        string       `json:"type"`
	Channel     ChannelInfo  `json:"channel"`
	User        string       `json:"user"`
	Username    string       `json:"username"`
	Text        string       `json:"text"`
	Timestamp   string       `json:"ts"`
	Permalink   string       `json:"permalink"`
	Team        string       `json:"team,omitempty"`
	Attachments []Attachment `json:"attachments,omitempty"`
}

Message represents a single message in search results

type MessagesBlock

type MessagesBlock struct {
	Total      int       `json:"total"`
	Pagination Paging    `json:"paging"`
	Matches    []Message `json:"matches"`
}

MessagesBlock represents the messages block in search response

type Paging

type Paging struct {
	Count int `json:"count"`
	Total int `json:"total"`
	Page  int `json:"page"`
	Pages int `json:"pages"`
}

Paging represents pagination information

type SearchMessageItem

type SearchMessageItem struct {
	Channel       string    `json:"channel"`
	ChannelName   string    `json:"channel_name"`
	User          string    `json:"user"`
	UserName      string    `json:"user_name"`
	Text          string    `json:"text"`
	Timestamp     string    `json:"timestamp"`
	Permalink     string    `json:"permalink"`
	FormattedTime time.Time `json:"formatted_time,omitempty"`
}

SearchMessageItem represents a formatted message item for output

type SearchOptions

type SearchOptions struct {
	Query     string `json:"query"`
	Sort      string `json:"sort,omitempty"`     // score, timestamp
	SortDir   string `json:"sort_dir,omitempty"` // asc, desc
	Count     int    `json:"count,omitempty"`
	Page      int    `json:"page,omitempty"`
	Highlight bool   `json:"highlight,omitempty"`
}

SearchOptions represents the options for Slack message search

type SearchOutput

type SearchOutput struct {
	Total    int                 `json:"total"`
	Messages []SearchMessageItem `json:"messages"`
}

SearchOutput represents the tool output format

type SearchResponse

type SearchResponse struct {
	OK       bool          `json:"ok"`
	Query    string        `json:"query"`
	Messages MessagesBlock `json:"messages"`
	Error    string        `json:"error,omitempty"`
}

SearchResponse represents the response from Slack search API

Jump to

Keyboard shortcuts

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