Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExecutePipeline ¶
func ExecutePipeline( ctx context.Context, req *model.PipelineRequest, stages []Stage, queue *FIFOQueue, auditFn func(*model.AuditEntry), rateLimitRecordFn func(agentID, toolName string), ) (*model.Response, error)
ExecutePipeline runs a tools/call request through ACL → RateLimit → Approval → Queue → Forward → Audit.
Types ¶
type ACL ¶
type ACL struct {
// contains filtered or unexported fields
}
ACL checks whether an agent is allowed to call a specific tool on a backend.
func (*ACL) Process ¶
func (a *ACL) Process(_ context.Context, req *model.PipelineRequest) (*model.StageResult, error)
Process checks whether the agent is allowed to call the specified tool.
type ApprovalGate ¶
type ApprovalGate struct {
// contains filtered or unexported fields
}
ApprovalGate blocks destructive operations until human approval.
func NewApprovalGate ¶
func NewApprovalGate(cfgMgr *config.Manager, store *approval.Store) *ApprovalGate
NewApprovalGate creates an approval gate stage.
func (*ApprovalGate) Name ¶
func (a *ApprovalGate) Name() string
Name returns the stage name for audit logging.
func (*ApprovalGate) Process ¶
func (a *ApprovalGate) Process(ctx context.Context, req *model.PipelineRequest) (*model.StageResult, error)
Process blocks until the request is approved, rejected, or times out.
type FIFOQueue ¶
type FIFOQueue struct {
// contains filtered or unexported fields
}
FIFOQueue serializes tool calls per backend with random delays.
func NewFIFOQueue ¶
func NewFIFOQueue(cfgMgr *config.Manager, forward ForwardFunc) *FIFOQueue
NewFIFOQueue creates a queue with per-backend workers.
func (*FIFOQueue) Enqueue ¶
func (q *FIFOQueue) Enqueue(ctx context.Context, req *model.PipelineRequest) (*model.Response, int, error)
Enqueue adds a request to the backend's FIFO queue and blocks until execution. Returns the backend response or an error if the queue is full/context cancelled.
func (*FIFOQueue) QueueStatus ¶
QueueStatus returns the current pending count per backend.
type ForwardFunc ¶
type ForwardFunc func(ctx context.Context, backendID string, rpcReq *model.Request, sessionID string) (*model.Response, string, error)
ForwardFunc sends a JSON-RPC request to the backend and returns the response.
type RateLimiter ¶
type RateLimiter struct {
// contains filtered or unexported fields
}
RateLimiter enforces per-agent per-tool and global per-tool sliding window rate limits.
func NewRateLimiter ¶
func NewRateLimiter(cfgMgr *config.Manager, logger *audit.Logger) *RateLimiter
NewRateLimiter creates a rate limiter stage using audit log counts.
func (*RateLimiter) Name ¶
func (r *RateLimiter) Name() string
Name returns the stage name for audit logging.
func (*RateLimiter) Process ¶
func (r *RateLimiter) Process(_ context.Context, req *model.PipelineRequest) (*model.StageResult, error)
Process checks global and per-agent sliding window rate limits.
type Stage ¶
type Stage interface {
Name() string
Process(ctx context.Context, req *model.PipelineRequest) (*model.StageResult, error)
}
Stage processes a request and returns a verdict.