server

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2026 License: MIT Imports: 60 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 DefaultAssistDir

func DefaultAssistDir() string

DefaultAssistDir is the assistant's own folder, the hub's and atc's, so it never starts in the home folder: Claude Code refuses a background session there unless it already has a yes on record.

func GuestsArgs

func GuestsArgs() []string

GuestsArgs are the flags for the guests' conversation: its own brief, only atc's tools (no WhatsApp, mail or browser of the user's), and no approvals to pass on.

func HubArgs

func HubArgs() []string

HubArgs are the flags for the hub's Claude: the same tools and switchboard as atc's standing sessions, plus how the channels work.

func Priced

func Priced(model string, u history.Usage) float64

func SavePeer

func SavePeer(path string, p Peer) error

SavePeer adds a peer to the file, or replaces the one of that name.

Types

type Agent

type Agent struct {
	Name   string     `json:"name"`
	Folder string     `json:"folder"`
	Host   string     `json:"host"`
	Title  string     `json:"title,omitempty"`
	Icon   string     `json:"icon,omitempty"`
	Color  string     `json:"color,omitempty"`
	Dir    string     `json:"dir,omitempty"`
	Args   []string   `json:"args,omitempty"`
	Every  string     `json:"every,omitempty"`
	From   string     `json:"from,omitempty"`
	Check  string     `json:"check,omitempty"`
	Prompt string     `json:"prompt,omitempty"`
	Reset  *resetSpec `json:"reset,omitempty"`
	Share  *share     `json:"share,omitempty"`
	// Talk lets the user talk to it directly on a call; Person is who it sounds and looks like there, and Background
	// replaces the background of whoever that is.
	Talk       bool   `json:"talk,omitempty"`
	Person     string `json:"person,omitempty"`
	Background string `json:"background,omitempty"`
	Err        string `json:"error,omitempty"`
}

Agent is a standing conversation defined by a folder: agent.json, brief.md, and settings.json and mcp.json when they are there, all read fresh each time it starts or resumes.

type AgentView

type AgentView struct {
	Agent
	Rule      startover.Policy `json:"rule"`
	Next      time.Time        `json:"next,omitzero"`
	LastReset time.Time        `json:"lastReset,omitzero"`
	Session   string           `json:"sessionId,omitempty"`
	ID        string           `json:"id,omitempty"`
	State     string           `json:"state,omitempty"`
	Parked    bool             `json:"parked,omitempty"`
	Context   int              `json:"context,omitempty"`
	Last      time.Time        `json:"last,omitzero"`
	Pages     []pages.Page     `json:"pages"`
	Badge     json.RawMessage  `json:"badge,omitempty"`
	Headline  string           `json:"headline,omitempty"`
	Trust     *agentTrust      `json:"trust,omitempty"`
}

type CapsMachine

type CapsMachine struct {
	Host          string     `json:"host"`
	Version       string     `json:"version,omitempty"`
	Rows          []caps.Row `json:"rows,omitempty"`
	Identity      Identity   `json:"identity"`
	Restart       []string   `json:"restart,omitempty"`
	RestartCmd    string     `json:"restartCommand,omitempty"`
	SettingsFile  string     `json:"settingsFile,omitempty"`
	SettingsError string     `json:"settingsError,omitempty"`
	Error         string     `json:"error,omitempty"`
}

CapsMachine is the list as one machine sees it.

type CapsReport

type CapsReport struct {
	Groups   []string      `json:"groups"`
	Machines []CapsMachine `json:"machines"`
}

func CapsAlone

func CapsAlone(ctx context.Context, set *settings.Settings, host, version, bin, self string) CapsReport

CapsAlone is the list without a running server, for `atc doctor`: the same checks over the same files.

type Engine

type Engine struct {
	Name    string            `json:"name"`
	Harness string            `json:"harness,omitempty"`
	Model   string            `json:"model"`
	URL     string            `json:"url,omitempty"`
	Token   string            `json:"token,omitempty"`
	Env     map[string]string `json:"env,omitempty"`
	Host    string            `json:"host,omitempty"`
}

func LoadEngines

func LoadEngines(path string) ([]Engine, error)

type Identity

type Identity struct {
	User      string `json:"user"`
	Assistant string `json:"assistant"`
	Language  string `json:"language"`
}

type Look

type Look struct {
	Scheme string `json:"scheme"`
	Theme  string `json:"theme"`
}

type Peer

type Peer struct {
	Name  string `json:"name"`
	URL   string `json:"url"`
	Token string `json:"token"`
	// CA is the certificate, as PEM, pinned when this peer was paired, for one no system trusts.
	CA string `json:"ca,omitempty"`
}

func LoadPeers

func LoadPeers(path string) ([]Peer, error)

type Person

type Person struct {
	ID        string `json:"id"`
	Name      string `json:"name"`
	Character string `json:"character"`
	// Background is a room: a picture in /app/personas/_rooms, with its settings in a .json beside it when it has any,
	// that replaces the character's own room; empty keeps that room.
	Background string            `json:"background,omitempty"`
	Voices     map[string]string `json:"voices"`
}

Person is who a call shows and speaks as: a name, a character from /app/personas (or "orb") and a voice per language. How the assistant behaves stays out of it. Nothing here is tied to the assistant, so an agent can name a person too.

type Persons

type Persons struct {
	Persons []Person          `json:"persons"`
	Langs   map[string]string `json:"langs"`
}

Persons is every person, and which one the assistant is in each language.

type Preset

type Preset struct {
	Name     string   `json:"name"`
	Dir      string   `json:"dir"`
	Brief    string   `json:"brief,omitempty"`
	Args     []string `json:"args,omitempty"`
	Worktree bool     `json:"worktree,omitempty"`
	Host     string   `json:"host,omitempty"`
}

func LoadPresets

func LoadPresets(path string) ([]Preset, error)

type Proxies

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

func ParseProxies

func ParseProxies(list string) *Proxies

func (*Proxies) Trusts

func (p *Proxies) Trusts(ip net.IP) bool

type Server

type Server struct {
	M       *sessions.Manager
	Res     *resources.Sampler
	Term    *attach.Hub
	Web     fs.FS
	Token   string
	Roots   []string
	Host    string
	Push    *push.Pusher
	Pages   *pages.Store
	Backlog *backlog.Store
	Browser *browser.Browser
	Peers   []Peer
	Presets []Preset
	Paired  *pair.Store

	// AgentsDir holds a folder per agent; every machine reads it and runs the ones naming it.
	AgentsDir string
	Engines   []Engine
	// Settings is settings.json, and Version this build; capsRunner keeps the feature checks' results briefly.
	Settings *settings.Settings
	Version  string

	Voice Voice

	WhatsApp *whatsapp.Client
	Hub      *hub.Client
	// CallLine is the call line service, whose app line the phone app's calls go through; calls from
	// CallTestFrom go to CallTestLine.
	CallLine, CallTestLine string
	CallTestFrom           []string
	// CallNumber is the assistant's own phone line, which the app logs its calls under.
	CallNumber string
	// CallVoices is the voice service, which lists the voices calls can speak with and keeps the pick.
	CallVoices string

	// PublicURL is where the user reaches atc (links in messages), LocalURL where this
	// machine's own browser does.
	PublicURL, LocalURL string

	AppDir    string
	AssistDir string
	StateDir  string

	TrustTailnet   string
	TrustedProxies *Proxies
	// contains filtered or unexported fields
}

func (*Server) Handler

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

type Speaker

type Speaker struct{ URL, Model, Voice string }

Speaker is a text-to-speech engine for one language, for one the default voice can't speak.

type Voice

type Voice struct {
	STT, STTModel, STTPrompt, STTLanguage string
	STTLanguages                          []string
	TTS, TTSModel, TTSVoice               string
	Speakers                              map[string]Speaker
	LLM, LLMModel                         string
}

func VoiceFromEnv

func VoiceFromEnv() Voice

Jump to

Keyboard shortcuts

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