Documentation
¶
Overview ¶
Package botdesktop provides Harness's native Desktop Bot & Group workspace page and its UI extension slots for product modules.
Index ¶
- Constants
- Variables
- func Register(opts ...Option) shell.Module
- type AboveChatContributor
- type ContactView
- type CreateMenuContributor
- type CreateMenuItem
- type DeepLinkHandler
- type HeaderActionContributor
- type InspectorSection
- type InspectorSectionContributor
- type MemberView
- type Option
- func WithAboveChatSlot(fn AboveChatContributor) Option
- func WithAssociationNamespace(ns string) Option
- func WithCreateMenuItems(fn CreateMenuContributor) Option
- func WithDeepLinkHandler(fn DeepLinkHandler) Option
- func WithHeaderActions(fn HeaderActionContributor) Option
- func WithInspectorSections(fn InspectorSectionContributor) Option
- func WithOverviewMeta(fn OverviewMetaContributor) Option
- func WithProfileStats(fn ProfileStatContributor) Option
- func WithProjectMentions(enabled bool) Option
- func WithPromptStarters(fn PromptStarterContributor) Option
- func WithSidebarItemDecorator(fn SidebarItemDecorator) Option
- type OverviewMeta
- type OverviewMetaContributor
- type ProfileStat
- type ProfileStatContributor
- type PromptStarterContributor
- type SidebarBadge
- type SidebarItemDecorator
- type SlotContext
Constants ¶
const PageID shell.Page = "page:bot"
PageID is the stable navigation ID for the Harness Bot & Group workspace.
Variables ¶
var Locales embed.FS
Locales contains the embedded translation files for the Bot desktop module.
Functions ¶
func Register ¶
Register returns a shell.Module that installs the native Bot & Group workspace page, its embedded locales, and the sailry-bot:// deep-link scheme. Calling Register again on the same Assembly (for example when a product layers options on top of desktop.HarnessModules()) replaces the prior PageID entry cleanly without duplicating locales or panicking on link registration.
Types ¶
type AboveChatContributor ¶
type AboveChatContributor func(c *ui.Context, ctx SlotContext)
AboveChatContributor renders content directly above the embedded conversation.
type ContactView ¶
type ContactView struct {
Key string // "role:<uuid>" or "team:<uuid>"
ID string // bare role or team UUID
Kind string // "bot" or "group"
Name string
ModelName string
Icon string
Description string
MemberAvatars []string
Members []MemberView
Node protocol.NodeID
SessionID protocol.SessionID
SessionTitle string
SessionFP string
LastActivity int64
Unread bool
Replying bool
}
ContactView describes one Bot or Group entry in the sidebar and active view.
type CreateMenuContributor ¶
type CreateMenuContributor func(c *ui.Context, ctx SlotContext) []CreateMenuItem
CreateMenuContributor appends items to the sidebar "+" menu.
type CreateMenuItem ¶
type CreateMenuItem struct {
Label string
Icon *ui.SVG
OnClick func(SlotContext)
}
CreateMenuItem describes one item contributed to the sidebar "+" menu.
type DeepLinkHandler ¶
type DeepLinkHandler func(ctx SlotContext, rawURL string) bool
DeepLinkHandler handles additional custom deep links routed to the Bot page.
type HeaderActionContributor ¶
type HeaderActionContributor func(c *ui.Context, ctx SlotContext)
HeaderActionContributor renders additional actions in the conversation header.
type InspectorSection ¶
type InspectorSection struct {
ID string
Title string
Tab bool
Order int
Empty bool
GroupOnly bool
Badge int
Render func(c *ui.Context, closePopover func())
}
InspectorSection contributes a section or tab to the right-hand overview card.
type InspectorSectionContributor ¶
type InspectorSectionContributor func(c *ui.Context, ctx SlotContext) []InspectorSection
InspectorSectionContributor returns extra sections/tabs for the overview card.
type MemberView ¶
MemberView describes one member Bot inside a Group contact.
type Option ¶
type Option func(*config)
Option configures the Harness Bot Desktop module.
func WithAboveChatSlot ¶
func WithAboveChatSlot(fn AboveChatContributor) Option
WithAboveChatSlot registers a slot rendered above the embedded conversation.
func WithAssociationNamespace ¶
WithAssociationNamespace overrides the native discussion namespace matched by the Bot workspace (default: "sailry-bot").
func WithCreateMenuItems ¶
func WithCreateMenuItems(fn CreateMenuContributor) Option
WithCreateMenuItems registers additional items in the sidebar "+" menu.
func WithDeepLinkHandler ¶
func WithDeepLinkHandler(fn DeepLinkHandler) Option
WithDeepLinkHandler registers a deep-link handler invoked when custom links target the Bot workspace.
func WithHeaderActions ¶
func WithHeaderActions(fn HeaderActionContributor) Option
WithHeaderActions registers additional header actions beside the active chat.
func WithInspectorSections ¶
func WithInspectorSections(fn InspectorSectionContributor) Option
WithInspectorSections registers additional sections/tabs in the overview card.
func WithOverviewMeta ¶
func WithOverviewMeta(fn OverviewMetaContributor) Option
WithOverviewMeta registers a contributor for the overview button metadata (icon, active state, badge count, attention tone, and empty-card copy).
func WithProfileStats ¶
func WithProfileStats(fn ProfileStatContributor) Option
WithProfileStats registers extra stat cards in the Contact Profile modal.
func WithProjectMentions ¶
WithProjectMentions enables @project mentions in Bot and Group composers (disabled by default so Sailry Work has zero Projects UI).
func WithPromptStarters ¶
func WithPromptStarters(fn PromptStarterContributor) Option
WithPromptStarters registers a starter-prompt contributor for empty chats.
func WithSidebarItemDecorator ¶
func WithSidebarItemDecorator(fn SidebarItemDecorator) Option
WithSidebarItemDecorator registers a decorator for Bot/Group sidebar rows.
type OverviewMeta ¶
OverviewMeta lets a product module customize the overview trigger button (icon, active spinner, badge, attention tint) and empty-card copy.
type OverviewMetaContributor ¶
type OverviewMetaContributor func(c *ui.Context, ctx SlotContext) *OverviewMeta
OverviewMetaContributor returns optional overview trigger metadata for the active contact.
type ProfileStat ¶
ProfileStat contributes one numeric figure to the Contact Profile dialog.
type ProfileStatContributor ¶
type ProfileStatContributor func(c *ui.Context, ctx SlotContext) []ProfileStat
ProfileStatContributor returns extra stats for the Contact Profile dialog.
type PromptStarterContributor ¶
type PromptStarterContributor func(c *ui.Context, contact ContactView) []viewapi.ConversationPrompt
PromptStarterContributor supplies starter prompt capsules for an empty chat.
type SidebarBadge ¶
SidebarBadge lets a product module decorate a Bot or Group row in the sidebar.
type SidebarItemDecorator ¶
type SidebarItemDecorator func(c *ui.Context, contact ContactView) SidebarBadge
SidebarItemDecorator returns optional status badges for a sidebar contact row.
type SlotContext ¶
type SlotContext struct {
Node protocol.NodeID
CanWrite bool
Services viewapi.Services
Contact ContactView
SelectContact func(node protocol.NodeID, contactKey string)
OpenProfile func(contactKey string)
Mention func(kind, id string)
FillContactPrompt func(node protocol.NodeID, contactKey, text string) bool
SendContactPrompt func(node protocol.NodeID, contactKey, text string) bool
OpenMemory func(node protocol.NodeID, filter viewapi.MemoryFilter) bool
Invalidate func()
}
SlotContext gives UI slot contributors read access to the active contact and safe navigation callbacks on the UI thread.