mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-09-11 14:00:29 +00:00
feat: Agent reports CommandsEnabled status to server. Related to #903
- Add CommandsEnabled field to AgentInfo in pkg/agents/host/report.go - Agent now reports whether AI command execution is enabled - Server stores and exposes this via Host model - Frontend can now show which agents have commands enabled - This provides visibility before implementing remote configuration
This commit is contained in:
@@ -437,6 +437,7 @@ export interface Host {
|
||||
lastSeen: number;
|
||||
intervalSeconds?: number;
|
||||
agentVersion?: string;
|
||||
commandsEnabled?: boolean; // Whether AI command execution is enabled on this agent
|
||||
tokenId?: string;
|
||||
tokenName?: string;
|
||||
tokenHint?: string;
|
||||
|
||||
@@ -360,6 +360,7 @@ func (a *Agent) buildReport(ctx context.Context) (agentshost.Report, error) {
|
||||
IntervalSeconds: int(a.interval / time.Second),
|
||||
Hostname: a.hostname,
|
||||
UpdatedFrom: a.updatedFrom,
|
||||
CommandsEnabled: a.cfg.EnableCommands,
|
||||
},
|
||||
Host: agentshost.HostInfo{
|
||||
ID: a.machineID,
|
||||
|
||||
@@ -181,6 +181,7 @@ type Host struct {
|
||||
IntervalSeconds int `json:"intervalSeconds,omitempty"`
|
||||
LastSeen time.Time `json:"lastSeen"`
|
||||
AgentVersion string `json:"agentVersion,omitempty"`
|
||||
CommandsEnabled bool `json:"commandsEnabled,omitempty"` // Whether AI command execution is enabled
|
||||
TokenID string `json:"tokenId,omitempty"`
|
||||
TokenName string `json:"tokenName,omitempty"`
|
||||
TokenHint string `json:"tokenHint,omitempty"`
|
||||
|
||||
@@ -2178,6 +2178,7 @@ func (m *Monitor) ApplyHostReport(report agentshost.Report, tokenRecord *config.
|
||||
IntervalSeconds: report.Agent.IntervalSeconds,
|
||||
LastSeen: timestamp,
|
||||
AgentVersion: strings.TrimSpace(report.Agent.Version),
|
||||
CommandsEnabled: report.Agent.CommandsEnabled,
|
||||
Tags: append([]string(nil), report.Tags...),
|
||||
IsLegacy: isLegacyHostAgent(report.Agent.Type),
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ type AgentInfo struct {
|
||||
IntervalSeconds int `json:"intervalSeconds,omitempty"`
|
||||
Hostname string `json:"hostname,omitempty"`
|
||||
UpdatedFrom string `json:"updatedFrom,omitempty"` // Previous version if recently auto-updated
|
||||
CommandsEnabled bool `json:"commandsEnabled,omitempty"` // Whether AI command execution is enabled
|
||||
}
|
||||
|
||||
// HostInfo contains platform and identification details about the monitored host.
|
||||
|
||||
Reference in New Issue
Block a user