Documentation
¶
Overview ¶
Package webui provides a web server and HTTP API for kodelet's web interface. It serves the embedded React frontend and provides REST endpoints for conversation management and LLM interactions through a browser interface.
Index ¶
- Variables
- func NewAuthToken() (string, error)
- func ValidateAuthToken(authToken string) error
- func ValidateCORSOrigins(origins []string) error
- type CWDHint
- type CWDHintsResponse
- type ChatContentBlock
- type ChatEvent
- type ChatEventSink
- type ChatImageSource
- type ChatImageURLSource
- type ChatProfileOption
- type ChatRequest
- type ChatRunner
- type ChatSettingsResponse
- type DefaultChatRunner
- type Server
- type ServerConfig
- type SlashCommandsResponse
- type UIConfirmEvent
- type UIInputEvent
- type UINotifyEvent
- type UISelectEvent
- type WebContentBlock
- type WebConversationResponse
- type WebImageSource
- type WebImageURL
- type WebMessage
- type WebToolCall
- type WebToolCallFunction
Constants ¶
This section is empty.
Variables ¶
var NewDefaultChatRunner = chat.NewDefaultChatRunner
Functions ¶
func NewAuthToken ¶
NewAuthToken generates a random token suitable for protecting the web UI.
func ValidateAuthToken ¶
ValidateAuthToken validates a caller-provided web UI auth token.
func ValidateCORSOrigins ¶
ValidateCORSOrigins validates caller-provided CORS origins.
Types ¶
type CWDHintsResponse ¶
type ChatContentBlock ¶
type ChatContentBlock = chat.ChatContentBlock
type ChatEventSink ¶
type ChatEventSink = chat.ChatEventSink
type ChatImageSource ¶
type ChatImageSource = chat.ChatImageSource
type ChatImageURLSource ¶
type ChatImageURLSource = chat.ChatImageURLSource
type ChatProfileOption ¶
type ChatProfileOption struct {
Name string `json:"name"`
Scope string `json:"scope"`
Active bool `json:"active,omitempty"`
}
ChatProfileOption represents a selectable profile in the web UI.
type ChatRequest ¶
type ChatRequest = chat.ChatRequest
type ChatRunner ¶
type ChatRunner = chat.ChatRunner
type ChatSettingsResponse ¶
type ChatSettingsResponse struct {
CurrentProfile string `json:"currentProfile,omitempty"`
Profiles []ChatProfileOption `json:"profiles"`
ReasoningEffort string `json:"reasoningEffort"`
ReasoningEffortOptions []string `json:"reasoningEffortOptions"`
DefaultCWD string `json:"defaultCWD,omitempty"`
}
ChatSettingsResponse contains new-conversation settings for the web chat composer.
type DefaultChatRunner ¶
type DefaultChatRunner = chat.DefaultChatRunner
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server represents the web UI server
func NewServer ¶
func NewServer(ctx context.Context, config *ServerConfig) (*Server, error)
NewServer creates a new web UI server
type ServerConfig ¶
type ServerConfig struct {
Host string
Port int
CWD string
CompactRatio float64
AuthToken string
CORSOrigins []string
}
ServerConfig holds the configuration for the web server
func (*ServerConfig) Validate ¶
func (c *ServerConfig) Validate() error
Validate validates the server configuration
type SlashCommandsResponse ¶
type SlashCommandsResponse struct {
Commands []slashcommands.Command `json:"commands"`
}
type UIConfirmEvent ¶
type UIConfirmEvent = chat.UIConfirmEvent
type UIInputEvent ¶
type UIInputEvent = chat.UIInputEvent
type UINotifyEvent ¶
type UINotifyEvent = chat.UINotifyEvent
type UISelectEvent ¶
type UISelectEvent = chat.UISelectEvent
type WebContentBlock ¶
type WebContentBlock = chat.ChatContentBlock
WebContentBlock represents a typed content block rendered by the web UI.
type WebConversationResponse ¶
type WebConversationResponse struct {
ID string `json:"id"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
Provider string `json:"provider"`
CWD string `json:"cwd,omitempty"`
CWDLocked bool `json:"cwdLocked,omitempty"`
Profile string `json:"profile,omitempty"`
ProfileLocked bool `json:"profileLocked,omitempty"`
ReasoningEffort string `json:"reasoningEffort,omitempty"`
ReasoningEffortLocked bool `json:"reasoningEffortLocked,omitempty"`
Summary string `json:"summary,omitempty"`
IsRunning bool `json:"isRunning,omitempty"`
Usage any `json:"usage"`
Messages []WebMessage `json:"messages"`
PendingSteer []WebMessage `json:"pendingSteer,omitempty"`
ToolResults any `json:"toolResults,omitempty"`
MessageCount int `json:"messageCount"`
}
WebConversationResponse represents a conversation response for the web UI.
type WebImageSource ¶
type WebImageSource = chat.ChatImageSource
WebImageSource represents inline image data for a web content block.
type WebImageURL ¶
type WebImageURL = chat.ChatImageURLSource
WebImageURL represents a remote image URL for a web content block.
type WebMessage ¶
type WebMessage struct {
Role string `json:"role"`
Content any `json:"content"`
ToolCalls []WebToolCall `json:"toolCalls,omitempty"`
ThinkingText string `json:"thinkingText,omitempty"`
ThinkingTexts []string `json:"thinkingTexts,omitempty"`
}
WebMessage represents a message with structured tool calls for the web UI
type WebToolCall ¶
type WebToolCall struct {
ID string `json:"id"`
Function WebToolCallFunction `json:"function"`
}
WebToolCall represents a tool call for the web UI
type WebToolCallFunction ¶
WebToolCallFunction represents the function part of a tool call