reflect

package
v0.18.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 29, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PluginID    = "reflect"
	RuntimeName = "service"
)

Variables

This section is empty.

Functions

func DefaultPluginConfig

func DefaultPluginConfig() map[string]any

func NewManagedRuntime

func NewManagedRuntime(deps RuntimeDeps) pkgplugins.Runtime

func PluginConfigSchema

func PluginConfigSchema() map[string]any

func RedactPluginConfig

func RedactPluginConfig(raw map[string]any) map[string]any

func SetRuntimeFactoryForTesting

func SetRuntimeFactoryForTesting(factory func(platform pkgplugins.Platform) (pkgplugins.Runtime, error)) func()

Types

type Config

type Config struct {
	StateStore pkgplugins.StateStore
	Memory     memory.Provider
	Store      pkgplugins.ReflectStore
	SkillStore pkgplugins.SkillStore
	Notifier   pkgplugins.Notifier
	Workspace  string
	Interval   time.Duration
	Batch      int
	Log        *slog.Logger
	Providers  func(api, apiKey, baseURL string) (*providers.Registry, error)
}

Config holds dependencies for the reflect service.

type PluginConfig

type PluginConfig struct {
	Interval time.Duration
	Batch    int
}

func DecodePluginConfig

func DecodePluginConfig(raw map[string]any) (PluginConfig, error)

type RuntimeDeps

type RuntimeDeps struct {
	Services      pkgplugins.ReflectPlatform
	Notifications pkgplugins.Notifier
	StateStore    pkgplugins.StateStore
	SkillStore    pkgplugins.SkillStore
	Scheduler     pkgplugins.Scheduler
	Log           *slog.Logger
	NewService    func(Config) serviceRunner
	Now           func() time.Time
}

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service runs background conversation review.

func New

func New(cfg Config) *Service

New creates a new reflect service.

func (*Service) ReviewNow

func (s *Service) ReviewNow(ctx context.Context, agentID string) (int, error)

ReviewNow triggers an immediate review cycle for an agent. Returns the number of sessions reviewed.

func (*Service) RunOnce

func (s *Service) RunOnce(ctx context.Context)

RunOnce executes a single review cycle.

func (*Service) Start

func (s *Service) Start(ctx context.Context) error

Start runs the review loop. Blocks until ctx is cancelled.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL