feat: add rebuild and restart functionality for agents, including build process and status reporting

This commit is contained in:
2026-03-06 00:13:15 +00:00
parent f2626f7007
commit d26be78c46
6 changed files with 127 additions and 4 deletions
+9
View File
@@ -379,6 +379,15 @@ func (m *Manager) PidPath(id string) string { return m.pidPath(id) }
// LogPath returns the path to the log file for an agent.
func (m *Manager) LogPath(id string) string { return m.logPath(id) }
// Build compiles all project binaries by running build.sh.
// Returns the combined output and any error.
func (m *Manager) Build() (string, error) {
cmd := exec.Command("bash", "build.sh")
cmd.Env = m.buildEnv()
out, err := cmd.CombinedOutput()
return string(out), err
}
// ── internal helpers ─────────────────────────────────────────────────────
func (m *Manager) pidPath(id string) string { return filepath.Join(m.runDir, id+".pid") }