Documentation
¶
Overview ¶
Package interceptor implements the fail-closed AfterAuth request pipeline.
Index ¶
Constants ¶
const HostCallbackIDMetadataKey = "__deepseek_vision_host_callback_id"
Variables ¶
Functions ¶
func HandleUnavailable ¶
func HandleUnavailable(req pluginapi.RequestInterceptRequest, targetModels ...string) (pluginapi.RequestInterceptResponse, error)
HandleUnavailable is the lifecycle fallback used while no generation is configured (including after shutdown). It preserves non-target traffic but terminates image-shaped Responses requests for the configured target models so an absent callback handler cannot turn a security boundary into host-level passthrough.
Types ¶
type AnalyzerFactory ¶
AnalyzerFactory constructs the thin host-model adapter for one immutable configuration snapshot. It is initialized lazily only for eligible images.
type DiagnosticFunc ¶
DiagnosticFunc emits bounded, content-free runtime diagnostics through the host. callbackID lets CLIProxyAPI attach its request ID when available.
type Runtime ¶
type Runtime struct {
// contains filtered or unexported fields
}
Runtime manages immutable generations and implements the plugin handler.
func NewRuntime ¶
func NewRuntime(factory AnalyzerFactory, diagnostics ...DiagnosticFunc) *Runtime
func NewRuntimeWithTrace ¶
func NewRuntimeWithTrace(factory AnalyzerFactory, trace *tracelog.Sink, diagnostics ...DiagnosticFunc) *Runtime
func (*Runtime) Handle ¶
func (r *Runtime) Handle(req pluginapi.RequestInterceptRequest) (resp pluginapi.RequestInterceptResponse, err error)
Handle is intentionally fail-closed: it always returns a concrete response and never returns a processing error to the host, because host adapters are allowed to fail open when callback errors are returned.
func (*Runtime) Reconfigure ¶
Reconfigure atomically publishes a new immutable snapshot. In-flight calls retain their previous state through ordinary Go references.