feat: create execute command

This commit is contained in:
2026-05-11 17:40:02 +03:00
parent d27eff2c57
commit 6046b8ae9d
5 changed files with 93 additions and 22 deletions
@@ -20,3 +20,22 @@ func toCreateHeartbeatModel(agentID string, heartbeat *pb.AgentEvent_Heartbeat)
},
}
}
func toGRPCCommandRequest(request domainHub.AgentRequest) pb.ServerCommandRequest {
return pb.ServerCommandRequest{
RequestId: request.RequestID,
Name: request.Name,
TimeoutSeconds: int64(request.TimeOut),
Args: request.Args,
}
}
func toAgentResponse(response *pb.AgentEvent_CommandResponse) domainHub.AgentResponse {
return domainHub.AgentResponse{
RequestID: response.CommandResponse.RequestId,
Success: response.CommandResponse.Success,
Error: response.CommandResponse.Error,
Output: response.CommandResponse.Output,
ExecTimeMS: int(response.CommandResponse.ExecTimeMs),
}
}