Documentation
¶
Overview ¶
Package slackchat connects initech to Slack via Socket Mode. It receives @mention events from Slack and dispatches them to agent panes. The client is started as a goroutine from TUI.Run() when Slack tokens are configured.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseMention ¶
ParseMention strips the <@BOTID> prefix from Slack message text and extracts the agent name (first word, lowercased) and message body (rest). Returns empty strings when the input has no content after the mention.
Types ¶
type AgentHost ¶
type AgentHost interface {
// FindAgent returns info for the named agent, or false if not found.
FindAgent(name string) (AgentInfo, bool)
// AllAgents returns info for all managed agents.
AllAgents() []AgentInfo
// SendToAgent delivers text to the named agent's PTY (with Enter).
// Returns an error if the agent is not found.
SendToAgent(name, text string) error
}
AgentHost provides agent lookup and delivery for Slack dispatch. Implemented by the TUI bridge adapter.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client manages the Slack Socket Mode connection and event loop.
func NewClient ¶
NewClient creates a Slack client configured for Socket Mode. The appToken (xapp-...) is used to establish the WebSocket connection. The botToken (xoxb-...) is used for Web API calls (posting messages, adding reactions). The host provides agent lookup and delivery; pass nil to defer wiring.