Files
HomeAgent/internal/sdk/supervisor.go
JianFeeeee 4e70b8d5d8 refactor(module): 核心仓 Go module 路径改为 github.com/JianFeeeee/HologramAgent
批 1,不含 SDK 仓与目录改名。

- go.mod 第 1 行 module 路径
- 366 个 .go 文件的完整前缀 github.com/JianFeeeee/HomeAgent 机械替换
  (857 处,仅完整前缀;展示名/注释里的 HomeAgent 字样留给批 5)
- 未改:third_party 目录名、SDK 自身 go.mod module、go.mod replace 目标、
  homed/waiter 可执行名、.hmap 后缀
2026-10-21 12:17:19 +08:00

28 lines
943 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package sdk
import (
"time"
"github.com/JianFeeeee/HologramAgent/pkg/types"
)
// SupervisorAPI provides access to agent lifecycle management.
type SupervisorAPI interface {
ListAgents() []AgentStatus
GetAgentStatus(id string) (*AgentStatus, error)
PreActionSnapshot(id string) (*types.Snapshot, error)
RollbackAgent(id string, snapID string) error
// Restart 主动请求重建本单元(热更新入口:换二进制后不必 systemctl restart)。
Restart(id string) error
}
// AgentStatus is a neutral snapshot of a supervised agent.
type AgentStatus struct {
ID types.AgentID `json:"id"`
State types.AgentState `json:"state"`
Health types.HealthStatus `json:"health"`
Uptime time.Duration `json:"uptime,omitempty"`
Network types.NetworkCheckResult `json:"network,omitempty"`
TrackerStats map[string]interface{} `json:"tracker_stats,omitempty"`
}