server

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: May 26, 2026 License: MIT Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionStatus added in v0.3.0

type ActionStatus struct {
	Name      string     `json:"name"`
	Running   bool       `json:"running"`
	ExitCode  *int       `json:"exit_code"`
	Lines     []string   `json:"lines"`
	StartTime time.Time  `json:"start_time"`
	EndTime   *time.Time `json:"end_time,omitempty"`
}

ActionStatus tracks the status of a background action

type LogEntry added in v0.3.0

type LogEntry struct {
	Timestamp time.Time `json:"timestamp"`
	Level     string    `json:"level"`
	Message   string    `json:"message"`
	Source    string    `json:"source"`
}

LogEntry represents a log entry

type Message

type Message struct {
	ID         string                   `json:"id"`
	SessionID  string                   `json:"session_id"`
	Role       string                   `json:"role"`
	Content    string                   `json:"content"`
	Timestamp  int64                    `json:"timestamp"`
	ToolCalls  []map[string]interface{} `json:"tool_calls,omitempty"`
	ToolName   string                   `json:"tool_name,omitempty"`
	ToolCallID string                   `json:"tool_call_id,omitempty"`
}

Message represents a chat message (API response format)

type PlatformStatus added in v0.3.0

type PlatformStatus struct {
	ErrorCode    string `json:"error_code,omitempty"`
	ErrorMessage string `json:"error_message,omitempty"`
	State        string `json:"state"`
	UpdatedAt    int64  `json:"updated_at"`
}

PlatformStatus represents platform status

type ProviderInfo added in v0.3.0

type ProviderInfo struct {
	Name    string   `json:"name"`
	Label   string   `json:"label"`
	BaseURL string   `json:"base_url"`
	Models  []string `json:"models"`
	APIKey  string   `json:"api_key,omitempty"`
}

ProviderInfo represents a model provider (API response format)

type QRStatus added in v0.4.0

type QRStatus struct {
	Platform  string `json:"platform"`
	Status    string `json:"status"`            // pending, scanning, confirmed, expired, error
	QRCode    string `json:"qr_code,omitempty"` // base64 encoded PNG
	Message   string `json:"message,omitempty"`
	ExpiresIn int    `json:"expires_in,omitempty"` // seconds remaining
}

QRStatus represents the status of a QR code login session

type Server

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

Server represents the HTTP server with real backend connections

func NewServer

func NewServer(dbPath string) *Server

NewServer creates a new server instance connected to real backend systems

func (*Server) Start

func (s *Server) Start(port int) error

Start starts the HTTP server

type Session

type Session struct {
	ID              string  `json:"id"`
	Profile         string  `json:"profile"`
	Source          string  `json:"source"`
	Model           string  `json:"model"`
	Title           string  `json:"title"`
	StartedAt       int64   `json:"started_at"`
	EndedAt         *int64  `json:"ended_at"`
	LastActive      int64   `json:"last_active"`
	IsActive        bool    `json:"is_active"`
	MessageCount    int     `json:"message_count"`
	ToolCallCount   int     `json:"tool_call_count"`
	InputTokens     int     `json:"input_tokens"`
	OutputTokens    int     `json:"output_tokens"`
	Preview         string  `json:"preview"`
	ParentSessionID *string `json:"parent_session_id"`
}

Session represents a chat session (API response format)

type Skill added in v0.3.0

type Skill struct {
	ID          string   `json:"id"`
	Name        string   `json:"name"`
	Description string   `json:"description"`
	Category    string   `json:"category"`
	Tags        []string `json:"tags"`
	Enabled     bool     `json:"enabled"`
}

Skill represents a skill

type Toolset added in v0.3.0

type Toolset struct {
	ID      string   `json:"id"`
	Name    string   `json:"name"`
	Tools   []string `json:"tools"`
	Enabled bool     `json:"enabled"`
}

Toolset represents a group of tools

Jump to

Keyboard shortcuts

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