Codex 5.5 batch lane processed 26 open Mantis tickets. 13 stale-fixed, 4 implemented, 9 deferred. Tickets implemented: - #142 — agentic_sprint_start + agentic_sprint_complete MCP tools wired to /v1/sprints/{id}/{start,complete} platform endpoints with tests - #225 — cmd/core-agent/commands.go: removed raw flag parsing; startupArgs() uses Core arg filtering + local log-level strip - #226 — cmd/core-agent/main.go: syscall.Exit(1) → core.Exit(1) - #227 — pkg/agentic/dispatch.go: runtime.GOOS → Core environment-backed OS detection Tickets stale-fixed: #161, #162, #163, #166, #167, #168, #171, #172, #223, #224, #230, #231, #232, #233 Tickets deferred: #160, #164, #165, #173, #222, #228, #229, #234 Co-authored-by: Codex <noreply@openai.com> Closes tasks.lthn.sh/view.php?id=142 Closes tasks.lthn.sh/view.php?id=225 Closes tasks.lthn.sh/view.php?id=226 Closes tasks.lthn.sh/view.php?id=227
101 lines
2.4 KiB
Go
101 lines
2.4 KiB
Go
// SPDX-License-Identifier: EUPL-1.2
|
|
|
|
package main
|
|
|
|
import (
|
|
"context"
|
|
|
|
agentpkg "dappco.re/go/agent"
|
|
"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/agent/pkg/setup"
|
|
coremcp "dappco.re/go/mcp/pkg/mcp"
|
|
)
|
|
|
|
func main() {
|
|
if err := runCoreAgent(); err != nil {
|
|
core.Error("core-agent failed", "err", err)
|
|
core.Exit(1)
|
|
}
|
|
}
|
|
|
|
// app := newCoreAgent()
|
|
// core.Println(app.App().Name) // "core-agent"
|
|
// core.Println(app.App().Version) // "dev" or linked version
|
|
func newCoreAgent() *core.Core {
|
|
coreApp := 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(setup.Register),
|
|
core.WithService(coremcp.Register),
|
|
)
|
|
coreApp.App().Version = applicationVersion()
|
|
|
|
coreApp.Cli().SetBanner(func(_ *core.Cli) string {
|
|
return core.Concat("core-agent ", coreApp.App().Version, " — agentic orchestration for the Core ecosystem")
|
|
})
|
|
|
|
registerApplicationCommands(coreApp)
|
|
|
|
return coreApp
|
|
}
|
|
|
|
// agentpkg.Version = "0.15.0"
|
|
// applicationVersion() // "0.15.0"
|
|
func applicationVersion() string {
|
|
if agentpkg.Version != "" {
|
|
return agentpkg.Version
|
|
}
|
|
return "dev"
|
|
}
|
|
|
|
// if err := runCoreAgent(); err != nil {
|
|
// core.Error("core-agent failed", "err", err)
|
|
// }
|
|
func runCoreAgent() error {
|
|
return runApp(newCoreAgent(), startupArgs())
|
|
}
|
|
|
|
// app := newCoreAgent()
|
|
// _ = runApp(app, []string{"version"})
|
|
func runApp(coreApp *core.Core, cliArgs []string) error {
|
|
if coreApp == nil {
|
|
return core.E("main.runApp", "core is required", nil)
|
|
}
|
|
|
|
defer coreApp.ServiceShutdown(context.Background())
|
|
|
|
result := coreApp.ServiceStartup(coreApp.Context(), nil)
|
|
if !result.OK {
|
|
return resultError("main.runApp", "startup failed", result)
|
|
}
|
|
|
|
if cli := coreApp.Cli(); cli != nil {
|
|
result = cli.Run(cliArgs...)
|
|
if !result.OK {
|
|
return resultError("main.runApp", "cli failed", result)
|
|
}
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// result := core.Result{OK: false, Value: core.E("main.runApp", "startup failed", nil)}
|
|
// err := resultError("main.runApp", "startup failed", result)
|
|
func resultError(op, msg string, result core.Result) error {
|
|
if result.OK {
|
|
return nil
|
|
}
|
|
if err, ok := result.Value.(error); ok && err != nil {
|
|
return err
|
|
}
|
|
return core.E(op, msg, nil)
|
|
}
|