agent/pkg/brain/register.go
Snider 4e69daf2da feat: replace initServices() with core.New() service conclave
Services are now registered during Core construction:
  core.New(
      core.WithService(agentic.Register),
      core.WithService(monitor.Register),
      core.WithService(brain.Register),
  )

- Remove initServices() closure — services created once in conclave
- Commands use c.ServiceStartup()/c.ServiceShutdown() for lifecycle
- Service instances retrieved via c.Config() for MCP tool registration
- run/orchestrator reduced to ServiceStartup + block + ServiceShutdown
- run/task uses conclave's agentic instance

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-24 16:33:04 +00:00

24 lines
491 B
Go

// SPDX-License-Identifier: EUPL-1.2
package brain
import (
core "dappco.re/go/core"
)
// Register is the service factory for core.WithService.
// Brain has no lifecycle hooks — it's a stateless API proxy.
//
// core.New(
// core.WithService(brain.Register),
// )
func Register(c *core.Core) core.Result {
brn := NewDirect()
c.Service("brain", core.Service{})
// Store instance for MCP tool registration
c.Config().Set("brain.instance", brn)
return core.Result{OK: true}
}