pluginhost

package
v7.2.38 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthModelResult

type AuthModelResult struct {
	Provider string
	Models   []ModelInfo
	Auth     *coreauth.Auth
	Handled  bool
	Err      error
}

AuthModelResult is the public result for per-auth model discovery.

type Host

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

Host wraps the internal plugin host behind a public SDK surface.

func New

func New() *Host

New creates a plugin host.

func (*Host) ApplyConfig

func (h *Host) ApplyConfig(ctx context.Context, cfg RuntimeConfig)

ApplyConfig applies plugin runtime configuration.

func (*Host) HasScheduler

func (h *Host) HasScheduler() bool

HasScheduler reports whether any active plugin provides a scheduler.

func (*Host) ModelsForAuth

func (h *Host) ModelsForAuth(ctx context.Context, auth *coreauth.Auth) AuthModelResult

ModelsForAuth lets plugin model providers discover auth-bound models.

func (*Host) ModelsForProvider

func (h *Host) ModelsForProvider(provider string) []ModelInfo

ModelsForProvider returns static models registered for a provider by plugins.

func (*Host) ParseAuth

func (h *Host) ParseAuth(ctx context.Context, req pluginapi.AuthParseRequest) (*coreauth.Auth, bool, error)

ParseAuth lets plugin auth providers parse a credential payload.

func (*Host) ParseAuths added in v7.2.36

func (h *Host) ParseAuths(ctx context.Context, req pluginapi.AuthParseRequest) ([]*coreauth.Auth, bool, error)

ParseAuths lets plugin auth providers expand one credential payload into multiple auth records.

func (*Host) PickAuth

PickAuth lets a scheduler plugin choose an auth candidate.

func (*Host) PluginBusy added in v7.2.36

func (h *Host) PluginBusy(id string) bool

PluginBusy reports whether a plugin dynamic library is loaded or being loaded.

func (*Host) RefreshAuth

func (h *Host) RefreshAuth(ctx context.Context, auth *coreauth.Auth) (*coreauth.Auth, bool, error)

RefreshAuth lets plugin auth providers refresh a credential.

func (*Host) ShutdownAll

func (h *Host) ShutdownAll()

ShutdownAll unloads every active plugin.

func (*Host) UnloadPlugin added in v7.2.36

func (h *Host) UnloadPlugin(id string) bool

UnloadPlugin removes one plugin from the active runtime and closes its dynamic library.

type ModelInfo

type ModelInfo = pluginapi.ModelInfo

ModelInfo describes a plugin-provided model using public plugin SDK types.

type OAuthModelAlias

type OAuthModelAlias struct {
	Name  string
	Alias string
	Fork  bool
}

OAuthModelAlias defines a model ID alias for OAuth/file-backed auth channels.

type PluginInstanceConfig

type PluginInstanceConfig struct {
	Enabled  *bool
	Priority int
	Raw      yaml.Node
}

PluginInstanceConfig stores host-owned plugin settings and the original plugin YAML subtree.

type RuntimeConfig

type RuntimeConfig struct {
	Enabled             bool
	Dir                 string
	AuthDir             string
	ProxyURL            string
	ForceModelPrefix    bool
	OAuthModelAlias     map[string][]OAuthModelAlias
	OAuthExcludedModels map[string][]string
	Configs             map[string]PluginInstanceConfig
}

RuntimeConfig is the public plugin host configuration used by embedders.

type ThinkingSupport

type ThinkingSupport = pluginapi.ThinkingSupport

ThinkingSupport describes plugin-provided thinking controls.

Jump to

Keyboard shortcuts

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