fix: initialise go-process for dispatch, fix Notification hook matcher

Co-Authored-By: Virgil <virgil@lethean.io>
This commit is contained in:
Snider 2026-03-17 03:22:34 +00:00
parent 58749c87f8
commit cb56cfb270
2 changed files with 16 additions and 3 deletions

View file

@ -105,7 +105,7 @@
],
"Notification": [
{
"matcher": "idle_prompt",
"matcher": "notification_type == \"idle_prompt\"",
"hooks": [
{
"type": "command",

View file

@ -6,6 +6,8 @@ import (
"forge.lthn.ai/core/agent/pkg/agentic"
"forge.lthn.ai/core/agent/pkg/brain"
"forge.lthn.ai/core/cli/pkg/cli"
"forge.lthn.ai/core/go-process"
"forge.lthn.ai/core/go/pkg/core"
"forge.lthn.ai/core/mcp/pkg/mcp"
)
@ -18,7 +20,18 @@ func main() {
}
mcpCmd := cli.NewCommand("mcp", "Start the MCP server on stdio", "", func(cmd *cli.Command, args []string) error {
svc, err := mcp.New(
// Initialise go-process so dispatch can spawn agents
c, err := core.New(core.WithName("process", process.NewService(process.Options{})))
if err != nil {
return cli.Wrap(err, "init core")
}
procSvc, err := core.ServiceFor[*process.Service](c, "process")
if err != nil {
return cli.Wrap(err, "get process service")
}
process.SetDefault(procSvc)
mcpSvc, err := mcp.New(
mcp.WithSubsystem(brain.NewDirect()),
mcp.WithSubsystem(agentic.NewPrep()),
)
@ -26,7 +39,7 @@ func main() {
return cli.Wrap(err, "create MCP service")
}
return svc.Run(cmd.Context())
return mcpSvc.Run(cmd.Context())
})
cli.RootCmd().AddCommand(mcpCmd)