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 WriteChannel(w *strings.Builder, entry ChannelEntry)
- func WritePost(w *strings.Builder, entry PostEntry)
- func WriteTeam(w *strings.Builder, entry TeamEntry)
- func WriteUser(w *strings.Builder, entry UserEntry)
- type AgentInfo
- type ChannelEntry
- type PostEntry
- type TeamEntry
- 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 WriteChannel ¶
func WriteChannel(w *strings.Builder, entry ChannelEntry)
WriteChannel writes a formatted channel entry to the builder.
Types ¶
type AgentInfo ¶
AgentInfo holds display fields for formatting an AI agent list (e.g. MCP tool output).
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 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.