Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ComponentBuilder ¶ added in v1.8.2
type ComponentBuilder func( msg *types.Message, sessionState service.SessionStateReader, ) layout.Model
ComponentBuilder is a function that creates a tool component.
type Factory ¶ added in v1.8.2
type Factory struct {
// contains filtered or unexported fields
}
Factory creates tool components using the registry. It looks up registered component builders and falls back to a default component if no specific builder is registered for a tool.
func NewFactory ¶ added in v1.8.2
type Registration ¶ added in v1.20.1
type Registration struct {
Names []string // Tool names or category prefixes (e.g., "category:api")
Builder ComponentBuilder // Factory function to create the component
}
Registration pairs tool identifiers with their component builder. Tools with the same visual representation share a builder.
type Registry ¶ added in v1.8.2
type Registry struct {
// contains filtered or unexported fields
}
Registry manages tool component builders.
func NewRegistry ¶ added in v1.8.2
func NewRegistry() *Registry
func (*Registry) Get ¶ added in v1.8.2
func (r *Registry) Get(toolName string) (ComponentBuilder, bool)
func (*Registry) Register ¶ added in v1.8.2
func (r *Registry) Register(toolName string, builder ComponentBuilder)
Register adds a single tool-to-builder mapping.
func (*Registry) RegisterAll ¶ added in v1.20.1
func (r *Registry) RegisterAll(registrations []Registration)
RegisterAll adds multiple registrations at once. This is the preferred way to set up the registry declaratively.
Click to show internal directories.
Click to hide internal directories.