Versions in this module Expand all Collapse all v0 v0.1.96 Sep 22, 2026 v0.1.95 Sep 20, 2026 v0.1.94 Sep 18, 2026 v0.1.93 Sep 16, 2026 v0.1.92 Sep 15, 2026 Changes in this version type Instance + func (i *Instance) EditsContent() bool v0.1.91 Sep 11, 2026 Changes in this version + const HealthDegraded + const HealthOK + const PluginHTTPTimeout + var DefaultHTTPClient = sync.OnceValue(func() *http.Client { ... }) type DecisionRecord + Dropped int + Duration time.Duration + FailedClosed bool + Replaced int + Step int + Type string + func DecisionRecordsOf(phase pluginapi.Kind, outcome Outcome, runErr error) []DecisionRecord + type Health struct + CheckedAt time.Time + Error string + Status string + func (h Health) Degraded() bool type HostDeps + HTTP *http.Client type Instance + func (i *Instance) CheckHealth(ctx context.Context) Health + func (i *Instance) Checks() bool + func (i *Instance) Health() Health type Record + Step int + Type string type RequestState + func (s *RequestState) NoStore() bool v0.1.90 Sep 8, 2026 Changes in this version + const CodeBlocked + const CodePluginFailure + const CodeWarn + const GuardrailHeader + const SecretMask + var ErrAbandoned = errors.New("plugin call abandoned") + var ErrHistoryUnavailable = errors.New("plugins: history is not available in this host version") + var ErrInferenceUnavailable = errors.New("plugins: internal inference is not available") + var ErrInstanceClosed = errors.New("plugins: instance is closed") + var ErrRouteResolverClosed = errors.New("plugins: routing-strategy resolver is closed") + var PhaseKinds = []pluginapi.Kind + func Abandoned(err error) bool + func BlockError(d pluginapi.Decision, defaultStatus int) *core.GatewayError + func Call[T any](ctx context.Context, inst *Instance, fn func(context.Context) (T, error)) (T, error) + func ComputeChainHash(rules []RuleDescriptor) string + func ConfigHash(raw json.RawMessage) string + func DefaultBlockStatus(phase pluginapi.Kind) int + func FailureError(err error) *core.GatewayError + func ImplementedKinds(p pluginapi.Plugin) []pluginapi.Kind + func IsPhaseKind(kind pluginapi.Kind) bool + func MergeDecision(current, next pluginapi.Decision) pluginapi.Decision + func MergeSecrets(schema []pluginapi.Field, incoming, stored json.RawMessage) json.RawMessage + func MetaFromContext(ctx context.Context, workflow *core.Workflow) pluginapi.Meta + func NewHost(deps HostDeps, info HostInfo) pluginapi.Host + func NormalizeDecision(d pluginapi.Decision) pluginapi.Decision + func PromptEditCaptureEnabled(ctx context.Context) bool + func RedactSecrets(schema []pluginapi.Field, raw json.RawMessage) json.RawMessage + func RoutePluginNames(catalog *Catalog) []string + func SchemaDefaults(schema []pluginapi.Field) json.RawMessage + func Severity(action pluginapi.Action) int + func ValidateConfig(schema []pluginapi.Field, raw json.RawMessage, scope pluginapi.FieldScope) (json.RawMessage, error) + func WarnHeaderValue(d pluginapi.Decision) string + func WithAttempts(meta pluginapi.Meta, attempts []Attempt) pluginapi.Meta + func WithPromptEditCapture(ctx context.Context) context.Context + type Attempt struct + Duration time.Duration + ErrorCode string + Kind string + Model string + ProviderName string + ProviderType string + Seq int + StatusCode int + Success bool + type Catalog struct + func NewCatalog() *Catalog + func (c *Catalog) Entries() []Entry + func (c *Catalog) Len() int + func (c *Catalog) Lookup(name string) (Entry, bool) + func (c *Catalog) Names() []string + func (c *Catalog) Register(factory Factory, source Source, options ...RegisterOptions) (err error) + func (c *Catalog) RegisterFailed(name string, source Source, err error) + type Chain struct + Hash string + Phase pluginapi.Kind + Steps []Step + func BuildChain(phase pluginapi.Kind, refs []Ref) (*Chain, error) + func (c *Chain) Acquire() + func (c *Chain) Empty() bool + func (c *Chain) Instances() []*Instance + func (c *Chain) Len() int + func (c *Chain) Release() + func (c *Chain) RunPrompt(ctx context.Context, x *pluginapi.Exchange) (Outcome, error) + func (c *Chain) RunPromptObserved(ctx context.Context, x *pluginapi.Exchange, observe EditObserver) (Outcome, error) + func (c *Chain) RunResponse(ctx context.Context, x *pluginapi.Exchange) (Outcome, error) + func (c *Chain) RunStreamEnd(ctx context.Context, x *pluginapi.Exchange) (Outcome, error) + func (c *Chain) StepsOf() []Step + type Chains struct + Prompt *Chain + Response *Chain + Stream *Chain + func (c *Chains) Acquire() + func (c *Chains) CacheHash() string + func (c *Chains) Empty() bool + func (c *Chains) Hashes() map[string]string + func (c *Chains) PromptHash() string + func (c *Chains) Release() + type ChatCompleter interface + ChatCompletion func(ctx context.Context, req *core.ChatRequest) (*core.ChatResponse, error) + type DecisionRecord struct + BytesAfter int + BytesBefore int + Decision pluginapi.Decision + Edited bool + Err error + Instance string + Phase pluginapi.Kind + type EditObserver func(instance string, x *pluginapi.Exchange) + type Entry struct + Err error + Factory Factory + Health string + Kinds []pluginapi.Kind + Manifest pluginapi.Manifest + Name string + SingleInstance bool + Source Source + func (e Entry) HasKind(kind pluginapi.Kind) bool + type Factory func() pluginapi.Plugin + type FailMode string + const FailClosed + const FailOpen + func DefaultFailMode(phase pluginapi.Kind) FailMode + func ParseFailMode(raw string) (FailMode, error) + type HostDeps struct + Chat ChatCompleter + Logger *slog.Logger + Metrics MetricsSink + type HostInfo struct + InstanceName string + PluginName string + UserPath string + type Instance struct + ConfigHash string + FailMode FailMode + Kinds []pluginapi.Kind + Manifest pluginapi.Manifest + Name string + Plugin pluginapi.Plugin + Timeout time.Duration + Type string + func NewInstance(ctx context.Context, entry Entry, spec InstanceSpec, host pluginapi.Host) (inst *Instance, err error) + func (i *Instance) Acquire() + func (i *Instance) Close(ctx context.Context) (err error) + func (i *Instance) Closed() bool + func (i *Instance) EffectiveFailMode(phase pluginapi.Kind) FailMode + func (i *Instance) FailsOpen(phase pluginapi.Kind, err error, shared bool) bool + func (i *Instance) HasKind(kind pluginapi.Kind) bool + func (i *Instance) Held() bool + func (i *Instance) Mutates() bool + func (i *Instance) Release() + func (i *Instance) StreamPolicy() (policy pluginapi.StreamPolicy) + type InstanceSpec struct + Config json.RawMessage + FailMode FailMode + Name string + Timeout time.Duration + type MetricsSink interface + Inc func(name string, labels map[string]string) + Observe func(name string, value float64, labels map[string]string) + type Outcome struct + Decision pluginapi.Decision + Instance string + Records []Record + type PluginError struct + Err error + Instance string + Phase pluginapi.Kind + func (e *PluginError) Error() string + func (e *PluginError) Unwrap() error + type PromptEdit struct + Apply func() (any, error) + Instance string + type Record struct + Decision pluginapi.Decision + Duration time.Duration + Edited bool + Err error + Instance string + type Ref struct + Instance *Instance + Step int + type RegisterOptions struct + SingleInstance bool + type RequestState struct + Decisions []DecisionRecord + ResponseHeaders http.Header + Values pluginapi.Values + func NewRequestState() *RequestState + func RequestStateFor(ctx context.Context) *RequestState + func RequestStateFromContext(ctx context.Context) *RequestState + func WithRequestState(ctx context.Context) (context.Context, *RequestState) + func (s *RequestState) AddPromptEdit(edit PromptEdit) + func (s *RequestState) AddResponseHeader(key, value string) + func (s *RequestState) ApplyRequestHeaders(dst http.Header) []string + func (s *RequestState) ApplyResponseHeaders(dst http.Header) + func (s *RequestState) Finish(x *pluginapi.Exchange) + func (s *RequestState) NewExchange(ctx context.Context, meta pluginapi.Meta) *pluginapi.Exchange + func (s *RequestState) PromptEdits() []PromptEdit + func (s *RequestState) Record(records ...DecisionRecord) + func (s *RequestState) Snapshot() []DecisionRecord + type RouteConfigSource func(name string) (json.RawMessage, bool) + type RouteResolver struct + func NewRouteResolver(catalog *Catalog, deps HostDeps) *RouteResolver + func (r *RouteResolver) Close(ctx context.Context) error + func (r *RouteResolver) Names() []string + func (r *RouteResolver) Release(inst *Instance) + func (r *RouteResolver) ReportOutcome(outcome pluginapi.RouteOutcome) + func (r *RouteResolver) SetInstanceConfigs(source RouteConfigSource) + func (r *RouteResolver) Strategy(name string) (pluginapi.RouteStrategy, *Instance, error) + func (r *RouteResolver) ValidateRouteConfig(name string, cfg map[string]any) (json.RawMessage, error) + type RuleDescriptor struct + Content string + Mode string + Name string + Order int + Type string + type ShortCircuit struct + Completion *pluginapi.Completion + Decision pluginapi.Decision + Instance string + func (e *ShortCircuit) Error() string + type Source string + const SourceBuiltin + const SourceRegistered + type Step struct + Instances []*Instance + Order int