Documentation
¶
Index ¶
- func AgentList(agents []AgentInfo, currentBotUserID string) string
- func AuthoredPost(post *model.Post, username string) string
- func BuildPostIndex(posts []*model.Post) map[string]int
- func MemberRole(schemeAdmin, schemeGuest, schemeUser bool) string
- func PostBody(post *model.Post) string
- func ThreadData(data *mmapi.ThreadData) string
- func WriteBookmark(w *strings.Builder, entry BookmarkEntry)
- func WriteBot(w *strings.Builder, entry BotEntry)
- func WriteCPAField(w *strings.Builder, entry CPAFieldEntry)
- func WriteChannel(w *strings.Builder, entry ChannelEntry)
- func WriteChannelMember(w *strings.Builder, entry ChannelMemberEntry)
- func WriteChannelModerations(w *strings.Builder, moderations []*model.ChannelModeration)
- func WriteChannelStats(w *strings.Builder, stats *model.ChannelStats)
- func WriteChannelUnread(w *strings.Builder, unread *model.ChannelUnread)
- func WriteCustomStatus(w *strings.Builder, userID string, cs *model.CustomStatus)
- func WriteEmoji(w *strings.Builder, entry EmojiEntry)
- func WriteFileDescriptor(w *strings.Builder, entry FileDescriptorEntry)
- func WriteGroup(w *strings.Builder, entry GroupEntry)
- func WriteIncomingWebhook(w *strings.Builder, entry IncomingWebhookEntry)
- func WriteOutgoingWebhook(w *strings.Builder, entry OutgoingWebhookEntry)
- func WritePost(w *strings.Builder, entry PostEntry)
- func WritePostInfo(w *strings.Builder, entry PostInfoEntry)
- func WriteReactions(w *strings.Builder, postID string, reactions []*model.Reaction, ...)
- func WriteRole(w *strings.Builder, entry RoleEntry)
- func WriteScheduledPost(w *strings.Builder, entry ScheduledPostEntry)
- func WriteSidebarCategory(w *strings.Builder, entry SidebarCategoryEntry)
- func WriteStatus(w *strings.Builder, entry StatusEntry)
- func WriteTeam(w *strings.Builder, entry TeamEntry)
- func WriteTeamMember(w *strings.Builder, entry TeamMemberEntry)
- func WriteTeamStats(w *strings.Builder, stats *model.TeamStats)
- func WriteTeamUnread(w *strings.Builder, unread *model.TeamUnread)
- func WriteThreadSummary(w *strings.Builder, entry ThreadSummaryEntry)
- func WriteUser(w *strings.Builder, entry UserEntry)
- type AgentInfo
- type BookmarkEntry
- type BotEntry
- type CPAFieldEntry
- type ChannelEntry
- type ChannelMemberEntry
- type EmojiEntry
- type FileDescriptorEntry
- type GroupEntry
- type IncomingWebhookEntry
- type OutgoingWebhookEntry
- type PostEntry
- type PostInfoEntry
- type RoleEntry
- type ScheduledPostEntry
- type SidebarCategoryEntry
- type StatusEntry
- type TeamEntry
- type TeamMemberEntry
- type ThreadSummaryEntry
- type UserEntry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AgentList ¶
AgentList formats discovered agents as a numbered list for LLM-facing text. When currentBotUserID matches an agent's ID, a marker line is added for that row.
func AuthoredPost ¶
AuthoredPost formats a post body with the username of its author for LLM consumption.
func BuildPostIndex ¶
BuildPostIndex creates a map from post ID to its 1-based display index. Used to generate "(reply to Post N)" annotations.
func MemberRole ¶
MemberRole converts scheme booleans to a readable role string. Works for both channel and team members.
func ThreadData ¶
func ThreadData(data *mmapi.ThreadData) string
func WriteBookmark ¶
func WriteBookmark(w *strings.Builder, entry BookmarkEntry)
WriteBookmark writes a formatted channel bookmark entry to the builder.
func WriteCPAField ¶
func WriteCPAField(w *strings.Builder, entry CPAFieldEntry)
WriteCPAField writes a Custom Profile Attribute field definition to the builder.
func WriteChannel ¶
func WriteChannel(w *strings.Builder, entry ChannelEntry)
WriteChannel writes a formatted channel entry to the builder.
func WriteChannelMember ¶
func WriteChannelMember(w *strings.Builder, entry ChannelMemberEntry)
WriteChannelMember writes a channel membership record (roles, mute, last-viewed).
func WriteChannelModerations ¶
func WriteChannelModerations(w *strings.Builder, moderations []*model.ChannelModeration)
WriteChannelModerations writes a channel's moderation settings to the builder.
func WriteChannelStats ¶
func WriteChannelStats(w *strings.Builder, stats *model.ChannelStats)
WriteChannelStats writes a channel's statistics to the builder.
func WriteChannelUnread ¶
func WriteChannelUnread(w *strings.Builder, unread *model.ChannelUnread)
WriteChannelUnread writes a channel's unread counts to the builder.
func WriteCustomStatus ¶
func WriteCustomStatus(w *strings.Builder, userID string, cs *model.CustomStatus)
WriteCustomStatus writes a user's custom status (emoji + text + expiry).
func WriteEmoji ¶
func WriteEmoji(w *strings.Builder, entry EmojiEntry)
WriteEmoji writes a formatted custom emoji entry to the builder.
func WriteFileDescriptor ¶
func WriteFileDescriptor(w *strings.Builder, entry FileDescriptorEntry)
WriteFileDescriptor writes a compact file metadata descriptor to the builder.
func WriteGroup ¶
func WriteGroup(w *strings.Builder, entry GroupEntry)
WriteGroup writes a group's metadata to the builder.
func WriteIncomingWebhook ¶
func WriteIncomingWebhook(w *strings.Builder, entry IncomingWebhookEntry)
WriteIncomingWebhook writes an incoming webhook's details to the builder.
func WriteOutgoingWebhook ¶
func WriteOutgoingWebhook(w *strings.Builder, entry OutgoingWebhookEntry)
WriteOutgoingWebhook writes an outgoing webhook's details to the builder.
func WritePostInfo ¶
func WritePostInfo(w *strings.Builder, entry PostInfoEntry)
WritePostInfo writes a post's channel/team context metadata to the builder.
func WriteReactions ¶
func WriteReactions(w *strings.Builder, postID string, reactions []*model.Reaction, usernames map[string]string)
WriteReactions writes a post's emoji reactions grouped by emoji, with the reacting usernames, to the builder. usernames maps user IDs to usernames.
func WriteScheduledPost ¶
func WriteScheduledPost(w *strings.Builder, entry ScheduledPostEntry)
WriteScheduledPost writes a formatted scheduled post entry to the builder.
func WriteSidebarCategory ¶
func WriteSidebarCategory(w *strings.Builder, entry SidebarCategoryEntry)
WriteSidebarCategory writes a sidebar category and its channel IDs to the builder.
func WriteStatus ¶
func WriteStatus(w *strings.Builder, entry StatusEntry)
WriteStatus writes a user's presence status to the builder.
func WriteTeamMember ¶
func WriteTeamMember(w *strings.Builder, entry TeamMemberEntry)
WriteTeamMember writes a team membership record (roles) to the builder.
func WriteTeamStats ¶
WriteTeamStats writes a team's member statistics to the builder.
func WriteTeamUnread ¶
func WriteTeamUnread(w *strings.Builder, unread *model.TeamUnread)
WriteTeamUnread writes a single team's unread counts to the builder.
func WriteThreadSummary ¶
func WriteThreadSummary(w *strings.Builder, entry ThreadSummaryEntry)
WriteThreadSummary writes a collated-thread summary to the builder.
Types ¶
type AgentInfo ¶
AgentInfo holds display fields for formatting an AI agent list (e.g. MCP tool output).
type BookmarkEntry ¶
type BookmarkEntry struct {
HeaderLabel string
Bookmark *model.ChannelBookmarkWithFileInfo
}
BookmarkEntry holds data for formatting a single channel bookmark.
type CPAFieldEntry ¶
type CPAFieldEntry struct {
HeaderLabel string
Field *model.PropertyField
}
CPAFieldEntry holds data for formatting a single Custom Profile Attribute field.
type ChannelEntry ¶
type ChannelEntry struct {
HeaderLabel string // e.g. "Channel Information:", "1. **General**"; empty to omit
Channel *model.Channel // the source channel
TeamName string // resolved team display name
TeamID string // team ID (shown when TeamName is empty but TeamID is set)
MemberCount int64 // -1 means don't show
Role string // requesting user's role: "admin" | "member" | "guest" | "not_member" | "" (omit)
}
ChannelEntry holds data for formatting a single channel.
type ChannelMemberEntry ¶
type ChannelMemberEntry struct {
HeaderLabel string
Member *model.ChannelMember
Username string // resolved, optional
}
ChannelMemberEntry holds data for formatting a single channel membership record.
type EmojiEntry ¶
EmojiEntry holds data for formatting a single custom emoji.
type FileDescriptorEntry ¶
type FileDescriptorEntry struct {
// Number is the 1-based position of the file in the attachment list; it
// renders as an "Attached File N" header. A zero value omits the header.
Number int
FileInfo *model.FileInfo // the source file
}
FileDescriptorEntry holds metadata for a file attachment surfaced to the LLM without inlining its contents. The File ID is included so the model can pass it to the read_file tool to fetch the contents on demand.
type GroupEntry ¶
GroupEntry holds data for formatting a single group.
type IncomingWebhookEntry ¶
type IncomingWebhookEntry struct {
HeaderLabel string
Webhook *model.IncomingWebhook
}
IncomingWebhookEntry holds data for formatting an incoming webhook.
type OutgoingWebhookEntry ¶
type OutgoingWebhookEntry struct {
HeaderLabel string
Webhook *model.OutgoingWebhook
}
OutgoingWebhookEntry holds data for formatting an outgoing webhook.
type PostEntry ¶
type PostEntry struct {
// Header components
HeaderLabel string // e.g. "Post 1", "Result 3"
Username string // resolved username; "" → "Unknown User"
Score float32 // >0 means show "(Score: X.XX)" — search only
ReplyAnnotation string // e.g. "(reply to Post 2)" — appended to header
// The source post
Post *model.Post
// Optional context metadata (search results show per-result channel info)
ChannelName string
TeamName string
ShowChannel bool // show Channel ID line
}
PostEntry holds pre-resolved data for formatting a single post. Used by MCP tools and other callers that need structured post output.
type PostInfoEntry ¶
PostInfoEntry holds data for formatting a single post's metadata/context.
type ScheduledPostEntry ¶
type ScheduledPostEntry struct {
HeaderLabel string // e.g. "Scheduled Post 1"; empty to omit
ScheduledPost *model.ScheduledPost
ChannelName string // resolved channel display name, optional
}
ScheduledPostEntry holds data for formatting a single scheduled post.
type SidebarCategoryEntry ¶
type SidebarCategoryEntry struct {
HeaderLabel string
Category *model.SidebarCategoryWithChannels
}
SidebarCategoryEntry holds data for formatting a single sidebar category.
type StatusEntry ¶
type StatusEntry struct {
HeaderLabel string
Status *model.Status
Username string // resolved, optional
}
StatusEntry holds data for formatting a single user's presence status.
type TeamEntry ¶
type TeamEntry struct {
Team *model.Team // the source team
MemberCount int64 // -1 means don't show
}
TeamEntry holds data for formatting a single team.
type TeamMemberEntry ¶
type TeamMemberEntry struct {
HeaderLabel string
Member *model.TeamMember
Username string // resolved, optional
}
TeamMemberEntry holds data for formatting a single team membership record.
type ThreadSummaryEntry ¶
type ThreadSummaryEntry struct {
HeaderLabel string
Thread *model.ThreadResponse
Username string // root post author
}
ThreadSummaryEntry holds data for formatting a single thread from the inbox.