Documentation
¶
Index ¶
- Constants
- Variables
- func AgentName(a Agent) string
- func FriendlyDescription(prompt string) string
- func FriendlyTitle(prompt string) string
- func HasRunner(meta string) bool
- func IsThreadBusy(err error) bool
- func IsThreadNotBusy(err error) bool
- func MessageProps(v ThreadView, m db.Message) ui.ChatMessageProps
- func NormalizeModel(agent, model string) string
- func ParseProviderModel(value string) (string, string)
- func ProviderModelOptions(agents []string) []uikit.SelectOption
- type Agent
- type Attachment
- type Broker
- type ClaudeAgent
- type CodexAgent
- type EchoAgent
- type Event
- type MessagePart
- type PlanEntry
- type Recoverable
- type Resolver
- type Server
- type Service
- func (s *Service) AddAttachment(threadID int64, name, mimeType string, r io.Reader) (db.Attachment, error)
- func (s *Service) AgentName(thread db.Thread) string
- func (s *Service) AgentNames() []string
- func (s *Service) Attachment(id int64) (db.Attachment, error)
- func (s *Service) Close()
- func (s *Service) CreateThread(agent, title string) (db.Thread, error)
- func (s *Service) CreateThreadWithLabel(agent, model, label, title string) (db.Thread, error)
- func (s *Service) CreateThreadWithModel(agent, model, title string) (db.Thread, error)
- func (s *Service) DeleteDraftAttachment(id int64) error
- func (s *Service) DeleteThread(threadID int64) error
- func (s *Service) Publish(threadID int64)
- func (s *Service) Recover() error
- func (s *Service) RegisterAgent(name string, agent Agent)
- func (s *Service) ResolveElicitation(messageID int64, elicitationID, action string, values map[string]string) error
- func (s *Service) Send(threadID int64, prompt string, attachmentIDs ...int64) (db.Message, error)
- func (s *Service) SetResolver(r Resolver)
- func (s *Service) SetThreadStarred(threadID int64, starred bool) error
- func (s *Service) SetThreadState(threadID int64, state string) error
- func (s *Service) StopThread(threadID int64) error
- func (s *Service) Subscribe(threadID int64) (<-chan struct{}, func() []int64, func())
- func (s *Service) Thread(id int64) (db.Thread, error)
- func (s *Service) ThreadAccess(thread db.Thread) string
- func (s *Service) ThreadLabel(thread db.Thread) string
- func (s *Service) ThreadPrompt(id int64) (string, error)
- func (s *Service) Threads() ([]db.Thread, error)
- func (s *Service) ThreadsByLabel(label string) ([]db.Thread, error)
- func (s *Service) ToggleThreadAccess(threadID int64) (string, error)
- func (s *Service) View(threadID int64) (ThreadView, error)
- type ThreadView
- type ToolCallView
- type Turn
Constants ¶
View Source
const ( EventAnchor = "anchor" EventDelta = "delta" EventElicitation = "elicitation" EventElicitationResult = "elicitation_result" EventError = "error" EventPlan = "plan" EventResult = "result" EventRunner = "runner" EventThinking = "thinking" EventToolCall = "tool_call" EventToolCallUpdate = "tool_call_update" EventUsage = "usage" )
View Source
const ( AccessFull = "full" AccessSafe = "safe" )
View Source
const ( PartError = "error" PartPlan = "plan" PartText = "text" PartThinking = "thinking" PartTool = "tool" ToolStatusCompleted = "completed" ToolStatusFailed = "failed" ToolStatusInProgress = "in_progress" )
View Source
const StructuralUpdate int64 = 0
Variables ¶
View Source
var ( ErrAgentUnknown = errors.New("agent unknown") ErrElicitationNotFound = errors.New("elicitation not found") ErrElicitationResolved = errors.New("elicitation already resolved") ErrNoResolver = errors.New("no elicitation resolver configured") ErrThreadBusy = errors.New("thread busy") ErrThreadNotBusy = errors.New("thread not busy") ErrThreadStateUnknown = errors.New("thread state unknown") ErrTurnPending = errors.New("turn pending durable recovery") )
View Source
var ErrAttachmentTooLarge = errors.New("attachment exceeds 32 MiB")
Functions ¶
func FriendlyDescription ¶
func FriendlyTitle ¶
func IsThreadBusy ¶
func IsThreadNotBusy ¶
func MessageProps ¶
func MessageProps(v ThreadView, m db.Message) ui.ChatMessageProps
func NormalizeModel ¶
func ParseProviderModel ¶
func ProviderModelOptions ¶
func ProviderModelOptions(agents []string) []uikit.SelectOption
Types ¶
type Agent ¶
type Agent interface {
Author() string
Run(ctx context.Context, turn Turn, emit func(Event)) (string, error)
}
func AvailableAgents ¶
func AvailableAgents() []Agent
func AvailableAgentsInDir ¶
func ResolveAgent ¶
func ResolveAgentInDir ¶
type Attachment ¶
type ClaudeAgent ¶
type ClaudeAgent struct {
Dir string
}
func (ClaudeAgent) Author ¶
func (ClaudeAgent) Author() string
type CodexAgent ¶
type CodexAgent struct {
Dir string
}
func (CodexAgent) Author ¶
func (CodexAgent) Author() string
type Event ¶
func DeltaEvent ¶
type MessagePart ¶
type MessagePart struct {
Kind string
Plan []PlanEntry
Text string
Tool *ToolCallView
}
type Recoverable ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func (*Service) AddAttachment ¶
func (*Service) AgentNames ¶
func (*Service) Attachment ¶
func (s *Service) Attachment(id int64) (db.Attachment, error)
func (*Service) CreateThread ¶
func (*Service) CreateThreadWithLabel ¶
func (*Service) CreateThreadWithModel ¶
func (*Service) DeleteDraftAttachment ¶
func (*Service) DeleteThread ¶
func (*Service) RegisterAgent ¶
func (*Service) ResolveElicitation ¶
func (*Service) SetResolver ¶
func (*Service) SetThreadStarred ¶
func (*Service) SetThreadState ¶
func (*Service) StopThread ¶
func (*Service) ThreadsByLabel ¶
func (*Service) ToggleThreadAccess ¶
type ThreadView ¶
Click to show internal directories.
Click to hide internal directories.