Documentation
¶
Overview ¶
Package kernel provides typed command dispatch for core engine operations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Register ¶
func Register[C any, R any](d *Dispatcher, h Handler[C, R])
Register stores one handler for the command type C.
func ValidateDefaultRegistry ¶
func ValidateDefaultRegistry(d *Dispatcher) error
ValidateDefaultRegistry ensures the default Phase A command set is registered.
Types ¶
type Dispatcher ¶
type Dispatcher struct {
// contains filtered or unexported fields
}
Dispatcher stores typed handlers keyed by command type.
func BuildDefault ¶
func BuildDefault(deps KernelDeps) *Dispatcher
BuildDefault constructs a dispatcher with all six Phase A command handlers registered.
func NewDispatcher ¶
func NewDispatcher() *Dispatcher
NewDispatcher constructs an empty typed dispatcher.
type HandlerTypeMismatchError ¶
type HandlerTypeMismatchError struct {
CommandType reflect.Type
ResultType reflect.Type
ActualHandlerType reflect.Type
}
HandlerTypeMismatchError reports a command dispatched with an incompatible result type for the registered handler.
func (*HandlerTypeMismatchError) Error ¶
func (e *HandlerTypeMismatchError) Error() string
Error implements error.
type KernelDeps ¶
type KernelDeps struct {
Logger *slog.Logger
EventBus *events.Bus[events.Event]
Workspace workspace.Context
AgentRegistry agent.RuntimeRegistry
// OpenRunScopeOptions controls whether executable extensions should be
// initialized for run-aware commands handled by this dispatcher.
OpenRunScopeOptions model.OpenRunScopeOptions
// contains filtered or unexported fields
}
KernelDeps groups shared infrastructure used by kernel handlers.
type UnregisteredHandlerError ¶
UnregisteredHandlerError reports a command type with no registered handler.
func (*UnregisteredHandlerError) Error ¶
func (e *UnregisteredHandlerError) Error() string
Error implements error.