hive

package
v0.59.0 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2026 License: MIT Imports: 41 Imported by: 0

Documentation

Overview

Package hive provides the service layer for orchestrating hive operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildSourceRegistry added in v0.55.0

func BuildSourceRegistry(cfg *config.Config, exec cliengine.Executor, kvStore kv.KV, logger zerolog.Logger) *sources.Registry

BuildSourceRegistry constructs the sources.Registry from cfg, registering a per-backend source for each enabled builtin. Registration failures are logged and the offending entry is skipped rather than failing startup.

func NewTerminalManager added in v0.58.0

func NewTerminalManager(cfg *config.Config) *terminal.Manager

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

func RenderUserCommandWindows added in v0.32.0

func RenderUserCommandWindows(renderer *tmpl.Renderer, windows []config.WindowConfig, data map[string]any) ([]coretmux.RenderedWindow, error)

RenderUserCommandWindows renders windows from a UserCommand using the provided template data map. Unlike RenderWindows, it accepts map[string]any to include .Form and session variables.

func RenderWindows added in v0.32.0

func RenderWindows(renderer *tmpl.Renderer, windows []config.WindowConfig, data SpawnData) ([]coretmux.RenderedWindow, error)

RenderWindows renders a slice of WindowConfig templates against SpawnData, producing fully-resolved RenderedWindow values ready for the tmux Client.

func RootStatusKey added in v0.58.0

func RootStatusKey(path string) string

RootStatusKey returns the FetchBatch result key for a root checkout. Prefixed so it can never collide with session IDs, which share the map.

func ShouldExposeWindows added in v0.58.0

func ShouldExposeWindows(windows []WindowStatus) bool

ShouldExposeWindows reports whether a session's windows warrant per-window breakdown: more than one window, or a single window with multiple agent panes.

Types

type App

type App struct {
	Sessions  *SessionService
	Messages  *MessageService
	Context   *ContextService
	Doctor    *DoctorService
	Todos     *TodoService
	Honeycomb *HoneycombService
	Status    *StatusService

	Bus        *eventbus.EventBus
	Terminal   *terminal.Manager
	Plugins    *plugins.Manager
	CommandSet *plugins.CommandSet
	Config     *config.Config
	DB         *db.DB
	KV         kv.KV
	Renderer   *tmpl.Renderer
	Build      BuildInfo
	Sources    *sources.Registry
}

App is the central entry point for all hive operations. Commands and TUI consume App instead of cherry-picking raw dependencies.

func NewApp

func NewApp(
	sessions *SessionService,
	msgStore messaging.Store,
	todoStore todo.Store,
	hcStore hc.Store,
	cfg *config.Config,
	bus *eventbus.EventBus,
	termMgr *terminal.Manager,
	pluginMgr *plugins.Manager,
	commandSet *plugins.CommandSet,
	database *db.DB,
	kvStore kv.KV,
	renderer *tmpl.Renderer,
	pluginInfos []doctor.PluginInfo,
	logger zerolog.Logger,
) *App

NewApp constructs an App from explicit dependencies.

type BuildInfo added in v0.32.0

type BuildInfo struct {
	Version string
	Commit  string
	Date    string
}

BuildInfo holds build-time metadata set by the main package.

type ContextService

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

ContextService manages per-repository context directories.

func NewContextService

func NewContextService(cfg *config.Config, gitClient git.Git) *ContextService

NewContextService creates a new ContextService.

func (c *ContextService) CreateSymlink(ctxDir string) (bool, error)

CreateSymlink creates a symlink from the current directory to the context directory. Returns true if the symlink already existed and pointed to the correct target.

func (*ContextService) Init

func (c *ContextService) Init(ctxDir string) ([]string, error)

Init creates the context directory and standard subdirectories. Returns the list of subdirectories that were newly created.

func (*ContextService) Prune

func (c *ContextService) Prune(ctxDir string, olderThan time.Duration) (int, error)

Prune deletes files in the context directory older than the given duration. Returns the number of files removed.

func (*ContextService) ResolveDir

func (c *ContextService) ResolveDir(ctx context.Context, repo string, shared bool) (string, error)

ResolveDir determines the context directory for the given repo spec. If repo is "owner/repo", it resolves directly. If shared is true, returns the shared dir. Otherwise detects from the current directory's git remote.

type CreateOptions

type CreateOptions struct {
	Name          string // Session name (used in path)
	SessionID     string // Session ID (auto-generated if empty)
	Prompt        string // Prompt to pass to spawned terminal (batch only)
	Remote        string // Git remote URL to clone (auto-detected if empty)
	Source        string // Source directory for file copying
	UseBatchSpawn bool   // Use batch_spawn commands instead of spawn
	Background    bool   // Create session without attaching to tmux
	// CloneStrategy selects the clone method: "full" (default) or "worktree".
	// Empty resolves via config rule matching, then global config, then "full".
	CloneStrategy string
	// SkipSpawn skips the configured spawn strategy (spawn: / batch_spawn: / windows:).
	// The caller is responsible for launching any terminal or tmux session. Use this
	// when the session directory is needed but terminal management happens elsewhere
	// (e.g. CreateSessionWithWindows, which creates the tmux session itself).
	SkipSpawn bool
	// AgentKey selects a named agent profile for this session's spawn command.
	// When non-empty, the spawn templates use that profile's command/flags instead
	// of the process-wide default. Must match a key in config.Agents.Profiles.
	AgentKey string
	// Tags are user-defined labels attached to the session for external provider tracking.
	Tags []string
	// Progress receives human-readable progress lines during session creation.
	// When non-nil, service output (hooks, file copies) is also redirected here.
	Progress io.Writer
}

type DoctorService

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

DoctorService runs health checks on the hive setup.

func NewDoctorService

func NewDoctorService(store session.Store, cfg *config.Config, pluginInfos []doctor.PluginInfo) *DoctorService

NewDoctorService creates a new DoctorService.

func (*DoctorService) RunChecks

func (d *DoctorService) RunChecks(ctx context.Context, configPath string, autofix bool) []doctor.Result

RunChecks executes all doctor checks and returns results.

type FileCopier

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

FileCopier copies files from a source directory to a destination.

func NewFileCopier

func NewFileCopier(log zerolog.Logger, stdout io.Writer) *FileCopier

NewFileCopier creates a new FileCopier.

func (*FileCopier) CopyFiles

func (c *FileCopier) CopyFiles(ctx context.Context, rule config.Rule, sourceDir, destDir string) error

CopyFiles copies files matching the rule's copy patterns from sourceDir to destDir.

type HoneycombService added in v0.37.0

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

HoneycombService orchestrates hc item and comment operations.

func NewHoneycombService added in v0.37.0

func NewHoneycombService(store hc.Store, logger zerolog.Logger) *HoneycombService

NewHoneycombService creates a new HoneycombService.

func (*HoneycombService) AddBlocker added in v0.39.0

func (s *HoneycombService) AddBlocker(ctx context.Context, blockerID, blockedID string) error

AddBlocker records that blockerID blocks blockedID. Cycle detection and the insert are performed atomically by the store. Returns hc.ErrCyclicDependency if the edge would create a cycle.

func (*HoneycombService) AddComment added in v0.37.0

func (s *HoneycombService) AddComment(ctx context.Context, itemID, message string) (hc.Comment, error)

AddComment attaches a new comment to an item and returns the created comment.

func (*HoneycombService) Context added in v0.37.0

func (s *HoneycombService) Context(ctx context.Context, epicID, sessionID string) (hc.ContextBlock, error)

Context assembles a ContextBlock for the given epic and session.

func (*HoneycombService) CreateBulk added in v0.37.0

func (s *HoneycombService) CreateBulk(ctx context.Context, repoKey string, input hc.CreateInput) ([]hc.Item, error)

CreateBulk walks a CreateInput tree (BFS) and persists all items in one atomic call. The root node must be of type epic.

func (*HoneycombService) CreateItem added in v0.37.0

func (s *HoneycombService) CreateItem(ctx context.Context, repoKey string, input hc.CreateItemInput) (hc.Item, error)

CreateItem creates a single hc item, resolving parent relationships when a ParentID is supplied.

func (*HoneycombService) DeleteItem added in v0.38.0

func (s *HoneycombService) DeleteItem(ctx context.Context, id string) error

DeleteItem removes an item by ID.

func (*HoneycombService) GetItem added in v0.37.0

func (s *HoneycombService) GetItem(ctx context.Context, id string) (hc.Item, error)

GetItem returns an item by ID.

func (*HoneycombService) ListBlockers added in v0.39.0

func (s *HoneycombService) ListBlockers(ctx context.Context, itemID string) ([]string, error)

ListBlockers returns IDs of open/in_progress items that explicitly block the given item.

func (*HoneycombService) ListComments added in v0.37.0

func (s *HoneycombService) ListComments(ctx context.Context, itemID string) ([]hc.Comment, error)

ListComments returns all comments for an item in chronological order.

func (*HoneycombService) ListItems added in v0.37.0

func (s *HoneycombService) ListItems(ctx context.Context, filter hc.ListFilter) ([]hc.Item, error)

ListItems returns items matching the supplied filter.

func (*HoneycombService) ListRepoKeys added in v0.38.0

func (s *HoneycombService) ListRepoKeys(ctx context.Context) ([]string, error)

ListRepoKeys returns all distinct, non-empty repo keys.

func (*HoneycombService) Next added in v0.37.0

func (s *HoneycombService) Next(ctx context.Context, filter hc.NextFilter) (hc.Item, bool, error)

Next returns the next actionable item for the given filter.

func (*HoneycombService) Prune added in v0.37.0

func (s *HoneycombService) Prune(ctx context.Context, opts hc.PruneOpts) (int, error)

Prune delegates to the store's Prune implementation.

func (*HoneycombService) RemoveBlocker added in v0.39.0

func (s *HoneycombService) RemoveBlocker(ctx context.Context, blockerID, blockedID string) error

RemoveBlocker removes the explicit blocker relationship.

func (*HoneycombService) UpdateItem added in v0.37.0

func (s *HoneycombService) UpdateItem(ctx context.Context, id string, update hc.ItemUpdate) (hc.Item, error)

UpdateItem applies a partial update to an item and returns the result. If the item is an epic and the update transitions it to a terminal status (done or cancelled) from a different status, all non-terminal descendants are updated to the same terminal status.

type HookRunner

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

HookRunner executes repository-specific setup hooks.

func NewHookRunner

func NewHookRunner(log zerolog.Logger, executor executil.Executor, renderer *tmpl.Renderer, stdout, stderr io.Writer) *HookRunner

NewHookRunner creates a new HookRunner.

func (*HookRunner) RunHooks

func (h *HookRunner) RunHooks(ctx context.Context, rule config.Rule, path string, data config.SpawnTemplateData) error

RunHooks executes the commands from a matched rule, rendering each as a Go template.

type MessageService

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

MessageService wraps messaging.Store with domain logic.

func NewMessageService

func NewMessageService(store messaging.Store, cfg *config.Config, bus *eventbus.EventBus) *MessageService

NewMessageService creates a new MessageService.

func (*MessageService) Acknowledge

func (m *MessageService) Acknowledge(ctx context.Context, consumerID string, messageIDs []string) error

Acknowledge marks messages as read by a consumer.

func (*MessageService) GenerateTopic

func (m *MessageService) GenerateTopic(prefix string) string

GenerateTopic creates a new topic name using the configured prefix and a random suffix.

func (*MessageService) GetUnread

func (m *MessageService) GetUnread(ctx context.Context, consumerID string, topic string) ([]messaging.Message, error)

GetUnread returns messages not yet acknowledged by consumer.

func (*MessageService) ListTopics

func (m *MessageService) ListTopics(ctx context.Context) ([]string, error)

ListTopics returns all topic names.

func (*MessageService) Prune

func (m *MessageService) Prune(ctx context.Context, olderThan time.Duration) (int, error)

Prune removes messages older than the given duration.

func (*MessageService) Publish

Publish adds a message to multiple topics. Returns the resolved topics after wildcard expansion.

func (*MessageService) Subscribe

func (m *MessageService) Subscribe(ctx context.Context, topic string, since time.Time) ([]messaging.Message, error)

Subscribe returns all messages for a topic, optionally filtered by since timestamp.

type PaneStatus added in v0.58.0

type PaneStatus struct {
	PaneID      string
	Status      terminal.Status
	Tool        string
	PaneContent string
	IsAgent     bool
}

PaneStatus holds per-pane terminal status for agent panes.

type RecycleData

type RecycleData struct {
	DefaultBranch string
}

RecycleData contains template data for recycle commands.

type Recycler

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

Recycler handles resetting a session environment for reuse.

func NewRecycler

func NewRecycler(log zerolog.Logger, executor executil.Executor, renderer *tmpl.Renderer) *Recycler

NewRecycler creates a new Recycler.

func (*Recycler) Recycle

func (r *Recycler) Recycle(ctx context.Context, path string, commands []string, data RecycleData, w io.Writer) error

Recycle executes recycle commands sequentially in the session directory. Commands are rendered as Go templates with the provided data. Output is written to the provided writer. If w is nil, output is discarded.

type RootRepoTarget added in v0.58.0

type RootRepoTarget struct {
	Name string
	Path string
}

RootRepoTarget identifies a workspace checkout to poll for agent status. Name doubles as the tmux session slug because opening a repo header names the root repo's tmux session after the repo name.

type SessionClient added in v0.32.0

type SessionClient interface {
	CreateSession(ctx context.Context, name, workDir string, windows []coretmux.RenderedWindow, background bool) error
	OpenSession(ctx context.Context, name, workDir string, windows []coretmux.RenderedWindow, background bool, targetWindow string) error
	AddWindows(ctx context.Context, name, workDir string, windows []coretmux.RenderedWindow) error
	AttachOrSwitch(ctx context.Context, name string) error
}

SessionClient is the interface used by consumers that create/open tmux sessions.

type SessionLaunchOptions added in v0.58.0

type SessionLaunchOptions struct {
	Repositories      []SessionLaunchRepository
	DefaultRepository string
	Agents            []string
	DefaultAgent      string
}

SessionLaunchOptions supplies the configured repositories and agents for an interactive session launcher.

type SessionLaunchRepository added in v0.58.0

type SessionLaunchRepository struct {
	Name   string
	Remote string
	Source string
}

CreateOptions configures session creation. SessionLaunchRepository is a repository available to an interactive session launch. Source is an existing local checkout used for Hive's normal file-copy behavior; desktop maps this to a narrower presentation DTO.

type SessionRisk added in v0.44.0

type SessionRisk struct {
	UncommittedChanges bool
	UnpushedCommits    bool
}

SessionRisk describes uncommitted or unpushed work that would be lost if a session is deleted or recycled. Only meaningful for active sessions.

func (SessionRisk) HasRisk added in v0.44.0

func (r SessionRisk) HasRisk() bool

HasRisk returns true if any data would be lost.

type SessionService

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

SessionService orchestrates hive session operations.

func NewSessionService

func NewSessionService(
	sessions session.Store,
	gitClient git.Git,
	cfg *config.Config,
	bus *eventbus.EventBus,
	exec executil.Executor,
	renderer *tmpl.Renderer,
	log zerolog.Logger,
	stdout, stderr io.Writer,
) *SessionService

NewSessionService creates a new SessionService.

func (*SessionService) AddWindowsToTmuxSession added in v0.32.0

func (s *SessionService) AddWindowsToTmuxSession(ctx context.Context, tmuxName, workDir string, windows []action.WindowSpec, background bool) error

AddWindowsToTmuxSession adds windows to an existing tmux session, converting action.WindowSpec to coretmux.RenderedWindow. Satisfies the command.WindowSpawner interface.

func (*SessionService) CheckSessionRisk added in v0.44.0

func (s *SessionService) CheckSessionRisk(ctx context.Context, id string) (SessionRisk, error)

CheckSessionRisk checks whether an active session has uncommitted or unpushed changes. Non-active sessions (recycled, corrupted) always return an empty risk. Git errors are treated conservatively: IsClean failures assume dirty; HasUnpushedCommits failures assume no unpushed commits.

func (*SessionService) CreateSession

func (s *SessionService) CreateSession(ctx context.Context, opts CreateOptions) (*session.Session, error)

CreateSession creates a new session or recycles an existing one.

func (*SessionService) CreateSessionWithWindows added in v0.32.0

func (s *SessionService) CreateSessionWithWindows(ctx context.Context, req action.NewSessionRequest, windows []action.WindowSpec, background bool) error

CreateSessionWithWindows creates a new Hive session, optionally runs shCmd in its directory, then opens tmux windows in it. Non-zero shCmd exit aborts window creation. Satisfies the command.WindowSpawner interface.

func (*SessionService) DeleteSession

func (s *SessionService) DeleteSession(ctx context.Context, id string) error

DeleteSession removes a session and its directory.

func (*SessionService) DetectRemote

func (s *SessionService) DetectRemote(ctx context.Context, dir string) (string, error)

DetectRemote gets the git remote URL from the specified directory.

func (*SessionService) DetectSession

func (s *SessionService) DetectSession(ctx context.Context) (string, error)

DetectSession returns the session ID for the current working directory. Returns empty string if not in a hive session.

func (*SessionService) GetSession

func (s *SessionService) GetSession(ctx context.Context, id string) (session.Session, error)

GetSession returns a session by ID.

func (*SessionService) Git

func (s *SessionService) Git() git.Git

Git returns the git client for use in background operations.

func (*SessionService) ListSessions

func (s *SessionService) ListSessions(ctx context.Context) ([]session.Session, error)

ListSessions returns all sessions.

func (*SessionService) OpenTmuxSession added in v0.32.0

func (s *SessionService) OpenTmuxSession(ctx context.Context, name, path, remote, targetWindow string, background bool) error

OpenTmuxSession opens (or creates) a tmux session for the given session parameters. It resolves the spawn strategy, renders window templates, and delegates to the spawner.

func (*SessionService) Prune

func (s *SessionService) Prune(ctx context.Context, all bool) (int, error)

Prune removes recycled and corrupted sessions and their directories. If all is true, deletes ALL recycled sessions. If all is false, respects max_recycled limit per repository (keeps newest N).

func (*SessionService) RecycleSession

func (s *SessionService) RecycleSession(ctx context.Context, id string, w io.Writer) error

RecycleSession marks a session for recycling and runs recycle commands. The session directory is not moved; only the DB record state changes. Output is written to w. If w is nil, output is discarded.

func (*SessionService) RenameSession

func (s *SessionService) RenameSession(ctx context.Context, id, newName string) error

RenameSession changes the name (and slug) of an existing session.

func (*SessionService) ResolveSessionLaunchRepository added in v0.58.0

func (s *SessionService) ResolveSessionLaunchRepository(ctx context.Context, remote string) (SessionLaunchRepository, error)

ResolveSessionLaunchRepository selects a known local checkout when the requested remote is equivalent. Non-GitHub and local paths match only by their exact spelling, preserving explicit choices made by the caller.

func (*SessionService) SessionLaunchOptions added in v0.58.0

func (s *SessionService) SessionLaunchOptions(ctx context.Context) (SessionLaunchOptions, error)

SessionLaunchOptions lists repositories from configured workspaces followed by existing on-disk Hive sessions. Equivalent GitHub remote spellings are coalesced so a local configured checkout wins over a Hive clone without rewriting either configured URL.

func (*SessionService) SetSessionGroup added in v0.33.0

func (s *SessionService) SetSessionGroup(ctx context.Context, id, group string) error

SetSessionGroup sets or clears the user-assigned group for a session. An empty group clears the assignment.

func (*SessionService) SilenceOutput added in v0.32.0

func (s *SessionService) SilenceOutput() (restore func())

SilenceOutput redirects all output to io.Discard and returns a restore function that reverts to the previous writers. Call before starting the TUI to prevent hook and spawn output from corrupting the terminal display.

type SpawnData

type SpawnData struct {
	Path       string // Absolute path to session directory
	Name       string // Session name (display name)
	Prompt     string // User-provided prompt (batch only)
	Slug       string // Session slug (URL-safe version of name)
	ContextDir string // Path to context directory
	Owner      string // Repository owner
	Repo       string // Repository name
}

SpawnData is the template context for spawn commands.

type Spawner

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

Spawner handles terminal spawning with template rendering.

func NewSpawner

func NewSpawner(log zerolog.Logger, executor executil.Executor, renderer *tmpl.Renderer, tmuxClient SessionClient, stdout, stderr io.Writer) *Spawner

NewSpawner creates a new Spawner.

func (*Spawner) AddWindowsToTmuxSession added in v0.32.0

func (s *Spawner) AddWindowsToTmuxSession(ctx context.Context, tmuxName, workDir string, windows []coretmux.RenderedWindow, background bool) error

AddWindowsToTmuxSession adds pre-rendered windows to an existing tmux session. If background is false, switches to the session after adding windows.

func (*Spawner) OpenWindows added in v0.32.0

func (s *Spawner) OpenWindows(ctx context.Context, windows []config.WindowConfig, data SpawnData, background bool, targetWindow string) error

OpenWindows renders window templates and opens (or creates) a tmux session. If the session already exists, it attaches to it (optionally selecting targetWindow).

func (*Spawner) OpenWindowsWith added in v0.52.0

func (s *Spawner) OpenWindowsWith(ctx context.Context, windows []config.WindowConfig, data SpawnData, background bool, targetWindow string, renderer *tmpl.Renderer) error

OpenWindowsWith renders window templates using the given renderer and opens (or creates) a tmux session.

func (*Spawner) Spawn

func (s *Spawner) Spawn(ctx context.Context, commands []string, data SpawnData) error

Spawn executes spawn commands sequentially with template rendering.

func (*Spawner) SpawnWindows added in v0.32.0

func (s *Spawner) SpawnWindows(ctx context.Context, windows []config.WindowConfig, data SpawnData, background bool) error

SpawnWindows renders window templates and creates a tmux session.

func (*Spawner) SpawnWindowsWith added in v0.49.0

func (s *Spawner) SpawnWindowsWith(ctx context.Context, windows []config.WindowConfig, data SpawnData, background bool, renderer *tmpl.Renderer) error

SpawnWindowsWith renders window templates using the given renderer and creates a tmux session.

func (*Spawner) SpawnWith added in v0.49.0

func (s *Spawner) SpawnWith(ctx context.Context, commands []string, data SpawnData, renderer *tmpl.Renderer) error

SpawnWith executes spawn commands using the given renderer instead of the default.

type StatusService added in v0.58.0

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

StatusService performs agent status detection for sessions via terminal integrations. It is UI-agnostic so embedders can run status checks outside the TUI.

func NewStatusService added in v0.58.0

func NewStatusService(term *terminal.Manager, workers int) *StatusService

NewStatusService creates a StatusService. workers bounds the number of concurrent per-session status fetches in FetchBatch.

func (*StatusService) Available added in v0.58.0

func (s *StatusService) Available() bool

Available reports whether any terminal integration is enabled and usable. It is safe to call on a nil service.

func (*StatusService) FetchBatch added in v0.58.0

func (s *StatusService) FetchBatch(ctx context.Context, sessions []*session.Session, roots []RootRepoTarget) map[string]TerminalStatus

FetchBatch fetches terminal status for the given sessions and workspace root checkouts concurrently. Results are keyed by session ID for sessions and by RootStatusKey for roots. Non-active sessions are skipped. Each per-target fetch is bounded by an internal timeout in addition to ctx.

Roots must share the batch rather than run as a separate call: the tmux integration only serves discovery from a cache younger than 2s, so a separate call would race the RefreshAll here and see a stale cache, silently missing statuses.

func (*StatusService) FetchSession added in v0.58.0

func (s *StatusService) FetchSession(ctx context.Context, sess *session.Session) TerminalStatus

FetchSession fetches terminal status for a single session.

type TerminalStatus added in v0.58.0

type TerminalStatus struct {
	Status      terminal.Status
	Tool        string
	WindowName  string
	PaneContent string
	IsLoading   bool
	Error       error
	Windows     []WindowStatus // per-window statuses (populated only for multi-window sessions)
}

TerminalStatus holds the terminal integration status for a session.

type TodoLimiter added in v0.34.0

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

TodoLimiter enforces rate and capacity limits on todo creation.

func NewTodoLimiter added in v0.34.0

func NewTodoLimiter(store todo.Store, cfg config.TodosLimiterConfig) *TodoLimiter

NewTodoLimiter creates a limiter with the given configuration.

func (*TodoLimiter) Check added in v0.34.0

func (l *TodoLimiter) Check(ctx context.Context, t todo.Todo) error

Check returns nil if the todo is allowed, or an error describing why it was rejected.

type TodoService added in v0.34.0

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

TodoService orchestrates todo operations with rate limiting and event publishing.

func NewTodoService added in v0.34.0

func NewTodoService(store todo.Store, bus *eventbus.EventBus, cfg *config.Config, logger zerolog.Logger) *TodoService

NewTodoService creates a new TodoService.

func (*TodoService) Acknowledge added in v0.34.0

func (s *TodoService) Acknowledge(ctx context.Context, id string) (todo.Todo, error)

Acknowledge updates a todo's status to acknowledged.

func (*TodoService) Add added in v0.34.0

func (s *TodoService) Add(ctx context.Context, t todo.Todo) (todo.Todo, error)

Add creates a new todo item after passing validation and limiter checks.

func (*TodoService) Complete added in v0.34.0

func (s *TodoService) Complete(ctx context.Context, id string) (todo.Todo, error)

Complete updates a todo's status to completed.

func (*TodoService) CountOpen added in v0.34.0

func (s *TodoService) CountOpen(ctx context.Context) (int, error)

CountOpen returns the number of open (pending + acknowledged) todo items.

func (*TodoService) CountPending added in v0.34.0

func (s *TodoService) CountPending(ctx context.Context) (int, error)

CountPending returns the number of pending todo items.

func (*TodoService) Dismiss added in v0.34.0

func (s *TodoService) Dismiss(ctx context.Context, id string) (todo.Todo, error)

Dismiss updates a todo's status to dismissed.

func (*TodoService) Get added in v0.34.0

func (s *TodoService) Get(ctx context.Context, id string) (todo.Todo, error)

Get retrieves a single todo item by ID.

func (*TodoService) List added in v0.34.0

func (s *TodoService) List(ctx context.Context, filter todo.ListFilter) ([]todo.Todo, error)

List returns todo items matching the given filter.

func (*TodoService) Reopen added in v0.39.0

func (s *TodoService) Reopen(ctx context.Context, id string) (todo.Todo, error)

Reopen reverts a completed or dismissed todo back to acknowledged.

type WindowStatus added in v0.58.0

type WindowStatus struct {
	WindowIndex string
	WindowName  string
	Status      terminal.Status
	Tool        string
	PaneContent string
	Panes       []PaneStatus
}

WindowStatus holds per-window terminal status for multi-window sessions.

Directories

Path Synopsis
Package plugins provides a plugin system for extending Hive with additional commands and status providers.
Package plugins provides a plugin system for extending Hive with additional commands and status providers.
claude
Package claude provides Claude Code integration for Hive.
Package claude provides Claude Code integration for Hive.
contextdir
Package contextdir provides commands for opening context directories.
Package contextdir provides commands for opening context directories.
github
Package github provides a GitHub plugin for Hive.
Package github provides a GitHub plugin for Hive.
lazygit
Package lazygit provides a lazygit plugin for Hive.
Package lazygit provides a lazygit plugin for Hive.
neovim
Package neovim provides a Neovim plugin for Hive.
Package neovim provides a Neovim plugin for Hive.
tmux
Package tmux provides a tmux plugin for Hive with default session management commands.
Package tmux provides a tmux plugin for Hive with default session management commands.
Package scripts embeds and extracts bundled helper scripts (hive-tmux, agent-send).
Package scripts embeds and extracts bundled helper scripts (hive-tmux, agent-send).

Jump to

Keyboard shortcuts

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