webui

package
v1.1.49 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type A2ADiscoverFunc added in v1.1.47

type A2ADiscoverFunc func() []A2ADiscoveredInstance

A2ADiscoverFunc returns discovered A2A instances (other running ggcode processes).

type A2ADiscoveredInstance added in v1.1.47

type A2ADiscoveredInstance struct {
	ID        string `json:"id"`
	Workspace string `json:"workspace"`
	Endpoint  string `json:"endpoint"`
	Status    string `json:"status"`
	StartedAt string `json:"started_at"`
}

A2ADiscoveredInstance describes a remote ggcode instance discovered via A2A.

type IMActionFunc

type IMActionFunc func(adapter string, action string) error

IMActionFunc performs an IM action (enable/disable/mute/unmute/unbind).

type IMRuntimeStatus

type IMRuntimeStatus struct {
	Adapter   string   `json:"adapter"`
	Platform  string   `json:"platform"`
	Healthy   bool     `json:"healthy"`
	Status    string   `json:"status"`
	LastError string   `json:"last_error,omitempty"`
	BoundDir  string   `json:"bound_dir,omitempty"`
	ChannelID string   `json:"channel_id,omitempty"`
	TargetID  string   `json:"target_id,omitempty"`
	Muted     bool     `json:"muted"`
	Disabled  bool     `json:"disabled"`
	AllDirs   []string `json:"all_dirs,omitempty"` // all persisted bound directories
}

IMRuntimeStatus describes a running IM adapter's state.

type IMStatusFunc

type IMStatusFunc func() []IMRuntimeStatus

IMStatusFunc returns runtime IM adapter states. Keys are adapter names.

type MCPRuntimeStatus

type MCPRuntimeStatus struct {
	Connected bool     `json:"connected"`
	Pending   bool     `json:"pending"`
	Disabled  bool     `json:"disabled"`
	Error     string   `json:"error,omitempty"`
	Tools     []string `json:"tools,omitempty"`
}

MCPRuntimeStatus describes a running MCP server's state.

type MCPStatusFunc

type MCPStatusFunc func() map[string]MCPRuntimeStatus

MCPStatusFunc returns runtime MCP server statuses. Keys are server names.

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server provides a built-in WebUI for configuration and chat.

func NewServer

func NewServer(cfg *config.Config) *Server

NewServer creates a WebUI server bound to the given config.

func (*Server) Addr

func (s *Server) Addr() string

Addr returns the listening address (empty if not started).

func (*Server) Close

func (s *Server) Close() error

Close shuts down the server.

func (*Server) SetA2ADiscoverFn added in v1.1.47

func (s *Server) SetA2ADiscoverFn(fn A2ADiscoverFunc)

SetA2ADiscoverFn sets the A2A instance discovery provider.

func (*Server) SetIMActionFn

func (s *Server) SetIMActionFn(fn IMActionFunc)

SetIMActionFn sets the IM action handler.

func (*Server) SetIMStatusFn

func (s *Server) SetIMStatusFn(fn IMStatusFunc)

SetIMStatusFn sets the runtime IM status provider.

func (*Server) SetMCPStatusFn

func (s *Server) SetMCPStatusFn(fn MCPStatusFunc)

SetMCPStatusFn sets the runtime MCP status provider.

func (*Server) SetRestartFn

func (s *Server) SetRestartFn(fn func())

SetRestartFn sets the restart callback (triggers process self-restart).

func (*Server) Start

func (s *Server) Start(addr string) (string, error)

Start starts the HTTP server on the given address (e.g. "127.0.0.1:0" for auto). Returns the actual listening address.

Jump to

Keyboard shortcuts

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