Documentation
¶
Overview ¶
Package contextguru is an outbound AuthBridge plugin that compacts an agent's LLM request context before it is forwarded upstream, using the embedded github.com/rossoctl/context-guru engine. It runs in the pre-LLM hook (OnRequest): it hands the outbound request body to apply.BodyWithModel, and if the engine rewrote it (dropped/reduced tool outputs, injected cache_control, etc.) it replaces the body via pctx.SetBody. OnResponse is a pass-through in v1 — model-driven restoration/expand is a later integration.
It is the single outbound WritesRequestBody plugin, so it is mutually exclusive with SPARC on the outbound chain (the pipeline refuses to build with two). It declares RequiresAny: [inference-parser] so a parser establishes the request is an inference call before it runs.
LLM-backed engine components (summarize, extract:code) are optional: configure a `model:` block to enable a static cheap model, and the plugin also reconstructs the agent's own "incoming" model from the live request so a component with model.source: incoming can reuse it. With no model available those components degrade to deterministic/no-op.
Index ¶
- type ContextGuru
- func (p *ContextGuru) Capabilities() pipeline.PluginCapabilities
- func (p *ContextGuru) ConfigSchema() []pipeline.FieldSchema
- func (p *ContextGuru) Configure(raw json.RawMessage) error
- func (p *ContextGuru) Name() string
- func (p *ContextGuru) OnRequest(ctx context.Context, pctx *pipeline.Context) pipeline.Action
- func (p *ContextGuru) OnResponse(_ context.Context, _ *pipeline.Context) pipeline.Action
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContextGuru ¶
type ContextGuru struct {
// contains filtered or unexported fields
}
ContextGuru is the plugin. pipe/store are built once at Configure and shared across requests (store is synchronized; the engine holds no mutable pipeline state). static is the configured cheap model (nil when none).
func (*ContextGuru) Capabilities ¶
func (p *ContextGuru) Capabilities() pipeline.PluginCapabilities
func (*ContextGuru) ConfigSchema ¶
func (p *ContextGuru) ConfigSchema() []pipeline.FieldSchema
ConfigSchema surfaces the operator-facing fields in abctl / /v1/plugins.
func (*ContextGuru) Configure ¶
func (p *ContextGuru) Configure(raw json.RawMessage) error
func (*ContextGuru) Name ¶
func (p *ContextGuru) Name() string
func (*ContextGuru) OnResponse ¶
OnResponse is a pass-through in v1. The model-driven expand loop (resolve markers from the Store + re-invoke upstream via llmclient) would live here in a later integration; the Store + session key are already threaded for it.