botdesktop

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2026 License: Apache-2.0 Imports: 21 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package botdesktop provides Harness's native Desktop Bot & Group workspace page and its UI extension slots for product modules.

Index

Constants

View Source
const PageID shell.Page = "page:bot"

PageID is the stable navigation ID for the Harness Bot & Group workspace.

Variables

View Source
var Locales embed.FS

Locales contains the embedded translation files for the Bot desktop module.

Functions

func Register

func Register(opts ...Option) shell.Module

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

type MemberView struct {
	Key         string
	ID          string
	Name        string
	Icon        string
	Description string
}

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

func WithAssociationNamespace(ns string) Option

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

func WithProjectMentions(enabled bool) Option

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

type OverviewMeta struct {
	Icon       *ui.SVG
	Active     bool
	Badge      int
	Attention  bool
	EmptyLabel string
}

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

type ProfileStat struct {
	Key       string
	Label     string
	Value     string
	Attention bool
}

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

type SidebarBadge struct {
	WaitingCount int
	Running      bool
	Failed       bool
	Trailing     func(*ui.Context)
}

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.

Jump to

Keyboard shortcuts

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