diff --git a/cmd/core-agent/main.go b/cmd/core-agent/main.go index 34be9a4..b9e6e4d 100644 --- a/cmd/core-agent/main.go +++ b/cmd/core-agent/main.go @@ -19,7 +19,7 @@ import ( func main() { r := core.New( - core.WithOptions(core.Options{{Key: "name", Value: "core-agent"}}), + core.WithOption("name", "core-agent"), core.WithService(agentic.Register), core.WithService(monitor.Register), core.WithService(brain.Register), diff --git a/pkg/agentic/prep_test.go b/pkg/agentic/prep_test.go index 84628f7..83c2c2f 100644 --- a/pkg/agentic/prep_test.go +++ b/pkg/agentic/prep_test.go @@ -190,7 +190,7 @@ func TestSetCore_Good(t *testing.T) { s := &PrepSubsystem{} assert.Nil(t, s.core) - c := core.New(core.WithOptions(core.Options{{Key: "name", Value: "test"}})).Value.(*core.Core) + c := core.New(core.WithOption("name", "test")).Value.(*core.Core) s.SetCore(c) assert.NotNil(t, s.core) } diff --git a/pkg/agentic/register.go b/pkg/agentic/register.go index 4fabe2a..fbac008 100644 --- a/pkg/agentic/register.go +++ b/pkg/agentic/register.go @@ -7,8 +7,9 @@ import ( ) // Register is the service factory for core.WithService. -// Creates the PrepSubsystem, registers it via RegisterService (auto-discovers -// Startable/Stoppable), loads config, and wires IPC handlers. +// Returns the PrepSubsystem instance — WithService auto-discovers the name +// from the package path and registers it. Startable/Stoppable/HandleIPCEvents +// are auto-discovered by RegisterService. // // core.New( // core.WithService(agentic.Register), @@ -23,9 +24,6 @@ func Register(c *core.Core) core.Result { c.Config().Set("agents.rates", cfg.Rates) c.Config().Set("agents.dispatch", cfg.Dispatch) - // Register instance — lifecycle hooks wired via Startable/Stoppable if implemented - c.RegisterService("agentic", prep) - RegisterHandlers(c, prep) return core.Result{Value: prep, OK: true} diff --git a/pkg/brain/register.go b/pkg/brain/register.go index fe168a5..951d353 100644 --- a/pkg/brain/register.go +++ b/pkg/brain/register.go @@ -7,13 +7,12 @@ import ( ) // Register is the service factory for core.WithService. -// Brain is a stateless API proxy — no lifecycle hooks. +// Returns the DirectSubsystem — WithService auto-registers it. // // core.New( // core.WithService(brain.Register), // ) func Register(c *core.Core) core.Result { brn := NewDirect() - c.RegisterService("brain", brn) return core.Result{Value: brn, OK: true} } diff --git a/pkg/monitor/register.go b/pkg/monitor/register.go index 1f0e838..f342174 100644 --- a/pkg/monitor/register.go +++ b/pkg/monitor/register.go @@ -8,8 +8,7 @@ import ( ) // Register is the service factory for core.WithService. -// Creates the monitor subsystem, registers via RegisterService, -// and wires IPC handlers for agent lifecycle events. +// Returns the monitor Subsystem — WithService auto-registers it. // // core.New( // core.WithService(monitor.Register), @@ -18,8 +17,6 @@ func Register(c *core.Core) core.Result { mon := New() mon.core = c - c.RegisterService("monitor", mon) - // Register IPC handler for agent lifecycle events c.RegisterAction(func(c *core.Core, msg core.Message) core.Result { switch ev := msg.(type) {