Versions in this module Expand all Collapse all v1 v1.1.0 Nov 17, 2026 Changes in this version + var ErrNoCandles = errors.New("no candles") + var ErrStopped = errors.New("the controller is stopping: nothing starts anymore") + func LockPIDs(dir string) (release func(), err error) + func StartServices(ctx context.Context, sup *Supervisor, services []config.Service, dir string) ([]string, error) + type Agent struct + Address string + Kind string + Name string + type AgentState struct + Exited bool + LaunchError string + RestartPending bool + type Backlog struct + Failing bool + Held int + Pending int + SetApart int + Since time.Time + type Backtests struct + func (b *Backtests) Cancel(ctx context.Context, id int64) (bool, error) + func (b *Backtests) Run(ctx context.Context) + func (b *Backtests) Wake() + type Bot interface + Apply func(cfg TelegramConfig) + SyncRelays func(names []string) + type BotState interface + Running func() bool + type Dashboard struct + func NewDashboard(agents []Agent, options ...DashboardOption) (*Dashboard, error) + func (d *Dashboard) Handler(ctx context.Context) http.Handler + func (d *Dashboard) Online(ctx context.Context, name string) bool + func (d *Dashboard) PrepareMT5Accounts(ctx context.Context) + func (d *Dashboard) RunMT5Accounts(ctx context.Context) + func (d *Dashboard) ServeBacktests(s *store.Store, agents config.Agents, cfg config.Backtest) *Backtests + func (d *Dashboard) ServeSettings(s *store.Store, manager *Manager, bot BotState) + func (d *Dashboard) ServeSupervision(s *store.Store, manager *Manager) *Supervision + func (d *Dashboard) SetAgents(agents []Agent) error + type DashboardOption func(*Dashboard) + func WithCacheDir(dir string) DashboardOption + func WithHTTPClient(client *http.Client) DashboardOption + func WithTrustedProxies(proxies []netip.Prefix) DashboardOption + func WithUIDir(dir string) DashboardOption + func WithUIVersion(version string) DashboardOption + func WithUsers(users Users) DashboardOption + type Manager struct + func NewManager(s *store.Store, agents config.Agents, sup *Supervisor, dashboard *Dashboard, ...) *Manager + func (m *Manager) Fence(name string) (release func()) + func (m *Manager) InternalHandler() http.Handler + func (m *Manager) Outbox(id int64) *ui.AgentOutbox + func (m *Manager) Reconcile(ctx context.Context) error + func (m *Manager) RefreshRuntime(ctx context.Context, name string) error + func (m *Manager) RenameOutbox(id int64, from, to string) (undo func(), err error) + func (m *Manager) Restart(ctx context.Context, name string) error + func (m *Manager) Run(ctx context.Context) + func (m *Manager) State(name string) AgentState + func (m *Manager) Trigger() + type Prepare func() (env map[string]string, release func(), err error) + type ProcessSpec struct + Command []string + Dir string + Env map[string]string + Name string + Restart bool + StopTimeout time.Duration + type ProcessState struct + LastExit string + PID int + Restarting bool + Restarts int + Running bool + Since time.Time + type PromptStore interface + AgentByName func(ctx context.Context, name string) (store.Agent, error) + Agents func(ctx context.Context) ([]store.Agent, error) + PromptByName func(ctx context.Context, name string) (store.Prompt, error) + Prompts func(ctx context.Context) ([]store.PromptSummary, error) + SetAgentPrompt func(ctx context.Context, id int64, promptID *int64) error + UpdatePrompt func(ctx context.Context, id int64, edit store.PromptEdit, by string) (store.Prompt, error) + type Supervision struct + func (s *Supervision) Analyze(ctx context.Context, origin, by string) (store.SupervisorRun, error) + func (s *Supervision) Ask(ctx context.Context, userID int64, by, text string) ([]store.SupervisorMessage, error) + func (s *Supervision) AskFollowed(ctx context.Context, userID int64, by, text string, events chatEvents) ([]store.SupervisorMessage, error) + func (s *Supervision) Confirm(ctx context.Context, id, userID int64, by string) (store.SupervisorAction, store.SupervisorMessage, error) + func (s *Supervision) Reject(ctx context.Context, id, userID int64, by string) (store.SupervisorAction, store.SupervisorMessage, error) + func (s *Supervision) Run(ctx context.Context) + func (s *Supervision) Trigger() + type Supervisor struct + func NewSupervisor(stdout, stderr io.Writer, stopTimeout time.Duration) *Supervisor + func (s *Supervisor) KeepPIDs(dir string) error + func (s *Supervisor) KillAll() + func (s *Supervisor) Running(name string) bool + func (s *Supervisor) Start(spec ProcessSpec, prepare Prepare) error + func (s *Supervisor) State(name string) ProcessState + func (s *Supervisor) Stop(name string) + func (s *Supervisor) StopAll() + func (s *Supervisor) StopLeftovers() + type Telegram struct + func NewTelegram(dashboard *Dashboard, token string, users []int64, options ...TelegramOption) (*Telegram, error) + func (t *Telegram) SetUsers(users []int64) + func (t *Telegram) Start(ctx context.Context) + func (t *Telegram) SyncRelays(names []string) + type TelegramConfig struct + Enabled bool + Token string + Users []int64 + type TelegramOption func(*Telegram) + func WithPrompts(prompts PromptStore, onChange func()) TelegramOption + type TelegramRunner struct + func NewTelegramRunner(ctx context.Context, dashboard *Dashboard, options ...TelegramOption) *TelegramRunner + func (r *TelegramRunner) Apply(cfg TelegramConfig) + func (r *TelegramRunner) Running() bool + func (r *TelegramRunner) SyncRelays(names []string) + type Users interface + Authenticate func(ctx context.Context, username, password string) (store.User, error) + CountUsers func(ctx context.Context) (int64, error) + User func(ctx context.Context, id int64) (store.User, error)