Documentation
¶
Overview ¶
Package app is the hive CLI's composition root: the engine services plus the pieces only the CLI has (plugins, the command set, sources, its config).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildSourceRegistry ¶
func BuildSourceRegistry(logger zerolog.Logger, cfg *config.Config, exec cliengine.Executor, kvStore kv.KV) *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.
Types ¶
type App ¶
type App struct {
*hive.Engine
// Logger carries no cmp label. A command or component adds its own.
Logger zerolog.Logger
// Config is the CLI config. It shadows Engine.Config, and its embedded
// engine half is the config the engine was built from.
Config *config.Config
Doctor *doctor.Service
Multiplexer Multiplexer
Plugins *plugins.Manager
CommandSet *plugins.CommandSet
Build BuildInfo
Sources *sources.Registry
}
App is the central entry point for all hive operations. It embeds the engine, whose accessors (Sessions, Messages, HC, ...) commands and the TUI call per use, and adds what only the CLI has.
func NewApp ¶
func NewApp( logger zerolog.Logger, engine *hive.Engine, cfg *config.Config, multiplexer Multiplexer, pluginMgr *plugins.Manager, commandSet *plugins.CommandSet, pluginInfos []doctor.PluginInfo, ) *App
NewApp wraps an engine built from &cfg.Config with the CLI pieces. Doctor validates the whole CLI config, so `hive doctor` keeps reporting errors in sections only the CLI reads.
type Multiplexer ¶
type Multiplexer interface {
sessionsvc.Multiplexer
terminal.PaneSource
ResolveTarget(ctx context.Context, raw string) (multiplexer.Pane, error)
SendLiteral(ctx context.Context, target multiplexer.Target, text string) error
SendKey(ctx context.Context, target multiplexer.Target, key multiplexer.NamedKey) error
Paste(ctx context.Context, target multiplexer.Target, text []byte, opts multiplexer.PasteOptions) error
}
Multiplexer exposes the shared operations used by application commands.