web

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: MIT Imports: 29 Imported by: 0

Documentation

Overview

Package web serves Oni3 agents to a browser over a small HTTP API.

The API mirrors the MCP tools (agents, models) and streams a single agent turn as Server-Sent Events. Conversations are stored with the same session files the TUI and ACP use, so a chat started in the browser can be resumed from the CLI and vice versa.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentInfo

type AgentInfo struct {
	Name         string `json:"name"`
	Description  string `json:"description"`
	DefaultModel string `json:"default_model"`
}

AgentInfo describes one selectable agent.

type ModelList

type ModelList struct {
	DefaultModel string   `json:"default_model"`
	Models       []string `json:"models"`
}

ModelList reports model aliases only, matching list_models over MCP.

type Options

type Options struct {
	// DefaultAgent is pre-selected in the interface. An empty value picks the
	// first agent by name.
	DefaultAgent string
	// WorkDir is shown in the interface and is the directory tools resolve
	// relative paths against (the process working directory).
	WorkDir string
	// Version is reported by /api/bootstrap.
	Version string
	// Token enables bearer-token authentication when non-empty.
	Token string
	// DisableWeb hides the browser interface, web API and login/docs pages.
	// Protocol endpoints and /api/health remain available.
	DisableWeb bool
	// EnableAGUI mounts the AG-UI SSE endpoint.
	EnableAGUI bool
	// EnableA2A mounts the A2A JSON-RPC and agent-card endpoints.
	EnableA2A bool
	// EnableMCPServer makes Oni3 itself an MCP server over Streamable HTTP and
	// legacy SSE. It does not manage external MCP servers.
	EnableMCPServer bool
}

Options configures a web server.

type Server

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

Server exposes configured agents over HTTP.

func New

func New(cfg *config.Config, opts Options) (*Server, error)

New creates a web server for cfg.

func (*Server) Handler

func (s *Server) Handler() http.Handler

Handler returns the HTTP handler.

type SessionSummary

type SessionSummary struct {
	ID      string    `json:"id"`
	Agent   string    `json:"agent"`
	Model   string    `json:"model"`
	Title   string    `json:"title"`
	Turns   int       `json:"turns"`
	Updated time.Time `json:"updated"`
}

SessionSummary is one row of the conversation sidebar.

Jump to

Keyboard shortcuts

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