web

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2026 License: MIT Imports: 33 Imported by: 0

Documentation

Overview

Package web serves the usher HTTP API and embedded static UI.

Two listeners run side by side:

  • the **web** listener (TCP at s.addr) serves the SPA, JSON API, SSE stream, and /login. Every non-exempt request is gated by auth middleware when a password is configured.
  • the **hook** listener (Unix socket at s.hookSockPath, mode 0600) serves only /hook/{event}. Hook traffic from the local `usher hook` subprocess never touches the public TCP port, so it doesn't need auth and a leaky-netns container can't reach it (fs-isolated).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

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

func NewServer

func NewServer(
	addr string,
	hookSockPath string,
	attachmentsDir string,
	authStore *auth.Store,
	r *router.Router,
	main *mainchat.Store,
	agent usheragent.Agent,
	pushMgr *push.Manager,
	editorURL string,
	uiDir string,
	themePath string,
	logger *slog.Logger,
) *Server

func (*Server) RelayForeignTurn added in v0.6.0

func (s *Server) RelayForeignTurn(sessionID, text string)

RelayForeignTurn delivers a turn usher did NOT initiate — a background workflow continuation, a prompt typed straight into the tmux pane — to every chat that recently routed to the session. Follows are derived from the chat histories themselves (FocusSession/SourceSession references), so there is no registry to persist and restarts lose nothing. Wired as the router's ForeignTurnHandler.

func (*Server) Run

func (s *Server) Run(ctx context.Context) error

Jump to

Keyboard shortcuts

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