server

package
v2026.1009.2 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: MIT Imports: 51 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearState added in v2026.909.0

func ClearState() error

func DesktopFrontend added in v2026.1009.0

func DesktopFrontend() http.Handler

DesktopFrontend makes the daemon the source of the native client's UI assets. Reloading a client after an update loads the daemon's matching frontend.

func DesktopProxy added in v2026.1003.0

func DesktopProxy() http.Handler

DesktopProxy connects the native WebView to the shared daemon. It adapts the native origin to the desktop HTTP origin understood by older running daemons, so installing a new GUI does not require interrupting their active sessions. The caller must serve this handler exclusively on a loopback listener.

func ForceStop added in v2026.909.0

func ForceStop(state State)

ForceStop terminates the server and, when present, its separately managed Vite process group. Detached Solomon and Vite commands are process-group leaders, while a foreground "server run" may share its terminal's group; forceStopProcess handles both cases without killing an unrelated shell.

func ForceStopPID added in v2026.909.0

func ForceStopPID(pid int)

func LogPath added in v2026.909.0

func LogPath() (string, error)

func QuotaErrorFromBodyForTest added in v2026.924.0

func QuotaErrorFromBodyForTest(status string, body []byte) string

func Run added in v2026.909.0

func Run(ctx context.Context, options Options) error

func RunningVersion added in v2026.1009.0

func RunningVersion() string

func SaveState added in v2026.909.0

func SaveState(state State) error

func StatePath added in v2026.909.0

func StatePath() (string, error)

Types

type Health added in v2026.909.0

type Health struct {
	OK      bool      `json:"ok"`
	Server  State     `json:"server"`
	Now     time.Time `json:"now"`
	Uptime  string    `json:"uptime"`
	API     string    `json:"api"`
	GUI     string    `json:"gui"`
	Workers string    `json:"workers"`
}

func ReadHealth added in v2026.1009.0

func ReadHealth(ctx context.Context, state State) (Health, error)

ReadHealth reads live daemon metadata rather than the persisted startup snapshot.

type Options

type Options struct {
	Mode       string
	DevDir     string
	ListenAddr string
}

type QuotaBarForTest added in v2026.924.0

type QuotaBarForTest struct {
	Label   string
	Percent float64
	Detail  string
}

QuotaBarForTest is a narrow test view of a provider quota bar.

func QuotaBarsForTest added in v2026.924.0

func QuotaBarsForTest(payload any, kind string) []QuotaBarForTest

QuotaBarsForTest exposes the pure parser to external package tests.

type ReachableAddress added in v2026.909.0

type ReachableAddress struct {
	Kind      string `json:"kind"`
	Interface string `json:"interface,omitempty"`
	URL       string `json:"url"`
}

type State added in v2026.909.0

type State struct {
	PID        int                `json:"pid"`
	URL        string             `json:"url"`
	LocalURL   string             `json:"localhost_url"`
	Addresses  []ReachableAddress `json:"addresses,omitempty"`
	StartedAt  time.Time          `json:"started_at"`
	Version    string             `json:"version"`
	Commit     string             `json:"commit,omitempty"`
	CommitTime time.Time          `json:"commit_time,omitempty"`
	SourceTree string             `json:"source_tree,omitempty"`
	Mode       string             `json:"mode"`
	Vite       string             `json:"vite"`
	ViteURL    string             `json:"vite_url,omitempty"`
	VitePID    int                `json:"vite_pid,omitempty"`
	DevDir     string             `json:"dev_directory,omitempty"`
	GOOS       string             `json:"goos"`
	GoVersion  string             `json:"go_version"`
}

func EnsureRunning added in v2026.1003.0

func EnsureRunning(ctx context.Context, cliPath string) (State, error)

EnsureRunning reuses a healthy local daemon or starts it through the CLI. cliPath must point to solomon, since the daemon also launches CLI PTY children.

func LoadState added in v2026.909.0

func LoadState() (State, error)

Jump to

Keyboard shortcuts

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