plugin

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package plugin defines the AgentBBS plugin contract (PRD §4.3).

A plugin is one interface implementation plus one registration in the hub. Plugins return control to the hub by emitting ExitMsg, never by quitting the session.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Exit

func Exit() tea.Msg

Exit is a convenience command for plugins.

Types

type Context

type Context struct {
	Store   store.Store
	Sandbox *sandbox.Runner
	// DataDir is the per-user persistent directory (members/agents only;
	// empty for guests).
	DataDir string
	// AssetsDir is the read-only platform assets tree (wads, binaries).
	AssetsDir string
	// Host is the BBS hostname (e.g. bbs.profullstack.com), for building
	// member homepage URLs (https://Host/~name) and similar links.
	Host string
	// Term is the client PTY's terminal type (e.g. xterm-256color). Needed by
	// sandboxed ncurses games (Space Invaders, Pac-Man, Tetris, Moon Patrol),
	// which call initscr() and fail with "Error opening terminal" if TERM is
	// unset — the systemd daemon environment has no TERM to inherit.
	Term string
}

Context carries the shared services a plugin may use.

type ExitMsg

type ExitMsg struct{}

ExitMsg is emitted by a plugin model to hand the session back to the hub.

type Plugin

type Plugin interface {
	// ID is a stable unique identifier, e.g. "arcade".
	ID() string
	// Title is the hub menu label.
	Title() string
	// Description is a one-line summary shown in the menu.
	Description() string
	// RequiresAuth reports whether guests are admitted.
	RequiresAuth() bool
	// New returns a fresh Bubble Tea model for one session.
	New(user auth.User, ctx Context) tea.Model
}

Plugin is the only integration point between a feature and the hub.

Jump to

Keyboard shortcuts

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