Documentation
¶
Index ¶
- func NewSessionSpawner(sessions SessionManager, resolver workspacepkg.RuntimeResolver, ...) memory.SessionSpawner
- type CompletionObserver
- type Runtime
- func (r *Runtime) Enabled() bool
- func (r *Runtime) EnqueueCheck(reason string, workspaceRef string)
- func (r *Runtime) LastConsolidatedAt() (time.Time, error)
- func (r *Runtime) SetCompletionObserver(observer CompletionObserver)
- func (r *Runtime) Shutdown()
- func (r *Runtime) Start(parent context.Context)
- func (r *Runtime) Trigger(ctx context.Context, workspace string) (bool, string, error)
- type Service
- type ServiceFactory
- type SessionManager
- type SessionRoute
- type SessionRouteResolver
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewSessionSpawner ¶
func NewSessionSpawner( sessions SessionManager, resolver workspacepkg.RuntimeResolver, memoryEnabled bool, resolveRoute SessionRouteResolver, ) memory.SessionSpawner
NewSessionSpawner creates dream sessions against one or more eligible workspaces.
Types ¶
type CompletionObserver ¶
type CompletionObserver func(context.Context, memory.ConsolidationResult) error
CompletionObserver receives successful consolidation results after their memory transaction and lock release have completed.
type Runtime ¶
type Runtime struct {
// contains filtered or unexported fields
}
Runtime owns dream scheduling, trigger behavior, and session spawning.
func NewRuntime ¶
func NewRuntime( enabled func() bool, service Service, spawner memory.SessionSpawner, interval time.Duration, logger *slog.Logger, lastConsolidatedAt func() (time.Time, error), ) *Runtime
NewRuntime constructs a dream runtime that can be started by the daemon.
func (*Runtime) EnqueueCheck ¶
EnqueueCheck requests a background dream check without blocking.
func (*Runtime) LastConsolidatedAt ¶
LastConsolidatedAt returns the most recent lock timestamp.
func (*Runtime) SetCompletionObserver ¶
func (r *Runtime) SetCompletionObserver(observer CompletionObserver)
SetCompletionObserver attaches the runtime consumer for successful consolidations.
func (*Runtime) Shutdown ¶
func (r *Runtime) Shutdown()
Shutdown stops the background dream check loop.
type Service ¶
type Service interface {
ShouldRun() (bool, error)
Run(ctx context.Context, spawn memory.SessionSpawner, workspace string) (memory.ConsolidationResult, error)
}
Service evaluates dream gates and coordinates lock-aware consolidation runs.
type ServiceFactory ¶
ServiceFactory constructs a consolidation service using memory package options.
type SessionManager ¶
type SessionManager interface {
Create(ctx context.Context, opts session.CreateOpts) (*session.Session, error)
ListAll(ctx context.Context) ([]*session.Info, error)
Prompt(ctx context.Context, id string, msg string) (<-chan acp.AgentEvent, error)
Stop(ctx context.Context, id string) error
}
SessionManager is the session lifecycle surface needed to spawn dream sessions.
type SessionRoute ¶
type SessionRoute struct {
Enabled bool
AgentName string
Provider string
Model string
ReasoningEffort string
Fallbacks []compozyconfig.RoleFallback
BeforeFallback func(context.Context, int, compozyconfig.RoleFallback) error
}
SessionRoute is the resolved dream-session route supplied by the daemon role resolver.
type SessionRouteResolver ¶
type SessionRouteResolver func(ctx context.Context, workspaceID string) (SessionRoute, error)
SessionRouteResolver resolves the dream route for one effective workspace config.