plugins

package
v0.0.20 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2026 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package plugins implements a builtin controller that fetches a plugin registry index and presents each available plugin as a configurable entity. Enabled plugins are run as isolated subprocesses.

The index is loaded from index.json next to the executable first, falling back to the upstream GitHub copy.

Index

Constants

View Source
const RegistryURL = "https://raw.githubusercontent.com/projectqai/hydris/main/index.json"

RegistryURL is the raw GitHub URL used as a fallback when no local index.json exists next to the executable.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, logger *slog.Logger, serverURL string) error

Types

type PluginIndex

type PluginIndex struct {
	HydrisVersion string       `json:"hydris_version"`
	Plugins       []PluginInfo `json:"plugins"`
}

PluginIndex is the top-level structure of index.json.

func FetchIndex

func FetchIndex(ctx context.Context) (*PluginIndex, error)

FetchIndex tries to read index.json from the directory containing the running executable. If that file does not exist or cannot be parsed, it falls back to fetching the index from GitHub.

func FetchRemoteIndexFromURL

func FetchRemoteIndexFromURL(ctx context.Context, url, token string) (*PluginIndex, error)

FetchRemoteIndexFromURL fetches and parses an index.json from the given URL. If token is non-empty it is sent as a Bearer Authorization header.

type PluginInfo

type PluginInfo struct {
	Name        string `json:"name"`
	Ref         string `json:"ref"`
	Label       string `json:"label"`
	Description string `json:"description"`
	Icon        string `json:"icon,omitempty"`
	Compat      string `json:"compat,omitempty"` // semver range for hydris version compatibility
}

PluginInfo describes a single plugin in the registry.

Jump to

Keyboard shortcuts

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