diff --git a/pkg/agentic/handlers.go b/pkg/agentic/handlers.go index 9d0c7de..fb77975 100644 --- a/pkg/agentic/handlers.go +++ b/pkg/agentic/handlers.go @@ -1,9 +1,5 @@ // SPDX-License-Identifier: EUPL-1.2 -// IPC handler for agent lifecycle events. -// Auto-discovered by Core's WithService via the HandleIPCEvents interface. -// No manual RegisterHandlers call needed — Core wires it during service registration. - package agentic import ( @@ -11,10 +7,9 @@ import ( core "dappco.re/go/core" ) -// HandleIPCEvents implements Core's IPC handler interface. -// Auto-registered by WithService — no manual wiring needed. +// HandleIPCEvents applies agent lifecycle messages to the prep subsystem. // -// _ = prep.HandleIPCEvents(c, messages.AgentCompleted{Workspace: "core/go-io/task-5"}) +// _ = prep.HandleIPCEvents(c, messages.AgentCompleted{Workspace: "core/go-io/task-5", Status: "completed"}) // _ = prep.HandleIPCEvents(c, messages.SpawnQueued{Workspace: "core/go-io/task-5", Agent: "codex", Task: "fix tests"}) func (s *PrepSubsystem) HandleIPCEvents(c *core.Core, msg core.Message) core.Result { switch ev := msg.(type) { diff --git a/pkg/agentic/prep.go b/pkg/agentic/prep.go index 100043b..ba89911 100644 --- a/pkg/agentic/prep.go +++ b/pkg/agentic/prep.go @@ -81,8 +81,7 @@ func NewPrep() *PrepSubsystem { } } -// SetCore wires the Core framework instance via ServiceRuntime. -// Deprecated: Use Register with core.WithService(agentic.Register) instead. +// Use core.New(core.WithService(agentic.Register)) for new code. // // prep.SetCore(c) func (s *PrepSubsystem) SetCore(c *core.Core) { diff --git a/pkg/agentic/process_register.go b/pkg/agentic/process_register.go index 87e6cfe..3f4f4e2 100644 --- a/pkg/agentic/process_register.go +++ b/pkg/agentic/process_register.go @@ -13,13 +13,8 @@ type processActionHandlers struct { service *process.Service } -// ProcessRegister is the service factory for go-process. -// Registers the process service under the canonical "process" name and exposes -// the Core `process.*` Actions expected by `c.Process()`. -// -// core.New( -// core.WithService(agentic.ProcessRegister), -// ) +// c := core.New(core.WithService(agentic.ProcessRegister)) +// processService, _ := core.ServiceFor[*process.Service](c, "process") func ProcessRegister(c *core.Core) core.Result { if c == nil { return core.Result{Value: core.E("agentic.ProcessRegister", "core is required", nil), OK: false} diff --git a/pkg/agentic/register.go b/pkg/agentic/register.go index c75bbda..4779e2b 100644 --- a/pkg/agentic/register.go +++ b/pkg/agentic/register.go @@ -6,14 +6,11 @@ import ( core "dappco.re/go/core" ) -// Register is the service factory for core.WithService. -// Returns the PrepSubsystem instance — WithService auto-discovers the name -// from the package path and registers it. -// -// core.New( +// c := core.New( // core.WithService(agentic.ProcessRegister), // core.WithService(agentic.Register), // ) +// prep, _ := core.ServiceFor[*agentic.PrepSubsystem](c, "agentic") func Register(c *core.Core) core.Result { subsystem := NewPrep() subsystem.ServiceRuntime = core.NewServiceRuntime(c, AgentOptions{}) @@ -36,8 +33,5 @@ func Register(c *core.Core) core.Result { c.Config().Enable("auto-merge") c.Config().Enable("auto-ingest") - // IPC handlers auto-discovered via HandleIPCEvents interface on PrepSubsystem. - // No manual RegisterHandlers call needed — WithService wires it. - return core.Result{Value: subsystem, OK: true} } diff --git a/pkg/brain/brain.go b/pkg/brain/brain.go index 6319af0..bc70662 100644 --- a/pkg/brain/brain.go +++ b/pkg/brain/brain.go @@ -47,8 +47,6 @@ func New(bridge *ide.Bridge) *Subsystem { return &Subsystem{bridge: bridge} } -// Name keeps the subsystem address stable for core.WithService and MCP. -// // name := subsystem.Name() // "brain" func (s *Subsystem) Name() string { return "brain" } diff --git a/pkg/brain/direct.go b/pkg/brain/direct.go index 73aac2c..dbeb466 100644 --- a/pkg/brain/direct.go +++ b/pkg/brain/direct.go @@ -56,8 +56,6 @@ func NewDirect() *DirectSubsystem { } } -// Name keeps the direct subsystem address stable for core.WithService and MCP. -// // name := subsystem.Name() // "brain" func (s *DirectSubsystem) Name() string { return "brain" } diff --git a/pkg/brain/provider.go b/pkg/brain/provider.go index 45b113c..735d495 100644 --- a/pkg/brain/provider.go +++ b/pkg/brain/provider.go @@ -47,8 +47,6 @@ func NewProvider(bridge *ide.Bridge, hub *ws.Hub) *BrainProvider { } } -// Name keeps the provider address stable during API registration. -// // name := p.Name() // "brain" func (p *BrainProvider) Name() string { return "brain" } diff --git a/pkg/monitor/monitor.go b/pkg/monitor/monitor.go index 487c422..f61fb6c 100644 --- a/pkg/monitor/monitor.go +++ b/pkg/monitor/monitor.go @@ -80,7 +80,7 @@ type Subsystem struct { var _ coremcp.Subsystem = (*Subsystem)(nil) -// Deprecated: prefer Register with core.WithService(monitor.Register). +// Use core.New(core.WithService(monitor.Register)) for new code. // // monitorService.SetCore(c) func (m *Subsystem) SetCore(coreApp *core.Core) { diff --git a/pkg/runner/runner.go b/pkg/runner/runner.go index 860822e..e66908e 100644 --- a/pkg/runner/runner.go +++ b/pkg/runner/runner.go @@ -54,9 +54,8 @@ func New() *Service { } } -// Register is the service factory for core.WithService. -// -// core.New(core.WithService(runner.Register)) +// c := core.New(core.WithService(runner.Register)) +// service, _ := core.ServiceFor[*runner.Service](c, "runner") func Register(coreApp *core.Core) core.Result { service := New() service.ServiceRuntime = core.NewServiceRuntime(coreApp, Options{})