agent/cmd/core-agent/main.go
Snider 0fc6eeb4cc feat(runner): extract dispatch runner into independent Core service
Moves concurrency, queue drain, workspace lifecycle, and frozen state
from agentic/prep into pkg/runner/ — a standalone Core service that
communicates via IPC Actions only.

- runner.Register wires Actions: dispatch, status, start, stop, kill, poke
- runner.HandleIPCEvents catches AgentCompleted → ChannelPush + queue poke
- Agentic dispatch asks runner for permission via c.Action("runner.dispatch")
- Dispatch mutex moved to struct-level sync.Mutex (fixes core.Lock init race)
- Registry-based concurrency counting replaces disk scanning
- TrackWorkspace called on both queued and running status writes
- SpawnQueued message added for runner→agentic spawn requests
- ChannelPush message in core/mcp enables any service to push channel events
- 51 new tests covering runner service, queue, and config parsing

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-26 11:00:47 +00:00

44 lines
1 KiB
Go

package main
import (
"dappco.re/go/core"
"dappco.re/go/agent/pkg/agentic"
"dappco.re/go/agent/pkg/brain"
"dappco.re/go/agent/pkg/monitor"
"dappco.re/go/agent/pkg/runner"
"dappco.re/go/mcp/pkg/mcp"
)
func main() {
// Set log level early — before ServiceStartup to suppress startup noise.
// --quiet/-q reduces to errors only, --debug shows everything.
applyLogLevel()
c := core.New(
core.WithOption("name", "core-agent"),
core.WithService(agentic.ProcessRegister),
core.WithService(agentic.Register),
core.WithService(runner.Register),
core.WithService(monitor.Register),
core.WithService(brain.Register),
core.WithService(mcp.Register),
)
c.App().Version = appVersion()
c.Cli().SetBanner(func(_ *core.Cli) string {
return core.Concat("core-agent ", c.App().Version, " — agentic orchestration for the Core ecosystem")
})
registerAppCommands(c)
c.Run()
}
// appVersion returns the build version or "dev".
func appVersion() string {
if version != "" {
return version
}
return "dev"
}