agent/pkg/brain/register.go
Snider 919dcf963f feat: factories return instances — WithService handles registration
Register factories no longer call c.RegisterService() explicitly.
WithService auto-discovers name from package path and registers.
Eliminates double-registration error.

Uses WithOption("name", "core-agent") for Options struct.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-24 20:36:17 +00:00

18 lines
382 B
Go

// SPDX-License-Identifier: EUPL-1.2
package brain
import (
core "dappco.re/go/core"
)
// Register is the service factory for core.WithService.
// Returns the DirectSubsystem — WithService auto-registers it.
//
// core.New(
// core.WithService(brain.Register),
// )
func Register(c *core.Core) core.Result {
brn := NewDirect()
return core.Result{Value: brn, OK: true}
}