Help us shape the future of Go! Take the 2026 Go Developer Survey

hive

package
v0.63.0 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2026 License: MIT Imports: 31 Imported by: 0

Documentation

Overview

Package hive is the hive engine both programs run on. Each application service lives in its own subpackage; Engine composes them over the drivers a program hands it and rebuilds the config-derived ones on Reload.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTerminalManager added in v0.58.0

func NewTerminalManager(logger zerolog.Logger, cfg *config.Config, source terminal.PaneSource) *terminal.Manager

NewTerminalManager builds the terminal integration manager from config. tmux is always enabled; availability is checked lazily by the manager.

func OpenDB added in v0.60.0

func OpenDB(ctx context.Context, dataDir string, opts config.DatabaseConfig) (*db.DB, error)

OpenDB opens hive.db in dataDir and imports the JSON stores that predate it.

func StatusOptionsFromConfig added in v0.60.0

func StatusOptionsFromConfig(cfg config.TerminalStatusConfig, pollInterval time.Duration) status.Options

StatusOptionsFromConfig maps the terminal.status config section onto the status tracker's debounce options.

Confirm.Missing is not part of status.Options: the tmux transport reads it as a retry count for failed list-panes calls, not as a tracker rule.

Types

type Engine added in v0.60.0

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

Engine is the hive engine. Accessors return the services built from the current config. Fetch a service per call (e.Sessions().X) and do not hold it across a Reload, or it keeps serving the old config.

func New added in v0.60.0

func New(cfg *config.Config, p Ports) (*Engine, error)

func (*Engine) Bus added in v0.60.0

func (e *Engine) Bus() *events.EventBus

func (*Engine) Config added in v0.60.0

func (e *Engine) Config() *config.Config

Config returns the config the current services were built from.

func (*Engine) Context added in v0.60.0

func (e *Engine) Context() *repocontext.Service

func (*Engine) Doctor added in v0.60.0

func (e *Engine) Doctor(validator doctor.ConfigValidator, plugins []doctor.PluginInfo) *doctor.Service

Doctor returns the health checks for the current config. validator checks the program's whole config: a program whose config has sections the engine does not read passes its own, so those sections are checked too. plugins is what the program wants reported; the engine has none.

func (*Engine) Git added in v0.60.0

func (e *Engine) Git() git.Git

Git returns the git executor for the current GitPath.

func (*Engine) GitStatus added in v0.60.0

func (e *Engine) GitStatus() *gitstatus.Service

func (*Engine) HC added in v0.60.0

func (e *Engine) HC() *hcsvc.Service

HC returns the honeycomb service. It reads no config, so Reload keeps it.

func (*Engine) KV added in v0.63.0

func (e *Engine) KV() kv.KV

KV returns the persistent key-value store. Reload keeps it. The program runs SweepKV.

func (*Engine) Messages added in v0.60.0

func (e *Engine) Messages() *msgsvc.Service

func (*Engine) Notifications added in v0.63.0

func (e *Engine) Notifications() notify.Store

Notifications returns the notification history. Reload keeps it.

func (*Engine) Reload added in v0.60.0

func (e *Engine) Reload(cfg *config.Config) error

Reload swaps in services built from cfg and publishes config.reloaded. A config that fails validation changes nothing: the running services keep serving the config they were built from.

The database, the bus, and the services that read no config (honeycomb, KV, notifications, reviews) are kept, so a changed database section or data dir still needs a restart.

func (*Engine) Renderer added in v0.60.0

func (e *Engine) Renderer() *tmpl.Renderer

Renderer returns the template renderer for the current default agent.

func (*Engine) Reviews added in v0.63.0

func (e *Engine) Reviews() review.Store

Reviews returns the document review sessions and comments. Reload keeps it.

func (*Engine) Sessions added in v0.60.0

func (e *Engine) Sessions() *sessionsvc.Service

func (*Engine) Status added in v0.60.0

func (e *Engine) Status() *statussvc.Service

Status returns the terminal status service, or nil without a PaneSource.

func (*Engine) SweepKV added in v0.63.0

func (e *Engine) SweepKV(ctx context.Context, interval time.Duration)

SweepKV deletes expired KV entries every interval until ctx is done. Reads already treat an expired entry as missing; the sweep only reclaims the rows.

func (*Engine) Terminal added in v0.60.0

func (e *Engine) Terminal() *terminal.Manager

Terminal returns the terminal status manager, or nil without a PaneSource.

func (*Engine) Todos added in v0.60.0

func (e *Engine) Todos() *todosvc.Service

type NotificationRouter added in v0.60.0

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

NotificationRouter maps domain events to user-facing notifications.

func NewNotificationRouter added in v0.60.0

func NewNotificationRouter(bus *events.EventBus) *NotificationRouter

NewNotificationRouter constructs a router for event-to-notification mappings.

func (*NotificationRouter) Register added in v0.60.0

func (r *NotificationRouter) Register()

Register subscribes all supported event mappings.

type Ports added in v0.60.0

type Ports struct {
	// DB is hive.db, opened with OpenDB. The program closes it.
	DB *db.DB
	// Bus is the event bus. The program starts and stops it.
	Bus      *events.EventBus
	Executor executil.Executor
	Mux      sessionsvc.Multiplexer
	// PaneSource feeds terminal status. Nil disables status: Status and
	// Terminal return nil.
	PaneSource terminal.PaneSource
	// DataDir holds the bundled scripts the renderer points spawn commands at.
	DataDir string
	// Styler, Stdout and Stderr shape hook and file-copy output. Nil means
	// plain text to io.Discard.
	Styler sessionsvc.OutputStyler
	Stdout io.Writer
	Stderr io.Writer
	Logger zerolog.Logger
}

Ports are the drivers and process-lived handles a program gives the engine. None of them is rebuilt on Reload.

Directories

Path Synopsis
Package doctor runs health checks on a hive setup.
Package doctor runs health checks on a hive setup.
Code generated by gobusgen; DO NOT EDIT.
Code generated by gobusgen; DO NOT EDIT.
testbus
Package testbus provides test utilities for the event bus.
Package testbus provides test utilities for the event bus.
Package gitstatus reads the git state of session checkouts: branch, dirty tree, unpushed commits and the line delta against the default branch.
Package gitstatus reads the git state of session checkouts: branch, dirty tree, unpushed commits and the line delta against the default branch.
Package hc is the honeycomb task service.
Package hc is the honeycomb task service.
Package messaging publishes and reads inter-agent messages.
Package messaging publishes and reads inter-agent messages.
Package repocontext manages per-repository context directories.
Package repocontext manages per-repository context directories.
Package session is the session service: create, recycle, rename, delete and prune sessions, and spawn their terminals.
Package session is the session service: create, recycle, rename, delete and prune sessions, and spawn their terminals.
scripts
Package scripts embeds and extracts bundled helper scripts (hive-tmux, agent-send).
Package scripts embeds and extracts bundled helper scripts (hive-tmux, agent-send).
Package status reads agent terminal status for sessions and repositories.
Package status reads agent terminal status for sessions and repositories.
Package todo is the todo service and its creation limiter.
Package todo is the todo service and its creation limiter.

Jump to

Keyboard shortcuts

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