Versions in this module Expand all Collapse all v0 v0.1.2 Feb 27, 2026 v0.1.1 Feb 27, 2026 v0.1.0 Feb 24, 2026 Changes in this version + type Chain struct + func NewChain(mw []Middleware, opts ...ChainOption) *Chain + func (c *Chain) Execute(ctx context.Context, stage Stage, st *State) error + func (c *Chain) Use(m Middleware) + type ChainOption func(*Chain) + func WithTimeout(d time.Duration) ChainOption + type FileHTTPTraceWriter struct + func NewFileHTTPTraceWriter(dir string) (*FileHTTPTraceWriter, error) + func (w *FileHTTPTraceWriter) Close() error + func (w *FileHTTPTraceWriter) Path() string + func (w *FileHTTPTraceWriter) WriteHTTPTrace(event *HTTPTraceEvent) error + type Funcs struct + Identifier string + OnAfterAgent func(ctx context.Context, st *State) error + OnAfterModel func(ctx context.Context, st *State) error + OnAfterTool func(ctx context.Context, st *State) error + OnBeforeAgent func(ctx context.Context, st *State) error + OnBeforeModel func(ctx context.Context, st *State) error + OnBeforeTool func(ctx context.Context, st *State) error + func (f Funcs) AfterAgent(ctx context.Context, st *State) error + func (f Funcs) AfterModel(ctx context.Context, st *State) error + func (f Funcs) AfterTool(ctx context.Context, st *State) error + func (f Funcs) BeforeAgent(ctx context.Context, st *State) error + func (f Funcs) BeforeModel(ctx context.Context, st *State) error + func (f Funcs) BeforeTool(ctx context.Context, st *State) error + func (f Funcs) Name() string + type HTTPTraceEvent struct + LoggedAt string + Request HTTPTraceRequest + Response HTTPTraceResponse + type HTTPTraceMiddleware struct + func NewHTTPTraceMiddleware(writer HTTPTraceWriter, opts ...HTTPTraceOption) *HTTPTraceMiddleware + func (m *HTTPTraceMiddleware) Handler(next http.Handler) http.Handler + func (m *HTTPTraceMiddleware) Wrap(next http.Handler) http.Handler + type HTTPTraceOption func(*HTTPTraceMiddleware) + func WithHTTPTraceClock(clock func() time.Time) HTTPTraceOption + func WithHTTPTraceMaxBodyBytes(limit int64) HTTPTraceOption + type HTTPTraceRequest struct + Body any + Headers map[string]string + Method string + Timestamp float64 + URL string + type HTTPTraceResponse struct + BodyRaw string + Headers map[string]string + Status int + Timestamp float64 + type HTTPTraceWriter interface + WriteHTTPTrace func(event *HTTPTraceEvent) error + type Middleware interface + AfterAgent func(ctx context.Context, st *State) error + AfterModel func(ctx context.Context, st *State) error + AfterTool func(ctx context.Context, st *State) error + BeforeAgent func(ctx context.Context, st *State) error + BeforeModel func(ctx context.Context, st *State) error + BeforeTool func(ctx context.Context, st *State) error + Name func() string + type Stage int + const StageAfterAgent + const StageAfterModel + const StageAfterTool + const StageBeforeAgent + const StageBeforeModel + const StageBeforeTool + type State struct + Agent any + Iteration int + ModelInput any + ModelOutput any + ToolCall any + ToolResult any + Values map[string]any + func (st *State) SetModelInput(v any) + func (st *State) SetModelOutput(v any) + func (st *State) SetValue(key string, value any) + type TraceContextKey string + const SessionIDContextKey + const TraceSessionIDContextKey + type TraceEvent struct + DurationMS int64 + Error string + Input any + Iteration int + ModelRequest map[string]any + ModelResponse map[string]any + Output any + SessionID string + Stage string + Timestamp time.Time + ToolCall map[string]any + ToolResult map[string]any + type TraceMiddleware struct + func NewTraceMiddleware(outputDir string, opts ...TraceOption) *TraceMiddleware + func (m *TraceMiddleware) AfterAgent(ctx context.Context, st *State) error + func (m *TraceMiddleware) AfterModel(ctx context.Context, st *State) error + func (m *TraceMiddleware) AfterTool(ctx context.Context, st *State) error + func (m *TraceMiddleware) BeforeAgent(ctx context.Context, st *State) error + func (m *TraceMiddleware) BeforeModel(ctx context.Context, st *State) error + func (m *TraceMiddleware) BeforeTool(ctx context.Context, st *State) error + func (m *TraceMiddleware) Close() + func (m *TraceMiddleware) Name() string + type TraceOption func(*TraceMiddleware) + func WithSkillTracing(enabled bool) TraceOption